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

Disassembly:
push 0xffffffffffffffff
push 0x613555
mov eax, dword fs:[0]
push eax
sub esp, 0x23c
mov eax, dword [0x685e38]
xor eax, esp
mov dword [esp + 0x238], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x685e38]
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.0040c210
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40da20
xor eax, eax
jmp 0x40e205
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 0x40da50
mov ecx, ebp
call dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMB2DGeometry::constructor_void_]
mov dword [ebp], vtable.BMB2DGeometry.0
jmp 0x40da52
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.00560cd0
push edi
lea ecx, [esp + 0x12c]
call fcn.00572480
mov ebx, 1
lea ecx, [esp + 0x128]
mov dword [esp + 0x258], ebx
call fcn.00572730
lea ecx, [esp + 0x128]
call fcn.00572970
cmp eax, 0x20
jne 0x40db0a
mov eax, dword [esp + 0x148]
push eax
lea ecx, [esp + 0xc0]
call fcn.005813b0
lea ecx, [esp + 0x98]
push ecx
lea ecx, [esp + 0xc0]
mov byte [esp + 0x25c], 2
call fcn.00581480
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.00581450
lea ecx, [esp + 0x128]
xor edi, edi
mov dword [esp + 0x20], ebx
call fcn.00572730
mov ecx, dword [esp + 0x134]
cmp ecx, dword [esp + 0x138]
ja 0x40e1ec
mov ebx, dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMB2DGeometry::PutGeUnit_int__unsigned_char__float__float_]
jmp 0x40db40
lea ecx, [esp + 0x128]
call fcn.00572970
cmp eax, 0x20
je 0x40e1cc
lea ecx, [esp + 0x128]
call fcn.00572970
cmp eax, 0x11
je 0x40dc7e
cmp eax, 0x16
jne 0x40e1cc
mov edx, dword [esp + 0x148]
push edx
lea ecx, [esp + 0xc0]
call fcn.0057e0d0
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 0x40dbca
cmp dword [esp + 0x28], ecx
jne 0x40dbca
lea ecx, [esp + 0xbc]
mov byte [esp + 0x258], 1
call fcn.0057e100
jmp 0x40e1cc
cmp dword [esp + 0x20], 1
jne 0x40dc1d
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.0042afc0
push ecx
lea eax, [esp + 0x6c]
fstp dword [esp]
push eax
mov ecx, esi
call fcn.0042afc0
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.0042afc0
push ecx
lea ecx, [esp + 0x7c]
fstp dword [esp]
push ecx
mov ecx, esi
call fcn.0042afc0
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.0057e100
jmp 0x40e1cc
mov ecx, dword [esp + 0x148]
push ecx
lea ecx, [esp + 0x100]
call fcn.005784d0
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 0x40de97
cmp dword [esp + 0x108], eax
jne 0x40dd0e
cmp edx, ecx
jne 0x40dd0e
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.0042afc0
fld dword [esi + 0x154]
fcompp
fnstsw ax
test ah, 0x41
je 0x40e1b8
lea ecx, [esp + 0x2c]
call fcn.005f3af0
fild dword [esi + 0x158]
push 1
sub esp, 8
fdivr qword [0x634610]
lea eax, [esp + 0x38]
lea ecx, [esp + 0x108]
mov byte [esp + 0x264], 5
fstp qword [esp]
push eax
call fcn.00520710
cmp dword [esp + 0x20], 1
jne 0x40ddc5
cmp dword [esp + 0x2c], 0
jle 0x40dd58
mov eax, dword [esp + 0x34]
jmp 0x40dd63
push 0
lea ecx, [esp + 0x30]
call fcn.005effb0
cmp dword [esp + 0x2c], 0
mov ecx, dword [eax + 4]
mov dword [esp + 0x80], ecx
jle 0x40dd7a
mov eax, dword [esp + 0x34]
jmp 0x40dd85
push 0
lea ecx, [esp + 0x30]
call fcn.005effb0
mov edx, dword [eax]
lea eax, [esp + 0x80]
push eax
mov ecx, esi
mov dword [esp + 0x8c], edx
call fcn.0042afc0
push ecx
lea ecx, [esp + 0x8c]
fstp dword [esp]
push ecx
mov ecx, esi
call fcn.0042afc0
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 0x40de71
jmp 0x40dde4
mov ecx, dword [esp + 0x14]
cmp ecx, edx
jge 0x40ddf1
mov eax, dword [esp + 0x34]
lea eax, [eax + ecx*8]
jmp 0x40de03
push ecx
lea ecx, [esp + 0x30]
call fcn.005effb0
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x14]
cmp ecx, edx
mov eax, dword [eax + 4]
mov dword [esp + 0x90], eax
jge 0x40de1a
mov edx, dword [esp + 0x34]
lea eax, [edx + ecx*8]
jmp 0x40de24
push ecx
lea ecx, [esp + 0x30]
call fcn.005effb0
mov eax, dword [eax]
lea ecx, [esp + 0x90]
push ecx
mov ecx, esi
mov dword [esp + 0xb0], eax
call fcn.0042afc0
push ecx
lea edx, [esp + 0xb0]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042afc0
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 0x40dde0
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.005f3b00
jmp 0x40e1b8
cmp dword [esp + 0x108], eax
jne 0x40e036
cmp dword [esp + 0x10c], ecx
jne 0x40e036
lea edx, [esp + 0x5c]
mov dword [esp + 0x5c], ecx
push edx
mov ecx, esi
mov dword [esp + 0x98], eax
call fcn.0042afc0
push ecx
lea eax, [esp + 0x98]
fstp dword [esp]
push eax
mov ecx, esi
call fcn.0042afc0
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.0051d930
push eax
lea ecx, [esp + 0x9c]
call fcn.005f0660
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.0042afc0
push ecx
lea edx, [esp + 0xa8]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042afc0
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.0042afc0
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.0051f0a0
fstp dword [esp + 0x14]
mov eax, dword [esp + 0x11c]
and eax, 0xfffffff9
cmp ax, 1
jne 0x40dfb0
fld dword [esp + 0x14]
fmul qword [0x633e08]
fstp dword [esp + 0x14]
lea ecx, [esp + 0xe4]
push ecx
lea ecx, [esp + 0x100]
call fcn.0051c490
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.0042afc0
push ecx
lea edx, [esp + 0x78]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042afc0
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 0x40e1b7
lea edx, [esp + 0x4c]
push edx
lea ecx, [esp + 0x100]
call fcn.005204b0
mov ecx, dword [esp + 0x4c]
mov eax, dword [esp + 0x3c]
cmp ecx, dword [esp + 0x38]
jne 0x40e05f
cmp dword [esp + 0x50], eax
je 0x40e127
cmp ecx, dword [esp + 0x18]
jne 0x40e073
mov ecx, dword [esp + 0x50]
cmp ecx, dword [esp + 0x1c]
je 0x40e127
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.0042afc0
push ecx
lea ecx, [esp + 0x80]
fstp dword [esp]
push ecx
mov ecx, esi
call fcn.0042afc0
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.0042afc0
push ecx
lea edx, [esp + 0x88]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042afc0
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.0042afc0
lea eax, [esp + 0x8c]
jmp 0x40e190
cmp dword [esp + 0x20], 1
jne 0x40e170
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.0042afc0
push ecx
lea edx, [esp + 0x5c]
fstp dword [esp]
push edx
mov ecx, esi
call fcn.0042afc0
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.0042afc0
lea eax, [esp + 0x48]
push ecx
fstp dword [esp]
push eax
mov ecx, esi
call fcn.0042afc0
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.00573da0
lea ecx, [esp + 0x128]
call fcn.00572760
mov eax, dword [esp + 0x134]
cmp eax, dword [esp + 0x138]
jbe 0x40db40
lea ecx, [esp + 0x128]
mov dword [esp + 0x258], 0xffffffff
call fcn.005717a0
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.005fb9ce
add esp, 0x248
ret 0xc