// File: 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:
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, 0x2b0(%rsp)
movq %rsi, 0x2a8(%rsp)
movq %rdx, 0x2a0(%rsp)
movq %rcx, 0x298(%rsp)
movq %r8, 0x290(%rsp)
leaq 0x90(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x34e0
movq 0x298(%rsp), %rdi
callq 0x3120
movq 0x70(%rsp), %rdi
movq %rax, %rsi
movl $0x10, %edx
callq 0x3050
jmp 0xe4a2
leaq 0x90(%rsp), %rdi
callq 0x3230
movb %al, 0x6f(%rsp)
jmp 0xe4b5
movb 0x6f(%rsp), %al
testb $0x1, %al
jne 0xe4c2
jmp 0xe6a4
movl $0x0, 0x80(%rsp)
movl $0x0, 0x7c(%rsp)
leaq 0xbe21(%rip), %rsi      # 0x1a2fd
leaq 0x90(%rsp), %rdi
callq 0x32c0
jmp 0xe4eb
movl $0x0, 0x78(%rsp)
movslq 0x78(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x2a0(%rsp), %rdi
callq 0x5730
movq %rax, %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
jae 0xe693
jmp 0xe51d
movl 0x80(%rsp), %eax
movl %eax, 0x5c(%rsp)
movq 0x2a0(%rsp), %rdi
movslq 0x78(%rsp), %rsi
callq 0x5750
movq %rax, %rcx
movl 0x5c(%rsp), %eax
movl (%rcx), %ecx
addl 0x7c(%rsp), %ecx
cmpl %ecx, %eax
jge 0xe665
movq 0x290(%rsp), %rax
movl (%rax), %esi
leaq 0x90(%rsp), %rdi
callq 0x34f0
movq %rax, 0x50(%rsp)
jmp 0xe56d
movq 0x50(%rsp), %rdi
leaq 0xbd98(%rip), %rsi      # 0x1a311
callq 0x32c0
movq %rax, 0x48(%rsp)
jmp 0xe585
movq 0x2b0(%rsp), %rdi
movslq 0x80(%rsp), %rsi
callq 0xeca0
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x32a0
movq %rax, 0x40(%rsp)
jmp 0xe5ae
movq 0x40(%rsp), %rdi
leaq 0xbd57(%rip), %rsi      # 0x1a311
callq 0x32c0
movq %rax, 0x38(%rsp)
jmp 0xe5c6
movq 0x2a8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x2b0(%rsp), %rdi
movslq 0x80(%rsp), %rsi
callq 0xeca0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0xecc0
movq %rax, 0x30(%rsp)
jmp 0xe5fc
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rax
movsd (%rax), %xmm0
callq 0x3550
movq %rax, 0x20(%rsp)
jmp 0xe616
movq 0x20(%rsp), %rdi
movq 0x149a6(%rip), %rsi     # 0x22fc8
callq 0x3330
jmp 0xe629
movl 0x80(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x80(%rsp)
jmp 0xe51d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x3440
jmp 0xe721
movl 0x7c(%rsp), %eax
addl 0x80(%rsp), %eax
movl %eax, 0x7c(%rsp)
movq 0x290(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0xe4f3
leaq 0x90(%rsp), %rdi
callq 0x3420
jmp 0xe6a2
jmp 0xe70c
movq 0x1492d(%rip), %rdi     # 0x22fd8
leaq 0xbc61(%rip), %rsi      # 0x1a313
callq 0x32c0
movq %rax, 0x18(%rsp)
jmp 0xe6be
movq 0x18(%rsp), %rdi
movq 0x298(%rsp), %rsi
callq 0x32a0
movq %rax, 0x10(%rsp)
jmp 0xe6d7
movq 0x10(%rsp), %rdi
leaq 0xbc3e(%rip), %rsi      # 0x1a321
callq 0x32c0
movq %rax, 0x8(%rsp)
jmp 0xe6ef
movq 0x8(%rsp), %rdi
movq 0x148cd(%rip), %rsi     # 0x22fc8
callq 0x3330
jmp 0xe702
movl $0x1, %edi
callq 0x33a0
leaq 0x90(%rsp), %rdi
callq 0x3440
addq $0x2b8, %rsp            # imm = 0x2B8
retq
movq 0x88(%rsp), %rdi
callq 0x3510
nop