// File: /workspace/github_c_makefile_star2_O0/thegenemyers[P]DASCRUBBER/DB.c
// Function: Load_Arrow
int Load_Arrow(DAZZ_DB *db, int i, char *arrow, int ascii)
{ FILE      *afile;
  int64      off;
  int        len, clen;

  if (db != Arrow_DB)
    { if (db->tracks == NULL || db->tracks->name != atrack_name)
        { EPRINTF(EPLACE,"%s: Arrow data is not available (Load_Arrow)\n",Prog_Name);
          EXIT(1);
        }
      Arrow_Ptr = (DAZZ_ARROW *) db->tracks;
      Arrow_DB  = db;
    }

  if (i < 0 || i >= db->nreads)
    { EPRINTF(EPLACE,"%s: Index out of bounds (Load_Arrow)\n",Prog_Name);
      EXIT(1);
    }

  afile = (FILE *) Arrow_Ptr->arrow;
  off   = Arrow_Ptr->aoff[i];
  len   = db->reads[i].rlen;

  if (ftello(afile) != off)
    fseeko(afile,off,SEEK_SET);
  clen = COMPRESSED_LEN(len);
  if (clen > 0)
    { if (fread(arrow,clen,1,afile) != 1)
        { EPRINTF(EPLACE,"%s: Failed read of .arw file (Load_Arrow)\n",Prog_Name);
          EXIT(1);
        }
    }
  Uncompress_Read(len,arrow);
  if (ascii == 1)
    { Letter_Arrow(arrow);
      arrow[-1] = '\0';
    }
  else
    arrow[-1] = 4;
  return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpq 0xe9df(%rip), %rax      # 0x14aa0
je 0x6126
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x60e3
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x8(%rax), %rax
cmpq 0xc25f(%rip), %rax      # 0x12340
je 0x610c
movq 0xbf0e(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0xe994(%rip), %rdx      # 0x14a88
leaq 0x86a3(%rip), %rsi      # 0xe79e
movb $0x0, %al
callq 0x1180
movl $0x1, %edi
callq 0x1260
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, 0xe98d(%rip)      # 0x14aa8
movq -0x8(%rbp), %rax
movq %rax, 0xe97a(%rip)      # 0x14aa0
cmpl $0x0, -0xc(%rbp)
jl 0x6138
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jl 0x6161
movq 0xbeb9(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0xe93f(%rip), %rdx      # 0x14a88
leaq 0x867c(%rip), %rsi      # 0xe7cc
movb $0x0, %al
callq 0x1180
movl $0x1, %edi
callq 0x1260
movq 0xe940(%rip), %rax      # 0x14aa8
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq 0xe931(%rip), %rax      # 0x14aa8
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1070
cmpq -0x30(%rbp), %rax
je 0x61be
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x1220
movl -0x34(%rbp), %eax
addl $0x3, %eax
sarl $0x2, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jle 0x6217
movq -0x18(%rbp), %rdi
movslq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rcx
movl $0x1, %edx
callq 0x10a0
cmpq $0x1, %rax
je 0x6215
movq 0xbe05(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0xe88b(%rip), %rdx      # 0x14a88
leaq 0x85ee(%rip), %rsi      # 0xe7f2
movb $0x0, %al
callq 0x1180
movl $0x1, %edi
callq 0x1260
jmp 0x6217
movl -0x34(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x2f20
cmpl $0x1, -0x1c(%rbp)
jne 0x623c
movq -0x18(%rbp), %rdi
callq 0x30b0
movq -0x18(%rbp), %rax
movb $0x0, -0x1(%rax)
jmp 0x6244
movq -0x18(%rbp), %rax
movb $0x4, -0x1(%rax)
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)