// File: 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:
subq $0x488, %rsp            # imm = 0x488
movq %rdi, 0x480(%rsp)
movl %esi, 0x47c(%rsp)
movq 0x480(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x470(%rsp), %rdi
callq 0x7ce0
leaq 0x268(%rsp), %rdi
callq 0x3400
leaq 0xe0(%rsp), %rdi
callq 0x3180
jmp 0xa38c
leaq 0xf0(%rsp), %rdi
movl 0x47c(%rsp), %esi
callq 0x3410
jmp 0xa3a2
leaq 0x90(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x3270
jmp 0xa3b9
leaq 0xaec0(%rip), %rsi      # 0x15280
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x12c60
jmp 0xa3d7
leaq 0x90(%rsp), %rdi
callq 0x3160
leaq 0xae9f(%rip), %rdx      # 0x1528a
leaq 0x70(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12cb0
jmp 0xa3ff
jmp 0xa401
leaq 0x70(%rsp), %rdi
callq 0x30e0
movq %rax, 0x28(%rsp)
movl $0x10, %edi
movl $0x20, %esi
callq 0x7f30
movl %eax, 0x34(%rsp)
jmp 0xa425
movl 0x34(%rsp), %edx
movq 0x28(%rsp), %rsi
leaq 0x268(%rsp), %rdi
callq 0x3040
jmp 0xa43d
movq 0x268(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x268(%rsp,%rax), %rdi
callq 0x3110
movb %al, 0x27(%rsp)
jmp 0xa45c
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0xa469
jmp 0xa501
xorl %edi, %edi
callq 0x31c0
jmp 0xa472
jmp 0xa501
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa733
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa726
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x3160
jmp 0xa726
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa719
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa70f
jmp 0xa503
movq 0x268(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x268(%rsp,%rax), %rdi
callq 0x3110
movb %al, 0x26(%rsp)
jmp 0xa522
movb 0x26(%rsp), %al
testb $0x1, %al
jne 0xa401
jmp 0xa530
movq 0x38(%rsp), %rdi
movl $0x0, 0x46c(%rsp)
callq 0x8810
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x470(%rsp)
movq 0x38(%rsp), %rdi
callq 0x8860
movq %rax, 0x60(%rsp)
leaq 0x470(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x8840
testb $0x1, %al
jne 0xa581
jmp 0xa6b1
cmpl $0x0, 0x46c(%rsp)
jne 0xa5a3
leaq 0xacfd(%rip), %rsi      # 0x1528f
leaq 0x268(%rsp), %rdi
callq 0x3280
jmp 0xa5a1
jmp 0xa611
cmpl $0x1, 0x46c(%rsp)
jne 0xa5c5
leaq 0xacea(%rip), %rsi      # 0x1529e
leaq 0x268(%rsp), %rdi
callq 0x3280
jmp 0xa5c3
jmp 0xa60f
leaq 0xace5(%rip), %rsi      # 0x152b1
leaq 0x268(%rsp), %rdi
callq 0x3280
movq %rax, 0x18(%rsp)
jmp 0xa5e0
movq 0x18(%rsp), %rdi
movl 0x46c(%rsp), %esi
decl %esi
callq 0x3410
movq %rax, 0x10(%rsp)
jmp 0xa5fa
movq 0x10(%rsp), %rdi
leaq 0xac8e(%rip), %rsi      # 0x15294
callq 0x3280
jmp 0xa60d
jmp 0xa60f
jmp 0xa611
leaq 0x470(%rsp), %rdi
callq 0x8890
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq (%rcx), %rsi
movl 0x34(%rax), %edx
leaq 0x40(%rsp), %rdi
callq 0xa750
jmp 0xa638
leaq 0x268(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3240
movq %rax, 0x8(%rsp)
jmp 0xa651
movq 0x8(%rsp), %rdi
leaq 0xad24(%rip), %rsi      # 0x15381
callq 0x3280
jmp 0xa664
leaq 0x40(%rsp), %rdi
callq 0x3160
movl 0x46c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x46c(%rsp)
leaq 0x470(%rsp), %rdi
callq 0x88b0
jmp 0xa557
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x3160
jmp 0xa70f
leaq 0xacc9(%rip), %rsi      # 0x15381
leaq 0x268(%rsp), %rdi
callq 0x3280
jmp 0xa6c7
leaq 0x268(%rsp), %rdi
callq 0x3370
jmp 0xa6d6
leaq 0x70(%rsp), %rdi
callq 0x3160
leaq 0xb0(%rsp), %rdi
callq 0x3160
leaq 0xe0(%rsp), %rdi
callq 0x31b0
leaq 0x268(%rsp), %rdi
callq 0x33a0
addq $0x488, %rsp            # imm = 0x488
retq
leaq 0x70(%rsp), %rdi
callq 0x3160
leaq 0xb0(%rsp), %rdi
callq 0x3160
leaq 0xe0(%rsp), %rdi
callq 0x31b0
leaq 0x268(%rsp), %rdi
callq 0x33a0
movq 0xd8(%rsp), %rdi
callq 0x3430
nopl (%rax)