// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %r12
leaq 0x3457(%rip), %rsi      # 0x9f32
movq %rax, %rdi
callq 0x2120
testq %rax, %rax
je 0x6bf6
movq %rax, %rbx
leaq 0x343c(%rip), %rsi      # 0x9f32
movq %r14, %rdi
callq 0x2120
testq %rax, %rax
je 0x6bfa
movq %rax, %r14
leaq 0x3421(%rip), %rsi      # 0x9f32
movq %r15, %rdi
callq 0x2120
testq %rax, %rax
je 0x6bfe
movq %rax, %r15
leaq 0x3406(%rip), %rsi      # 0x9f32
movq %r13, %rdi
callq 0x2120
testq %rax, %rax
je 0x6c0e
movq %rax, %r13
xorl %eax, %eax
xorl %ecx, %ecx
subb 0x1eeac(%r12,%rax), %cl
movb %cl, 0x1680(%rsp,%rax)
incq %rax
cmpq $0x1eea8, %rax          # imm = 0x1EEA8
jne 0x6b42
xorl %eax, %eax
xorl %ecx, %ecx
subb 0x3f3d0(%r12,%rax), %cl
movb %cl, (%rsp,%rax)
incq %rax
cmpq $0x167c, %rax           # imm = 0x167C
jne 0x6b60
leaq 0x4(%r12), %rdi
movl $0x1eea8, %esi          # imm = 0x1EEA8
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21f0
cmpq $0x1, %rax
jne 0x6c02
leaq 0x1680(%rsp), %rdi
movl $0x1eea8, %esi          # imm = 0x1EEA8
movl $0x1, %edx
movq %r14, %rcx
callq 0x21f0
cmpq $0x1, %rax
jne 0x6c02
addq $0x3dd54, %r12          # imm = 0x3DD54
movl $0x167c, %esi           # imm = 0x167C
movl $0x1, %edx
movq %r12, %rdi
movq %r15, %rcx
callq 0x21f0
cmpq $0x1, %rax
jne 0x6c02
movq %rsp, %rdi
movl $0x167c, %esi           # imm = 0x167C
movl $0x1, %edx
movq %r13, %rcx
callq 0x21f0
cmpq $0x1, %rax
sete %bpl
jmp 0x6c04
xorl %ebp, %ebp
jmp 0x6c28
xorl %ebp, %ebp
jmp 0x6c20
xorl %ebp, %ebp
jmp 0x6c18
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x20d0
jmp 0x6c10
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