// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5ca0
movl 0x68(%rbx), %esi
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0xd215
leaq 0xdc88(%rip), %rsi      # 0x24b4e
leaq 0x10(%rsp), %rdi
movq %r14, %rdx
callq 0xcf8b
leaq 0xd210(%rip), %rdx      # 0x240ea
leaq 0x118(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x8051
leaq 0x118(%rsp), %r14
movq %r14, %rdi
callq 0xd451
movq %r14, %rdi
callq 0x5150
leaq 0x10(%rsp), %rdi
callq 0x5150
leaq 0x38(%rsp), %rdi
callq 0x5150
leaq 0x1540(%rbx), %rsi
movq %rbx, %rdi
callq 0x152b2
movq %rsp, %rdi
callq 0x5ca0
vmovss 0xc2e5(%rip), %xmm0     # 0x2321c
vmovss 0xc2f1(%rip), %xmm1     # 0x23230
leaq 0x70(%rbx), %rdi
callq 0x16690
leaq 0x8(%rsp), %rdi
callq 0x5ca0
vcvtusi2sdq 0x1428(%rbx), %xmm2, %xmm0
leaq 0xd8(%rsp), %r14
vmulsd 0xc26c(%rip), %xmm0, %xmm0 # 0x231d8
vcvtusi2sdq 0x60(%rbx), %xmm2, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x20e6c
leaq 0xd167(%rip), %rdx      # 0x240f0
leaq 0x98(%rsp), %rdi
movq %r14, %rsi
callq 0x8051
vmovsd (%rsp), %xmm0
vsubsd 0x30(%rsp), %xmm0, %xmm0
vmulsd 0xc224(%rip), %xmm0, %xmm0 # 0x231d0
leaq 0x78(%rsp), %rdi
xorl %esi, %esi
callq 0x20e6c
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0xcf24
leaq 0xd12d(%rip), %rdx      # 0x24106
leaq 0x38(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x8051
vmovsd 0x8(%rsp), %xmm0
vsubsd (%rsp), %xmm0, %xmm0
vmulsd 0xc1d2(%rip), %xmm0, %xmm0 # 0x231d0
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x20e6c
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0xcf24
leaq 0xd0ec(%rip), %rdx      # 0x24111
leaq 0xf8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x8051
leaq 0xf8(%rsp), %r14
movq %r14, %rdi
callq 0xd451
movq %r14, %rdi
callq 0x5150
leaq 0x10(%rsp), %rdi
callq 0x5150
leaq 0x58(%rsp), %rdi
callq 0x5150
leaq 0x38(%rsp), %rdi
callq 0x5150
leaq 0xb8(%rsp), %rdi
callq 0x5150
leaq 0x78(%rsp), %rdi
callq 0x5150
leaq 0x98(%rsp), %rdi
callq 0x5150
leaq 0xd8(%rsp), %rdi
callq 0x5150
movq 0x60(%rbx), %rcx
movl 0x68(%rbx), %eax
shrq %rcx
cmpq %rcx, 0x1428(%rbx)
jae 0x170c0
cmpl $0x6, %eax
jb 0x170db
vmovsd 0xc152(%rip), %xmm0     # 0x23210
jmp 0x170c8
vmovsd 0xc140(%rip), %xmm0     # 0x23208
vcvtusi2sd %eax, %xmm2, %xmm1
vmulsd %xmm1, %xmm0, %xmm0
vcvttsd2usi %xmm0, %eax
movl %eax, 0x68(%rbx)
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r14
retq
leaq 0x10(%rsp), %rdi
movq %rax, %rbx
callq 0x5150
jmp 0x170f8
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x5150
jmp 0x17107
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5150
jmp 0x17116
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5150
jmp 0x17128
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x5150
leaq 0x98(%rsp), %rdi
callq 0x5150
leaq 0xd8(%rsp), %rdi
jmp 0x1716a
movq %rax, %rbx
jmp 0x17132
movq %rax, %rbx
jmp 0x1713f
leaq 0x10(%rsp), %rdi
movq %rax, %rbx
callq 0x5150
jmp 0x17165
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5150
movq %rbx, %rdi
callq 0x5650
nop