Function at 0x404990
Capabilities:
Hide graphical window

Disassembly:
sub esp, 0x5c
push ebx
push ebp
mov ebp, dword [esp + 0x68]
push esi
push edi
lea esi, [ebp + 0x7c]
lea edi, [esp + 0x74]
lea ebx, [esp + 0x70]
call fcn.00402550
mov eax, dword [esp + 0x70]
cmp eax, dword [ebp + 0x84]
je 0x404dc2
add eax, 0xc
lea esi, [esp + 0x20]
call fcn.00418a30
mov edi, dword [esp + 0x20]
test byte [edi + 0x10], 4
jne 0x404d91
mov eax, dword [esp + 0x74]
push eax
call dword [0x43924c]
test eax, eax
je 0x404d91
lea esi, [esp + 0x1c]
call fcn.0041c820
or eax, 0xffffffff
mov dword [edi + 0x20], eax
mov dword [edi + 0x24], eax
mov ebx, dword [ebp + 0xf0]
lea esi, [ebp + 0xd8]
mov dword [edi + 0x28], ebx
mov dword [edi + 0x2c], eax
mov dword [edi + 0x30], eax
call fcn.0041a970
mov edi, eax
mov dword [esp + 0x14], edi
call fcn.0041a9c0
mov dword [esp + 0x70], eax
call fcn.0041aaf0
cmp ebx, 2
jne 0x404bb4
mov ecx, dword [esp + 0x74]
mov dword [ebp + 0xe0], ecx
test edi, edi
je 0x404ada
lea edi, [esp + 0x14]
lea ebx, [esp + 0x70]
lea esi, [ebp + 0x7c]
call fcn.00402550
mov eax, dword [esp + 0x70]
cmp eax, dword [ebp + 0x84]
je 0x404d5f
add eax, 0xc
lea esi, [esp + 0x28]
call fcn.00418a30
mov eax, dword [esp + 0x28]
mov edx, dword [eax + 0x2c]
mov ecx, dword [esp + 0x20]
mov edi, dword [esp + 0x14]
mov dword [ecx + 0x2c], edx
mov edx, dword [eax + 0x30]
mov dword [ecx + 0x30], edx
or ecx, 0xffffffff
push 9
push edi
mov dword [eax + 0x28], 0
mov dword [eax + 0x2c], ecx
mov dword [eax + 0x30], ecx
call dword [0x4392d4]
lea eax, [esp + 0x30]
push eax
push edi
call dword [0x4392f8]
push edi
lea esi, [esp + 0x44]
call fcn.0041c190
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x54]
push 0x615
push 0
push 0
push ecx
add edx, 0xf
push edx
push 0
push edi
call dword [0x43930c]
jmp 0x404d56
cmp dword [esp + 0x70], 0
je 0x404d5f
lea edi, [esp + 0x70]
lea ebx, [esp + 0x14]
lea esi, [ebp + 0x7c]
call fcn.00402550
mov eax, dword [esp + 0x14]
cmp eax, dword [ebp + 0x84]
je 0x404d5f
add eax, 0xc
lea esi, [esp + 0x14]
call fcn.00418a30
mov edi, dword [esp + 0x14]
mov ebx, dword [edi + 0x2c]
cmp ebx, 0xffffffff
je 0x404bab
mov eax, dword [esp + 0x74]
push eax
lea esi, [esp + 0x44]
call fcn.0041c190
mov eax, dword [ebp + 0x74]
cmp dword [eax + 0xff14], 0
lea ecx, [eax + 0xff14]
je 0x404b45
mov eax, ecx
jmp 0x404b4a
add eax, 0xff0c
lea esi, [esp + 0x28]
call fcn.00418a30
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx + 0x128]
add edx, edx
mov eax, ebx
sub eax, edx
sub eax, dword [ecx + 0x130]
mov ecx, dword [ebp + 0x74]
sub eax, dword [esp + 0x54]
mov esi, dword [ecx + 0xff04]
cmp eax, esi
jge 0x404b9b
mov ecx, esi
sub ecx, eax
mov eax, dword [edi + 0x30]
lea edx, [ecx + ebx]
sub eax, ecx
mov dword [edi + 0x2c], edx
mov dword [edi + 0x30], eax
mov eax, dword [esp + 0x70]
push 0xffffffffffffffff
push eax
push ebp
call fcn.00404110
mov eax, esi
mov ecx, dword [esp + 0x20]
mov dword [ecx + 0x30], eax
lea eax, [esp + 0x28]
call fcn.00402510
lea eax, [esp + 0x14]
jmp 0x404d5a
cmp ebx, 3
jne 0x404d5f
cmp dword [esp + 0x70], 0
mov edx, dword [esp + 0x74]
mov dword [ebp + 0xe4], edx
je 0x404c72
lea edi, [esp + 0x70]
lea ebx, [esp + 0x14]
lea esi, [ebp + 0x7c]
call fcn.00402550
mov eax, dword [esp + 0x14]
cmp eax, dword [ebp + 0x84]
je 0x404d5f
add eax, 0xc
lea esi, [esp + 0x28]
call fcn.00418a30
mov eax, dword [esp + 0x28]
mov edx, dword [eax + 0x2c]
mov ecx, dword [esp + 0x20]
mov edi, dword [esp + 0x70]
mov dword [ecx + 0x2c], edx
mov edx, dword [eax + 0x30]
mov dword [ecx + 0x30], edx
or ecx, 0xffffffff
push 9
push edi
mov dword [eax + 0x28], 0
mov dword [eax + 0x2c], ecx
mov dword [eax + 0x30], ecx
call dword [0x4392d4]
lea eax, [esp + 0x30]
push eax
push edi
call dword [0x4392f8]
push edi
lea esi, [esp + 0x44]
call fcn.0041c190
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
sub edx, dword [esp + 0x38]
mov eax, dword [esp + 0x5c]
push 0x615
push 0
push 0
push ecx
lea ecx, [edx + eax - 0xf]
push ecx
push 0
push edi
call dword [0x43930c]
jmp 0x404d56
test edi, edi
je 0x404d5f
lea edi, [esp + 0x14]
lea ebx, [esp + 0x70]
lea esi, [ebp + 0x7c]
call fcn.00402550
mov eax, dword [esp + 0x70]
cmp eax, dword [ebp + 0x84]
je 0x404d5f
add eax, 0xc
lea esi, [esp + 0x28]
call fcn.00418a30
mov edx, dword [esp + 0x28]
mov ebx, dword [edx + 0x30]
cmp ebx, 0xffffffff
je 0x404d56
mov eax, dword [esp + 0x74]
push eax
lea esi, [esp + 0x44]
call fcn.0041c190
mov ecx, dword [ebp + 0x74]
cmp dword [ecx + 0xff14], 0
lea eax, [ecx + 0xff14]
jne 0x404cdc
lea eax, [ecx + 0xff0c]
lea esi, [esp + 0x30]
call fcn.00418a30
mov edi, dword [esp + 0x30]
mov ecx, dword [edi + 0x128]
mov eax, dword [esp + 0x54]
mov edx, dword [edi + 0x130]
lea eax, [eax + ecx*2]
mov ecx, dword [esp + 0x5c]
sub ecx, dword [esp + 0x54]
add eax, ebx
add eax, edx
sub ecx, eax
sub ecx, edx
mov edx, dword [ebp + 0x74]
mov esi, dword [edx + 0xff04]
cmp ecx, esi
jge 0x404d43
mov eax, dword [esp + 0x28]
sub ecx, esi
add ecx, ebx
mov dword [eax + 0x30], ecx
mov ecx, dword [esp + 0x14]
push 0xffffffffffffffff
push ecx
push ebp
call fcn.00404110
mov eax, dword [esp + 0x5c]
sub eax, dword [edi + 0x130]
mov ecx, esi
sub eax, esi
sub eax, dword [esp + 0x54]
mov edx, dword [esp + 0x20]
mov dword [edx + 0x2c], eax
lea eax, [esp + 0x30]
mov dword [edx + 0x30], ecx
call fcn.00402510
lea eax, [esp + 0x28]
call fcn.00402510
mov edx, dword [esp + 0x74]
push 3
push edx
call dword [0x4392d4]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x404d91
push 0
mov dword [esp + 0x38], eax
lea eax, [esp + 0x34]
push eax
push 8
push 0x49
mov dword [esp + 0x40], 8
call dword [0x439228]
mov esi, dword [esp + 0x24]
test esi, esi
je 0x404dc2
or edx, 0xffffffff
lea ecx, [esi + 8]
lock xadd dword [ecx], edx
jne 0x404dc2
mov eax, dword [esi]
mov edx, dword [eax]
mov ecx, esi
call edx
or ecx, 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
jne 0x404dc2
mov edx, dword [esi]
mov eax, dword [edx + 4]
mov ecx, esi
call eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret 8