Function at 0x1400518d0
Capabilities:
Get common file path

Disassembly:
push rsi
push rdi
push rbx
sub rsp, 0x250
mov rax, qword [0x1400d5038]
xor rax, rsp
mov qword [rsp + 0x248], rax
mov sil, 1
cmp qword [0x1400e9188], 0
jne 0x140051b67
mov rdi, qword [0x1400e9160]
test rdi, rdi
je 0x14005191b
test byte [0x1400d854c], 1
jne 0x140051a23
jmp 0x140051b67
mov ecx, 0x18
call fcn.140080b60
mov rdi, rax
lea rbx, [rsp + 0x40]
mov r8d, 0x208
mov rcx, rbx
mov dl, 0xaa
call fcn.140084230
xor ecx, ecx
mov rdx, rbx
mov r8d, 0x104
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
movaps xmm0, xmmword [0x1400bea10]
movups xmmword [rdi], xmm0
movabs rax, 0xaaaaaaaaaaaaaaaa
mov qword [rdi + 0x10], rax
mov rcx, rdi
mov rdx, rbx
call fcn.14001c09e
movzx ecx, byte [rdi + 0x17]
test cl, cl
mov rax, qword [rdi]
mov rdx, qword [rdi + 8]
mov r8, rcx
cmovs r8, rdx
mov r10, rdi
cmovs r10, rax
test r8, r8
je 0x1400519fa
add r8, r8
nop word cs:[rax + rax]
test r8, r8
je 0x1400519fa
lea r9, [r8 - 2]
cmp word [r10 + r8 - 2], 0x5c
mov r8, r9
jne 0x1400519a0
cmp r9, 0xfffffffffffffffe
je 0x1400519fa
mov r8, r9
sar r8, 1
lea r10, [r8 + 1]
test cl, cl
js 0x1400519e5
cmp r8, rcx
jae 0x140051bf9
cmp r9, 0x14
jae 0x140051bcd
mov byte [rdi + 0x17], r10b
mov rax, rdi
jmp 0x1400519f2
cmp rdx, r8
jbe 0x140051bf9
mov qword [rdi + 8], r10
mov word [rax + r8*2 + 2], 0
lea rdx, str.debug.log
mov r8d, 9
mov rcx, rdi
call fcn.140041c98
mov qword [0x1400e9160], rdi
test byte [0x1400d854c], 1
je 0x140051b67
cmp byte [rdi + 0x17], 0
jns 0x140051a2c
mov rdi, qword [rdi]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
mov rcx, rdi
mov edx, 4
mov r8d, 3
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [0x1400e9188], rax
inc rax
cmp rax, 1
ja 0x140051b67
lea rdi, [rsp + 0x40]
mov r8d, 0x208
mov rcx, rdi
mov dl, 0xaa
call fcn.140084230
mov word [rsp + 0x40], 0
mov ecx, 0x104
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
add eax, 0xfffffefb
cmp eax, 0xfffffefc
jb 0x140051b65
mov rcx, qword [0x1400e9160]
lea rdx, [rsp + 0x40]
call fcn.140041aba
mov rcx, qword [0x1400e9160]
movzx eax, byte [rcx + 0x17]
test al, al
js 0x140051b84
test rax, rax
je 0x140051ba1
mov rdx, rcx
cmp word [rdx + rax*2 - 2], 0x5c
je 0x140051afb
lea rdx, [0x1400c0840]
mov r8d, 1
call fcn.140041c98
mov rcx, qword [0x1400e9160]
lea rdx, str.debug.log
mov r8d, 9
call fcn.140041c98
mov rcx, qword [0x1400e9160]
cmp byte [rcx + 0x17], 0
jns 0x140051b1d
mov rcx, qword [rcx]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
mov edx, 4
mov r8d, 3
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [0x1400e9188], rax
inc rax
cmp rax, 1
ja 0x140051b67
mov qword [0x1400e9188], 0
xor esi, esi
mov rcx, qword [rsp + 0x248]
xor rcx, rsp
call fcn.1400820f0
mov eax, esi
add rsp, 0x250
pop rbx
pop rdi
pop rsi
ret
mov rax, qword [rcx + 8]
test rax, rax
je 0x140051ba1
mov rdx, qword [rcx]
cmp word [rdx + rax*2 - 2], 0x5c
jne 0x140051ae2
jmp 0x140051afb
lea rax, str.string::back__:_string_is_empty
mov qword [rsp + 0x20], rax
lea rcx, str._s:_d:_assertion__s_failed:__s
lea rdx, str....._buildtools_third_partylibc_trunkinclude_string
lea r9, str._empty__
mov r8d, 0x4d1
call fcn.140020b04
lea rax, str.__s_should_never_be_greater_than_or_equal_to_the_short_string_capacity
mov qword [rsp + 0x20], rax
lea rcx, str._s:_d:_assertion__s_failed:__s
lea rdx, str....._buildtools_third_partylibc_trunkinclude_string
lea r9, str.__s_____min_cap
mov r8d, 0x6d7
call fcn.140020b04
call fcn.1400952f0
int3