// File: ncbi[P]amr/common.cpp
// Function: Common_sp::Threads::Threads(unsigned long, bool)
Threads::Threads (size_t threadsToStart_arg, 
                  bool quiet_arg)
{ 
  if (! isMainThread ())
	  throw logic_error ("Threads are started not from the main thread");
  if (! empty ())
	  throw logic_error ("Previous threads have not finished");

	threadsToStart = threadsToStart_arg;
	if (threadsToStart >= threads_max)
		throw logic_error ("Too many threads to start");
		
  quiet = quiet_arg;
		
	threads. reserve (threadsToStart);
	
	if (! quiet && verbose (1) && threadsToStart)
	{
    const OColor c (cerr, Color::green, false, true);  // Cf. Progress::report() 
    cerr << "# Threads started: " << threadsToStart + 1/*main thread*/ << endl;
  }
}

// Assembly:
subq $0x88, %rsp
movb %dl, %al
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
andb $0x1, %al
movb %al, 0x77(%rsp)
movq 0x80(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
callq 0x74290
movq 0x40(%rsp), %rdi
callq 0x74320
callq 0x3d180
movb %al, 0x4f(%rsp)
jmp 0x4b76b
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x4b7e5
jmp 0x4b775
movl $0x10, %edi
callq 0xc3b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x30(%rsp)
leaq 0x82b5b(%rip), %rsi     # 0xce2ec
callq 0xca70
jmp 0x4b798
movq 0x30(%rsp), %rdi
movq 0xba824(%rip), %rsi     # 0x105fc8
movq 0xba7d5(%rip), %rdx     # 0x105f80
callq 0xcc80
jmp 0x4b9d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0x4b9bb
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
callq 0xc580
jmp 0x4b9bb
callq 0x74330
movb %al, 0x2f(%rsp)
jmp 0x4b7f0
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x4b857
jmp 0x4b7fa
movl $0x10, %edi
callq 0xc3b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x20(%rsp)
leaq 0x82b03(%rip), %rsi     # 0xce319
callq 0xca70
jmp 0x4b81d
movq 0x20(%rsp), %rdi
movq 0xba79f(%rip), %rsi     # 0x105fc8
movq 0xba750(%rip), %rdx     # 0x105f80
callq 0xcc80
jmp 0x4b9d9
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
callq 0xc580
jmp 0x4b9bb
movq 0x78(%rsp), %rax
movq %rax, 0xbb45d(%rip)     # 0x106cc0
movq 0xbb456(%rip), %rax     # 0x106cc0
cmpq 0xbaf07(%rip), %rax     # 0x106778
jb 0x4b8d0
movl $0x10, %edi
callq 0xc3b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
leaq 0x82aad(%rip), %rsi     # 0xce33c
callq 0xca70
jmp 0x4b896
movq 0x18(%rsp), %rdi
movq 0xba726(%rip), %rsi     # 0x105fc8
movq 0xba6d7(%rip), %rdx     # 0x105f80
callq 0xcc80
jmp 0x4b9d9
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
callq 0xc580
jmp 0x4b9bb
movq 0x38(%rsp), %rdi
movb 0x77(%rsp), %al
andb $0x1, %al
movb %al, 0xbb3e7(%rip)      # 0x106cc8
movq 0xbb3d8(%rip), %rsi     # 0x106cc0
callq 0x74340
jmp 0x4b8ef
testb $0x1, 0xbb3d2(%rip)     # 0x106cc8
jne 0x4b9b3
movl $0x1, %edi
callq 0x4a800
movb %al, 0x17(%rsp)
jmp 0x4b90c
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x4b919
jmp 0x4b9b3
cmpq $0x0, 0xbb39f(%rip)     # 0x106cc0
je 0x4b9b3
movq 0xba6ba(%rip), %rsi     # 0x105fe8
leaq 0x50(%rsp), %rdi
movl $0x20, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x30fc0
jmp 0x4b947
movq 0xba69a(%rip), %rdi     # 0x105fe8
leaq 0x82a01(%rip), %rsi     # 0xce356
callq 0xc6f0
movq %rax, 0x8(%rsp)
jmp 0x4b961
movq 0x8(%rsp), %rdi
movq 0xbb353(%rip), %rsi     # 0x106cc0
incq %rsi
callq 0xc160
movq %rax, (%rsp)
jmp 0x4b97b
movq (%rsp), %rdi
movq 0xba5ba(%rip), %rsi     # 0x105f40
callq 0xc760
jmp 0x4b98d
leaq 0x50(%rsp), %rdi
callq 0x310f0
jmp 0x4b9b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x310f0
jmp 0x4b9bb
addq $0x88, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x74450
movq 0x38(%rsp), %rdi
callq 0x744b0
movq 0x68(%rsp), %rdi
callq 0xccf0
nopl (%rax)