// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdi, %rbx
leaq 0x100(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5600
vcvtsi2sdq (%r14), %xmm0, %xmm0
vmovsd %xmm0, 0x8(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm1, %xmm0
vmovsd %xmm0, 0xb8(%rsp)
movl 0xd0(%rbx), %esi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xe629
leaq 0x18198(%rip), %rcx     # 0x2e430
movl $0x1e, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x53c0
leaq 0x110(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x162d0
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r14)
jmp 0x162e3
movq %rdx, 0x100(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x110(%rsp)
movq 0x8(%rax), %rdx
leaq 0x100(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x18146(%rip), %rsi     # 0x2e44f
callq 0x5720
leaq 0x158(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x16336
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r12)
jmp 0x16349
movq %rdx, 0x148(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x158(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x150(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x26c6d(%rip), %r15     # 0x3cfd8
movq (%r15), %rsi
movq 0x148(%rsp), %rdi
callq 0x53b0
movq 0x148(%rsp), %rdi
cmpq %r12, %rdi
je 0x1638d
callq 0x5310
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x1639f
callq 0x5310
leaq 0x20(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x163b3
callq 0x5310
vcvtusi2sdq 0xc8(%rbx), %xmm1, %xmm0
vmovsd %xmm0, 0xb0(%rsp)
movq 0xa0(%rbx), %rax
leaq 0x100(%rsp), %rsi
movq %rax, 0x20(%rsi)
vmovupd 0x80(%rbx), %ymm0
vmovupd %ymm0, (%rsi)
leaq 0xa8(%rbx), %rdx
movq %rbx, %rdi
vzeroupper
callq 0x12772
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5600
vcvtsi2sdq (%r14), %xmm1, %xmm0
vmovsd %xmm0, 0xa8(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm1, %xmm0
vmovsd %xmm0, 0xa0(%rsp)
leaq 0xe8(%rbx), %rdi
vmovss 0x17111(%rip), %xmm0    # 0x2d540
vmovss 0x1710d(%rip), %xmm1    # 0x2d544
callq 0x1400e
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5600
vcvtsi2sdq (%r14), %xmm2, %xmm0
vmovsd %xmm0, 0x98(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm2, %xmm0
vmovsd %xmm0, 0x90(%rsp)
vcvtusi2sdq 0xc8(%rbx), %xmm2, %xmm0
vmulsd 0x170d1(%rip), %xmm0, %xmm0 # 0x2d548
vdivsd 0xb0(%rsp), %xmm0, %xmm0
leaq 0x168(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x2a99c
leaq 0x17fb9(%rip), %rsi     # 0x2e455
movq %r14, %rdi
callq 0x5720
vmovsd 0xb8(%rsp), %xmm0
vdivsd 0x15b53(%rip), %xmm0, %xmm0 # 0x2c008
vaddsd 0x8(%rsp), %xmm0, %xmm0
vmovsd 0xa0(%rsp), %xmm1
vdivsd 0x15b3c(%rip), %xmm1, %xmm1 # 0x2c008
vaddsd 0xa8(%rsp), %xmm1, %xmm2
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x164f8
vmovupd (%rcx), %xmm1
vmovupd %xmm1, (%r14)
jmp 0x16505
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
vmovsd %xmm2, 0x8(%rsp)
vsubsd %xmm0, %xmm2, %xmm0
vmulsd 0x16c11(%rip), %xmm0, %xmm0 # 0x2d140
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
callq 0x2a99c
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0xe8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r14, %rcx
je 0x16563
movq 0x60(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x16588
leaq 0xf0(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x16583
movq 0xf0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1659c
movq 0xe0(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x50e0
jmp 0x165ad
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x53c0
leaq 0x40(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x165cc
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x165d9
movq %rsi, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x17e6e(%rip), %rsi     # 0x2e46b
leaq 0x30(%rsp), %rdi
callq 0x5720
vmovsd 0x90(%rsp), %xmm0
vdivsd 0x159f0(%rip), %xmm0, %xmm0 # 0x2c008
vaddsd 0x98(%rsp), %xmm0, %xmm0
leaq 0x80(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
vmovsd 0x8(%rsp), %xmm2
jne 0x1664e
vmovupd (%rcx), %xmm1
vmovupd %xmm1, (%r13)
jmp 0x1665e
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x78(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
vsubsd %xmm2, %xmm0, %xmm0
vmulsd 0x16abe(%rip), %xmm0, %xmm0 # 0x2d140
leaq 0xc0(%rsp), %rdi
xorl %esi, %esi
callq 0x2a99c
movq 0x70(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0xc8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x166b9
movq 0x80(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x166de
leaq 0xd0(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x166d9
movq 0xd0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x166f2
movq 0xc0(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x50e0
jmp 0x16703
leaq 0xc0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x53c0
movq %r12, 0x10(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
jne 0x16720
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r12)
jmp 0x1672d
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x17d25(%rip), %rsi     # 0x2e476
leaq 0x10(%rsp), %rdi
callq 0x5720
leaq 0x138(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x16781
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rbp)
jmp 0x16794
movq %rdx, 0x128(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x138(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x130(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r15), %rsi
movq 0x128(%rsp), %rdi
callq 0x53b0
movq 0x128(%rsp), %rdi
cmpq %rbp, %rdi
je 0x167d1
callq 0x5310
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x167e0
callq 0x5310
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x167f6
callq 0x5310
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x16805
callq 0x5310
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16818
callq 0x5310
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1682e
callq 0x5310
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1683d
callq 0x5310
leaq 0x178(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16853
callq 0x5310
movq 0x40(%rbx), %rcx
shrq %rcx
movl 0xd0(%rbx), %eax
cmpq %rcx, 0x14a0(%rbx)
jae 0x1687d
movl 0x5c(%rbx), %ecx
leal (%rcx,%rcx,4), %ecx
cmpl %ecx, %eax
jle 0x16897
vmovsd 0x16d05(%rip), %xmm0    # 0x2d580
jmp 0x16885
vmovsd 0x16cf3(%rip), %xmm0    # 0x2d578
vcvtsi2sd %eax, %xmm3, %xmm1
vmulsd %xmm1, %xmm0, %xmm0
vcvttsd2si %xmm0, %eax
movl %eax, 0xd0(%rbx)
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x168c0
callq 0x5310
jmp 0x168c0
movq %rax, %rbx
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x168db
callq 0x5310
jmp 0x168db
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x168ef
callq 0x5310
jmp 0x168ef
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16907
callq 0x5310
jmp 0x16907
movq %rax, %rbx
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16922
callq 0x5310
jmp 0x16922
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x16936
callq 0x5310
jmp 0x16936
movq %rax, %rbx
leaq 0x178(%rsp), %rax
jmp 0x1695f
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x1695a
callq 0x5310
jmp 0x1695a
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1696d
callq 0x5310
movq %rbx, %rdi
callq 0x56c0
nop