// File: /workspace/github_c_makefile_star2_O2/mabdi[P]bunney/bunny-flow.c
// Function: reload_config
static void reload_config(void) {
  DIR* d;
  struct dirent* dent;
  _u32 i;
   
  for (i=0;i<infcount;i++) {
    free(infile[i].fname);
    if (infile[i].data) free(infile[i].data);
  }
  
  if (infile) free(infile);

  infcount = 0;
  infile   = 0;
  orig_fuzzable = 0;
  
  if (chdir(indir) || !(d = opendir(".")))
    pfatal("cannot open '%s' for reading",indir);
    
  while ((dent = readdir(d))) {
    struct stat st;
    _u8* x;
    
    if (dent->d_name[0] == '.') continue;
    
    x = strrchr(dent->d_name,'.');
    
    infile = realloc(infile,(infcount + 1) * sizeof(struct file_record));
    if (!infile) fatal("out of memory");
    
    infile[infcount].asis = (x && !strcmp(x,".keep"));

    infile[infcount].fname = strdup(dent->d_name);
    if (!infile[infcount].fname) fatal("out of memory");
    
    infile[infcount].data  = 0;
    infile[infcount].dirty = 0;
    
    if (access(dent->d_name,R_OK) || stat(dent->d_name,&st))
      pfatal("unable to access '%s/%s'",indir,dent->d_name);
      
    if (!S_ISREG(st.st_mode))
      fatal("'%s/%s' is not a regular file",indir,dent->d_name);

    /* 4 GB total oughta be enough for everybody... */
    infile[infcount].orig_len   = st.st_size;
    infile[infcount].cur_len    = st.st_size;
    if (!infile[infcount].asis) orig_fuzzable += st.st_size;
    
    infcount++;
  }

  closedir(d);
  
  if (!orig_fuzzable)
    fatal("directory '%s' contains no fuzzable entries",indir);

  if (infcount > 1)
    qsort(infile,infcount,sizeof(struct file_record),inf_sorter);

  debug("Loaded directory '%s': %u entries, %u bytes to fuzz\n",indir,infcount,orig_fuzzable);

  if (chdir(workdir))
    pfatal("unable to go back to work directory");

  cur_fuzzable = orig_fuzzable;
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl 0x5a57(%rip), %r14d     # 0x8190
movq 0x5a58(%rip), %rbx      # 0x8198
shlq $0x5, %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x2765
movq (%rbx,%r15), %rdi
callq 0x1170
movq 0x8(%rbx,%r15), %rdi
callq 0x1170
addq $0x20, %r15
jmp 0x2747
movq %rbx, %rdi
callq 0x1170
andl $0x0, 0x5a1c(%rip)      # 0x8190
andq $0x0, 0x5a1c(%rip)      # 0x8198
andl $0x0, 0x5a1d(%rip)      # 0x81a0
movq 0x49f6(%rip), %rdi      # 0x7180
callq 0x11e0
testl %eax, %eax
jne 0x2a85
leaq 0x1a69(%rip), %rdi      # 0x4207
callq 0x1200
testq %rax, %rax
je 0x2a85
movq %rax, %rbx
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
callq 0x1210
testq %rax, %rax
je 0x28d0
movq %rax, %r13
cmpb $0x2e, 0x13(%rax)
je 0x27b4
addq $0x13, %r13
movq %r13, %rdi
pushq $0x2e
popq %rsi
callq 0x1130
movq %rax, %rbp
movq 0x59b1(%rip), %rdi      # 0x8198
movl 0x59a2(%rip), %r14d     # 0x8190
leal 0x1(%r14), %esi
shlq $0x5, %rsi
callq 0x1250
movq %rax, 0x5996(%rip)      # 0x8198
testq %rax, %rax
je 0x29c4
movq %rax, %r12
testq %rbp, %rbp
je 0x2829
movq %rbp, %rdi
leaq 0x1a52(%rip), %rsi      # 0x426f
callq 0x11a0
testl %eax, %eax
sete %al
jmp 0x282b
xorl %eax, %eax
shlq $0x5, %r14
movb %al, 0x10(%r12,%r14)
movq %r13, %rdi
callq 0x1270
movq %rax, (%r12,%r14)
testq %rax, %rax
je 0x29fc
movq %r12, %rax
addq %r14, %rax
andq $0x0, 0x8(%rax)
movb $0x0, 0x1c(%r12,%r14)
movq %r13, %rdi
pushq $0x4
popq %rsi
callq 0x1260
testl %eax, %eax
jne 0x296e
movq %r13, %rdi
movq %r15, %rsi
callq 0x1110
testl %eax, %eax
jne 0x296e
movl 0x20(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x2a36
movl 0x38(%rsp), %ecx
movq 0x58f7(%rip), %rdx      # 0x8198
movl 0x58e9(%rip), %eax      # 0x8190
movq %rax, %rsi
shlq $0x5, %rsi
movl %ecx, 0x14(%rdx,%rsi)
movl %ecx, 0x18(%rdx,%rsi)
cmpb $0x0, 0x10(%rdx,%rsi)
jne 0x28c3
addl %ecx, 0x58dd(%rip)      # 0x81a0
incl %eax
movl %eax, 0x58c5(%rip)      # 0x8190
jmp 0x27b4
movq %rbx, %rdi
callq 0x1230
movl 0x58c1(%rip), %r8d      # 0x81a0
testl %r8d, %r8d
je 0x2ac3
movl 0x58a2(%rip), %ecx      # 0x8190
cmpq $0x2, %rcx
jb 0x291d
movq 0x589d(%rip), %rdi      # 0x8198
leaq 0x23b(%rip), %rax       # 0x2b3d
pushq $0x20
popq %rdx
movq %rcx, %rsi
movq %rax, %rcx
callq 0x1280
movl 0x587a(%rip), %ecx      # 0x8190
movl 0x5883(%rip), %r8d      # 0x81a0
movq 0x46bc(%rip), %rbx      # 0x6fe0
movq (%rbx), %rdi
movq 0x4852(%rip), %rdx      # 0x7180
leaq 0x19e7(%rip), %rsi      # 0x431c
xorl %eax, %eax
callq 0x11b0
leaq 0x484d(%rip), %rdi      # 0x7190
callq 0x11e0
testl %eax, %eax
jne 0x2b05
movl 0x584a(%rip), %eax      # 0x81a0
movl %eax, 0x5848(%rip)      # 0x81a4
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x466b(%rip), %rbx      # 0x6fe0
movq (%rbx), %rdi
movq 0x4801(%rip), %rdx      # 0x7180
leaq 0x18ef(%rip), %rsi      # 0x4275
movq %r13, %rcx
xorl %eax, %eax
callq 0x11b0
movq (%rbx), %rdi
leaq 0x16d2(%rip), %rsi      # 0x406c
leaq 0x189b(%rip), %rdx      # 0x423c
leaq 0x16d9(%rip), %rcx      # 0x4081
pushq $0x7f
popq %r8
xorl %eax, %eax
callq 0x11b0
leaq 0x1792(%rip), %rdi      # 0x414c
callq 0x1100
jmp 0x2a7d
movq 0x4615(%rip), %rbx      # 0x6fe0
movq (%rbx), %rcx
leaq 0x1875(%rip), %rdi      # 0x424a
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1290
movq (%rbx), %rdi
leaq 0x1682(%rip), %rsi      # 0x406c
leaq 0x184b(%rip), %rdx      # 0x423c
leaq 0x1689(%rip), %rcx      # 0x4081
pushq $0x74
jmp 0x2a32
movq 0x45dd(%rip), %rbx      # 0x6fe0
movq (%rbx), %rcx
leaq 0x183d(%rip), %rdi      # 0x424a
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1290
movq (%rbx), %rdi
leaq 0x164a(%rip), %rsi      # 0x406c
leaq 0x1813(%rip), %rdx      # 0x423c
leaq 0x1651(%rip), %rcx      # 0x4081
pushq $0x79
popq %r8
jmp 0x2a76
movq 0x45a3(%rip), %rbx      # 0x6fe0
movq (%rbx), %rdi
movq 0x4739(%rip), %rdx      # 0x7180
leaq 0x1856(%rip), %rsi      # 0x42a4
movq %r13, %rcx
xorl %eax, %eax
callq 0x11b0
movq (%rbx), %rdi
leaq 0x160a(%rip), %rsi      # 0x406c
leaq 0x17d3(%rip), %rdx      # 0x423c
leaq 0x1611(%rip), %rcx      # 0x4081
movl $0x82, %r8d
xorl %eax, %eax
callq 0x11b0
pushq $0x1
popq %rdi
callq 0x1180
movq 0x4554(%rip), %rbx      # 0x6fe0
movq (%rbx), %rdi
movq 0x46ea(%rip), %rdx      # 0x7180
leaq 0x176c(%rip), %rsi      # 0x4209
xorl %eax, %eax
callq 0x11b0
movq (%rbx), %rdi
leaq 0x15be(%rip), %rsi      # 0x406c
leaq 0x1787(%rip), %rdx      # 0x423c
leaq 0x15c5(%rip), %rcx      # 0x4081
pushq $0x69
jmp 0x29aa
movq 0x4516(%rip), %rbx      # 0x6fe0
movq (%rbx), %rdi
movq 0x46ac(%rip), %rdx      # 0x7180
leaq 0x17fe(%rip), %rsi      # 0x42d9
xorl %eax, %eax
callq 0x11b0
movq (%rbx), %rdi
leaq 0x1580(%rip), %rsi      # 0x406c
leaq 0x1749(%rip), %rdx      # 0x423c
leaq 0x1587(%rip), %rcx      # 0x4081
movl $0x8f, %r8d
jmp 0x2a76
movq (%rbx), %rcx
leaq 0x1842(%rip), %rdi      # 0x4351
pushq $0x39
popq %rsi
pushq $0x1
popq %rdx
callq 0x1290
movq (%rbx), %rdi
leaq 0x1548(%rip), %rsi      # 0x406c
leaq 0x1711(%rip), %rdx      # 0x423c
leaq 0x154f(%rip), %rcx      # 0x4081
movl $0x97, %r8d
jmp 0x29ac