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

Disassembly:
push 0xffffffffffffffff
push 0x46751a
mov eax, dword fs:[0]
push eax
sub esp, 0x50
push ebx
push ebp
push esi
push edi
mov eax, dword [0x481670]
xor eax, esp
push eax
lea eax, [esp + 0x64]
mov dword fs:[0], eax
xor ebx, ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
lea eax, [esp + 0x18]
push ebx
push eax
mov dword [esp + 0x74], 1
call fcn.0044d260
lea ecx, [esp + 0x48]
mov byte [esp + 0x74], 2
mov eax, dword [eax]
push ecx
push eax
call fcn.0044e7e0
mov byte [esp + 0x7c], 1
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
add esp, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40a4f6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x44]
cmp eax, ebx
je 0x40a509
mov ecx, dword [esp + 0x48]
sub ecx, eax
sar ecx, 2
jne 0x40a544
mov esi, dword [esp + 0x74]
push 0x4740fc
mov ecx, esi
call fcn.004036e0
mov eax, dword [esp + 0x44]
cmp eax, ebx
je 0x40a9f8
mov edx, dword [esp + 0x74]
push edx
mov edx, dword [esp + 0x4c]
lea ecx, [esp + 0x44]
push ecx
push edx
push eax
call fcn.0040d100
mov eax, dword [esp + 0x54]
push eax
jmp 0x40a9f0
call fcn.00402930
mov dword [esp + 0x38], eax
mov byte [eax + 0x15], 1
mov eax, dword [esp + 0x38]
mov dword [eax + 4], eax
mov eax, dword [esp + 0x38]
mov dword [eax], eax
mov eax, dword [esp + 0x38]
mov dword [eax + 8], eax
mov dword [esp + 0x3c], ebx
mov byte [esp + 0x6c], 3
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x48]
cmp eax, ecx
mov esi, eax
jbe 0x40a589
call fcn.004335f3
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x44]
cmp eax, ecx
lea edx, [esp + 0x40]
mov ebp, edx
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], esi
mov dword [esp + 0x20], ecx
jbe 0x40a5a4
call fcn.004335f3
cmp ebp, ebx
je 0x40a5b0
lea ecx, [esp + 0x40]
cmp ebp, ecx
je 0x40a5b5
call fcn.004335f3
cmp esi, dword [esp + 0x20]
je 0x40a792
lea edx, [esp + 0x2c]
push ebx
push edx
call fcn.0040d250
add esp, 8
mov edi, eax
call fcn.0041e3a5
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
je 0x40a77e
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
lea ecx, [esp + 0x24]
push ebx
push ecx
mov byte [esp + 0x74], 4
call fcn.0044d260
push ebx
mov byte [esp + 0x78], 5
mov ecx, dword [edi]
mov eax, dword [eax]
lea edx, [esp + 0x24]
push edx
push ecx
push eax
call fcn.0044e430
add esp, 0x18
test eax, eax
mov byte [esp + 0x6c], 4
mov eax, dword [esp + 0x24]
setne bl
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a646
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
je 0x40a668
mov byte [esp + 0x6c], 3
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x40a74d
mov edx, dword [esp + 0x18]
test edx, edx
jne 0x40a674
xor eax, eax
jmp 0x40a691
mov eax, edx
lea esi, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a680
sub eax, esi
js 0x40a788
cmp eax, dword [edx - 8]
jg 0x40a788
mov dword [edx - 0xc], eax
mov ecx, dword [esp + 0x18]
push 3
lea edx, [esp + 0x2c]
mov byte [eax + ecx], 0
push edx
mov ecx, edi
call fcn.00407da0
push 0x4743d8
mov byte [esp + 0x70], 6
or dword [esp + 0x18], 2
push eax
call fcn.00407230
add esp, 8
test al, al
jne 0x40a6e0
lea esi, [esp + 0x18]
call fcn.0040ba10
test al, al
jne 0x40a6e0
xor bl, bl
jmp 0x40a6e2
mov bl, 1
mov dword [esp + 0x6c], 4
test byte [esp + 0x14], 2
je 0x40a716
mov eax, dword [esp + 0x28]
and dword [esp + 0x14], 0xfffffffd
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a716
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
jne 0x40a64a
push edi
lea ecx, [esp + 0x38]
call fcn.0040bc10
lea ecx, [esp + 0x18]
push ecx
mov ecx, eax
call fcn.0040bf90
mov byte [esp + 0x6c], 3
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40a759
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test ebp, ebp
jne 0x40a762
call fcn.004335f3
mov esi, dword [esp + 0x30]
cmp esi, dword [ebp + 8]
jb 0x40a770
call fcn.004335f3
add esi, 4
mov dword [esp + 0x30], esi
xor ebx, ebx
jmp 0x40a5a4
push 0x80004005
call fcn.00402f90
push 0x80070057
call fcn.00402f90
cmp dword [esp + 0x3c], ebx
jne 0x40a7c6
mov esi, dword [esp + 0x74]
push 0x4740fc
mov ecx, esi
call fcn.004036e0
or dword [esp + 0x14], 1
lea eax, [esp + 0x34]
mov byte [esp + 0x6c], 1
call fcn.0040c360
mov eax, dword [esp + 0x44]
cmp eax, ebx
jmp 0x40a9d4
mov eax, dword [esp + 0x78]
mov eax, dword [eax]
push str.SetupValues.dat
push ecx
sub eax, 0x10
mov dword [esp + 0x30], esp
mov esi, esp
push eax
call fcn.00402d30
lea ecx, [esp + 0x28]
add esp, 4
add eax, 0x10
push ecx
mov dword [esi], eax
call fcn.00407ce0
add esp, 0xc
mov byte [esp + 0x6c], 7
mov edx, dword [esp + 0x1c]
push 0x1001
push edx
lea ecx, [esp + 0x58]
call fcn.00423ae5
mov dword [esp + 0x50], vtable.cptlib::CStdioFileA.0
mov byte [esp + 0x6c], 8
mov eax, dword [esp + 0x38]
mov esi, dword [eax]
lea ecx, [esp + 0x34]
mov edi, ecx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], esi
mov ebp, eax
mov bl, 0xb
test edi, edi
je 0x40a83f
lea eax, [esp + 0x34]
cmp edi, eax
je 0x40a844
call fcn.004335f3
cmp esi, ebp
je 0x40a96f
test edi, edi
jne 0x40a855
call fcn.004335f3
cmp esi, dword [edi + 4]
jne 0x40a85f
call fcn.004335f3
mov eax, dword [esi + 0xc]
push eax
lea ecx, [esp + 0x24]
call fcn.0040b7d0
lea ecx, [esp + 0x24]
push 0x474404
push ecx
mov ecx, eax
mov byte [esp + 0x74], 9
call fcn.0040b930
add esi, 0x10
lea edx, [esp + 0x30]
push esi
push edx
mov ecx, eax
mov byte [esp + 0x7c], 0xa
call fcn.0040b870
lea ecx, [esp + 0x88]
push 0x474400
push ecx
mov ecx, eax
mov byte [esp + 0x84], bl
call fcn.0040b930
add esp, 0x18
mov byte [esp + 0x6c], 0xc
mov eax, dword [eax]
push eax
lea ecx, [esp + 0x54]
call fcn.004521c0
mov byte [esp + 0x6c], bl
mov eax, dword [esp + 0x78]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40a8ea
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x6c], 0xa
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a90f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x6c], 9
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a934
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x6c], 8
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a959
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea esi, [esp + 0x2c]
call fcn.0040cf60
mov esi, dword [esp + 0x30]
mov edi, dword [esp + 0x2c]
jmp 0x40a833
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
push eax
call fcn.00402d30
mov esi, dword [esp + 0x78]
or dword [esp + 0x18], 1
add eax, 0x10
add esp, 4
lea ecx, [esp + 0x50]
mov dword [esi], eax
mov byte [esp + 0x6c], 7
call fcn.004238de
mov byte [esp + 0x6c], 3
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a9c0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esp + 0x34]
mov byte [esp + 0x6c], 1
call fcn.0040c360
mov eax, dword [esp + 0x44]
test eax, eax
je 0x40a9f8
mov ecx, dword [esp + 0x74]
push ecx
mov ecx, dword [esp + 0x4c]
lea edx, [esp + 0x44]
push edx
push ecx
push eax
call fcn.0040d100
mov edx, dword [esp + 0x54]
push edx
call fcn.004175c8
add esp, 0x14
mov eax, esi
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret 8