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

  valid_fd = fopen(validpath, "wb");
  if (valid_fd == NULL)
    goto CantOpenValid;
  
  ecc_fd = fopen(eccpath, "wb");
  if (ecc_fd == NULL)
    goto CantOpenECC;
  
  eccvalid_fd = fopen(eccvalidpath, "wb");
  if (eccvalid_fd == NULL)
    goto CantOpenECCValid;
  
  //
  // Create character arrays from all boolean items.
  //
  for (size_t i = 0; i < kSize; i++)
    valid[i] = mDataIsValid[i] ? 0xff : 0;
  
  for (size_t i = 0; i < DDSGroup1::kSize; i++)
    eccvalid[i] = mECCDataIsValid[i] ? 0xff : 0;
  
  //
  // Write all data items, .
  //
  if (fwrite(mData, sizeof(mData), 1, data_fd) != 1)
    goto CantWriteData;
  if (fwrite(valid, sizeof(valid), 1, valid_fd) != 1)
    goto CantWriteValid;
  if (fwrite(mECCData, sizeof(mECCData), 1, ecc_fd) != 1)
    goto CantWriteECC;
  if (fwrite(eccvalid, sizeof(eccvalid), 1, eccvalid_fd) != 1)
    goto CantWriteECCValid;
  
  res = true;

CantWriteECCValid:
CantWriteECC:
CantWriteValid:
CantWriteData:
  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 $0x20528, %rsp          # imm = 0x20528
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %r13
leaq 0x268d(%rip), %rsi      # 0x8f42
movq %rax, %rdi
callq 0x2130
testq %rax, %rax
je 0x6934
movq %rax, %rbx
leaq 0x2676(%rip), %rsi      # 0x8f42
movq %r14, %rdi
callq 0x2130
testq %rax, %rax
je 0x693b
movq %rax, %r14
leaq 0x265f(%rip), %rsi      # 0x8f42
movq %r15, %rdi
callq 0x2130
testq %rax, %rax
je 0x69d5
movq %rax, %r15
leaq 0x2644(%rip), %rsi      # 0x8f42
movq %r12, %rdi
callq 0x2130
testq %rax, %rax
je 0x69e5
movq %rax, %r12
xorl %eax, %eax
cmpq $0x1eea8, %rax          # imm = 0x1EEA8
je 0x6942
movb 0x1eeac(%r13,%rax), %cl
xorl %edx, %edx
subb %cl, %dl
movb %dl, 0x1680(%rsp,%rax)
incq %rax
jmp 0x6914
xorl %ebp, %ebp
jmp 0x69ff
xorl %ebp, %ebp
jmp 0x69f7
xorl %eax, %eax
cmpq $0x167c, %rax           # imm = 0x167C
je 0x6960
movb 0x3f3d0(%r13,%rax), %cl
xorl %edx, %edx
subb %cl, %dl
movb %dl, (%rsp,%rax)
incq %rax
jmp 0x6944
leaq 0x4(%r13), %rdi
pushq $0x1
popq %rdx
movl $0x1eea8, %esi          # imm = 0x1EEA8
movq %rbx, %rcx
callq 0x2200
cmpq $0x1, %rax
jne 0x69d9
leaq 0x1680(%rsp), %rdi
pushq $0x1
popq %rdx
movl $0x1eea8, %esi          # imm = 0x1EEA8
movq %r14, %rcx
callq 0x2200
cmpq $0x1, %rax
jne 0x69d9
addq $0x3dd54, %r13          # imm = 0x3DD54
pushq $0x1
popq %rdx
movl $0x167c, %esi           # imm = 0x167C
movq %r13, %rdi
movq %r15, %rcx
callq 0x2200
cmpq $0x1, %rax
jne 0x69d9
movq %rsp, %rdi
pushq $0x1
popq %rdx
movl $0x167c, %esi           # imm = 0x167C
movq %r12, %rcx
callq 0x2200
cmpq $0x1, %rax
sete %bpl
jmp 0x69db
xorl %ebp, %ebp
jmp 0x69ef
xorl %ebp, %ebp
movq %r12, %rdi
callq 0x20d0
jmp 0x69e7
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x20d0
movl %ebp, %eax
addq $0x20528, %rsp          # imm = 0x20528
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop