Function at 0x405d50
Capabilities:
Hide graphical window

Disassembly:
push 0xffffffffffffffff
push 0x4a53cb
mov eax, dword fs:[0]
push eax
sub esp, 0x7c
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4d32ac]
xor eax, esp
push eax
lea eax, [esp + 0x90]
mov dword fs:[0], eax
mov esi, ecx
mov ebp, dword [esp + 0xa0]
mov ecx, dword [ebp + 4]
lea eax, [esp + 0x60]
push eax
push ecx
call dword [0x4a7454]
lea edx, [esp + 0x38]
xor edi, edi
push edx
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], edi
call dword [0x4a7448]
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x38]
push eax
push ecx
lea edx, [esp + 0x68]
push edx
call dword [0x4a744c]
test eax, eax
je 0x40642c
movsx ebx, si
shr esi, 0x10
movsx eax, si
mov dword [esp + 0x14], edi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], eax
lea esp, [esp]
mov ecx, dword [ebp + 0x38]
test ecx, ecx
je 0x405fea
mov eax, dword [ebp + 0x3c]
sub eax, ecx
sar eax, 2
cmp edi, eax
jae 0x405fea
test ecx, ecx
je 0x405e0b
mov eax, dword [ebp + 0x3c]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x405e10
call fcn.0047ebfb
mov ecx, dword [ebp + 0x38]
mov esi, dword [ecx + edi*4]
test esi, esi
mov dword [esp + 0x24], esi
je 0x405e3a
mov edx, dword [esi + 0x28]
cmp edx, dword [ebp + 0x64]
jne 0x405e3a
mov eax, dword [esp + 0x2c]
push eax
push ebx
lea ecx, [esi + 0x18]
push ecx
call dword [0x4a744c]
test eax, eax
jne 0x405e3f
add edi, 1
jmp 0x405de0
cmp dword [ebp + 0x7c], 0
mov dword [ebp + 0xc0], edi
mov dword [esp + 0x14], 1
je 0x405fea
cmp edi, dword [ebp + 0xbc]
je 0x405fea
mov edx, dword [0x4dbc78]
mov eax, dword [edx + 0xc]
mov ecx, 0x4dbc78
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
lea ecx, [esi + 8]
push ecx
lea edx, [esp + 0x20]
push edx
mov ebx, 0x4aa6a8
mov dword [esp + 0xa0], 0
call fcn.004038a0
lea ecx, [esi + 0x10]
push ecx
lea edx, [esp + 0x2c]
push edx
mov ebx, eax
mov byte [esp + 0xa8], 1
call fcn.00405430
add esp, 0x10
lea edi, [esp + 0x18]
mov byte [esp + 0x98], 2
call fcn.00403b10
mov byte [esp + 0x98], 1
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 0x405eec
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor ebx, ebx
mov byte [esp + 0x98], bl
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 0x405f15
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x70]
lea edi, [ebp + 4]
push ecx
push edx
call dword [0x4a7454]
mov eax, dword [esi + 0x18]
mov ecx, dword [esi + 0x1c]
mov edx, dword [esi + 0x20]
mov dword [esp + 0x40], eax
mov eax, dword [esi + 0x24]
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x40]
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], edx
call fcn.004047b0
mov edi, dword [ebp + 0x7c]
push ebx
call fcn.00431440
mov esi, dword [ebp + 0x7c]
push 9
call fcn.00430920
mov ecx, dword [ebp + 0xac]
cmp ecx, ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
je 0x405fb5
mov esi, dword [esp + 0x18]
push esi
lea ebx, [esp + 0x24]
lea edi, [esp + 0x20]
call fcn.0042ddd0
test eax, eax
je 0x405fb5
mov edx, dword [esp + 0x1c]
test edx, edx
je 0x405fb5
mov ecx, dword [esp + 0x20]
test ecx, ecx
jbe 0x405fb5
mov eax, dword [esp + 0x24]
mov eax, dword [eax + 4]
lea edi, [esp + 0x70]
push edi
lea edi, [esp + 0x44]
push edi
push eax
push ecx
mov ecx, esi
mov esi, dword [ebp + 0x7c]
push edx
call fcn.00430e10
mov edi, dword [ebp + 0x7c]
push 1
call fcn.00431440
mov dword [esp + 0x98], 0xffffffff
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
jg 0x405fea
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor esi, esi
lea esp, [esp]
mov eax, dword [ebp + 0x48]
test eax, eax
mov ebx, dword [0x4a7444]
je 0x406140
mov ecx, dword [ebp + 0x4c]
sub ecx, eax
sar ecx, 2
cmp esi, ecx
jae 0x406140
mov ecx, eax
test ecx, ecx
je 0x406023
mov eax, dword [ebp + 0x4c]
sub eax, ecx
sar eax, 2
cmp esi, eax
jb 0x406028
call fcn.0047ebfb
mov ecx, dword [ebp + 0x48]
mov edi, dword [ecx + esi*4]
test edi, edi
je 0x406052
mov edx, dword [edi + 0x38]
cmp edx, dword [ebp + 0x64]
jne 0x406052
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
push eax
push ecx
lea edx, [edi + 0x28]
push edx
call dword [0x4a744c]
test eax, eax
jne 0x406057
add esi, 1
jmp 0x405ff0
add esi, 0xc8
cmp dword [ebp + 0x7c], 0
mov dword [ebp + 0xc0], esi
mov dword [esp + 0x14], 1
je 0x406140
cmp esi, dword [ebp + 0xbc]
je 0x406140
mov ecx, dword [ebp + 4]
lea eax, [esp + 0x70]
push eax
push ecx
call dword [0x4a7454]
mov eax, dword [edi + 0x2c]
mov ecx, dword [edi + 0x30]
mov edx, dword [edi + 0x28]
mov dword [esp + 0x44], eax
lea eax, [esp + 0x40]
mov dword [esp + 0x48], ecx
mov ecx, dword [ebp + 4]
mov dword [esp + 0x40], edx
mov edx, dword [edi + 0x34]
push eax
push ecx
mov dword [esp + 0x54], edx
call ebx
test eax, eax
je 0x4060c6
mov eax, dword [ebp + 4]
lea edx, [esp + 0x48]
push edx
push eax
call ebx
mov esi, dword [ebp + 0x7c]
mov eax, dword [esi + 8]
test eax, eax
je 0x406113
push eax
call dword [0x4a73e4]
test eax, eax
je 0x406113
mov ecx, dword [esi + 8]
xor eax, eax
push 0x3e9
push ecx
mov dword [esi + 0xc4], eax
mov dword [esi + 0xac], eax
call dword [0x4a7484]
mov edx, dword [esi + 8]
push 0x3ea
push edx
call dword [0x4a7484]
mov eax, dword [esi + 8]
push 0
push eax
call dword [0x4a73ec]
mov esi, dword [ebp + 0x7c]
push 9
call fcn.00430920
mov eax, dword [edi + 0x24]
mov esi, dword [ebp + 0x7c]
lea ecx, [esp + 0x70]
push ecx
mov ecx, dword [edi + 0x20]
lea edx, [esp + 0x44]
push edx
push eax
call fcn.004309e0
mov edi, dword [ebp + 0x7c]
push 1
call fcn.00431440
xor esi, esi
mov ecx, dword [ebp + 0x58]
test ecx, ecx
je 0x406320
mov eax, dword [ebp + 0x5c]
sub eax, ecx
sar eax, 2
cmp esi, eax
jae 0x406320
test ecx, ecx
je 0x40616d
mov eax, dword [ebp + 0x5c]
sub eax, ecx
sar eax, 2
cmp esi, eax
jb 0x406172
call fcn.0047ebfb
mov ecx, dword [ebp + 0x58]
mov edi, dword [ecx + esi*4]
test edi, edi
je 0x406194
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
push edx
push eax
lea ecx, [edi + 0x1c]
push ecx
call dword [0x4a744c]
test eax, eax
jne 0x406199
add esi, 1
jmp 0x406142
add esi, 0x190
cmp dword [ebp + 0x7c], 0
mov dword [ebp + 0xc0], esi
mov dword [esp + 0x14], 1
je 0x406320
cmp esi, dword [ebp + 0xbc]
je 0x406320
mov eax, dword [ebp + 4]
lea edx, [esp + 0x80]
push edx
push eax
call dword [0x4a7454]
mov edx, dword [edi + 0x20]
mov eax, dword [edi + 0x24]
mov ecx, dword [edi + 0x1c]
mov dword [esp + 0x2c], edx
lea edx, [esp + 0x28]
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 4]
mov dword [esp + 0x28], ecx
mov ecx, dword [edi + 0x28]
push edx
push eax
mov dword [esp + 0x3c], ecx
call ebx
test eax, eax
je 0x40620b
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x30]
push ecx
push edx
call ebx
mov esi, dword [ebp + 0x7c]
mov eax, dword [esi + 8]
xor ebx, ebx
cmp eax, ebx
je 0x406257
push eax
call dword [0x4a73e4]
test eax, eax
je 0x406257
mov eax, dword [esi + 8]
push 0x3e9
push eax
mov dword [esi + 0xc4], ebx
mov dword [esi + 0xac], ebx
call dword [0x4a7484]
mov ecx, dword [esi + 8]
push 0x3ea
push ecx
call dword [0x4a7484]
mov edx, dword [esi + 8]
push ebx
push edx
call dword [0x4a73ec]
mov esi, dword [ebp + 0x7c]
push 0x14
call fcn.00430920
mov edx, dword [edi + 0x18]
mov esi, dword [ebp + 0x7c]
lea eax, [esp + 0x80]
push eax
lea ecx, [esp + 0x2c]
push ecx
mov ecx, dword [edi + 0x14]
push edx
call fcn.004309e0
mov esi, dword [ebp + 0x7c]
mov eax, dword [esi + 8]
cmp eax, ebx
je 0x406320
mov ebx, dword [0x4a73e4]
push eax
call ebx
test eax, eax
je 0x406320
mov eax, dword [esi + 0x60]
mov ecx, dword [esi + 8]
push 0
push eax
push 0x3ea
push ecx
mov dword [esi + 0xc4], 1
call dword [0x4a7424]
cmp dword [esi + 0xac], 0
jne 0x406307
mov edi, dword [esi + 8]
test edi, edi
je 0x406307
push edi
call ebx
test eax, eax
je 0x406307
push 0xffffffffffffffeb
push edi
call dword [0x4a73fc]
mov ebx, eax
test ebx, ebx
je 0x406307
cmp dword [ebx + 0xac], 0
je 0x406300
push 0x3e9
push edi
call dword [0x4a7484]
mov dword [ebx + 0xac], 0
mov eax, ebx
call fcn.00431720
mov edx, dword [esi + 8]
push 0x213
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push edx
call dword [0x4a73dc]
mov edi, dword [esp + 0x14]
test edi, edi
mov dword [ebp + 0x78], 1
je 0x406343
push 0x7f89
push 0
call dword [0x4a743c]
push eax
call dword [0x4a7440]
xor eax, eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
mov eax, dword [ebp + 4]
lea esi, [ebp + 4]
lea ecx, [esp + 0x50]
push ecx
mov dword [esp + 0x54], 0x10
mov dword [esp + 0x58], 2
mov dword [esp + 0x5c], eax
call dword [0x4a7438]
mov eax, dword [ebp + 0xc0]
cmp eax, dword [ebp + 0xbc]
jne 0x40640d
test edi, edi
jne 0x40641d
mov dword [ebp + 0xbc], 0xffffffff
mov ebp, dword [ebp + 0x7c]
xor ebx, ebx
cmp ebp, ebx
je 0x4063e8
mov eax, dword [ebp + 8]
cmp eax, ebx
je 0x4063e8
push eax
call dword [0x4a73e4]
test eax, eax
je 0x4063e8
mov edx, dword [ebp + 8]
mov edi, dword [0x4a7484]
push 0x3e9
push edx
mov dword [ebp + 0xc4], ebx
mov dword [ebp + 0xac], ebx
call edi
mov eax, dword [ebp + 8]
push 0x3ea
push eax
call edi
mov ecx, dword [ebp + 8]
push ebx
push ecx
call dword [0x4a73ec]
mov edx, dword [esi]
push 0
push 0
push edx
call dword [0x4a7434]
mov eax, dword [esi]
push eax
call dword [0x4a7430]
mov ecx, dword [esp + 0xa4]
mov dword [ecx], 0
jmp 0x406435
test edi, edi
je 0x406390
mov dword [ebp + 0xbc], eax
jmp 0x4063e8
mov edx, dword [esp + 0xa4]
mov dword [edx], 0
jmp 0x406435
mov eax, dword [esp + 0xa4]
mov dword [eax], edi
xor eax, eax
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret 8