// File: /workspace/github_cpp_makefile_star2_O1/tewalds[P]morat/hex/agentmcts.h
// Function: Morat::Hex::AgentMCTS::start_gc()
void start_gc() {
		Time starttime;
		logerr("Starting player GC with limit " + to_str(gclimit) + " ... ");
		uint64_t nodesbefore = nodes;
		garbage_collect(root, rootboard.to_play());
		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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55b0
vcvtsi2sdq (%r14), %xmm0, %xmm0
vmovsd %xmm0, 0x20(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm1, %xmm0
vmovsd %xmm0, 0xb0(%rsp)
movl 0x4118(%rbx), %esi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x11187
leaq 0x1e338(%rip), %rcx     # 0x3326f
movl $0x1e, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x14f6c
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r15)
jmp 0x14f78
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1e2f5(%rip), %rsi     # 0x3328e
callq 0x56e0
leaq 0x128(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x14fc4
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r14)
jmp 0x14fd7
movq %rdx, 0x118(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x128(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x120(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x34fd7(%rip), %r13     # 0x49fd0
movq (%r13), %rsi
movq 0x118(%rsp), %rdi
callq 0x5370
movq 0x118(%rsp), %rdi
cmpq %r14, %rdi
je 0x1501c
callq 0x52e0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1502a
callq 0x52e0
leaq 0x38(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x1503e
callq 0x52e0
leaq 0x40e0(%rbx), %rsi
movl 0x18(%rbx), %edx
vcvtusi2sdq 0x4110(%rbx), %xmm1, %xmm0
vmovsd %xmm0, 0xa8(%rsp)
movq %rbx, %rdi
callq 0x10662
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55b0
vcvtsi2sdq (%r14), %xmm1, %xmm0
vmovsd %xmm0, 0xa0(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm1, %xmm0
vmovsd %xmm0, 0x98(%rsp)
leaq 0x4130(%rbx), %rdi
vmovss 0x1d164(%rip), %xmm0    # 0x32200
vmovss 0x1d16c(%rip), %xmm1    # 0x32210
callq 0x123b8
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55b0
vcvtsi2sdq (%r14), %xmm2, %xmm0
vmovsd %xmm0, 0x90(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm2, %xmm0
vmovsd %xmm0, 0x88(%rsp)
vcvtusi2sdq 0x4110(%rbx), %xmm2, %xmm0
vmulsd 0x1d13b(%rip), %xmm0, %xmm0 # 0x32220
vdivsd 0xa8(%rsp), %xmm0, %xmm0
leaq 0x138(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x2f81c
leaq 0x1e18a(%rip), %rsi     # 0x33294
movq %r14, %rdi
callq 0x56e0
vmovsd 0xb0(%rsp), %xmm0
vdivsd 0x1bee5(%rip), %xmm0, %xmm0 # 0x31008
vaddsd 0x20(%rsp), %xmm0, %xmm0
vmovsd 0x98(%rsp), %xmm1
vdivsd 0x1bece(%rip), %xmm1, %xmm1 # 0x31008
vaddsd 0xa0(%rsp), %xmm1, %xmm2
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x15166
vmovupd (%rcx), %xmm1
vmovupd %xmm1, (%r14)
jmp 0x15173
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
vmovsd %xmm2, 0x20(%rsp)
vsubsd %xmm0, %xmm2, %xmm0
vmulsd 0x1d07b(%rip), %xmm0, %xmm0 # 0x32218
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
callq 0x2f81c
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %r8
movq 0xe0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r14, %rcx
je 0x151d1
movq 0x78(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x151f6
leaq 0xe8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x151f1
movq 0xe8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1520a
movq 0xd8(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x50c0
jmp 0x1521b
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x58(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x1523a
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x15247
movq %rsi, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1e03f(%rip), %rsi     # 0x332aa
leaq 0x48(%rsp), %rdi
callq 0x56e0
vmovsd 0x88(%rsp), %xmm0
vdivsd 0x1bd82(%rip), %xmm0, %xmm0 # 0x31008
vaddsd 0x90(%rsp), %xmm0, %xmm0
movq %r12, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
vmovsd 0x20(%rsp), %xmm2
jne 0x152b5
vmovupd (%rcx), %xmm1
vmovupd %xmm1, (%r12)
jmp 0x152c2
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
vsubsd %xmm2, %xmm0, %xmm0
vmulsd 0x1cf32(%rip), %xmm0, %xmm0 # 0x32218
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
callq 0x2f81c
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0xc0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x1531a
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1533f
leaq 0xc8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x1533a
movq 0xc8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x15353
movq 0xb8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x50c0
jmp 0x15364
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
movq %r15, (%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
jne 0x1537f
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r15)
jmp 0x1538b
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1df06(%rip), %rsi     # 0x332b5
movq %rsp, %rdi
callq 0x56e0
leaq 0x108(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x153dd
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rbp)
jmp 0x153f0
movq %rdx, 0xf8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x108(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x100(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r13), %rsi
movq 0xf8(%rsp), %rdi
callq 0x5370
movq 0xf8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1542e
callq 0x52e0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1543c
callq 0x52e0
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15452
callq 0x52e0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x15461
callq 0x52e0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15474
callq 0x52e0
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1548a
callq 0x52e0
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x15499
callq 0x52e0
leaq 0x148(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x154af
callq 0x52e0
movq 0x60(%rbx), %rcx
shrq %rcx
movl 0x4118(%rbx), %eax
cmpq %rcx, 0x54e8(%rbx)
jae 0x154dc
movl 0x94(%rbx), %ecx
leal (%rcx,%rcx,4), %ecx
cmpl %ecx, %eax
jle 0x154f6
vmovsd 0x1cda6(%rip), %xmm0    # 0x32280
jmp 0x154e4
vmovsd 0x1cd94(%rip), %xmm0    # 0x32278
vcvtsi2sd %eax, %xmm3, %xmm1
vmulsd %xmm1, %xmm0, %xmm0
vcvttsd2si %xmm0, %eax
movl %eax, 0x4118(%rbx)
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1551e
callq 0x52e0
jmp 0x1551e
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15539
callq 0x52e0
jmp 0x15539
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x1554d
callq 0x52e0
jmp 0x1554d
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15565
callq 0x52e0
jmp 0x15565
movq %rax, %rbx
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15580
callq 0x52e0
jmp 0x15580
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x15594
callq 0x52e0
jmp 0x15594
movq %rax, %rbx
leaq 0x148(%rsp), %rax
jmp 0x155b9
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x155b4
callq 0x52e0
jmp 0x155b4
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x155c7
callq 0x52e0
movq %rbx, %rdi
callq 0x5670
nop