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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x80
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebx]
mov eax, dword [ebx + 4]
mov dword [esp + 0x60], esi
mov ecx, esi
or ecx, 1
bsr edx, eax
xor edx, 0x1f
bsr ecx, ecx
xor ecx, 0x1f
or ecx, 0x20
test eax, eax
cmovne ecx, edx
xor ecx, 0x3f
movzx edi, word [ecx + ecx + 0x573d40]
mov dword [esp + 0x70], esi
cmp esi, dword [edi*8 + 0x573158]
mov dword [esp + 0x64], eax
mov ecx, eax
sbb ecx, dword [edi*8 + 0x57315c]
setb cl
movzx ecx, cl
sub edi, ecx
mov dword [esp + 0x2c], edi
mov ecx, dword [ebp + 0x18]
mov dword [esp + 0x20], ecx
movzx edx, ch
mov dword [esp + 0x28], edx
mov cl, byte [ebp + 0x1c]
mov dword [esp + 0x5c], ecx
js 0x5168c1
lea esi, [ebp + 0x14]
mov dword [esp + 0x6c], edx
cmp edx, 1
mov ecx, edi
sbb ecx, 0xffffffff
mov dword [esp + 0x1c], ecx
mov ecx, dword [ebx + 8]
mov bl, byte [esi + 4]
lea edx, [ecx + edi]
mov dword [esp + 0x24], edx
mov edx, dword [esi]
cmp bl, 1
je 0x516590
test bl, bl
jne 0x516540
test edx, edx
mov esi, 0x10
cmovg esi, edx
cmp dword [esp + 0x24], 0xfffffffd
jl 0x516590
cmp dword [esp + 0x24], esi
jg 0x516590
mov esi, dword [esp + 0x24]
mov dword [esp + 0x74], esi
test ecx, ecx
js 0x5166a4
add ecx, dword [esp + 0x1c]
sub edx, esi
mov dword [esp + 0x18], edx
test dword [esp + 0x20], 0x100000
mov ebx, dword [ebp + 0x10]
je 0x516774
test edx, edx
jg 0x51676e
cmp byte [esp + 0x20], 2
je 0x51676e
mov dword [esp + 0x18], 1
mov edx, 1
jmp 0x516772
lea esi, [ecx + edi]
add esi, 0xffffffff
test dword [esp + 0x20], 0x100000
jne 0x5165b7
xor edx, edx
cmp edi, 1
jne 0x5165c2
mov byte [ebp + 0x1c], 0
mov dword [esp + 0x5c], 0
xor edx, edx
jmp 0x5165c2
xor ecx, ecx
sub edx, edi
cmovs edx, ecx
add dword [esp + 0x1c], edx
mov ecx, 1
mov ebx, dword [esp + 0x24]
sub ecx, ebx
test ebx, ebx
cmovg ecx, esi
test dword [esp + 0x20], 0x10000
xorps xmm0, xmm0
movaps xmmword [esp + 0x30], xmm0
movaps xmmword [esp + 0x40], xmm0
mov dword [esp + 0x54], 0
mov ebx, dword [esp + 0x6c]
mov dword [esp + 0x30], ebx
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 0x38], eax
mov dword [esp + 0x40], edi
mov ebx, dword [esp + 0x5c]
mov byte [esp + 0x44], bl
mov dword [esp + 0x48], edx
sete al
shl al, 5
or al, 0x45
mov byte [esp + 0x4c], al
mov dword [esp + 0x50], esi
mov edi, dword [ebp + 0x10]
mov esi, dword [edi]
test esi, esi
jle 0x516752
xor eax, eax
cmp ecx, 0x3e8
setge al
add eax, 3
cmp ecx, 0x64
mov ecx, 2
cmovge ecx, eax
mov edx, dword [esp + 0x1c]
add edx, ecx
cmp bl, 1
sbb edx, 0
add edx, 3
xor eax, eax
sub esi, edx
cmovb esi, eax
movzx eax, byte [edi + 9]
and eax, 0xf
mov cl, byte [eax + 0x573c25]
lea eax, [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 0x14], eax
mov ebx, edi
mov edi, esi
shr edi, cl
add ebx, 0xa
mov eax, dword [esp + 0x14]
push ebx
push edi
push eax
call fcn.005159e0
add esp, 0xc
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x30]
push eax
call fcn.00516900
jmp 0x5167f8
test esi, esi
mov ebx, dword [ebp + 0x10]
jle 0x516815
mov eax, dword [esp + 0x20]
shl eax, 0xb
sar eax, 0x1f
sub edx, edi
and edx, eax
mov dword [esp + 0x18], edx
lea eax, [ebp + 8]
mov eax, dword [eax]
lea ecx, [esp + 0x28]
mov dword [esp + 0x30], ecx
lea ecx, [esp + 0x60]
mov dword [esp + 0x34], ecx
lea ecx, [esp + 0x2c]
mov dword [esp + 0x38], ecx
lea ecx, [esp + 0x74]
mov dword [esp + 0x3c], ecx
lea ecx, [ebp + 0x1c]
mov dword [esp + 0x40], ecx
lea ecx, [esp + 0x18]
mov dword [esp + 0x44], ecx
mov esi, dword [ebx]
test esi, esi
js 0x5168c1
xor ecx, ecx
test edx, edx
cmovs edx, ecx
mov edi, dword [esp + 0x1c]
add edx, edi
add edx, 1
sub esi, edx
cmovb esi, ecx
movzx ecx, byte [ebx + 9]
and ecx, 0xf
mov cl, byte [ecx + 0x573c25]
mov dword [esp + 0x14], eax
mov edi, esi
shr edi, cl
add ebx, 0xa
mov eax, dword [esp + 0x14]
push ebx
push edi
push eax
call fcn.005159e0
add esp, 0xc
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x30]
push eax
call fcn.00516cf0
jmp 0x5167f8
lea eax, [ebp + 8]
mov eax, dword [eax]
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x78]
lea ecx, [esp + 0x30]
push eax
call fcn.00516900
jmp 0x51680d
test edx, edx
jle 0x516774
add ecx, edx
lea eax, [ebp + 8]
mov eax, dword [eax]
lea edx, [esp + 0x28]
mov dword [esp + 0x30], edx
lea edx, [esp + 0x60]
mov dword [esp + 0x34], edx
lea edx, [esp + 0x2c]
mov dword [esp + 0x38], edx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x3c], edx
lea edx, [ebp + 0x14]
mov dword [esp + 0x40], edx
lea edx, [ebp + 0x1c]
mov dword [esp + 0x44], edx
lea edx, [esp + 0x18]
mov dword [esp + 0x48], edx
mov esi, dword [ebx]
test esi, esi
js 0x5168c1
xor edx, edx
sub esi, ecx
cmovb esi, edx
movzx ecx, byte [ebx + 9]
and ecx, 0xf
mov cl, byte [ecx + 0x573c25]
mov edi, esi
shr edi, cl
add ebx, 0xa
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x14]
push ebx
push edi
push eax
call fcn.005159e0
add esp, 0xc
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x30]
push eax
call fcn.00516a50
mov dword [esp + 0xc], eax
sub esi, edi
mov eax, dword [esp + 0xc]
push ebx
push esi
push eax
call fcn.005159e0
add esp, 0xc
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
neg esi
test edi, edi
sete al
test edx, edx
setns ah
and ah, al
cmp edx, esi
setl cl
and cl, ah
mov eax, esi
cmovne eax, edx
mov dword [esp + 0x18], eax
lea eax, [esp + 0x28]
mov dword [esp + 0x30], eax
lea eax, [esp + 0x18]
mov dword [esp + 0x34], eax
lea eax, [esp + 0x2c]
mov dword [esp + 0x38], eax
lea eax, [ebp + 8]
mov eax, dword [eax]
lea edi, [ebp + 0x14]
mov dword [esp + 0x3c], edi
mov edi, esi
lea esi, [ebp + 0x1c]
mov dword [esp + 0x40], esi
lea esi, [esp + 0x60]
mov dword [esp + 0x44], esi
mov esi, dword [ebx]
test esi, esi
js 0x5168c1
test cl, cl
cmovne edi, edx
mov ecx, dword [esp + 0x1c]
add ecx, edi
add ecx, 2
xor edx, edx
sub esi, ecx
cmovb esi, edx
movzx ecx, byte [ebx + 9]
and ecx, 0xf
mov cl, byte [ecx + 0x573c25]
mov dword [esp + 0x14], eax
mov edi, esi
shr edi, cl
add ebx, 0xa
mov eax, dword [esp + 0x14]
push ebx
push edi
push eax
call fcn.005159e0
add esp, 0xc
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x30]
push eax
call fcn.00516e20
jmp 0x5167f8
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
sub esp, 0x10
mov dword [esp], eax
mov dword [esp + 0x10], str.negative_value
mov dword [esp + 0xc], 0x146
mov dword [esp + 8], str.external_fmtlib_include_fmt_core.h
call fcn.0050a710
add esp, 0x14
call fcn.004949d0
int3