// File: drarwood[P]gags/FileWriter.cpp
// Function: OutputIndependentSolution(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>&, std::vector<int, std::allocator<int>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int&)
void OutputIndependentSolution(vector<string>& s, map<string,double>& m, vector<int>& n, string& o, int& g) {
    
    ofstream outFile;
    
    if (g == 1) {
        outFile.open(o.c_str(), ios_base::out);
        if (outFile.is_open()) {
            outFile << "Group\tID\tPhenotype\n";   
            for (int i = 0; i < n.size(); ++i) {
                for (int j = 0; j < n[i]; ++j) {
                    outFile << g << "\t" << s[j] << "\t" << m[s[j]] << endl;
                }
            }
            outFile.close();
        }
        else {
            cout << "Can not open " << o << " for writing" << endl;
            exit(EXIT_FAILURE);
        }
    }
    else {
        outFile.open(o.c_str(), ios_base::app);
        if (outFile.is_open()) {
            for (int i = 0; i < n.size(); ++i) {
                for (int j = 0; j < n[i]; ++j) {
                    outFile << g << "\t" << s[j] << "\t" << m[s[j]] << endl;
                }
            }
            outFile.close();
        }
        else {
            cout << "Can not open " << o << " for appending" << endl;
            exit(EXIT_FAILURE);
        }
    }
}

// Assembly:
subq $0x318, %rsp            # imm = 0x318
movq %rdi, 0x310(%rsp)
movq %rsi, 0x308(%rsp)
movq %rdx, 0x300(%rsp)
movq %rcx, 0x2f8(%rsp)
movq %r8, 0x2f0(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x34e0
movq 0x2f0(%rsp), %rax
cmpl $0x1, (%rax)
jne 0xea37
movq 0x2f8(%rsp), %rdi
callq 0x3120
movq %rax, %rsi
leaq 0xf0(%rsp), %rdi
movl $0x10, %edx
callq 0x3050
jmp 0xe7a1
leaq 0xf0(%rsp), %rdi
callq 0x3230
movb %al, 0xd3(%rsp)
jmp 0xe7b7
movb 0xd3(%rsp), %al
testb $0x1, %al
jne 0xe7c7
jmp 0xe9c4
leaq 0xbb2f(%rip), %rsi      # 0x1a2fd
leaq 0xf0(%rsp), %rdi
callq 0x32c0
jmp 0xe7dd
movl $0x0, 0xe0(%rsp)
movslq 0xe0(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x300(%rsp), %rdi
callq 0x5730
movq %rax, %rcx
movq 0xc8(%rsp), %rax
cmpq %rcx, %rax
jae 0xe9b3
movl $0x0, 0xdc(%rsp)
movl 0xdc(%rsp), %eax
movl %eax, 0xc4(%rsp)
movq 0x300(%rsp), %rdi
movslq 0xe0(%rsp), %rsi
callq 0x5750
movq %rax, %rcx
movl 0xc4(%rsp), %eax
cmpl (%rcx), %eax
jge 0xe99b
movq 0x2f0(%rsp), %rax
movl (%rax), %esi
leaq 0xf0(%rsp), %rdi
callq 0x34f0
movq %rax, 0xb8(%rsp)
jmp 0xe87a
movq 0xb8(%rsp), %rdi
leaq 0xba88(%rip), %rsi      # 0x1a311
callq 0x32c0
movq %rax, 0xb0(%rsp)
jmp 0xe898
movq 0x310(%rsp), %rdi
movslq 0xdc(%rsp), %rsi
callq 0xeca0
movq 0xb0(%rsp), %rdi
movq %rax, %rsi
callq 0x32a0
movq %rax, 0xa8(%rsp)
jmp 0xe8c7
movq 0xa8(%rsp), %rdi
leaq 0xba3b(%rip), %rsi      # 0x1a311
callq 0x32c0
movq %rax, 0xa0(%rsp)
jmp 0xe8e5
movq 0x308(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x310(%rsp), %rdi
movslq 0xdc(%rsp), %rsi
callq 0xeca0
movq 0x90(%rsp), %rdi
movq %rax, %rsi
callq 0xecc0
movq %rax, 0x98(%rsp)
jmp 0xe924
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rax
movsd (%rax), %xmm0
callq 0x3550
movq %rax, 0x88(%rsp)
jmp 0xe947
movq 0x88(%rsp), %rdi
movq 0x14672(%rip), %rsi     # 0x22fc8
callq 0x3330
jmp 0xe95d
jmp 0xe95f
movl 0xdc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xdc(%rsp)
jmp 0xe824
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x3440
jmp 0xec85
jmp 0xe99d
movl 0xe0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe0(%rsp)
jmp 0xe7e8
leaq 0xf0(%rsp), %rdi
callq 0x3420
jmp 0xe9c2
jmp 0xea32
movq 0x1460d(%rip), %rdi     # 0x22fd8
leaq 0xb941(%rip), %rsi      # 0x1a313
callq 0x32c0
movq %rax, 0x80(%rsp)
jmp 0xe9e1
movq 0x80(%rsp), %rdi
movq 0x2f8(%rsp), %rsi
callq 0x32a0
movq %rax, 0x78(%rsp)
jmp 0xe9fd
movq 0x78(%rsp), %rdi
leaq 0xb918(%rip), %rsi      # 0x1a321
callq 0x32c0
movq %rax, 0x70(%rsp)
jmp 0xea15
movq 0x70(%rsp), %rdi
movq 0x145a7(%rip), %rsi     # 0x22fc8
callq 0x3330
jmp 0xea28
movl $0x1, %edi
callq 0x33a0
jmp 0xec70
movq 0x2f8(%rsp), %rdi
callq 0x3120
movq %rax, %rsi
leaq 0xf0(%rsp), %rdi
movl $0x1, %edx
callq 0x3050
jmp 0xea5b
leaq 0xf0(%rsp), %rdi
callq 0x3230
movb %al, 0x6f(%rsp)
jmp 0xea6e
movb 0x6f(%rsp), %al
testb $0x1, %al
jne 0xea7b
jmp 0xec06
movl $0x0, 0xd8(%rsp)
movslq 0xd8(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x300(%rsp), %rdi
callq 0x5730
movq %rax, %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
jae 0xebf5
movl $0x0, 0xd4(%rsp)
movl 0xd4(%rsp), %eax
movl %eax, 0x5c(%rsp)
movq 0x300(%rsp), %rdi
movslq 0xd8(%rsp), %rsi
callq 0x5750
movq %rax, %rcx
movl 0x5c(%rsp), %eax
cmpl (%rcx), %eax
jge 0xebdd
movq 0x2f0(%rsp), %rax
movl (%rax), %esi
leaq 0xf0(%rsp), %rdi
callq 0x34f0
movq %rax, 0x50(%rsp)
jmp 0xeb09
movq 0x50(%rsp), %rdi
leaq 0xb7fc(%rip), %rsi      # 0x1a311
callq 0x32c0
movq %rax, 0x48(%rsp)
jmp 0xeb21
movq 0x310(%rsp), %rdi
movslq 0xd4(%rsp), %rsi
callq 0xeca0
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x32a0
movq %rax, 0x40(%rsp)
jmp 0xeb4a
movq 0x40(%rsp), %rdi
leaq 0xb7bb(%rip), %rsi      # 0x1a311
callq 0x32c0
movq %rax, 0x38(%rsp)
jmp 0xeb62
movq 0x308(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x310(%rsp), %rdi
movslq 0xd4(%rsp), %rsi
callq 0xeca0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0xecc0
movq %rax, 0x30(%rsp)
jmp 0xeb98
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rax
movsd (%rax), %xmm0
callq 0x3550
movq %rax, 0x20(%rsp)
jmp 0xebb2
movq 0x20(%rsp), %rdi
movq 0x1440a(%rip), %rsi     # 0x22fc8
callq 0x3330
jmp 0xebc5
jmp 0xebc7
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
jmp 0xeabc
jmp 0xebdf
movl 0xd8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd8(%rsp)
jmp 0xea86
leaq 0xf0(%rsp), %rdi
callq 0x3420
jmp 0xec04
jmp 0xec6e
movq 0x143cb(%rip), %rdi     # 0x22fd8
leaq 0xb6ff(%rip), %rsi      # 0x1a313
callq 0x32c0
movq %rax, 0x18(%rsp)
jmp 0xec20
movq 0x18(%rsp), %rdi
movq 0x2f8(%rsp), %rsi
callq 0x32a0
movq %rax, 0x10(%rsp)
jmp 0xec39
movq 0x10(%rsp), %rdi
leaq 0xb6e9(%rip), %rsi      # 0x1a32e
callq 0x32c0
movq %rax, 0x8(%rsp)
jmp 0xec51
movq 0x8(%rsp), %rdi
movq 0x1436b(%rip), %rsi     # 0x22fc8
callq 0x3330
jmp 0xec64
movl $0x1, %edi
callq 0x33a0
jmp 0xec70
leaq 0xf0(%rsp), %rdi
callq 0x3440
addq $0x318, %rsp            # imm = 0x318
retq
movq 0xe8(%rsp), %rdi
callq 0x3510
nopw %cs:(%rax,%rax)
nopl (%rax)