Function at 0x100401270
Capabilities:
Query environment variable

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x430
mov ebx, ecx
mov r12, rdx
lea rsi, [rsp + 0x30]
test rdx, rdx
je 0x1004013e3
lea rcx, [0x10040506b]
call sub.msys_2.0.dll_getenv
mov rcx, rax
test rax, rax
je 0x1004012b5
call sub.msys_ncursesw6.dll__nc_is_abs_path
test al, al
je 0x100401345
cmp byte [r12], 0x3f
je 0x1004013c5
lea r13, str._s:_cant_initialize_terminal_type__s__error__d__n
lea rbp, str._s:_unknown_terminal_type__s_n
jmp 0x1004012f1
call sub.msys_2.0.dll___getreent
mov r9, r12
mov r8, r14
mov rdx, rbp
mov rcx, qword [rax + 0x18]
call sub.msys_2.0.dll_fprintf
xor ecx, ecx
call 0x100401150
mov r12, rax
mov r8, rsi
mov edx, ebx
mov rcx, r12
call sub.msys_ncursesw6.dll_setupterm
test eax, eax
je 0x100401330
mov edi, dword [rsp + 0x30]
mov r14, qword [str.tset]
test edi, edi
je 0x1004012d0
call sub.msys_2.0.dll___getreent
mov r9, r12
mov r8, r14
mov rdx, r13
mov rcx, qword [rax + 0x18]
mov dword [rsp + 0x20], edi
call sub.msys_2.0.dll_fprintf
jmp 0x1004012e7
mov rax, r12
add rsp, 0x430
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rax, qword [sym.imp.msys_2.0.dll_environ]
mov rbp, qword [rax]
mov rdx, qword [rbp]
test rdx, rdx
je 0x1004012b5
xor edi, edi
lea r14, str.TERMCAP
jmp 0x100401382
add rdi, 1
mov rdx, qword [rbp + rdi*8]
test rdx, rdx
je 0x1004012b5
mov r8d, 8
mov rcx, r14
movsxd r13, edi
call sub.msys_2.0.dll_strncmp
test eax, eax
jne 0x100401370
mov rdx, qword [rbp + r13*8 + 8]
lea rax, [rbp + r13*8]
mov qword [rax], rdx
test rdx, rdx
je 0x1004012b5
nop dword [rax]
mov rdx, qword [rax + 0x10]
add rax, 8
mov qword [rax], rdx
test rdx, rdx
jne 0x1004013b0
jmp 0x1004012b5
cmp byte [r12 + 1], 0
je 0x100401497
lea rcx, [r12 + 1]
call 0x100401150
mov r12, rax
jmp 0x1004012c0
lea rcx, str.TERM
call sub.msys_2.0.dll_getenv
mov r12, rax
test rax, rax
je 0x1004014a6
mov rdi, qword [0x100409100]
test rdi, rdi
je 0x100401294
mov rax, qword [sym.imp.msys_ncursesw6.dll_ospeed]
lea rbp, [0x1004050d4]
movsx r13d, word [rax]
nop dword [rax]
mov rcx, qword [rdi + 8]
test rcx, rcx
je 0x100401435
mov rdx, r12
call sub.msys_2.0.dll_strcmp
test eax, eax
jne case.0x100401446.5
cmp dword [rdi + 0x18], 6
ja case.0x100401446.5
mov eax, dword [rdi + 0x18]
movsxd rax, dword [rbp + rax*4]
add rax, rbp
jmp rax
xor eax, eax
cmp r13d, dword [rdi + 0x1c]
setle al
test eax, eax
je case.0x100401446.5
mov r12, qword [rdi + 0x10]
jmp 0x100401294
mov rdi, qword [rdi]
test rdi, rdi
jne 0x100401420
jmp 0x100401294
xor eax, eax
cmp r13d, dword [rdi + 0x1c]
setl al
jmp 0x100401451
xor eax, eax
cmp dword [rdi + 0x1c], r13d
setle al
jmp 0x100401451
xor eax, eax
cmp dword [rdi + 0x1c], r13d
sete al
jmp 0x100401451
xor eax, eax
cmp dword [rdi + 0x1c], r13d
setl al
jmp 0x100401451
xor ecx, ecx
call 0x100401150
mov r12, rax
jmp 0x1004012c0
mov ecx, ebx
call sub.msys_2.0.dll_ttyname
mov rcx, rax
test rax, rax
je 0x10040155b
call sub.msys_ncursesw6.dll__nc_basename
lea r12, [0x100405052]
lea rcx, str._etc_ttytype
mov rdx, r12
mov rbp, rax
call sub.msys_2.0.dll_fopen
mov r14, rax
test rax, rax
je 0x100401544
lea rsi, [rsp + 0x30]
mov r8, r14
mov edx, 0x3ff
mov rcx, rsi
call sub.msys_2.0.dll_fgets
test rax, rax
je 0x1004015ae
cmp byte [rsp + 0x30], 0
je 0x1004014e4
xor r13d, r13d
xor r12d, r12d
mov rdi, rsi
jmp 0x10040151c
mov byte [rdi], 0
add rdi, 1
cmp byte [rdi], 0
je 0x100401571
call sub.msys_2.0.dll___locale_ctype_ptr
movzx edx, byte [rdi]
test byte [rdx + rax + 1], 8
jne 0x100401510
test r12, r12
je 0x10040156c
test r13, r13
jne 0x100401513
cmp rdi, rsi
je 0x100401513
cmp byte [rdi - 1], 0
cmove r13, rdi
jmp 0x100401513
mov rdx, r12
lea rcx, str._etc_ttys
call sub.msys_2.0.dll_fopen
mov r14, rax
test rax, rax
jne 0x1004014df
lea r12, str.unknown
lea rsi, [rsp + 0x30]
jmp 0x1004013fb
mov r12, rdi
jmp 0x100401513
test r12, r12
je 0x1004014e4
test r13, r13
je 0x1004014e4
mov rdx, rbp
mov rcx, r13
call sub.msys_2.0.dll_strcmp
test eax, eax
jne 0x1004014e4
mov rcx, r12
call sub.msys_2.0.dll_strdup
mov rcx, r14
mov r12, rax
call sub.msys_2.0.dll_fclose
jmp 0x1004013fb
mov rcx, r14
lea r12, str.unknown
call sub.msys_2.0.dll_fclose
jmp 0x1004013fb