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

Disassembly:
mov eax, dword [0x41bdac]
sub esp, 0x60
test eax, eax
je 0x409d82
mov eax, dword [esp + 0x68]
push ebx
push ebp
push esi
lea eax, [eax + eax*2 + 3]
push edi
cdq
and edx, 3
mov ebx, dword [esp + 0x74]
add eax, edx
mov dword [esp + 0x14], 2
mov edi, eax
mov eax, dword [esp + 0x80]
sar edi, 2
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [esp + 0x30], ecx
mov ecx, dword [eax + 0x10]
mov dword [esp + 0x34], edx
mov edx, dword [eax + 0x14]
mov dword [esp + 0x38], ecx
mov ecx, dword [eax + 8]
mov dword [esp + 0x3c], edx
mov edx, dword [eax + 0xc]
mov dword [esp + 0x40], ecx
mov ecx, dword [eax + 0x18]
mov dword [esp + 0x44], edx
mov edx, dword [eax + 0x1c]
mov dword [esp + 0x48], ecx
mov ecx, dword [eax]
mov dword [esp + 0x4c], edx
mov edx, dword [eax + 4]
mov dword [esp + 0x50], ecx
mov ecx, dword [eax + 8]
mov dword [esp + 0x54], edx
mov edx, dword [eax + 0xc]
mov dword [esp + 0x58], ecx
mov ecx, dword [eax + 0x10]
mov dword [esp + 0x5c], edx
mov edx, dword [eax + 0x14]
mov dword [esp + 0x60], ecx
mov ecx, dword [eax + 0x18]
mov dword [esp + 0x64], edx
mov edx, dword [eax + 0x1c]
mov eax, dword [esp + 0x88]
mov dword [esp + 0x68], ecx
mov cx, ax
mov dword [esp + 0x6c], edx
shr cx, 8
shl edi, 2
mov word [esp + 0x78], cx
lea ecx, [esp + 0x30]
shr eax, 0x10
mov dword [esp + 0x80], eax
mov dword [esp + 0x10], ecx
mov edx, dword [ecx + 8]
mov eax, dword [ecx]
fild dword [ecx + 4]
fild dword [ecx + 0xc]
mov esi, edx
mov dword [esp + 0x20], edx
sub esi, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], esi
mov esi, eax
fsub st(1)
fild dword [esp + 0x18]
cmp esi, edx
fdivp st(1)
fstp qword [esp + 0x28]
jg 0x409bb6
lea ebp, [esi + esi*2]
jmp 0x409afa
mov eax, dword [esp + 0x1c]
mov ecx, esi
sub ecx, eax
mov dword [esp + 0x18], ecx
fild dword [esp + 0x18]
fmul qword [esp + 0x28]
fadd st(1)
call sub.msvcrt.dll__ftol
mov edx, eax
mov eax, dword [esp + 0x7c]
sub eax, edx
mov cl, byte [esp + 0x80]
dec eax
mov dl, byte [esp + 0x78]
imul eax, edi
add eax, ebp
add ebp, 3
add eax, ebx
inc esi
mov byte [eax], cl
mov cl, byte [esp + 0x88]
mov byte [eax + 1], dl
mov byte [eax + 2], cl
cmp esi, dword [esp + 0x20]
jle 0x409af6
mov ecx, dword [esp + 0x10]
fstp st(0)
mov eax, dword [esp + 0x14]
add ecx, 0x10
dec eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
jne 0x409ac0
lea ecx, [esp + 0x54]
mov dword [esp + 0x10], 2
mov dword [esp + 0x14], ecx
mov edx, dword [ecx + 8]
mov eax, dword [ecx]
fild dword [ecx - 4]
fild dword [ecx + 4]
mov esi, edx
mov dword [esp + 0x24], edx
sub esi, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], esi
mov esi, eax
fsub st(1)
fild dword [esp + 0x20]
cmp esi, edx
fdivp st(1)
fstp qword [esp + 0x28]
jg 0x409d86
mov ebp, dword [esp + 0x7c]
mov ecx, edi
sub ebp, esi
neg ecx
dec ebp
mov dword [esp + 0x18], ecx
imul ebp, edi
jmp 0x409bbe
fstp st(0)
jmp 0x409b4b
mov eax, dword [esp + 0x1c]
mov edx, esi
sub edx, eax
mov dword [esp + 0x20], edx
fild dword [esp + 0x20]
fmul qword [esp + 0x28]
fadd st(1)
call sub.msvcrt.dll__ftol
mov dl, byte [esp + 0x80]
lea ecx, [ebp + eax*2]
add eax, ecx
mov cl, byte [esp + 0x78]
add eax, ebx
inc esi
mov byte [eax], dl
mov dl, byte [esp + 0x88]
mov byte [eax + 1], cl
mov ecx, dword [esp + 0x18]
mov byte [eax + 2], dl
mov eax, dword [esp + 0x24]
add ebp, ecx
cmp esi, eax
jle 0x409bba
mov ecx, dword [esp + 0x14]
fstp st(0)
mov eax, dword [esp + 0x10]
add ecx, 0x10
dec eax
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
jne 0x409b71
mov al, byte [esp + 0x88]
mov cl, byte [esp + 0x78]
or dl, 0xff
sub dl, al
or al, 0xff
sub al, cl
mov cl, byte [esp + 0x80]
mov byte [esp + 0x78], al
or al, 0xff
sub al, cl
mov dword [esp + 0x80], 0x18
mov byte [esp + 0x88], al
mov eax, dword [esp + 0x84]
add eax, 4
mov esi, dword [esp + 0x7c]
mov ebp, dword [eax]
sub esi, ebp
mov ecx, dword [eax - 4]
dec esi
mov ebp, ebx
imul esi, edi
lea ecx, [ecx + ecx*2]
add ebp, esi
mov esi, dword [eax - 4]
add ecx, ebp
cmp esi, dword [eax + 4]
jg 0x409ca3
mov bl, byte [esp + 0x88]
mov byte [ecx + 2], dl
mov byte [ecx], bl
mov bl, byte [esp + 0x78]
mov byte [ecx + 1], bl
mov ebx, dword [eax + 4]
add ecx, 3
inc esi
cmp esi, ebx
jle 0x409c81
mov ebx, dword [esp + 0x74]
mov esi, dword [esp + 0x7c]
mov ebp, dword [eax + 8]
sub esi, ebp
mov ecx, dword [eax - 4]
dec esi
mov ebp, ebx
imul esi, edi
lea ecx, [ecx + ecx*2]
add ebp, esi
mov esi, dword [eax - 4]
add ecx, ebp
cmp esi, dword [eax + 4]
jg 0x409ce6
mov bl, byte [esp + 0x88]
mov byte [ecx + 2], dl
mov byte [ecx], bl
mov bl, byte [esp + 0x78]
mov byte [ecx + 1], bl
mov ebx, dword [eax + 4]
add ecx, 3
inc esi
cmp esi, ebx
jle 0x409cc4
mov ebx, dword [esp + 0x74]
mov ecx, dword [eax]
mov esi, dword [esp + 0x7c]
sub esi, ecx
mov ecx, dword [eax - 4]
dec esi
mov ebp, ebx
imul esi, edi
lea ecx, [ecx + ecx*2]
add ebp, esi
mov esi, dword [eax]
add ecx, ebp
cmp esi, dword [eax + 8]
jg 0x409d26
mov bl, byte [esp + 0x88]
mov byte [ecx + 2], dl
mov byte [ecx], bl
mov bl, byte [esp + 0x78]
mov byte [ecx + 1], bl
mov ebx, dword [eax + 8]
sub ecx, edi
inc esi
cmp esi, ebx
jle 0x409d05
mov ebx, dword [esp + 0x74]
mov ecx, dword [eax]
mov esi, dword [esp + 0x7c]
sub esi, ecx
mov ecx, dword [eax + 4]
dec esi
mov ebp, ebx
imul esi, edi
lea ecx, [ecx + ecx*2]
add ebp, esi
mov esi, dword [eax]
add ecx, ebp
cmp esi, dword [eax + 8]
jg 0x409d66
mov bl, byte [esp + 0x88]
mov byte [ecx + 2], dl
mov byte [ecx], bl
mov bl, byte [esp + 0x78]
mov byte [ecx + 1], bl
mov ebx, dword [eax + 8]
sub ecx, edi
inc esi
cmp esi, ebx
jle 0x409d45
mov ebx, dword [esp + 0x74]
mov ecx, dword [esp + 0x80]
add eax, 0x10
dec ecx
mov dword [esp + 0x80], ecx
jne 0x409c61
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret
fstp st(0)
jmp 0x409c0c