// File: /workspace/github_cpp_makefile_star2_O2/drarwood[P]gags/FileWriter.cpp
// Function: OutputSolution(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 OutputSolution(vector<string>& s, map<string,double>& m, vector<int>& n, string& o, int& g) {
    ofstream outFile;
    outFile.open(o.c_str(), ios_base::out);
    if (outFile.is_open()) {
        int index  = 0;
        //int group  = 0;
        int offset = 0;
        outFile << "Group\tID\tPhenotype\n";   
        for (int i = 0; i < n.size(); ++i) {
            //group++;
            while (index < n[i] + offset) {
                outFile << g << "\t" << s[index] << "\t" << m[s[index]] << endl;
                index++;
            }
            offset = offset + index;
            g++;
        }
        outFile.close();
    }
    else {
        cout << "Can not open " << o << " for writing" << endl;
        exit(EXIT_FAILURE);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %r8, 0x10(%rsp)
movq %rcx, %r13
movq %rdx, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %r12
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
callq 0x33e0
movq (%r13), %rsi
pushq $0x10
popq %rdx
movq %rbp, %rdi
callq 0x3040
leaq 0x98(%rsp), %rdi
callq 0x3080
testb %al, %al
je 0x6416
leaq 0x3fff(%rip), %rsi      # 0xa30d
leaq 0x28(%rsp), %rdi
callq 0x3250
movq 0x8(%rsp), %rax
movq (%rax), %rax
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
jbe 0x63f0
movslq %ebp, %rbp
movq %rbp, %rbx
shlq $0x5, %rbx
movslq %r14d, %rcx
movq %rcx, 0x20(%rsp)
addl %ebp, %r14d
movslq (%rax,%r15,4), %rcx
addq 0x20(%rsp), %rcx
cmpq %rcx, %rbp
jge 0x63e1
movq 0x10(%rsp), %rax
movl (%rax), %esi
leaq 0x28(%rsp), %rdi
callq 0x33f0
movq %rax, %rdi
leaq 0x3fa2(%rip), %rsi      # 0xa321
callq 0x3250
movq (%r12), %rsi
addq %rbx, %rsi
movq %rax, %rdi
callq 0x3230
movq %rax, %rdi
leaq 0x3f84(%rip), %rsi      # 0xa321
callq 0x3250
movq %rax, %r13
movq (%r12), %rsi
addq %rbx, %rsi
movq 0x18(%rsp), %rdi
callq 0x670e
movsd (%rax), %xmm0
movq %r13, %rdi
callq 0x33b0
movq %rax, %rdi
callq 0x3140
incq %rbp
movq 0x8(%rsp), %rax
movq (%rax), %rax
incl %r14d
addq $0x20, %rbx
jmp 0x6356
movq 0x10(%rsp), %rcx
incl (%rcx)
incq %r15
jmp 0x6328
leaq 0x28(%rsp), %rdi
callq 0x3330
leaq 0x28(%rsp), %rdi
callq 0x3350
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8bbb(%rip), %rdi      # 0xefd8
leaq 0x3eff(%rip), %rsi      # 0xa323
callq 0x3250
movq %rax, %rdi
movq %r13, %rsi
callq 0x3230
leaq 0x3ef6(%rip), %rsi      # 0xa331
movq %rax, %rdi
callq 0x3250
movq %rax, %rdi
callq 0x3140
pushq $0x1
popq %rdi
callq 0x32c0
jmp 0x6457
jmp 0x6457
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3410