Function at 0x1400d1f36
Capabilities:
Query environment variable

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x88
lea rbp, [rsp + 0x80]
test rdx, rdx
mov r14, rdx
mov qword [rbp + 0x60], r8
mov r13, rcx
sete al
test r8, r8
mov r15d, r9d
sete dl
or al, dl
jne 0x1400d22fb
test rcx, rcx
je 0x1400d22fb
call fcn.1400d1cfc
cmp r13, rax
jne 0x1400d20c3
lea rcx, [0x1401dc5c0]
call sub.msvcrt.dll_getenv
mov rsi, rax
test rax, rax
je 0x1400d20c3
mov rcx, rax
call sub.msvcrt.dll_strlen
mov rcx, r13
test rax, rax
lea rdi, [rax + 1]
mov eax, 2
cmove rdi, rax
call sub.msvcrt.dll_strlen
add rax, rdi
lea rcx, [rax + 5]
cmp rcx, 0xfbf
ja 0x1400d1fee
add rax, 0x14
and rax, 0xfffffffffffffff0
call fcn.1400df280
xor edx, edx
sub rsp, rax
mov qword [rbp - 0x58], rdx
lea r12, [rsp + 0x20]
jmp 0x1400d1ffa
call sub.msvcrt.dll_malloc
mov qword [rbp - 0x58], rax
mov r12, rax
lea rax, [rbp - 0x38]
mov rbx, rsi
mov qword [rbp - 0x48], rax
mov al, byte [rbx]
cmp al, 0x3b
je 0x1400d2014
test al, al
je 0x1400d2014
inc rbx
jmp 0x1400d2005
cmp rsi, rbx
jne 0x1400d2028
mov word [r12], 0x2f2e
mov byte [r12 + 2], 0
jmp 0x1400d2051
mov rax, rbx
mov rdi, r12
sub rax, rsi
mov rcx, rax
rep movsb byte [rdi], byte [rsi]
mov dl, byte [rbx - 1]
cmp dl, 0x2f
je 0x1400d204e
cmp dl, 0x5c
je 0x1400d204e
mov byte [rdi], 0x2f
mov byte [r12 + rax + 1], 0
jmp 0x1400d2051
mov byte [rdi], 0
mov rdx, r13
mov rcx, r12
call sub.msvcrt.dll_strcat
mov edx, 1
mov rcx, r12
call sub.msvcrt.dll__access
test eax, eax
jne 0x1400d2080
mov rdx, qword [rbp - 0x48]
mov rcx, r12
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
jns 0x1400d20a2
jmp 0x1400d20b5
lea rdx, str..exe
mov rcx, r12
call sub.msvcrt.dll_strcat
mov rcx, r12
mov edx, 1
call sub.msvcrt.dll__access
test eax, eax
je 0x1400d206d
jmp 0x1400d20b5
mov ax, word [rbp - 0x32]
and ax, 0xf000
cmp ax, 0x8000
jne 0x1400d20b5
mov r13, r12
jmp 0x1400d20c9
cmp byte [rbx], 0
je 0x1400d20c9
lea rsi, [rbx + 1]
jmp 0x1400d200f
xor eax, eax
mov qword [rbp - 0x58], rax
mov rcx, r13
test r15d, r15d
je 0x1400d20d8
call fcn.1400d1d00
jmp 0x1400d20dd
call sub.msvcrt.dll__strdup
mov rsi, rax
test rax, rax
jne 0x1400d20f4
xor r14d, r14d
xor ebx, ebx
xor r13d, r13d
xor edi, edi
jmp 0x1400d22d8
mov rcx, rax
lea rdx, [rbp - 0x40]
call fcn.1400d1dc5
mov rcx, rsi
mov rdi, rax
call sub.msvcrt.dll_free
test rdi, rdi
je 0x1400d20e5
lea rdx, [rbp - 0x3c]
mov rcx, r14
call fcn.1400d1dc5
mov r13, rax
test rax, rax
je 0x1400d22d3
mov eax, dword [rbp - 0x40]
mov esi, dword [rbp - 0x3c]
xor r12d, r12d
dec eax
mov dword [rbp - 0x48], eax
mov dword [rbp - 0x40], eax
cmp eax, esi
jne 0x1400d2173
cmp esi, r12d
jle 0x1400d2160
mov rdx, qword [r13 + r12*8]
mov rcx, qword [rdi + r12*8]
call sub.msvcrt.dll_strcmp
mov edx, eax
lea rax, [r12 + 1]
test edx, edx
jne 0x1400d2160
mov r12, rax
jmp 0x1400d213d
cmp dword [rbp - 0x48], 0
jle 0x1400d22d3
cmp esi, r12d
je 0x1400d22d3
mov rcx, qword [rbp + 0x60]
lea rdx, [rbp - 0x38]
xor r14d, r14d
call fcn.1400d1dc5
mov rbx, rax
test rax, rax
je 0x1400d22d8
mov eax, dword [rbp - 0x38]
mov dword [rbp - 0x4c], eax
cmp esi, eax
mov r15d, eax
cmovle r15d, esi
xor r12d, r12d
cmp r15d, r12d
jle 0x1400d21c4
mov rdx, qword [rbx + r12*8]
mov rcx, qword [r13 + r12*8]
call sub.msvcrt.dll_strcmp
mov edx, eax
lea rax, [r12 + 1]
test edx, edx
jne 0x1400d21c4
mov r12, rax
jmp 0x1400d21a1
mov dword [rbp - 0x50], r12d
test r12d, r12d
je 0x1400d222f
xor r15d, r15d
xor r14d, r14d
cmp dword [rbp - 0x48], r15d
jle 0x1400d21ea
mov rcx, qword [rdi + r15*8]
inc r15
call sub.msvcrt.dll_strlen
add r14d, eax
jmp 0x1400d21d3
movsxd r15, dword [rbp - 0x50]
mov edx, esi
sub edx, r15d
mov r8, r15
lea edx, [rdx + rdx*2]
add r14d, edx
cmp dword [rbp - 0x4c], r8d
jle 0x1400d221b
mov rcx, qword [rbx + r8*8]
mov qword [rbp - 0x60], r8
call sub.msvcrt.dll_strlen
mov r8, qword [rbp - 0x60]
add r14d, eax
inc r8
jmp 0x1400d21fc
lea ecx, [r14 + 1]
movsxd rcx, ecx
call sub.msvcrt.dll_malloc
mov r14, rax
test rax, rax
jne 0x1400d2237
xor r14d, r14d
jmp 0x1400d22d8
mov byte [rax], 0
xor r9d, r9d
cmp dword [rbp - 0x48], r9d
jle 0x1400d225c
mov rdx, qword [rdi + r9*8]
mov rcx, r14
mov qword [rbp - 0x60], r9
call sub.msvcrt.dll_strcat
mov r9, qword [rbp - 0x60]
inc r9
jmp 0x1400d223d
mov rcx, r14
call sub.msvcrt.dll_strlen
mov r10d, dword [rbp - 0x50]
lea r9, [r14 + rax]
mov rcx, r9
cmp esi, r10d
jle 0x1400d22a0
lea rdx, [0x1401dc5ca]
mov qword [rbp - 0x60], r9
mov dword [rbp - 0x48], r10d
call sub.msvcrt.dll_strcpy
mov r10d, dword [rbp - 0x48]
mov r9, qword [rbp - 0x60]
mov rcx, rax
add rcx, 3
inc r10d
mov byte [rcx - 1], 0x2f
jmp 0x1400d226f
mov edx, dword [rbp - 0x50]
mov eax, esi
sub eax, r12d
lea rax, [rax + rax*2]
cmp esi, edx
mov edx, 0
cmovl rax, rdx
mov byte [r9 + rax], 0
cmp dword [rbp - 0x4c], r15d
jle 0x1400d22d8
mov rdx, qword [rbx + r15*8]
mov rcx, r14
inc r15
call sub.msvcrt.dll_strcat
jmp 0x1400d22bc
xor r14d, r14d
xor ebx, ebx
mov rcx, rdi
call fcn.1400d1d8c
mov rcx, r13
call fcn.1400d1d8c
mov rcx, rbx
call fcn.1400d1d8c
mov rcx, qword [rbp - 0x58]
call sub.msvcrt.dll_free
jmp 0x1400d22fe
xor r14d, r14d
mov rax, r14
lea rsp, [rbp + 8]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret