Function at 0x100407410
Capabilities:
Terminate process

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x78
mov r12, rcx
mov rcx, qword [0x10040d030]
mov r13d, edx
mov ebx, r8d
mov edi, ebx
call sub.msys_2.0.dll_strlen
add r13d, eax
mov dword [rsp + 0x28], eax
mov rsi, rax
mov eax, dword [0x10040d03c]
test eax, eax
setle byte [0x1004170e5]
and edi, 1
je 0x100407467
mov edx, dword [0x1004170ec]
cmp edx, dword [0x10040d020]
jg 0x100407570
mov eax, ebx
and eax, 0xc
cmp eax, 4
jne 0x10040747a
cmp byte [0x1004170e6], 0
jne 0x1004074d0
test r12, r12
jne 0x1004075c0
mov qword [0x1004170c8], 0
xor r8d, r8d
lea rdx, [0x100410cf4]
lea r13, [0x1004170c0]
mov rcx, r13
call fcn.100407220
and ebx, 4
jne 0x100407588
mov rcx, r12
call sub.msys_2.0.dll_strlen
add dword [0x1004170ec], eax
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov ebp, dword [0x10040d03c]
test ebp, ebp
js 0x10040747a
mov r8d, dword [0x1004170ec]
add r13d, r8d
cmp ebp, r13d
jge 0x10040747a
mov rax, qword [0x10040d028]
mov rcx, r12
mov dword [rsp + 0x30], r8d
xor r13d, r13d
mov qword [rsp + 0x50], rax
call sub.msys_2.0.dll_strlen
movzx r9d, byte [r12]
mov r8d, dword [rsp + 0x30]
xor r11d, r11d
mov r15, rax
mov r10d, 1
mov r14d, r9d
lea rdx, [r12 + 1]
mov eax, r14d
xor ecx, ecx
test r14b, r14b
jne 0x10040755b
jmp 0x100407600
lea r9, [rcx + 1]
test r13d, r13d
je 0x1004075d8
mov byte [r11 + rcx], al
mov rcx, r9
movzx eax, byte [rdx]
add rdx, 1
test al, al
je 0x100407600
cmp al, 0x20
jne 0x100407538
test r13d, r13d
jne 0x1004075e0
add r15, 2
jmp 0x10040754c
add edx, r13d
cmp eax, edx
jge 0x100407467
call fcn.1004072b0
jmp 0x100407467
mov rdx, qword [0x10040d030]
test rdx, rdx
jne 0x100407727
mov qword [0x1004170c8], 0
xor r8d, r8d
lea rdx, [0x100410cf4]
mov rcx, r13
call fcn.100407220
jmp 0x1004074b0
mov rcx, r12
call sub.msys_2.0.dll_strlen
mov rdx, r12
mov r8, rax
jmp 0x100407498
mov rcx, r9
jmp 0x10040754c
lea rax, [r11 + rcx]
mov r9d, 0x735c
add rcx, 2
mov word [rax], r9w
mov byte [rax + 2], 0
jmp 0x10040754c
test r13d, r13d
je 0x1004079a2
mov byte [r11 + rcx], 0
cmp r10d, 2
jne 0x10040771a
mov rcx, r11
mov dword [rsp + 0x30], r8d
mov qword [rsp + 0x38], r11
call sub.msys_2.0.dll_strlen
mov r8d, dword [rsp + 0x30]
mov dword [rsp + 0x4c], eax
mov r15, rax
mov eax, dword [0x1004170f4]
sub eax, 2
cmp eax, 1
jbe 0x1004079f0
mov rcx, qword [rsp + 0x38]
mov edx, 0x3d
mov dword [rsp + 0x30], r8d
call sub.msys_2.0.dll_strchr
test rax, rax
je 0x100407a53
add rax, 1
mov edx, 8
sub rax, qword [rsp + 0x38]
cmp eax, edx
lea rcx, [rsp + 0x67]
lea r9, [0x100410d06]
cmovle edx, eax
mov dword [rsp + 0x40], edx
mov r8d, edx
lea rdx, [0x100410d08]
call sub.msys_2.0.dll_sprintf
cmp byte [0x1004170e7], 0
je 0x100407741
mov r14, qword [rsp + 0x38]
mov edx, 0xa
mov rcx, r14
call sub.msys_2.0.dll_strchr
test rax, rax
je 0x100407741
mov rsi, r14
lea r13, [0x1004170c0]
test r15d, r15d
jle 0x1004076e6
nop
mov rcx, rsi
call sub.msys_2.0.dll_strlen
mov rdx, rsi
mov rcx, r13
mov r8, rax
call fcn.100407220
and ebx, 4
jne 0x100407a1a
mov rax, qword [rsp + 0x50]
mov qword [0x10040d028], rax
call fcn.1004072b0
mov rcx, qword [rsp + 0x38]
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sub.msys_2.0.dll_free
add r13d, 1
add r10d, 1
jmp 0x10040751e
mov rcx, rdx
mov qword [rsp + 0x28], rdx
call sub.msys_2.0.dll_strlen
mov rdx, qword [rsp + 0x28]
mov r8, rax
jmp 0x1004075ad
mov eax, dword [0x1004170f4]
mov dword [rsp + 0x48], 0
sub eax, 2
cmp eax, 1
jbe 0x100407a5a
mov eax, 0x20
cmp ebp, eax
cmovge eax, ebp
add esi, r15d
add esi, dword [0x1004170ec]
mov dword [rsp + 0x44], eax
cmp eax, esi
jge 0x100407b09
mov dword [rsp + 0x58], ebx
mov esi, dword [rsp + 0x44]
lea r13, [0x1004170c0]
mov dword [rsp + 0x34], 0
sub esi, dword [rsp + 0x48]
mov dword [rsp + 0x30], r15d
mov edi, esi
lea r15, [rsp + 0x67]
nop dword [rax]
mov eax, dword [rsp + 0x4c]
movsxd rbp, dword [rsp + 0x34]
sub eax, ebp
cmp eax, edi
cmovle edi, eax
test edi, edi
jle 0x10040782a
mov ecx, edi
sub ecx, 1
je 0x100407ad3
mov rax, qword [rsp + 0x38]
movsxd r14, ecx
mov rsi, r14
lea r12, [rax + rbp]
jmp 0x1004077fc
call sub.msys_2.0.dll___locale_ctype_ptr
test byte [rbx + rax + 1], 7
je 0x1004078b0
sub rsi, 1
test esi, esi
je 0x1004078b0
movzx ebx, byte [r12 + rsi]
mov r8d, esi
lea rax, [rbp + rsi]
cmp bl, 0x5c
jne 0x1004077e0
mov rsi, qword [rsp + 0x38]
cmp byte [rsi + rax - 1], 0x5c
jne 0x10040781e
sub r8d, 1
cmp edi, r8d
jle 0x100407b3b
mov edi, r8d
mov rax, qword [rsp + 0x38]
movsxd r8, edi
mov rcx, r13
lea rdx, [rax + rbp]
call fcn.100407220
sub dword [rsp + 0x30], edi
mov eax, dword [rsp + 0x30]
add dword [rsp + 0x34], edi
test eax, eax
jle 0x100407862
call fcn.1004072b0
mov byte [0x1004170e5], 1
mov dword [rsp + 0x48], 0
mov eax, dword [rsp + 0x28]
add eax, dword [rsp + 0x30]
add eax, dword [0x1004170ec]
cmp eax, dword [rsp + 0x44]
jle 0x10040795d
mov edx, dword [rsp + 0x34]
mov edi, dword [rsp + 0x44]
sub edi, dword [rsp + 0x48]
test edx, edx
je 0x1004077a8
mov rcx, r15
call sub.msys_2.0.dll_strlen
mov rdx, r15
mov rcx, r13
mov r8, rax
call fcn.100407220
sub edi, dword [rsp + 0x40]
jmp 0x1004077a8
mov ecx, dword [rsp + 0x34]
mov r8d, edi
jmp 0x1004078cd
sub r14, 1
test r14d, r14d
je 0x100407951
cmp byte [r12 + r14], 0x25
mov esi, r14d
lea eax, [rcx + r14]
lea rdx, [rbp + r14]
jne 0x1004078c0
test eax, eax
jle 0x1004078f3
mov rbx, qword [rsp + 0x38]
mov ecx, r14d
cmp byte [rbx + rdx - 1], 0x5c
je 0x10040794b
mov rbx, qword [rsp + 0x38]
mov ecx, dword [0x1004170f4]
lea edx, [rax + 1]
movsxd rdx, edx
movsx r9d, byte [rbx + rdx]
lea edx, [rcx - 2]
cmp edx, 1
jbe 0x100407a81
cmp r9d, 0x27
je 0x100407acb
cmp r9d, 0x7b
je 0x100407ade
lea rcx, [0x100410d0c]
mov edx, r9d
mov dword [rsp + 0x5c], r8d
call sub.msys_2.0.dll_strchr
mov ecx, esi
mov r8d, dword [rsp + 0x5c]
cmp rax, 1
sbb ecx, 0xfffffffd
cmp edi, ecx
cmovl r8d, esi
cmp edi, r8d
cmovg edi, r8d
jmp 0x10040782a
mov eax, dword [rsp + 0x30]
mov ebx, dword [rsp + 0x58]
test eax, eax
jle 0x1004076e6
movsxd rsi, dword [rsp + 0x34]
mov rax, rsi
add rsi, qword [rsp + 0x38]
test eax, eax
je 0x1004076d0
lea r12, [rsp + 0x67]
mov rcx, r12
call sub.msys_2.0.dll_strlen
mov rdx, r12
mov rcx, r13
mov r8, rax
call fcn.100407220
jmp 0x1004076d0
lea rcx, [r15 + 1]
mov edx, 1
mov dword [rsp + 0x34], r8d
mov dword [rsp + 0x30], r10d
call sub.msys_2.0.dll_calloc
mov r10d, dword [rsp + 0x30]
mov r8d, dword [rsp + 0x34]
test rax, rax
mov r11, rax
jne 0x10040771a
lea rcx, str.fill_spaces
call sub.msys_2.0.dll_perror
mov ecx, 1
call sub.msys_2.0.dll_exit
nop word cs:[rax + rax]
lea rax, str._n_t
mov qword [0x10040d028], rax
cmp r8d, 8
jg 0x100407a99
mov byte [rsp + 0x67], 0
mov dword [rsp + 0x40], 0
jmp 0x100407697
mov r12, qword [0x10040d030]
test r12, r12
jne 0x100407b2b
mov qword [0x1004170c8], 0
xor r8d, r8d
lea r12, [0x100410cf4]
mov rdx, r12
lea rcx, [0x1004170c0]
call fcn.100407220
jmp 0x1004076ef
mov r8d, dword [rsp + 0x30]
jmp 0x1004079fe
cmp qword [0x1004170c8], 0
je 0x100407a74
mov dword [rsp + 0x48], 3
test edi, edi
je 0x10040775b
mov dword [rsp + 0x48], 0
jmp 0x10040775b
cmp r9d, 0x3e
je 0x100407acb
xor ecx, ecx
cmp r9d, 0x2b
sete cl
lea ecx, [rcx + rsi + 2]
jmp 0x10040794b
lea ecx, [r8 - 8]
mov eax, 8
lea r9, [0x100410d06]
cmp ecx, eax
lea rdx, [0x100410d08]
cmovle eax, ecx
lea rcx, [rsp + 0x67]
mov r8d, eax
mov dword [rsp + 0x40], eax
call sub.msys_2.0.dll_sprintf
jmp 0x100407697
lea ecx, [rsi + 4]
jmp 0x10040794b
mov r8d, 1
jmp 0x100407951
cdqe
mov edx, 1
add rax, qword [rsp + 0x38]
movsx ecx, byte [rax + rdx + 1]
mov r9d, edx
test ecx, ecx
je 0x100407b23
add rdx, 1
cmp ecx, 0x7d
jne 0x100407aea
lea ecx, [r9 + rsi + 2]
jmp 0x10040794b
mov rsi, qword [rsp + 0x38]
lea r13, [0x1004170c0]
test r15d, r15d
jg 0x1004076d0
jmp 0x1004076e6
lea ecx, [rsi + 1]
jmp 0x10040794b
mov rcx, r12
call sub.msys_2.0.dll_strlen
mov r8, rax
jmp 0x100407a3f
mov ecx, dword [rsp + 0x34]
jmp 0x1004078cd