// File: /workspace/github_cpp_makefile_star2_O1/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 0x2935c
cmpl $-0x9, 0x358(%rsp)
jne 0x19bad
leaq 0x188(%rsp), %rsi
movq 0x168(%rsi), %rax
movl $0xfffffff7, (%rax,%rbp,4) # imm = 0xFFFFFFF7
movq %r14, %rdi
callq 0x2e600
movq %rax, %rdi
movq %r14, %rsi
callq 0x5070
incq 0x10(%r14)
jmp 0x1a15b
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 0x112ce
addq %rbp, %rbx
leaq 0x110(%rsp), %rdi
leaq 0x28(%rbx), %rsi
callq 0x289ec
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 0x112ce
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 0x19c51
movl 0x358(%rsp), %eax
cmpl $0x1, %eax
ja 0x19c9e
movl %eax, %esi
shlq $0x5, %rsi
addq 0x110(%rsp), %rsi
leaq 0x140(%rsp), %rdi
callq 0x51c0
jmp 0x19ce5
movq 0x2232b(%rip), %rbp     # 0x3bfd0
leaq 0x17951(%rip), %rsi     # 0x315fd
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 0x222f8(%rip), %rdi     # 0x3bfd0
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 0x176ee
addl %eax, 0x2e0(%rsp)
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x19d39
movq 0x10(%rsp), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x5610
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %rbx
jne 0x19d23
movq 0x148(%rsp), %rbx
testq %rbx, %rbx
je 0x19d67
movq 0x140(%rsp), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x5610
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %rbx
jne 0x19d51
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x140(%rsp), %rsi
movq 0x148(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x112ce
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 0x112ce
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x112ce
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x13f5e
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x19e22
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x19e3f
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x18(%rsp), %rax
decq %rax
je 0x19eb3
cmpb $0x0, 0x7(%rsp)
movl $0x38, %eax
movl $0x8, %ebx
cmovneq %rax, %rbx
movslq %r13d, %r15
shlq $0x5, %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x30(%rsp), %rax
leaq (%rax,%r12), %rsi
cmpq $0x1, 0x8(%rax,%r12)
jne 0x19e88
movq 0x10(%rsp), %rax
movb (%rax,%rbp), %al
movq (%rsi), %rcx
cmpb (%rcx), %al
je 0x19e9b
movq 0x188(%rsp,%rbx), %rdi
addq %r15, %rdi
addq %r12, %rdi
callq 0x51c0
incq %rbp
movq 0x18(%rsp), %rax
decq %rax
addq $0x20, %r12
cmpq %rbp, %rax
ja 0x19e68
movl %ebp, %ebx
jmp 0x19eb7
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpq %rbp, %rax
jne 0x1a1fa
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 0x112ce
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x19f4a
cmpq $0x1, %rax
jne 0x19f9c
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 0x1a079
cmpb $0x0, 0x7(%rsp)
leaq 0x1c0(%rsp), %rax
leaq 0x190(%rsp), %r15
cmovneq %rax, %r15
addl %r13d, %ebx
movslq %ebx, %r13
jmp 0x1a056
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 0x17642(%rip), %rcx     # 0x315c2
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x54b0
movq 0x8(%rsp), %rbp
movl 0x358(%rsp), %r15d
jmp 0x1a079
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 0x1a062
leaq 0x17a72(%rip), %rsi     # 0x31a56
callq 0x50e0
testl %eax, %eax
movq 0x8(%rsp), %rbp
je 0x1a056
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 0x1a079
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1a079
shlq $0x5, %r13
addq (%r15), %r13
movq %r13, %rdi
jmp 0x1a067
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 0x2e600
movq %rax, %rdi
movq %r14, %rsi
callq 0x5070
incq 0x10(%r14)
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a0ba
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x30(%rsp), %rdi
callq 0xe7ca
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x1a0e0
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq $-0x40, %rbx
leaq 0x170(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x1a103
movq (%r14), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x1a0ef
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1a129
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x110(%rsp), %rdi
callq 0xe7ca
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x1a15b
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x2f0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a178
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 0x1a19b
movq (%rax), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %rbx
cmpq $0xc0, %rbx
jne 0x1a17d
movl $0x98, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0x2a5c6
addq $-0x30, %rbx
cmpq $0x38, %rbx
jne 0x1a1ad
movl $0x50, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0xe7ca
addq $-0x18, %rbx
cmpq $-0x10, %rbx
jne 0x1a1cc
movb $0x1, %al
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17410(%rip), %rdi     # 0x31611
leaq 0x1741d(%rip), %rsi     # 0x31625
leaq 0x174b1(%rip), %rcx     # 0x316c0
movl $0x725, %edx            # imm = 0x725
callq 0x5230
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a2d6
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1a2d6
jmp 0x1a2d3
jmp 0x1a2f4
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1a275
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1a275
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a2f7
movq 0xd8(%rsp), %rsi
jmp 0x1a2e5
jmp 0x1a2f4
jmp 0x1a2ef
movq %rax, %rbx
jmp 0x1a366
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x1a373
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1a373
jmp 0x1a2cb
movq %rax, %rbx
jmp 0x1a373
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a2f7
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1a2f7
movq %rax, %rbx
jmp 0x1a31d
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xe7ca
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x1a31d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x5340
movq $-0x40, %r14
leaq 0x170(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x1a340
movq (%r15), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r15
addq $0x20, %r14
jne 0x1a32c
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1a366
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0xe8(%rsp), %rdi
callq 0x28b44
leaq 0x188(%rsp), %rdi
callq 0x29560
movq %rbx, %rdi
callq 0x55c0