// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movq %rdi, %rbx
addq $0x258, %rdi            # imm = 0x258
callq 0x10682
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)
andq $0x0, 0x248(%rbx)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x20(%rsp)
pushq $0x50
popq %rdi
callq 0x5390
movq %rax, %r15
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r15)
leaq 0xd088(%rip), %rax      # 0x1dbb0
movq %rax, (%r15)
andq $0x0, 0x18(%r15)
andl $0x0, 0x20(%r15)
movb $0x0, 0x24(%r15)
andl $0x0, 0x28(%r15)
leaq 0xf(%rsp), %rax
andq $0x0, 0x30(%r15)
movq %rax, 0x10(%rsp)
andl $0x0, 0x38(%r15)
movq %r15, 0x18(%rsp)
leaq 0x10(%r15), %r12
leaq 0xd09d(%rip), %rax      # 0x1dc00
movq %rax, 0x10(%r15)
pushq $0x10
popq %rdi
callq 0x5390
movq %rax, %r13
pxor %xmm0, %xmm0
movdqa %xmm0, (%rax)
movq %rax, %rdi
callq 0x113c4
movq %r13, 0x40(%r15)
movq %rbx, 0x48(%r15)
andq $0x0, 0x38(%rsp)
pushq $0x20
popq %rdi
callq 0x5390
leaq 0xd0b9(%rip), %rcx      # 0x1dc58
movq %rcx, (%rax)
movq %r12, 0x8(%rax)
leaq 0x4df(%rip), %rcx       # 0x1108c
movq %rcx, 0x10(%rax)
andq $0x0, 0x18(%rax)
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x38(%rsp), %rdi
xorl %edx, %edx
callq 0x5310
movq %r15, %r13
addq $0x30, %r13
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x10be1
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x48(%rsp), %rbp
leaq 0x38(%rsp), %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0xc810
movq %r14, %rdi
callq 0xc82a
leaq 0x10(%rsp), %rdi
andq $0x0, 0x8(%rdi)
callq 0x11016
leaq 0x18(%rsp), %rdi
pxor %xmm0, %xmm0
movdqa %xmm0, -0x8(%rbp)
movdqa 0x20(%rsp), %xmm0
movq %r12, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movdqa %xmm0, -0x8(%rdi)
callq 0xc0d4
movq %rbp, %rdi
callq 0xc0d4
cmpq $0x0, 0x20(%rsp)
jne 0x10d09
pushq $0x40
popq %rdi
callq 0x5390
movq %rax, %r15
leaq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r15)
leaq 0xd025(%rip), %rax      # 0x1dc98
movq %rax, (%r15)
andq $0x0, 0x18(%r15)
movq %r15, 0x18(%rsp)
andl $0x0, 0x20(%r15)
movb $0x0, 0x24(%r15)
andl $0x0, 0x28(%r15)
movq %r15, %r14
addq $0x10, %r14
leaq 0xd04b(%rip), %rax      # 0x1dce8
movq %rax, 0x10(%r15)
pushq $0x10
popq %rdi
callq 0x5390
movq %rax, %r12
pxor %xmm0, %xmm0
movdqa %xmm0, (%rax)
movq %rax, %rdi
callq 0x113c4
leaq 0x48(%rsp), %r13
movq %r12, 0x30(%r15)
movq %rbx, 0x38(%r15)
leaq 0x10(%rsp), %rdi
andq $0x0, 0x8(%rdi)
callq 0x11298
leaq 0x18(%rsp), %rdi
pxor %xmm0, %xmm0
movdqa %xmm0, -0x8(%r13)
movdqa 0x20(%rsp), %xmm0
movq %r14, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movdqa %xmm0, -0x8(%rdi)
callq 0xc0d4
movq %r13, %rdi
callq 0xc0d4
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x11412
leaq 0x28(%rsp), %rdi
callq 0xc0d4
addq $0x280, %rbx            # imm = 0x280
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x11396
leaq 0x18(%rsp), %rdi
callq 0xc0d4
movb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x5360
jmp 0x10d61
movq %rax, %rbx
movq %r14, %rdi
callq 0xc894
leaq 0x10(%rsp), %rdi
callq 0x11298
jmp 0x10e25
jmp 0x10d7a
movq %rax, %rbx
jmp 0x10e25
movq %r12, %r14
movq %rdx, %r12
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x10da6
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x10da6
movq %r12, %r14
movq %rdx, %r12
movq %rax, %rbx
addq $0x40, %r15
movq %r15, %rdi
callq 0x113da
jmp 0x10dd0
movq %r12, %r14
movq %rdx, %r12
movq %rax, %rbx
movq %r13, %rdi
callq 0x5360
jmp 0x10dd0
movq %r12, %r14
movq %rdx, %r12
movq %rax, %rbx
movq %r14, %rdi
callq 0xc862
leaq 0x10(%rsp), %rdi
callq 0x11016
jmp 0x10dea
movq %rdx, %r12
movq %rax, %rbx
cmpl $0x1, %r12d
jne 0x10e25
movq %rbx, %rdi
callq 0x5140
leaq 0x10(%rax), %rbx
callq 0x51a0
leaq 0x40(%rsp), %rsi
movl $0xb, (%rsi)
movq %rax, 0x8(%rsi)
movq %rbx, %rdi
callq 0xc7e4
callq 0x54f0
movq %rax, %rbx
callq 0x55a0
leaq 0x28(%rsp), %rdi
callq 0xc0d4
movq %rbx, %rdi
callq 0x5610
movq %rax, %rdi
callq 0x7100
nop