Function at 0x10165f30
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10221015
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x104fb780]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x18], edi
mov esi, dword [edi + 4]
add esi, 0x44
push esi
mov dword [ebp - 0x2c], esi
call fcn.1010aece
add esp, 4
test eax, eax
jne 0x10166136
mov eax, dword [esi + 0x2c]
cmp eax, 0x7fffffff
je 0x1016613d
mov eax, dword [edi + 4]
mov edx, dword [ebp + 8]
mov dword [ebp - 4], 0
mov ebx, dword [eax + 0x78]
sub ebx, dword [eax + 0x74]
sar ebx, 3
cmp edx, ebx
jae 0x10165fab
mov ecx, edi
call fcn.10165d90
mov edx, dword [ebp + 8]
xor ebx, ebx
mov eax, dword [edi + 4]
mov edi, dword [eax + 0x74]
add eax, 0x74
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x1c], eax
mov ecx, dword [eax + 4]
mov dword [ebp - 0x14], ecx
sub dword [ebp - 0x14], edi
sar dword [ebp - 0x14], 3
mov edi, dword [ebp - 0x18]
mov dword [ebp - 0x28], ecx
cmp edx, dword [ebp - 0x14]
jae 0x10165ff9
mov eax, dword [ebp - 0x24]
lea edx, [eax + edx*8]
mov eax, edx
cmp edx, ecx
je 0x10165ff1
nop
cmp dword [eax + 4], 0
jne 0x10166148
add eax, 8
cmp eax, ecx
jne 0x10165fe0
mov eax, dword [ebp - 0x1c]
mov dword [eax + 4], edx
jmp 0x1016603d
jbe 0x1016603d
mov eax, dword [eax + 8]
sub eax, dword [ebp - 0x24]
sar eax, 3
cmp edx, eax
jbe 0x10166017
mov ecx, dword [ebp - 0x1c]
lea eax, [ebp - 0xd]
push eax
push edx
call fcn.101650d0
jmp 0x1016603d
sub edx, dword [ebp - 0x14]
je 0x10166037
lea edi, [edx*8]
push edi
push 0
push ecx
call fcn.10122460
mov ecx, dword [ebp - 0x28]
add esp, 0xc
add ecx, edi
mov edi, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov dword [eax + 4], ecx
cmp ebx, dword [ebp + 8]
jae 0x101660fa
mov dword [ebp - 0x28], 0
nop dword [eax]
push 0x10
call fcn.1011fa0f
mov edi, eax
add esp, 4
test edi, edi
je 0x10166092
mov ecx, dword [ebp - 0x18]
mov dword [edi], 0
mov dword [edi + 4], 0
mov eax, dword [ecx + 8]
test eax, eax
je 0x1016607b
lock inc dword [eax + 4]
mov eax, dword [ecx + 4]
mov dword [edi], eax
mov eax, dword [ecx + 8]
mov dword [edi + 4], eax
mov dword [edi + 8], ecx
mov dword [edi + 0xc], 0x101663e0
jmp 0x10166094
xor edi, edi
lea ecx, [ebp - 0x28]
call fcn.101655d0
mov dword [ebp - 0x24], edi
lea eax, [ebp - 0x1c]
mov byte [ebp - 4], 1
push eax
push 0
push edi
push 0x10165010
push 0
push 0
call fcn.1012d2ae
mov edx, eax
add esp, 0x18
mov dword [ebp - 0x20], edx
test edx, edx
je 0x10166128
mov edi, dword [ebp - 0x18]
mov byte [ebp - 4], 0
mov ecx, dword [edi + 4]
mov ecx, dword [ecx + 0x74]
cmp dword [ecx + ebx*8 + 4], 0
jne 0x10166148
mov eax, dword [ebp - 0x1c]
xorps xmm0, xmm0
movlpd qword [ebp - 0x20], xmm0
mov dword [ecx + ebx*8], edx
mov dword [ecx + ebx*8 + 4], eax
cmp dword [ebp - 0x1c], 0
jne 0x10166148
inc ebx
cmp ebx, dword [ebp + 8]
jb 0x10166050
mov eax, dword [edi + 4]
mov ecx, dword [eax + 0x78]
sub ecx, dword [eax + 0x74]
sub eax, 0xffffff80
sar ecx, 3
xchg dword [eax], ecx
push esi
call fcn.1010aedf
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 6
mov dword [ebp - 0x1c], 0
call fcn.1010a516
push 5
call fcn.1010a516
dec eax
push 6
mov dword [esi + 0x2c], eax
call fcn.1010a516
call fcn.10130390
int3