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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x13c
mov eax, dword [0x57a040]
xor eax, esp
mov dword [esp + 0x138], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov ecx, dword [eax*4 + 0x20a514c]
push edi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x30], eax
cmp word [ecx + 0x78], 1
mov dword [esp + 0x24], ecx
jne 0x51368b
mov edi, dword [ecx + 0x284]
test edi, edi
js 0x51368b
cmp edi, 0x1194
jge 0x51368b
mov al, byte [ecx + 0x149]
cmp al, 0x28
je 0x51368b
cmp al, 0x12
jb 0x51341d
cmp al, 0x17
jbe 0x51368b
cmp al, 0x35
je 0x51368b
test esi, esi
js 0x51368b
cmp esi, 0x1194
jge 0x51368b
mov eax, dword [esi*4 + 0x20a514c]
cmp word [eax + 0x78], 1
jne 0x51368b
mov edx, dword [eax + 0x284]
test edx, edx
js 0x51368b
cmp edx, 0x1194
jge 0x51368b
cmp edi, edx
jne 0x51368b
movsx edx, word [eax + 0x146]
movsx eax, word [eax + 0x144]
mov ebx, dword [ebp + 0x10]
push edx
push eax
mov dword [esp + 0x28], eax
movsx eax, word [ecx + 0x146]
movzx ebx, word [ebx + 8]
push eax
movsx eax, word [ecx + 0x144]
push eax
push ebx
mov dword [esp + 0x2c], edx
call fcn.00507fe0
test al, al
je 0x51368b
imul edi, edi, 0x2c
mov ebx, 1
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], 0xffffffff
mov dword [esp + 0x3c], 0xffffffff
mov dword [esp + 0x14], 0
add edi, 0xb94b0c
nop dword [eax]
mov esi, dword [edi]
test esi, esi
js 0x51351e
cmp esi, 0x1194
jge 0x51351e
cmp dword [esp + 0x1c], esi
je 0x51351e
mov ecx, dword [esi*4 + 0x20a514c]
movsx eax, word [ecx + 0x146]
push eax
movsx eax, word [ecx + 0x144]
mov ecx, dword [ebp + 0x10]
push eax
push dword [esp + 0x20]
push dword [esp + 0x2c]
movzx eax, word [ecx + 8]
push eax
call fcn.005080e0
test al, al
je 0x51351e
mov dword [esp + ebx*4 + 0x34], esi
inc ebx
cmp ebx, 3
jae 0x51352f
mov esi, dword [esp + 0x14]
add edi, 4
inc esi
mov dword [esp + 0x14], esi
cmp esi, 0xa
jl 0x5134d0
mov ecx, dword [esp + 0x24]
push 0x1ad
push ecx
mov eax, dword [ecx + 0x120]
add eax, dword [ecx + 0xf4]
cdq
idiv dword [0xbdc130]
mov esi, eax
add esi, dword [0xbdc12c]
call fcn.004b6100
mov ecx, eax
xor edi, edi
imul ecx, esi
mov eax, 0x51eb851f
imul ecx
mov ecx, 0xa
sar edx, 5
mov eax, edx
mov dword [esp + 0x14], ecx
shr eax, 0x1f
add edx, eax
mov eax, dword [ebp + 0x10]
add edx, esi
movzx eax, word [eax + 8]
mov dword [esp + 0x2c], eax
shr eax, 8
mov dword [esp + 0x28], eax
xor al, al
test ebx, ebx
jle 0x51361d
mov eax, edx
mov byte [esp + 0x13], bl
neg eax
mov ecx, 0xc8
shl eax, 2
sub eax, edx
mov dword [esp + 0x18], ecx
shl eax, 2
imul edx, edx, 0x64
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], edx
jmp 0x5135c4
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + edi*4 + 0x34]
mov eax, 0x51eb851f
imul edx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, 0x10
push eax
push ecx
mov ecx, dword [esi*4 + 0x20a514c]
push esi
call fcn.00523ad0
mov ecx, dword [esp + 0x20]
inc edi
mov edx, dword [esp + 0x28]
add esp, 0xc
add edx, dword [esp + 0x20]
add dword [esp + 0x18], 0xc8
mov word [esp + ecx + 0x40], si
add ecx, 2
mov dword [esp + 0x14], ecx
mov dword [esp + 0x1c], edx
cmp edi, ebx
jl 0x5135c0
mov al, byte [esp + 0x13]
mov edx, dword [esp + 0x28]
mov byte [esp + 0x48], al
mov al, byte [esp + 0x3d]
mov byte [esp + 0x44], dl
mov edx, dword [esp + 0x2c]
mov byte [esp + 0x49], al
lea eax, [esp + 0x40]
push ecx
mov byte [esp + 0x49], dl
mov edx, dword [esp + 0x34]
push eax
push edx
mov byte [esp + 0x4c], 0xc1
mov byte [esp + 0x4d], cl
mov word [esp + 0x4e], 0x18bf
mov word [esp + 0x52], dx
call fcn.005192f0
push dword [esp + 0x14]
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x44]
call fcn.005264a0
add esp, 4
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x138]
xor ecx, esp
call fcn.00529f01
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esp + 0x144]
xor al, al
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00529f01
mov esp, ebp
pop ebp
ret 0xc