// File: /workspace/github_cpp_makefile_star2_O3/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 0x55f9(%rip), %rcx      # 0xb3a0
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 0x5de0
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x5de7
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 0x5e1a
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 0xadf6
leaq 0x5571(%rip), %rsi      # 0xb3aa
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
movl 0x80(%rsp,%rax), %eax
testb $0x5, %al
je 0x5e82
xorl %edi, %edi
callq 0x2130
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x80(%rsp,%rax), %eax
testb $0x5, %al
jne 0x5e46
movq (%rbx), %r13
cmpq %rbx, %r13
je 0x5f5e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x5603(%rip), %r12      # 0xb4a1
leal 0x1(%rbp), %r15d
cmpl $0x1, %r15d
je 0x5eeb
movl $0xe, %edx
movq %r14, %rdi
leaq 0x54f8(%rip), %rsi      # 0xb3af
testl %r15d, %r15d
je 0x5efa
movl $0x2, %edx
movq %r14, %rdi
leaq 0x5506(%rip), %rsi      # 0xb3d1
callq 0x2210
movq %r14, %rdi
movl %ebp, %esi
callq 0x22f0
movq %rax, %rdi
movl $0x9, %edx
leaq 0x54cb(%rip), %rsi      # 0xb3b4
jmp 0x5efa
movl $0x12, %edx
movq %r14, %rdi
leaq 0x54c4(%rip), %rsi      # 0xb3be
callq 0x2210
movq 0x10(%r13), %rsi
movl 0x34(%rbx), %edx
leaq 0x40(%rsp), %rdi
callq 0x60fa
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 0x5f4e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21f0
movq (%r13), %r13
movl %r15d, %ebp
cmpq %rbx, %r13
jne 0x5e9e
leaq 0x553c(%rip), %rsi      # 0xb4a1
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 0x5f9e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5fb5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x8004(%rip), %rsi      # 0xdfc0
leaq 0x260(%rsp), %rdi
callq 0x2120
leaq 0x2e0(%rsp), %rdi
callq 0x2090
movq 0x7ffb(%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 0x6033
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x30(%rsp), %r14
jmp 0x60b0
movq %rax, %rbx
jmp 0x60b0
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x60c7
movq 0x10(%rsp), %rsi
jmp 0x60bf
jmp 0x6059
movq %rax, %rbx
jmp 0x60c7
movq %rax, %rbx
jmp 0x60e8
jmp 0x608d
jmp 0x608d
jmp 0x608d
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6090
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x6090
movq %rax, %rbx
leaq 0x30(%rsp), %r14
leaq 0x10(%rsp), %rax
movq (%rsp), %rdi
cmpq %rax, %rdi
je 0x60b0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x60c7
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x7ef2(%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