// File: /workspace/github_cpp_makefile_star2_O1/enbock[P]Warp10Server/ulib/src/Thread.cpp
// Function: u::ThreadSystem::create(u::Callback*)
bool ThreadSystem::create(Callback *cb)
{
	_access.lock();
	if(isTerminating) {
		_access.unlock();
		return false;
	}

	Thread *t = new Thread(cb);

	_build.push_back(t);
	_access.unlock();

#ifndef NDEBUG
	trace(
		"\033[0mThreadSystem::create: " + Object::ptr2string(cb)
		 + " -> " +  Object::ptr2string(&(t->_call))
		 //+ "\n\033[37m" + ThreadSystem::toString()
	);
#endif

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rdi, %r14
leaq 0x202d6e(%rip), %rdi    # 0x60e6b0
callq 0x4098c2
movb 0x202d5c(%rip), %bl     # 0x60e6a9
cmpb $0x1, %bl
jne 0x40b963
leaq 0x202d57(%rip), %rdi    # 0x60e6b0
callq 0x40987a
jmp 0x40bc59
movl $0x98, %edi
callq 0x40eea0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x40af2c
movq %r15, 0x48(%rsp)
movq 0x202da1(%rip), %rsi    # 0x60e728
cmpq 0x202da2(%rip), %rsi    # 0x60e730
je 0x40b99d
movq %r15, (%rsi)
addq $0x8, 0x202d8d(%rip)    # 0x60e728
jmp 0x40b9ae
leaq 0x202d7c(%rip), %rdi    # 0x60e720
leaq 0x48(%rsp), %rdx
callq 0x40d952
leaq 0x202cfb(%rip), %rdi    # 0x60e6b0
callq 0x40987a
movq $0x60f6a0, %rdi         # imm = 0x60F6A0
leaq 0x18d6b1(%rip), %rsi    # 0x599079
movl $0x4, %edx
callq 0x477930
leaq 0xc8(%rsp), %rdi
movq %r14, %rsi
callq 0x409c72
leaq 0x100(%rsp), %rdi
leaq 0x18daef(%rip), %rcx    # 0x5994e0
movl $0x1a, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x488d50
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40ba27
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x40ba2e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x50(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x18d79b(%rip), %rsi    # 0x5991ec
callq 0x489510
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40ba7e
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x40ba86
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x409c72
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0xb0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x40bad2
movq 0x38(%rsp), %rsi
leaq 0xb8(%rsp), %r13
cmpq %rsi, %rax
jbe 0x40bafb
movl $0xf, %esi
cmpq %r13, 0xa8(%rsp)
je 0x40baf6
movq 0xb8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x40bb0f
movq 0xa8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x4893d0
jmp 0x40bb20
leaq 0xa8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x488d50
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x40bb44
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x40bb4a
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq $0x60f6a0, %rdi         # imm = 0x60F6A0
callq 0x477930
movq %rax, %r14
leaq 0x18d4fe(%rip), %rsi    # 0x599085
movl $0x4, %edx
movq %rax, %rdi
callq 0x477930
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x458a80
movsbl %al, %esi
movq %r14, %rdi
callq 0x477430
movq %rax, %rdi
callq 0x476a00
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40bbd6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40dd10
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x40bbf3
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x40dd10
leaq 0x70(%rsp), %rdi
callq 0x4099d0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x40bc14
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40dd10
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x40bc2b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x40dd10
leaq 0x110(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40bc4c
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x40dd10
leaq 0xc8(%rsp), %rdi
callq 0x4099d0
xorb $0x1, %bl
movl %ebx, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x40bcb3
movq %rax, %rbx
jmp 0x40bcbd
movq %rax, %rbx
jmp 0x40bcd4
movq %rax, %rbx
jmp 0x40bceb
movq %rax, %rbx
movl $0x98, %esi
movq %r15, %rdi
callq 0x40dd10
jmp 0x40bcf8
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40bcb3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40dd10
leaq 0x70(%rsp), %rdi
callq 0x404a8a
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x40bcd4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40dd10
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x40bceb
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x40dd10
leaq 0xc8(%rsp), %rdi
callq 0x404a8a
movq %rbx, %rdi
callq 0x4b7f40