Function at 0x100401bed
Capabilities:
Terminate process
Write file on windows

Disassembly:
push rbp
push rbx
sub rsp, 0x78
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x10], rcx
mov eax, edx
mov ecx, r8d
mov edx, r9d
mov byte [rbp + 0x18], al
mov byte [rbp + 0x20], cl
mov byte [rbp + 0x28], dl
lea rax, str.stdin
mov qword [rbp - 0x30], rax
lea rax, str.stdout
mov qword [rbp - 0x28], rax
lea rax, str.stderr
mov qword [rbp - 0x20], rax
mov rax, qword [rbp + 0x10]
mov byte [rax + 4], 1
mov rax, qword [rbp + 0x10]
movzx edx, byte [rbp + 0x20]
mov byte [rax + 5], dl
mov rax, qword [rbp + 0x10]
movzx edx, byte [rbp + 0x28]
mov byte [rax + 6], dl
mov dword [rbp - 0x14], 0
cmp dword [rbp - 0x14], 2
jg 0x100401d3c
mov rdx, qword [rbp + 0x10]
mov eax, dword [rbp - 0x14]
cdqe
movzx eax, byte [rdx + rax + 4]
xor eax, 1
test al, al
jne 0x100401d32
mov eax, dword [rbp - 0x14]
mov ecx, eax
call sub.msys_2.0.dll_isatty
test eax, eax
sete al
test al, al
je 0x100401cd8
mov rdx, qword [rbp + 0x10]
mov eax, dword [rbp - 0x14]
cdqe
mov byte [rdx + rax + 4], 0
movzx eax, byte [rbp + 0x18]
xor eax, 1
test al, al
je 0x100401d33
mov eax, dword [rbp - 0x14]
cdqe
mov rbx, qword [rbp + rax*8 - 0x30]
call sub.msys_2.0.dll___getreent
mov rax, qword [rax + 0x18]
mov r8, rbx
lea rdx, str._s_is_not_a_tty_n
mov rcx, rax
call sub.msys_2.0.dll_fprintf
mov ecx, 1
call sub.msys_2.0.dll_exit
mov rdx, qword [rbp + 0x10]
mov eax, dword [rbp - 0x14]
cdqe
mov byte [rdx + rax + 4], 1
mov eax, dword [rbp - 0x14]
movsxd rdx, eax
mov rax, rdx
shl rax, 2
add rax, rdx
add rax, rax
add rax, rdx
shl rax, 2
mov rdx, qword [rbp + 0x10]
add rax, rdx
lea rdx, [rax + 8]
mov eax, dword [rbp - 0x14]
mov ecx, eax
call sub.msys_2.0.dll_tcgetattr
shr eax, 0x1f
test al, al
je 0x100401d33
lea rcx, str.tcgetattr_failed
call sub.msys_2.0.dll_perror
mov ecx, 1
call sub.msys_2.0.dll_exit
nop
add dword [rbp - 0x14], 1
jmp 0x100401c56
mov rax, qword [rbp + 0x10]
movzx eax, byte [rax + 4]
test al, al
je 0x100401df6
lea rax, [rbp - 0x60]
mov rdx, rax
mov ecx, 0
call sub.msys_2.0.dll_tcgetattr
shr eax, 0x1f
test al, al
je 0x100401d7a
lea rcx, str.tcgetattr_failed
call sub.msys_2.0.dll_perror
mov ecx, 1
call sub.msys_2.0.dll_exit
mov eax, dword [rbp - 0x54]
and eax, 0xfffffef8
mov dword [rbp - 0x54], eax
mov eax, dword [rbp - 0x60]
and eax, 0xfffffacd
mov dword [rbp - 0x60], eax
mov eax, dword [rbp - 0x58]
and eax, 0xfffffecf
mov dword [rbp - 0x58], eax
mov eax, dword [rbp - 0x58]
or eax, 0x30
mov dword [rbp - 0x58], eax
mov byte [rbp - 0x46], 1
mov byte [rbp - 0x3f], 0
lea rax, [rbp - 0x60]
mov r8, rax
mov edx, 1
mov ecx, 0
call sub.msys_2.0.dll_tcsetattr
shr eax, 0x1f
test al, al
je 0x100401df6
call sub.msys_2.0.dll___getreent
mov rax, qword [rax + 0x18]
mov r9, rax
mov r8d, 0x11
mov edx, 1
lea rcx, str.tcsetattr_failed_n
call sub.msys_2.0.dll_fwrite
mov ecx, 1
call sub.msys_2.0.dll_exit
mov dword [rbp - 0x18], 1
cmp dword [rbp - 0x18], 2
jg 0x100401ebc
mov rdx, qword [rbp + 0x10]
mov eax, dword [rbp - 0x18]
cdqe
movzx eax, byte [rdx + rax + 4]
xor eax, 1
test al, al
jne 0x100401eb2
lea rdx, [rbp - 0x60]
mov eax, dword [rbp - 0x18]
mov ecx, eax
call sub.msys_2.0.dll_tcgetattr
shr eax, 0x1f
test al, al
je 0x100401e4b
lea rcx, str.tcgetattr_failed
call sub.msys_2.0.dll_perror
mov ecx, 1
call sub.msys_2.0.dll_exit
mov eax, dword [rbp - 0x58]
and eax, 0xfffffecf
mov dword [rbp - 0x58], eax
mov eax, dword [rbp - 0x58]
or eax, 0x30
mov dword [rbp - 0x58], eax
mov eax, dword [rbp - 0x5c]
and eax, 0xfffffffe
mov dword [rbp - 0x5c], eax
lea rdx, [rbp - 0x60]
mov eax, dword [rbp - 0x18]
mov r8, rdx
mov edx, 1
mov ecx, eax
call sub.msys_2.0.dll_tcsetattr
shr eax, 0x1f
test al, al
je 0x100401eb3
call sub.msys_2.0.dll___getreent
mov rax, qword [rax + 0x18]
mov r9, rax
mov r8d, 0x11
mov edx, 1
lea rcx, str.tcsetattr_failed_n
call sub.msys_2.0.dll_fwrite
mov ecx, 1
call sub.msys_2.0.dll_exit
nop
add dword [rbp - 0x18], 1
jmp 0x100401dfd
nop
mov rax, qword [rbp + 0x10]
add rsp, 0x78
pop rbx
pop rbp
ret