// File: /workspace/github_c_makefile_star2_O2/mabdi[P]bunney/bunny-flow.c
// Function: load_data
static void load_data(_u32 rec) {
  _s32 fd;

  if (infile[rec].data) return;
  
  if (chdir(indir)) pfatal("cannot enter '%s'",indir);
  if (rec >= infcount) fatal("rec out of range");

  fd = open(infile[rec].fname,O_RDONLY);
    
  if (fd < 0)
    pfatal("unable to access '%s/%s'",indir,infile[rec].fname);
        
  infile[rec].dirty = 0;
  infile[rec].data  = malloc(infile[rec].orig_len);
  if (!infile[rec].data) fatal("out of memory");
    
  if (infile[rec].orig_len)
    if (read(fd,infile[rec].data,infile[rec].orig_len) != infile[rec].orig_len)
      fatal("short read from '%s/%s'",indir,infile[rec].fname);

  close(fd);

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

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x519f(%rip), %rax      # 0x8198
movl %edi, %r15d
shlq $0x5, %r15
cmpq $0x0, 0x8(%rax,%r15)
jne 0x30b6
movl %edi, %ebx
movq 0x416b(%rip), %rdi      # 0x7180
callq 0x11e0
testl %eax, %eax
jne 0x30c2
cmpl %ebx, 0x5168(%rip)      # 0x8190
jbe 0x3104
movq 0x5163(%rip), %rax      # 0x8198
movq (%rax,%r15), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10d0
testl %eax, %eax
js 0x3143
movl %eax, %ebx
movq 0x5145(%rip), %r12      # 0x8198
movb $0x0, 0x1c(%r12,%r15)
movl 0x14(%r12,%r15), %r14d
movq %r14, %rdi
callq 0x1190
movq %rax, 0x8(%r12,%r15)
testq %rax, %rax
je 0x318d
testq %r14, %r14
je 0x309b
movl %ebx, %edi
movq %rax, %rsi
movq %r14, %rdx
callq 0x11c0
movq 0x510b(%rip), %rcx      # 0x8198
movl 0x14(%rcx,%r15), %edx
cmpq %rdx, %rax
jne 0x321b
movl %ebx, %edi
callq 0x12a0
leaq 0x40e7(%rip), %rdi      # 0x7190
callq 0x11e0
testl %eax, %eax
jne 0x31cc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x3f17(%rip), %rbx      # 0x6fe0
movq (%rbx), %rdi
movq 0x40ad(%rip), %rdx      # 0x7180
leaq 0x142f(%rip), %rsi      # 0x4509
xorl %eax, %eax
callq 0x11b0
movq (%rbx), %rdi
leaq 0xf81(%rip), %rsi       # 0x406c
leaq 0x143f(%rip), %rdx      # 0x4531
leaq 0xf88(%rip), %rcx       # 0x4081
movl $0xa4, %r8d
jmp 0x3206
movq 0x3ed5(%rip), %rbx      # 0x6fe0
movq (%rbx), %rcx
leaq 0x1426(%rip), %rdi      # 0x453b
pushq $0x27
popq %rsi
pushq $0x1
popq %rdx
callq 0x1290
movq (%rbx), %rdi
leaq 0xf42(%rip), %rsi       # 0x406c
leaq 0x1400(%rip), %rdx      # 0x4531
leaq 0xf49(%rip), %rcx       # 0x4081
movl $0xa5, %r8d
jmp 0x325e
movq 0x3e96(%rip), %rbx      # 0x6fe0
movq (%rbx), %rdi
movq 0x402c(%rip), %rdx      # 0x7180
movq 0x503d(%rip), %rax      # 0x8198
movq (%rax,%r15), %rcx
leaq 0x110f(%rip), %rsi      # 0x4275
xorl %eax, %eax
callq 0x11b0
movq (%rbx), %rdi
leaq 0xef5(%rip), %rsi       # 0x406c
leaq 0x13b3(%rip), %rdx      # 0x4531
leaq 0xefc(%rip), %rcx       # 0x4081
movl $0xaa, %r8d
jmp 0x3206
movq 0x3e4c(%rip), %rbx      # 0x6fe0
movq (%rbx), %rcx
leaq 0x10ac(%rip), %rdi      # 0x424a
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x1290
movq (%rbx), %rdi
leaq 0xeb9(%rip), %rsi       # 0x406c
leaq 0x1377(%rip), %rdx      # 0x4531
leaq 0xec0(%rip), %rcx       # 0x4081
movl $0xae, %r8d
jmp 0x325e
movq 0x3e0d(%rip), %rbx      # 0x6fe0
movq (%rbx), %rcx
leaq 0x1174(%rip), %rdi      # 0x4351
pushq $0x39
popq %rsi
pushq $0x1
popq %rdx
callq 0x1290
movq (%rbx), %rdi
leaq 0xe7a(%rip), %rsi       # 0x406c
leaq 0x1338(%rip), %rdx      # 0x4531
leaq 0xe81(%rip), %rcx       # 0x4081
movl $0xb6, %r8d
xorl %eax, %eax
callq 0x11b0
leaq 0xf38(%rip), %rdi       # 0x414c
callq 0x1100
jmp 0x3265
addq %r15, %rcx
movq 0x3dbb(%rip), %rbx      # 0x6fe0
movq (%rbx), %rdi
movq 0x3f51(%rip), %rdx      # 0x7180
movq (%rcx), %rcx
leaq 0x132a(%rip), %rsi      # 0x4563
xorl %eax, %eax
callq 0x11b0
movq (%rbx), %rdi
leaq 0xe22(%rip), %rsi       # 0x406c
leaq 0x12e0(%rip), %rdx      # 0x4531
leaq 0xe29(%rip), %rcx       # 0x4081
movl $0xb2, %r8d
xorl %eax, %eax
callq 0x11b0
pushq $0x1
popq %rdi
callq 0x1180