Function at 0x51b7a0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x5c
mov eax, dword [esp + 0x78]
movsx eax, word [eax]
test eax, eax
jle 0x51c7af
cmp eax, dword [0x5b5310]
jg 0x51c7af
lea edx, [eax - 1]
mov ebp, ecx
mov ecx, dword [0x5b531d]
imul edx, dword [0x5b5314]
mov edx, dword [ecx + edx]
mov edi, dword [edx + 0x29]
mov dword [esp + 0x2c], edi
movsx edi, byte [edx + 8]
mov edx, dword [esp + 0x7c]
mov dword [esp + 0x24], edi
mov edi, dword [0x5b39d0]
mov dword [esp + 0x38], edi
test edx, edx
jle 0x51c160
mov edi, dword [esp + 0x78]
mov ebx, dword [esp + 0x7c]
lea esi, [edi + 2]
lea ebx, [edi + ebx*2]
jmp 0x51b81a
cmp ebx, esi
je 0x51b864
movsx eax, word [esi]
add esi, 2
test eax, eax
jle 0x51c7bd
cmp eax, dword [ebp + 0x10]
jg 0x51c7bd
sub eax, 1
imul eax, dword [ebp + 0x14]
mov edx, dword [ebp + 0x1d]
mov edi, dword [edx + eax]
movzx eax, byte [edi + 9]
cmp al, 5
jne 0x51b855
mov eax, dword [edi]
mov ecx, edi
mov dword [esp], 0
call dword [eax + 0x78]
movzx eax, byte [edi + 9]
sub esp, 4
cmp al, 1
jne 0x51b810
mov ecx, edi
call fcn.0052fa60
cmp ebx, esi
jne 0x51b814
mov eax, dword [esp + 0x7c]
mov dword [esp + 4], 1
xor edi, edi
mov dword [esp + 0x48], eax
add eax, eax
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov dword [esp + 0x20], edi
mov esi, dword [esp + 0x7c]
xor edx, edx
mov dword [esp + 0x30], eax
mov ebx, dword [esp + 0x78]
movsx eax, word [ebx + edx*2]
mov ecx, eax
test eax, eax
jle 0x51c7b6
cmp eax, dword [ebp + 0x10]
jg 0x51c7b6
sub eax, 1
imul eax, dword [ebp + 0x14]
mov edi, dword [ebp + 0x1d]
mov eax, dword [edi + eax]
mov eax, dword [eax + 0x1e]
cmp word [eax + 0xe], 1
jne 0x51b8d6
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x30]
sub esi, 1
mov word [eax + edi*2], cx
lea eax, [edi + 1]
mov dword [esp + 0x20], eax
add edx, 1
cmp dword [esp + 0x7c], edx
jle 0x51b8e8
test esi, esi
jne 0x51b892
lea esi, [esi]
nop
cmp dword [esp + 0x24], 0x4c
mov ecx, 1
je 0x51b91d
mov eax, dword [esp + 0x70]
mov ecx, 2
shr eax, 0x1f
add eax, dword [esp + 0x70]
and eax, 0xfffffffe
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x74]
shr eax, 0x1f
add eax, dword [esp + 0x74]
and eax, 0xfffffffe
mov dword [esp + 0x74], eax
xor edi, edi
mov eax, dword [esp + 0x70]
mov dword [esp + 4], 1
xor esi, esi
mov word [0x5c9236], di
mov edi, dword [esp + 0x48]
mov dword [0x5c923c], eax
mov eax, dword [esp + 0x74]
lea ebx, [edi*4]
mov dword [0x5c9240], ecx
mov dword [esp], ebx
mov dword [0x5c9238], eax
xor eax, eax
mov word [0x5c9248], ax
xor eax, eax
mov dword [esp + 0x20], ecx
mov word [0x5c9234], si
mov word [0x5c924a], ax
call sub.msvcrt.dll_calloc
mov dword [esp + 4], 1
mov dword [esp], ebx
mov dword [0x5c9230], eax
call sub.msvcrt.dll_calloc
mov dword [esp + 4], 1
mov dword [esp], ebx
mov dword [0x5c9228], eax
call sub.msvcrt.dll_calloc
mov dword [esp + 4], 1
mov dword [esp], edi
mov dword [0x5c922c], eax
call sub.msvcrt.dll_calloc
mov ecx, dword [esp + 0x20]
mov dword [0x5c9224], eax
mov eax, dword [esp + 0x7c]
test eax, eax
je 0x51c725
mov ebx, 7
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x44], ebp
mov word [esp + 0x40], bx
mov ebp, eax
movzx eax, word [esp + 0x40]
mov edx, ecx
lea edi, [eax - 4]
lea esi, [eax - 3]
sub ax, 6
cmovns esi, eax
mov word [esp + 0x3c], di
movsx edi, ax
mov word [esp + 0x34], ax
sar si, 2
mov dword [esp + 0x20], edi
imul esi, ecx
test edi, edi
jle 0x51c58e
sar ax, 1
mov edi, esi
xor ebx, ebx
cwde
mov dword [esp + 0x28], eax
jmp 0x51ba32
sub esi, ecx
cmp dword [esp + 0x20], eax
je 0x51ba6e
test ebp, ebp
je 0x51bb90
mov ebx, eax
movsx edx, si
add edx, dword [esp + 0x70]
movsx eax, di
add eax, dword [esp + 0x74]
mov ecx, edx
mov dword [0x5c923c], edx
or ecx, eax
mov dword [0x5c9238], eax
jns 0x51bb40
mov ecx, dword [0x5c9240]
lea eax, [ebx + 1]
mov edx, ecx
cmp dword [esp + 0x28], ebx
jg 0x51ba20
sub edi, ecx
cmp dword [esp + 0x20], eax
jne 0x51ba28
movzx eax, word [0x5c924a]
add eax, edx
mov word [0x5c924a], ax
mov edi, eax
test ebp, ebp
je 0x51bea0
movzx edi, word [esp + 0x3c]
test di, di
lea ebx, [edi + 3]
cmovns ebx, edi
sar bx, 2
not ebx
imul ebx, edx
lea esi, [ebx + edx]
mov word [esp + 0x34], si
movsx esi, di
mov dword [esp + 0x20], esi
test esi, esi
jle 0x51c708
sar di, 1
movzx esi, word [esp + 0x34]
movsx eax, di
xor edi, edi
mov dword [esp + 0x28], eax
jmp 0x51bae2
add esi, ecx
cmp dword [esp + 0x20], eax
je 0x51bb1c
test ebp, ebp
je 0x51beb0
mov edi, eax
movsx edx, si
add edx, dword [esp + 0x70]
movsx eax, bx
add eax, dword [esp + 0x74]
mov ecx, edx
mov dword [0x5c923c], edx
or ecx, eax
mov dword [0x5c9238], eax
jns 0x51be50
mov ecx, dword [0x5c9240]
lea eax, [edi + 1]
cmp dword [esp + 0x28], edi
jg 0x51bad0
add ebx, ecx
cmp dword [esp + 0x20], eax
jne 0x51bad8
movzx edi, word [0x5c924a]
add edi, ecx
mov word [0x5c924a], di
test ebp, ebp
je 0x51bea0
add word [esp + 0x40], 4
jmp 0x51b9de
mov ecx, dword [0x59ad30]
cmp edx, ecx
jge 0x51ba55
cmp eax, dword [0x59ad2c]
jge 0x51ba55
imul eax, ecx
lea ecx, [eax + edx]
mov eax, dword [esp + 0x2c]
imul ecx, ecx, 0xe
add ecx, dword [esp + 0x38]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call fcn.00498f20
sub esp, 8
cmp eax, 1
adc ebp, 0xffffffff
jmp 0x51ba55
movzx edi, word [0x5c924a]
mov ebp, dword [esp + 0x44]
movzx ebx, word [esp + 0x34]
add edi, edx
mov word [0x5c924a], di
sub ebx, eax
mov word [0x5c9248], bx
movsx eax, bx
movsx esi, di
mov dword [esp + 0x28], eax
movzx ebx, word [0x5c9236]
mov eax, esi
mov word [0x5c9244], di
cdq
mov word [0x5c9246], di
idiv ecx
movzx edx, word [0x5c9234]
mov word [esp + 0x44], di
mov word [esp + 0x20], dx
cmp dword [esp + 0x28], eax
jl 0x51bc00
mov eax, edi
mov word [esp + 0x44], di
sub eax, ecx
mov word [0x5c9244], ax
mov edi, eax
nop
cmp ecx, 1
je 0x51c680
test di, di
lea eax, [edi + 3]
mov edx, dword [esp + 0x70]
cmovns eax, edi
sar ax, 2
cwde
lea edx, [edx + eax*2]
lea eax, [esi + 1]
sub esi, 2
cmovns eax, esi
mov esi, dword [esp + 0x74]
sar eax, 2
lea eax, [esi + eax*2]
mov dword [0x5c923c], edx
mov edx, dword [esp + 0x7c]
mov dword [0x5c9238], eax
test edx, edx
jle 0x51c716
mov esi, dword [esp + 0x30]
mov edx, dword [esp + 0x48]
mov word [esp + 0x4c], di
mov byte [esp + 0x3c], 0
mov dword [esp + 0x40], esi
lea edx, [esi + edx*2]
movzx esi, word [esp + 0x20]
mov edi, edx
mov byte [esp + 0x28], 0
mov edx, dword [esp + 0x40]
mov word [esp + 0x34], si
mov esi, ebx
mov dword [esp + 0x40], ecx
mov ecx, eax
mov word [esp + 0x4e], bx
jmp 0x51bc97
mov byte [esp + 0x28], 1
add esi, 1
add edx, 2
cmp edi, edx
je 0x51bcd9
movsx eax, word [edx]
test eax, eax
jle 0x51c78d
cmp eax, dword [ebp + 0x10]
jg 0x51c78d
sub eax, 1
imul eax, dword [ebp + 0x14]
mov ebx, dword [ebp + 0x1d]
mov eax, dword [ebx + eax]
movzx eax, word [eax + 0x1c]
sar ax, 5
cwde
cmp eax, ecx
jl 0x51bc88
jle 0x51bc90
add edx, 2
add word [esp + 0x34], 1
mov byte [esp + 0x3c], 1
cmp edi, edx
jne 0x51bc97
cmp byte [esp + 0x3c], 0
movzx edi, word [esp + 0x4c]
mov ecx, dword [esp + 0x40]
movzx ebx, word [esp + 0x4e]
je 0x51c6a7
movzx eax, word [esp + 0x34]
mov word [0x5c9234], ax
cmp byte [esp + 0x28], 0
je 0x51bd0d
mov word [0x5c9236], si
mov ebx, esi
cmp bx, word [esp + 0x34]
je 0x51c5a2
mov eax, dword [esp + 0x24]
mov ecx, ebp
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x74]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x7c]
mov dword [esp], eax
call fcn.0051ae60
mov ecx, ebp
sub esp, 0x10
mov eax, dword [esp + 0x7c]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x30]
mov dword [esp], eax
call fcn.0051ab30
mov eax, dword [0x5c9238]
sub esp, 8
mov dword [esp + 0x40], eax
movzx eax, word [0x5c9234]
cmp word [0x5c9236], ax
jl 0x51bf53
mov ecx, dword [esp + 0x7c]
test ecx, ecx
je 0x51c116
movsx edi, word [esp + 0x7c]
mov eax, dword [esp + 0x7c]
xor ebx, ebx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x3c], edi
mov dword [esp + 0x20], eax
mov eax, dword [0x5c923c]
nop
mov esi, dword [0x59ad30]
mov edi, eax
imul esi, ecx
add esi, eax
imul esi, esi, 0xe
add esi, dword [esp + 0x38]
cmp word [0x5c9244], 0
jle 0x51c6c7
mov dword [esp + 0x28], ebx
lea esi, [esi]
lea esi, [esi]
mov eax, dword [esp + 0x2c]
mov ecx, esi
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call fcn.00498f20
sub esp, 8
test eax, eax
jne 0x51c020
mov edx, dword [0x5c9240]
movsx ecx, word [0x5c9244]
imul eax, edx, 0xe
sub edi, edx
sub esi, eax
mov eax, dword [0x5c923c]
mov ebx, eax
sub ebx, ecx
cmp ebx, edi
jl 0x51bdd0
mov ecx, dword [0x5c9238]
mov ebx, dword [esp + 0x28]
sub ecx, edx
mov edx, dword [esp + 0x20]
mov dword [0x5c9238], ecx
test edx, edx
je 0x51c116
test ecx, ecx
jns 0x51bda0
mov edi, dword [esp + 0x40]
mov dword [0x5c9238], edi
mov ecx, edi
jmp 0x51bda0
mov ecx, dword [0x59ad30]
cmp edx, ecx
jge 0x51bb05
cmp eax, dword [0x59ad2c]
jge 0x51bb05
imul eax, ecx
lea ecx, [eax + edx]
mov eax, dword [esp + 0x2c]
imul ecx, ecx, 0xe
add ecx, dword [esp + 0x38]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call fcn.00498f20
sub esp, 8
cmp eax, 1
adc ebp, 0xffffffff
jmp 0x51bb05
mov ebp, dword [esp + 0x44]
movsx eax, word [0x5c9248]
jmp 0x51bbb5
movzx edi, word [0x5c924a]
mov ebp, dword [esp + 0x44]
movzx ebx, word [esp + 0x3c]
add edi, ecx
mov word [0x5c924a], di
jmp 0x51bba9
cmp byte [esp + 0x28], 0
movzx ecx, byte [esp + 0x20]
je 0x51bee5
movzx eax, word [esp + 0x34]
mov word [0x5c9234], ax
test cl, cl
je 0x51bd18
mov eax, dword [esp + 0x24]
mov ecx, ebp
mov word [0x5c9236], bx
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x74]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x7c]
mov dword [esp], eax
call fcn.0051ae60
mov ecx, ebp
sub esp, 0x10
mov eax, dword [esp + 0x7c]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x30]
mov dword [esp], eax
call fcn.0051ab30
mov eax, dword [0x5c9238]
sub esp, 8
mov dword [esp + 0x40], eax
movzx eax, word [0x5c9236]
cmp word [0x5c9234], ax
jle 0x51bd83
mov ebx, dword [esp + 0x7c]
test ebx, ebx
je 0x51c116
movsx edi, word [esp + 0x7c]
mov eax, dword [esp + 0x7c]
xor ebx, ebx
mov edx, dword [esp + 0x40]
mov dword [esp + 0x34], edi
mov dword [esp + 0x20], eax
mov eax, dword [0x5c923c]
lea esi, [esi]
nop
mov esi, dword [0x59ad30]
mov edi, eax
imul esi, edx
add esi, eax
imul esi, esi, 0xe
add esi, dword [esp + 0x38]
cmp word [0x5c9244], 0
jle 0x51c6b6
lea esi, [esi]
mov eax, dword [esp + 0x2c]
mov ecx, esi
mov dword [esp + 4], eax
mov eax, dword [esp + 0x24]
mov dword [esp], eax
call fcn.00498f20
sub esp, 8
test eax, eax
jne 0x51c178
mov edx, dword [0x5c9240]
movsx ecx, word [0x5c9244]
imul eax, edx, 0xe
add edi, edx
add esi, eax
mov eax, dword [0x5c923c]
add ecx, eax
cmp ecx, edi
jg 0x51bfa8
mov esi, dword [esp + 0x20]
add edx, dword [0x5c9238]
mov dword [0x5c9238], edx
test esi, esi
je 0x51c116
cmp dword [0x59ad2c], edx
jg 0x51bf80
mov edi, dword [esp + 0x40]
mov dword [0x5c9238], edi
mov edx, edi
jmp 0x51bf80
mov edx, dword [0x5c922c]
mov ebx, dword [esp + 0x28]
mov dword [esp + 0x34], esi
mov esi, dword [esp + 0x30]
lea esi, [esi]
mov eax, dword [edx + ebx*4]
movsx eax, word [esi + eax*2]
test eax, eax
jle 0x51c7b6
cmp eax, dword [ebp + 0x10]
jg 0x51c7b6
sub eax, 1
imul eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x1d]
add ebx, 1
mov ecx, dword [ecx + eax]
mov eax, dword [ecx + 0x1e]
cmp word [eax + 0xe], 1
jg 0x51c038
cmp dword [esp + 0x7c], 1
mov esi, dword [esp + 0x34]
mov dword [esp + 0x28], ebx
mov edx, dword [0x5c9238]
jle 0x51c278
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 0x7c]
je 0x51c3a0
cmp byte [ecx + 8], 0x4c
je 0x51c440
mov ebx, dword [esp + 0x3c]
mov eax, dword [ecx]
mov dword [esp + 0x1c], 3
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 4
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], edi
call dword [eax + 0x7c]
sub esp, 0x20
mov edx, dword [0x5c9240]
movsx ecx, word [0x5c9244]
sub dword [esp + 0x20], 1
imul eax, edx, 0xe
sub edi, edx
sub esi, eax
mov eax, dword [0x5c923c]
mov ebx, eax
sub ebx, ecx
cmp ebx, edi
jge 0x51be12
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x51bdd0
sub dword [0x5c9238], edx
mov eax, dword [0x5c9224]
mov dword [esp], eax
call fcn.00565f80
mov eax, dword [0x5c9228]
mov dword [esp], eax
call fcn.00565f80
mov eax, dword [0x5c922c]
mov dword [esp], eax
call fcn.00565f80
mov eax, dword [0x5c9230]
mov dword [esp], eax
call fcn.00565f80
mov eax, dword [esp + 0x30]
mov dword [esp], eax
call fcn.00565f80
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
jne 0x51c73f
mov dword [esp + 0x48], 0
jmp 0x51b8e8
mov dword [esp + 0x28], esi
mov edx, dword [0x5c922c]
mov esi, dword [esp + 0x30]
lea esi, [esi]
lea esi, [esi]
mov eax, dword [edx + ebx*4]
movsx eax, word [esi + eax*2]
test eax, eax
jle 0x51c7b6
cmp eax, dword [ebp + 0x10]
jg 0x51c7b6
sub eax, 1
imul eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x1d]
add ebx, 1
mov ecx, dword [ecx + eax]
mov eax, dword [ecx + 0x1e]
cmp word [eax + 0xe], 1
jg 0x51c190
cmp dword [esp + 0x7c], 1
mov esi, dword [esp + 0x28]
mov edx, dword [0x5c9238]
jle 0x51c2b0
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x7c], eax
je 0x51c2f8
cmp byte [ecx + 8], 0x4c
je 0x51c498
mov eax, dword [ecx]
mov dword [esp + 0x1c], 3
mov dword [esp + 0x18], 1
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0xc], 4
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], edi
call dword [eax + 0x7c]
sub esp, 0x20
mov edx, dword [0x5c9240]
movsx ecx, word [0x5c9244]
sub dword [esp + 0x20], 1
imul eax, edx, 0xe
add edi, edx
add esi, eax
mov eax, dword [0x5c923c]
add ecx, eax
cmp ecx, edi
jle 0x51bfe8
mov ecx, dword [esp + 0x20]
test ecx, ecx
jne 0x51bfa8
add dword [0x5c9238], edx
jmp 0x51c116
mov eax, dword [ecx]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 1
jmp 0x51c0c5
mov eax, dword [ecx]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], 1
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 1
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], edi
call dword [eax + 0x7c]
sub esp, 0x20
jmp 0x51c236
mov eax, dword [ecx]
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x1c], 1
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 4
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], edi
call dword [eax + 0x7c]
sub esp, 0x20
mov ecx, dword [esp + 0x3c]
cmp byte [ecx + 8], 0x4c
je 0x51c4ec
mov edx, dword [esp + 0x34]
mov eax, dword [ecx]
mov dword [esp + 0x1c], 2
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], edx
mov edx, dword [0x5c9238]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 4
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], edi
call dword [eax + 0x7c]
sub esp, 0x20
jmp 0x51c236
mov eax, dword [ecx]
mov ebx, dword [esp + 0x3c]
mov dword [esp + 0x34], ecx
mov dword [esp + 0x1c], 1
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 4
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], edi
call dword [eax + 0x7c]
sub esp, 0x20
mov ecx, dword [esp + 0x34]
cmp byte [ecx + 8], 0x4c
je 0x51c53f
mov eax, dword [ecx]
mov ebx, dword [esp + 0x3c]
mov dword [esp + 0x1c], 2
mov edx, dword [0x5c9238]
mov dword [esp + 0x18], 1
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 4
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], edi
call dword [eax + 0x7c]
sub esp, 0x20
jmp 0x51c0da
movsx eax, byte [ecx + 0x25]
test al, al
je 0x51c09b
mov dword [esp + 0xc], edx
mov dword [esp + 0x14], 4
mov dword [esp + 0x10], eax
mov dword [esp + 8], edi
movzx eax, word [ecx + 0x1c]
mov dword [esp + 0x34], ecx
sar ax, 5
cwde
mov dword [esp + 4], eax
movzx eax, word [ecx + 0x1a]
sar ax, 5
cwde
mov dword [esp], eax
call fcn.0052c570
mov edx, dword [0x5c9238]
sub esp, 0x18
mov ecx, dword [esp + 0x34]
jmp 0x51c09b
movsx eax, byte [ecx + 0x25]
test al, al
je 0x51c1ef
mov dword [esp + 0xc], edx
mov dword [esp + 0x14], 4
mov dword [esp + 0x10], eax
mov dword [esp + 8], edi
movzx eax, word [ecx + 0x1c]
mov dword [esp + 0x28], ecx
sar ax, 5
cwde
mov dword [esp + 4], eax
movzx eax, word [ecx + 0x1a]
sar ax, 5
cwde
mov dword [esp], eax
call fcn.0052c570
mov edx, dword [0x5c9238]
sub esp, 0x18
mov ecx, dword [esp + 0x28]
jmp 0x51c1ef
movsx eax, byte [ecx + 0x25]
test al, al
je 0x51c351
mov dword [esp + 0x10], eax
mov eax, dword [0x5c9238]
mov dword [esp + 0x14], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
movzx eax, word [ecx + 0x1c]
mov dword [esp + 0x28], ecx
sar ax, 5
cwde
mov dword [esp + 4], eax
movzx eax, word [ecx + 0x1a]
sar ax, 5
cwde
mov dword [esp], eax
call fcn.0052c570
sub esp, 0x18
mov ecx, dword [esp + 0x28]
jmp 0x51c351
movsx eax, byte [ecx + 0x25]
test al, al
je 0x51c3f1
mov dword [esp + 0x10], eax
mov eax, dword [0x5c9238]
mov dword [esp + 0x14], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
movzx eax, word [ecx + 0x1c]
sar ax, 5
cwde
mov dword [esp + 4], eax
movzx eax, word [ecx + 0x1a]
sar ax, 5
cwde
mov dword [esp], eax
call fcn.0052c570
sub esp, 0x18
mov ecx, dword [esp + 0x34]
jmp 0x51c3f1
movzx eax, word [0x5c924a]
add eax, ecx
mov word [0x5c924a], ax
jmp 0x51ba87
movsx eax, di
cmp ecx, 1
je 0x51c6d8
lea edx, [eax + 1]
sub eax, 2
movzx edi, word [esp + 0x44]
cmovns edx, eax
mov eax, dword [esp + 0x70]
sar edx, 2
add edx, edx
sub eax, edx
test di, di
lea edx, [edi + 3]
cmovns edx, edi
mov edi, dword [esp + 0x74]
sar dx, 2
movsx edx, dx
add edx, edx
sub edi, edx
mov dword [0x5c923c], eax
xor eax, eax
mov word [0x5c9234], ax
xor eax, eax
mov word [0x5c9236], ax
mov eax, dword [esp + 0x7c]
mov dword [0x5c9238], edi
test eax, eax
jle 0x51bd18
mov eax, dword [esp + 0x30]
mov esi, dword [esp + 0x48]
xor ecx, ecx
mov byte [esp + 0x28], 0
mov byte [esp + 0x20], cl
xor ebx, ebx
mov edx, eax
lea esi, [eax + esi*2]
xor eax, eax
mov word [esp + 0x34], ax
jmp 0x51c643
mov byte [esp + 0x20], 1
add ebx, 1
add edx, 2
cmp esi, edx
je 0x51bece
movsx eax, word [edx]
test eax, eax
jle 0x51c762
cmp eax, dword [ebp + 0x10]
jg 0x51c762
sub eax, 1
imul eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x1d]
mov eax, dword [ecx + eax]
movzx eax, word [eax + 0x1c]
sar ax, 5
cwde
cmp eax, edi
jl 0x51c630
jle 0x51c638
add word [esp + 0x34], 1
mov byte [esp + 0x28], 1
jmp 0x51c638
mov eax, edi
sub esi, 1
shr ax, 0xf
add eax, edi
sar ax, 1
cwde
add eax, dword [esp + 0x70]
mov edx, eax
mov eax, esi
shr eax, 0x1f
add eax, esi
sar eax, 1
add eax, dword [esp + 0x74]
jmp 0x51bc31
movzx eax, word [esp + 0x20]
mov word [esp + 0x34], ax
jmp 0x51bcfd
add edx, dword [0x5c9240]
mov dword [0x5c9238], edx
jmp 0x51c000
sub ecx, dword [0x5c9240]
mov dword [0x5c9238], ecx
jmp 0x51be30
sub eax, 1
movzx edi, word [esp + 0x44]
mov edx, eax
shr edx, 0x1f
add edx, eax
mov eax, dword [esp + 0x70]
sar edx, 1
sub eax, edx
mov edx, edi
shr dx, 0xf
add edx, edi
mov edi, dword [esp + 0x74]
sar dx, 1
movsx edx, dx
sub edi, edx
jmp 0x51c5df
add edx, eax
mov word [0x5c924a], dx
jmp 0x51bb34
movzx eax, word [esp + 0x20]
mov word [esp + 0x34], ax
jmp 0x51bd0d
xor eax, eax
xor edx, edx
xor esi, esi
xor ebx, ebx
mov word [0x5c9246], ax
xor edi, edi
mov word [esp + 0x20], dx
jmp 0x51bbed
mov eax, dword [esp + 0x7c]
mov dword [esp + 4], 1
mov dword [esp + 0x48], eax
add eax, eax
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov dword [esp + 0x30], eax
jmp 0x51b8e8
cmp byte [esp + 0x28], 0
movzx ecx, byte [esp + 0x20]
je 0x51c779
movzx eax, word [esp + 0x34]
mov word [0x5c9234], ax
test cl, cl
je 0x51c784
mov word [0x5c9236], bx
movzx eax, word [0x1c]
ud2
cmp byte [esp + 0x3c], 0
je 0x51c79f
movzx eax, word [esp + 0x34]
mov word [0x5c9234], ax
cmp byte [esp + 0x28], 0
je 0x51c784
mov word [0x5c9236], si
jmp 0x51c784
mov eax, dword [0x29]
ud2
mov eax, dword [0x1e]
ud2
movzx eax, byte [9]
ud2