// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %r15
addq $0x258, %rdi            # imm = 0x258
callq 0x5540
testl %eax, %eax
jne 0x11fa4
movdqu 0x290(%r15), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x290(%r15)
movq 0x248(%r15), %rax
movq %rax, 0x250(%r15)
movq $0x0, 0x248(%r15)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x20(%rsp)
movl $0x50, %edi
callq 0x53d0
movq %rax, %rbx
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%rbx)
leaq 0xadbe(%rip), %rax      # 0x1cc40
movq %rax, (%rbx)
leaq 0x10(%rbx), %r14
xorl %eax, %eax
movq %rax, 0x18(%rbx)
movl %eax, 0x20(%rbx)
movb $0x0, 0x24(%rbx)
movl %eax, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movl %eax, 0x38(%rbx)
leaq 0xade9(%rip), %rax      # 0x1cc90
movq %rax, 0x10(%rbx)
movl $0x10, %edi
callq 0x53d0
movq %rax, %r13
pxor %xmm0, %xmm0
movdqa %xmm0, (%rax)
movq %rax, %rdi
callq 0x5200
leaq 0xae59(%rip), %rax      # 0x1cd28
movq %rax, (%r13)
movq %r13, 0x40(%rbx)
movq %r15, 0x48(%rbx)
movq $0x0, (%rsp)
movl $0x20, %edi
callq 0x53d0
leaq 0xadf4(%rip), %rcx      # 0x1cce8
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
leaq 0x4b2(%rip), %rcx       # 0x123b4
movq %rcx, 0x10(%rax)
movq $0x0, 0x18(%rax)
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movq %rsp, %rdi
xorl %edx, %edx
callq 0x5340
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x11f30
movq (%rdi), %rax
callq *0x8(%rax)
cmpq $0x0, 0x30(%rbx)
jne 0x11fab
movq %rsp, %rdi
movq (%rdi), %rax
movq %rax, 0x30(%rbx)
leaq 0x20(%rsp), %rsi
movq %r14, (%rsi)
movq %rbx, 0x8(%rsi)
callq 0x12636
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x11f61
callq 0xde06
movaps (%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%rsp)
movq 0x288(%r15), %rdi
movups %xmm0, 0x280(%r15)
testq %rdi, %rdi
je 0x11f94
callq 0xde06
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11f94
callq 0xde06
movb $0x1, %al
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x5240
callq 0x50e0
movq %rax, %r15
jmp 0x1204b
movq %rdx, %r12
movq %rax, %r15
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x11fd6
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x11fd6
movq %rdx, %r12
movq %rax, %r15
movq %rbx, %rdi
addq $0x40, %rdi
callq 0x125fc
jmp 0x11ffa
movq %rdx, %r12
movq %rax, %r15
movq %r13, %rdi
callq 0x5390
jmp 0x11ffa
movq %rdx, %r12
movq %rax, %r15
movq %r14, %rdi
callq 0xe52e
movq %rbx, %rdi
callq 0x5390
jmp 0x12012
movq %rdx, %r12
movq %rax, %r15
cmpl $0x1, %r12d
jne 0x1204b
movq %r15, %rdi
callq 0x5150
leaq 0x10(%rax), %rbx
callq 0x51b0
movq %rsp, %rsi
movl $0xb, (%rsi)
movq %rax, 0x8(%rsi)
movq %rbx, %rdi
callq 0xe475
callq 0x5530
movq %rax, %r15
callq 0x55e0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1205a
callq 0xde06
movq %r15, %rdi
callq 0x5650
movq %rax, %rdi
callq 0xde75