// File: /workspace/github_cpp_makefile_star2_O3/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, 0x18(%rsp)
movq %rcx, %r13
movq %rdx, 0x8(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, %r12
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
callq 0x3410
movq (%r13), %rsi
movq %rbp, %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x98(%rsp), %rdi
callq 0x3080
testb %al, %al
je 0x6eea
leaq 0x55d1(%rip), %rsi      # 0xc33d
leaq 0x28(%rsp), %rdi
movl $0x13, %edx
callq 0x32c0
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
cmpq %rax, %rcx
je 0x6e9c
xorl %r15d, %r15d
xorl %esi, %esi
xorl %ebx, %ebx
movl (%rax,%r15,4), %edx
addl %esi, %edx
cmpl %edx, %ebx
jge 0x6e7d
movslq %ebx, %rbx
movq %rbx, %r14
shlq $0x5, %r14
movl %esi, 0x14(%rsp)
movslq %esi, %rbp
movq 0x18(%rsp), %rax
movl (%rax), %esi
leaq 0x28(%rsp), %rdi
callq 0x3420
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x5578(%rip), %rsi      # 0xc351
callq 0x32c0
movq (%r12), %rax
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
movq %r13, %rdi
callq 0x32c0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x554c(%rip), %rsi      # 0xc351
callq 0x32c0
movq (%r12), %rsi
addq %r14, %rsi
movq 0x20(%rsp), %rdi
callq 0x72f6
movsd (%rax), %xmm0
movq %r13, %rdi
callq 0x33e0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
incq %rbx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movslq (%rax,%r15,4), %rcx
addq %rbp, %rcx
addq $0x20, %r14
cmpq %rcx, %rbx
jl 0x6db6
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movl 0x14(%rsp), %esi
addl %ebx, %esi
movq 0x18(%rsp), %rdx
incl (%rdx)
incq %r15
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r15, %rdx
ja 0x6d97
leaq 0x28(%rsp), %rdi
callq 0x3340
movq 0xa113(%rip), %rax      # 0x10fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x3230
leaq 0x120(%rsp), %rdi
callq 0x30d0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa0e7(%rip), %rdi      # 0x10fd8
leaq 0x545b(%rip), %rsi      # 0xc353
movl $0xd, %edx
callq 0x32c0
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0xa0c7(%rip), %rdi      # 0x10fd8
callq 0x32c0
movq %rax, %rbx
leaq 0x5441(%rip), %rsi      # 0xc361
movl $0xc, %edx
movq %rax, %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x3120
movl $0x1, %edi
callq 0x32e0
jmp 0x6f43
jmp 0x6f43
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3370
movq %rbx, %rdi
callq 0x3450