// File: /workspace/github_c_makefile_star2_O2/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
callq 0x5496
pushq $-0x1
popq %r14
testl %ebp, %ebp
js 0x5988
cmpl $-0x1, %eax
jne 0x5988
movq 0x11b35(%rip), %rax     # 0x17350
movl %ebp, %r13d
movb (%rax,%r13), %al
testb $0x8, %al
je 0x584e
movq 0x11b13(%rip), %rcx     # 0x17340
cmpl $-0x12, (%rcx,%r13,4)
jne 0x584e
pushq $-0x1
popq %rsi
movl %ebp, %edi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f8c
testb $0x9, %al
jne 0x5988
movq 0x11ae3(%rip), %rax     # 0x17340
movl (%rax,%r13,4), %r15d
cmpl 0x11dd0(%rip), %r15d    # 0x17638
je 0x5988
cmpl 0x11ea3(%rip), %r15d    # 0x17718
je 0x58bd
cmpl 0x11eb2(%rip), %r15d    # 0x17730
je 0x58bd
cmpl 0x11e99(%rip), %r15d    # 0x17720
je 0x58bd
cmpl 0x11e94(%rip), %r15d    # 0x17724
je 0x58bd
cmpl 0x11e9b(%rip), %r15d    # 0x17734
je 0x58bd
cmpl 0x11e7a(%rip), %r15d    # 0x1771c
je 0x58ca
cmpl 0x11e81(%rip), %r15d    # 0x1772c
je 0x58ca
movl %r15d, %edi
callq 0x5a27
testl %eax, %eax
je 0x599a
shlq $0x2, %r13
addq 0x11a80(%rip), %r13     # 0x17348
jmp 0x58d9
movq 0x11a77(%rip), %rax     # 0x17348
movslq (%rax,%r13,4), %rcx
leaq (%rax,%rcx,4), %r13
movb $0x1, %r12b
movl (%r13), %ebp
movl 0x1188a(%rip), %esi     # 0x17170
pushq $-0x1
popq %r14
movl %r14d, %edi
xorl %edx, %edx
callq 0x2f8c
movl %eax, 0x11876(%rip)     # 0x17170
pushq $0x1
popq %r15
testl %ebp, %ebp
js 0x5970
movq 0x11a47(%rip), %rax     # 0x17350
movl %ebp, %r13d
testb $0x9, (%rax,%r13)
jne 0x5970
movq 0x11a26(%rip), %rax     # 0x17340
movl (%rax,%r13,4), %edi
movl %ebx, %esi
callq 0x57eb
movl %eax, %ebp
movl 0x11843(%rip), %esi     # 0x17170
movl %eax, %edi
xorl %edx, %edx
callq 0x2f8c
movl %eax, 0x11834(%rip)     # 0x17170
movl %r14d, %edi
movl %ebp, %esi
callq 0x571b
movl %eax, %r14d
movl %r15d, %edi
callq 0x31a9
movq 0x119e8(%rip), %rax     # 0x17340
movslq 0x11811(%rip), %rcx     # 0x17170
movl %r14d, (%rax,%rcx,4)
movq 0x119de(%rip), %rax     # 0x17348
movl (%rax,%r13,4), %ebp
jmp 0x58fe
pushq $0x1
popq %rdi
callq 0x31a9
movl %eax, %r14d
testb %r12b, %r12b
jne 0x5988
pushq $0x3
popq %rdi
callq 0x31a9
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %r12b
cmpl 0x11d84(%rip), %r15d    # 0x17728
jne 0x58e0
movl 0x117c0(%rip), %esi     # 0x17170
xorl %r12d, %r12d
movl %ebx, %edi
xorl %edx, %edx
callq 0x2f8c
movl %eax, 0x117ae(%rip)     # 0x17170
movq 0x11977(%rip), %rax     # 0x17340
movq 0x11978(%rip), %rcx     # 0x17348
movslq (%rcx,%r13,4), %rcx
movl (%rax,%rcx,4), %edi
callq 0x5503
movl %eax, %ebp
movl 0x1178c(%rip), %esi     # 0x17170
movl %eax, %edi
xorl %edx, %edx
callq 0x2f8c
movl %eax, 0x1177d(%rip)     # 0x17170
movl %ebp, %edi
movl %ebx, %esi
callq 0x571b
movl %eax, %ebx
movl 0x1176c(%rip), %esi     # 0x17170
movl %eax, %edi
xorl %edx, %edx
callq 0x2f8c
movl %eax, 0x1175d(%rip)     # 0x17170
movq 0x1192e(%rip), %rax     # 0x17348
movslq (%rax,%r13,4), %rcx
leaq (%rax,%rcx,4), %r13
jmp 0x58dc