Function at 0x510640
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push ecx
mov eax, dword [0x5dd190]
push esi
push edi
mov eax, dword [eax + 0xc]
test eax, eax
je 0x510783
cmp dword [eax + 0x5c], 3
je 0x510783
lea ecx, [ebp - 4]
mov dword [eax + 0x50], ecx
mov ecx, dword [0x5dd190]
mov eax, dword [ecx + 0xc]
mov edx, dword [ecx]
sub edx, dword [eax + 0x50]
mov dword [eax + 0x58], edx
mov eax, dword [0x5dd190]
mov eax, dword [eax + 0xc]
mov ecx, dword [eax + 0x58]
test ecx, ecx
jge 0x51068d
mov dword [eax + 0x58], 0
mov ecx, dword [0x5dd190]
mov ecx, dword [ecx + 0xc]
mov edx, dword [ecx + 0x58]
mov eax, dword [ecx + 0x54]
cmp edx, eax
jle 0x510712
mov eax, 0x51eb851f
imul edx
sar edx, 5
mov eax, edx
shr eax, 0x1f
lea eax, [edx + eax + 1]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 2
mov dword [ecx + 0x54], edx
mov eax, dword [0x5dd190]
mov eax, dword [eax + 0xc]
mov ecx, dword [eax + 0x4c]
test ecx, ecx
je 0x5106e7
mov edx, dword [eax + 0x54]
push 0x1eb
push str.thread.d
push edx
push ecx
call fcn.005946f5
add esp, 8
jmp 0x5106fd
mov eax, dword [eax + 0x54]
push 0x1ed
push str.thread.d
push eax
call fcn.0059306c
add esp, 4
push eax
call fcn.0051f4b0
mov ecx, dword [0x5dd190]
add esp, 0xc
mov edx, dword [ecx + 0xc]
mov dword [edx + 0x4c], eax
mov eax, dword [0x5dd190]
mov eax, dword [eax + 0xc]
mov ecx, dword [eax + 0x58]
test ecx, ecx
je 0x510735
mov esi, dword [eax + 0x50]
mov edi, dword [eax + 0x4c]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x5dd190]
push 0
mov ecx, dword [eax + 0xc]
add ecx, 0xc
push ecx
call fcn.00595b14
add esp, 8
test eax, eax
je 0x510783
mov edx, dword [0x5dd190]
mov eax, dword [edx + 0xc]
mov ecx, dword [eax + 0x58]
test ecx, ecx
je 0x510773
mov esi, dword [eax + 0x4c]
mov edi, dword [eax + 0x50]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
mov dword [0x5c44ac], 1
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x5dd190]
mov eax, dword [ecx + 8]
test eax, eax
je 0x51079c
mov edx, dword [eax + 4]
mov ecx, dword [edx + 0x84]
mov dword [eax + 4], ecx
mov edx, dword [0x5dd190]
mov eax, dword [edx + 0x14]
test eax, eax
je 0x5107d3
call fcn.005a3a93
test eax, eax
je 0x5107d3
mov eax, dword [0x5dd190]
push 0
mov ecx, dword [eax + 0x14]
mov edx, dword [ecx]
push edx
call 0x510820
mov eax, dword [0x5dd190]
add esp, 8
mov dword [eax + 0x14], 0
mov eax, dword [0x5dd190]
mov ecx, dword [eax + 4]
mov dword [eax + 8], ecx
mov ecx, dword [0x5dd190]
mov eax, dword [ecx + 8]
test eax, eax
je 0x510815
mov edx, dword [eax + 4]
push 1
mov dword [ecx + 0xc], edx
mov eax, dword [0x5dd190]
mov eax, dword [eax + 0xc]
mov ecx, dword [eax + 0x5c]
test ecx, ecx
jne 0x51080c
push 0x5efba0
call fcn.00595a98
add eax, 0xc
push eax
call fcn.00595a98
push 0
call fcn.00593892
nop
nop
nop
nop
mov eax, dword [0x5efb9c]
push esi
push edi
mov edi, dword [esp + 0xc]
push eax
push edi
call fcn.00520040
mov esi, eax
add esp, 8
cmp dword [esi + 0x5c], 2
jne 0x5108b8
mov eax, dword [esi + 0x70]
dec eax
mov dword [esi + 0x70], eax
jne 0x5108b8
mov eax, dword [esi + 0x6c]
test eax, eax
mov dword [esi + 0x5c], eax
je 0x510855
cmp eax, 1
jne 0x5108b8
mov eax, dword [esi + 0x88]
test eax, eax
je 0x51086d
mov ecx, dword [esi + 0x84]
mov dword [eax + 0x84], ecx
jmp 0x51087b
mov eax, dword [0x5dd190]
mov edx, dword [esi + 0x84]
mov dword [eax + 0x10], edx
mov eax, dword [esi + 0x84]
test eax, eax
je 0x510891
mov ecx, dword [esi + 0x88]
mov dword [eax + 0x88], ecx
push esi
call fcn.005108c0
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x5108b8
mov edx, dword [0x5dd190]
mov ecx, dword [esi + 0x64]
mov eax, dword [edx + 0xc]
cmp ecx, dword [eax + 0x64]
jle 0x5108b8
call fcn.00510640
mov eax, edi
pop edi
pop esi
ret