// File: /workspace/github_cpp_makefile_star2_O3/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 0x4175(%rip), %rsi      # 0xaac0
movq %rax, %rdi
callq 0x2120
testq %rax, %rax
je 0x6aa5
movq %rax, %rbx
leaq 0x415a(%rip), %rsi      # 0xaac0
movq %r14, %rdi
callq 0x2120
testq %rax, %rax
je 0x6aa9
movq %rax, %r14
leaq 0x413f(%rip), %rsi      # 0xaac0
movq %r15, %rdi
callq 0x2120
testq %rax, %rax
je 0x6aad
movq %rax, %r15
leaq 0x4124(%rip), %rsi      # 0xaac0
movq %r13, %rdi
callq 0x2120
testq %rax, %rax
je 0x6abd
movq %rax, %r13
leaq 0x21bb0(%rsp), %rdi
movl $0x1eea8, %esi          # imm = 0x1EEA8
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21a0
cmpq $0x1, %rax
jne 0x6ab1
leaq 0x2d00(%rsp), %rdi
movl $0x1eea8, %esi          # imm = 0x1EEA8
movl $0x1, %edx
movq %r14, %rcx
callq 0x21a0
cmpq $0x1, %rax
jne 0x6ab1
leaq 0x1680(%rsp), %rdi
movl $0x167c, %esi           # imm = 0x167C
movl $0x1, %edx
movq %r15, %rcx
callq 0x21a0
cmpq $0x1, %rax
jne 0x6ab1
movq %rsp, %rdi
movl $0x167c, %esi           # imm = 0x167C
movl $0x1, %edx
movq %r13, %rcx
callq 0x21a0
cmpq $0x1, %rax
jne 0x6ab1
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 0x6a50
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 0x6a88
movb $0x1, %bpl
jmp 0x6ab3
xorl %ebp, %ebp
jmp 0x6ad7
xorl %ebp, %ebp
jmp 0x6acf
xorl %ebp, %ebp
jmp 0x6ac7
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x20d0
jmp 0x6abf
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