// File: /workspace/github_cpp_makefile_star2_O1/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 0x1417d
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1d62f(%rip), %r12     # 0x315c2
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0xc45c
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0xc45c
leaq 0x98(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x112ce
leaq 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x112ce
leaq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x13b56
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x14030
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x1404d
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
cmpq $0x0, 0x8(%r14)
je 0x140a5
leaq 0x58(%rsp), %r13
xorl %ebp, %ebp
leaq 0x1d560(%rip), %r15     # 0x315c2
leaq 0x48(%rsp), %r12
movq %r13, 0x48(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0xc45c
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe826
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x1409c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
incq %rbp
cmpq %rbp, 0x8(%r14)
ja 0x14067
cmpq $0x0, 0x30(%rsp)
je 0x14145
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movq 0x28(%rsp), %rax
cmpb $0x2d, (%rax,%r13)
jne 0x140eb
movl %r12d, %edi
movq (%rbx), %rax
shlq $0x5, %rdi
addq %rax, %rdi
testl %r12d, %r12d
cmovsq %rax, %rdi
movq 0x8(%rsp), %rax
movsbl (%rax,%r13), %esi
callq 0x52d0
jmp 0x14137
movq 0x8(%rsp), %rax
movb (%rax,%r13), %al
incl %r12d
cmpb $0x2d, %al
je 0x14137
movslq %r12d, %r15
movq 0x8(%r14), %rcx
cmpq %r15, %rcx
ja 0x1411e
movq (%rbx), %rdx
shlq $0x5, %rcx
leaq (%rdx,%rcx), %rdi
addq $-0x20, %rdi
movsbl %al, %esi
callq 0x52d0
shlq $0x5, %r15
addq (%rbx), %r15
movq 0x8(%rsp), %rax
movsbl (%rax,%r13), %esi
movq %r15, %rdi
callq 0x52d0
incq %r13
cmpq %r13, 0x30(%rsp)
ja 0x140ba
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x14161
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1417d
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 0x141ae
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x141ae
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x141ed
movq 0x98(%rsp), %rsi
jmp 0x141e5
jmp 0x141ce
movq %rax, %rbx
jmp 0x14209
jmp 0x141ce
movq %rax, %rbx
jmp 0x141ed
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x141ed
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x14209
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x14225
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5340
movq %rbx, %rdi
callq 0x55c0
nop