// File: /workspace/github_cpp_makefile_star2_O3/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 0x140d2
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1d70b(%rip), %r12     # 0x315f2
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0xc3da
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0xc3da
leaq 0x98(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x1123c
leaq 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x1123c
leaq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x13aa0
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x13f84
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x13fa1
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
cmpq $0x0, 0x8(%r14)
je 0x13ff9
leaq 0x58(%rsp), %r13
xorl %ebp, %ebp
leaq 0x1d63c(%rip), %r15     # 0x315f2
leaq 0x48(%rsp), %r12
movq %r13, 0x48(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0xc3da
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe77a
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x13ff0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
incq %rbp
cmpq %rbp, 0x8(%r14)
ja 0x13fbb
cmpq $0x0, 0x30(%rsp)
je 0x1409a
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movq 0x28(%rsp), %rax
cmpb $0x2d, (%rax,%r13)
jne 0x1403e
testl %r12d, %r12d
movl $0x0, %edi
cmovgl %r12d, %edi
shlq $0x5, %rdi
addq (%rbx), %rdi
movq 0x8(%rsp), %rax
movsbl (%rax,%r13), %esi
callq 0x52d0
jmp 0x1408c
movq 0x8(%rsp), %rax
movb (%rax,%r13), %al
incl %r12d
cmpb $0x2d, %al
je 0x1408c
movslq %r12d, %r15
movq 0x8(%r14), %rcx
cmpq %r15, %rcx
ja 0x1407a
movq (%rbx), %rdx
shlq $0x5, %rcx
leaq (%rdx,%rcx), %rdi
addq $-0x20, %rdi
movsbl %al, %esi
callq 0x52d0
movq 0x8(%rsp), %rax
movb (%rax,%r13), %al
shlq $0x5, %r15
addq (%rbx), %r15
movsbl %al, %esi
movq %r15, %rdi
callq 0x52d0
incq %r13
cmpq %r13, 0x30(%rsp)
ja 0x1400e
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x140b6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x140d2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5340
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x14103
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x14103
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x14142
movq 0x98(%rsp), %rsi
jmp 0x1413a
jmp 0x14123
movq %rax, %rbx
jmp 0x1415e
jmp 0x14123
movq %rax, %rbx
jmp 0x14142
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x14142
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1415e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1417a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5340
movq %rbx, %rdi
callq 0x55c0