// File: /workspace/github_cpp_makefile_star2_O3/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 0x8823(%rip), %rsi      # 0xe435
leaq 0x881e(%rip), %rdx      # 0xe437
leaq -0xf0(%rbp), %rdi
callq 0x7140
leaq -0x110(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
callq 0xbffa
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5c51
callq 0x5230
movq 0x8(%r14), %rdx
leaq 0x73bf(%rip), %rsi      # 0xd01b
leaq -0xd0(%rbp), %rdi
callq 0x6827
leaq 0x73bf(%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 0x5ca2
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x5ca9
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 0x5cff
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x5d07
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 0x7313(%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 0x5d52
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x5d5a
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 0xab96
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x5d8b
callq 0x5230
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x5d99
callq 0x5230
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x5daa
callq 0x5230
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5dbf
callq 0x5230
callq 0x5090
cmpl $-0x1, %eax
je 0x5de2
testl %eax, %eax
je 0x6099
movq %rbx, %rsi
movl %eax, %edx
callq 0x652a
movl %eax, %ebx
jmp 0x6070
callq 0x5060
movq %rax, %r14
movl (%rax), %edi
callq 0x50d0
leaq -0xd0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq %rax, %rsi
callq 0x50f0
leaq 0x7233(%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 0x5e47
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x5e4e
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 0x7201(%rip), %rsi      # 0xd074
callq 0x5450
movq %r12, -0x70(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5e9b
movq %r12, %r13
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x5ea6
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 0x5f20
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x5f17
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x5f1d
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x5f20
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x5ee4
addl $-0x3, %r12d
jmp 0x5f20
addl $-0x2, %r12d
jmp 0x5f20
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 0x6a3d
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0xa8(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x5f7a
movq -0x60(%rbp), %rdi
movq -0xb0(%rbp), %rsi
cmpq %rdi, %rax
leaq -0x80(%rbp), %r14
leaq -0xa0(%rbp), %r15
jbe 0x5fa7
movl $0xf, %edi
cmpq %r15, %rsi
je 0x5fa2
movq -0xa0(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x5fb2
leaq -0x70(%rbp), %rdi
callq 0x50b0
jmp 0x5fc2
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 0x5fe3
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x5fe9
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 0xa372
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x6023
callq 0x5230
movq -0xb0(%rbp), %rdi
cmpq %r15, %rdi
je 0x6034
callq 0x5230
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x6042
callq 0x5230
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
leaq -0xc0(%rbp), %rbx
je 0x605a
callq 0x5230
movq -0xd0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x606b
callq 0x5230
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6085
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 0x61a8
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x60be
callq 0x5230
jmp 0x60be
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x60db
callq 0x5230
jmp 0x60db
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x60ee
callq 0x5230
jmp 0x60ee
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x6108
callq 0x5230
jmp 0x6108
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
jmp 0x6166
jmp 0x6172
jmp 0x6172
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x6132
callq 0x5230
jmp 0x6132
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x6145
callq 0x5230
jmp 0x6145
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x615b
callq 0x5230
jmp 0x615b
movq %rax, %rbx
leaq -0xc0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6175
callq 0x5230
jmp 0x6175
movq %rax, %rbx
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x618a
callq 0x5230
movq %rbx, %rdi
callq 0x5400
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
jne 0x6185
jmp 0x618a
movq %rax, %rbx
jmp 0x618a