// File: /workspace/github_c_makefile_star2_O2/mabdi[P]bunney/bunny-main.c
// Function: make_input
static _u8* make_input(_u8* prefix) {
  _u8 *curdir, tmp[MAXTOKEN];
  DIR* d;
  struct dirent* dent;
  static _u8 *newdir = 0;

  if (newdir) free(newdir);

  curdir = strdup(N(out_dir,".flow-out"));
  if (!curdir) fatal("out of memory");

  sprintf(tmp,"%s%03llu",prefix, input_cnt / 1000);
  mkdir(N(out_dir,tmp),0755);
  sprintf(tmp,"%s%03llu/%03llu",prefix, input_cnt / 1000, input_cnt % 1000);
  newdir = strdup(N(out_dir,tmp));
  if (!newdir) fatal("out of memory");

  input_cnt++;

  mkdir(newdir,0755);
  free_input(newdir,0);

  d = opendir(curdir);
  if (!d) pfatal("cannot open '%s' for reading",curdir);

  while ((dent = readdir(d))) {
    _u8 *odname;
    if (dent->d_name[0] == '.') continue;

    odname = strdup(N(curdir,dent->d_name));
    if (!odname) fatal("out of memory");

    if (link(odname, N(newdir,dent->d_name)))
      pfatal("cannot link '%s' to '%s/",odname,newdir);

    free(odname);

  }

  closedir(d);
  free(curdir);

  return newdir;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdi, %r14
movq 0x268da(%rip), %rdi     # 0x30360
callq 0x2220
movq 0x67de(%rip), %rdi      # 0x10270
leaq 0x281c(%rip), %rsi      # 0xc2b5
callq 0x6b44
movq %rax, %rdi
callq 0x2390
testq %rax, %rax
je 0x9d27
movq %rax, %rbx
movq 0x268af(%rip), %rax     # 0x30368
movl $0x3e8, %r12d           # imm = 0x3E8
xorl %edx, %edx
divq %r12
leaq 0x365e(%rip), %rsi      # 0xd129
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2050
movq 0x678b(%rip), %rdi      # 0x10270
movq %r15, %rsi
callq 0x6b44
movq %rax, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x20f0
movq 0x26867(%rip), %rax     # 0x30368
xorl %edx, %edx
divq %r12
movq %rdx, %r8
leaq 0x3622(%rip), %rsi      # 0xd132
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2050
movq 0x6749(%rip), %rdi      # 0x10270
movq %r15, %rsi
callq 0x6b44
movq %rax, %rdi
callq 0x2390
movq %rax, 0x26822(%rip)     # 0x30360
testq %rax, %rax
je 0x9da0
incq 0x2681a(%rip)           # 0x30368
movq %rax, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x20f0
movq 0x267fe(%rip), %rdi     # 0x30360
xorl %esi, %esi
callq 0x95cc
movq %rbx, %rdi
callq 0x2300
testq %rax, %rax
je 0x9e1d
movq %rax, %r14
movq %r14, %rdi
callq 0x2320
testq %rax, %rax
je 0x9bde
movq %rax, %r12
cmpb $0x2e, 0x13(%rax)
je 0x9b7d
addq $0x13, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6b44
movq %rax, %rdi
callq 0x2390
testq %rax, %rax
je 0x9c04
movq %rax, %r15
movq 0x267a7(%rip), %rdi     # 0x30360
movq %r12, %rsi
callq 0x6b44
movq %r15, %rdi
movq %rax, %rsi
callq 0x20a0
testl %eax, %eax
jne 0x9c88
movq %r15, %rdi
callq 0x2220
jmp 0x9b7d
movq %r14, %rdi
callq 0x2350
movq %rbx, %rdi
callq 0x2220
movq 0x2676b(%rip), %rax     # 0x30360
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x198d(%rip), %rdi      # 0xb598
xorl %eax, %eax
callq 0x2030
movq 0x664f(%rip), %rcx      # 0x10268
testq %rcx, %rcx
je 0x9c30
leaq 0x1973(%rip), %rdi      # 0xb598
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x23b0
leaq 0x1606(%rip), %rdi      # 0xb23d
leaq 0x34e0(%rip), %rsi      # 0xd11e
leaq 0x1608(%rip), %rdx      # 0xb24d
movl $0x36c, %ecx            # imm = 0x36C
xorl %eax, %eax
callq 0x2030
movq 0x6610(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9d1f
leaq 0x15d5(%rip), %rsi      # 0xb23d
leaq 0x34af(%rip), %rdx      # 0xd11e
leaq 0x15d7(%rip), %rcx      # 0xb24d
movl $0x36c, %r8d            # imm = 0x36C
xorl %eax, %eax
callq 0x22d0
jmp 0x9d1f
movq 0x266d1(%rip), %rdx     # 0x30360
leaq 0x34df(%rip), %rdi      # 0xd175
movq %r15, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x65c1(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9cc4
movq 0x266ad(%rip), %rcx     # 0x30360
leaq 0x34bb(%rip), %rsi      # 0xd175
movq %r15, %rdx
xorl %eax, %eax
callq 0x22d0
leaq 0x1572(%rip), %rdi      # 0xb23d
leaq 0x344c(%rip), %rsi      # 0xd11e
leaq 0x1574(%rip), %rdx      # 0xb24d
movl $0x36f, %ecx            # imm = 0x36F
xorl %eax, %eax
callq 0x2030
movq 0x657c(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9d13
leaq 0x1545(%rip), %rsi      # 0xb23d
leaq 0x341f(%rip), %rdx      # 0xd11e
leaq 0x1547(%rip), %rcx      # 0xb24d
movl $0x36f, %r8d            # imm = 0x36F
xorl %eax, %eax
callq 0x22d0
leaq 0x2322(%rip), %rdi      # 0xc03c
callq 0x2170
pushq $0x1
popq %rdi
callq 0x2230
leaq 0x186a(%rip), %rdi      # 0xb598
xorl %eax, %eax
callq 0x2030
movq 0x652c(%rip), %rcx      # 0x10268
testq %rcx, %rcx
je 0x9d53
leaq 0x1850(%rip), %rdi      # 0xb598
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x23b0
leaq 0x14e3(%rip), %rdi      # 0xb23d
leaq 0x33bd(%rip), %rsi      # 0xd11e
leaq 0x14e5(%rip), %rdx      # 0xb24d
movl $0x357, %ecx            # imm = 0x357
xorl %eax, %eax
callq 0x2030
movq 0x64ed(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9d1f
leaq 0x14b6(%rip), %rsi      # 0xb23d
leaq 0x3390(%rip), %rdx      # 0xd11e
leaq 0x14b8(%rip), %rcx      # 0xb24d
movl $0x357, %r8d            # imm = 0x357
jmp 0x9c7c
leaq 0x17f1(%rip), %rdi      # 0xb598
xorl %eax, %eax
callq 0x2030
movq 0x64b3(%rip), %rcx      # 0x10268
testq %rcx, %rcx
je 0x9dcc
leaq 0x17d7(%rip), %rdi      # 0xb598
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x23b0
leaq 0x146a(%rip), %rdi      # 0xb23d
leaq 0x3344(%rip), %rsi      # 0xd11e
leaq 0x146c(%rip), %rdx      # 0xb24d
movl $0x35d, %ecx            # imm = 0x35D
xorl %eax, %eax
callq 0x2030
movq 0x6474(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9d1f
leaq 0x1439(%rip), %rsi      # 0xb23d
leaq 0x3313(%rip), %rdx      # 0xd11e
leaq 0x143b(%rip), %rcx      # 0xb24d
movl $0x35d, %r8d            # imm = 0x35D
jmp 0x9c7c
leaq 0x331e(%rip), %rdi      # 0xd142
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x6433(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9e4b
leaq 0x3301(%rip), %rsi      # 0xd142
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22d0
leaq 0x13eb(%rip), %rdi      # 0xb23d
leaq 0x32c5(%rip), %rsi      # 0xd11e
leaq 0x13ed(%rip), %rdx      # 0xb24d
movl $0x365, %ecx            # imm = 0x365
xorl %eax, %eax
callq 0x2030
movq 0x63f5(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9d13
leaq 0x13ba(%rip), %rsi      # 0xb23d
leaq 0x3294(%rip), %rdx      # 0xd11e
leaq 0x13bc(%rip), %rcx      # 0xb24d
movl $0x365, %r8d            # imm = 0x365
jmp 0x9d0c