// File: /workspace/github_cpp_makefile_star2_O2/afinit[P]afin/process.cpp
// Function: Process::run_manager()
void Process::run_manager(){
  // create thread array with max_thread entries
  vector<thread> t;
  Queue<int> qu;

  // loop max search loops
  for( int j=0; j<max_search_loops; j++ ){
    Log::Inst()->log_it( "Begin Extensions" );
      
    // initialize threads
    for( int i=0; i<max_threads; i++ ){
      t.push_back(thread( &Process::thread_worker, this, ref(qu), i ));
    }

    if( test_run ){
      Log::Inst()->log_it( "contigs.size(): " + to_string(contigs->get_list_size()) + " max_threads: " + to_string(max_threads) );
    }

    // push each thread onto queue
    for( int i=0; i<contigs->get_list_size(); i++ ){
      qu.push( i );
    }

    // push stop signals onto queue for each thread
    for( int i=0; i<max_threads; i++ ){
      qu.push( -1 );
    }

    // join threads
    for( int i=0; i<max_threads; i++ ){
      t[i].join();
    }

    // remove threads from vector
    t.erase( t.begin(), t.begin()+max_threads );

    // removed for master branch until algorithm can be adjusted
    if( ! no_fusion )
      fuse->run_fusion( false );
    
    if( test_run ){
      contigs->output_contigs( 0, outfile + ".fus" + to_string(j), "mid" );
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x70b6
leaq 0x18(%rbx), %rax
movq %rax, -0x58(%rbp)
xorl %eax, %eax
leaq -0x80(%rbp), %r15
leaq -0xe0(%rbp), %r13
movq %rax, -0x38(%rbp)
cmpl 0x14aae(%rip), %eax     # 0x1b618
jge 0x6e08
callq 0x81fe
movq %rax, %r12
leaq -0x160(%rbp), %r14
movq %r14, %rdi
leaq 0xc156(%rip), %rsi      # 0x12cdf
movq %r15, %rdx
callq 0x4120
movq %r12, %rdi
movq %r14, %rsi
callq 0x83ae
movq %r14, %rdi
callq 0x4160
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
cmpl 0x14a81(%rip), %eax     # 0x1b630
jge 0x6c0e
leaq 0x35e(%rip), %rax       # 0x6f16
movq %rax, -0x80(%rbp)
andq $0x0, -0x78(%rbp)
movq %rbx, -0xa0(%rbp)
leaq -0x208(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq %r13, %rdi
movq %r15, %rsi
leaq -0xa0(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
leaq -0x2c(%rbp), %r8
callq 0x70e6
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x792a
movq %r13, %rdi
callq 0x717e
movl -0x2c(%rbp), %eax
incl %eax
jmp 0x6ba6
cmpb $0x0, 0x14a33(%rip)     # 0x1b648
je 0x6cc8
callq 0x81fe
movq %rax, -0x60(%rbp)
movq 0x8(%rbx), %rdi
callq 0x107dc
leaq -0xa0(%rbp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0x7029
movq %r13, %rdi
leaq 0xc0a8(%rip), %rsi      # 0x12cf0
movq %r14, %rdx
callq 0x6ffb
movq %r15, %rdi
movq %r13, %rsi
leaq 0xc0a4(%rip), %rdx      # 0x12d01
callq 0x5a70
movl 0x149c8(%rip), %esi     # 0x1b630
leaq -0xc0(%rbp), %r14
movq %r14, %rdi
callq 0x7029
leaq -0x140(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x718e
movq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0x83ae
movq %r12, %rdi
callq 0x4160
leaq -0xc0(%rbp), %rdi
callq 0x4160
movq %r15, %rdi
callq 0x4160
movq %r13, %rdi
callq 0x4160
leaq -0xa0(%rbp), %rdi
callq 0x4160
xorl %r14d, %r14d
movl %r14d, -0x80(%rbp)
movq 0x8(%rbx), %rdi
callq 0x107dc
cmpl %eax, %r14d
jge 0x6cf5
leaq -0x208(%rbp), %rdi
movq %r15, %rsi
callq 0x7200
movl -0x80(%rbp), %r14d
incl %r14d
jmp 0x6ccb
xorl %r14d, %r14d
movl 0x14932(%rip), %eax     # 0x1b630
cmpl %eax, %r14d
jge 0x6d1b
orl $-0x1, -0x80(%rbp)
leaq -0x208(%rbp), %rdi
movq %r15, %rsi
callq 0x7200
incl %r14d
jmp 0x6cf8
xorl %r12d, %r12d
xorl %r14d, %r14d
cltq
movq -0x50(%rbp), %rsi
cmpq %rax, %r14
jge 0x6d46
addq %r12, %rsi
movq %rsi, %rdi
callq 0x4560
incq %r14
movl 0x148f0(%rip), %eax     # 0x1b630
addq $0x8, %r12
jmp 0x6d21
leaq (%rsi,%rax,8), %rdx
leaq -0x50(%rbp), %rdi
callq 0x7264
cmpl $0x0, 0x14902(%rip)     # 0x1b65c
jne 0x6d67
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq 0xab86
cmpb $0x1, 0x148da(%rip)     # 0x1b648
jne 0x6dfd
movq 0x8(%rbx), %r14
movq %r15, %rdi
movq -0x58(%rbp), %rsi
leaq 0xbf50(%rip), %rdx      # 0x12cd6
callq 0x6fc3
movq %r13, %rdi
movq -0x38(%rbp), %rsi
callq 0x7029
leaq -0x100(%rbp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x718e
leaq -0x120(%rbp), %r12
movq %r12, %rdi
leaq 0xbf21(%rip), %rsi      # 0x12cdb
leaq -0xa0(%rbp), %rdx
callq 0x4120
movq %r14, %rdi
xorl %esi, %esi
leaq -0x100(%rbp), %r14
movq %r14, %rdx
movq %r12, %rcx
callq 0x108e8
movq %r12, %rdi
callq 0x4160
movq %r14, %rdi
callq 0x4160
movq %r13, %rdi
callq 0x4160
movq %r15, %rdi
callq 0x4160
movq -0x38(%rbp), %rax
incl %eax
jmp 0x6b60
leaq -0x208(%rbp), %rdi
callq 0x726e
leaq -0x50(%rbp), %rdi
callq 0x728e
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x6f04
movq %rax, %rbx
jmp 0x6e61
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x4160
jmp 0x6e55
jmp 0x6ef5
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x4160
leaq -0xe0(%rbp), %rdi
callq 0x4160
jmp 0x6e72
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
jmp 0x6ed3
movq %rax, %rbx
jmp 0x6e9d
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x4160
jmp 0x6e91
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x4160
leaq -0x80(%rbp), %rdi
callq 0x4160
jmp 0x6eab
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x4160
jmp 0x6ebc
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
jmp 0x6ed3
jmp 0x6ef5
jmp 0x6ef5
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x4160
jmp 0x6ef8
jmp 0x6ef5
jmp 0x6ef5
jmp 0x6ef5
jmp 0x6ef5
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x717e
jmp 0x6ef8
jmp 0x6ef5
movq %rax, %rbx
leaq -0x208(%rbp), %rdi
callq 0x726e
leaq -0x50(%rbp), %rdi
callq 0x728e
movq %rbx, %rdi
callq 0x4590
nop