// File: /workspace/github_c_makefile_star2_O0/hughbarney[P]zepl/lisp.c
// Function: readList
Object *readList(Stream * stream, GC_PARAM)
{
	GC_TRACE(gcList, nil);
	GC_TRACE(gcLast, nil);

	for (;;) {
		int ch = readNext(stream);
		if (ch == EOF)
			exception("unexpected end of stream in list");
		else if (ch == ')')
			return reverseList(*gcList);
		else if (ch == '.' && !isSymbolChar(streamPeek(stream))) {
			if (*gcLast == nil)
				exception("unexpected dot at start of list");
			if ((ch = peekNext(stream)) == ')')
				exception("expected object at end of dotted list");
			if (!(*gcLast = readExpr(stream, GC_ROOTS)))
				exception("unexpected end of stream in dotted list");
			if ((ch = peekNext(stream)) != ')')
				exception("unexpected object at end of dotted list");
			readNext(stream);
			Object *list = reverseList(*gcList);
			(*gcList)->cdr = *gcLast;

			return list;
		} else {
			*gcLast = readExpr(streamSeek(stream, -1), GC_ROOTS);
			*gcList = newCons(gcLast, gcList, GC_ROOTS);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x3, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq 0x8577(%rip), %rax      # 0xf220
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x40(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x3, -0x70(%rbp)
movq $0x0, -0x68(%rbp)
movq 0x8541(%rip), %rax      # 0xf220
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x70(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6680
movl %eax, -0x7c(%rbp)
cmpl $-0x1, -0x7c(%rbp)
jne 0x6d23
xorl %eax, %eax
movl %eax, %edi
leaq 0x48ff(%rip), %rsi      # 0xb61b
movb $0x0, %al
callq 0x50e0
cmpl $0x29, -0x7c(%rbp)
jne 0x6d3e
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x6c30
movq %rax, -0x8(%rbp)
jmp 0x6e78
cmpl $0x2e, -0x7c(%rbp)
jne 0x6e30
movq -0x10(%rbp), %rdi
callq 0x6640
movl %eax, %edi
callq 0x6a30
cmpl $0x0, %eax
jne 0x6e30
movq -0x78(%rbp), %rax
movq (%rax), %rax
cmpq 0x84b1(%rip), %rax      # 0xf220
jne 0x6d83
xorl %eax, %eax
movl %eax, %edi
leaq 0x48c0(%rip), %rsi      # 0xb63c
movb $0x0, %al
callq 0x50e0
movq -0x10(%rbp), %rdi
callq 0x6700
movl %eax, -0x7c(%rbp)
cmpl $0x29, %eax
jne 0x6da6
xorl %eax, %eax
movl %eax, %edi
leaq 0x48e7(%rip), %rsi      # 0xb686
movb $0x0, %al
callq 0x50e0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6880
movq -0x78(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x6dd2
xorl %eax, %eax
movl %eax, %edi
leaq 0x4891(%rip), %rsi      # 0xb65c
movb $0x0, %al
callq 0x50e0
movq -0x10(%rbp), %rdi
callq 0x6700
movl %eax, -0x7c(%rbp)
cmpl $0x29, %eax
je 0x6df5
xorl %eax, %eax
movl %eax, %edi
leaq 0x4896(%rip), %rsi      # 0xb684
movb $0x0, %al
callq 0x50e0
movq -0x10(%rbp), %rdi
callq 0x6680
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x6c30
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x88(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6e78
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x65f0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x6880
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, (%rax)
movq -0x78(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x5d50
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
jmp 0x6e71
jmp 0x6e73
jmp 0x6cff
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)