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

Disassembly:
sub esp, 0x854
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov dword [esp + 0x34], esi
cmp dword [esi], 4
jne 0x40599f
mov edi, dword [esi + 0x78]
sar edi, 2
mov dword [esp + 0x38], edi
jmp 0x4059aa
mov eax, dword [esi + 0x78]
sar eax, 1
mov dword [esp + 0x38], eax
mov edi, eax
push edi
mov ecx, esi
call fcn.004061ae
mov ebp, dword [esi + 0x7c]
xor edx, edx
mov ecx, 0xffff8300
mov dword [esp + 0x14], 0
test ebp, ebp
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x10], esi
mov dword [esi + 0x7c], edx
je 0x40603f
jmp 0x4059e9
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x405f46
mov eax, dword [esi]
cmp eax, 4
mov eax, dword [ebp]
mov esi, eax
jne 0x405a21
and eax, 3
mov edi, eax
mov eax, dword [ebp + 4]
mov ebx, eax
sar esi, 2
sar ebx, 2
and eax, 3
mov dword [esp + 0x30], esi
mov dword [esp + 0x44], ebx
mov dword [esp + 0x3c], eax
jmp 0x405a46
and eax, 1
sar esi, 1
mov edi, eax
mov eax, dword [ebp + 4]
mov dword [esp + 0x30], esi
mov esi, eax
sar esi, 1
mov dword [esp + 0x44], esi
mov esi, dword [esp + 0x30]
mov ebx, dword [esp + 0x44]
and eax, 1
mov dword [esp + 0x3c], eax
cmp esi, ebx
mov dword [esp + 0x48], 0
jne 0x405b5e
mov ecx, dword [esp + 0x38]
lea eax, [esp + 0x24]
push eax
push ecx
push esi
mov ecx, ebp
call fcn.004044fe
mov eax, dword [esp + 0x3c]
sub eax, edi
mov edi, eax
mov eax, dword [esp + 0x1c]
cmp eax, esi
je 0x405b39
cmp word [esp + 0x1a], 0
je 0x405b2b
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx]
cmp edx, 2
mov edx, dword [esp + 0x14]
jne 0x405aad
shr edx, 2
and edx, 0xff00ff
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x18]
shr edx, 2
jmp 0x405ac1
shr edx, 4
and edx, 0xff00ff
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x18]
shr edx, 4
and edx, 0xff00ff
mov dword [esp + 0x2c], eax
mov dword [esp + 0x18], edx
cmp word [esp + 0x1a], 0xff
mov dword [esp + 0x3c], ecx
jne 0x405af2
lea edx, [esp + 0x14]
push edx
lea edx, [eax + 1]
push edx
push eax
push ecx
call dword [ecx + 0x124]
add esp, 0x10
jmp 0x405b2b
lea edx, [esp + 0x54]
lea ebx, [eax + 1]
push edx
push ebx
push eax
push ecx
call dword [ecx + 0x12c]
lea eax, [esp + 0x64]
lea ecx, [esp + 0x24]
push eax
push ecx
call fcn.0040604e
mov eax, dword [esp + 0x44]
lea edx, [esp + 0x6c]
push edx
push ebx
push eax
mov eax, dword [esp + 0x60]
push eax
call dword [eax + 0x124]
add esp, 0x28
xor eax, eax
mov dword [esp + 0x1c], esi
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov ecx, edi
imul edi, dword [esp + 0x28]
imul ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
add edx, ecx
add eax, edi
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], eax
jmp 0x405f42
test edi, edi
je 0x405c82
mov eax, dword [esp + 0x38]
lea edx, [esp + 0x24]
push edx
push eax
push esi
mov ecx, ebp
call fcn.004044fe
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x48], 1
mov ebx, dword [ecx]
mov ecx, dword [esp + 0x1c]
sub ebx, edi
cmp ecx, esi
je 0x405c53
cmp word [esp + 0x1a], 0
je 0x405c43
mov eax, dword [esp + 0x10]
mov edx, dword [eax]
cmp edx, 2
mov edx, dword [esp + 0x14]
jne 0x405bc5
shr edx, 2
and edx, 0xff00ff
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x18]
shr edx, 2
jmp 0x405bd9
shr edx, 4
and edx, 0xff00ff
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x18]
shr edx, 4
and edx, 0xff00ff
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x18], edx
cmp word [esp + 0x1a], 0xff
mov dword [esp + 0x30], eax
jne 0x405c0a
lea edx, [esp + 0x14]
push edx
lea edx, [ecx + 1]
push edx
push ecx
push eax
call dword [eax + 0x124]
add esp, 0x10
jmp 0x405c43
lea edx, [esp + 0x4c]
lea edi, [ecx + 1]
push edx
push edi
push ecx
push eax
call dword [eax + 0x12c]
lea eax, [esp + 0x5c]
lea ecx, [esp + 0x24]
push eax
push ecx
call fcn.0040604e
mov eax, dword [esp + 0x44]
lea edx, [esp + 0x64]
push edx
push edi
push eax
mov eax, dword [esp + 0x54]
push eax
call dword [eax + 0x124]
add esp, 0x28
xor eax, eax
mov ecx, esi
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ecx
mov edi, dword [esp + 0x24]
mov edx, ebx
imul edx, edi
mov eax, dword [esp + 0x14]
add eax, edx
mov edx, dword [esp + 0x18]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x28]
imul ebx, eax
add edx, ebx
mov ebx, dword [esp + 0x44]
inc esi
mov dword [esp + 0x18], edx
mov dword [esp + 0x30], esi
jmp 0x405c8a
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x24]
cmp esi, ebx
jge 0x405e38
mov cl, byte [ebp + 0x11]
test cl, cl
je 0x405ce2
mov ecx, dword [esp + 0x34]
mov edx, dword [ebp + 0xc]
cmp edx, dword [ecx]
jne 0x405ce6
mov al, byte [ebp + 0x12]
test al, al
je 0x405cc9
xor eax, eax
lea edx, [ebp + 0x18]
mov al, byte [ebp + 0x13]
push eax
push edx
push ebx
push esi
call fcn.004050be
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
jmp 0x405e38
mov eax, dword [ebp + 0x18]
push ebx
push esi
push eax
call dword [eax + 0x18]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
add esp, 0xc
jmp 0x405e38
mov ecx, dword [esp + 0x34]
mov ecx, dword [ecx]
mov dword [esp + 0x40], esi
sar ecx, 1
mov dword [esp + 0x2c], ecx
jmp 0x405d04
mov ecx, dword [esp + 0x2c]
mov ebx, dword [esp + 0x44]
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x24]
mov edx, dword [esp + 0x40]
add edx, 0x100
cmp ebx, edx
jl 0x405d14
mov ebx, edx
mov dl, byte [ebp + 0x10]
test dl, dl
je 0x405d97
mov edi, dword [esp + 0x40]
lea esi, [esp + 0x64]
cmp edi, ebx
jge 0x405e09
mov eax, dword [esp + 0x38]
push esi
push eax
push edi
mov ecx, ebp
call fcn.004044fe
mov edx, dword [esi]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esi + 4]
add esi, 8
shr edx, cl
shr eax, cl
and edx, 0xff00ff
and eax, 0xff00ff
mov dword [esi - 8], edx
mov dword [esi - 4], eax
inc edi
cmp edi, ebx
jl 0x405d2b
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x40]
mov ecx, dword [esp + 0x34]
mov edx, dword [ebp + 0xc]
cmp edx, dword [ecx]
jne 0x405e12
mov al, byte [ebp + 0x12]
test al, al
jne 0x405e12
lea eax, [esp + 0x64]
push eax
push ebx
push edi
push ecx
call dword [ecx + 0x124]
add esp, 0x10
jmp 0x405e1e
mov edx, dword [esp + 0x48]
test edx, edx
jne 0x405dc5
mov edx, dword [esp + 0x38]
lea ecx, [esp + 0x24]
push ecx
push edx
push esi
mov ecx, ebp
call fcn.004044fe
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x24]
mov dword [esp + 0x48], 1
shr edi, cl
shr eax, cl
mov ecx, dword [esp + 0x40]
and edi, 0xff00ff
and eax, 0xff00ff
inc ecx
mov dword [esp + 0x68], eax
cmp ecx, ebx
mov dword [esp + 0x64], edi
lea eax, [esp + 0x6c]
jge 0x405d63
mov edx, ebx
sub edx, ecx
mov ecx, dword [esp + 0x64]
mov dword [eax], ecx
mov ecx, dword [esp + 0x68]
mov dword [eax + 4], ecx
add eax, 8
dec edx
jne 0x405df1
jmp 0x405d63
mov esi, dword [esp + 0x30]
jmp 0x405d67
lea edx, [esp + 0x64]
push edx
push ebx
push edi
call fcn.004032de
mov eax, dword [esp + 0x44]
mov dword [esp + 0x40], ebx
cmp ebx, eax
jl 0x405cf4
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
mov ebx, eax
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x405f42
mov al, byte [ebp + 0x10]
test al, al
jne 0x405e53
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x405e6d
mov ecx, dword [esp + 0x38]
lea eax, [esp + 0x24]
push eax
push ecx
push ebx
mov ecx, ebp
call fcn.004044fe
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
cmp ecx, ebx
je 0x405f20
cmp word [esp + 0x1a], 0
je 0x405f16
mov eax, dword [esp + 0x10]
mov esi, dword [eax]
cmp esi, 2
mov esi, dword [esp + 0x14]
jne 0x405ea2
shr esi, 2
and esi, 0xff00ff
mov dword [esp + 0x14], esi
shr edx, 2
jmp 0x405eb2
shr esi, 4
and esi, 0xff00ff
mov dword [esp + 0x14], esi
shr edx, 4
and edx, 0xff00ff
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x18], edx
cmp word [esp + 0x1a], 0xff
mov edi, eax
jne 0x405ee1
lea edx, [esp + 0x14]
push edx
lea edx, [ecx + 1]
push edx
push ecx
push eax
call dword [eax + 0x124]
add esp, 0x10
jmp 0x405f16
lea edx, [esp + 0x5c]
lea esi, [ecx + 1]
push edx
push esi
push ecx
push eax
call dword [eax + 0x12c]
lea eax, [esp + 0x6c]
lea ecx, [esp + 0x24]
push eax
push ecx
call fcn.0040604e
mov eax, dword [esp + 0x44]
lea edx, [esp + 0x74]
push edx
push esi
push eax
push edi
call dword [edi + 0x124]
add esp, 0x28
xor edx, edx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x14], edx
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x3c]
imul ecx, eax
mov esi, dword [esp + 0x14]
add esi, ecx
mov ecx, dword [esp + 0x28]
imul ecx, eax
add edx, ecx
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], edx
mov esi, dword [esp + 0x34]
mov edi, dword [ebp + 8]
push ebp
lea ecx, [esi + 0xa4]
call 0x3fb73e
test edi, edi
mov ebp, edi
jne 0x4059e1
cmp word [esp + 0x1a], di
je 0x40603f
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
cmp dword [eax], 2
jne 0x405f8d
mov ecx, dword [esp + 0x18]
shr edx, 2
and edx, 0xff00ff
mov dword [esp + 0x14], edx
shr ecx, 2
jmp 0x405fa1
mov ecx, dword [esp + 0x18]
shr edx, 4
and edx, 0xff00ff
mov dword [esp + 0x14], edx
shr ecx, 4
and ecx, 0xff00ff
mov edi, eax
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x1c]
cmp word [esp + 0x1a], 0xff
mov ebx, ecx
jne 0x405fdb
lea edx, [esp + 0x14]
push edx
lea edx, [ecx + 1]
push edx
push ecx
push eax
call dword [eax + 0x124]
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x854
ret
lea edx, [esp + 0x24]
lea esi, [ecx + 1]
push edx
push esi
push ecx
push eax
call dword [eax + 0x12c]
mov ecx, dword [esp + 0x2a]
mov edx, dword [esp + 0x34]
and ecx, 0xffff
mov eax, 0x100
sub eax, ecx
mov ebp, dword [esp + 0x28]
imul edx, eax
imul eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x24]
shr eax, 8
add eax, ebp
and eax, 0xff00ff
mov dword [esp + 0x38], eax
lea eax, [esp + 0x34]
shr edx, 8
add edx, ecx
push eax
push esi
and edx, 0xff00ff
push ebx
push edi
mov dword [esp + 0x44], edx
call dword [edi + 0x124]
add esp, 0x20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x854
ret