// File: /workspace/github_cpp_makefile_star2_O1/lrq3000[P]rfrb/./src/fileWriter.cpp
// Function: FileWriter::writeAsync()
bool FileWriter::writeAsync()
{
	auto lambda = [&] () -> void
	{
		write();
		localMtx.unlock();
	};

	localMtx.lock();
	char *tmp = writeBuffer;
	writeBuffer = workBuffer;
	workBuffer = tmp;
	toWrite = pos;
	pos = 0;
	//Threads are started with the lambda function
	futureObj = std::async(std::launch::async, lambda);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
addq $0x258, %rdi            # imm = 0x258
callq 0x5540
testl %eax, %eax
jne 0x12cae
movdqu 0x290(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x290(%rbx)
movq 0x248(%rbx), %rax
movq %rax, 0x250(%rbx)
movq $0x0, 0x248(%rbx)
pxor %xmm0, %xmm0
movdqa %xmm0, (%rsp)
movl $0x50, %edi
callq 0x53d0
movq %rax, %r14
movabsq $0x100000001, %r12      # imm = 0x100000001
movq %r12, 0x8(%rax)
leaq 0xc0c2(%rip), %rax      # 0x1eba8
movq %rax, (%r14)
leaq 0x10(%r14), %r15
xorl %eax, %eax
movl %eax, 0x28(%r14)
movq %rax, 0x18(%r14)
movq %rax, 0x1d(%r14)
movq %rax, 0x30(%r14)
movl %eax, 0x38(%r14)
leaq 0xc0ee(%rip), %rax      # 0x1ebf8
movq %rax, 0x10(%r14)
movl $0x10, %edi
callq 0x53d0
movq %rax, %r13
pxor %xmm0, %xmm0
movdqa %xmm0, (%rax)
movq %rax, %rdi
callq 0x5200
leaq 0xc1f6(%rip), %rbp      # 0x1ed28
movq %rbp, (%r13)
movq %r13, 0x40(%r14)
movq %rbx, 0x48(%r14)
movq $0x0, 0x10(%rsp)
movl $0x20, %edi
callq 0x53d0
leaq 0xc0f8(%rip), %rcx      # 0x1ec50
movq %rcx, (%rax)
movq %r15, 0x8(%rax)
leaq 0x590(%rip), %rcx       # 0x130f6
movq %rcx, 0x10(%rax)
movq $0x0, 0x18(%rax)
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x5340
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x12b96
movq (%rdi), %rax
callq *0x8(%rax)
cmpq $0x0, 0x30(%r14)
jne 0x12cb5
movq 0x10(%rsp), %rax
movq %rax, 0x30(%r14)
movq %r15, (%rsp)
movq 0x8(%rsp), %rdi
movq %r14, 0x8(%rsp)
testq %rdi, %rdi
je 0x12bc2
callq 0xe634
cmpq $0x0, (%rsp)
jne 0x12c4d
movl $0x40, %edi
callq 0x53d0
movq %rax, %r14
movq %r12, 0x8(%rax)
leaq 0xc0ab(%rip), %rax      # 0x1ec90
movq %rax, (%r14)
movq %r14, %r15
addq $0x10, %r15
movl $0x0, 0x28(%r14)
xorl %eax, %eax
movq %rax, 0x18(%r14)
movq %rax, 0x1d(%r14)
leaq 0xc0d8(%rip), %rax      # 0x1ece0
movq %rax, 0x10(%r14)
movl $0x10, %edi
callq 0x53d0
movq %rax, %r12
pxor %xmm0, %xmm0
movdqa %xmm0, (%rax)
movq %rax, %rdi
callq 0x5200
movq %rbp, (%r12)
movq %r12, 0x30(%r14)
movq %rbx, 0x38(%r14)
movq %r15, (%rsp)
movq 0x8(%rsp), %rdi
movq %r14, 0x8(%rsp)
testq %rdi, %rdi
je 0x12c4d
callq 0xe634
leaq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x134ec
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12c69
callq 0xe634
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x288(%rbx), %rdi
movups %xmm0, 0x280(%rbx)
testq %rdi, %rdi
je 0x12c8e
callq 0xe634
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12c9d
callq 0xe634
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x5240
callq 0x50e0
movq %rax, %rbx
movq %r12, %rdi
callq 0x5390
jmp 0x12cca
movq %rax, %rbx
movq %r15, %rdi
callq 0xedca
movq %r14, %rdi
callq 0x5390
jmp 0x12d87
jmp 0x12ce1
movq %rax, %rbx
jmp 0x12d87
movq %rdx, %r12
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x12cff
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x20(%rsp)
jmp 0x12d10
movq %rdx, %r12
movq %rax, %rbx
movq %r14, %rdi
addq $0x40, %rdi
callq 0x134b2
jmp 0x12d34
movq %rdx, %r12
movq %rax, %rbx
movq %r13, %rdi
callq 0x5390
jmp 0x12d34
movq %rdx, %r12
movq %rax, %rbx
movq %r15, %rdi
callq 0xed9c
movq %r14, %rdi
callq 0x5390
jmp 0x12d4c
movq %rdx, %r12
movq %rax, %rbx
cmpl $0x1, %r12d
jne 0x12d87
movq %rbx, %rdi
callq 0x5150
leaq 0x10(%rax), %rbx
callq 0x51b0
leaq 0x10(%rsp), %rsi
movl $0xb, (%rsi)
movq %rax, 0x8(%rsi)
movq %rbx, %rdi
callq 0xecdb
callq 0x5530
movq %rax, %rbx
callq 0x55e0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12d96
callq 0xe634
movq %rbx, %rdi
callq 0x5650
movq %rax, %rdi
callq 0xe6a3