// File: /workspace/github_c_makefile_star2_O0/mabdi[P]bunney/bunny-gcc.c
// Function: wait_execvp
static void wait_execvp(_u8* path, _u8** argv) {
  _s32 pid, st;
  
  if (getenv("BUNNY_EXEC")) {    
    _u32 i = 0;
    debug(">> EXEC");
    while (argv[i]) debug(" %s",argv[i++]);
    debug("\n");
  }
  
  pid = fork();
  if (pid < 0) fatal("unable to spawn a process");
  
  if (!pid) {
    argv[0] = path;
    execvp(path,(char**)argv);
    pfatal("unable to invoke gcc (set $BUNNY_GCC)");
  } else {

    if (waitpid(pid,&st,0) != pid) pfatal("waitpid() fails?");
    
    if (WIFSIGNALED(st)) fatal("gcc died on signal %u",WTERMSIG(st));
    else if (WEXITSTATUS(st))
      fatal("gcc error (exit code %u)",WEXITSTATUS(st));
  }
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x1960(%rip), %rdi      # 0x73b7
callq 0x11a0
cmpq $0x0, %rax
je 0x5ad6
movl $0x0, -0x1c(%rbp)
movq 0x5570(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x1948(%rip), %rsi      # 0x73c2
movb $0x0, %al
callq 0x11c0
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x5abe
movq 0x554a(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
leaq 0x1a4b(%rip), %rsi      # 0x7500
movb $0x0, %al
callq 0x11c0
jmp 0x5a81
movq 0x551b(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x1adb(%rip), %rsi      # 0x75aa
movb $0x0, %al
callq 0x11c0
callq 0x1050
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x5b34
jmp 0x5ae6
movq 0x54f3(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x18d3(%rip), %rsi      # 0x73ca
movb $0x0, %al
callq 0x11c0
movq 0x54db(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x16ce(%rip), %rsi      # 0x71dd
leaq 0x18e5(%rip), %rdx      # 0x73fb
leaq 0x16dd(%rip), %rcx      # 0x71fa
movl $0xff, %r8d
movb $0x0, %al
callq 0x11c0
movl $0x1, %edi
callq 0x1190
cmpl $0x0, -0x14(%rbp)
jne 0x5bac
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10f0
movq 0x5487(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x18a4(%rip), %rsi      # 0x7407
movb $0x0, %al
callq 0x11c0
movq 0x546f(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x1662(%rip), %rsi      # 0x71dd
leaq 0x1879(%rip), %rdx      # 0x73fb
leaq 0x1671(%rip), %rcx      # 0x71fa
movl $0x104, %r8d            # imm = 0x104
movb $0x0, %al
callq 0x11c0
leaq 0x18a6(%rip), %rdi      # 0x7443
callq 0x1110
movl $0x1, %edi
callq 0x1190
movl -0x14(%rbp), %edi
leaq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x1100
cmpl -0x14(%rbp), %eax
je 0x5c1b
jmp 0x5bc1
movq 0x5418(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x1881(%rip), %rsi      # 0x7453
movb $0x0, %al
callq 0x11c0
movq 0x5400(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x15f3(%rip), %rsi      # 0x71dd
leaq 0x180a(%rip), %rdx      # 0x73fb
leaq 0x1602(%rip), %rcx      # 0x71fa
movl $0x107, %r8d            # imm = 0x107
movb $0x0, %al
callq 0x11c0
leaq 0x1837(%rip), %rdi      # 0x7443
callq 0x1110
movl $0x1, %edi
callq 0x1190
movl -0x18(%rbp), %eax
andl $0x7f, %eax
addl $0x1, %eax
movsbl %al, %eax
sarl %eax
cmpl $0x0, %eax
jle 0x5c84
jmp 0x5c30
movq 0x53a9(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movl -0x18(%rbp), %edx
andl $0x7f, %edx
leaq 0x1833(%rip), %rsi      # 0x747a
movb $0x0, %al
callq 0x11c0
movq 0x538b(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x157e(%rip), %rsi      # 0x71dd
leaq 0x1795(%rip), %rdx      # 0x73fb
leaq 0x158d(%rip), %rcx      # 0x71fa
movl $0x109, %r8d            # imm = 0x109
movb $0x0, %al
callq 0x11c0
movl $0x1, %edi
callq 0x1190
movl -0x18(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
cmpl $0x0, %eax
je 0x5cf0
jmp 0x5c96
movq 0x5343(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movl -0x18(%rbp), %edx
andl $0xff00, %edx           # imm = 0xFF00
sarl $0x8, %edx
leaq 0x17f4(%rip), %rsi      # 0x74a7
movb $0x0, %al
callq 0x11c0
movq 0x531f(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x1512(%rip), %rsi      # 0x71dd
leaq 0x1729(%rip), %rdx      # 0x73fb
leaq 0x1521(%rip), %rcx      # 0x71fa
movl $0x10b, %r8d            # imm = 0x10B
movb $0x0, %al
callq 0x11c0
movl $0x1, %edi
callq 0x1190
jmp 0x5cf2
jmp 0x5cf4
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)