// File: /workspace/github_c_makefile_star2_O1/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 0x643b
movq 0x12f2b(%rip), %rcx     # 0x19340
movq 0x12f2c(%rip), %rdx     # 0x19348
movl %ebx, %eax
movslq %eax, %rsi
cmpl %ebp, (%rcx,%rsi,4)
je 0x6433
movl (%rdx,%rsi,4), %eax
cmpl $-0x1, %eax
jne 0x641e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
setne %al
jmp 0x643d
xorl %eax, %eax
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %ebp, %ebp
js 0x65cf
testb %al, %al
jne 0x65cf
movq 0x12ef6(%rip), %rax     # 0x19350
movl %ebp, %r13d
movb (%rax,%r13), %al
testb $0x8, %al
je 0x648f
movq 0x12ed4(%rip), %rcx     # 0x19340
cmpl $-0x12, (%rcx,%r13,4)
jne 0x648f
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 0x3162
testb $0x9, %al
jne 0x65cf
movq 0x12ea2(%rip), %rax     # 0x19340
movl (%rax,%r13,4), %r15d
cmpl 0x1318f(%rip), %r15d    # 0x19638
je 0x65cf
cmpl 0x13262(%rip), %r15d    # 0x19718
je 0x64fe
cmpl 0x13271(%rip), %r15d    # 0x19730
je 0x64fe
cmpl 0x13258(%rip), %r15d    # 0x19720
je 0x64fe
cmpl 0x13253(%rip), %r15d    # 0x19724
je 0x64fe
cmpl 0x1325a(%rip), %r15d    # 0x19734
je 0x64fe
cmpl 0x13239(%rip), %r15d    # 0x1971c
je 0x650b
cmpl 0x13240(%rip), %r15d    # 0x1972c
je 0x650b
movl %r15d, %edi
callq 0x666e
testl %eax, %eax
je 0x65e1
shlq $0x2, %r13
addq 0x12e3f(%rip), %r13     # 0x19348
jmp 0x651a
movq 0x12e36(%rip), %rax     # 0x19348
movslq (%rax,%r13,4), %rcx
leaq (%rax,%rcx,4), %r13
movb $0x1, %r12b
movl (%r13), %ebp
movl 0x12c49(%rip), %esi     # 0x19170
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x3162
movl %eax, 0x12c31(%rip)     # 0x19170
testl %ebp, %ebp
js 0x65b3
movq 0x12e06(%rip), %rax     # 0x19350
movl %ebp, %r15d
testb $0x9, (%rax,%r15)
jne 0x65b3
movq 0x12de5(%rip), %rax     # 0x19340
movl (%rax,%r15,4), %edi
movl %ebx, %esi
callq 0x63fa
movl %eax, %ebp
movl 0x12c02(%rip), %esi     # 0x19170
movl %eax, %edi
xorl %edx, %edx
callq 0x3162
movl %eax, 0x12bf3(%rip)     # 0x19170
movl %r14d, %edi
movl %ebp, %esi
callq 0x62f1
movl %eax, %r14d
movl $0x1, %edi
callq 0x33d7
movq 0x12da5(%rip), %rax     # 0x19340
movslq 0x12bce(%rip), %rcx     # 0x19170
movl %r14d, (%rax,%rcx,4)
movq 0x12d9b(%rip), %rax     # 0x19348
movl (%rax,%r15,4), %ebp
jmp 0x653f
movl $0x1, %edi
callq 0x33d7
movl %eax, %r14d
testb %r12b, %r12b
jne 0x65cf
movl $0x3, %edi
callq 0x33d7
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %r12b
cmpl 0x1313d(%rip), %r15d    # 0x19728
jne 0x6521
movl 0x12b79(%rip), %esi     # 0x19170
xorl %r12d, %r12d
movl %ebx, %edi
xorl %edx, %edx
callq 0x3162
movl %eax, 0x12b67(%rip)     # 0x19170
movq 0x12d30(%rip), %rax     # 0x19340
movq 0x12d31(%rip), %rcx     # 0x19348
movslq (%rcx,%r13,4), %rcx
movl (%rax,%rcx,4), %edi
callq 0x6086
movl %eax, %ebp
movl 0x12b45(%rip), %esi     # 0x19170
movl %eax, %edi
xorl %edx, %edx
callq 0x3162
movl %eax, 0x12b36(%rip)     # 0x19170
movl %ebp, %edi
movl %ebx, %esi
callq 0x62f1
movl %eax, %ebx
movl 0x12b25(%rip), %esi     # 0x19170
movl %eax, %edi
xorl %edx, %edx
callq 0x3162
movl %eax, 0x12b16(%rip)     # 0x19170
movq 0x12ce7(%rip), %rax     # 0x19348
movslq (%rax,%r13,4), %rcx
leaq (%rax,%rcx,4), %r13
jmp 0x651d