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

  static _s32 pid;
  static _u32 st;

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

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

  rno = get_procentry(orig_pid,0);

  if (rno < 0) {

    if (WIFEXITED(st))     
      outf("--- Untraced process %u exited (code=%u) ---\n",orig_pid,WEXITSTATUS(st));
    else 
      outf("--- Untraced process %u killed (signal %u) ---\n",orig_pid,WTERMSIG(st));

  } else {

    if (WIFEXITED(st)) 
      outf("--- Process %u exited (code=%u) ---\n",orig_pid,WEXITSTATUS(st));
    else 
      outf("--- Process %u killed (signal %u) ---\n",orig_pid,WTERMSIG(st));

  }

  if (shmreg->child_crash)
    outf("--- (Child process %u crashed) ---\n",shmreg->child_crash);

  for (i=0;i<proc_cnt;i++) kill(procs[i].pid,SIGKILL);
    
  return 1;
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x2b89(%rip)      # 0x5148
jl 0x25f2
movl 0x2b71(%rip), %edi      # 0x5138
leaq 0x2b7e(%rip), %rsi      # 0x514c
movl $0x1, %edx
callq 0x1090
movl %eax, 0x2b6a(%rip)      # 0x5148
cmpl $0x0, 0x2b63(%rip)      # 0x5148
jl 0x25f0
movb $0x0, -0x1(%rbp)
jmp 0x2734
jmp 0x25f2
movl 0x2b40(%rip), %edi      # 0x5138
xorl %esi, %esi
callq 0x2780
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jge 0x2668
movl 0x2b3e(%rip), %eax      # 0x514c
andl $0x7f, %eax
cmpl $0x0, %eax
jne 0x2642
movq 0x2b03(%rip), %rdi      # 0x5120
movl 0x2b15(%rip), %edx      # 0x5138
movl 0x2b23(%rip), %ecx      # 0x514c
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
leaq 0xd5c(%rip), %rsi       # 0x3395
movb $0x0, %al
callq 0x1170
jmp 0x2666
movq 0x2ad7(%rip), %rdi      # 0x5120
movl 0x2ae9(%rip), %edx      # 0x5138
movl 0x2af7(%rip), %ecx      # 0x514c
andl $0x7f, %ecx
leaq 0xd64(%rip), %rsi       # 0x33c3
movb $0x0, %al
callq 0x1170
jmp 0x26c8
movl 0x2ade(%rip), %eax      # 0x514c
andl $0x7f, %eax
cmpl $0x0, %eax
jne 0x26a2
movq 0x2aa3(%rip), %rdi      # 0x5120
movl 0x2ab5(%rip), %edx      # 0x5138
movl 0x2ac3(%rip), %ecx      # 0x514c
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
leaq 0xd5a(%rip), %rsi       # 0x33f3
movb $0x0, %al
callq 0x1170
jmp 0x26c6
movq 0x2a77(%rip), %rdi      # 0x5120
movl 0x2a89(%rip), %edx      # 0x5138
movl 0x2a97(%rip), %ecx      # 0x514c
andl $0x7f, %ecx
leaq 0xd59(%rip), %rsi       # 0x3418
movb $0x0, %al
callq 0x1170
jmp 0x26c8
movq 0x2a61(%rip), %rax      # 0x5130
movl 0x10(%rax), %eax
cmpl $0x0, %eax
je 0x26f6
movq 0x2a42(%rip), %rdi      # 0x5120
movq 0x2a4b(%rip), %rax      # 0x5130
movl 0x10(%rax), %edx
leaq 0xd50(%rip), %rsi       # 0x343f
movb $0x0, %al
callq 0x1170
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x2a36(%rip), %eax      # 0x513c
jae 0x2730
movq 0x2a31(%rip), %rax      # 0x5140
movl -0xc(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edi
movl $0x9, %esi
callq 0x1160
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x26fd
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)