rendered paste body
.text:00470C20 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
.text:00470C20
.text:00470C20
.text:00470C20 sub_470C20 proc near ; CODE XREF: sub_472840+B4p
.text:00470C20 ; sub_472840+CCp ...
.text:00470C20
.text:00470C20 var_8 = dword ptr -8
.text:00470C20 arg_0 = dword ptr 4
.text:00470C20 arg_4 = dword ptr 8
.text:00470C20 arg_8 = dword ptr 0Ch
.text:00470C20
.text:00470C20 sub esp, 8
.text:00470C23 push esi
.text:00470C24 mov esi, [esp+0Ch+arg_4]
.text:00470C28 test esi, esi
.text:00470C2A jl loc_470D0E
.text:00470C30 movzx eax, word ptr [ecx+3E8h]
.text:00470C37 cmp esi, eax
.text:00470C39 jge loc_470D0E
.text:00470C3F mov edx, [esp+0Ch+arg_8]
.text:00470C43 test edx, edx
.text:00470C45 jl loc_470D0E
.text:00470C4B push ebx
.text:00470C4C movzx ebx, word ptr [ecx+3EAh]
.text:00470C53 cmp edx, ebx
.text:00470C55 pop ebx
.text:00470C56 jge loc_470D0E
.text:00470C5C mov ecx, [ecx+3ECh]
.text:00470C62 imul eax, edx
.text:00470C65 add eax, esi
.text:00470C67 cmp byte_57FEED, 1
.text:00470C6E lea eax, [eax+eax*2]
.text:00470C71 mov edx, [ecx+eax*2]
.text:00470C74 lea eax, [ecx+eax*2]
.text:00470C77 mov ax, [eax+4]
.text:00470C7B mov [esp+0Ch+var_8], edx
.text:00470C7F jz short loc_470CF7
.text:00470C81 movzx ecx, dx
.text:00470C84 movsx edx, word_57FF1C
.text:00470C8B cmp ecx, edx
.text:00470C8D jl short loc_470CA3
.text:00470C8F movsx edx, word_57FF20
.text:00470C96 cmp ecx, edx
.text:00470C98 jg short loc_470CA3
.text:00470C9A add word ptr [esp+0Ch+var_8], 0FB51h
.text:00470CA1 jmp short loc_470CB5
.text:00470CA3 ; ---------------------------------------------------------------------------
.text:00470CA3
.text:00470CA3 loc_470CA3: ; CODE XREF: sub_470C20+6Dj
.text:00470CA3 ; sub_470C20+78j
.text:00470CA3 movsx edx, word_57FF18
.text:00470CAA cmp ecx, edx
.text:00470CAC jle short loc_470CB5
.text:00470CAE mov word ptr [esp+0Ch+var_8], 0
.text:00470CB5
.text:00470CB5 loc_470CB5: ; CODE XREF: sub_470C20+81j
.text:00470CB5 ; sub_470C20+8Cj
.text:00470CB5 movsx edx, word_57FF28
.text:00470CBC movzx ecx, ax
.text:00470CBF cmp ecx, edx
.text:00470CC1 jl short loc_470CE9
.text:00470CC3 movsx edx, word_57FF2C
.text:00470CCA cmp ecx, edx
.text:00470CCC jg short loc_470CE9
.text:00470CCE mov ecx, [esp+0Ch+arg_0]
.text:00470CD2 mov edx, [esp+0Ch+var_8]
.text:00470CD6 add ax, 0FE85h
.text:00470CDA mov [ecx], edx
.text:00470CDC mov [ecx+4], ax
.text:00470CE0 mov eax, ecx
.text:00470CE2 pop esi
.text:00470CE3 add esp, 8
.text:00470CE6 retn 0Ch
.text:00470CE9 ; ---------------------------------------------------------------------------
.text:00470CE9
.text:00470CE9 loc_470CE9: ; CODE XREF: sub_470C20+A1j
.text:00470CE9 ; sub_470C20+ACj
.text:00470CE9 movsx edx, word_57FF24
.text:00470CF0 cmp ecx, edx
.text:00470CF2 jle short loc_470CF7
.text:00470CF4 xor ax, ax
.text:00470CF7
.text:00470CF7 loc_470CF7: ; CODE XREF: sub_470C20+5Fj
.text:00470CF7 ; sub_470C20+D2j
.text:00470CF7 mov ecx, [esp+0Ch+arg_0]
.text:00470CFB mov edx, [esp+0Ch+var_8]
.text:00470CFF mov [ecx], edx
.text:00470D01 mov [ecx+4], ax
.text:00470D05 mov eax, ecx
.text:00470D07 pop esi
.text:00470D08 add esp, 8
.text:00470D0B retn 0Ch
.text:00470D0E ; ---------------------------------------------------------------------------
.text:00470D0E
.text:00470D0E loc_470D0E: ; CODE XREF: sub_470C20+Aj
.text:00470D0E ; sub_470C20+19j ...
.text:00470D0E mov eax, [esp+0Ch+arg_0]
.text:00470D12 xor cx, cx
.text:00470D15 or word ptr [esp+0Ch+var_8+2], 1
.text:00470D1B mov word ptr [esp+0Ch+var_8], 0
.text:00470D22 mov edx, [esp+0Ch+var_8]
.text:00470D26 mov [eax], edx
.text:00470D28 mov [eax+4], cx
.text:00470D2C pop esi
.text:00470D2D add esp, 8
.text:00470D30 retn 0Ch
.text:00470D30 sub_470C20 endp