// File: /workspace/github_c_makefile_star2_O2/thegenemyers[P]DASCRUBBER/DB.c
// Function: Load_All_Track_Data
int Load_All_Track_Data(DAZZ_TRACK *track)
{ FILE  *dfile;
  void  *data;
  int   *alen;
  int64  dlen, off, o;
  int    i, len, nreads;

  if (track->loaded || track->data == NULL)
    return (0);

  nreads = track->nreads;
  dfile  = (FILE *) track->data;
  alen   = track->alen;

  dlen = 0;
  for (i = 0; i < nreads; i++)
    dlen += alen[i];

  data = (void *) Malloc(dlen,"Allocating All Track Data");
  if (data == NULL)
    EXIT(1);

  o = 0;
  if (track->size == 4)
    { int *anno4 = (int *) track->anno;

      for (i = 0; i < nreads; i++)
        { len = alen[i];
          off = anno4[i];
          if (ftello(dfile) != off)
            fseeko(dfile,off,SEEK_SET);
          if (len > 0)
            { if (fread(data+o,len,1,dfile) != 1)
                { EPRINTF(EPLACE,"%s: Read of .data failed (Load_All_Track_Data)\n",Prog_Name);
                  free(data);
                  EXIT(1);
                }
            }
          anno4[i] = o;
          o += len;
        }
      anno4[nreads] = o;
    }
  else
    { int64 *anno8 = (int64 *) track->anno;

      for (i = 0; i < nreads; i++)
        { len = alen[i];
          off = anno8[i];
          if (ftello(dfile) != off)
            fseeko(dfile,off,SEEK_SET);
          if (len > 0)
            { if (fread(data+o,len,1,dfile) != 1)
                { EPRINTF(EPLACE,"%s: Read of .data failed (Load_All_Track_Data)\n",Prog_Name);
                  free(data);
                  EXIT(1);
                }
            }
          anno8[i] = o;
          o += len;
        }
      anno8[nreads] = o;
    }

  fclose(dfile);

  track->data = (void *) data;
  track->loaded = 1;

  return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0x30(%rdi)
jne 0x5307
movq %rdi, %r14
movq 0x28(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0x5307
movslq 0x14(%r14), %r15
movq 0x20(%r14), %r13
xorl %eax, %eax
testl %r15d, %r15d
movl $0x0, %ebx
cmovgl %r15d, %ebx
xorl %edi, %edi
cmpq %rax, %rbx
je 0x51cb
movslq (%r13,%rax,4), %rcx
addq %rcx, %rdi
incq %rax
jmp 0x51b9
leaq 0x486f(%rip), %rsi      # 0x9a41
callq 0x1bad
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x5341
movq %r15, 0x10(%rsp)
cmpl $0x4, 0x10(%r14)
movq %r14, 0x20(%rsp)
movq 0x18(%r14), %r15
movq %r13, 0x18(%rsp)
jne 0x526e
xorl %r12d, %r12d
xorl %r14d, %r14d
cmpq %r12, %rbx
je 0x52d5
movl (%r13,%r12,4), %r13d
movslq (%r15,%r12,4), %rbp
movq (%rsp), %rdi
callq 0x1080
cmpq %rbp, %rax
je 0x5233
movq (%rsp), %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x1230
testl %r13d, %r13d
jle 0x525a
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %rdi
movq %r13, %rsi
pushq $0x1
popq %rdx
movq (%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0x5318
movl %r14d, (%r15,%r12,4)
movslq %r13d, %rax
addq %rax, %r14
incq %r12
movq 0x18(%rsp), %r13
jmp 0x5205
xorl %r12d, %r12d
xorl %r14d, %r14d
cmpq %r12, %rbx
je 0x52e0
movl (%r13,%r12,4), %r13d
movq (%r15,%r12,8), %rbp
movq (%rsp), %rdi
callq 0x1080
cmpq %rbp, %rax
je 0x529e
movq (%rsp), %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x1230
testl %r13d, %r13d
jle 0x52c1
movq 0x8(%rsp), %rax
leaq (%rax,%r14), %rdi
movq %r13, %rsi
pushq $0x1
popq %rdx
movq (%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0x5318
movq %r14, (%r15,%r12,8)
movslq %r13d, %rax
addq %rax, %r14
incq %r12
movq 0x18(%rsp), %r13
jmp 0x5274
movq 0x10(%rsp), %rax
movl %r14d, (%r15,%rax,4)
jmp 0x52e9
movq 0x10(%rsp), %rax
movq %r14, (%r15,%rax,8)
movq (%rsp), %rdi
callq 0x10c0
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x28(%rax)
movl $0x1, 0x30(%rax)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8cd9(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq 0xb5bf(%rip), %rdx      # 0x108e8
leaq 0x472b(%rip), %rsi      # 0x9a5b
xorl %eax, %eax
callq 0x11a0
movq 0x8(%rsp), %rdi
callq 0x1030
pushq $0x1
popq %rdi
callq 0x1270