// File: /workspace/github_c_makefile_star2_O3/mabdi[P]bunney/bunny-exec.c
// Function: handle_process
static void handle_process(_u8* path, _u8** argv) {

  struct bunny_message m;

  orig_pid = vfork();
  if (orig_pid < 0) fatal("unable to spawn a process");

  if (!orig_pid) {  
    execvp(path,(char**)argv);
    pfatal("unable to execute '%s'",path);
  }

  while (!read_shm(&m,sizeof(m))) {

    switch (m.type) {

      case MESSAGE_ENTER: {
          char fname[MAXTOKEN];
          if (m.data_len > MAXTOKEN - 1) fatal("excessively long function name");
          if (read_shm(fname,m.data_len)) goto handle_bailout;
          fname[m.data_len]=0;
          register_call(m.pid, fname, m.value);
        }
        break;

      case MESSAGE_PARAM:
        register_param(m.pid, m.value);
        break;

      case MESSAGE_LEAVE:
        register_return(m.pid, m.value);
        break;

      case MESSAGE_SPOT:
        register_spot(m.pid, m.value);
        break;


      default: fatal("malformed data from traced process (0x%08x)",m.type);

    }

  }

handle_bailout:

  finalize();
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1068, %rsp           # imm = 0x1068
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1180
movl %eax, 0x3352(%rip)      # 0x519c
testl %eax, %eax
js 0x249e
je 0x24a3
leaq 0xc(%rsp), %rdi
movl $0x10, %esi
callq 0x260e
testb %al, %al
jne 0x21bf
leaq 0x118e(%rip), %rbp      # 0x3004
leaq 0x60(%rsp), %r15
xorl %eax, %eax
movq %rax, 0x20(%rsp)
leaq 0xc(%rsp), %r12
movl $0x10, %r13d
movl 0x10(%rsp), %edi
movl %edi, %eax
addl $0x3ffefff0, %eax       # imm = 0x3FFEFFF0
roll $0x1c, %eax
cmpl $0x3, %eax
ja 0x248f
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movl 0x18(%rsp), %eax
movl %eax, %ebx
cmpq $0x1000, %rbx           # imm = 0x1000
jae 0x2494
movl %ebx, %esi
movq %r15, %rdi
callq 0x260e
testb %al, %al
jne 0x21bf
movb $0x0, 0x60(%rsp,%rbx)
movl 0xc(%rsp), %edi
movl $0x1, %esi
callq 0x2933
movl %eax, %ebx
movq %r15, %rdi
callq 0x1220
testq %rax, %rax
je 0x2499
movq %rax, %r14
movq 0x32a5(%rip), %r15      # 0x51a8
movslq %ebx, %rbx
shlq $0x6, %rbx
leaq (%r15,%rbx), %r12
addq $0x10, %r12
movl 0x8(%r12), %eax
movq (%r12), %rdi
testb $0x7f, %al
jne 0x1f44
addl $0x82, %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x1210
movq %rax, (%r12)
testq %rax, %rax
je 0x24c7
movq %rax, %rdi
movl 0x8(%r12), %eax
movl %eax, %ecx
incl %eax
movl %eax, 0x8(%r12)
movq %r14, (%rdi,%rcx,8)
movq (%r12), %rcx
movq $0x0, (%rcx,%rax,8)
leaq (%r15,%rbx), %r14
addq $0x20, %r14
movl 0x8(%r14), %eax
movq (%r14), %rdi
testb $0x7f, %al
je 0x214a
leaq 0xc(%rsp), %r12
jmp 0x2172
movl 0xc(%rsp), %edi
movl 0x14(%rsp), %ebx
movl $0x1, %esi
callq 0x2933
movq 0x3211(%rip), %r14      # 0x51a8
movl %eax, %eax
movl %eax, %r15d
shlq $0x6, %r15
leaq (%r14,%r15), %r12
addq $0x10, %r12
decl -0x8(%r12)
movl 0x8(%r12), %eax
movq (%r12), %rdi
testb $0x7f, %al
jne 0x1fdf
addl $0x82, %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x1210
movq %rax, (%r12)
testq %rax, %rax
je 0x24bd
movq %rax, %rdi
movl 0x8(%r12), %eax
movl %eax, %ecx
incl %eax
movl %eax, 0x8(%r12)
xorl %edx, %edx
movq %rdx, (%rdi,%rcx,8)
movq (%r12), %rcx
movq %rdx, (%rcx,%rax,8)
leaq (%r14,%r15), %r12
addq $0x20, %r12
movl 0x8(%r12), %eax
movq (%r12), %rdi
testb $0x7f, %al
jne 0x2030
addl $0x81, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1210
movq %rax, (%r12)
testq %rax, %rax
je 0x24b8
movq %rax, %rdi
movl 0x8(%r12), %eax
addq %r15, %r14
addq $0x8, %r14
movl (%r14), %ecx
movl %eax, %edx
incl %eax
movl %eax, 0x8(%r12)
movl %edx, %eax
movl %ecx, (%rdi,%rax,4)
movl 0x30(%r14), %eax
movq 0x28(%r14), %rdi
testb $0x7f, %al
je 0x210d
leaq 0x60(%rsp), %r15
leaq 0xc(%rsp), %r12
jmp 0x213b
movl 0xc(%rsp), %edi
movl 0x14(%rsp), %esi
callq 0x2711
jmp 0x21ac
movl 0xc(%rsp), %edi
movl 0x311d(%rip), %eax      # 0x51a0
movl %eax, %ecx
testq %rcx, %rcx
je 0x2483
movl 0x14(%rsp), %ebx
movq 0x310f(%rip), %rax      # 0x51a8
xorl %edx, %edx
movq %rax, %rsi
cmpl %edi, (%rsi)
je 0x20b9
movq %rdx, %r8
incq %r8
addq $0x40, %rsi
movq %r8, %rdx
cmpq %r8, %rcx
jne 0x209e
jmp 0x2483
testl %edx, %edx
js 0x2483
movl %edx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
shlq $0x6, %rcx
leaq (%rax,%rcx), %r14
addq $0x30, %r14
movl 0x8(%r14), %eax
movq (%r14), %rdi
testb $0x7f, %al
jne 0x2103
addl $0x81, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1210
movq %rax, (%r14)
testq %rax, %rax
je 0x24c2
movq %rax, %rdi
movl 0x8(%r14), %eax
movl %eax, %ecx
incl %eax
movl %eax, 0x8(%r14)
jmp 0x2143
addl $0x81, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1210
movq %rax, 0x28(%r14)
testq %rax, %rax
leaq 0x60(%rsp), %r15
leaq 0xc(%rsp), %r12
je 0x24b3
movq %rax, %rdi
movl 0x30(%r14), %eax
movl %eax, %ecx
incl %eax
movl %eax, 0x30(%r14)
movl %ecx, %eax
movl %ebx, (%rdi,%rax,4)
jmp 0x21ac
addl $0x81, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1210
movq %rax, (%r14)
testq %rax, %rax
leaq 0xc(%rsp), %r12
je 0x24cc
movq %rax, %rdi
movl 0x8(%r14), %eax
movl 0x8(%r15,%rbx), %ecx
movl %eax, %edx
incl %eax
movl %eax, 0x8(%r14)
movl %edx, %eax
movl %ecx, (%rdi,%rax,4)
incl %ecx
movl %ecx, 0x8(%r15,%rbx)
incl 0x4(%r15,%rbx)
leaq 0x2fd9(%rip), %rdi      # 0x5170
movq 0x20(%rsp), %rsi
callq 0x1200
incl 0x3011(%rip)            # 0x51b8
leaq 0x60(%rsp), %r15
movq %r12, %rdi
movl %r13d, %esi
callq 0x260e
testb %al, %al
je 0x1e8d
movb 0x2fd5(%rip), %al       # 0x519a
movb %al, 0x28(%rsp)
movl 0x2fd1(%rip), %eax      # 0x51a0
movl %eax, 0x3c(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x1080
movl 0x2fbd(%rip), %eax      # 0x51a0
xorl %edx, %edx
testl %eax, %eax
je 0x22b4
xorl %esi, %esi
movq 0x2fb2(%rip), %rcx      # 0x51a8
movl %esi, %r12d
leaq 0x60(%rsp), %rbx
movl $0x4, %r14d
movq %r12, %r13
shlq $0x6, %r13
cmpl $0x0, 0x18(%rcx,%r13)
je 0x228c
movl %esi, 0x1c(%rsp)
xorl %eax, %eax
movl %eax, %ebp
movq 0x10(%rcx,%r13), %rax
movq (%rax,%rbp,8), %r15
movq %rcx, %rax
testq %r15, %r15
je 0x2249
movq %r15, %rdi
callq 0x1050
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1240
movq 0x2f5f(%rip), %rax      # 0x51a8
leaq (,%rbp,4), %rsi
addq 0x20(%rax,%r13), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1240
movq %rbp, %rdx
incq %rdx
movq 0x2f3a(%rip), %rax      # 0x51a8
movl 0x18(%rax,%r13), %ecx
movl %ecx, %esi
movq %rdx, %rbp
movq %rax, %rcx
cmpq %rsi, %rdx
jb 0x221b
movl 0x2f1a(%rip), %edx      # 0x51a0
movl 0x1c(%rsp), %esi
jmp 0x2291
movl %eax, %edx
movq %rcx, %rax
movq %rax, %rcx
movl %edx, %eax
addl 0x4(%rcx,%r13), %esi
movq %r12, %rdi
incq %rdi
movl %edx, %edx
movl %edx, %r8d
movq %rdi, %r12
movl %esi, %edx
cmpq %r8, %rdi
jb 0x2204
movl %edx, %ebp
leaq 0x50(%rsp), %rbx
leaq 0x60(%rsp), %rsi
movq %rbx, %rdi
callq 0x1150
movq (%rbx), %rax
movq %rax, 0x30(%rsp)
movl %ebp, 0x40(%rsp)
movl 0x2ec6(%rip), %eax      # 0x51a0
movl %eax, %ecx
xorl %esi, %esi
testq %rcx, %rcx
je 0x2307
movq 0x2ebe(%rip), %rax      # 0x51a8
shlq $0x6, %rcx
xorl %edi, %edi
movl %edi, %edx
addl 0x38(%rax,%rdx), %edi
movq %rdx, %r8
addq $0x40, %r8
movq %r8, %rdx
movl %edi, %esi
cmpq %r8, %rcx
jne 0x22f2
movl %esi, 0x44(%rsp)
xorl %esi, %esi
movq 0x2e7c(%rip), %rax      # 0x5190
movl %esi, %ecx
movl %esi, %edx
cmpl $0x0, 0x14(%rax,%rcx,4)
jns 0x2323
subl 0x14(%rax,%rcx,4), %edx
movq %rcx, %rdi
incq %rdi
movq %rdi, %rcx
movl %edx, %esi
cmpq $0x10, %rdi
jne 0x2316
movl %edx, 0x48(%rsp)
movq 0x2e81(%rip), %rdi      # 0x51c0
testq %rdi, %rdi
je 0x239e
testb $0x7, 0x2e4f(%rip)      # 0x519a
je 0x239e
callq 0x1050
movq %rax, %rbx
movl %ebx, %ebp
leaq 0x28(%rsp), %rsi
movl %ebx, 0x10(%rsi)
movl $0x28, %edx
movl $0x63, %edi
callq 0x1040
cmpq $0x28, %rax
jne 0x24ae
testl %ebp, %ebp
je 0x23c3
movq 0x2e3d(%rip), %rsi      # 0x51c0
movl %ebx, %eax
movl %eax, %ebx
movl $0x63, %edi
movq %rbx, %rdx
callq 0x1040
cmpq %rbx, %rax
je 0x23c3
callq 0x1490
leaq 0x28(%rsp), %rsi
movl $0x0, 0x10(%rsi)
movl $0x28, %edx
movl $0x63, %edi
callq 0x1040
cmpq $0x28, %rax
jne 0x24ae
movl 0x2dd7(%rip), %eax      # 0x51a0
testl %eax, %eax
je 0x2471
movq 0x2dd0(%rip), %rcx      # 0x51a8
xorl %edx, %edx
movl %edx, %r15d
movl $0x63, %ebx
movq %r15, %r12
shlq $0x6, %r12
movl 0x38(%rcx,%r12), %edx
testl %edx, %edx
je 0x242d
leaq (%rcx,%r12), %rax
addq $0x30, %rax
movq (%rax), %r14
shll $0x2, %edx
xorl %r13d, %r13d
movl %edx, %ebp
movl %ebp, %eax
movl %eax, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x1040
movl %eax, %ecx
testl %eax, %eax
jle 0x2434
addl %ecx, %r13d
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r14
movl %r13d, %eax
subl %ecx, %ebp
jne 0x2405
jmp 0x2436
movl %eax, %edx
movq %rcx, %rax
jmp 0x2458
movl %ecx, %eax
movslq %eax, %rdx
movq 0x2d68(%rip), %rax      # 0x51a8
movl 0x38(%rax,%r12), %ecx
leaq (,%rcx,4), %rsi
cmpq %rdx, %rsi
jne 0x2488
movl 0x2d48(%rip), %edx      # 0x51a0
movq %rax, %rcx
movl %edx, %eax
movq %r15, %rdx
incq %rdx
movl %eax, %esi
movq %rdx, %r15
cmpq %rsi, %rdx
jb 0x23e2
addq $0x1068, %rsp           # imm = 0x1068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1448
movl %ecx, %edi
callq 0x1524
callq 0x168e
callq 0x1644
callq 0x15fc
callq 0x1736
movq %r14, %rdi
movq %rbx, %rsi
callq 0x16d6
callq 0x14da
callq 0x1320
callq 0x136a
callq 0x13b4
callq 0x13fe
callq 0x15b4
callq 0x156c