// File: /workspace/github_c_makefile_star2_O0/blakemcbride[P]LISP9/ls9.c
// Function: expand
cell expand(cell x, int r) {
	cell	n, m;

	if (Mxlev < 0) error("interrupted", UNDEF);
	if (Mxlev > MXMAX)
		error("too many levels of macro expansion", UNDEF);
	if (atomp(x)) {
		return x;
	}
	if (car(x) == S_quote) {
		return x;
	}
	Mxlev++;
	if (car(x) == S_lambda) {
		protect(x);
		n = mapexp(cddr(x), r);
		n = cons(cadr(x), n);
		n = cons(car(x), n);
		unprot(1);
		Mxlev--;
		return n;
	}
	if (car(x) == S_defun || car(x) == S_defmac) {
		protect(x);
		x = expanddef(x);
		car(Protected) = x;
		x = expand(x, r);
		unprot(1);
		Mxlev--;
		return x;
	}
	if (	symbolp(car(x)) &&
		(m = assq(car(x), Macros)) != NIL)
	{
		protect(x);
		n = cons(cdr(x), NIL);
		n = cons(S_quote, n);
		n = cons(n, NIL);
		n = cons(cdr(m), n);
		n = cons(S_apply, n);
		x = eval(n, 1);
		car(Protected) = x;
		if (r) x = expand(x, r);
		unprot(1);
		Mxlev--;
		return x;
	}
	x = mapexp(x, r);
	Mxlev--;
	return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl 0x13e34(%rip), %eax     # 0x20948
cmpl $0x0, %eax
jge 0xcb2a
leaq 0xebba(%rip), %rdi      # 0x1b6da
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x26c0
movl 0x13e18(%rip), %eax     # 0x20948
cmpl $0x7d0, %eax            # imm = 0x7D0
jle 0xcb48
leaq 0xeda8(%rip), %rdi      # 0x1b8e6
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x26c0
cmpl $0x0, -0x8(%rbp)
jl 0xcb7c
movq 0x137fb(%rip), %rax     # 0x20350
movslq -0x8(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xcb7c
movq 0x137e4(%rip), %rax     # 0x20350
movslq -0x8(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xcb87
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xce89
movq 0x137b2(%rip), %rax     # 0x20340
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x13a9d(%rip), %eax     # 0x20638
jne 0xcba8
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xce89
movl 0x13d9a(%rip), %eax     # 0x20948
addl $0x1, %eax
movl %eax, 0x13d91(%rip)     # 0x20948
movq 0x13782(%rip), %rax     # 0x20340
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x13b5d(%rip), %eax     # 0x20728
jne 0xcc70
movl -0x8(%rbp), %edi
movl 0x13596(%rip), %esi     # 0x20170
xorl %edx, %edx
callq 0x3990
movl %eax, 0x13589(%rip)     # 0x20170
movq 0x1375a(%rip), %rax     # 0x20348
movq 0x13753(%rip), %rcx     # 0x20348
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edi
movl -0xc(%rbp), %esi
callq 0xc9d0
movl %eax, -0x10(%rbp)
movq 0x1372e(%rip), %rax     # 0x20340
movq 0x1372f(%rip), %rcx     # 0x20348
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edi
movl -0x10(%rbp), %esi
xorl %edx, %edx
callq 0x3990
movl %eax, -0x10(%rbp)
movq 0x13708(%rip), %rax     # 0x20340
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %edi
movl -0x10(%rbp), %esi
xorl %edx, %edx
callq 0x3990
movl %eax, -0x10(%rbp)
movl $0x1, %edi
callq 0x3d00
movl 0x13cec(%rip), %eax     # 0x20948
addl $-0x1, %eax
movl %eax, 0x13ce3(%rip)     # 0x20948
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xce89
movq 0x136c9(%rip), %rax     # 0x20340
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x13cbc(%rip), %eax     # 0x20940
je 0xcc9c
movq 0x136b3(%rip), %rax     # 0x20340
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x13cb2(%rip), %eax     # 0x2094c
jne 0xcd03
movl -0x8(%rbp), %edi
movl 0x134cb(%rip), %esi     # 0x20170
xorl %edx, %edx
callq 0x3990
movl %eax, 0x134be(%rip)     # 0x20170
movl -0x8(%rbp), %edi
callq 0xd380
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edx
movq 0x13679(%rip), %rax     # 0x20340
movslq 0x134a2(%rip), %rcx     # 0x20170
movl %edx, (%rax,%rcx,4)
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
callq 0xcb00
movl %eax, -0x8(%rbp)
movl $0x1, %edi
callq 0x3d00
movl 0x13c59(%rip), %eax     # 0x20948
addl $-0x1, %eax
movl %eax, 0x13c50(%rip)     # 0x20948
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xce89
movq 0x13636(%rip), %rax     # 0x20340
movslq -0x8(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jl 0xce66
movq 0x13631(%rip), %rax     # 0x20350
movq 0x1361a(%rip), %rcx     # 0x20340
movslq -0x8(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xce66
movq 0x135fb(%rip), %rcx     # 0x20340
movq 0x135f4(%rip), %rax     # 0x20340
movslq -0x8(%rbp), %rdx
movslq (%rax,%rdx,4), %rdx
movl $0xffffffee, %eax       # imm = 0xFFFFFFEE
cmpl (%rcx,%rdx,4), %eax
jne 0xce66
movq 0x135d7(%rip), %rax     # 0x20340
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %edi
movl 0x13442(%rip), %esi     # 0x201b8
callq 0x27c0
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0xce66
movl -0x8(%rbp), %edi
movl 0x133e0(%rip), %esi     # 0x20170
xorl %edx, %edx
callq 0x3990
movl %eax, 0x133d3(%rip)     # 0x20170
movq 0x135a4(%rip), %rax     # 0x20348
movslq -0x8(%rbp), %rcx
movl (%rax,%rcx,4), %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x3990
movl %eax, -0x10(%rbp)
movl 0x13878(%rip), %edi     # 0x20638
movl -0x10(%rbp), %esi
xorl %edx, %edx
callq 0x3990
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x3990
movl %eax, -0x10(%rbp)
movq 0x13562(%rip), %rax     # 0x20348
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edi
movl -0x10(%rbp), %esi
xorl %edx, %edx
callq 0x3990
movl %eax, -0x10(%rbp)
movl 0x13918(%rip), %edi     # 0x20718
movl -0x10(%rbp), %esi
xorl %edx, %edx
callq 0x3990
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edi
movl $0x1, %esi
callq 0xd550
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edx
movq 0x13519(%rip), %rax     # 0x20340
movslq 0x13342(%rip), %rcx     # 0x20170
movl %edx, (%rax,%rcx,4)
cmpl $0x0, -0xc(%rbp)
je 0xce45
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
callq 0xcb00
movl %eax, -0x8(%rbp)
movl $0x1, %edi
callq 0x3d00
movl 0x13af3(%rip), %eax     # 0x20948
addl $-0x1, %eax
movl %eax, 0x13aea(%rip)     # 0x20948
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xce89
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
callq 0xc9d0
movl %eax, -0x8(%rbp)
movl 0x13ace(%rip), %eax     # 0x20948
addl $-0x1, %eax
movl %eax, 0x13ac5(%rip)     # 0x20948
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)