// File: 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:
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, 0x1e0(%rsp)
movq 0x1e0(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x1d8(%rsp), %rdi
callq 0x67a0
movq 0x10(%rsp), %rax
movl 0xd0(%rax), %esi
leaq 0x178(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x16700
movq 0x18(%rsp), %rdx
leaq 0x219aa(%rip), %rsi     # 0x4537c
leaq 0x198(%rsp), %rdi
callq 0x14410
jmp 0x239e1
leaq 0x219b3(%rip), %rdx     # 0x4539b
leaq 0x1b8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0xaa40
jmp 0x239ff
leaq 0x1b8(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x143d0
movq (%rsp), %rdi
callq 0x5290
leaq 0x198(%rsp), %rdi
callq 0x5290
leaq 0x178(%rsp), %rdi
callq 0x5290
movq 0x10(%rsp), %rdi
movq 0xc8(%rdi), %rax
movq %rax, 0x160(%rsp)
movq 0xa0(%rdi), %rax
movq %rax, 0x150(%rsp)
vmovdqu 0x80(%rdi), %ymm0
vmovdqu %ymm0, 0x130(%rsp)
movq %rdi, %rdx
addq $0xa8, %rdx
leaq 0x130(%rsp), %rsi
vzeroupper
callq 0x1b270
leaq 0x128(%rsp), %rdi
callq 0x67a0
movq 0x10(%rsp), %rdi
addq $0xe8, %rdi
vmovss 0x20a9e(%rip), %xmm0    # 0x44540
vmovss 0x20a9e(%rip), %xmm1    # 0x44548
callq 0x1d0d0
leaq 0x120(%rsp), %rdi
callq 0x67a0
movq 0x10(%rsp), %rax
vcvtusi2sdq 0xc8(%rax), %xmm0, %xmm0
vmovsd 0x20a38(%rip), %xmm1    # 0x44508
vmulsd %xmm1, %xmm0, %xmm0
vcvtusi2sdq 0x160(%rsp), %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
leaq 0x60(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl $0x1, %esi
callq 0x3fed0
movq 0x8(%rsp), %rsi
leaq 0x218a1(%rip), %rdx     # 0x453a1
leaq 0x80(%rsp), %rdi
callq 0xaa40
jmp 0x23b0f
leaq 0x128(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x144f0
vmovsd 0x205f4(%rip), %xmm1    # 0x44120
vmulsd %xmm1, %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x3fed0
jmp 0x23b3e
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x14510
jmp 0x23b5a
leaq 0x21856(%rip), %rdx     # 0x453b7
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xaa40
jmp 0x23b78
leaq 0x120(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x144f0
vmovsd 0x2058b(%rip), %xmm1    # 0x44120
vmulsd %xmm1, %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x3fed0
jmp 0x23ba7
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x14510
jmp 0x23bc3
leaq 0x217f8(%rip), %rdx     # 0x453c2
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xaa40
jmp 0x23be1
leaq 0x100(%rsp), %rdi
callq 0x143d0
leaq 0x100(%rsp), %rdi
callq 0x5290
leaq 0xe0(%rsp), %rdi
callq 0x5290
leaq 0x20(%rsp), %rdi
callq 0x5290
leaq 0xc0(%rsp), %rdi
callq 0x5290
leaq 0xa0(%rsp), %rdi
callq 0x5290
leaq 0x40(%rsp), %rdi
callq 0x5290
leaq 0x80(%rsp), %rdi
callq 0x5290
leaq 0x60(%rsp), %rdi
callq 0x5290
movq 0x10(%rsp), %rdi
addq $0xe8, %rdi
callq 0x23e50
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rcx
shrq %rcx
cmpq %rcx, %rax
jb 0x23dd9
movq 0x10(%rsp), %rax
vcvtsi2sdl 0xd0(%rax), %xmm0, %xmm0
vmovsd 0x208b0(%rip), %xmm1    # 0x44538
vmulsd %xmm1, %xmm0, %xmm0
vcvttsd2si %xmm0, %ecx
movl %ecx, 0xd0(%rax)
jmp 0x23e11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
jmp 0x23cd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
leaq 0x198(%rsp), %rdi
callq 0x5290
leaq 0x178(%rsp), %rdi
callq 0x5290
jmp 0x23e19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
jmp 0x23dcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
jmp 0x23dc0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
jmp 0x23db6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
jmp 0x23da9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
jmp 0x23d9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
jmp 0x23d92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x170(%rsp)
movl %eax, 0x16c(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x5290
leaq 0x20(%rsp), %rdi
callq 0x5290
leaq 0xc0(%rsp), %rdi
callq 0x5290
leaq 0xa0(%rsp), %rdi
callq 0x5290
leaq 0x40(%rsp), %rdi
callq 0x5290
leaq 0x80(%rsp), %rdi
callq 0x5290
leaq 0x60(%rsp), %rdi
callq 0x5290
jmp 0x23e19
movq 0x10(%rsp), %rcx
movl 0xd0(%rcx), %eax
imull $0x5, 0x5c(%rcx), %ecx
cmpl %ecx, %eax
jle 0x23e0f
movq 0x10(%rsp), %rax
vcvtsi2sdl 0xd0(%rax), %xmm0, %xmm0
vmovsd 0x2072f(%rip), %xmm1    # 0x44530
vmulsd %xmm1, %xmm0, %xmm0
vcvttsd2si %xmm0, %ecx
movl %ecx, 0xd0(%rax)
jmp 0x23e11
addq $0x1e8, %rsp            # imm = 0x1E8
retq
movq 0x170(%rsp), %rdi
callq 0x57a0
nopw %cs:(%rax,%rax)