// File: /workspace/github_cpp_makefile_star2_O2/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 0x33a1(%rip), %rsi      # 0x9ab0
movq %rax, %rdi
callq 0x2130
testq %rax, %rax
je 0x6817
movq %rax, %rbx
leaq 0x3386(%rip), %rsi      # 0x9ab0
movq %r14, %rdi
callq 0x2130
testq %rax, %rax
je 0x681b
movq %rax, %r14
leaq 0x336b(%rip), %rsi      # 0x9ab0
movq %r15, %rdi
callq 0x2130
testq %rax, %rax
je 0x681f
movq %rax, %r15
leaq 0x3350(%rip), %rsi      # 0x9ab0
movq %r13, %rdi
callq 0x2130
testq %rax, %rax
je 0x682f
movq %rax, %r13
leaq 0x21bb0(%rsp), %rdi
pushq $0x1
popq %rdx
movl $0x1eea8, %esi          # imm = 0x1EEA8
movq %rbx, %rcx
callq 0x21b0
cmpq $0x1, %rax
jne 0x6823
leaq 0x2d00(%rsp), %rdi
pushq $0x1
popq %rdx
movl $0x1eea8, %esi          # imm = 0x1EEA8
movq %r14, %rcx
callq 0x21b0
cmpq $0x1, %rax
jne 0x6823
leaq 0x1680(%rsp), %rdi
pushq $0x1
popq %rdx
movl $0x167c, %esi           # imm = 0x167C
movq %r15, %rcx
callq 0x21b0
cmpq $0x1, %rax
jne 0x6823
movq %rsp, %rdi
pushq $0x1
popq %rdx
movl $0x167c, %esi           # imm = 0x167C
movq %r13, %rcx
callq 0x21b0
cmpq $0x1, %rax
jne 0x6823
xorl %eax, %eax
cmpq $0x1eea8, %rax          # imm = 0x1EEA8
je 0x685d
movb 0x21bb0(%rsp,%rax), %cl
movb %cl, 0x4(%r12,%rax)
cmpb $0x0, 0x2d00(%rsp,%rax)
setne 0x1eeac(%r12,%rax)
incq %rax
jmp 0x67ed
xorl %ebp, %ebp
jmp 0x6849
xorl %ebp, %ebp
jmp 0x6841
xorl %ebp, %ebp
jmp 0x6839
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x20d0
jmp 0x6831
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
xorl %eax, %eax
cmpq $0x167c, %rax           # imm = 0x167C
je 0x6888
movb 0x1680(%rsp,%rax), %cl
movb %cl, 0x3dd54(%r12,%rax)
cmpb $0x0, (%rsp,%rax)
setne 0x3f3d0(%r12,%rax)
incq %rax
jmp 0x685f
movb $0x1, %bpl
jmp 0x6825
nop