// File: /workspace/github_c_makefile_star2_O0/mabdi[P]bunney/bunny-exec.c
// Function: prepare_shm
static void prepare_shm(void) {
  _u8 buf[128];
  _u32 i;

#ifdef __CYGWIN__
  if (!getenv("CYGWIN")) {
    debug("Sorry, you need to enable SHM support in Cygwin first:\n"
          "  1. Install Cygwin IPC service ('cygserver-config').\n"
          "  2. Launch the service ('net start cygserver').\n"
          "  3. Export 'CYGWIN=server' to your environment.\n");
    exit(1);
  }
#endif /* __CYGWIN__ */
    
  if (!(outfile=fdopen(99,"a"))) fatal("unable to create a FILE object");

  shmid = shmget(0, OUTPUT_BUF + sizeof(struct shm_record), IPC_CREAT | 0600);
  if (shmid < 0) pfatal("unable to get %d kB of shared memory", OUTPUT_BUF / 1024);

  shmreg = shmat(shmid, 0, 0);
  if (!shmreg || (long)shmreg == -1) pfatal("unable to attach shared memory");

  sprintf(buf,"%u",shmid);
  setenv("BUNNY_SHMID",buf,1);

  shmreg->length      = OUTPUT_BUF;
  shmreg->child_crash = 0;

  for (i=0;i<16;i++)
    shmreg->func_quota[i] = func_limit;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl $0x63, %edi
leaq 0x2aaa(%rip), %rsi      # 0x4091
callq 0x1100
movq %rax, 0x4b85(%rip)      # 0x6178
cmpq $0x0, %rax
jne 0x1649
jmp 0x15fb
movq 0x49de(%rip), %rax      # 0x5fe0
movq (%rax), %rdi
leaq 0x2a87(%rip), %rsi      # 0x4093
movb $0x0, %al
callq 0x11b0
movq 0x49c6(%rip), %rax      # 0x5fe0
movq (%rax), %rdi
leaq 0x2a3b(%rip), %rsi      # 0x405f
leaq 0x2a9e(%rip), %rdx      # 0x40c9
leaq 0x2a42(%rip), %rcx      # 0x4074
movl $0x201, %r8d            # imm = 0x201
movb $0x0, %al
callq 0x11b0
movl $0x1, %edi
callq 0x1130
xorl %edi, %edi
movl $0x80054, %esi          # imm = 0x80054
movl $0x380, %edx            # imm = 0x380
callq 0x1070
movl %eax, 0x4b20(%rip)      # 0x6180
cmpl $0x0, 0x4b19(%rip)      # 0x6180
jae 0x16ca
jmp 0x166b
movq 0x496e(%rip), %rax      # 0x5fe0
movq (%rax), %rdi
leaq 0x2a59(%rip), %rsi      # 0x40d5
movl $0x200, %edx            # imm = 0x200
movb $0x0, %al
callq 0x11b0
movq 0x4951(%rip), %rax      # 0x5fe0
movq (%rax), %rdi
leaq 0x29c6(%rip), %rsi      # 0x405f
leaq 0x2a29(%rip), %rdx      # 0x40c9
leaq 0x29cd(%rip), %rcx      # 0x4074
movl $0x204, %r8d            # imm = 0x204
movb $0x0, %al
callq 0x11b0
leaq 0x2a55(%rip), %rdi      # 0x4110
callq 0x10d0
movl $0x1, %edi
callq 0x1130
movl 0x4ab0(%rip), %edi      # 0x6180
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1190
movq %rax, 0x4aa6(%rip)      # 0x6188
cmpq $0x0, 0x4a9e(%rip)      # 0x6188
je 0x16f9
movq 0x4a95(%rip), %rax      # 0x6188
cmpq $-0x1, %rax
jne 0x1755
jmp 0x16fb
movq 0x48de(%rip), %rax      # 0x5fe0
movq (%rax), %rdi
leaq 0x2a14(%rip), %rsi      # 0x4120
movb $0x0, %al
callq 0x11b0
movq 0x48c6(%rip), %rax      # 0x5fe0
movq (%rax), %rdi
leaq 0x293b(%rip), %rsi      # 0x405f
leaq 0x299e(%rip), %rdx      # 0x40c9
leaq 0x2942(%rip), %rcx      # 0x4074
movl $0x207, %r8d            # imm = 0x207
movb $0x0, %al
callq 0x11b0
leaq 0x29ca(%rip), %rdi      # 0x4110
callq 0x10d0
movl $0x1, %edi
callq 0x1130
leaq -0x80(%rbp), %rdi
movl 0x4a21(%rip), %edx      # 0x6180
leaq 0x2ba4(%rip), %rsi      # 0x430a
movb $0x0, %al
callq 0x1030
leaq -0x80(%rbp), %rsi
leaq 0x29dd(%rip), %rdi      # 0x4155
movl $0x1, %edx
callq 0x11e0
movq 0x49ff(%rip), %rax      # 0x6188
movl $0x80000, 0x4(%rax)     # imm = 0x80000
movq 0x49f1(%rip), %rax      # 0x6188
movl $0x0, 0x10(%rax)
movl $0x0, -0x84(%rbp)
cmpl $0x10, -0x84(%rbp)
jae 0x17d9
movl 0x4999(%rip), %edx      # 0x6150
movq 0x49ca(%rip), %rax      # 0x6188
movl -0x84(%rbp), %ecx
movl %edx, 0x14(%rax,%rcx,4)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x17a8
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)