Function at 0x140001520
Capabilities:
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
mov r14d, dword [0x140003010]
mov rdi, rcx
cmp r14d, 0xffffffff
je 0x1400015d0
sub r14d, 1
js 0x140001599
mov r13, qword [0x140007108]
mov rbp, qword [sym.imp.ucrtbase.dll_strcmp]
lea r12, [rdi + 1]
xor r15d, r15d
jmp 0x140001571
lea r15d, [rsi + 1]
cmp r15d, r14d
jg 0x140001599
lea esi, [r15 + r14]
mov rcx, r12
sar esi, 1
movsxd rbx, esi
shl rbx, 4
add rbx, r13
lea rdx, [rbx + 1]
call rbp
test eax, eax
je 0x1400015c8
jns 0x140001568
lea r14d, [rsi - 1]
cmp r15d, r14d
jle 0x140001571
cmp byte [rdi], 0
movzx eax, byte [0x140003014]
js 0x1400015c0
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov byte [rdi], al
jmp 0x1400015a5
movzx eax, byte [rbx]
jmp 0x1400015a5
lea rcx, str.WINEDEBUG
call qword [sym.imp.ucrtbase.dll_getenv]
mov dword [0x140003010], 0
test rax, rax
je 0x140001599
mov rcx, rax
call qword [sym.imp.ucrtbase.dll__strdup]
test rax, rax
je 0x140001729
mov qword [rsp + 0x30], rax
mov rbx, rax
mov qword [rsp + 0xa0], rdi
nop
mov edx, 0x2c
mov rcx, rbx
xor r12d, r12d
call qword [sym.imp.ucrtbase.dll_strchr]
test rax, rax
je 0x14000162d
mov byte [rax], 0
lea r12, [rax + 1]
lea rdx, [0x14000406a]
mov rcx, rbx
call qword [sym.imp.ucrtbase.dll_strcspn]
lea rdi, [rbx + rax]
mov rsi, rax
movzx r13d, byte [rdi]
test r13b, r13b
je 0x1400016c0
cmp rbx, rdi
jae 0x1400017f0
mov eax, 5
xor r14d, r14d
lea r15, str.fixme
cdqe
cmp rax, rsi
jne 0x140001683
mov rdx, qword [r15 + r14*8]
mov r8, rsi
mov rcx, rbx
call sym.memcmp
test eax, eax
je 0x140001895
add r14, 1
cmp r14, 4
je 0x1400016b0
mov rcx, qword [r15 + r14*8]
call qword [sym.imp.ucrtbase.dll_strlen]
cdqe
cmp rax, rsi
je 0x14000166c
add r14, 1
cmp r14, 4
jne 0x14000168d
nop dword [rax + rax]
test r12, r12
je 0x140001713
mov rbx, r12
jmp 0x140001610
movzx r13d, byte [rbx]
cmp r13b, 0x2d
je 0x140001738
lea esi, [r13 - 0x2b]
and esi, 0xfd
je 0x1400017e0
mov r14d, 0xffffffff
xor esi, esi
test r13b, r13b
je 0x1400016b0
lea rdx, [0x14000406d]
mov rcx, rbx
call qword [sym.imp.ucrtbase.dll_strcmp]
test eax, eax
jne 0x140001750
not esi
and sil, byte [0x140003014]
or esi, r14d
mov byte [0x140003014], sil
test r12, r12
jne 0x1400016b5
mov rbp, qword [rsp + 0x30]
mov rdi, qword [rsp + 0xa0]
mov rcx, rbp
call qword [sym.imp.ucrtbase.dll_free]
mov r14d, dword [0x140003010]
jmp 0x140001544
mov esi, 0xffffffff
xor r14d, r14d
mov rdi, rbx
movzx r13d, byte [rdi + 1]
lea rbx, [rdi + 1]
jmp 0x1400016e2
mov rcx, rbx
call qword [sym.imp.ucrtbase.dll_strlen]
mov r15, rax
cmp rax, 0xe
ja 0x1400016b0
mov r9d, dword [0x140003010]
mov rax, qword [0x140007108]
mov ebp, r9d
mov qword [rsp + 0x28], rax
sub ebp, 1
js 0x1400019d8
xor r13d, r13d
mov qword [rsp + 0x48], r15
mov dword [rsp + 0x40], r9d
mov r15d, r13d
mov r13d, ebp
mov rbp, rax
mov byte [rsp + 0x38], sil
jmp 0x1400017b1
lea r15d, [rsi + 1]
cmp r13d, r15d
jl 0x14000180b
lea r8d, [r15 + r13]
mov rcx, rbx
mov esi, r8d
sar esi, 1
movsxd rdi, esi
shl rdi, 4
add rdi, rbp
lea rdx, [rdi + 1]
call qword [sym.imp.ucrtbase.dll_strcmp]
test eax, eax
je 0x1400017f8
jns 0x1400017a8
lea r13d, [rsi - 1]
jmp 0x1400017ac
mov rdi, rbx
mov r14d, 0xffffffff
jmp 0x140001743
mov rbx, rdi
jmp 0x1400016c4
movzx edx, byte [rsp + 0x38]
not edx
and dl, byte [rdi]
or edx, r14d
mov byte [rdi], dl
jmp 0x1400016b0
movsxd r11, r15d
mov r9d, dword [rsp + 0x40]
movzx esi, byte [rsp + 0x38]
mov r10, r11
mov r15, qword [rsp + 0x48]
mov r13, r11
shl r10, 4
mov eax, dword [0x140007110]
cmp r9d, eax
jge 0x140001959
mov rax, qword [rsp + 0x28]
add r10, rax
cmp r13d, r9d
jl 0x14000191a
add r15, 1
lea rax, [r10 + 1]
cmp r15d, 8
jae 0x1400018ca
test r15b, 4
jne 0x1400019ff
test r15d, r15d
je 0x140001875
movzx edx, byte [rbx]
mov byte [r10 + 1], dl
test r15b, 2
jne 0x140001a17
mov eax, esi
add r9d, 1
not eax
and al, byte [0x140003014]
mov dword [0x140003010], r9d
or eax, r14d
mov byte [r10], al
jmp 0x1400016b0
mov ecx, r14d
mov eax, 1
shl eax, cl
mov r14d, eax
mov esi, eax
cmp r13b, 0x2b
je 0x1400019ce
lea r14d, [r13 - 0x2b]
and r14d, 0xfd
je 0x140001743
mov rbx, rdi
xor r14d, r14d
jmp 0x1400016e7
mov rdx, qword [rbx]
mov qword [r10 + 1], rdx
mov edx, r15d
mov rcx, qword [rbx + rdx - 8]
mov qword [rax + rdx - 8], rcx
lea rdx, [r10 + 9]
and rdx, 0xfffffffffffffff8
sub rax, rdx
add r15d, eax
sub rbx, rax
and r15d, 0xfffffff8
cmp r15d, 8
jb 0x140001875
and r15d, 0xfffffff8
xor eax, eax
mov ecx, eax
add eax, 8
mov r8, qword [rbx + rcx]
mov qword [rdx + rcx], r8
cmp eax, r15d
jb 0x140001903
jmp 0x140001875
mov r8d, r9d
mov rcx, qword [rsp + 0x28]
lea rax, [r11 + 1]
mov rdx, r10
sub r8d, r13d
shl rax, 4
mov dword [rsp + 0x38], r9d
movsxd r8, r8d
mov qword [rsp + 0x28], r10
add rcx, rax
shl r8, 4
call qword [sym.imp.ucrtbase.dll_memmove]
mov r9d, dword [rsp + 0x38]
mov r10, qword [rsp + 0x28]
jmp 0x140001847
mov ecx, 0x10
add eax, eax
mov qword [rsp + 0x40], r10
cmp eax, ecx
mov qword [rsp + 0x38], r11
cmovl eax, ecx
mov dword [0x140007110], eax
cdqe
shl rax, 4
mov r8, rax
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
cmp qword [rsp + 0x28], 0
mov rcx, qword [rax + 0x30]
je 0x1400019e6
mov r9, r8
xor edx, edx
mov r8, qword [rsp + 0x28]
call qword [sym.imp.kernel32.dll_HeapReAlloc]
mov r10, qword [rsp + 0x40]
mov r11, qword [rsp + 0x38]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x28]
mov r9d, dword [0x140003010]
mov qword [0x140007108], rax
jmp 0x140001836
mov rbx, rdi
xor esi, esi
jmp 0x140001740
xor r10d, r10d
xor r11d, r11d
xor r13d, r13d
jmp 0x140001827
xor edx, edx
call qword [sym.imp.kernel32.dll_HeapAlloc]
mov r11, qword [rsp + 0x38]
mov r10, qword [rsp + 0x40]
mov qword [rsp + 0x28], rax
jmp 0x1400019b6
mov edx, dword [rbx]
mov r15d, r15d
mov dword [r10 + 1], edx
mov edx, dword [rbx + r15 - 4]
mov dword [rax + r15 - 4], edx
jmp 0x140001875
mov r15d, r15d
movzx edx, word [rbx + r15 - 2]
mov word [rax + r15 - 2], dx
jmp 0x140001875