// File: /workspace/github_cpp_makefile_star2_O2/IHorvalds[P]RomAna/./processing/InflexEngineUtil.cpp
// Function: InflexEngine::saveExternal(char const*)
void InflexEngine::saveExternal(const char* filename) {
// Save class members to external binary file
  std::ofstream out;
  out.open(filename, std::ios::out | std::ios::binary);
  
  // "+ 1" because "bufferLastPtr" points on the last used pointer
  uint32_t writeSize = bufferLastPtr + 1;
  out.write((char*) &writeSize,  sizeof(uint32_t));
  out.write((char*) &sigma,      sizeof(uint32_t));
  out.write((char*) &fullBits,  sizeof(uint32_t));
  
  for (unsigned i = 0; i < writeSize; i++) {
    unsigned countOfSons = bitOp::countOfBits(staticTrieAccess(i)->configuration);
    
    // Computes configuration (the sons with non-zero values).
    if (staticTrieAccess(i)->configuration == fullBits) {
      staticTrieAccess(i)->configuration = 0;
      for (unsigned j = 0; j < sigma; j++)
        if (staticTrieAccess(i)->sons[j])
          staticTrieAccess(i)->configuration |= (1u << j);
    }
    out.write((char*) &staticTrieAccess(i)->code,          sizeof(uint32_t));
    out.write((char*) &staticTrieAccess(i)->configuration, sizeof(uint32_t));
    out.write((char*) &staticTrieAccess(i)->parent,        sizeof(uint32_t));

    // Writes only the sons with non-zero values.
    for (unsigned j = 0; j < countOfSons; j++)
      if (staticTrieAccess(i)->sons[j])
        out.write((char*) &staticTrieAccess(i)->sons[j], sizeof(uint32_t));
  }
  out.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x3440
pushq $0x14
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3050
movl 0x28(%rbx), %eax
incl %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x18(%rsp), %rdi
pushq $0x4
popq %rdx
callq 0x3330
leaq 0x20(%rbx), %r14
leaq 0x18(%rsp), %rdi
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x3330
leaq 0x24(%rbx), %rsi
leaq 0x18(%rsp), %rdi
pushq $0x4
popq %rdx
movq %rsi, 0x10(%rsp)
callq 0x3330
xorl %r12d, %r12d
pushq $0x4
popq %rbp
cmpl 0xc(%rsp), %r12d
jae 0x511d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
movl 0x8(%rax), %r13d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
movl 0x8(%rax), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
jne 0x503b
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
andl $0x0, 0x8(%rax)
xorl %r15d, %r15d
movl (%r14), %eax
cmpq %rax, %r15
jae 0x503b
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
movq 0xc(%rax), %rax
cmpl $0x0, (%rax,%r15,4)
je 0x5036
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
pushq $0x1
popq %rdx
movl %r15d, %ecx
shll %cl, %edx
orl %edx, 0x8(%rax)
incq %r15
jmp 0x5002
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x3330
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
addq $0x8, %rax
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x3330
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
addq $0x4, %rax
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x3330
movl %r13d, %eax
shrl %eax
andl $0x55555555, %eax       # imm = 0x55555555
subl %eax, %r13d
movl %r13d, %eax
movl $0x33333333, %ecx       # imm = 0x33333333
andl %ecx, %eax
shrl $0x2, %r13d
andl %ecx, %r13d
addl %eax, %r13d
movl %r13d, %eax
shrl $0x4, %eax
addl %r13d, %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
imull $0x1010101, %eax, %r15d # imm = 0x1010101
shrl $0x18, %r15d
shll $0x2, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x5115
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
movq 0xc(%rax), %rax
cmpl $0x0, (%rax,%r13)
je 0x510f
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3792
movq 0xc(%rax), %rsi
addq %r13, %rsi
leaq 0x18(%rsp), %rdi
movq %rbp, %rdx
callq 0x3330
addq $0x4, %r13
jmp 0x50d5
incl %r12d
jmp 0x4fbf
leaq 0x18(%rsp), %rdi
callq 0x3370
leaq 0x18(%rsp), %rdi
callq 0x33a0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x514b
jmp 0x514b
jmp 0x514b
jmp 0x514b
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x33a0
movq %rbx, %rdi
callq 0x3480