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

Disassembly:
sub esp, 0x1a8
mov eax, dword [0x4bd910]
xor eax, esp
mov dword [esp + 0x1a4], eax
push esi
mov esi, dword [esp + 0x1b0]
cmp dword [esi + 0x58], 2
jge 0x40219d
mov eax, 0xffffff7d
pop esi
mov ecx, dword [esp + 0x1a4]
xor ecx, esp
call fcn.00471a6a
add esp, 0x1a8
ret
cmp dword [esi + 4], 0
jne 0x4021be
mov eax, 0xffffff76
pop esi
mov ecx, dword [esp + 0x1a4]
xor ecx, esp
call fcn.00471a6a
add esp, 0x1a8
ret
push ebx
mov ebx, dword [esp + 0x1bc]
test ebx, ebx
push edi
jl 0x4024a9
mov edi, dword [esp + 0x1bc]
jg 0x4021e0
test edi, edi
jb 0x4024a9
cmp ebx, dword [esi + 0x14]
jg 0x4024a9
jl 0x4021f4
cmp edi, dword [esi + 0x10]
ja 0x4024a9
or eax, 0xffffffff
push ebp
mov dword [esi + 0x50], eax
mov dword [esi + 0x54], eax
mov eax, dword [esi + 0x5c]
push eax
lea ebp, [esi + 0x78]
push ebp
call fcn.0041bda0
lea ecx, [esi + 0x1e0]
push ecx
call fcn.0041d380
push ebx
push edi
mov eax, esi
call fcn.00401090
add esp, 0x14
test eax, eax
je 0x402260
or eax, 0xffffffff
lea edx, [esp + 0x4c]
push edx
mov dword [esi + 0x50], eax
mov dword [esi + 0x54], eax
call fcn.0041b5d0
add esp, 4
call fcn.00401cb0
mov eax, 0xffffff77
pop ebp
pop edi
pop ebx
pop esi
mov ecx, dword [esp + 0x1a4]
xor ecx, esp
call fcn.00471a6a
add esp, 0x1a8
ret
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0x5c]
push eax
lea ecx, [esp + 0x50]
push ecx
call fcn.0041b560
lea edx, [esp + 0x54]
push edx
call fcn.0041bd50
add esp, 0xc
lea esp, [esp]
mov edi, 3
cmp dword [esi + 0x58], edi
jl 0x40233b
lea eax, [esp + 0x2c]
push eax
lea ecx, [esp + 0x50]
push ecx
call fcn.0041bed0
add esp, 8
test eax, eax
jle 0x40233b
mov edx, dword [esi + 0x60]
mov eax, dword [esi + 0x48]
shl edx, 5
add eax, edx
cmp dword [eax + 0x1c], 0
je 0x402330
lea ecx, [esp + 0x2c]
push ecx
push eax
call fcn.0041cb30
mov ebx, eax
add esp, 8
test ebx, ebx
jge 0x4022ec
push 0
push ebp
call fcn.0041bed0
add esp, 8
xor ebx, ebx
jmp 0x402312
cmp dword [esp + 0x18], 0
je 0x402300
push 0
push ebp
call fcn.0041bed0
add esp, 8
jmp 0x402312
mov eax, dword [esp + 0x10]
test eax, eax
je 0x402312
lea edx, [ebx + eax]
sar edx, 2
add dword [esp + 0x14], edx
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
mov eax, edi
and eax, ecx
cmp eax, 0xffffffff
jne 0x40242b
mov dword [esp + 0x10], ebx
jmp 0x402290
push 0
push ebp
call fcn.0041bed0
add esp, 8
cmp dword [esp + 0x10], 0
jne 0x402484
push 0xffffffffffffffff
lea ecx, [esp + 0x20]
push 0xffffffffffffffff
push ecx
call fcn.004010f0
add esp, 0xc
test edx, edx
jl 0x402474
jg 0x402369
test eax, eax
jb 0x402474
cmp dword [esi + 0x58], edi
jl 0x4023a8
lea edx, [esp + 0x1c]
push edx
call fcn.0041b500
add esp, 4
cmp dword [esi + 0x5c], eax
je 0x4023a3
lea eax, [esp + 0x1c]
push eax
call fcn.0041b450
add esp, 4
test eax, eax
je 0x4023a3
call fcn.00401cb0
lea ecx, [esp + 0x4c]
push ecx
call fcn.0041b5d0
add esp, 4
cmp dword [esi + 0x58], edi
jge 0x4023fb
lea edx, [esp + 0x1c]
push edx
call fcn.0041b500
mov edx, dword [esi + 0x34]
mov edi, eax
add esp, 4
xor eax, eax
test edx, edx
jle 0x4023d1
mov ecx, dword [esi + 0x40]
cmp dword [ecx], edi
je 0x4023d1
add eax, 1
add ecx, 4
cmp eax, edx
jl 0x4023c3
cmp eax, edx
je 0x402290
push edi
push ebp
mov dword [esi + 0x60], eax
mov dword [esi + 0x5c], edi
call fcn.0041bda0
lea eax, [esp + 0x54]
push edi
push eax
call fcn.0041bda0
add esp, 0x10
mov dword [esi + 0x58], 3
lea ecx, [esp + 0x1c]
push ecx
push ebp
call fcn.0041ba90
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x58]
push eax
call fcn.0041ba90
lea ecx, [esp + 0x2c]
push ecx
call fcn.0041b460
add esp, 0x14
mov dword [esp + 0x18], eax
jmp 0x402290
mov ebx, dword [esi + 0x60]
mov edx, dword [esi + 0x44]
mov eax, ebx
shl eax, 4
sub edi, dword [eax + edx]
sbb ecx, dword [eax + edx + 4]
test ecx, ecx
jg 0x40244b
jl 0x402447
test edi, edi
jae 0x40244b
xor edi, edi
xor ecx, ecx
test ebx, ebx
jle 0x402463
lea eax, [edx + 8]
mov edx, dword [eax]
add edi, edx
mov edx, dword [eax + 4]
adc ecx, edx
add eax, 0x10
sub ebx, 1
jne 0x402452
mov eax, dword [esp + 0x14]
cdq
sub edi, eax
sbb ecx, edx
mov dword [esi + 0x50], edi
mov dword [esi + 0x54], ecx
jmp 0x40248d
push 0xffffffffffffffff
push esi
call fcn.004020f0
add esp, 8
mov dword [esi + 0x54], edx
jmp 0x40248a
or eax, 0xffffffff
mov dword [esi + 0x54], eax
mov dword [esi + 0x50], eax
lea eax, [esp + 0x4c]
push eax
call fcn.0041b5d0
fldz
fst qword [esi + 0x68]
add esp, 4
fstp qword [esi + 0x70]
xor eax, eax
jmp 0x402247
mov ecx, dword [esp + 0x1b0]
pop edi
pop ebx
pop esi
xor ecx, esp
mov eax, 0xffffff7d
call fcn.00471a6a
add esp, 0x1a8
ret