// File: /workspace/github_cpp_makefile_star2_O1/AndreiBarsan[P]uShell/command.cc
// Function: microshell::core::DiskCommand::invoke(microshell::core::Shell*)
int DiskCommand::invoke(Shell *shell) {
  string comma_args =
    util::merge_with(argv.begin() + 1, argv.end(), ", ");
  shell->out("Invoking program [" + argv[0] + "] with args [" +
              comma_args + "]");
  //signal(SIGCHLD, handle_sigchld);
  pid_t child_pid = fork();
  if(-1 == child_pid) {
    // TODO(andrei) Shell::perror().
    shell->eout("Could not crete a child to run the command. "
                "OS says [" + string(strerror(errno)) + "]. errno = " +
                to_string(errno));
    return -1;
  }
  else if(0 == child_pid) {
    this->handle_child(shell);
    // No return, the child will just 'exec' or 'exit' (on error).
  }

  return this->handle_parent(shell, child_pid);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
addq $0x20, %rax
movq %rax, -0x50(%rbp)
movq 0x10(%rdi), %rax
movq %rax, -0x70(%rbp)
leaq -0xe0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8853(%rip), %rsi      # 0xe435
leaq 0x884e(%rip), %rdx      # 0xe437
leaq -0xf0(%rbp), %rdi
callq 0x713a
leaq -0x110(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
callq 0xc0d6
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5c21
callq 0x5230
movq 0x8(%r14), %rdx
leaq 0x73ef(%rip), %rsi      # 0xd01b
leaq -0xd0(%rbp), %rdi
callq 0x67fb
leaq 0x73ef(%rip), %rsi      # 0xd02e
leaq -0xd0(%rbp), %rdi
callq 0x5450
leaq -0x80(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5c72
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x5c79
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x90(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
callq 0x50b0
leaq -0x60(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5ccf
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x5cd7
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x70(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x7343(%rip), %rsi      # 0xd03c
callq 0x5450
leaq -0x40(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5d22
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x5d2a
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x50(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0xac5c
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x5d5b
callq 0x5230
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x5d69
callq 0x5230
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x5d7a
callq 0x5230
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5d8f
callq 0x5230
callq 0x5090
cmpl $-0x1, %eax
je 0x5db2
testl %eax, %eax
je 0x606d
movq %rbx, %rsi
movl %eax, %edx
callq 0x64fe
movl %eax, %ebx
jmp 0x6044
callq 0x5060
movq %rax, %r14
movl (%rax), %edi
callq 0x50d0
leaq -0xd0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq %rax, %rsi
callq 0x50f0
leaq 0x7263(%rip), %rcx      # 0xd03e
leaq -0xd0(%rbp), %rdi
movl $0x35, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
movq %r15, -0x90(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5e17
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x5e1e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x90(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x7231(%rip), %rsi      # 0xd074
callq 0x5450
movq %r12, -0x70(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5e6b
movq %r12, %r13
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x5e76
movups (%rcx), %xmm0
movq %r12, %r13
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x68(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl (%r14), %r14d
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x5ef0
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x5ee7
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x5eed
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x5ef0
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x5eb4
addl $-0x3, %r12d
jmp 0x5ef0
addl $-0x2, %r12d
jmp 0x5ef0
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0xb0(%rbp), %rdi
movl $0x2d, %edx
callq 0x52b0
addq -0xb0(%rbp), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x6a15
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0xa8(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x5f4a
movq -0x60(%rbp), %rsi
cmpq %rsi, %rax
leaq -0x80(%rbp), %r14
leaq -0xa0(%rbp), %r15
jbe 0x5f74
movl $0xf, %esi
cmpq %r15, -0xb0(%rbp)
je 0x5f6f
movq -0xa0(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x5f86
movq -0xb0(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x50b0
jmp 0x5f96
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq -0x40(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x5fb7
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x5fbd
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0xa434
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5ff7
callq 0x5230
movq -0xb0(%rbp), %rdi
cmpq %r15, %rdi
je 0x6008
callq 0x5230
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x6016
callq 0x5230
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
leaq -0xc0(%rbp), %rbx
je 0x602e
callq 0x5230
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x603f
callq 0x5230
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6059
callq 0x5230
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x617c
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x6092
callq 0x5230
jmp 0x6092
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x60af
callq 0x5230
jmp 0x60af
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x60c2
callq 0x5230
jmp 0x60c2
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x60dc
callq 0x5230
jmp 0x60dc
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
jmp 0x613a
jmp 0x6146
jmp 0x6146
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x6106
callq 0x5230
jmp 0x6106
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x6119
callq 0x5230
jmp 0x6119
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x612f
callq 0x5230
jmp 0x612f
movq %rax, %rbx
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6149
callq 0x5230
jmp 0x6149
movq %rax, %rbx
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x615e
callq 0x5230
movq %rbx, %rdi
callq 0x5400
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
jne 0x6159
jmp 0x615e
movq %rax, %rbx
jmp 0x615e