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

Disassembly:
push 0xffffffffffffffff
push 0x613645
mov eax, dword fs:[0]
push eax
sub esp, 0x244
mov eax, dword [0x685e38]
xor eax, esp
mov dword [esp + 0x240], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x685e38]
xor eax, esp
push eax
lea eax, [esp + 0x258]
mov dword fs:[0], eax
mov edi, dword [esp + 0x26c]
mov eax, dword [esp + 0x268]
mov esi, ecx
mov ecx, dword [esp + 0x270]
push ecx
push edi
mov ecx, esi
mov dword [esp + 0x78], eax
mov dword [esp + 0x20], edi
call fcn.0040c210
cmp eax, 0xffffffff
jne 0x40e8ef
xor eax, eax
jmp 0x40f195
push 0x1c
lea ebx, [eax + 3]
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
mov ebp, eax
add esp, 4
mov dword [esp + 0x44], ebp
mov dword [esp + 0x260], 0
test ebp, ebp
je 0x40e922
mov ecx, ebp
call dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMB2DGeometry::constructor_void_]
mov dword [ebp], vtable.BMB2DGeometry.0
jmp 0x40e924
xor ebp, ebp
push 0xffffffffffffffff
mov ecx, edi
mov dword [esp + 0x264], 0xffffffff
mov byte [ebp + 8], 3
call fcn.00564d60
lea edx, [esp + 0x14]
push edx
mov ecx, esi
mov dword [esp + 0x18], eax
call fcn.0042afc0
fstp dword [ebp + 0xc]
push ebx
mov ecx, ebp
mov dword [ebp + 0x10], ebx
call dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMB2DGeometry::AllocateGeUnitArray_int_]
mov al, byte [edi + 8]
and al, 0xf
cmp al, 1
jne 0x40e966
jmp 0x40e975
cmp al, 2
jne 0x40e96c
jmp 0x40e975
cmp al, 3
setne al
dec al
and al, 3
fldz
mov ebx, dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMB2DGeometry::PutGeUnit_int__unsigned_char__float__float_]
sub esp, 8
fstp dword [esp + 4]
movzx eax, al
mov dword [esp + 0x1c], eax
mov ecx, ebp
fild dword [esp + 0x1c]
fstp dword [esp]
push 8
push 0
call ebx
mov ecx, dword [edi + 0x14]
mov edx, dword [edi + 0x10]
lea eax, [esp + 0x14]
mov dword [esp + 0x14], ecx
push eax
mov ecx, esi
mov dword [esp + 0x20], edx
call fcn.0042afc0
push ecx
lea ecx, [esp + 0x20]
fstp dword [esp]
push ecx
mov ecx, esi
call fcn.0042afc0
push ecx
fstp dword [esp]
push 9
push 1
mov ecx, ebp
call ebx
fldz
mov edx, dword [edi + 0x18]
push ecx
lea eax, [esp + 0x20]
fstp dword [esp]
push eax
mov ecx, esi
mov dword [esp + 0x24], edx
call fcn.0042afc0
push ecx
fstp dword [esp]
push 0xa
push 2
mov ecx, ebp
call ebx
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x1c]
mov edi, 3
call fcn.00560cd0
mov edx, dword [esp + 0x18]
push edx
lea ecx, [esp + 0x134]
call fcn.00572480
lea ecx, [esp + 0x130]
mov dword [esp + 0x260], 1
call fcn.00572730
lea ecx, [esp + 0x130]
call fcn.00572970
cmp eax, 0x20
jne 0x40ea92
mov eax, dword [esp + 0x150]
push eax
lea ecx, [esp + 0xc8]
call fcn.005813b0
lea ecx, [esp + 0xa0]
push ecx
lea ecx, [esp + 0xc8]
mov byte [esp + 0x264], 2
call fcn.00581480
mov edx, dword [eax]
mov dword [esp + 0x28], edx
mov eax, dword [eax + 4]
lea ecx, [esp + 0xc4]
mov dword [esp + 0x2c], eax
mov byte [esp + 0x260], 1
call fcn.00581450
lea ecx, [esp + 0x130]
mov dword [esp + 0x14], 1
call fcn.00572730
mov ecx, dword [esp + 0x13c]
cmp ecx, dword [esp + 0x140]
ja 0x40f16e
lea ebx, [ebx]
lea ecx, [esp + 0x130]
call fcn.00572970
cmp eax, 0x20
je 0x40f14e
lea ecx, [esp + 0x130]
call fcn.00572970
cmp eax, 0x11
je 0x40ec04
cmp eax, 0x16
jne 0x40f14e
mov edx, dword [esp + 0x150]
push edx
lea ecx, [esp + 0xc8]
call fcn.0057e0d0
mov eax, dword [esp + 0xd0]
mov ecx, dword [esp + 0xd4]
mov byte [esp + 0x260], 3
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], ecx
cmp dword [esp + 0x28], eax
jne 0x40eb4a
cmp dword [esp + 0x2c], ecx
jne 0x40eb4a
lea ecx, [esp + 0xc4]
mov byte [esp + 0x260], 1
call fcn.0057e100
jmp 0x40f14e
cmp dword [esp + 0x14], 1
jne 0x40eb9d
mov ecx, dword [esp + 0xc8]
mov eax, dword [esp + 0xcc]
lea edx, [esp + 0x84]
mov dword [esp + 0x68], ecx
push edx
mov ecx, esi
mov dword [esp + 0x88], 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 + 0x14], 0
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x48]
lea eax, [esp + 0x78]
mov dword [esp + 0x78], ecx
push eax
mov ecx, esi
mov dword [esp + 0x84], edx
call fcn.0042afc0
push ecx
lea ecx, [esp + 0x84]
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 + 0x48]
mov eax, dword [esp + 0x4c]
lea ecx, [esp + 0xc4]
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], eax
inc edi
mov byte [esp + 0x260], 1
call fcn.0057e100
jmp 0x40f14e
mov ecx, dword [esp + 0x150]
push ecx
lea ecx, [esp + 0x108]
call fcn.005784d0
cmp dword [esp + 0x270], 1
mov edx, dword [esp + 0x110]
mov eax, dword [esp + 0x108]
mov ecx, dword [esp + 0x10c]
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x114]
mov byte [esp + 0x260], 4
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ecx
mov dword [esp + 0x24], edx
jne 0x40ee19
cmp dword [esp + 0x110], eax
jne 0x40ec94
cmp edx, ecx
jne 0x40ec94
mov eax, dword [esp + 0x120]
lea ecx, [eax + eax]
lea edx, [esp + 0x1c]
mov dword [esp + 0x1c], ecx
push edx
mov ecx, esi
call fcn.0042afc0
fld dword [esi + 0x154]
fcompp
fnstsw ax
test ah, 0x41
je 0x40f13a
lea ecx, [esp + 0x30]
call fcn.005f3af0
fild dword [esi + 0x158]
push 1
sub esp, 8
fdivr qword [0x634610]
lea eax, [esp + 0x3c]
lea ecx, [esp + 0x110]
mov byte [esp + 0x26c], 5
fstp qword [esp]
push eax
call fcn.00520710
cmp dword [esp + 0x14], 1
jne 0x40ed4b
cmp dword [esp + 0x30], 0
jle 0x40ecde
mov eax, dword [esp + 0x38]
jmp 0x40ece9
push 0
lea ecx, [esp + 0x34]
call fcn.005effb0
cmp dword [esp + 0x30], 0
mov ecx, dword [eax + 4]
mov dword [esp + 0x88], ecx
jle 0x40ed00
mov eax, dword [esp + 0x38]
jmp 0x40ed0b
push 0
lea ecx, [esp + 0x34]
call fcn.005effb0
mov edx, dword [eax]
lea eax, [esp + 0x88]
push eax
mov ecx, esi
mov dword [esp + 0x94], edx
call fcn.0042afc0
push ecx
lea ecx, [esp + 0x94]
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 + 0x14], 0
mov edx, dword [esp + 0x30]
mov ecx, 1
cmp edx, ecx
mov dword [esp + 0x18], ecx
jle 0x40edf3
jmp 0x40ed66
mov ecx, dword [esp + 0x18]
cmp ecx, edx
jge 0x40ed73
mov eax, dword [esp + 0x38]
lea eax, [eax + ecx*8]
jmp 0x40ed85
push ecx
lea ecx, [esp + 0x34]
call fcn.005effb0
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x18]
cmp ecx, edx
mov eax, dword [eax + 4]
mov dword [esp + 0x98], eax
jge 0x40ed9c
mov edx, dword [esp + 0x38]
lea eax, [edx + ecx*8]
jmp 0x40eda6
push ecx
lea ecx, [esp + 0x34]
call fcn.005effb0
mov eax, dword [eax]
lea ecx, [esp + 0x98]
push ecx
mov ecx, esi
mov dword [esp + 0xb8], eax
call fcn.0042afc0
push ecx
lea edx, [esp + 0xb8]
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 + 0x18]
mov edx, dword [esp + 0x30]
inc eax
inc edi
cmp eax, edx
mov dword [esp + 0x18], eax
jl 0x40ed62
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x2c], ecx
lea ecx, [esp + 0x30]
mov dword [esp + 0x28], eax
mov byte [esp + 0x260], 4
call fcn.005f3b00
jmp 0x40f13a
cmp dword [esp + 0x110], eax
jne 0x40efbe
cmp dword [esp + 0x114], ecx
jne 0x40efbe
lea edx, [esp + 0xbc]
mov dword [esp + 0xbc], ecx
push edx
mov ecx, esi
mov dword [esp + 0x68], eax
call fcn.0042afc0
push ecx
lea eax, [esp + 0x68]
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 + 0xf4]
push ecx
lea ecx, [esp + 0x108]
inc edi
call fcn.0051d930
push eax
lea ecx, [esp + 0xa4]
call fcn.005f0660
mov edx, dword [esp + 0xa4]
mov eax, dword [esp + 0xa0]
lea ecx, [esp + 0x9c]
push ecx
mov ecx, esi
mov dword [esp + 0xa0], edx
mov dword [esp + 0x70], eax
call fcn.0042afc0
push ecx
lea edx, [esp + 0x70]
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 + 0x120]
lea ecx, [eax + eax]
lea edx, [esp + 0xac]
mov dword [esp + 0xac], ecx
push edx
mov ecx, esi
inc edi
call fcn.0042afc0
fstp dword [esp + 0x1c]
fldz
sub esp, 8
fstp dword [esp + 4]
mov ecx, ebp
fld dword [esp + 0x24]
fstp dword [esp]
push 1
push edi
call ebx
lea ecx, [esp + 0x104]
inc edi
call fcn.0051f0a0
fstp dword [esp + 0x18]
mov eax, dword [esp + 0x124]
and eax, 0xfffffff9
cmp ax, 1
jne 0x40ef38
fld dword [esp + 0x18]
fmul qword [0x633e08]
fstp dword [esp + 0x18]
lea ecx, [esp + 0xec]
push ecx
lea ecx, [esp + 0x108]
call fcn.0051c490
fld qword [eax]
fld dword [esp + 0x18]
sub esp, 8
fstp dword [esp + 4]
mov ecx, ebp
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
fstp dword [esp]
push 5
push edi
call ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x74]
push ecx
mov ecx, esi
inc edi
mov dword [esp + 0x78], edx
mov dword [esp + 0xac], eax
call fcn.0042afc0
push ecx
lea edx, [esp + 0xac]
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 + 0x20]
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], ecx
jmp 0x40f139
lea edx, [esp + 0x50]
push edx
lea ecx, [esp + 0x108]
call fcn.005204b0
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x40]
cmp ecx, dword [esp + 0x3c]
jne 0x40efe7
cmp dword [esp + 0x54], eax
je 0x40f0a9
cmp ecx, dword [esp + 0x20]
jne 0x40effb
mov ecx, dword [esp + 0x54]
cmp ecx, dword [esp + 0x24]
je 0x40f0a9
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x7c], eax
lea eax, [esp + 0x7c]
push eax
mov ecx, esi
mov dword [esp + 0x18], 1
mov dword [esp + 0xbc], edx
call fcn.0042afc0
push ecx
lea ecx, [esp + 0xbc]
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 + 0x54]
mov eax, dword [esp + 0x50]
lea ecx, [esp + 0x58]
push ecx
mov ecx, esi
inc edi
mov dword [esp + 0x5c], edx
mov dword [esp + 0xc4], eax
call fcn.0042afc0
push ecx
lea edx, [esp + 0xc4]
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 + 0x20]
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x8c]
mov dword [esp + 0xb0], ecx
push edx
mov ecx, esi
inc edi
mov dword [esp + 0x90], eax
call fcn.0042afc0
lea eax, [esp + 0xb0]
jmp 0x40f112
cmp dword [esp + 0x14], 1
jne 0x40f0f2
lea ecx, [esp + 0x94]
mov dword [esp + 0x94], eax
mov eax, dword [esp + 0x3c]
push ecx
mov ecx, esi
mov dword [esp + 0x60], eax
call fcn.0042afc0
push ecx
lea edx, [esp + 0x60]
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 + 0x14], 0
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x60]
mov dword [esp + 0x44], ecx
push edx
mov ecx, esi
mov dword [esp + 0x64], eax
call fcn.0042afc0
lea eax, [esp + 0x44]
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 + 0x24]
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x28], ecx
inc edi
lea ecx, [esp + 0x104]
mov byte [esp + 0x260], 1
call fcn.00573da0
lea ecx, [esp + 0x130]
call fcn.00572760
mov eax, dword [esp + 0x13c]
cmp eax, dword [esp + 0x140]
jbe 0x40eac0
mov ecx, dword [esp + 0x70]
push ebp
call dword [sym.imp.BMB_NX_C9.dll_public:_void___thiscall_BMBElement::Add2DShape_class_BMB2DGeometry__]
lea ecx, [esp + 0x130]
mov dword [esp + 0x260], 0xffffffff
call fcn.005717a0
mov eax, 1
mov ecx, dword [esp + 0x258]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x240]
xor ecx, esp
call fcn.005fb9ce
add esp, 0x250
ret 0xc