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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x45ea27
mov eax, dword fs:[0]
push eax
sub esp, 0xc8
push ebx
push esi
push edi
mov eax, dword [0x4c003c]
xor eax, esp
push eax
lea eax, [esp + 0xd8]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [esp + 0x5c], ebx
mov eax, dword [ebx + 0x34]
or esi, 0xffffffff
xor ecx, ecx
xor edx, edx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x38], edx
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], esi
mov edi, dword [eax + 0xc]
cmp edi, dword [eax + 8]
jne 0x407a12
mov eax, dword [ebp + 8]
mov dword [eax], edx
mov dword [eax + 4], ecx
mov ecx, esi
mov dword [eax + 8], ecx
mov dword [eax + 0xc], esi
mov ecx, dword [esp + 0xd8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp + 0xc]
lea edx, [esp + 0x6c]
push edx
call dword [0x46b8bc]
mov edx, dword [ebp + 0x10]
mov ecx, dword [edx]
mov eax, dword [esp + 0x74]
mov esi, dword [edx + 4]
mov edi, dword [edx + 8]
mov edx, dword [edx + 0xc]
sub ecx, eax
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x78]
sub esi, ecx
mov dword [esp + 0x28], esi
mov esi, dword [esp + 0x6c]
add esi, esi
sub eax, esi
add eax, edi
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x70]
add eax, eax
sub ecx, eax
add ecx, edx
mov dword [esp + 0x54], ecx
mov ecx, dword [ebx + 0x2c]
push ecx
mov ecx, dword [ebx + 0xc]
call dword [0x46be18]
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x24]
call eax
mov dword [esp + 0x60], eax
mov eax, dword [0x46a704]
mov dword [esp + 0x18], eax
mov ecx, 1
lock xadd dword [eax], ecx
cmp byte [ebx + 0x44], 0
mov edi, dword [0x46b8ec]
mov dword [esp + 0xe0], 0
je 0x407ae8
mov ecx, dword [ebx + 0xc]
xor esi, esi
call dword [0x46be48]
test eax, eax
jle 0x407ae8
lea ecx, [esp + 0x30]
call dword [0x46b8e4]
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0xe4], 1
call fcn.00403e00
lea ecx, [esp + 0x30]
mov byte [esp + 0xe0], 0
call edi
mov ecx, dword [ebx + 0xc]
inc esi
call dword [0x46be48]
cmp esi, eax
jl 0x407ab0
mov eax, dword [esp + 0x28]
cmp eax, dword [esp + 0x54]
mov dword [esp + 0x24], eax
jg 0x407f2e
mov esi, dword [esp + 0x50]
mov edx, dword [esp + 0x58]
cmp esi, edx
mov dword [esp + 0x1c], esi
jg 0x407f1f
mov dword [esp + 0x90], eax
jmp 0x407b20
mov ecx, dword [esp + 0x60]
lea eax, [esp + 0x8c]
push eax
lea eax, [ebx + 0x24]
push eax
lea eax, [ebx + 0x20]
push eax
push ecx
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x9c], esi
call fcn.00405d90
add esp, 0x10
test al, al
je 0x407f0c
mov eax, dword [ebx + 0x34]
mov edx, dword [eax + 0xc]
sub edx, dword [eax + 8]
xor ecx, ecx
cmp edx, 1
mov dword [esp + 0x20], ecx
jle 0x407b7e
mov ecx, dword [eax + 0xc]
sub ecx, dword [eax + 8]
mov dword [esp + 0x30], ecx
call dword [0x46a63c]
cdq
idiv dword [esp + 0x30]
mov dword [esp + 0x20], edx
mov ecx, edx
mov eax, dword [ebx + 0x34]
mov edx, dword [eax + 8]
add edx, ecx
cmp byte [ebx + 0x44], 0
mov eax, dword [eax + edx*4 + 0x14]
jne 0x407c0f
mov ecx, dword [esp + 0x24]
mov edx, dword [ebp + 0xc]
push eax
push ecx
push esi
push edx
mov ecx, ebx
call fcn.00406450
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0x7c]
push ecx
lea edx, [esp + 0xb8]
push edx
lea ecx, [esp + 0x74]
mov dword [esp + 0x84], esi
mov dword [esp + 0x88], eax
call dword [0x46a640]
push eax
lea eax, [esp + 0x98]
push eax
lea ecx, [esp + 0x40]
call dword [0x46a644]
mov ecx, dword [esp + 0x94]
mov edx, dword [esp + 0x98]
mov eax, dword [esp + 0x9c]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0xa0]
mov dword [esp + 0x3c], edx
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], ecx
jmp 0x407f0c
lea ecx, [esp + 0x34]
push ecx
mov ecx, eax
mov dword [esp + 0x2c], eax
call fcn.004305f0
mov eax, dword [0x46a708]
mov dword [esp + 0x14], eax
mov edx, 1
lock xadd dword [eax], edx
mov eax, dword [esp + 0x34]
mov ecx, dword [eax + 8]
mov edx, dword [eax + 0xc]
sub edx, ecx
xor esi, esi
mov byte [esp + 0xe0], 3
test edx, edx
jle 0x407d44
mov dword [esp + 0x2c], 0x10
add ecx, esi
mov eax, dword [eax + ecx*4 + 0x14]
lea ecx, [esp + 0x68]
push ecx
mov ecx, eax
call dword [0x46bdf0]
mov edx, dword [ebp + 0xc]
push edx
lea ecx, [esp + 0x68]
push ecx
mov ecx, eax
mov byte [esp + 0xe8], 4
call dword [0x46b8c0]
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0xe4], 5
call fcn.004035e0
lea ecx, [esp + 0x64]
mov byte [esp + 0xe0], 4
call edi
lea ecx, [esp + 0x68]
mov byte [esp + 0xe0], 3
call edi
mov edx, dword [esp + 0x14]
mov eax, dword [edx]
cmp eax, 1
je 0x407cd1
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 8]
push ecx
push edx
lea ecx, [esp + 0x1c]
call fcn.00402f80
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
push edx
add ecx, eax
mov eax, dword [esp + 0x20]
push eax
lea edx, [esp + 0x54]
push edx
call dword [0x46b8c4]
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx + 8]
add edx, esi
lea ecx, [ecx + edx*4 + 0x14]
mov ecx, dword [ecx]
push eax
mov byte [esp + 0xe4], 6
call dword [0x46b8c8]
lea ecx, [esp + 0x4c]
mov bl, al
mov byte [esp + 0xe0], 3
call edi
test bl, bl
jne 0x407e92
mov eax, dword [esp + 0x34]
mov ecx, dword [eax + 8]
mov edx, dword [eax + 0xc]
add dword [esp + 0x2c], 4
inc esi
sub edx, ecx
cmp esi, edx
jl 0x407c57
mov ebx, dword [esp + 0x5c]
mov eax, dword [ebx + 0x34]
mov ecx, dword [eax + 8]
add ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x24]
mov edx, dword [eax + ecx*4 + 0x14]
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebp + 0xc]
push edx
push esi
push eax
push ecx
mov ecx, ebx
call fcn.00406450
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x84]
push eax
lea ecx, [esp + 0xc8]
push ecx
lea ecx, [esp + 0x74]
mov dword [esp + 0x8c], edx
mov dword [esp + 0x90], esi
call dword [0x46a640]
push eax
lea edx, [esp + 0xa8]
push edx
lea ecx, [esp + 0x40]
call dword [0x46a644]
mov eax, dword [esp + 0xa4]
mov ecx, dword [esp + 0xa8]
mov edx, dword [esp + 0xac]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0xb0]
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], eax
mov edx, dword [ecx]
xor esi, esi
cmp dword [edx + 0x3c], esi
jle 0x407e96
mov dword [esp + 0x20], 0x10
mov eax, dword [esp + 0x14]
mov ecx, dword [eax]
cmp ecx, 1
je 0x407e0c
mov eax, dword [esp + 0x14]
mov edx, dword [eax + 4]
mov eax, dword [eax + 8]
push edx
push eax
lea ecx, [esp + 0x1c]
call fcn.00402f80
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
push eax
add ecx, edx
mov edx, dword [esp + 0x20]
push edx
lea eax, [esp + 0x50]
push eax
call dword [0x46b8c4]
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx]
mov byte [esp + 0xe0], 7
cmp edx, 1
je 0x407e53
mov eax, dword [esp + 0x18]
mov ecx, dword [eax + 4]
push ecx
lea ecx, [esp + 0x1c]
call fcn.00403250
mov eax, dword [esp + 0x18]
mov edx, dword [eax + 8]
mov ecx, dword [esp + 0x2c]
add edx, esi
lea eax, [eax + edx*4 + 0x14]
push ecx
mov ecx, dword [eax]
call dword [0x46b8d0]
lea ecx, [esp + 0x48]
mov byte [esp + 0xe0], 3
call edi
mov edx, dword [esp + 0x28]
mov eax, dword [edx]
add dword [esp + 0x20], 4
inc esi
cmp esi, dword [eax + 0x3c]
jl 0x407dec
jmp 0x407e96
mov ebx, dword [esp + 0x5c]
mov eax, dword [esp + 0x14]
mov byte [esp + 0xe0], 2
test eax, eax
je 0x407ee5
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x407ee5
mov eax, dword [esp + 0x14]
mov edx, dword [eax + 8]
lea ecx, [eax + 0x10]
lea esi, [ecx + edx*4]
mov dword [esp + 0x28], eax
mov dword [esp + 0x30], ecx
cmp esi, ecx
je 0x407ed5
sub esi, 4
mov ecx, esi
call edi
cmp esi, dword [esp + 0x30]
jne 0x407ec8
mov eax, dword [esp + 0x28]
push 4
push eax
call dword [0x46a6f8]
add esp, 8
mov ecx, dword [esp + 0x34]
mov byte [esp + 0xe0], 0
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x407f08
mov eax, dword [esp + 0x34]
push eax
call dword [0x46a6d4]
add esp, 4
mov esi, dword [esp + 0x1c]
inc esi
cmp esi, dword [esp + 0x58]
mov dword [esp + 0x1c], esi
jle 0x407b20
mov eax, dword [esp + 0x24]
inc eax
cmp eax, dword [esp + 0x54]
mov dword [esp + 0x24], eax
jle 0x407afa
mov ebx, dword [ebp + 8]
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x40]
mov dword [ebx], ecx
mov ecx, dword [esp + 0x44]
mov dword [ebx + 4], edx
mov edx, dword [esp + 0x18]
mov dword [ebx + 8], eax
mov dword [ebx + 0xc], ecx
mov dword [esp + 0xe0], 0xffffffff
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x407fb2
mov eax, dword [esp + 0x18]
mov ecx, dword [eax + 0xc]
mov edx, dword [eax + 8]
lea esi, [eax + ecx*4 + 0x14]
mov dword [esp + 0x4c], eax
lea eax, [eax + edx*4 + 0x14]
mov dword [esp + 0x48], eax
cmp eax, esi
je 0x407fa4
mov ebx, dword [esi - 4]
sub esi, 4
test ebx, ebx
je 0x407f9d
mov ecx, ebx
call edi
push ebx
call fcn.0045dcd6
mov eax, dword [esp + 0x4c]
add esp, 4
cmp esi, eax
jne 0x407f82
mov ebx, dword [ebp + 8]
mov eax, dword [esp + 0x4c]
push eax
call dword [0x46a6d4]
add esp, 4
mov eax, ebx
mov ecx, dword [esp + 0xd8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc