// File: 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
subq $0x1d0, %rsp            # imm = 0x1D0
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x46e0
movq -0x190(%rbp), %rdx
leaq 0x262c8(%rip), %rsi     # 0x2c1b8
leaq -0x30(%rbp), %rdi
callq 0x4530
jmp 0x5efb
leaq -0x31(%rbp), %rdi
callq 0x4420
leaq -0x69(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x46e0
movq -0x1a0(%rbp), %rdx
leaq 0x26296(%rip), %rsi     # 0x2c1b8
leaq -0x68(%rbp), %rdi
callq 0x4530
jmp 0x5f2d
leaq -0x69(%rbp), %rdi
callq 0x4420
leaq -0x91(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x46e0
movq -0x1a8(%rbp), %rdx
leaq 0x26261(%rip), %rsi     # 0x2c1b8
leaq -0x90(%rbp), %rdi
callq 0x4530
jmp 0x5f65
leaq -0x91(%rbp), %rdi
callq 0x4420
testb $0x1, -0x9(%rbp)
je 0x605d
movq -0x198(%rbp), %rdi
addq $0x10, %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x45e0
movq -0x1b0(%rbp), %rsi
movq %rax, %rdx
leaq 0x38719(%rip), %rax     # 0x3e6bc
movslq (%rax), %rax
subq %rax, %rdx
leaq -0xb8(%rbp), %rdi
movq $-0x1, %rcx
callq 0x43e0
jmp 0x5fbe
leaq -0x68(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movq %rsi, -0x1b8(%rbp)
callq 0x4480
movq -0x1b8(%rbp), %rdi
callq 0x4270
leaq 0x25d92(%rip), %rsi     # 0x2bd7a
leaq -0x90(%rbp), %rdi
callq 0x4520
jmp 0x5ff6
jmp 0x60be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x4420
jmp 0x632b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x4420
jmp 0x6322
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x4420
jmp 0x6319
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x630d
movq -0x198(%rbp), %rsi
addq $0x10, %rsi
leaq 0x3864d(%rip), %rax     # 0x3e6bc
movslq (%rax), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0xd8(%rbp), %rdi
callq 0x43e0
jmp 0x6084
leaq -0x68(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
movq %rsi, -0x1c0(%rbp)
callq 0x4480
movq -0x1c0(%rbp), %rdi
callq 0x4270
leaq 0x25cd3(%rip), %rsi     # 0x2bd81
leaq -0x90(%rbp), %rdi
callq 0x4520
jmp 0x60bc
jmp 0x60be
movq -0x198(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x41b0
jmp 0x60e2
movq -0x1c8(%rbp), %rsi
movzbl -0x9(%rbp), %ecx
andl $0x1, %ecx
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0x25850
jmp 0x6105
leaq -0x30(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x4480
leaq -0xf8(%rbp), %rdi
callq 0x4270
leaq -0x118(%rbp), %rdi
callq 0x4270
leaq 0x385c4(%rip), %rax     # 0x3e6f8
cmpl $0x0, (%rax)
je 0x6287
leaq 0x385c4(%rip), %rsi     # 0x3e708
leaq -0x120(%rbp), %rdi
callq 0x69e0
jmp 0x6152
callq 0x100d0
movq %rax, -0x1d0(%rbp)
jmp 0x6160
movq -0x198(%rbp), %rsi
addq $0x30, %rsi
leaq -0x180(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x6ab0
jmp 0x6180
leaq 0x25c02(%rip), %rdx     # 0x2bd89
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x6a60
jmp 0x619c
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x6a10
jmp 0x61b5
movq -0x1d0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x10460
jmp 0x61ca
leaq -0x140(%rbp), %rdi
callq 0x4270
leaq -0x160(%rbp), %rdi
callq 0x4270
leaq -0x180(%rbp), %rdi
callq 0x4270
leaq -0x120(%rbp), %rdi
callq 0x6b30
jmp 0x6287
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x4270
jmp 0x630d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6276
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x626a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x625e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x4270
leaq -0x160(%rbp), %rdi
callq 0x4270
leaq -0x180(%rbp), %rdi
callq 0x4270
leaq -0x120(%rbp), %rdi
callq 0x6b30
jmp 0x630d
leaq -0x30(%rbp), %rdi
callq 0x45e0
cmpq $0x0, %rax
jne 0x62a2
movl $0x1, -0x184(%rbp)
jmp 0x62e6
testb $0x1, -0x9(%rbp)
je 0x62c0
movq -0x198(%rbp), %rdi
addq $0x10, %rdi
leaq -0x30(%rbp), %rsi
callq 0x4750
jmp 0x62be
jmp 0x62dc
movq -0x198(%rbp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdx
callq 0x4620
jmp 0x62da
jmp 0x62dc
movl $0x0, -0x184(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x4270
leaq -0x68(%rbp), %rdi
callq 0x4270
leaq -0x30(%rbp), %rdi
callq 0x4270
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0x4270
leaq -0x68(%rbp), %rdi
callq 0x4270
leaq -0x30(%rbp), %rdi
callq 0x4270
movq -0x40(%rbp), %rdi
callq 0x46c0
nopw %cs:(%rax,%rax)