// File: /workspace/github_cpp_makefile_star2_O3/medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::AppendChangedSpNoGenotype(SequencePath&, std::vector<DiploidVariant, std::allocator<DiploidVariant>>&, std::__cxx11::list<SequencePath, std::allocator<SequencePath>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, int, int, int)
bool WholeGenome::AppendChangedSpNoGenotype(SequencePath& sp,
                         vector<DiploidVariant> & variant_list,
                         list<SequencePath> & sequence_path_list,
                         const string & reference_sequence,
                         int score_unit,
                         int match_mode,
                         int score_scheme,
                         int variant_index,
                         int c)
{
    int pos = sp.current_genome_pos+1;
    SequencePath path = sp;
    if(c == NOT_USE){
        path.choice_vector[variant_index] = c;
        sequence_path_list.push_back(path);
        return true;
    }

    pair<int, int> var_choice[2];
    int x = 0;
    int var_index = variant_index;
    DiploidVariant var = variant_list[var_index];
    if(var.flag) x = 1;
    string ref = var.ref;
    string alts[2];

    if(c == 0 || c == 1){
        // c == 0 or 1
        alts[0] = var.alts[c];
    }else{
        dout << "Unrecognized choice" << endl;
    }
    path.score += CalculateScore(var,
                                 c,
                                 score_unit,
                                 match_mode,
                                 score_scheme);
    ToUpper(ref);
    ToUpper(alts[0]);
    int y = 0;

    string alt = alts[y];
    vector<string> alt_vector;
    GenerateAltVector(ref, alt, alt_vector);
    int k = 0;
    for(; k < ref.length()-1; k++){
        if(alt_vector[k].size() != 1 || ref[k] != alt_vector[k][0]){
            path.string_sequences[x*2+y][pos+k] = alt_vector[k];
        }
        // else changes nothing
    }
    // hence k == ref.length()-1, the last position
    assert(k == ref.length()-1);
    string alt_part = alt_vector[k];
    if(alt_part.length() > 0){
        if(alt_part.length() > 1){
            if(alt_part[0] == ref[k]){
                if(path.string_sequences[x*2+y][pos+k] == "."){
                    path.string_sequences[x*2+y][pos+k] = alt_part;
                }else{
                    path.string_sequences[x*2+y][pos+k] += alt_part.substr(1, alt_part.size() - 1);
                }
            }else{
                path.string_sequences[x*2+y][pos+k] = alt_part;
            }
        }else{
            if(ref[k] != alt_vector[k][0]){
                path.string_sequences[x*2+y][pos+k] = alt_part;
            }
        }
    }else{
        path.string_sequences[x*2+y][pos+k] = "";
    }
    // choice made
    path.choice_vector[variant_index] = c;
    //dout << "after decision at variant " << variant_index << endl;
    //PrintPath(path);
    sequence_path_list.push_back(path);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movl %r9d, %r15d
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r12
movslq 0x350(%rsp), %rbp
movl 0xc8(%rsi), %r13d
leaq 0x188(%rsp), %rdi
callq 0x28ef6
cmpl $-0x9, 0x358(%rsp)
jne 0x19823
leaq 0x188(%rsp), %rsi
movq 0x168(%rsi), %rax
movl $0xfffffff7, (%rax,%rbp,4) # imm = 0xFFFFFFF7
movq %r14, %rdi
callq 0x2e160
movq %rax, %rdi
movq %r14, %rsi
callq 0x5070
incq 0x10(%r14)
jmp 0x19dd7
movq (%rbx), %rbx
movq %rbp, 0x8(%rsp)
imulq $0x58, %rbp, %rbp
movl (%rbx,%rbp), %eax
leaq 0xf0(%rsp), %rdi
movl %eax, -0x8(%rdi)
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x8(%rbx,%rbp), %rsi
movq 0x10(%rbx,%rbp), %rdx
addq %rsi, %rdx
callq 0x1123c
addq %rbp, %rbx
leaq 0x110(%rsp), %rdi
leaq 0x28(%rbx), %rsi
callq 0x28582
movups 0x40(%rbx), %xmm0
movups %xmm0, 0x128(%rsp)
movq 0x50(%rbx), %rax
movq %rax, 0x138(%rsp)
movb 0x134(%rsp), %al
movb %al, 0x7(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0xf0(%rsp), %rsi
movq 0xf8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x1123c
movl 0x340(%rsp), %ebx
incl %r13d
movl $0x10, %eax
leaq (%rsp,%rax), %rcx
addq $0x140, %rcx            # imm = 0x140
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x198c7
movl 0x358(%rsp), %eax
cmpl $0x1, %eax
ja 0x19914
movl %eax, %esi
shlq $0x5, %rsi
addq 0x110(%rsp), %rsi
leaq 0x140(%rsp), %rdi
callq 0x51c0
jmp 0x1995b
movq 0x236b5(%rip), %rbp     # 0x3cfd0
leaq 0x17d0b(%rip), %rsi     # 0x3162d
movl $0x13, %edx
movq %rbp, %rdi
callq 0x53a0
movq (%rbp), %rax
addq -0x18(%rax), %rbp
movq %rbp, %rdi
movl $0xa, %esi
callq 0x5310
movsbl %al, %esi
movq 0x23682(%rip), %rdi     # 0x3cfd0
callq 0x5040
movq %rax, %rdi
callq 0x5240
leaq 0xe8(%rsp), %rsi
movq %r12, %rdi
movl 0x358(%rsp), %edx
movl %r15d, %ecx
movl %ebx, %r8d
movl 0x348(%rsp), %r9d
callq 0x174b2
addl %eax, 0x2e0(%rsp)
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x199af
movq 0x10(%rsp), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x5610
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %rbx
jne 0x19999
movq 0x140(%rsp), %rbx
movq 0x148(%rsp), %r15
testq %r15, %r15
je 0x199ef
xorl %r12d, %r12d
movsbl (%rbx,%r12), %edi
callq 0x5610
movb %al, (%rbx,%r12)
incq %r12
cmpq %r12, %r15
jne 0x199c7
movq 0x140(%rsp), %rbx
movq 0x148(%rsp), %rdx
jmp 0x199f1
xorl %edx, %edx
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
addq %rbx, %rdx
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x1123c
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x1123c
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x1123c
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x13eb2
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x19a9f
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x19abc
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x18(%rsp), %rax
cmpq $0x1, %rax
jne 0x19acd
xorl %ebp, %ebp
xorl %ebx, %ebx
jmp 0x19b3c
cmpb $0x0, 0x7(%rsp)
movl $0x38, %ecx
movl $0x8, %ebx
cmovneq %rcx, %rbx
movslq %r13d, %r15
shlq $0x5, %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x30(%rsp), %rcx
leaq (%rcx,%r12), %rsi
cmpq $0x1, 0x8(%rcx,%r12)
jne 0x19b0c
movq 0x10(%rsp), %rcx
movb (%rcx,%rbp), %cl
movq (%rsi), %rdx
cmpb (%rdx), %cl
je 0x19b24
movq 0x188(%rsp,%rbx), %rdi
addq %r15, %rdi
addq %r12, %rdi
callq 0x51c0
movq 0x18(%rsp), %rax
incq %rbp
leaq -0x1(%rax), %rcx
addq $0x20, %r12
cmpq %rbp, %rcx
ja 0x19aec
jne 0x19e76
movl %ebp, %ebx
movq 0x30(%rsp), %rax
movq %rbp, %r15
shlq $0x5, %r15
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x1123c
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x19bc6
cmpq $0x1, %rax
jne 0x19c18
movq 0x10(%rsp), %rax
movb (%rax,%rbp), %al
movq 0x30(%rsp), %rcx
movq (%rcx,%r15), %rcx
cmpb (%rcx), %al
movq 0x8(%rsp), %rbp
movl 0x358(%rsp), %r15d
je 0x19cf5
cmpb $0x0, 0x7(%rsp)
leaq 0x1c0(%rsp), %rax
leaq 0x190(%rsp), %r15
cmovneq %rax, %r15
addl %r13d, %ebx
movslq %ebx, %r13
jmp 0x19cd2
cmpb $0x0, 0x7(%rsp)
leaq 0x1c0(%rsp), %rax
leaq 0x190(%rsp), %rcx
cmovneq %rax, %rcx
addl %r13d, %ebx
movslq %ebx, %rax
movq (%rcx), %rcx
shlq $0x5, %rax
leaq (%rcx,%rax), %rdi
movq 0x8(%rcx,%rax), %rdx
leaq 0x179f6(%rip), %rcx     # 0x315f2
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x54b0
movq 0x8(%rsp), %rbp
movl 0x358(%rsp), %r15d
jmp 0x19cf5
movq 0x48(%rsp), %rax
movb (%rax), %al
movq 0x10(%rsp), %rcx
cmpb $0x0, 0x7(%rsp)
leaq 0x1c0(%rsp), %rdx
leaq 0x190(%rsp), %r15
cmovneq %rdx, %r15
addl %r13d, %ebx
movslq %ebx, %r13
movq %r13, %rbx
shlq $0x5, %rbx
movq (%r15), %rdi
addq %rbx, %rdi
cmpb (%rcx,%rbp), %al
jne 0x19cde
leaq 0x17e26(%rip), %rsi     # 0x31a86
callq 0x50e0
testl %eax, %eax
movq 0x8(%rsp), %rbp
je 0x19cd2
leaq 0x48(%rsp), %rsi
movq 0x8(%rsi), %rcx
decq %rcx
leaq 0x88(%rsp), %rdi
movl $0x1, %edx
callq 0x5360
addq (%r15), %rbx
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %rbx, %rdi
callq 0x50f0
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
movl 0x358(%rsp), %r15d
je 0x19cf5
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x19cf5
shlq $0x5, %r13
addq (%r15), %r13
movq %r13, %rdi
jmp 0x19ce3
movq 0x8(%rsp), %rbp
leaq 0x48(%rsp), %rsi
callq 0x51c0
movl 0x358(%rsp), %r15d
leaq 0x188(%rsp), %rsi
movq 0x168(%rsi), %rax
movl %r15d, (%rax,%rbp,4)
movq %r14, %rdi
callq 0x2e160
movq %rax, %rdi
movq %r14, %rsi
callq 0x5070
incq 0x10(%r14)
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x19d36
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x30(%rsp), %rdi
callq 0xe71c
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x19d5c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq $-0x40, %rbx
leaq 0x170(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x19d7f
movq (%r14), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x19d6b
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x19da5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x110(%rsp), %rdi
callq 0xe71c
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x19dd7
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x2f0(%rsp), %rdi
testq %rdi, %rdi
je 0x19df4
movq 0x300(%rsp), %rsi
subq %rdi, %rsi
callq 0x5340
movl $0x140, %ebx            # imm = 0x140
leaq (%rsp,%rbx), %rax
addq $0x188, %rax            # imm = 0x188
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0x19e17
movq (%rax), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %rbx
cmpq $0xc0, %rbx
jne 0x19df9
movl $0x98, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0x2a10c
addq $-0x30, %rbx
cmpq $0x38, %rbx
jne 0x19e29
movl $0x50, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0xe71c
addq $-0x18, %rbx
cmpq $-0x10, %rbx
jne 0x19e48
movb $0x1, %al
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x177c4(%rip), %rdi     # 0x31641
leaq 0x177d1(%rip), %rsi     # 0x31655
leaq 0x17865(%rip), %rcx     # 0x316f0
movl $0x725, %edx            # imm = 0x725
callq 0x5230
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x19f52
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x19f52
jmp 0x19f4f
jmp 0x19f70
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x19ef1
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x19ef1
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x19f73
movq 0xd8(%rsp), %rsi
jmp 0x19f61
jmp 0x19f70
jmp 0x19f6b
movq %rax, %rbx
jmp 0x19fe2
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x19fef
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x19fef
jmp 0x19f47
movq %rax, %rbx
jmp 0x19fef
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x19f73
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x19f73
movq %rax, %rbx
jmp 0x19f99
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xe71c
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x19f99
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq $-0x40, %r14
leaq 0x170(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x19fbc
movq (%r15), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r15
addq $0x20, %r14
jne 0x19fa8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x19fe2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0xe8(%rsp), %rdi
callq 0x286da
leaq 0x188(%rsp), %rdi
callq 0x290d4
movq %rbx, %rdi
callq 0x55c0