// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x2a2e(%rip)      # 0x51b4
js 0x27b0
movl 0x2a0e(%rip), %edi      # 0x519c
leaq 0x2a1b(%rip), %rsi      # 0x51b0
movl $0x1, %edx
callq 0x10a0
movl %eax, 0x2a0f(%rip)      # 0x51b4
testl %eax, %eax
js 0x27b0
xorl %ebx, %ebx
jmp 0x291d
movl 0x29e6(%rip), %edi      # 0x519c
movl 0x29e4(%rip), %eax      # 0x51a0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x27e3
movq 0x29db(%rip), %rdx      # 0x51a8
xorl %ecx, %ecx
cmpl %edi, (%rdx)
je 0x27e1
incq %rcx
addq $0x40, %rdx
cmpq %rcx, %rax
jne 0x27cf
jmp 0x27e3
movl %ecx, %ebx
cmpl $0x0, 0x29ce(%rip)      # 0x51b8
jne 0x27f3
orb $0x8, 0x29a7(%rip)      # 0x519a
movl 0x29b7(%rip), %eax      # 0x51b0
movl %eax, %esi
andl $0x7f, %esi
movl %esi, %ecx
shll $0x18, %ecx
addl $0x1000000, %ecx        # imm = 0x1000000
cmpl $0x2000000, %ecx        # imm = 0x2000000
jl 0x285a
andl $0x7e, %eax
cmpl $0x18, %eax
je 0x2825
leal -0x4(%rsi), %eax
cmpl $0x5, %eax
jae 0x2925
orb $0x2, 0x296e(%rip)      # 0x519a
testl %ebx, %ebx
js 0x2866
callq 0x2711
movq 0x296c(%rip), %rax      # 0x51a8
movl %ebx, %ecx
shlq $0x6, %rcx
movq 0x10(%rax,%rcx), %rdx
movl 0x18(%rax,%rcx), %eax
decl %eax
movq (%rdx,%rax,8), %rax
movq %rax, 0x2968(%rip)      # 0x51c0
jmp 0x286d
testl %ebx, %ebx
js 0x2866
movzbl %ah, %esi
callq 0x2711
movq 0x2953(%rip), %rax      # 0x51c0
testq %rax, %rax
je 0x287a
movl 0x2928(%rip), %eax      # 0x51a0
jmp 0x28dd
movq 0x290f(%rip), %rcx      # 0x5190
cmpl $0x0, 0x10(%rcx)
movl 0x2915(%rip), %eax      # 0x51a0
je 0x28dd
movl 0x10(%rcx), %esi
testl %eax, %eax
je 0x28d6
movq 0x290d(%rip), %rcx      # 0x51a8
xorl %edx, %edx
movq %rcx, %rdi
cmpl %esi, (%rdi)
je 0x28b2
incq %rdx
addq $0x40, %rdi
cmpq %rdx, %rax
jne 0x28a0
jmp 0x28d6
testl %edx, %edx
js 0x28d6
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
shlq $0x6, %rdx
movq 0x10(%rcx,%rdx), %rsi
movl 0x18(%rcx,%rdx), %ecx
decl %ecx
movq (%rsi,%rcx,8), %rcx
movq %rcx, 0x28ea(%rip)      # 0x51c0
orb $0x2, 0x28bd(%rip)      # 0x519a
movb $0x1, %bl
testl %eax, %eax
je 0x291d
movq 0x28be(%rip), %rcx      # 0x51a8
xorl %r14d, %r14d
xorl %r15d, %r15d
movl (%rcx,%r14), %edi
testl %edi, %edi
je 0x290f
movl $0x9, %esi
callq 0x11a0
movq 0x289f(%rip), %rcx      # 0x51a8
movl 0x2891(%rip), %eax      # 0x51a0
incq %r15
movl %eax, %edx
addq $0x40, %r14
cmpq %rdx, %r15
jb 0x28f0
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
cmpl $0xb, %esi
je 0x2825
jmp 0x282c