// File: /workspace/github_c_makefile_star2_O0/mabdi[P]bunney/bunny-exec.c
// Function: report_kids
static _u8 report_kids(void) {
  static _u32 st;
  _s32 i;

  if (wait_res >= 0) {
    wait_res = waitpid(orig_pid,&st,WNOHANG);
    /* Process still running or just done? */
    if (wait_res >= 0) return 0;
  }

  /* Process gone at least a round ago... */

  i = get_procentry(orig_pid,0);

  if (!total_calls) exitflags |= EXITF_NOCALLS;

  /* Detect termination on fault-related signals */
  if (WIFSIGNALED(st)) {
    _u32 sig = WTERMSIG(st);
#ifdef EXTRA_SIGNALS
    if (sig == SIGSEGV || sig == SIGILL  || sig == SIGBUS  || sig == SIGFPE ||
        sig == SIGABRT || sig == SIGTRAP || sig == SIGXCPU || sig == SIGXFSZ)
#else
    if (sig == SIGSEGV || sig == SIGILL  || sig == SIGBUS  || sig == SIGFPE)
#endif /* ^EXTRA_SIGNALS */
      exitflags |= EXITF_CRASH;

    if (i >= 0) {
      register_spot(orig_pid, WTERMSIG(st));
      fault_loc = procs[i].funclist.v[procs[i].funclist.c-1];
    }
      
  } else {
    if (i >= 0) register_spot(orig_pid, WEXITSTATUS(st));
  }

  if (!fault_loc && shmreg->child_crash) {
    _s32 x = get_procentry(shmreg->child_crash,0);
    if (x >= 0) fault_loc = procs[x].funclist.v[procs[x].funclist.c-1];
    exitflags |= EXITF_CRASH;
  }

  /* Kill all registered child processes */
  for (i=0;i<proc_cnt;i++) 
    if (procs[i].pid) kill(procs[i].pid,SIGKILL);

  return 1;
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x35fd(%rip)      # 0x61ac
jl 0x2be2
movl 0x35dd(%rip), %edi      # 0x6194
leaq 0x35ea(%rip), %rsi      # 0x61a8
movl $0x1, %edx
callq 0x10a0
movl %eax, 0x35de(%rip)      # 0x61ac
cmpl $0x0, 0x35d7(%rip)      # 0x61ac
jl 0x2be0
movb $0x0, -0x1(%rbp)
jmp 0x2dc0
jmp 0x2be2
movl 0x35ac(%rip), %edi      # 0x6194
xorl %esi, %esi
callq 0x2e10
movl %eax, -0x8(%rbp)
cmpl $0x0, 0x35b7(%rip)      # 0x61b0
jne 0x2c0b
movzbl 0x3590(%rip), %eax      # 0x6192
orl $0x8, %eax
movb %al, 0x3587(%rip)       # 0x6192
movl 0x3597(%rip), %eax      # 0x61a8
andl $0x7f, %eax
addl $0x1, %eax
movsbl %al, %eax
sarl %eax
cmpl $0x0, %eax
jle 0x2cc8
movl 0x357d(%rip), %eax      # 0x61a8
andl $0x7f, %eax
movl %eax, -0xc(%rbp)
cmpl $0xb, -0xc(%rbp)
je 0x2c61
cmpl $0x4, -0xc(%rbp)
je 0x2c61
cmpl $0x7, -0xc(%rbp)
je 0x2c61
cmpl $0x8, -0xc(%rbp)
je 0x2c61
cmpl $0x6, -0xc(%rbp)
je 0x2c61
cmpl $0x5, -0xc(%rbp)
je 0x2c61
cmpl $0x18, -0xc(%rbp)
je 0x2c61
cmpl $0x19, -0xc(%rbp)
jne 0x2c71
movzbl 0x352a(%rip), %eax      # 0x6192
orl $0x2, %eax
movb %al, 0x3521(%rip)       # 0x6192
cmpl $0x0, -0x8(%rbp)
jl 0x2cc6
movl 0x3517(%rip), %edi      # 0x6194
movl 0x3525(%rip), %esi      # 0x61a8
andl $0x7f, %esi
callq 0x2670
movq 0x350e(%rip), %rax      # 0x61a0
movslq -0x8(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq 0x34f8(%rip), %rcx      # 0x61a0
movslq -0x8(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x34f2(%rip)      # 0x61b8
jmp 0x2cea
cmpl $0x0, -0x8(%rbp)
jl 0x2ce8
movl 0x34c0(%rip), %edi      # 0x6194
movl 0x34ce(%rip), %esi      # 0x61a8
andl $0xff00, %esi           # imm = 0xFF00
shrl $0x8, %esi
callq 0x2670
jmp 0x2cea
cmpq $0x0, 0x34c6(%rip)      # 0x61b8
jne 0x2d68
movq 0x348d(%rip), %rax      # 0x6188
movl 0x10(%rax), %eax
cmpl $0x0, %eax
je 0x2d68
movq 0x347e(%rip), %rax      # 0x6188
movl 0x10(%rax), %edi
xorl %esi, %esi
callq 0x2e10
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jl 0x2d58
movq 0x347c(%rip), %rax      # 0x61a0
movslq -0x10(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq 0x3466(%rip), %rcx      # 0x61a0
movslq -0x10(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x3460(%rip)      # 0x61b8
movzbl 0x3433(%rip), %eax      # 0x6192
orl $0x2, %eax
movb %al, 0x342a(%rip)       # 0x6192
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x3420(%rip), %eax      # 0x6198
jae 0x2dbc
movq 0x341f(%rip), %rax      # 0x61a0
movslq -0x8(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
je 0x2daf
movq 0x3408(%rip), %rax      # 0x61a0
movslq -0x8(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %edi
movl $0x9, %esi
callq 0x11a0
jmp 0x2db1
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2d6f
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)