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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x50
mov al, byte [esp + 0x78]
mov dword [esp + 0x40], eax
mov edx, dword [esp + 0x68]
mov ebx, dword [edx]
mov eax, ebx
or eax, 1
bsr eax, eax
movzx edi, word [eax + eax + 0x573d40]
xor eax, eax
cmp dword [edi*4 + 0x573128], ebx
mov dword [esp + 0x3c], ebx
seta al
sub edi, eax
mov dword [esp + 0x38], edi
mov eax, dword [esp + 0x74]
mov dword [esp + 0x14], eax
movzx eax, ah
mov dword [esp + 0x34], eax
js 0x51585b
lea ecx, [esp + 0x70]
mov dword [esp + 0x44], eax
cmp eax, 1
mov eax, edi
sbb eax, 0xffffffff
mov dword [esp + 0x10], eax
mov esi, dword [edx + 4]
lea ebp, [esi + edi]
mov edx, dword [ecx]
mov al, byte [ecx + 4]
cmp al, 1
je 0x515527
test al, al
jne 0x5154da
test edx, edx
mov eax, 0x10
cmovg eax, edx
cmp ebp, 0xfffffffd
jl 0x515527
cmp ebp, eax
jg 0x515527
mov dword [esp + 0x48], ebp
test esi, esi
js 0x51562d
add esi, dword [esp + 0x10]
sub edx, ebp
mov dword [esp + 0xc], edx
test dword [esp + 0x14], 0x100000
mov ebx, dword [esp + 0x6c]
je 0x515701
test edx, edx
jg 0x5156fb
cmp byte [esp + 0x14], 2
je 0x5156fb
mov dword [esp + 0xc], 1
mov edx, 1
jmp 0x5156ff
add esi, edi
add esi, 0xffffffff
test dword [esp + 0x14], 0x100000
jne 0x51554e
xor edx, edx
cmp edi, 1
jne 0x515559
mov byte [esp + 0x78], 0
mov dword [esp + 0x40], 0
xor edx, edx
jmp 0x515559
xor eax, eax
sub edx, edi
cmovs edx, eax
add dword [esp + 0x10], edx
mov eax, 1
sub eax, ebp
test ebp, ebp
cmovg eax, esi
test dword [esp + 0x14], 0x10000
mov dword [esp + 0x24], 0
mov dword [esp + 0x2c], 0
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], edi
mov ecx, dword [esp + 0x40]
mov edi, ecx
mov byte [esp + 0x24], cl
mov dword [esp + 0x28], edx
sete cl
shl cl, 5
or cl, 0x45
mov byte [esp + 0x2c], cl
mov dword [esp + 0x30], esi
mov ebx, dword [esp + 0x6c]
mov esi, dword [ebx]
test esi, esi
jle 0x5156de
xor ecx, ecx
cmp eax, 0x3e8
setge cl
add ecx, 3
cmp eax, 0x64
mov eax, 2
cmovge eax, ecx
mov ecx, dword [esp + 0x10]
add ecx, eax
mov eax, edi
cmp al, 1
sbb ecx, 0
add ecx, 3
xor eax, eax
sub esi, ecx
cmovb esi, eax
movzx eax, byte [ebx + 9]
and eax, 0xf
mov cl, byte [eax + 0x573c25]
mov edi, esi
shr edi, cl
lea eax, [esp + 0x64]
mov eax, dword [eax]
add ebx, 0xa
mov dword [esp + 8], eax
mov eax, dword [esp + 8]
push ebx
push edi
push eax
call fcn.005159e0
add esp, 0xc
mov dword [esp + 4], eax
mov eax, dword [esp + 4]
lea ecx, [esp + 0x18]
push eax
call fcn.00515ac0
jmp 0x515840
test ebp, ebp
mov ebx, dword [esp + 0x6c]
jle 0x515798
mov eax, dword [esp + 0x14]
shl eax, 0xb
sar eax, 0x1f
sub edx, edi
and edx, eax
mov dword [esp + 0xc], edx
lea eax, [esp + 0x64]
mov eax, dword [eax]
lea ecx, [esp + 0x34]
mov dword [esp + 0x18], ecx
lea ecx, [esp + 0x3c]
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x38]
mov dword [esp + 0x20], ecx
lea ecx, [esp + 0x48]
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x78]
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0xc]
mov dword [esp + 0x2c], ecx
mov esi, dword [ebx]
test esi, esi
js 0x51585b
xor ecx, ecx
test edx, edx
cmovs edx, ecx
mov edi, dword [esp + 0x10]
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 edi, esi
shr edi, cl
add ebx, 0xa
mov dword [esp + 8], eax
mov eax, dword [esp + 8]
push ebx
push edi
push eax
call fcn.005159e0
add esp, 0xc
mov dword [esp + 4], eax
mov eax, dword [esp + 4]
lea ecx, [esp + 0x18]
push eax
call fcn.00516010
jmp 0x515840
lea eax, [esp + 0x64]
mov eax, dword [eax]
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x4c]
lea ecx, [esp + 0x18]
push eax
call fcn.00515ac0
jmp 0x515853
test edx, edx
jle 0x515701
add esi, edx
lea eax, [esp + 0x64]
mov eax, dword [eax]
lea ecx, [esp + 0x34]
mov dword [esp + 0x18], ecx
lea ecx, [esp + 0x3c]
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x38]
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x68]
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x70]
mov dword [esp + 0x28], ecx
lea ecx, [esp + 0x78]
mov dword [esp + 0x2c], ecx
lea ecx, [esp + 0xc]
mov dword [esp + 0x30], ecx
mov edi, dword [ebx]
test edi, edi
js 0x51585b
xor ecx, ecx
sub edi, esi
cmovb edi, ecx
movzx ecx, byte [ebx + 9]
and ecx, 0xf
mov cl, byte [ecx + 0x573c25]
mov esi, edi
shr esi, cl
add ebx, 0xa
mov dword [esp + 8], eax
mov eax, dword [esp + 8]
push ebx
push esi
push eax
call fcn.005159e0
add esp, 0xc
mov dword [esp + 4], eax
mov eax, dword [esp + 4]
lea ecx, [esp + 0x18]
push eax
call fcn.00515dc0
mov dword [esp], eax
sub edi, esi
mov eax, dword [esp]
push ebx
push edi
jmp 0x51584a
neg ebp
test edi, edi
sete al
test edx, edx
setns ah
and ah, al
cmp edx, ebp
setl cl
and cl, ah
mov eax, ebp
cmovne eax, edx
mov dword [esp + 0xc], eax
lea eax, [esp + 0x64]
mov eax, dword [eax]
lea esi, [esp + 0x34]
mov dword [esp + 0x18], esi
lea esi, [esp + 0xc]
mov dword [esp + 0x1c], esi
lea esi, [esp + 0x38]
mov dword [esp + 0x20], esi
lea esi, [esp + 0x70]
mov dword [esp + 0x24], esi
lea esi, [esp + 0x78]
mov dword [esp + 0x28], esi
lea esi, [esp + 0x3c]
mov dword [esp + 0x2c], esi
mov esi, dword [ebx]
test esi, esi
js 0x51585b
test cl, cl
cmovne ebp, edx
mov ecx, dword [esp + 0x10]
add ecx, ebp
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 edi, esi
shr edi, cl
add ebx, 0xa
mov dword [esp + 8], eax
mov eax, dword [esp + 8]
push ebx
push edi
push eax
call fcn.005159e0
add esp, 0xc
mov dword [esp + 4], eax
mov eax, dword [esp + 4]
lea ecx, [esp + 0x18]
push eax
call fcn.00516130
mov dword [esp], eax
sub esi, edi
mov eax, dword [esp]
push ebx
push esi
push eax
call fcn.005159e0
add esp, 0xc
add esp, 0x50
pop esi
pop edi
pop ebx
pop ebp
ret
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