// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0xe0, %rsp
movl %esi, %ebx
movq %rdi, %r15
leaq 0xd9c2(%rip), %r14      # 0x12f4c
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rdx
movq %r14, %rsi
callq 0x4120
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
movq %r14, %rsi
callq 0x4120
leaq 0xd998(%rip), %rsi      # 0x12f4c
leaq -0xa0(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x4120
leaq 0x10(%r15), %r14
testb %bl, %bl
je 0x560d
movq 0x18(%r15), %rdx
leaq 0x16045(%rip), %rax     # 0x1b61c
movslq (%rax), %rax
subq %rax, %rdx
leaq -0x40(%rbp), %rdi
pushq $-0x1
popq %rcx
movq %r14, %rsi
callq 0x4330
leaq -0x80(%rbp), %rdi
leaq -0x40(%rbp), %r12
movq %r12, %rsi
callq 0x4390
movq %r12, %rdi
callq 0x4160
leaq 0xd5e3(%rip), %rsi      # 0x12bee
jmp 0x5644
leaq 0x16008(%rip), %rax     # 0x1b61c
movslq (%rax), %rcx
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4330
leaq -0x80(%rbp), %rdi
leaq -0x40(%rbp), %r12
movq %r12, %rsi
callq 0x4390
movq %r12, %rdi
callq 0x4160
leaq 0xd5b1(%rip), %rsi      # 0x12bf5
leaq -0xa0(%rbp), %rdi
callq 0x4600
movq 0x8(%r15), %r12
leaq -0x100(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4410
movzbl %bl, %ecx
leaq -0x40(%rbp), %rdi
leaq -0x100(%rbp), %rdx
movq %r12, %rsi
callq 0xfa52
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %r12
movq %r12, %rsi
callq 0x4390
movq %r12, %rdi
callq 0x4160
leaq -0x100(%rbp), %rdi
callq 0x4160
leaq 0x15fb3(%rip), %rax     # 0x1b658
cmpl $0x0, (%rax)
je 0x5743
leaq 0x15fb3(%rip), %rdi     # 0x1b668
callq 0x5f74
callq 0x81fe
movq %rax, %r12
addq $0x30, %r15
leaq -0xc0(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
movq %r15, %rsi
callq 0x5a99
leaq 0xd51a(%rip), %rdx      # 0x12bfd
leaq -0x40(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x5a70
leaq -0xe0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x5a47
leaq -0xe0(%rbp), %rsi
movq %r12, %rdi
callq 0x83ae
leaq -0xe0(%rbp), %rdi
callq 0x4160
leaq -0x40(%rbp), %rdi
callq 0x4160
leaq -0xc0(%rbp), %rdi
callq 0x4160
leaq 0x15f2a(%rip), %rdi     # 0x1b668
callq 0x4260
cmpq $0x0, -0x58(%rbp)
je 0x576a
testb %bl, %bl
je 0x575c
leaq -0x60(%rbp), %rsi
movq %r14, %rdi
callq 0x4630
jmp 0x576a
leaq -0x60(%rbp), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x4500
leaq -0xa0(%rbp), %rdi
callq 0x4160
leaq -0x80(%rbp), %rdi
callq 0x4160
leaq -0x60(%rbp), %rdi
callq 0x4160
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x57fe
jmp 0x57fe
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x4160
jmp 0x57b0
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x4160
jmp 0x57be
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x4160
jmp 0x57d1
jmp 0x57ce
movq %rax, %rbx
leaq 0x15e90(%rip), %rdi     # 0x1b668
callq 0x4260
jmp 0x5801
jmp 0x57fe
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x4160
jmp 0x5801
jmp 0x57fe
movq %rax, %rbx
jmp 0x580d
movq %rax, %rbx
jmp 0x5816
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x4160
leaq -0x80(%rbp), %rdi
callq 0x4160
leaq -0x60(%rbp), %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x4590
nop