// File: medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::GenerateAltVector(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 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>>>>&)
void WholeGenome::GenerateAltVector(string ref, string alt, vector<string> & alt_vector){
    if(ref.size() == 0) return;
    string ref_match = "";
    string alt_match = "";
    needleman_wunsch(ref, alt, ref_match, alt_match);
    int current_ref_index = -1;
    for(int i = 0; i < ref.size(); i++){
        alt_vector.push_back("");
    }

    for(int i = 0; i < ref_match.size(); i++){
        if(ref_match[i] == '-'){
            if(current_ref_index < 0){
                alt_vector[0].push_back(alt_match[i]);
            }else{
                alt_vector[current_ref_index].push_back(alt_match[i]);
            }
        }else if(alt_match[i] == '-'){
            // pass
            current_ref_index ++;
        }else{
            current_ref_index ++;
            if(current_ref_index >= ref.size()){
                alt_vector[ref.size()-1].push_back(alt_match[i]);
            }
            alt_vector[current_ref_index].push_back(alt_match[i]);
        }
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rsi, -0x110(%rbp)
movq %rdi, %rax
movq -0x110(%rbp), %rdi
movq %rdi, -0x108(%rbp)
movq %rdx, -0x100(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
callq 0x6320
cmpq $0x0, %rax
jne 0x1dce5
jmp 0x1e17e
leaq -0x41(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x6760
movq -0x118(%rbp), %rdx
leaq 0x3789b(%rip), %rsi     # 0x5559e
leaq -0x40(%rbp), %rdi
callq 0x9680
jmp 0x1dd0e
leaq -0x41(%rbp), %rdi
callq 0x64b0
leaq -0x79(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x6760
movq -0x120(%rbp), %rdx
leaq 0x37869(%rip), %rsi     # 0x5559e
leaq -0x78(%rbp), %rdi
callq 0x9680
jmp 0x1dd40
leaq -0x79(%rbp), %rdi
callq 0x64b0
movq -0x108(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x61b0
jmp 0x1dd5e
movq -0x100(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x61b0
jmp 0x1dd73
movq -0xf8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq -0x78(%rbp), %r8
callq 0x1d6e0
jmp 0x1dd97
leaq -0xc0(%rbp), %rdi
callq 0x6828
leaq -0xa0(%rbp), %rdi
callq 0x6828
movl $0xffffffff, -0xc4(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xc8(%rbp)
movq -0x108(%rbp), %rdi
movslq -0xc8(%rbp), %rax
movq %rax, -0x128(%rbp)
callq 0x6320
movq %rax, %rcx
movq -0x128(%rbp), %rax
cmpq %rcx, %rax
jae 0x1df1e
movq -0x20(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x6760
movq -0x130(%rbp), %rdx
leaq 0x37782(%rip), %rsi     # 0x5559e
leaq -0xe8(%rbp), %rdi
callq 0x9680
jmp 0x1de2a
movq -0x138(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x12d50
jmp 0x1de3f
leaq -0xe8(%rbp), %rdi
callq 0x6828
leaq -0xe9(%rbp), %rdi
callq 0x64b0
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x1ddc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x64b0
jmp 0x1e187
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x64b0
jmp 0x1e173
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1e16a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1ded6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x6828
leaq -0xa0(%rbp), %rdi
callq 0x6828
jmp 0x1e16a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1df0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x6828
leaq -0xe9(%rbp), %rdi
callq 0x64b0
jmp 0x1e16a
movl $0x0, -0xf0(%rbp)
movslq -0xf0(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x6320
movq %rax, %rcx
movq -0x140(%rbp), %rax
cmpq %rcx, %rax
jae 0x1e156
movslq -0xf0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x6810
movq %rax, -0x148(%rbp)
jmp 0x1df6b
movq -0x148(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1e01d
cmpl $0x0, -0xc4(%rbp)
jge 0x1dfce
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9080
movq %rax, -0x158(%rbp)
movslq -0xf0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x6810
movq %rax, -0x150(%rbp)
jmp 0x1dfb4
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rax
movsbl (%rax), %esi
callq 0x63b0
jmp 0x1dfcc
jmp 0x1e018
movq -0x20(%rbp), %rdi
movslq -0xc4(%rbp), %rsi
callq 0x9080
movq %rax, -0x168(%rbp)
movslq -0xf0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x6810
movq %rax, -0x160(%rbp)
jmp 0x1dffe
movq -0x168(%rbp), %rdi
movq -0x160(%rbp), %rax
movsbl (%rax), %esi
callq 0x63b0
jmp 0x1e016
jmp 0x1e018
jmp 0x1e140
movslq -0xf0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x6810
movq %rax, -0x170(%rbp)
jmp 0x1e036
movq -0x170(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1e059
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x1e13e
movq -0x108(%rbp), %rdi
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
movslq -0xc4(%rbp), %rax
movq %rax, -0x178(%rbp)
callq 0x6320
movq %rax, %rcx
movq -0x178(%rbp), %rax
cmpq %rcx, %rax
jb 0x1e0f4
movq -0x108(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x190(%rbp)
callq 0x6320
movq -0x190(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x9080
movq %rax, -0x188(%rbp)
movslq -0xf0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x6810
movq %rax, -0x180(%rbp)
jmp 0x1e0da
movq -0x188(%rbp), %rdi
movq -0x180(%rbp), %rax
movsbl (%rax), %esi
callq 0x63b0
jmp 0x1e0f2
jmp 0x1e0f4
movq -0x20(%rbp), %rdi
movslq -0xc4(%rbp), %rsi
callq 0x9080
movq %rax, -0x1a0(%rbp)
movslq -0xf0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x6810
movq %rax, -0x198(%rbp)
jmp 0x1e124
movq -0x1a0(%rbp), %rdi
movq -0x198(%rbp), %rax
movsbl (%rax), %esi
callq 0x63b0
jmp 0x1e13c
jmp 0x1e13e
jmp 0x1e140
jmp 0x1e142
movl -0xf0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf0(%rbp)
jmp 0x1df28
leaq -0x78(%rbp), %rdi
callq 0x6828
leaq -0x40(%rbp), %rdi
callq 0x6828
jmp 0x1e17e
leaq -0x78(%rbp), %rdi
callq 0x6828
leaq -0x40(%rbp), %rdi
callq 0x6828
jmp 0x1e187
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x6750