Function at 0x10058180
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x54
push ebx
mov ebx, dword [esp + 0x5c]
xor ecx, ecx
xor edx, edx
push ebp
mov ebp, dword [esp + 0x64]
cmp ebp, 3
sete cl
push esi
push edi
mov edi, eax
lea eax, [ebx + 0x6c]
mov dword [esp + 0x18], eax
mov eax, dword [edi + 8]
mov dword [esp + 0x2c], ecx
xor ecx, ecx
cmp ebp, 4
sete cl
mov dword [esp + 0x6c], edx
lea esi, [ebx + 0x4c]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], edx
mov dword [esp + 0x30], ecx
mov ecx, dword [ebx + 0x48]
cmp ecx, dword [edi + 0x10]
je 0x100581de
mov ecx, 6
mov dword [esp + 0x6c], ecx
jmp 0x1005852d
cmp ebp, dword [esp + 0x74]
je 0x100581f2
mov ecx, 0x13
mov dword [esp + 0x6c], ecx
jmp 0x1005852d
mov edx, dword [ebx + 0x9c]
test byte [edx + 4], 1
je 0x1005821c
mov ecx, dword [esi + 0xc]
push ecx
push eax
call fcn.1004f1e0
mov dword [esi + 0xc], 0
mov eax, dword [ebx + 0x9c]
add esp, 8
and dword [eax + 4], 0xfffffffe
mov edx, dword [esp + 0x70]
push edx
push ebp
push ebx
call fcn.1004f630
mov ecx, dword [esi]
mov edx, dword [esi + 8]
lea eax, [esp + 0x78]
push eax
mov eax, dword [esp + 0x2c]
push 0
push ecx
push 0
push edx
push eax
call fcn.100526b0
mov ecx, dword [esp + 0x90]
add esp, 0x24
mov dword [esi + 0xc], eax
test ecx, ecx
jne 0x10058525
mov eax, dword [ebx + 0x9c]
or dword [eax + 4], 1
mov ebp, dword [ebx + 0x64]
mov ecx, dword [ebx + 0x68]
mov edx, dword [esi]
neg ebp
neg ecx
shl ebp, 6
shl ecx, 6
shl edx, 6
cmp byte [esi + 0x12], 6
mov dword [esp + 0x14], ebp
jne 0x10058292
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add eax, edx
add ecx, eax
jmp 0x10058294
add ecx, edx
mov eax, dword [esp + 0x70]
mov dword [esp + 0x10], ecx
test eax, eax
je 0x100582ad
add ebp, dword [eax]
add ecx, dword [eax + 4]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], ecx
test ebp, ebp
jne 0x100582b5
test ecx, ecx
je 0x100582c4
mov eax, dword [esp + 0x18]
push ecx
push ebp
push eax
call fcn.1004e210
add esp, 0xc
cmp dword [esp + 0x2c], 0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], 1
je 0x1005843e
mov eax, dword [esi + 8]
mov edx, dword [esi]
mov dword [esp + 0x20], eax
mov dword [esp + 0x2c], edx
mov eax, 0xaaaaaaab
mul dword [esi + 4]
mov ebp, edx
shr ebp, 1
add dword [esi + 0xc], ebp
mov edx, dword [edi + 0x34]
mov eax, dword [edi + 0x38]
lea ecx, [esp + 0x34]
push ecx
push edx
call eax
mov ecx, eax
add esp, 8
mov dword [esp + 0x6c], ecx
test ecx, ecx
jne 0x10058525
mov ecx, dword [esp + 0x18]
push eax
push 0xffffffffffffffeb
push ecx
call fcn.1004e210
add dword [esi + 0xc], ebp
mov eax, dword [edi + 0x34]
mov ecx, dword [edi + 0x38]
sub dword [esp + 0x20], 0x15
lea edx, [esp + 0x40]
push edx
push eax
call ecx
mov ecx, eax
add esp, 0x14
mov dword [esp + 0x6c], ecx
test ecx, ecx
jne 0x10058525
mov edx, dword [esp + 0x18]
push eax
push 0x2a
push edx
call fcn.1004e210
add dword [esp + 0x20], 0x2a
lea eax, [ebp + ebp]
sub dword [esi + 0xc], eax
mov ecx, dword [edi + 0x34]
mov edx, dword [edi + 0x38]
lea eax, [esp + 0x40]
push eax
push ecx
call edx
mov ecx, eax
add esp, 0x14
mov dword [esp + 0x6c], ecx
test ecx, ecx
jne 0x10058525
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x6c]
push eax
push ecx
push edx
call fcn.10050b80
mov ecx, dword [esp + 0x78]
add esp, 0xc
mov dword [esp + 0x28], eax
test ecx, ecx
jne 0x10058525
mov eax, dword [esp + 0x2c]
test eax, eax
jbe 0x10058426
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], eax
mov edi, dword [esi + 0xc]
add edi, dword [esp + 0x24]
xor eax, eax
test ebp, ebp
jbe 0x10058404
mov ecx, dword [esp + 0x28]
lea ebx, [edi + ebp*2]
add ecx, 2
lea edx, [edi + ebp]
mov dword [esp + 0x30], ebx
nop
movzx ebx, byte [eax + edi]
mov byte [ecx - 2], bl
movzx ebx, byte [edx + eax]
mov byte [ecx - 1], bl
mov ebx, dword [esp + 0x30]
movzx ebx, byte [ebx + eax]
mov byte [ecx], bl
inc eax
add ecx, 3
cmp eax, ebp
jb 0x100583e0
mov ebx, dword [esp + 0x68]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
push eax
push ecx
push edi
call fcn.10105350
mov edx, dword [esp + 0x2c]
add dword [esp + 0x30], edx
add esp, 0xc
sub dword [esp + 0x2c], 1
jne 0x100583c1
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x1c]
push eax
push ecx
call fcn.1004f1e0
mov ecx, dword [esp + 0x74]
jmp 0x10058515
cmp dword [esp + 0x30], 0
je 0x10058501
mov ebp, dword [esi + 8]
add dword [esi + 0xc], ebp
lea edx, [ebp + ebp*2]
mov dword [esi + 8], edx
mov eax, 0xaaaaaaab
mul dword [esi]
shr edx, 1
mov dword [esi], edx
mov ecx, dword [edi + 0x34]
mov edx, dword [edi + 0x38]
lea eax, [esp + 0x34]
push eax
push ecx
call edx
mov ecx, eax
add esp, 8
mov dword [esp + 0x6c], ecx
test ecx, ecx
jne 0x10058525
push 0x15
push eax
mov eax, dword [esp + 0x20]
push eax
call fcn.1004e210
add dword [esi + 0xc], ebp
mov edx, dword [edi + 0x34]
mov eax, dword [edi + 0x38]
add dword [esp + 0x1c], 0x15
lea ecx, [esp + 0x40]
push ecx
push edx
call eax
mov ecx, eax
add esp, 0x14
mov dword [esp + 0x6c], ecx
test ecx, ecx
jne 0x10058525
mov ecx, dword [esp + 0x18]
push 0xffffffffffffffd6
push eax
push ecx
call fcn.1004e210
sub dword [esp + 0x1c], 0x2a
neg ebp
add ebp, ebp
add dword [esi + 0xc], ebp
mov eax, dword [edi + 0x34]
mov ecx, dword [edi + 0x38]
lea edx, [esp + 0x40]
push edx
push eax
call ecx
mov ecx, eax
add esp, 0x14
mov dword [esp + 0x6c], ecx
test ecx, ecx
jne 0x10058525
mov edx, dword [esi + 8]
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esi + 8], eax
mov eax, dword [esi]
lea edx, [eax + eax*2]
mov dword [esi], edx
jmp 0x10058518
mov ecx, dword [edi + 0x34]
mov edx, dword [edi + 0x38]
lea eax, [esp + 0x34]
push eax
push ecx
call edx
mov ecx, eax
mov dword [esp + 0x74], ecx
add esp, 8
test ecx, ecx
jne 0x10058525
mov dword [ebx + 0x48], 0x62697473
jmp 0x1005855b
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
mov edi, dword [ebx + 0x9c]
test byte [edi + 4], 1
je 0x1005855f
mov ecx, dword [esi + 0xc]
push ecx
push eax
call fcn.1004f1e0
mov dword [esi + 0xc], 0
mov ebx, dword [ebx + 0x9c]
add esp, 8
and dword [ebx + 4], 0xfffffffe
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
test eax, eax
jne 0x1005856f
test edx, edx
je 0x1005858a
neg edx
push edx
mov edx, dword [esp + 0xc]
neg eax
push eax
push edx
call fcn.1004e210
mov eax, dword [esp + 0x68]
add esp, 0xc
add esp, 0x54
ret
mov eax, ecx
add esp, 0x54
ret