// File: /workspace/github_cpp_makefile_star2_O1/tewalds[P]morat/hex/agentpns.h
// Function: Morat::Hex::AgentPNS::start_gc()
void start_gc() {
		Time starttime;
		logerr("Starting GC with limit " + to_str(gclimit) + " ... ");

		garbage_collect(& root);

		Time gctime;
		ctmem.compact(1.0, 0.75);

		Time compacttime;
		logerr(to_str(100.0*ctmem.meminuse()/memlimit, 1) + " % of tree remains - " +
			to_str((gctime - starttime)*1000, 0)  + " msec gc, " + to_str((compacttime - gctime)*1000, 0) + " msec compact\n");

		if(ctmem.meminuse() >= memlimit/2)
			gclimit = (unsigned int)(gclimit*1.3);
		else if(gclimit > 5)
			gclimit = (unsigned 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
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55b0
vcvtsi2sdq (%r14), %xmm0, %xmm0
vmovsd %xmm0, 0x28(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm1, %xmm0
vmovsd %xmm0, 0xb0(%rsp)
movl 0x68(%rbx), %esi
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x11206
leaq 0x162b4(%rip), %rcx     # 0x33f1e
movl $0x17, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1dc9f
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r15)
jmp 0x1dcac
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x155bf(%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 0x1dcfa
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r14)
jmp 0x1dd0d
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 0x2c2a1(%rip), %r13     # 0x49fd0
movq (%r13), %rsi
movq 0x118(%rsp), %rdi
callq 0x5370
movq 0x118(%rsp), %rdi
cmpq %r14, %rdi
je 0x1dd52
callq 0x52e0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1dd61
callq 0x52e0
leaq 0x40(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x1dd75
callq 0x52e0
leaq 0x1540(%rbx), %rsi
movq %rbx, %rdi
callq 0x1b8d0
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55b0
vcvtsi2sdq (%r14), %xmm1, %xmm0
vmovsd %xmm0, 0xa8(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm1, %xmm0
vmovsd %xmm0, 0xa0(%rsp)
leaq 0x70(%rbx), %rdi
vmovss 0x14444(%rip), %xmm0    # 0x32200
vmovss 0x1444c(%rip), %xmm1    # 0x32210
callq 0x1d340
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55b0
vcvtsi2sdq (%r14), %xmm2, %xmm0
vmovsd %xmm0, 0x98(%rsp)
vcvtsi2sdq 0x8(%r14), %xmm2, %xmm0
vmovsd %xmm0, 0x90(%rsp)
vcvtusi2sdq 0x1428(%rbx), %xmm2, %xmm0
vmulsd 0x14419(%rip), %xmm0, %xmm0 # 0x32220
vcvtusi2sdq 0x60(%rbx), %xmm2, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
leaq 0x138(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x2f81c
leaq 0x15466(%rip), %rsi     # 0x33294
movq %r14, %rdi
callq 0x56e0
vmovsd 0xb0(%rsp), %xmm0
vdivsd 0x131c1(%rip), %xmm0, %xmm0 # 0x31008
vaddsd 0x28(%rsp), %xmm0, %xmm0
vmovsd 0xa0(%rsp), %xmm1
vdivsd 0x131aa(%rip), %xmm1, %xmm1 # 0x31008
vaddsd 0xa8(%rsp), %xmm1, %xmm2
leaq 0x80(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1de8d
vmovupd (%rcx), %xmm1
vmovupd %xmm1, (%r14)
jmp 0x1de9d
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)
vmovsd %xmm2, 0x28(%rsp)
vsubsd %xmm0, %xmm2, %xmm0
vmulsd 0x14351(%rip), %xmm0, %xmm0 # 0x32218
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
callq 0x2f81c
movq 0x70(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0xe0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r14, %rcx
je 0x1defe
movq 0x80(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1df23
leaq 0xe8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x1df1e
movq 0xe8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1df37
movq 0xd8(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x50c0
jmp 0x1df48
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x60(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x1df67
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x1df74
movq %rsi, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x15312(%rip), %rsi     # 0x332aa
leaq 0x50(%rsp), %rdi
callq 0x56e0
vmovsd 0x90(%rsp), %xmm0
vdivsd 0x13055(%rip), %xmm0, %xmm0 # 0x31008
vaddsd 0x98(%rsp), %xmm0, %xmm0
movq %r12, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
vmovsd 0x28(%rsp), %xmm2
jne 0x1dfe2
vmovupd (%rcx), %xmm1
vmovupd %xmm1, (%r12)
jmp 0x1dfef
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
vsubsd %xmm2, %xmm0, %xmm0
vmulsd 0x14205(%rip), %xmm0, %xmm0 # 0x32218
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
callq 0x2f81c
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0xc0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x1e047
movq 0x40(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1e06c
leaq 0xc8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x1e067
movq 0xc8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1e080
movq 0xb8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x50c0
jmp 0x1e091
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
movq %r15, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
jne 0x1e0ad
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r15)
jmp 0x1e0ba
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x151d7(%rip), %rsi     # 0x332b5
leaq 0x8(%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 0x1e10e
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rbp)
jmp 0x1e121
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 0x1e15f
callq 0x52e0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e16e
callq 0x52e0
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e184
callq 0x52e0
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x1e193
callq 0x52e0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e1a6
callq 0x52e0
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e1bc
callq 0x52e0
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x1e1cb
callq 0x52e0
leaq 0x148(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e1e1
callq 0x52e0
movq 0x60(%rbx), %rcx
shrq %rcx
movl 0x68(%rbx), %eax
cmpq %rcx, 0x1428(%rbx)
jae 0x1e203
cmpl $0x6, %eax
jb 0x1e21e
vmovsd 0x1407f(%rip), %xmm0    # 0x32280
jmp 0x1e20b
vmovsd 0x1406d(%rip), %xmm0    # 0x32278
vcvtusi2sd %eax, %xmm3, %xmm1
vmulsd %xmm1, %xmm0, %xmm0
vcvttsd2usi %xmm0, %eax
movl %eax, 0x68(%rbx)
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e247
callq 0x52e0
jmp 0x1e247
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e262
callq 0x52e0
jmp 0x1e262
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x1e276
callq 0x52e0
jmp 0x1e276
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e28e
callq 0x52e0
jmp 0x1e28e
movq %rax, %rbx
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e2a9
callq 0x52e0
jmp 0x1e2a9
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x1e2bd
callq 0x52e0
jmp 0x1e2bd
movq %rax, %rbx
leaq 0x148(%rsp), %rax
jmp 0x1e2e3
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e2de
callq 0x52e0
jmp 0x1e2de
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e2f1
callq 0x52e0
movq %rbx, %rdi
callq 0x5670
nop