// File: /workspace/github_cpp_makefile_star2_O1/pgrouchy[P]NoiseWorld/mathNet.cpp
// Function: Genome::save_EMM_txt(int)
void Genome::save_EMM_txt(int myNum) {
    list<Tree*>::iterator curTree;

    int counter;
    ofstream myFile;
    stringstream tempNum;
    tempNum << myNum;
    string myName = "myEMM_ind" + tempNum.str();
    string myFilename = myName + ".emm";

    do {
        myFile.open(myFilename.c_str(), ios::out | ios::trunc);
        if (!myFile)
            sleep(0.1);
    } while (!myFile);

    counter = 0;
    for (curTree = trees.begin(); curTree != trees.end(); ++curTree) {
        if (counter == 0) {
            myFile << "theta^(t+1) = ";
        } else if (counter == 1) {
            myFile << "omega_out^(t+1) = ";
        } else {
            myFile << "v_" << (counter - 1) << "^(t+1) = ";
        }
        myFile << (*curTree)->produceMyEqn(this->num_trees) << "\n";
        counter++;
    }
    myFile << "\n";
    myFile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x60(%rsp), %rdi
callq 0x22e0
leaq 0x260(%rsp), %rdi
callq 0x20f0
leaq 0x270(%rsp), %rdi
movl %ebp, %esi
callq 0x22f0
leaq 0x278(%rsp), %rsi
movq %rsp, %rdi
callq 0x22b0
leaq 0x5615(%rip), %rcx      # 0xb390
movq %rsp, %rdi
movl $0x9, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2200
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5db4
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x5dbb
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x5dee
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rsp, %rdi
movq %r15, (%rdi)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
callq 0xadd8
leaq 0x558d(%rip), %rsi      # 0xb39a
movq %rsp, %rdi
callq 0x2350
leaq 0x60(%rsp), %r14
movq (%rsp), %rsi
movq %r14, %rdi
movl $0x30, %edx
callq 0x2050
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x80(%rsp,%rax)
je 0x5e45
xorl %edi, %edi
callq 0x2130
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x80(%rsp,%rax)
jne 0x5e1a
movq (%rbx), %r13
cmpq %rbx, %r13
je 0x5f30
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x5621(%rip), %r12      # 0xb491
leal 0x1(%rbp), %r15d
cmpl $0x1, %r15d
je 0x5ebd
movl $0xe, %edx
movq %r14, %rdi
leaq 0x5516(%rip), %rsi      # 0xb39f
testl %r15d, %r15d
je 0x5ecc
movl $0x2, %edx
movq %r14, %rdi
leaq 0x5524(%rip), %rsi      # 0xb3c1
callq 0x2210
movq %r14, %rdi
movl %ebp, %esi
callq 0x22f0
movq %rax, %rdi
movl $0x9, %edx
leaq 0x54e9(%rip), %rsi      # 0xb3a4
jmp 0x5ecc
movl $0x12, %edx
movq %r14, %rdi
leaq 0x54e2(%rip), %rsi      # 0xb3ae
callq 0x2210
movq 0x10(%r13), %rsi
movl 0x34(%rbx), %edx
leaq 0x40(%rsp), %rdi
callq 0x60cc
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq %r14, %rdi
callq 0x2210
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2210
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x5f20
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21f0
movq (%r13), %r13
movl %r15d, %ebp
cmpq %rbx, %r13
jne 0x5e70
leaq 0x555a(%rip), %rsi      # 0xb491
leaq 0x60(%rsp), %rdi
movl $0x1, %edx
callq 0x2210
leaq 0x60(%rsp), %rdi
callq 0x2260
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
leaq 0x30(%rsp), %rbx
je 0x5f70
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5f87
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x8032(%rip), %rsi      # 0xdfc0
leaq 0x260(%rsp), %rdi
callq 0x2120
leaq 0x2e0(%rsp), %rdi
callq 0x2090
movq 0x8029(%rip), %rax      # 0xdfd8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x68(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x60(%rsp,%rcx)
callq 0x2170
leaq 0x158(%rsp), %rdi
callq 0x2090
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x6005
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x30(%rsp), %r14
jmp 0x6082
movq %rax, %rbx
jmp 0x6082
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6099
movq 0x10(%rsp), %rsi
jmp 0x6091
jmp 0x602b
movq %rax, %rbx
jmp 0x6099
movq %rax, %rbx
jmp 0x60ba
jmp 0x605f
jmp 0x605f
jmp 0x605f
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6062
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x6062
movq %rax, %rbx
leaq 0x30(%rsp), %r14
leaq 0x10(%rsp), %rax
movq (%rsp), %rdi
cmpq %rax, %rdi
je 0x6082
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x6099
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x7f20(%rip), %rsi      # 0xdfc0
leaq 0x260(%rsp), %rdi
callq 0x2120
leaq 0x2e0(%rsp), %rdi
callq 0x2090
leaq 0x60(%rsp), %rdi
callq 0x2280
movq %rbx, %rdi
callq 0x2300