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

Disassembly:
push 0xffffffffffffffff
push 0x5a514b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x30
push ebx
push esi
mov esi, dword [esp + 0x74]
mov ebx, ecx
lea ecx, [esi + 2]
mov eax, 0x55555556
imul ecx
mov eax, edx
push edi
xor edi, edi
shr eax, 0x1f
add edx, eax
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], edx
jne 0x520df6
mov dword [esp + 0x24], 1
cmp dword [esp + 0x5c], edi
jge 0x520e09
mov eax, 0x66
sub eax, esi
mov dword [esp + 0xc], eax
jmp 0x520e11
mov dword [esp + 0xc], 0xcc
cmp dword [esp + 0x80], edi
mov dword [esp + 0x18], edi
jle 0x520fd5
xor edx, edx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x34], edx
push ebp
lea ecx, [ecx]
mov edi, dword [esp + 0x80]
test edi, edi
jle 0x520f8c
xor ecx, ecx
xor eax, eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x34], edi
nop
xor edi, edi
test esi, esi
jle 0x520f51
add edx, eax
mov eax, dword [esp + 0x5c]
lea edx, [edx + eax - 8]
mov eax, dword [esp + 0x20]
add eax, ecx
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x18], edx
lea edx, [eax + ecx - 8]
mov eax, dword [esp + 0x24]
add eax, esi
mov dword [esp + 0x14], edx
mov dword [esp + 0x24], eax
push 0x40
call fcn.00591ce0
add esp, 4
mov dword [esp + 0x3c], eax
xor ebp, ebp
cmp eax, ebp
mov dword [esp + 0x48], ebp
je 0x520ea5
mov ecx, eax
call fcn.0051f8b0
mov ebp, eax
mov eax, dword [esp + 0x50]
push eax
mov ecx, ebp
mov dword [esp + 0x4c], 0xffffffff
call fcn.0051f8d0
push 1
push 0xb
push 0x11
call dword [sym.imp.SanCalc.dll_int___cdecl_rnd_int__enum_RANDOM_KIND__int_]
mov edx, dword [esp + 0x20]
push 1
mov esi, eax
push 0xb
push 0x11
add esi, edx
call dword [sym.imp.SanCalc.dll_int___cdecl_rnd_int__enum_RANDOM_KIND__int_]
mov ecx, eax
add ecx, dword [esp + 0x30]
mov eax, edi
cdq
idiv dword [esp + 0x40]
mov edx, dword [esp + 0x34]
add esp, 0x18
push eax
mov eax, dword [esp + 0x14]
push edx
mov edx, dword [esp + 0x5c]
push eax
mov eax, dword [ebx]
push ecx
mov ecx, dword [ebx + 0x188]
push esi
push ecx
push edx
mov ecx, ebx
call dword [eax + 0x54]
push eax
mov ecx, ebp
call fcn.0051f980
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x14]
mov ebp, dword [esp + 0x10]
mov eax, dword [esp + 0x7c]
add edx, ecx
mov ecx, dword [esp + 0x18]
inc ebp
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x68]
inc edi
add ecx, edx
cmp edi, eax
mov dword [esp + 0x10], ebp
mov dword [esp + 0x18], ecx
jl 0x520e84
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x38]
mov esi, eax
mov eax, dword [esp + 0x2c]
mov edi, dword [esp + 0x60]
test edi, edi
jge 0x520f69
mov ebp, dword [esp + 0x10]
mov edi, esi
neg edi
lea edi, [ebp + edi*2]
mov dword [esp + 0x10], edi
mov edi, dword [esp + 0x70]
mov ebp, dword [esp + 0x6c]
add eax, edi
mov edi, dword [esp + 0x34]
add ecx, ebp
dec edi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edi
jne 0x520e50
mov ecx, dword [esp + 0x74]
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
mov ebp, dword [esp + 0x78]
add edi, ecx
mov ecx, dword [esp + 0x84]
inc eax
add edx, ebp
cmp eax, ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x38], edx
mov dword [esp + 0x20], edi
jl 0x520e30
mov eax, dword [esp + 0x24]
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
add esp, 0x3c
ret 0x38
mov ecx, dword [esp + 0x3c]
mov eax, edi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x3c
ret 0x38