// File: /workspace/github_c_makefile_star2_O3/blakemcbride[P]LISP9/ls9.c
// Function: freevars
cell freevars(cell x, cell e) {
	cell	n, u, a;
	int	lam;

	lam = 0;
	if (memq(x, e) != NIL) {
		return NIL;
	}
	else if (symbolp(x)) {
		return cons(x, NIL);
	}
	else if (!pairp(x)) {
		return NIL;
	}
	else if (car(x) == S_quote) {
		return NIL;
	}
	else if (car(x) == S_apply ||
		 car(x) == S_prog ||
		 car(x) == S_if ||
		 car(x) == S_ifstar ||
		 car(x) == S_setq
	) {
		x = cdr(x);
	}
	else if (car(x) == S_def ||
		 car(x) == S_macro
	) {
		x = cddr(x);
	}
	else if (subrp(car(x))) {
		x = cdr(x);
	}
	else if (car(x) == S_lambda) {
		protect(e);
		a = flatargs(cadr(x));
		protect(a);
		n = set_union(a, e);
		protect(n);
		e = n;
		x = cddr(x);
		lam = 1;
	}
	protect(u = NIL);
	while (pairp(x)) {
		n = freevars(car(x), e);
		protect(n);
		u = set_union(u, n);
		unprot(1);;
		car(Protected) = u;
		x = cdr(x);
	}
	n = unprot(1);
	if (lam) e = unprot(3);
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
cmpl $-0x1, %esi
je 0x637e
movq 0x12fdf(%rip), %rax     # 0x19340
movq 0x12fe0(%rip), %rcx     # 0x19348
movl %ebx, %edx
movslq %edx, %rdx
cmpl %ebp, (%rax,%rdx,4)
je 0x643c
movl (%rcx,%rdx,4), %edx
cmpl $-0x1, %edx
jne 0x636a
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %ebp, %ebp
js 0x6442
movq 0x12fbd(%rip), %rax     # 0x19350
movl %ebp, %r13d
movb (%rax,%r13), %al
testb $0x8, %al
je 0x63c8
movq 0x12f9b(%rip), %rcx     # 0x19340
cmpl $-0x12, (%rcx,%r13,4)
jne 0x63c8
movl %ebp, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30e7
testb $0x9, %al
jne 0x6442
movq 0x12f6d(%rip), %rax     # 0x19340
movl (%rax,%r13,4), %r15d
cmpl 0x1325a(%rip), %r15d    # 0x19638
je 0x6442
cmpl 0x13331(%rip), %r15d    # 0x19718
je 0x642f
cmpl 0x13340(%rip), %r15d    # 0x19730
je 0x642f
cmpl 0x13327(%rip), %r15d    # 0x19720
je 0x642f
cmpl 0x13322(%rip), %r15d    # 0x19724
je 0x642f
cmpl 0x13329(%rip), %r15d    # 0x19734
je 0x642f
cmpl 0x13308(%rip), %r15d    # 0x1971c
je 0x6454
cmpl 0x1330f(%rip), %r15d    # 0x1972c
je 0x6454
movl %r15d, %edi
callq 0x65ae
testl %eax, %eax
je 0x6521
shlq $0x2, %r13
addq 0x12f0e(%rip), %r13     # 0x19348
jmp 0x6463
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x12eed(%rip), %rax     # 0x19348
movslq (%rax,%r13,4), %rcx
leaq (%rax,%rcx,4), %r13
movb $0x1, %r12b
movl (%r13), %ebp
movl 0x12d00(%rip), %esi     # 0x19170
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x30e7
movl %eax, 0x12ce8(%rip)     # 0x19170
testl %ebp, %ebp
js 0x64fc
movq 0x12ebd(%rip), %rax     # 0x19350
movl %ebp, %r15d
testb $0x9, (%rax,%r15)
jne 0x64fc
movq 0x12e9c(%rip), %rax     # 0x19340
movl (%rax,%r15,4), %edi
movl %ebx, %esi
callq 0x6346
movl %eax, %ebp
movl 0x12cb9(%rip), %esi     # 0x19170
movl %eax, %edi
xorl %edx, %edx
callq 0x30e7
movl %eax, 0x12caa(%rip)     # 0x19170
movl %r14d, %edi
movl %ebp, %esi
callq 0x6243
movl %eax, %r14d
movl $0x1, %edi
callq 0x335c
movq 0x12e5c(%rip), %rax     # 0x19340
movslq 0x12c85(%rip), %rcx     # 0x19170
movl %r14d, (%rax,%rcx,4)
movq 0x12e52(%rip), %rax     # 0x19348
movl (%rax,%r15,4), %ebp
jmp 0x6488
movl $0x1, %edi
callq 0x335c
movl %eax, %r14d
testb %r12b, %r12b
jne 0x6442
movl $0x3, %edi
callq 0x335c
jmp 0x6442
movb $0x1, %r12b
cmpl 0x131fd(%rip), %r15d    # 0x19728
jne 0x646a
movl 0x12c39(%rip), %esi     # 0x19170
xorl %r12d, %r12d
movl %ebx, %edi
xorl %edx, %edx
callq 0x30e7
movl %eax, 0x12c27(%rip)     # 0x19170
movq 0x12df0(%rip), %rax     # 0x19340
movq 0x12df1(%rip), %rcx     # 0x19348
movslq (%rcx,%r13,4), %rcx
movl (%rax,%rcx,4), %edi
callq 0x6008
movl %eax, %ebp
movl 0x12c05(%rip), %esi     # 0x19170
movl %eax, %edi
xorl %edx, %edx
callq 0x30e7
movl %eax, 0x12bf6(%rip)     # 0x19170
movl %ebp, %edi
movl %ebx, %esi
callq 0x6243
movl %eax, %ebx
movl 0x12be5(%rip), %esi     # 0x19170
movl %eax, %edi
xorl %edx, %edx
callq 0x30e7
movl %eax, 0x12bd6(%rip)     # 0x19170
movq 0x12da7(%rip), %rax     # 0x19348
movslq (%rax,%r13,4), %rcx
leaq (%rax,%rcx,4), %r13
jmp 0x6466