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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x44
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov ebx, dword [esi*4 + 0x20a514c]
mov dword [esp + 0x1c], ebx
cmp word [ebx + 0x78], 1
je 0x5136ea
mov eax, dword [ebx + 0x2a8]
test eax, eax
js 0x513b1d
cmp eax, 0x1194
jge 0x513b1d
mov edx, dword [ebp + 8]
mov ecx, dword [edx*4 + 0x20a514c]
mov dword [esp + 0x38], ecx
mov eax, dword [ecx + 0x284]
cmp eax, dword [ebx + 0x284]
jne 0x513b1d
mov al, byte [ecx + 0x149]
cmp al, 0x28
je 0x513720
cmp al, 0x12
jb 0x513728
cmp al, 0x17
jbe 0x513720
cmp al, 0x35
jne 0x513728
cmp edx, esi
jne 0x513b1d
movsx eax, word [ebx + 0x146]
mov edi, dword [ebp + 0x10]
push eax
movsx eax, word [ebx + 0x144]
push eax
movsx eax, word [ecx + 0x146]
push eax
movsx eax, word [ecx + 0x144]
push eax
movzx eax, word [edi + 8]
push eax
call fcn.00507fe0
test al, al
je 0x513b1d
mov ecx, dword [esp + 0x38]
push 0x1b1
push ecx
mov eax, dword [ecx + 0x120]
add eax, dword [ecx + 0xf4]
cdq
idiv dword [0xbdc134]
mov esi, eax
call fcn.004b6100
add esi, eax
mov ecx, 0xbf0bd4
mov eax, dword [0xbdc138]
mov dword [esp + 0x14], eax
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x44]
mov dword [esp + 0x38], esi
movzx esi, word [edi + 8]
push eax
mov dword [esp + 0x38], esi
call fcn.00405650
mov eax, dword [esp + 0x48]
mov ecx, dword [0xbf0bd4]
cmp byte [eax + 0xd], 0
jne 0x5137c1
cmp esi, dword [eax + 0x10]
jge 0x5137c3
mov eax, ecx
cmp eax, ecx
je 0x513965
mov ecx, dword [eax + 0x54]
mov eax, dword [esp + 0x34]
movzx eax, ax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x18], eax
test ecx, ecx
js 0x513965
cmp ecx, 0x100
jge 0x513965
imul eax, ecx, 0x4c
cmp dword [eax + 0x6460e4], ecx
lea edi, [eax + 0x6460e4]
jne 0x513965
test edi, edi
je 0x513965
mov edx, dword [edi + 0x38]
cmp edx, 0xffffffff
je 0x513835
cmp dword [edi + 0x30], 2
jne 0x51382f
push 0
call fcn.0052d9f5
mov dword [esp + 0x48], edx
add esp, 4
mov edx, dword [edi + 0x38]
add edx, eax
mov dword [esp + 0x14], edx
jmp 0x513839
mov edx, dword [esp + 0x14]
mov eax, dword [edi + 0x3c]
cmp eax, 0xffffffff
je 0x513848
movzx eax, ax
mov dword [esp + 0x18], eax
mov eax, dword [edi + 0x40]
xor esi, esi
cmp eax, 0xffffffff
movzx ecx, ax
cmove ecx, esi
movzx eax, cx
mov dword [esp + 0x24], eax
movzx eax, ax
mov dword [esp + 0x28], eax
mov eax, dword [edi + 0x44]
cmp eax, 0xffffffff
movzx ecx, ax
cmove ecx, esi
movzx eax, cx
mov dword [esp + 0x3c], eax
movzx eax, ax
mov dword [esp + 0x2c], eax
mov eax, dword [edi + 0x48]
cmp eax, 0xffffffff
movzx ecx, ax
cmove ecx, esi
mov esi, dword [ebx + 0x624]
movzx eax, cx
xor ecx, ecx
mov dword [esp + 0x40], eax
movzx eax, ax
mov dword [esp + 0x30], eax
mov al, byte [esi + 4]
mov byte [esp + 0x10], al
cmp al, 0xff
je 0x5138b8
movzx eax, byte [esi + 5]
cmp eax, dword [edi + 4]
je 0x513993
inc ecx
add esi, 0x1c
cmp ecx, 0x20
jl 0x5138a0
mov eax, dword [esp + 0x1c]
xor ebx, ebx
nop word [eax + eax]
mov esi, dword [eax + 0x624]
mov ecx, edx
mov dl, byte [edi + 0x34]
add esi, ebx
mov byte [esp + 0x11], dl
mov dl, byte [edi + 0x30]
mov byte [esp + 0x10], dl
cmp byte [esi + 4], 0xff
mov dl, byte [edi + 0x2c]
mov byte [esp + 0x12], dl
mov dl, byte [edi + 4]
mov byte [esp + 0x13], dl
mov edx, dword [esp + 0x14]
mov dword [esp + 0x24], 0
jne 0x513952
cmp byte [esp + 0x10], 2
jne 0x513ae5
push 0
mov dword [esp + 0x28], edx
call fcn.0052d9f5
add esp, 4
push edx
push eax
push 0
push dword [esp + 0x20]
call fcn.0052d9b0
add esp, 0x10
fstp qword [esp + 0x40]
movsd xmm0, qword [esp + 0x40]
call fcn.00546020
mov ecx, eax
test ecx, ecx
jg 0x513ae5
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
add ebx, 0x1c
cmp ebx, 0x380
jl 0x5138d0
mov ebx, dword [esp + 0x1c]
push ecx
push dword [esp + 0x38]
push 0x11
push ebx
call fcn.00481b20
mov eax, dword [ebp + 0x10]
push 1
push dword [ebp + 0xc]
movzx eax, word [eax + 8]
push eax
push dword [esp + 0x44]
call fcn.00517480
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
movzx eax, byte [esp + 0x10]
cmp dword [esp + 0x20], eax
jne 0x5139c6
mov eax, dword [esp + 0x18]
cmp ax, word [esi + 0x14]
jb 0x513965
mov eax, dword [esp + 0x24]
cmp ax, word [esi + 0x16]
jb 0x513965
mov eax, dword [esp + 0x3c]
cmp ax, word [esi + 0x18]
jb 0x513965
mov eax, dword [esp + 0x40]
cmp ax, word [esi + 0x1a]
jb 0x513965
push esi
push ebx
mov ecx, 0x6460e0
call fcn.00478000
movzx eax, byte [esi + 4]
mov ecx, 0x6460e0
push eax
movzx eax, byte [esi + 5]
push 0
push 2
push 0
push eax
push ebx
call fcn.00478bb0
xor eax, eax
mov dword [esi + 4], 0xff
mov dword [esi + 0x10], 0
mov byte [esi + 8], 0
mov dword [esi + 0xc], 0
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov cl, byte [edi + 0x2c]
mov dl, byte [edi + 4]
mov dword [esp + 0x1c], eax
mov al, byte [edi + 0x34]
mov byte [esp + 0x13], al
mov al, byte [edi + 0x30]
mov byte [esp + 0x12], al
mov byte [esp + 0x11], cl
mov byte [esp + 0x10], dl
cmp al, 2
jne 0x513adf
mov edi, dword [esp + 0x14]
push 0
mov dword [esp + 0x20], edi
call fcn.0052d9f5
add esp, 4
push edx
push eax
push 0
push edi
call fcn.0052d9b0
add esp, 0x10
fstp qword [esp + 0x40]
movsd xmm0, qword [esp + 0x40]
call fcn.00546020
test eax, eax
jle 0x513965
mov dl, byte [esp + 0x10]
mov dh, byte [esp + 0x11]
mov cl, byte [esp + 0x20]
mov edi, dword [esp + 0x1c]
mov byte [esi + 6], dh
mov dh, byte [esp + 0x12]
mov byte [esi + 7], dh
mov dh, byte [esp + 0x13]
push ecx
mov dword [esi + 0x10], eax
push eax
mov byte [esi + 4], cl
mov byte [esi + 5], dl
mov byte [esi + 8], dh
mov dword [esi + 0xc], edi
movzx eax, dl
mov edi, dword [esp + 0x20]
mov ecx, 0x6460e0
mov word [esi + 0x14], di
mov edi, dword [esp + 0x30]
push 0
mov word [esi + 0x16], di
mov edi, dword [esp + 0x38]
push 0
mov word [esi + 0x18], di
mov edi, dword [esp + 0x40]
push eax
push ebx
mov word [esi + 0x1a], di
call fcn.00478bb0
push esi
push ebx
mov ecx, 0x6460e0
call fcn.00477580
jmp 0x513965
mov eax, dword [esp + 0x14]
jmp 0x513a70
mov dl, byte [esp + 0x12]
mov al, byte [esp + 0x20]
mov bl, byte [esp + 0x13]
mov byte [esi + 6], dl
mov dl, byte [esp + 0x10]
mov byte [esi + 7], dl
mov dl, byte [esp + 0x11]
push eax
mov byte [esi + 4], al
mov byte [esi + 8], dl
mov edx, dword [esp + 0x28]
mov byte [esi + 5], bl
movzx eax, bl
mov ebx, dword [esp + 0x20]
mov dword [esi + 0xc], edx
mov dword [esi + 0x10], ecx
push ecx
jmp 0x513a9e
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 0xc