// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rdi, %rbx
callq 0x1180
movl %eax, 0x3920(%rip)      # 0x519c
testl %eax, %eax
js 0x2018
je 0x2056
leaq 0x4(%rsp), %r12
pushq $0x10
popq %rbp
leaq 0x176b(%rip), %r15      # 0x3004
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %r12, %rdi
movl %ebp, %esi
callq 0x224c
testb %al, %al
jne 0x1b70
movl 0x8(%rsp), %edx
movl %edx, %eax
addl $0x3ffefff0, %eax       # imm = 0x3FFEFFF0
roll $0x1c, %eax
cmpl $0x3, %eax
ja 0x1e11
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movl 0x10(%rsp), %eax
movl %eax, %ebx
cmpq $0x1000, %rbx           # imm = 0x1000
jae 0x1e50
movl %ebx, %esi
leaq 0x60(%rsp), %r12
movq %r12, %rdi
callq 0x224c
testb %al, %al
jne 0x1b70
movb $0x0, 0x60(%rsp,%rbx)
movl 0x4(%rsp), %edi
pushq $0x1
popq %rsi
callq 0x25a7
movl %eax, %r14d
movq %r12, %rdi
callq 0x1220
testq %rax, %rax
je 0x1dd4
movq %rax, %r13
movq 0x387d(%rip), %r12      # 0x51a8
movslq %r14d, %r14
shlq $0x6, %r14
leaq (%r12,%r14), %rbx
addq $0x10, %rbx
movl 0x8(%rbx), %eax
movq (%rbx), %rdi
testb $0x7f, %al
jne 0x1966
addl $0x82, %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x1210
movq %rax, (%rbx)
testq %rax, %rax
je 0x1dd4
movq %rax, %rdi
movl 0x8(%rbx), %eax
movl %eax, %ecx
incl %eax
movl %eax, 0x8(%rbx)
movq %r13, (%rdi,%rcx,8)
movq (%rbx), %rcx
andq $0x0, (%rcx,%rax,8)
leaq (%r12,%r14), %rbx
addq $0x20, %rbx
movl 0x8(%rbx), %eax
movq (%rbx), %rdi
testb $0x7f, %al
jne 0x19ad
addl $0x81, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1210
movq %rax, (%rbx)
testq %rax, %rax
je 0x1fd1
movq %rax, %rdi
movl 0x8(%rbx), %eax
movl 0x8(%r12,%r14), %ecx
movl %eax, %edx
incl %eax
movl %eax, 0x8(%rbx)
movl %edx, %eax
movl %ecx, (%rdi,%rax,4)
incl %ecx
movl %ecx, 0x8(%r12,%r14)
incl 0x4(%r12,%r14)
leaq 0x379f(%rip), %rdi      # 0x5170
movq 0x20(%rsp), %rsi
callq 0x1200
incl 0x37d7(%rip)            # 0x51b8
leaq 0x4(%rsp), %r12
jmp 0x18a0
movl 0x4(%rsp), %edi
movl 0xc(%rsp), %r14d
pushq $0x1
popq %rsi
callq 0x25a7
movq 0x37a5(%rip), %r12      # 0x51a8
movl %eax, %eax
movl %eax, %r13d
shlq $0x6, %r13
leaq (%r12,%r13), %rbx
addq $0x10, %rbx
decl -0x8(%rbx)
movl 0x8(%rbx), %eax
movq (%rbx), %rdi
testb $0x7f, %al
jne 0x1a43
addl $0x82, %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x1210
movq %rax, (%rbx)
testq %rax, %rax
je 0x1f55
movq %rax, %rdi
movl 0x8(%rbx), %eax
movl %eax, %ecx
incl %eax
movl %eax, 0x8(%rbx)
andq $0x0, (%rdi,%rcx,8)
movq (%rbx), %rcx
andq $0x0, (%rcx,%rax,8)
leaq (%r12,%r13), %rbx
addq $0x20, %rbx
movl 0x8(%rbx), %eax
movq (%rbx), %rdi
testb $0x7f, %al
jne 0x1a8b
addl $0x81, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1210
movq %rax, (%rbx)
testq %rax, %rax
je 0x1f14
movq %rax, %rdi
movl 0x8(%rbx), %eax
addq %r13, %r12
addq $0x8, %r12
movl (%r12), %ecx
movl %eax, %edx
incl %eax
movl %eax, 0x8(%rbx)
movl %edx, %eax
movl %ecx, (%rdi,%rax,4)
movl 0x30(%r12), %eax
movq 0x28(%r12), %rdi
testb $0x7f, %al
jne 0x1ad6
addl $0x81, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1210
movq %rax, 0x28(%r12)
testq %rax, %rax
je 0x1ed3
movq %rax, %rdi
movl 0x30(%r12), %eax
movl %eax, %ecx
incl %eax
movl %eax, 0x30(%r12)
movl %ecx, %eax
movl %r14d, (%rdi,%rax,4)
leaq 0x4(%rsp), %r12
jmp 0x18a0
movl 0x4(%rsp), %edi
movl 0xc(%rsp), %esi
callq 0x2391
jmp 0x18a0
movl 0x4(%rsp), %r13d
movl 0xc(%rsp), %r14d
movl %r13d, %edi
xorl %esi, %esi
callq 0x25a7
testl %eax, %eax
js 0x1e91
movq 0x3684(%rip), %rcx      # 0x51a8
movl %eax, %eax
shlq $0x6, %rax
leaq (%rcx,%rax), %rbx
addq $0x30, %rbx
movl 0x8(%rbx), %eax
movq (%rbx), %rdi
testb $0x7f, %al
jne 0x1b5e
addl $0x81, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1210
movq %rax, (%rbx)
testq %rax, %rax
je 0x1f93
movq %rax, %rdi
movl 0x8(%rbx), %eax
movl %eax, %ecx
incl %eax
movl %eax, 0x8(%rbx)
movl %ecx, %eax
movl %r14d, (%rdi,%rax,4)
jmp 0x18a0
movb 0x3624(%rip), %al       # 0x519a
movb %al, 0x28(%rsp)
movl 0x3620(%rip), %eax      # 0x51a0
movl %eax, 0x3c(%rsp)
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x1080
xorl %ecx, %ecx
movl %ecx, %r13d
pushq $0x4
popq %r14
movl %ecx, %ebp
movl 0x35fe(%rip), %eax      # 0x51a0
cmpq %rax, %r13
jae 0x1c31
movl %ebp, 0x14(%rsp)
xorl %eax, %eax
movl %eax, %r12d
movq %r13, 0x18(%rsp)
shlq $0x6, %r13
movq %r12, %rbp
movq 0x35e1(%rip), %rax      # 0x51a8
leaq (%rax,%r13), %rcx
movl 0x18(%rax,%r13), %edx
cmpq %rdx, %rbp
jae 0x1c1b
movq 0x10(%rcx), %rcx
movq (%rcx,%r12,2), %r15
testq %r15, %r15
je 0x1bff
movq %r15, %rdi
callq 0x1050
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1240
movq 0x35a9(%rip), %rax      # 0x51a8
movq 0x20(%rax,%r13), %rsi
addq %r12, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1240
incq %rbp
addq $0x4, %r12
jmp 0x1bc0
movl 0x14(%rsp), %edx
addl 0x4(%rcx), %edx
movq 0x18(%rsp), %r13
incq %r13
movl %edx, %ecx
jmp 0x1b9a
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 0x354b(%rip), %eax      # 0x51a0
movl %eax, %ecx
movq 0x354a(%rip), %rax      # 0x51a8
shlq $0x6, %rcx
xorl %edx, %edx
movl %edx, %esi
cmpq %rsi, %rcx
je 0x1c75
addl 0x38(%rax,%rsi), %edx
addq $0x40, %rsi
jmp 0x1c66
movl %edx, 0x44(%rsp)
xorl %edx, %edx
movq 0x350e(%rip), %rax      # 0x5190
movl %edx, %ecx
cmpq $0x10, %rcx
je 0x1c9a
cmpl $0x0, 0x14(%rax,%rcx,4)
jns 0x1c95
subl 0x14(%rax,%rcx,4), %edx
incq %rcx
jmp 0x1c84
movl %edx, 0x48(%rsp)
movq 0x351b(%rip), %rdi      # 0x51c0
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x1cbc
testb $0x7, 0x34e7(%rip)      # 0x519a
je 0x1cbc
callq 0x1050
movl %eax, %ebx
leaq 0x28(%rsp), %rsi
movl %ebx, 0x10(%rsi)
pushq $0x63
popq %rdi
pushq $0x28
popq %rdx
callq 0x1040
cmpq $0x28, %rax
jne 0x20b4
testl %ebx, %ebx
je 0x1cfa
movq 0x34dc(%rip), %rsi      # 0x51c0
movl %ebx, %ebx
pushq $0x63
popq %rdi
movq %rbx, %rdx
callq 0x1040
cmpq %rbx, %rax
jne 0x20f5
xorl %eax, %eax
movl %eax, %r15d
pushq $0x63
popq %rbx
movl 0x3498(%rip), %eax      # 0x51a0
cmpq %rax, %r15
jae 0x1d81
movq 0x3494(%rip), %rax      # 0x51a8
movq %r15, %r12
shlq $0x6, %r12
movl 0x38(%rax,%r12), %ecx
testl %ecx, %ecx
je 0x1d7c
addq %r12, %rax
addq $0x30, %rax
movq (%rax), %r14
shll $0x2, %ecx
xorl %r13d, %r13d
movl %ecx, %ebp
movl %ebp, %eax
movl %eax, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x1040
movl %eax, %ecx
testl %eax, %eax
jle 0x1d5e
addl %ecx, %r13d
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r14
movl %r13d, %eax
subl %ecx, %ebp
jne 0x1d36
jmp 0x1d60
movl %ecx, %eax
movslq %eax, %rcx
movq 0x343e(%rip), %rax      # 0x51a8
movl 0x38(%rax,%r12), %eax
leaq (,%rax,4), %rdx
cmpq %rcx, %rdx
jne 0x1d93
incq %r15
jmp 0x1d02
addq $0x1068, %rsp           # imm = 0x1068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edx
movq 0x3244(%rip), %r14      # 0x4fe0
movq (%r14), %rdi
leaq 0x15df(%rip), %rsi      # 0x3385
xorl %eax, %eax
movl %eax, %ebx
callq 0x11b0
movq (%r14), %rdi
leaq 0x12b6(%rip), %rsi      # 0x306f
leaq 0x1584(%rip), %rdx      # 0x3344
leaq 0x12bd(%rip), %rcx      # 0x3084
movl %ebx, %eax
movl $0x16d, %r8d            # imm = 0x16D
jmp 0x200b
movq 0x3205(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x147f(%rip), %rdi      # 0x3264
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0x1275(%rip), %rsi      # 0x306f
leaq 0x1496(%rip), %rdx      # 0x3297
leaq 0x127c(%rip), %rcx      # 0x3084
xorl %eax, %eax
pushq $0x75
jmp 0x2009
movq 0x31c8(%rip), %r14      # 0x4fe0
movq (%r14), %rdi
leaq 0x13b7(%rip), %rsi      # 0x31d9
xorl %eax, %eax
movl %eax, %ebx
callq 0x11b0
movq (%r14), %rdi
leaq 0x123a(%rip), %rsi      # 0x306f
leaq 0x132b(%rip), %rdx      # 0x3167
leaq 0x1241(%rip), %rcx      # 0x3084
movl %ebx, %eax
movl $0x1d3, %r8d            # imm = 0x1D3
jmp 0x200b
movq 0x3189(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x1342(%rip), %rdi      # 0x31a3
pushq $0x35
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0x11f9(%rip), %rsi      # 0x306f
leaq 0x12ea(%rip), %rdx      # 0x3167
leaq 0x1200(%rip), %rcx      # 0x3084
xorl %eax, %eax
movl $0x1bf, %r8d            # imm = 0x1BF
jmp 0x200b
movq 0x3148(%rip), %r14      # 0x4fe0
movq (%r14), %rdi
leaq 0x1403(%rip), %rsi      # 0x32a5
xorl %eax, %eax
movl %eax, %ebx
movl %r13d, %edx
callq 0x11b0
movq (%r14), %rdi
leaq 0x11b7(%rip), %rsi      # 0x306f
leaq 0x1423(%rip), %rdx      # 0x32e2
leaq 0x11be(%rip), %rcx      # 0x3084
movl %ebx, %eax
movl $0x85, %r8d
jmp 0x200b
movq 0x3106(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x1380(%rip), %rdi      # 0x3264
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0x1176(%rip), %rsi      # 0x306f
leaq 0x13f1(%rip), %rdx      # 0x32f1
leaq 0x117d(%rip), %rcx      # 0x3084
xorl %eax, %eax
movl $0x97, %r8d
jmp 0x200b
movq 0x30c5(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x133f(%rip), %rdi      # 0x3264
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0x1135(%rip), %rsi      # 0x306f
leaq 0x13b0(%rip), %rdx      # 0x32f1
leaq 0x113c(%rip), %rcx      # 0x3084
xorl %eax, %eax
movl $0x95, %r8d
jmp 0x200b
movq 0x3084(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x12fe(%rip), %rdi      # 0x3264
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0x10f4(%rip), %rsi      # 0x306f
leaq 0x136f(%rip), %rdx      # 0x32f1
leaq 0x10fb(%rip), %rcx      # 0x3084
xorl %eax, %eax
movl $0x94, %r8d
jmp 0x200b
movq 0x3046(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x12c0(%rip), %rdi      # 0x3264
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0x10b6(%rip), %rsi      # 0x306f
leaq 0x1322(%rip), %rdx      # 0x32e2
leaq 0x10bd(%rip), %rcx      # 0x3084
xorl %eax, %eax
movl $0x88, %r8d
jmp 0x200b
movq 0x3008(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x1282(%rip), %rdi      # 0x3264
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0x1078(%rip), %rsi      # 0x306f
leaq 0x1299(%rip), %rdx      # 0x3297
leaq 0x107f(%rip), %rcx      # 0x3084
xorl %eax, %eax
pushq $0x76
popq %r8
callq 0x11b0
pushq $0x1
popq %rdi
callq 0x1130
movq 0x2fc1(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x110d(%rip), %rdi      # 0x3136
pushq $0x30
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0x1031(%rip), %rsi      # 0x306f
leaq 0x1122(%rip), %rdx      # 0x3167
leaq 0x1038(%rip), %rcx      # 0x3084
xorl %eax, %eax
movl $0x1b2, %r8d            # imm = 0x1B2
jmp 0x200b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1090
movq 0x2f78(%rip), %r14      # 0x4fe0
movq (%r14), %rdi
leaq 0x1104(%rip), %rsi      # 0x3176
xorl %eax, %eax
movl %eax, %ebp
movq %rbx, %rdx
callq 0x11b0
movq (%r14), %rdi
leaq 0xfe7(%rip), %rsi       # 0x306f
leaq 0x10d8(%rip), %rdx      # 0x3167
leaq 0xfee(%rip), %rcx       # 0x3084
movl %ebp, %eax
movl $0x1b6, %r8d            # imm = 0x1B6
callq 0x11b0
leaq 0x103b(%rip), %rdi      # 0x30e5
callq 0x10d0
jmp 0x2010
movq 0x2f25(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x124a(%rip), %rdi      # 0x330f
pushq $0x34
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0xf95(%rip), %rsi       # 0x306f
leaq 0x1263(%rip), %rdx      # 0x3344
leaq 0xf9c(%rip), %rcx       # 0x3084
xorl %eax, %eax
movl $0x165, %r8d            # imm = 0x165
jmp 0x200b
movq 0x2ee4(%rip), %rbx      # 0x4fe0
movq (%rbx), %rcx
leaq 0x1247(%rip), %rdi      # 0x334d
pushq $0x37
popq %rsi
pushq $0x1
popq %rdx
callq 0x1250
movq (%rbx), %rdi
leaq 0xf54(%rip), %rsi       # 0x306f
leaq 0x1222(%rip), %rdx      # 0x3344
leaq 0xf5b(%rip), %rcx       # 0x3084
xorl %eax, %eax
movl $0x168, %r8d            # imm = 0x168
jmp 0x200b