// File: /workspace/github_cpp_makefile_star2_O1/ke6jjj[P]r-dat/BasicGroup.cc
// Function: BasicGroup::LoadFromFile(char const*, char const*, char const*, char const*)
bool
BasicGroup::LoadFromFile(const char *datapath, const char *validpath,
  const char *eccpath, const char *eccvalidpath)
{
  FILE *data_fd, *valid_fd, *ecc_fd, *eccvalid_fd;
  DataArray data, valid;
  DDSGroup1::DataArray ecc, eccvalid;
  bool res = false;
  
  data_fd = fopen(datapath, "rb");
  if (data_fd == NULL)
    goto CantOpenData;

  valid_fd = fopen(validpath, "rb");
  if (valid_fd == NULL)
    goto CantOpenValid;
  
  ecc_fd = fopen(eccpath, "rb");
  if (ecc_fd == NULL)
    goto CantOpenECC;
  
  eccvalid_fd = fopen(eccvalidpath, "rb");
  if (eccvalid_fd == NULL)
    goto CantOpenECCValid;
    
  //
  // Read in all the data items to temporary places.
  //
  if (fread(data, sizeof(data), 1, data_fd) != 1)
    goto ShortDataRead;

  if (fread(valid, sizeof(valid), 1, valid_fd) != 1)
    goto ShortValidRead;

  if (fread(ecc, sizeof(ecc), 1, ecc_fd) != 1)
    goto ShortECCRead;

  if (fread(eccvalid, sizeof(eccvalid), 1, eccvalid_fd) != 1)
    goto ShortECCValidRead;
  
  //
  // Copy the temporary data into our member variables, translating
  // booleans where needed.
  //
  for (size_t i = 0; i < kSize; i++) {
    mData[i] = data[i];
    mDataIsValid[i] = valid[i] != 0;
  }
  for (size_t i = 0; i < DDSGroup1::kSize; i++) {
    mECCData[i] = ecc[i];
    mECCDataIsValid[i] = eccvalid[i] != 0;
  }
  
  res = true;

ShortECCValidRead:
ShortECCRead:
ShortValidRead:
ShortDataRead:
  fclose(eccvalid_fd);
CantOpenECCValid:
  fclose(ecc_fd);
CantOpenECC:
  fclose(valid_fd);
CantOpenValid:
  fclose(data_fd);
CantOpenData:
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40a58, %rsp          # imm = 0x40A58
movq %r8, %r13
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %r12
leaq 0x419d(%rip), %rsi      # 0xaab0
movq %rax, %rdi
callq 0x2120
testq %rax, %rax
je 0x6a6d
movq %rax, %rbx
leaq 0x4182(%rip), %rsi      # 0xaab0
movq %r14, %rdi
callq 0x2120
testq %rax, %rax
je 0x6a71
movq %rax, %r14
leaq 0x4167(%rip), %rsi      # 0xaab0
movq %r15, %rdi
callq 0x2120
testq %rax, %rax
je 0x6a75
movq %rax, %r15
leaq 0x414c(%rip), %rsi      # 0xaab0
movq %r13, %rdi
callq 0x2120
testq %rax, %rax
je 0x6a85
movq %rax, %r13
leaq 0x21bb0(%rsp), %rdi
movl $0x1eea8, %esi          # imm = 0x1EEA8
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21a0
cmpq $0x1, %rax
jne 0x6a79
leaq 0x2d00(%rsp), %rdi
movl $0x1eea8, %esi          # imm = 0x1EEA8
movl $0x1, %edx
movq %r14, %rcx
callq 0x21a0
cmpq $0x1, %rax
jne 0x6a79
leaq 0x1680(%rsp), %rdi
movl $0x167c, %esi           # imm = 0x167C
movl $0x1, %edx
movq %r15, %rcx
callq 0x21a0
cmpq $0x1, %rax
jne 0x6a79
movq %rsp, %rdi
movl $0x167c, %esi           # imm = 0x167C
movl $0x1, %edx
movq %r13, %rcx
callq 0x21a0
cmpq $0x1, %rax
jne 0x6a79
leaq 0x4(%r12), %rdi
leaq 0x21bb0(%rsp), %rsi
movl $0x1eea8, %edx          # imm = 0x1EEA8
callq 0x20c0
xorl %eax, %eax
cmpb $0x0, 0x2d00(%rsp,%rax)
setne 0x1eeac(%r12,%rax)
incq %rax
cmpq $0x1eea8, %rax          # imm = 0x1EEA8
jne 0x6a18
leaq 0x3dd54(%r12), %rdi
leaq 0x1680(%rsp), %rsi
movl $0x167c, %edx           # imm = 0x167C
callq 0x20c0
xorl %eax, %eax
cmpb $0x0, (%rsp,%rax)
setne 0x3f3d0(%r12,%rax)
incq %rax
cmpq $0x167c, %rax           # imm = 0x167C
jne 0x6a50
movb $0x1, %bpl
jmp 0x6a7b
xorl %ebp, %ebp
jmp 0x6a9f
xorl %ebp, %ebp
jmp 0x6a97
xorl %ebp, %ebp
jmp 0x6a8f
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x20d0
jmp 0x6a87
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x20d0
movl %ebp, %eax
addq $0x40a58, %rsp          # imm = 0x40A58
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop