// File: /workspace/github_c_makefile_star2_O0/mabdi[P]bunney/bunny-main.c
// Function: launch_exec
static void launch_exec(_u8* infn) {
  _s32 exec_pipe[2];
  _s32 infd = 0;

  if (infn) {
    infd = open(infn,O_RDONLY|O_LARGEFILE);
    if (infd < 0) pfatal("unable to open %s for reading",infn);
  }

  if (pipe(exec_pipe)) pfatal("unable to create pipe");

  exec_pid = fork();
  if (exec_pid < 0) pfatal("unable to create a child process");
  
  if (!exec_pid) {
    _u8  tmp[64];
    _u8* logfile = N(out_dir,"bunny-exec.out");
    _u32 fd;

    unlink(logfile);
    fd = open(logfile,O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE,0600);

    if (fd >= 0) { 
      dup2(fd, 2); 
#ifdef DEBUG_TRACE
      dup2(fd, 1);
#else
      close(fd);
      fd = open("/dev/null",O_WRONLY);
      if (fd >= 0) dup2(fd,1);
#endif /* ^DEBUG_TRACE */
      close(fd); 
    }
    
    if (dup2(exec_pipe[1],99) < 0) pfatal("dup2() failed");
    close(exec_pipe[0]);
    close(exec_pipe[1]);
    
    if (infn) {
      if (dup2(infd,0) < 0) pfatal("dup2() failed");
      close(infd);
    } else {
      close(0);
      fd = open("/dev/null",O_RDONLY);
      if (fd) fatal("unable to open /dev/null as fd 0");
    }

    sprintf(tmp,"%u",time_limit);
    setenv("BUNNY_MAXTIME",tmp,1);

    sprintf(tmp,"%u",stall_limit);
    setenv("BUNNY_MAXSTUCK",tmp,1);

    sprintf(tmp,"%u",func_limit);
    setenv("BUNNY_MAXFUNC",tmp,1);

    setenv("BUNNY_KEEPALIVE","yes",1);

#ifdef USE_EXEC_CWD
    if (access("bunny-exec",X_OK))
#endif /* USE_EXEC_CWD */
      execvp("bunny-exec",(char**)program_args);
#ifdef USE_EXEC_CWD
      else execv("./bunny-exec",(char**)program_args);
#endif /* USE_EXEC_CWD */

    pfatal("cannot execute bunny-exec"); 
    
  }
  
  close(exec_pipe[1]);
  if (infn) close(infd);

  exec_pipe_ret = exec_pipe[0];
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xb853
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x2150
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xb851
jmp 0xb7aa
jmp 0xb7ac
movq -0x8(%rbp), %rsi
leaq 0x46d2(%rip), %rdi      # 0xfe89
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6b12(%rip)      # 0x122d8
je 0xb7e1
movq 0x6b09(%rip), %rdi      # 0x122d8
movq -0x8(%rbp), %rdx
leaq 0x46af(%rip), %rsi      # 0xfe89
movb $0x0, %al
callq 0x22d0
jmp 0xb7e3
jmp 0xb7e5
leaq 0x29c5(%rip), %rdi      # 0xe1b1
leaq 0x46ca(%rip), %rsi      # 0xfebd
leaq 0x29c7(%rip), %rdx      # 0xe1c1
movl $0x246, %ecx            # imm = 0x246
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6aca(%rip)      # 0x122d8
je 0xb839
movq 0x6ac1(%rip), %rdi      # 0x122d8
leaq 0x2993(%rip), %rsi      # 0xe1b1
leaq 0x4698(%rip), %rdx      # 0xfebd
leaq 0x2995(%rip), %rcx      # 0xe1c1
movl $0x246, %r8d            # imm = 0x246
movb $0x0, %al
callq 0x22d0
jmp 0xb83b
leaq 0x376e(%rip), %rdi      # 0xefb0
callq 0x2190
movl $0x1, %edi
callq 0x2250
jmp 0xb853
leaq -0x10(%rbp), %rdi
callq 0x2290
cmpl $0x0, %eax
je 0xb906
jmp 0xb867
jmp 0xb869
leaq 0x4659(%rip), %rdi      # 0xfec9
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6a59(%rip)      # 0x122d8
je 0xb896
movq 0x6a50(%rip), %rdi      # 0x122d8
leaq 0x463a(%rip), %rsi      # 0xfec9
movb $0x0, %al
callq 0x22d0
jmp 0xb898
jmp 0xb89a
leaq 0x2910(%rip), %rdi      # 0xe1b1
leaq 0x4615(%rip), %rsi      # 0xfebd
leaq 0x2912(%rip), %rdx      # 0xe1c1
movl $0x249, %ecx            # imm = 0x249
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6a15(%rip)      # 0x122d8
je 0xb8ee
movq 0x6a0c(%rip), %rdi      # 0x122d8
leaq 0x28de(%rip), %rsi      # 0xe1b1
leaq 0x45e3(%rip), %rdx      # 0xfebd
leaq 0x28e0(%rip), %rcx      # 0xe1c1
movl $0x249, %r8d            # imm = 0x249
movb $0x0, %al
callq 0x22d0
jmp 0xb8f0
leaq 0x36b9(%rip), %rdi      # 0xefb0
callq 0x2190
movl $0x1, %edi
callq 0x2250
callq 0x2090
movl %eax, 0x6923(%rip)      # 0x12234
cmpl $0x0, 0x691c(%rip)      # 0x12234
jge 0xb9bf
jmp 0xb920
jmp 0xb922
leaq 0x390a(%rip), %rdi      # 0xf233
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x69a0(%rip)      # 0x122d8
je 0xb94f
movq 0x6997(%rip), %rdi      # 0x122d8
leaq 0x38eb(%rip), %rsi      # 0xf233
movb $0x0, %al
callq 0x22d0
jmp 0xb951
jmp 0xb953
leaq 0x2857(%rip), %rdi      # 0xe1b1
leaq 0x455c(%rip), %rsi      # 0xfebd
leaq 0x2859(%rip), %rdx      # 0xe1c1
movl $0x24c, %ecx            # imm = 0x24C
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x695c(%rip)      # 0x122d8
je 0xb9a7
movq 0x6953(%rip), %rdi      # 0x122d8
leaq 0x2825(%rip), %rsi      # 0xe1b1
leaq 0x452a(%rip), %rdx      # 0xfebd
leaq 0x2827(%rip), %rcx      # 0xe1c1
movl $0x24c, %r8d            # imm = 0x24C
movb $0x0, %al
callq 0x22d0
jmp 0xb9a9
leaq 0x3600(%rip), %rdi      # 0xefb0
callq 0x2190
movl $0x1, %edi
callq 0x2250
cmpl $0x0, 0x686e(%rip)      # 0x12234
jne 0xbe1c
movq 0x690d(%rip), %rdi      # 0x122e0
leaq 0x451b(%rip), %rsi      # 0xfef5
callq 0x7010
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x2110
movq -0x68(%rbp), %rdi
movl $0xc1, %esi
movl $0x180, %edx            # imm = 0x180
movb $0x0, %al
callq 0x2150
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jb 0xba50
movl -0x6c(%rbp), %edi
movl $0x2, %esi
callq 0x21d0
movl -0x6c(%rbp), %edi
callq 0x23a0
leaq 0x44de(%rip), %rdi      # 0xff04
movl $0x1, %esi
movb $0x0, %al
callq 0x2150
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jb 0xba48
movl -0x6c(%rbp), %edi
movl $0x1, %esi
callq 0x21d0
movl -0x6c(%rbp), %edi
callq 0x23a0
movl -0xc(%rbp), %edi
movl $0x63, %esi
callq 0x21d0
cmpl $0x0, %eax
jge 0xbb07
jmp 0xba68
jmp 0xba6a
leaq 0x3808(%rip), %rdi      # 0xf279
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6858(%rip)      # 0x122d8
je 0xba97
movq 0x684f(%rip), %rdi      # 0x122d8
leaq 0x37e9(%rip), %rsi      # 0xf279
movb $0x0, %al
callq 0x22d0
jmp 0xba99
jmp 0xba9b
leaq 0x270f(%rip), %rdi      # 0xe1b1
leaq 0x4414(%rip), %rsi      # 0xfebd
leaq 0x2711(%rip), %rdx      # 0xe1c1
movl $0x262, %ecx            # imm = 0x262
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6814(%rip)      # 0x122d8
je 0xbaef
movq 0x680b(%rip), %rdi      # 0x122d8
leaq 0x26dd(%rip), %rsi      # 0xe1b1
leaq 0x43e2(%rip), %rdx      # 0xfebd
leaq 0x26df(%rip), %rcx      # 0xe1c1
movl $0x262, %r8d            # imm = 0x262
movb $0x0, %al
callq 0x22d0
jmp 0xbaf1
leaq 0x34b8(%rip), %rdi      # 0xefb0
callq 0x2190
movl $0x1, %edi
callq 0x2250
movl -0x10(%rbp), %edi
callq 0x23a0
movl -0xc(%rbp), %edi
callq 0x23a0
cmpq $0x0, -0x8(%rbp)
je 0xbbe3
movl -0x14(%rbp), %edi
xorl %esi, %esi
callq 0x21d0
cmpl $0x0, %eax
jge 0xbbd6
jmp 0xbb37
jmp 0xbb39
leaq 0x3739(%rip), %rdi      # 0xf279
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6789(%rip)      # 0x122d8
je 0xbb66
movq 0x6780(%rip), %rdi      # 0x122d8
leaq 0x371a(%rip), %rsi      # 0xf279
movb $0x0, %al
callq 0x22d0
jmp 0xbb68
jmp 0xbb6a
leaq 0x2640(%rip), %rdi      # 0xe1b1
leaq 0x4345(%rip), %rsi      # 0xfebd
leaq 0x2642(%rip), %rdx      # 0xe1c1
movl $0x267, %ecx            # imm = 0x267
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6745(%rip)      # 0x122d8
je 0xbbbe
movq 0x673c(%rip), %rdi      # 0x122d8
leaq 0x260e(%rip), %rsi      # 0xe1b1
leaq 0x4313(%rip), %rdx      # 0xfebd
leaq 0x2610(%rip), %rcx      # 0xe1c1
movl $0x267, %r8d            # imm = 0x267
movb $0x0, %al
callq 0x22d0
jmp 0xbbc0
leaq 0x33e9(%rip), %rdi      # 0xefb0
callq 0x2190
movl $0x1, %edi
callq 0x2250
movl -0x14(%rbp), %edi
callq 0x23a0
jmp 0xbc9e
xorl %edi, %edi
callq 0x23a0
leaq 0x4313(%rip), %rdi      # 0xff04
xorl %esi, %esi
movb $0x0, %al
callq 0x2150
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0xbc9c
jmp 0xbc09
jmp 0xbc0b
leaq 0x42fc(%rip), %rdi      # 0xff0e
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x66b7(%rip)      # 0x122d8
je 0xbc38
movq 0x66ae(%rip), %rdi      # 0x122d8
leaq 0x42dd(%rip), %rsi      # 0xff0e
movb $0x0, %al
callq 0x22d0
jmp 0xbc3a
jmp 0xbc3c
leaq 0x256e(%rip), %rdi      # 0xe1b1
leaq 0x4273(%rip), %rsi      # 0xfebd
leaq 0x2570(%rip), %rdx      # 0xe1c1
movl $0x26c, %ecx            # imm = 0x26C
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6673(%rip)      # 0x122d8
je 0xbc90
movq 0x666a(%rip), %rdi      # 0x122d8
leaq 0x253c(%rip), %rsi      # 0xe1b1
leaq 0x4241(%rip), %rdx      # 0xfebd
leaq 0x253e(%rip), %rcx      # 0xe1c1
movl $0x26c, %r8d            # imm = 0x26C
movb $0x0, %al
callq 0x22d0
jmp 0xbc92
movl $0x1, %edi
callq 0x2250
jmp 0xbc9e
leaq -0x60(%rbp), %rdi
movl 0x654c(%rip), %edx      # 0x121f4
leaq 0x2742(%rip), %rsi      # 0xe3f1
movb $0x0, %al
callq 0x2060
leaq -0x60(%rbp), %rsi
leaq 0x4285(%rip), %rdi      # 0xff46
movl $0x1, %edx
callq 0x2310
leaq -0x60(%rbp), %rdi
movl 0x651b(%rip), %edx      # 0x121f0
leaq 0x2715(%rip), %rsi      # 0xe3f1
movb $0x0, %al
callq 0x2060
leaq -0x60(%rbp), %rsi
leaq 0x4266(%rip), %rdi      # 0xff54
movl $0x1, %edx
callq 0x2310
leaq -0x60(%rbp), %rdi
movl 0x650e(%rip), %edx      # 0x12210
leaq 0x26e8(%rip), %rsi      # 0xe3f1
movb $0x0, %al
callq 0x2060
leaq -0x60(%rbp), %rsi
leaq 0x4248(%rip), %rdi      # 0xff63
movl $0x1, %edx
callq 0x2310
leaq 0x4245(%rip), %rdi      # 0xff71
leaq 0x424e(%rip), %rsi      # 0xff81
movl $0x1, %edx
callq 0x2310
leaq 0x4273(%rip), %rdi      # 0xffb7
movl $0x1, %esi
callq 0x2370
cmpl $0x0, %eax
je 0xbd68
movq 0x65e6(%rip), %rsi      # 0x12340
leaq 0x4256(%rip), %rdi      # 0xffb7
callq 0x2170
jmp 0xbd7b
movq 0x65d1(%rip), %rsi      # 0x12340
leaq 0x420f(%rip), %rdi      # 0xff85
callq 0x21b0
jmp 0xbd7d
jmp 0xbd7f
leaq 0x420c(%rip), %rdi      # 0xff92
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x6543(%rip)      # 0x122d8
je 0xbdac
movq 0x653a(%rip), %rdi      # 0x122d8
leaq 0x41ed(%rip), %rsi      # 0xff92
movb $0x0, %al
callq 0x22d0
jmp 0xbdae
jmp 0xbdb0
leaq 0x23fa(%rip), %rdi      # 0xe1b1
leaq 0x40ff(%rip), %rsi      # 0xfebd
leaq 0x23fc(%rip), %rdx      # 0xe1c1
movl $0x282, %ecx            # imm = 0x282
movb $0x0, %al
callq 0x2030
cmpq $0x0, 0x64ff(%rip)      # 0x122d8
je 0xbe04
movq 0x64f6(%rip), %rdi      # 0x122d8
leaq 0x23c8(%rip), %rsi      # 0xe1b1
leaq 0x40cd(%rip), %rdx      # 0xfebd
leaq 0x23ca(%rip), %rcx      # 0xe1c1
movl $0x282, %r8d            # imm = 0x282
movb $0x0, %al
callq 0x22d0
jmp 0xbe06
leaq 0x31a3(%rip), %rdi      # 0xefb0
callq 0x2190
movl $0x1, %edi
callq 0x2250
movl -0xc(%rbp), %edi
callq 0x23a0
cmpq $0x0, -0x8(%rbp)
je 0xbe33
movl -0x14(%rbp), %edi
callq 0x23a0
movl -0x10(%rbp), %eax
movl %eax, 0x6478(%rip)      # 0x122b4
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)