// File: /workspace/github_c_makefile_star2_O3/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 0x6460
movq %rdi, %rbx
movq 0x28(%rdi), %r14
testq %r14, %r14
je 0x6460
movslq 0x14(%rbx), %r12
movq 0x20(%rbx), %r13
testq %r12, %r12
jle 0x630e
xorl %eax, %eax
xorl %edi, %edi
movslq (%r13,%rax,4), %rcx
addq %rcx, %rdi
incq %rax
cmpq %rax, %r12
jne 0x62fc
jmp 0x6310
xorl %edi, %edi
leaq 0x578a(%rip), %rsi      # 0xbaa1
callq 0x2af5
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x6485
cmpl $0x4, 0x10(%rbx)
movq 0x18(%rbx), %r15
movq %r12, 0x20(%rsp)
movq %r13, 0x18(%rsp)
jne 0x63c2
testl %r12d, %r12d
jle 0x6435
movq %rbx, 0x10(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
movl (%r13,%rbx,4), %r12d
movslq (%r15,%rbx,4), %r13
movq %r14, %rdi
callq 0x1080
cmpq %r13, %rax
je 0x6377
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x1230
testl %r12d, %r12d
jle 0x639f
movq 0x8(%rsp), %rax
leaq (%rax,%rbp), %rdi
movl $0x1, %edx
movq %r12, %rsi
movq %r14, %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0x6471
movl %ebp, (%r15,%rbx,4)
movslq %r12d, %rax
addq %rax, %rbp
incq %rbx
movq 0x20(%rsp), %r12
cmpq %rbx, %r12
movq 0x18(%rsp), %r13
jne 0x6354
movq 0x10(%rsp), %rbx
jmp 0x6437
movq %rbx, 0x10(%rsp)
testl %r12d, %r12d
jle 0x643d
xorl %ebx, %ebx
xorl %ebp, %ebp
movl (%r13,%rbx,4), %r12d
movq (%r15,%rbx,8), %r13
movq %r14, %rdi
callq 0x1080
cmpq %r13, %rax
je 0x63f3
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x1230
testl %r12d, %r12d
jle 0x6417
movq 0x8(%rsp), %rax
leaq (%rax,%rbp), %rdi
movl $0x1, %edx
movq %r12, %rsi
movq %r14, %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0x647b
movq %rbp, (%r15,%rbx,8)
movslq %r12d, %rax
addq %rax, %rbp
incq %rbx
movq 0x20(%rsp), %r12
cmpq %rbx, %r12
movq 0x18(%rsp), %r13
jne 0x63d0
jmp 0x643f
xorl %ebp, %ebp
movl %ebp, (%r15,%r12,4)
jmp 0x6448
xorl %ebp, %ebp
movq %rbp, (%r15,%r12,8)
movq 0x10(%rsp), %rbx
movq %r14, %rdi
callq 0x10c0
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rbx)
movl $0x1, 0x30(%rbx)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
callq 0x1b15
movq 0x8(%rsp), %rdi
callq 0x1ae2
movl $0x1, %edi
callq 0x1270