// File: /workspace/github_cpp_makefile_star2_O1/afinit[P]afin/contig.cpp
// Function: Contig::extend(bool)
void Contig::extend( bool back ){
  string exten_seq("");
  string contig_sub("");
  string contig_end("");
 
  // get extension sequence through get_extension
  if( back ){
    contig_sub = contig.substr( contig.length() - ( contig_sub_len ) );
    contig_end = " rear ";
  }
  else{
    contig_sub = contig.substr( 0, contig_sub_len );
    contig_end = " front ";
  }

  exten_seq = extension->get_extension( contig_sub, back );
  
  if( verbose ){
    lock_guard<mutex> lk_g(log_mut);
    Log::Inst()->log_it( contig_id + contig_end + "extension: " + exten_seq );
  }

  if( exten_seq.length() == 0 ){
    return;
  }

  if( back ){
    contig.append( exten_seq );
  }
  else{
    contig.insert( 0, exten_seq );
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %esi, %ebx
movq %rdi, %r15
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1024e(%rip), %r14     # 0x15f4c
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x6b5c
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x90(%rbp), %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x6b5c
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x10213(%rip), %rdx     # 0x15f4c
leaq -0xb0(%rbp), %rdi
movq %rdx, %rsi
callq 0x6b5c
leaq 0x10(%r15), %rsi
testb %bl, %bl
movq %rsi, -0x50(%rbp)
je 0x5da9
movq 0x18(%r15), %rdx
leaq 0x178ad(%rip), %rax     # 0x1d60c
movslq (%rax), %rax
subq %rax, %rdx
leaq -0x48(%rbp), %rdi
movq $-0x1, %rcx
callq 0x4330
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %r12
movq %r12, %rsi
callq 0x43b0
movq (%r12), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x5d9a
callq 0x42f0
movl $0x6, %r8d
leaq 0xfe47(%rip), %rcx      # 0x15bee
jmp 0x5df0
leaq 0x1785c(%rip), %rax     # 0x1d60c
movslq (%rax), %rcx
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x4330
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %r12
movq %r12, %rsi
callq 0x43b0
movq (%r12), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x5de3
callq 0x42f0
movl $0x7, %r8d
leaq 0xfe05(%rip), %rcx      # 0x15bf5
leaq -0xb0(%rbp), %rdi
movq 0x8(%rdi), %rdx
xorl %esi, %esi
callq 0x44f0
movq 0x8(%r15), %r12
leaq -0xe0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x6876
movzbl %bl, %ecx
leaq -0x48(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
movq %r12, %rsi
callq 0x12bac
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %r12
movq %r12, %rsi
callq 0x43b0
movq (%r12), %rdi
leaq -0x38(%rbp), %r13
cmpq %r13, %rdi
je 0x5e66
callq 0x42f0
movq -0xf0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5e77
callq 0x42f0
leaq 0x177ca(%rip), %rax     # 0x1d648
cmpl $0x0, (%rax)
je 0x5fba
leaq 0x177ca(%rip), %rdi     # 0x1d658
callq 0x4490
testl %eax, %eax
jne 0x603a
callq 0x9626
movq %rax, %r12
addq $0x30, %r15
leaq -0x110(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
movq %r15, %rsi
callq 0x634c
leaq 0xfd39(%rip), %rsi      # 0x15bfd
leaq -0x110(%rbp), %rdi
callq 0x45f0
movq %r13, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5ef0
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x5ef8
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x48(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x40f0
leaq -0xc0(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5f4d
movq %rdx, -0xd0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc0(%rbp)
jmp 0x5f54
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0xd0(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r12, %rdi
callq 0x9846
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5f8b
callq 0x42f0
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x5f99
callq 0x42f0
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5fae
callq 0x42f0
leaq 0x176a3(%rip), %rdi     # 0x1d658
callq 0x4260
movq -0x68(%rbp), %r8
testq %r8, %r8
je 0x5fe9
movq -0x70(%rbp), %rcx
testb %bl, %bl
je 0x5fdc
movq -0x50(%rbp), %rdi
movq %rcx, %rsi
movq %r8, %rdx
callq 0x40f0
jmp 0x5fe9
movq -0x50(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4350
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x6001
callq 0x42f0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x6016
callq 0x42f0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x6028
callq 0x42f0
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x41f0
jmp 0x60bf
jmp 0x60bf
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x605e
callq 0x42f0
jmp 0x605e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x6071
callq 0x42f0
jmp 0x6071
movq %rax, %rbx
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x608d
callq 0x42f0
jmp 0x608d
jmp 0x608a
movq %rax, %rbx
leaq 0x175c4(%rip), %rdi     # 0x1d658
callq 0x4260
jmp 0x60c2
jmp 0x60bf
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r14, %rdi
je 0x60c2
callq 0x42f0
jmp 0x60c2
jmp 0x60bf
movq %rax, %rbx
jmp 0x60da
movq %rax, %rbx
jmp 0x60ef
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x60da
callq 0x42f0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x60ef
callq 0x42f0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x6101
callq 0x42f0
movq %rbx, %rdi
callq 0x4590
nop