// File: /workspace/github_c_makefile_star2_O1/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, 0x2a51(%rip)      # 0x51b4
js 0x278d
movl 0x2a31(%rip), %edi      # 0x519c
leaq 0x2a3e(%rip), %rsi      # 0x51b0
movl $0x1, %edx
callq 0x10a0
movl %eax, 0x2a32(%rip)      # 0x51b4
testl %eax, %eax
js 0x278d
xorl %ebx, %ebx
jmp 0x28f4
movl 0x2a09(%rip), %edi      # 0x519c
movl 0x2a07(%rip), %eax      # 0x51a0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x27c0
movq 0x29fe(%rip), %rdx      # 0x51a8
xorl %ecx, %ecx
cmpl %edi, (%rdx)
je 0x27be
incq %rcx
addq $0x40, %rdx
cmpq %rcx, %rax
jne 0x27ac
jmp 0x27c0
movl %ecx, %ebx
cmpl $0x0, 0x29f1(%rip)      # 0x51b8
jne 0x27d0
orb $0x8, 0x29ca(%rip)      # 0x519a
movl 0x29da(%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 0x2837
andl $0x7e, %eax
cmpl $0x18, %eax
je 0x2802
leal -0x4(%rsi), %eax
cmpl $0x5, %eax
jae 0x28fc
orb $0x2, 0x2991(%rip)      # 0x519a
testl %ebx, %ebx
js 0x2843
callq 0x26f0
movq 0x298f(%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, 0x298b(%rip)      # 0x51c0
jmp 0x2843
testl %ebx, %ebx
js 0x2843
movzbl %ah, %esi
callq 0x26f0
cmpq $0x0, 0x2975(%rip)      # 0x51c0
jne 0x28b8
movq 0x293c(%rip), %rax      # 0x5190
cmpl $0x0, 0x10(%rax)
je 0x28b8
movl 0x10(%rax), %ecx
movl 0x293d(%rip), %edx      # 0x51a0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rdx, %rdx
je 0x288a
movq 0x2934(%rip), %rdi      # 0x51a8
xorl %esi, %esi
cmpl %ecx, (%rdi)
je 0x2888
incq %rsi
addq $0x40, %rdi
cmpq %rsi, %rdx
jne 0x2876
jmp 0x288a
movl %esi, %eax
testl %eax, %eax
js 0x28b1
movq 0x2913(%rip), %rcx      # 0x51a8
movl %eax, %eax
shlq $0x6, %rax
movq 0x10(%rcx,%rax), %rdx
movl 0x18(%rcx,%rax), %eax
decl %eax
movq (%rdx,%rax,8), %rax
movq %rax, 0x290f(%rip)      # 0x51c0
orb $0x2, 0x28e2(%rip)      # 0x519a
movb $0x1, %bl
cmpl $0x0, 0x28df(%rip)      # 0x51a0
je 0x28f4
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x28d8(%rip), %rax      # 0x51a8
movl (%rax,%r14), %edi
testl %edi, %edi
je 0x28e2
movl $0x9, %esi
callq 0x11a0
incq %r15
movl 0x28b5(%rip), %eax      # 0x51a0
addq $0x40, %r14
cmpq %rax, %r15
jb 0x28c9
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
cmpl $0xb, %esi
je 0x2802
jmp 0x2809