// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x7761
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x776d
movl $0x0, -0x4(%rbp)
jmp 0x7a0c
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x77c5
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x779e
movq -0x30(%rbp), %rdi
leaq 0x7274(%rip), %rsi      # 0xea44
callq 0x22c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x77ea
movl $0x1, %edi
callq 0x1260
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x4, 0x10(%rax)
jne 0x78f6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x78e0
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movslq -0x44(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1070
cmpq -0x38(%rbp), %rax
je 0x785b
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
callq 0x1220
cmpl $0x0, -0x48(%rbp)
jle 0x78b5
movq -0x20(%rbp), %rdi
addq -0x40(%rbp), %rdi
movslq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rcx
movl $0x1, %edx
callq 0x10a0
cmpq $0x1, %rax
je 0x78b3
movq 0xa770(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0xd1f6(%rip), %rdx      # 0x14a88
leaq 0x71c5(%rip), %rsi      # 0xea5e
movb $0x0, %al
callq 0x1180
movq -0x20(%rbp), %rdi
callq 0x1030
movl $0x1, %edi
callq 0x1260
jmp 0x78b5
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x58(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movslq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7813
movq -0x40(%rbp), %rax
movl %eax, %edx
movq -0x58(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x79e5
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x79d5
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movq -0x60(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1070
cmpq -0x38(%rbp), %rax
je 0x7951
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
callq 0x1220
cmpl $0x0, -0x48(%rbp)
jle 0x79ab
movq -0x20(%rbp), %rdi
addq -0x40(%rbp), %rdi
movslq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rcx
movl $0x1, %edx
callq 0x10a0
cmpq $0x1, %rax
je 0x79a9
movq 0xa67a(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0xd100(%rip), %rdx      # 0x14a88
leaq 0x70cf(%rip), %rsi      # 0xea5e
movb $0x0, %al
callq 0x1180
movq -0x20(%rbp), %rdi
callq 0x1030
movl $0x1, %edi
callq 0x1260
jmp 0x79ab
movq -0x40(%rbp), %rdx
movq -0x60(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7909
movq -0x40(%rbp), %rdx
movq -0x60(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rdi
callq 0x10b0
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x30(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)