// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
cmpq $0x0, 0x8(%rsi)
je 0xef0a
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
leaq 0x137fb(%rip), %r13     # 0x225aa
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r13, %rsi
callq 0x72ee
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
movq %r13, %rsi
callq 0x72ee
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x53f0
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x53f0
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r15, %rdi
callq 0xea7e
leaq 0x48(%rsp), %rdi
callq 0x55e8
leaq 0x68(%rsp), %rdi
callq 0x55e8
xorl %ebp, %ebp
leaq 0x13781(%rip), %r15     # 0x225aa
leaq 0x88(%rsp), %r12
leaq 0x7(%rsp), %r13
cmpq %rbp, 0x8(%r14)
jbe 0xee62
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x72ee
movq %rbx, %rdi
movq %r12, %rsi
callq 0xadee
movq %r12, %rdi
callq 0x55e8
incq %rbp
jmp 0xee36
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
cmpq %r12, 0x30(%rsp)
jbe 0xeef6
movq 0x28(%rsp), %rax
cmpb $0x2d, (%rax,%r12)
jne 0xeea1
testl %ebp, %ebp
movl $0x0, %edi
cmovgl %ebp, %edi
shlq $0x5, %rdi
addq (%rbx), %rdi
movq 0x8(%rsp), %rax
movsbl (%rax,%r12), %esi
callq 0x52a0
jmp 0xeeee
movq 0x8(%rsp), %rax
movb (%rax,%r12), %al
incl %ebp
cmpb $0x2d, %al
je 0xeeee
movslq %ebp, %r15
movq 0x8(%r14), %rcx
cmpq %r15, %rcx
ja 0xeedc
movq (%rbx), %rdx
shlq $0x5, %rcx
leaq (%rdx,%rcx), %rdi
addq $-0x20, %rdi
movsbl %al, %esi
callq 0x52a0
movq 0x8(%rsp), %rax
movb (%rax,%r12), %al
shlq $0x5, %r15
addq (%rbx), %r15
movsbl %al, %esi
movq %r15, %rdi
callq 0x52a0
incq %r12
jmp 0xee68
leaq 0x8(%rsp), %rdi
callq 0x55e8
leaq 0x28(%rsp), %rdi
callq 0x55e8
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x55e8
jmp 0xef2e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0xef49
jmp 0xef50
movq %rax, %rbx
jmp 0xef5d
jmp 0xef50
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x55e8
jmp 0xef53
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x55e8
leaq 0x28(%rsp), %rdi
callq 0x55e8
movq %rbx, %rdi
callq 0x5540
nop