// File: /workspace/github_c_makefile_star2_O0/thegenemyers[P]DASCRUBBER/DB.c
// Function: Load_QVentry
int Load_QVentry(DAZZ_DB *db, int i, char **entry, int ascii)
{ DAZZ_READ *reads;
  FILE      *quiva;
  int        rlen;

  if (db != Active_DB)
    { if (db->tracks == NULL || strcmp(db->tracks->name,".@qvs") != 0)
        { EPRINTF(EPLACE,"%s: QV's have not been opened (Load_QVentry)\n",Prog_Name);
          EXIT(1);
        }
      Active_QV = (DAZZ_QV *) db->tracks;
      Active_DB = db;
    }

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

  reads = db->reads;
  quiva = Active_QV->quiva;
  rlen  = reads[i].rlen;

  fseeko(quiva,reads[i].coff,SEEK_SET);
  if (Uncompress_Next_QVentry(quiva,entry,Active_QV->coding+Active_QV->table[i],rlen))
    EXIT(1);

  if (ascii != 1)
    { char *deltag = entry[1];

      if (ascii != 2)
        { char x = deltag[rlen];
          deltag[rlen] = '\0';
          Number_Read(deltag);
          deltag[rlen] = x;
        }
      else
        { int j;
          int u = 'A'-'a';

          for (j = 0; j < rlen; j++)
            deltag[j] = (char) (deltag[j]+u);
        }
    }

  return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpq 0xbd3f(%rip), %rax      # 0x14ab0
je 0x8dde
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x8d9b
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x5872(%rip), %rsi      # 0xe603
callq 0x1170
cmpl $0x0, %eax
je 0x8dc4
movq 0x9256(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0xbcdc(%rip), %rdx      # 0x14a88
leaq 0x5fa3(%rip), %rsi      # 0xed56
movb $0x0, %al
callq 0x1180
movl $0x1, %edi
callq 0x1260
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, 0xbce5(%rip)      # 0x14ab8
movq -0x8(%rbp), %rax
movq %rax, 0xbcd2(%rip)      # 0x14ab0
cmpl $0x0, -0xc(%rbp)
jl 0x8df0
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jl 0x8e19
movq 0x9201(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0xbc87(%rip), %rdx      # 0x14a88
leaq 0x5f7c(%rip), %rsi      # 0xed84
movb $0x0, %al
callq 0x1180
movl $0x1, %edi
callq 0x1260
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x28(%rbp)
movq 0xbc8c(%rip), %rax      # 0x14ab8
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rsi
xorl %edx, %edx
callq 0x1220
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq 0xbc42(%rip), %rax      # 0x14ab8
movq 0x18(%rax), %rdx
movq 0xbc37(%rip), %rax      # 0x14ab8
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cltq
imulq $0x48, %rax, %rax
addq %rax, %rdx
movl -0x34(%rbp), %ecx
callq 0xc500
cmpl $0x0, %eax
je 0x8ead
movl $0x1, %edi
callq 0x1260
cmpl $0x1, -0x1c(%rbp)
je 0x8f3d
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
cmpl $0x2, -0x1c(%rbp)
je 0x8efc
movq -0x40(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x41(%rbp)
movq -0x40(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x40(%rbp), %rdi
callq 0x3100
movb -0x41(%rbp), %dl
movq -0x40(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x8f3b
movl $0xffffffe0, -0x4c(%rbp) # imm = 0xFFFFFFE0
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x8f39
movq -0x40(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl -0x4c(%rbp), %eax
movb %al, %dl
movq -0x40(%rbp), %rax
movslq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x8f0a
jmp 0x8f3b
jmp 0x8f3d
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)