// File: /workspace/github_c_makefile_star2_O0/ccxvii[P]mujs/./jsgc.c
// Function: js_gc
void js_gc(js_State *J, int report)
{
	js_Function *fun, *nextfun, **prevnextfun;
	js_Object *obj, *nextobj, **prevnextobj;
	js_String *str, *nextstr, **prevnextstr;
	js_Environment *env, *nextenv, **prevnextenv;
	unsigned int nenv = 0, nfun = 0, nobj = 0, nstr = 0, nprop = 0;
	unsigned int genv = 0, gfun = 0, gobj = 0, gstr = 0, gprop = 0;
	int mark;
	int i;

	mark = J->gcmark = J->gcmark == 1 ? 2 : 1;

	/* Add initial roots. */

	jsG_markobject(J, mark, J->Object_prototype);
	jsG_markobject(J, mark, J->Array_prototype);
	jsG_markobject(J, mark, J->Function_prototype);
	jsG_markobject(J, mark, J->Boolean_prototype);
	jsG_markobject(J, mark, J->Number_prototype);
	jsG_markobject(J, mark, J->String_prototype);
	jsG_markobject(J, mark, J->RegExp_prototype);
	jsG_markobject(J, mark, J->Date_prototype);

	jsG_markobject(J, mark, J->Error_prototype);
	jsG_markobject(J, mark, J->EvalError_prototype);
	jsG_markobject(J, mark, J->RangeError_prototype);
	jsG_markobject(J, mark, J->ReferenceError_prototype);
	jsG_markobject(J, mark, J->SyntaxError_prototype);
	jsG_markobject(J, mark, J->TypeError_prototype);
	jsG_markobject(J, mark, J->URIError_prototype);

	jsG_markobject(J, mark, J->R);
	jsG_markobject(J, mark, J->G);

	jsG_markstack(J, mark);

	jsG_markenvironment(J, mark, J->E);
	jsG_markenvironment(J, mark, J->GE);
	for (i = 0; i < J->envtop; ++i)
		jsG_markenvironment(J, mark, J->envstack[i]);

	/* Scan objects until none remain. */

	while ((obj = J->gcroot) != NULL) {
		J->gcroot = obj->gcroot;
		obj->gcroot = NULL;
		jsG_scanobject(J, mark, obj);
	}

	/* Free everything not marked. */

	prevnextenv = &J->gcenv;
	for (env = J->gcenv; env; env = nextenv) {
		nextenv = env->gcnext;
		if (env->gcmark != mark) {
			*prevnextenv = nextenv;
			jsG_freeenvironment(J, env);
			++genv;
		} else {
			prevnextenv = &env->gcnext;
		}
		++nenv;
	}

	prevnextfun = &J->gcfun;
	for (fun = J->gcfun; fun; fun = nextfun) {
		nextfun = fun->gcnext;
		if (fun->gcmark != mark) {
			*prevnextfun = nextfun;
			jsG_freefunction(J, fun);
			++gfun;
		} else {
			prevnextfun = &fun->gcnext;
		}
		++nfun;
	}

	prevnextobj = &J->gcobj;
	for (obj = J->gcobj; obj; obj = nextobj) {
		nprop += obj->count;
		nextobj = obj->gcnext;
		if (obj->gcmark != mark) {
			gprop += obj->count;
			*prevnextobj = nextobj;
			jsG_freeobject(J, obj);
			++gobj;
		} else {
			prevnextobj = &obj->gcnext;
		}
		++nobj;
	}

	prevnextstr = &J->gcstr;
	for (str = J->gcstr; str; str = nextstr) {
		nextstr = str->gcnext;
		if (str->gcmark != mark) {
			*prevnextstr = nextstr;
			js_free(J, str);
			++gstr;
		} else {
			prevnextstr = &str->gcnext;
		}
		++nstr;
	}

	unsigned int ntot = nenv + nfun + nobj + nstr + nprop;
	unsigned int gtot = genv + gfun + gobj + gstr + gprop;
	unsigned int remaining = ntot - gtot;

	J->gccounter = remaining;
	J->gcthresh = remaining * JS_GCFACTOR;

	if (report) {
		char buf[256];
		snprintf(buf, sizeof buf, "garbage collected (%d%%): %d/%d envs, %d/%d funs, %d/%d objs, %d/%d props, %d/%d strs",
			100*gtot/ntot, genv, nenv, gfun, nfun, gobj, nobj, gprop, nprop, gstr, nstr);
		js_report(J, buf);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, -0x30(%rbp)
movl %esi, -0x34(%rbp)
movl $0x0, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movl $0x0, -0xa4(%rbp)
movl $0x0, -0xa8(%rbp)
movl $0x0, -0xac(%rbp)
movl $0x0, -0xb0(%rbp)
movl $0x0, -0xb4(%rbp)
movl $0x0, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movl $0x0, -0xc0(%rbp)
movq -0x30(%rbp), %rax
movl 0x150(%rax), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movq -0x30(%rbp), %rcx
movl %eax, 0x150(%rcx)
movl %eax, -0xc4(%rbp)
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0x90(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0x98(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xa0(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xa8(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xb0(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xb8(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xc0(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xc8(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xd0(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xd8(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xe0(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xe8(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xf0(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0xf8(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0x100(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0x120(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0x128(%rax), %rdx
callq 0xd210
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
callq 0xd250
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0x130(%rax), %rdx
callq 0xd300
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movq 0x138(%rax), %rdx
callq 0xd300
movl $0x0, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x188(%rcx), %eax
jge 0xcdd5
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x30(%rbp), %rax
movslq -0xc8(%rbp), %rcx
movq 0x190(%rax,%rcx,8), %rdx
callq 0xd300
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0xcd90
jmp 0xcdd7
movq -0x30(%rbp), %rax
movq 0x180(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0xce20
movq -0x58(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x180(%rax)
movq -0x58(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x30(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0x58(%rbp), %rdx
callq 0xd380
jmp 0xcdd7
movq -0x30(%rbp), %rax
addq $0x160, %rax            # imm = 0x160
movq %rax, -0x98(%rbp)
movq -0x30(%rbp), %rax
movq 0x160(%rax), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0xcedb
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0xc4(%rbp), %eax
je 0xcea7
movq -0x90(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0xd540
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0xceb9
movq -0x88(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x98(%rbp)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0xce43
movq -0x30(%rbp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq 0x168(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xcf68
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movl 0x68(%rax), %eax
cmpl -0xc4(%rbp), %eax
je 0xcf43
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xd570
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0xcf4f
movq -0x40(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x50(%rbp)
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0xcef8
movq -0x30(%rbp), %rax
addq $0x170, %rax            # imm = 0x170
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq 0x170(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xd022
movq -0x58(%rbp), %rax
movl 0x10(%rax), %eax
addl -0xac(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x58(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movl 0x60(%rax), %eax
cmpl -0xc4(%rbp), %eax
je 0xcffa
movq -0x58(%rbp), %rax
movl 0x10(%rax), %eax
addl -0xc0(%rbp), %eax
movl %eax, -0xc0(%rbp)
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0xd5d0
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0xd006
movq -0x58(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x68(%rbp)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0xcf85
movq -0x30(%rbp), %rax
addq $0x178, %rax            # imm = 0x178
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq 0x178(%rax), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0xd0ab
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rax
movsbl 0x8(%rax), %eax
cmpl -0xc4(%rbp), %eax
je 0xd08a
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0xd710
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0xd092
movq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0xd03f
movl -0x9c(%rbp), %eax
movl -0xa0(%rbp), %ecx
addl %ecx, %eax
movl -0xa4(%rbp), %ecx
addl %ecx, %eax
movl -0xa8(%rbp), %ecx
addl %ecx, %eax
movl -0xac(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0xcc(%rbp)
movl -0xb0(%rbp), %eax
movl -0xb4(%rbp), %ecx
addl %ecx, %eax
movl -0xb8(%rbp), %ecx
addl %ecx, %eax
movl -0xbc(%rbp), %ecx
addl %ecx, %eax
movl -0xc0(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0xd0(%rbp)
movl -0xcc(%rbp), %eax
movl -0xd0(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x154(%rax)
movl -0xd4(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x26366(%rip), %xmm1    # 0x334a0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x158(%rax)
cmpl $0x0, -0x34(%rbp)
je 0xd1fd
leaq -0x1e0(%rbp), %rdi
imull $0x64, -0xd0(%rbp), %eax
xorl %edx, %edx
divl -0xcc(%rbp)
movl %eax, %ecx
movl -0xb0(%rbp), %r8d
movl -0x9c(%rbp), %r9d
movl -0xb4(%rbp), %r13d
movl -0xa0(%rbp), %r12d
movl -0xb8(%rbp), %r15d
movl -0xa4(%rbp), %r14d
movl -0xc0(%rbp), %ebx
movl -0xac(%rbp), %r11d
movl -0xbc(%rbp), %r10d
movl -0xa8(%rbp), %eax
movl $0x100, %esi            # imm = 0x100
leaq 0x2e6ef(%rip), %rdx     # 0x3b8b0
movl %r13d, (%rsp)
movl %r12d, 0x8(%rsp)
movl %r15d, 0x10(%rsp)
movl %r14d, 0x18(%rsp)
movl %ebx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movl %r10d, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movb $0x0, %al
callq 0x3080
movq -0x30(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xd740
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop