// File: /workspace/github_c_makefile_star2_O0/blakemcbride[P]LISP9/ls9.c
// Function: rdlist
cell rdlist(void) {
	cell		n, a, p;
	cell		new;
	static char	badpair[] = "malformed pair";

	Inlist++;
	n = xread2();
	if (RPAREN == n) {
		Inlist--;
		return NIL;
	}
	p = NIL;
	a = cons3(n, NIL, CONST_TAG);
	protect(a);
	while (n != RPAREN) {
		if (Intr || Readerr) {
			unprot(1);
			return NIL;
		}
		if (EOFMARK == n)  {
			unprot(1);
			rderror("missing ')'", UNDEF);
			return NIL;
		}
		else if (DOT == n) {
			if (NIL == p) {
				unprot(1);
				rderror(badpair, UNDEF);
				return NIL;
			}
			n = xread2();
			cdr(p) = n;
			if (RPAREN == n || xread2() != RPAREN) {
				unprot(1);
				rderror(badpair, UNDEF);
				return NIL;
			}
			Inlist--;
			return unprot(1);
		}
		car(a) = n;
		p = a;
		n = xread2();
		if (n != RPAREN) {
			Tmp = n;
			new = cons3(NIL, NIL, CONST_TAG);
			Tmp = NIL;
			cdr(a) = new;
			a = cdr(a);
		}
	}
	Inlist--;
	return unprot(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl 0x1adbe(%rip), %eax     # 0x2061c
addl $0x1, %eax
movl %eax, 0x1adb5(%rip)     # 0x2061c
callq 0x5a80
movl %eax, -0x8(%rbp)
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
cmpl -0x8(%rbp), %eax
jne 0x5894
movl 0x1ad9d(%rip), %eax     # 0x2061c
addl $-0x1, %eax
movl %eax, 0x1ad94(%rip)     # 0x2061c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a71
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x80, %edx
callq 0x3990
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edi
movl 0x1a8b7(%rip), %esi     # 0x20170
xorl %edx, %edx
callq 0x3990
movl %eax, 0x1a8aa(%rip)     # 0x20170
cmpl $-0x5, -0x8(%rbp)
je 0x5a55
movl 0x1ad5a(%rip), %eax     # 0x20630
cmpl $0x0, %eax
jne 0x58e5
cmpq $0x0, 0x1ad45(%rip)     # 0x20628
je 0x58fb
movl $0x1, %edi
callq 0x3d00
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a71
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
cmpl -0x8(%rbp), %eax
jne 0x592c
movl $0x1, %edi
callq 0x3d00
leaq 0x15c29(%rip), %rdi     # 0x1b53f
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x55a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a71
movl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
cmpl -0x8(%rbp), %eax
jne 0x59e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl -0x10(%rbp), %eax
jne 0x596b
movl $0x1, %edi
callq 0x3d00
leaq 0x1a82f(%rip), %rdi     # 0x20184
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x55a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a71
callq 0x5a80
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edx
movq 0x1a9cb(%rip), %rax     # 0x20348
movslq -0x10(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
cmpl -0x8(%rbp), %eax
je 0x5998
callq 0x5a80
cmpl $-0x5, %eax
je 0x59bf
movl $0x1, %edi
callq 0x3d00
leaq 0x1a7db(%rip), %rdi     # 0x20184
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
callq 0x55a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a71
movl 0x1ac57(%rip), %eax     # 0x2061c
addl $-0x1, %eax
movl %eax, 0x1ac4e(%rip)     # 0x2061c
movl $0x1, %edi
callq 0x3d00
movl %eax, -0x4(%rbp)
jmp 0x5a71
jmp 0x59e2
movl -0x8(%rbp), %edx
movq 0x1a954(%rip), %rax     # 0x20340
movslq -0xc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
callq 0x5a80
movl %eax, -0x8(%rbp)
cmpl $-0x5, -0x8(%rbp)
je 0x5a50
movl -0x8(%rbp), %eax
movl %eax, 0x1a764(%rip)     # 0x20174
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x80, %edx
movl %esi, %edi
callq 0x3990
movl %eax, -0x14(%rbp)
movl $0xffffffff, 0x1a746(%rip) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %edx
movq 0x1a910(%rip), %rax     # 0x20348
movslq -0xc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x1a902(%rip), %rax     # 0x20348
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xc(%rbp)
jmp 0x58c6
movl 0x1abc1(%rip), %eax     # 0x2061c
addl $-0x1, %eax
movl %eax, 0x1abb8(%rip)     # 0x2061c
movl $0x1, %edi
callq 0x3d00
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)