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

Disassembly:
push 0xffffffffffffffff
push 0x6115e5
mov eax, dword fs:[0]
push eax
sub esp, 0x23c
mov eax, dword [0x682d00]
xor eax, esp
mov dword [esp + 0x238], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x682d00]
xor eax, esp
push eax
lea eax, [esp + 0x250]
mov dword fs:[0], eax
mov eax, dword [esp + 0x268]
mov edi, dword [esp + 0x260]
push eax
push edi
mov esi, ecx
call fcn.0040c220
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40d7e0
xor eax, eax
jmp 0x40dfc5
push 0x1c
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
mov ebp, eax
add esp, 4
mov dword [esp + 0x48], ebp
mov dword [esp + 0x258], 0
test ebp, ebp
je 0x40d810
mov ecx, ebp
call dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMB2DGeometry::constructor_void_]
mov dword [ebp], vtable.BMB2DGeometry.0
jmp 0x40d812
xor ebp, ebp
mov cl, byte [esp + 0x264]
fldz
mov byte [ebp + 8], cl
fstp dword [ebp + 0xc]
push ebx
mov ecx, ebp
mov dword [esp + 0x25c], 0xffffffff
mov dword [ebp + 0x10], ebx
call dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMB2DGeometry::AllocateGeUnitArray_int_]
lea edx, [esp + 0x24]
push edx
mov ecx, edi
call fcn.0055f620
push edi
lea ecx, [esp + 0x12c]
call fcn.00570df0
mov ebx, 1
lea ecx, [esp + 0x128]
mov dword [esp + 0x258], ebx
call fcn.005710a0
lea ecx, [esp + 0x128]
call fcn.005712e0
cmp eax, 0x20
jne 0x40d8ca
mov eax, dword [esp + 0x148]
push eax
lea ecx, [esp + 0xc0]
call fcn.0057fd90
lea ecx, [esp + 0x98]
push ecx
lea ecx, [esp + 0xc0]
mov byte [esp + 0x25c], 2
call fcn.0057fe60
mov edx, dword [eax]
mov dword [esp + 0x24], edx
mov eax, dword [eax + 4]
lea ecx, [esp + 0xbc]
mov dword [esp + 0x28], eax
mov byte [esp + 0x258], bl
call fcn.0057fe30
lea ecx, [esp + 0x128]
xor edi, edi
mov dword [esp + 0x20], ebx
call fcn.005710a0
mov ecx, dword [esp + 0x134]
cmp ecx, dword [esp + 0x138]
ja 0x40dfac
mov ebx, dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMB2DGeometry::PutGeUnit_int__unsigned_char__float__float_]
jmp 0x40d900
lea ecx, [esp + 0x128]
call fcn.005712e0
cmp eax, 0x20
je 0x40df8c
lea ecx, [esp + 0x128]
call fcn.005712e0
cmp eax, 0x11
je 0x40da3e
cmp eax, 0x16
jne 0x40df8c
mov edx, dword [esp + 0x148]
push edx
lea ecx, [esp + 0xc0]
call fcn.0057ca40
mov eax, dword [esp + 0xc8]
mov ecx, dword [esp + 0xcc]
mov byte [esp + 0x258], 3
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], ecx
cmp dword [esp + 0x24], eax
jne 0x40d98a
cmp dword [esp + 0x28], ecx
jne 0x40d98a
lea ecx, [esp + 0xbc]
mov byte [esp + 0x258], 1
call fcn.0057ca70
jmp 0x40df8c
cmp dword [esp + 0x20], 1
jne 0x40d9dd
mov ecx, dword [esp + 0xc0]
mov eax, dword [esp + 0xc4]
lea edx, [esp + 0xb8]
mov dword [esp + 0x68], ecx
push edx
mov ecx, esi
mov dword [esp + 0xbc], eax
call fcn.0042ac80
push ecx
lea eax, [esp + 0x6c]
fstp dword [esp]
push eax
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push edi
mov ecx, ebp
call ebx
inc edi
mov dword [esp + 0x20], 0
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x40]
lea eax, [esp + 0x70]
mov dword [esp + 0x70], ecx
push eax
mov ecx, esi
mov dword [esp + 0x7c], edx
call fcn.0042ac80
push ecx
lea ecx, [esp + 0x7c]
fstp dword [esp]
push ecx
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push edi
mov ecx, ebp
call ebx
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x44]
lea ecx, [esp + 0xbc]
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], eax
inc edi
mov byte [esp + 0x258], 1
call fcn.0057ca70
jmp 0x40df8c
mov ecx, dword [esp + 0x148]
push ecx
lea ecx, [esp + 0x100]
call fcn.00576e40
cmp dword [esp + 0x268], 1
mov edx, dword [esp + 0x108]
mov eax, dword [esp + 0x100]
mov ecx, dword [esp + 0x104]
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x10c]
mov byte [esp + 0x258], 4
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x1c], edx
jne 0x40dc57
cmp dword [esp + 0x108], eax
jne 0x40dace
cmp edx, ecx
jne 0x40dace
mov eax, dword [esp + 0x118]
lea ecx, [eax + eax]
lea edx, [esp + 0x14]
mov dword [esp + 0x14], ecx
push edx
mov ecx, esi
call fcn.0042ac80
fld dword [esi + 0x154]
fcompp
fnstsw ax
test ah, 0x41
je 0x40df78
lea ecx, [esp + 0x2c]
call fcn.005f1fa0
fild dword [esi + 0x158]
push 1
sub esp, 8
fdivr qword [0x632608]
lea eax, [esp + 0x38]
lea ecx, [esp + 0x108]
mov byte [esp + 0x264], 5
fstp qword [esp]
push eax
call fcn.0051f630
cmp dword [esp + 0x20], 1
jne 0x40db85
cmp dword [esp + 0x2c], 0
jle 0x40db18
mov eax, dword [esp + 0x34]
jmp 0x40db23
push 0
lea ecx, [esp + 0x30]
call fcn.005ee880
cmp dword [esp + 0x2c], 0
mov ecx, dword [eax + 4]
mov dword [esp + 0x80], ecx
jle 0x40db3a
mov eax, dword [esp + 0x34]
jmp 0x40db45
push 0
lea ecx, [esp + 0x30]
call fcn.005ee880
mov edx, dword [eax]
lea eax, [esp + 0x80]
push eax
mov ecx, esi
mov dword [esp + 0x8c], edx
call fcn.0042ac80
push ecx
lea ecx, [esp + 0x8c]
fstp dword [esp]
push ecx
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push 0xffffffffffffffff
mov ecx, ebp
call ebx
inc edi
mov dword [esp + 0x20], 0
mov edx, dword [esp + 0x2c]
mov ecx, 1
cmp edx, ecx
mov dword [esp + 0x14], ecx
jle 0x40dc31
jmp 0x40dba4
mov ecx, dword [esp + 0x14]
cmp ecx, edx
jge 0x40dbb1
mov eax, dword [esp + 0x34]
lea eax, [eax + ecx*8]
jmp 0x40dbc3
push ecx
lea ecx, [esp + 0x30]
call fcn.005ee880
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x14]
cmp ecx, edx
mov eax, dword [eax + 4]
mov dword [esp + 0x90], eax
jge 0x40dbda
mov edx, dword [esp + 0x34]
lea eax, [edx + ecx*8]
jmp 0x40dbe4
push ecx
lea ecx, [esp + 0x30]
call fcn.005ee880
mov eax, dword [eax]
lea ecx, [esp + 0x90]
push ecx
mov ecx, esi
mov dword [esp + 0xb0], eax
call fcn.0042ac80
push ecx
lea edx, [esp + 0xb0]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push 0xffffffffffffffff
mov ecx, ebp
call ebx
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x2c]
inc eax
inc edi
cmp eax, edx
mov dword [esp + 0x14], eax
jl 0x40dba0
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0x2c]
mov dword [esp + 0x24], eax
mov byte [esp + 0x258], 4
call fcn.005f1f90
jmp 0x40df78
cmp dword [esp + 0x108], eax
jne 0x40ddf6
cmp dword [esp + 0x10c], ecx
jne 0x40ddf6
lea edx, [esp + 0x5c]
mov dword [esp + 0x5c], ecx
push edx
mov ecx, esi
mov dword [esp + 0x98], eax
call fcn.0042ac80
push ecx
lea eax, [esp + 0x98]
fstp dword [esp]
push eax
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push edi
mov ecx, ebp
call ebx
lea ecx, [esp + 0xec]
push ecx
lea ecx, [esp + 0x100]
inc edi
call fcn.0051c850
push eax
lea ecx, [esp + 0x9c]
call fcn.005eeba0
mov edx, dword [esp + 0x9c]
mov eax, dword [esp + 0x98]
lea ecx, [esp + 0x64]
push ecx
mov ecx, esi
mov dword [esp + 0x68], edx
mov dword [esp + 0xa8], eax
call fcn.0042ac80
push ecx
lea edx, [esp + 0xa8]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 3
push edi
mov ecx, ebp
call ebx
mov eax, dword [esp + 0x118]
lea ecx, [eax + eax]
lea edx, [esp + 0x6c]
mov dword [esp + 0x6c], ecx
push edx
mov ecx, esi
inc edi
call fcn.0042ac80
fstp dword [esp + 0x14]
fldz
sub esp, 8
fstp dword [esp + 4]
mov ecx, ebp
fld dword [esp + 0x1c]
fstp dword [esp]
push 1
push edi
call ebx
lea ecx, [esp + 0xfc]
inc edi
call fcn.0051dfc0
fstp dword [esp + 0x14]
mov eax, dword [esp + 0x11c]
and eax, 0xfffffff9
cmp ax, 1
jne 0x40dd70
fld dword [esp + 0x14]
fmul qword [0x631e00]
fstp dword [esp + 0x14]
lea ecx, [esp + 0xe4]
push ecx
lea ecx, [esp + 0x100]
call fcn.0051b3c0
fld qword [eax]
fld dword [esp + 0x14]
sub esp, 8
fstp dword [esp + 4]
mov ecx, ebp
fstp dword [esp + 0x1c]
fld dword [esp + 0x1c]
fstp dword [esp]
push 5
push edi
call ebx
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0xa0]
push ecx
mov ecx, esi
inc edi
mov dword [esp + 0xa4], edx
mov dword [esp + 0x78], eax
call fcn.0042ac80
push ecx
lea edx, [esp + 0x78]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push edi
mov ecx, ebp
call ebx
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ecx
jmp 0x40df77
lea edx, [esp + 0x4c]
push edx
lea ecx, [esp + 0x100]
call fcn.0051f3d0
mov ecx, dword [esp + 0x4c]
mov eax, dword [esp + 0x3c]
cmp ecx, dword [esp + 0x38]
jne 0x40de1f
cmp dword [esp + 0x50], eax
je 0x40dee7
cmp ecx, dword [esp + 0x18]
jne 0x40de33
mov ecx, dword [esp + 0x50]
cmp ecx, dword [esp + 0x1c]
je 0x40dee7
mov edx, dword [esp + 0x38]
mov dword [esp + 0xb0], eax
lea eax, [esp + 0xb0]
push eax
mov ecx, esi
mov dword [esp + 0x24], 1
mov dword [esp + 0x80], edx
call fcn.0042ac80
push ecx
lea ecx, [esp + 0x80]
fstp dword [esp]
push ecx
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 0xd
push edi
mov ecx, ebp
call ebx
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x4c]
lea ecx, [esp + 0x54]
push ecx
mov ecx, esi
inc edi
mov dword [esp + 0x58], edx
mov dword [esp + 0x88], eax
call fcn.0042ac80
push ecx
lea edx, [esp + 0x88]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push edi
mov ecx, ebp
call ebx
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0xa8]
mov dword [esp + 0x8c], ecx
push edx
mov ecx, esi
inc edi
mov dword [esp + 0xac], eax
call fcn.0042ac80
lea eax, [esp + 0x8c]
jmp 0x40df50
cmp dword [esp + 0x20], 1
jne 0x40df30
lea ecx, [esp + 0xb4]
mov dword [esp + 0xb4], eax
mov eax, dword [esp + 0x38]
push ecx
mov ecx, esi
mov dword [esp + 0x5c], eax
call fcn.0042ac80
push ecx
lea edx, [esp + 0x5c]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push edi
mov ecx, ebp
call ebx
inc edi
mov dword [esp + 0x20], 0
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x60]
mov dword [esp + 0x48], ecx
push edx
mov ecx, esi
mov dword [esp + 0x64], eax
call fcn.0042ac80
lea eax, [esp + 0x48]
push ecx
fstp dword [esp]
push eax
mov ecx, esi
call fcn.0042ac80
push ecx
fstp dword [esp]
push 6
push edi
mov ecx, ebp
call ebx
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x28], edx
mov dword [esp + 0x24], ecx
inc edi
lea ecx, [esp + 0xfc]
mov byte [esp + 0x258], 1
call fcn.00572710
lea ecx, [esp + 0x128]
call fcn.005710d0
mov eax, dword [esp + 0x134]
cmp eax, dword [esp + 0x138]
jbe 0x40d900
lea ecx, [esp + 0x128]
mov dword [esp + 0x258], 0xffffffff
call fcn.00570110
mov eax, ebp
mov ecx, dword [esp + 0x250]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x238]
xor ecx, esp
call fcn.005f9aee
add esp, 0x248
ret 0xc