Function at 0x1005507
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
mov ecx, dword [ebp + 8]
mov eax, dword [0x1009988]
mov edx, dword [0x100998c]
add ecx, 0x17
and ecx, 0xfffffff0
push ebx
mov dword [ebp - 0x10], ecx
sar ecx, 4
push esi
lea eax, [eax + eax*4]
push edi
dec ecx
cmp ecx, 0x20
lea edi, [edx + eax*4]
mov dword [ebp - 4], edi
jge 0x100533a
or esi, 0xffffffff
shr esi, cl
or dword [ebp - 8], 0xffffffff
jmp 0x1005347
add ecx, 0xffffffe0
or eax, 0xffffffff
xor esi, esi
shr eax, cl
mov dword [ebp - 8], eax
mov eax, dword [0x1009994]
mov ebx, eax
mov dword [ebp - 0xc], esi
cmp ebx, edi
jmp 0x1005369
mov ecx, dword [ebx + 4]
mov edi, dword [ebx]
and ecx, dword [ebp - 8]
and edi, esi
or ecx, edi
jne 0x100536e
add ebx, 0x14
cmp ebx, dword [ebp - 4]
mov dword [ebp + 8], ebx
jb 0x1005355
cmp ebx, dword [ebp - 4]
jne 0x1005397
mov ebx, edx
jmp 0x1005388
mov ecx, dword [ebx + 4]
mov edi, dword [ebx]
and ecx, dword [ebp - 8]
and edi, esi
or ecx, edi
jne 0x100538f
add ebx, 0x14
cmp ebx, eax
mov dword [ebp + 8], ebx
jb 0x1005377
cmp ebx, eax
je 0x100542b
mov dword [0x1009994], ebx
mov eax, dword [ebx + 0x10]
mov edx, dword [eax]
cmp edx, 0xffffffff
mov dword [ebp - 4], edx
je 0x10053be
mov ecx, dword [eax + edx*4 + 0xc4]
mov edi, dword [eax + edx*4 + 0x44]
and ecx, dword [ebp - 8]
and edi, esi
or ecx, edi
jne 0x10053f4
mov edx, dword [eax + 0xc4]
and edx, dword [ebp - 8]
and dword [ebp - 4], 0
lea ecx, [eax + 0x44]
mov esi, dword [ecx]
and esi, dword [ebp - 0xc]
or edx, esi
mov esi, dword [ebp - 0xc]
jne 0x10053f1
mov edx, dword [ecx + 0x84]
and edx, dword [ebp - 8]
inc dword [ebp - 4]
add ecx, 4
mov edi, dword [ecx]
and edi, esi
or edx, edi
je 0x10053da
mov edx, dword [ebp - 4]
mov ecx, edx
imul ecx, ecx, 0x204
lea ecx, [ecx + eax + 0x144]
mov dword [ebp - 0xc], ecx
mov ecx, dword [eax + edx*4 + 0x44]
xor edi, edi
and ecx, esi
jne 0x100547d
mov ecx, dword [eax + edx*4 + 0xc4]
and ecx, dword [ebp - 8]
push 0x20
pop edi
jmp 0x100547d
cmp dword [ebx + 8], 0
jne 0x1005430
add ebx, 0x14
mov dword [ebp + 8], ebx
cmp ebx, dword [ebp - 4]
jb 0x100541f
cmp ebx, dword [ebp - 4]
jne 0x100545b
mov ebx, edx
jmp 0x1005442
cmp dword [ebx + 8], 0
jne 0x1005449
add ebx, 0x14
cmp ebx, eax
mov dword [ebp + 8], ebx
jb 0x1005439
cmp ebx, eax
jne 0x100545b
call fcn.01005140
mov ebx, eax
test ebx, ebx
mov dword [ebp + 8], ebx
je 0x1005473
push ebx
call fcn.010051f7
pop ecx
mov ecx, dword [ebx + 0x10]
mov dword [ecx], eax
mov eax, dword [ebx + 0x10]
cmp dword [eax], 0xffffffff
jne 0x1005397
xor eax, eax
jmp 0x10055f4
shl ecx, 1
inc edi
test ecx, ecx
jge 0x100547a
mov ecx, dword [ebp - 0xc]
mov edx, dword [ecx + edi*8 + 4]
mov ecx, dword [edx]
sub ecx, dword [ebp - 0x10]
mov esi, ecx
sar esi, 4
dec esi
cmp esi, 0x3f
mov dword [ebp - 8], ecx
jle 0x100549e
push 0x3f
pop esi
cmp esi, edi
je 0x10055a7
mov ecx, dword [edx + 4]
cmp ecx, dword [edx + 8]
jne 0x100550a
cmp edi, 0x20
mov ebx, 0x80000000
jge 0x10054de
mov ecx, edi
shr ebx, cl
mov ecx, dword [ebp - 4]
lea edi, [eax + edi + 4]
not ebx
mov dword [ebp - 0x14], ebx
and ebx, dword [eax + ecx*4 + 0x44]
mov dword [eax + ecx*4 + 0x44], ebx
dec byte [edi]
jne 0x1005507
mov ecx, dword [ebp - 0x14]
mov ebx, dword [ebp + 8]
and dword [ebx], ecx
jmp 0x100550a
lea ecx, [edi - 0x20]
shr ebx, cl
mov ecx, dword [ebp - 4]
lea ecx, [eax + ecx*4 + 0xc4]
lea edi, [eax + edi + 4]
not ebx
and dword [ecx], ebx
dec byte [edi]
mov dword [ebp - 0x14], ebx
jne 0x1005507
mov ebx, dword [ebp + 8]
mov ecx, dword [ebp - 0x14]
and dword [ebx + 4], ecx
jmp 0x100550a
mov ebx, dword [ebp + 8]
cmp dword [ebp - 8], 0
mov ecx, dword [edx + 8]
mov edi, dword [edx + 4]
mov dword [ecx + 4], edi
mov ecx, dword [edx + 4]
mov edi, dword [edx + 8]
mov dword [ecx + 8], edi
je 0x10055b3
mov ecx, dword [ebp - 0xc]
lea ecx, [ecx + esi*8]
mov edi, dword [ecx + 4]
mov dword [edx + 8], ecx
mov dword [edx + 4], edi
mov dword [ecx + 4], edx
mov ecx, dword [edx + 4]
mov dword [ecx + 8], edx
mov ecx, dword [edx + 4]
cmp ecx, dword [edx + 8]
jne 0x10055a4
mov cl, byte [esi + eax + 4]
mov byte [ebp + 0xb], cl
inc cl
cmp esi, 0x20
mov byte [esi + eax + 4], cl
jge 0x100557b
cmp byte [ebp + 0xb], 0
jne 0x1005569
mov edi, 0x80000000
mov ecx, esi
shr edi, cl
or dword [ebx], edi
mov ecx, esi
mov edi, 0x80000000
shr edi, cl
mov ecx, dword [ebp - 4]
or dword [eax + ecx*4 + 0x44], edi
jmp 0x10055a4
cmp byte [ebp + 0xb], 0
jne 0x100558e
lea ecx, [esi - 0x20]
mov edi, 0x80000000
shr edi, cl
or dword [ebx + 4], edi
mov ecx, dword [ebp - 4]
lea edi, [eax + ecx*4 + 0xc4]
lea ecx, [esi - 0x20]
mov esi, 0x80000000
shr esi, cl
or dword [edi], esi
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x10055b6
mov dword [edx], ecx
mov dword [ecx + edx - 4], ecx
jmp 0x10055b6
mov ecx, dword [ebp - 8]
mov esi, dword [ebp - 0x10]
add edx, ecx
lea ecx, [esi + 1]
mov dword [edx], ecx
mov dword [edx + esi - 4], ecx
mov esi, dword [ebp - 0xc]
mov ecx, dword [esi]
test ecx, ecx
lea edi, [ecx + 1]
mov dword [esi], edi
jne 0x10055ec
cmp ebx, dword [0x1009984]
jne 0x10055ec
mov ecx, dword [ebp - 4]
cmp ecx, dword [0x100999c]
jne 0x10055ec
and dword [0x1009984], 0
mov ecx, dword [ebp - 4]
mov dword [eax], ecx
lea eax, [edx + 4]
pop edi
pop esi
pop ebx
leave
ret