// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]morat/pentago/agentmcts.h
// Function: Morat::Pentago::AgentMCTS::start_gc()
void start_gc() {
		Time starttime;
		logerr("Starting player GC with limit " + to_str(gclimit) + " ... ");
		uint64_t nodesbefore = nodes;
		Board copy = rootboard;
		garbage_collect(copy, & root);
		Time gctime;
		ctmem.compact(1.0, 0.75);
		Time compacttime;
		logerr(to_str(100.0*nodes/nodesbefore, 1) + " % of tree remains - " +
			to_str((gctime - starttime)*1000, 0)  + " msec gc, " + to_str((compacttime - gctime)*1000, 0) + " msec compact\n");

		if(ctmem.meminuse() >= maxmem/2)
			gclimit = (int)(gclimit*1.3);
		else if(gclimit > rollouts*5)
			gclimit = (int)(gclimit*0.9); //slowly decay to a minimum of 5
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5df0
movl 0xd0(%rbx), %esi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0xb860
leaq 0x104f3(%rip), %rsi     # 0x21390
leaq 0x40(%rsp), %rdi
movq %r14, %rdx
callq 0xaac0
leaq 0x104fe(%rip), %rdx     # 0x213af
leaq 0x148(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x7b4d
leaq 0x148(%rsp), %r14
movq %r14, %rdi
callq 0xaaae
movq %r14, %rdi
callq 0x5170
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x5170
leaq 0x20(%rsp), %rdi
callq 0x5170
movq 0xa0(%rbx), %rax
vcvtusi2sdq 0xc8(%rbx), %xmm0, %xmm0
leaq 0xa8(%rbx), %rdx
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
movq %rax, 0x20(%r14)
vmovups 0x80(%rbx), %ymm1
vmovsd %xmm0, 0x8(%rsp)
vmovups %ymm1, (%r14)
vzeroupper
callq 0xdcfa
movq %rsp, %rdi
callq 0x5df0
vmovss 0xf612(%rip), %xmm0     # 0x20550
vmovss 0xf612(%rip), %xmm1     # 0x20558
leaq 0xe8(%rbx), %rdi
callq 0xedd0
leaq 0x10(%rsp), %rdi
callq 0x5df0
vcvtusi2sdq 0xc8(%rbx), %xmm2, %xmm0
leaq 0x108(%rsp), %r14
vmulsd 0xf5a5(%rip), %xmm0, %xmm0 # 0x20518
vdivsd 0x8(%rsp), %xmm0, %xmm0
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x1df78
leaq 0x1042a(%rip), %rdx     # 0x213b5
leaq 0xa8(%rsp), %rdi
movq %r14, %rsi
callq 0x7b4d
vmovsd (%rsp), %xmm0
vsubsd 0x18(%rsp), %xmm0, %xmm0
vmulsd 0xf16a(%rip), %xmm0, %xmm0 # 0x20118
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
callq 0x1df78
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0xab3b
leaq 0x103ea(%rip), %rdx     # 0x213cb
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x7b4d
vmovsd 0x10(%rsp), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmulsd 0xf10f(%rip), %xmm0, %xmm0 # 0x20118
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
callq 0x1df78
leaq 0x20(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0xab3b
leaq 0x103a3(%rip), %rdx     # 0x213d6
leaq 0x128(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x7b4d
leaq 0x128(%rsp), %r14
movq %r14, %rdi
callq 0xaaae
movq %r14, %rdi
callq 0x5170
leaq 0x20(%rsp), %rdi
callq 0x5170
leaq 0x68(%rsp), %rdi
callq 0x5170
leaq 0xe8(%rsp), %rdi
callq 0x5170
leaq 0xc8(%rsp), %rdi
callq 0x5170
leaq 0x88(%rsp), %rdi
callq 0x5170
leaq 0xa8(%rsp), %rdi
callq 0x5170
leaq 0x108(%rsp), %rdi
callq 0x5170
movq 0x40(%rbx), %rcx
movl 0xd0(%rbx), %eax
shrq %rcx
cmpq %rcx, 0x14a0(%rbx)
jae 0x110da
imull $0x5, 0x5c(%rbx), %ecx
cmpl %ecx, %eax
jle 0x110f4
vmovsd 0xf470(%rip), %xmm0     # 0x20548
jmp 0x110e2
vmovsd 0xf45e(%rip), %xmm0     # 0x20540
vcvtsi2sd %eax, %xmm2, %xmm1
vmulsd %xmm1, %xmm0, %xmm0
vcvttsd2si %xmm0, %eax
movl %eax, 0xd0(%rbx)
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r14
retq
leaq 0x20(%rsp), %rdi
movq %rax, %rbx
callq 0x5170
jmp 0x11111
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x5170
jmp 0x11120
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x5170
jmp 0x11132
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x5170
jmp 0x11144
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x5170
leaq 0xa8(%rsp), %rdi
callq 0x5170
leaq 0x108(%rsp), %rdi
jmp 0x11189
movq %rax, %rbx
jmp 0x11151
movq %rax, %rbx
jmp 0x1115e
leaq 0x40(%rsp), %rdi
movq %rax, %rbx
callq 0x5170
jmp 0x11184
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5170
movq %rbx, %rdi
callq 0x5690