// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: readNumberOrSymbol
Object *readNumberOrSymbol(Stream * stream, GC_PARAM)
{
	size_t offset = stream->offset;
	int ch = streamPeek(stream);

	// skip optional leading sign
	if (ch == '+' || ch == '-') {
		streamGetc(stream);
		ch = streamPeek(stream);
	}
	// try to read a number in integer or decimal format
	if (ch == '.' || isdigit(ch)) {
		if (isdigit(ch))
			ch = readWhile(stream, isdigit);
		if (!isSymbolChar(ch))
			return newNumber(strtol(stream->buffer + offset, NULL, 10), GC_ROOTS);
		if (ch == '.') {
			ch = streamGetc(stream);
			if (isdigit(streamPeek(stream))) {
				ch = readWhile(stream, isdigit);
				if (!isSymbolChar(ch))
					return newNumber(strtod(stream->buffer + offset, NULL), GC_ROOTS);
			}
		}
	}
	// non-numeric character encountered, read a symbol
	readWhile(stream, isSymbolChar);
	return newSymbolWithLength(stream->buffer + offset, stream->offset - offset, GC_ROOTS);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r13
movq %rdi, %r15
movq 0x28(%rdi), %rbp
callq 0x4df3
movl %eax, %r14d
cmpl $-0x1, %eax
je 0x53fb
movq 0x28(%r15), %rax
leaq -0x1(%rax), %rcx
xorl %edx, %edx
cmpq $0x2, %rax
cmovgeq %rcx, %rdx
movq %rdx, 0x28(%r15)
cmpl $0x2d, %r14d
je 0x53cd
cmpl $0x2b, %r14d
jne 0x53fb
movq %r15, %rdi
callq 0x4df3
movq %r15, %rdi
callq 0x4df3
movl %eax, %r14d
cmpl $-0x1, %eax
je 0x53fb
movq 0x28(%r15), %rax
leaq -0x1(%rax), %rcx
xorl %edx, %edx
cmpq $0x2, %rax
cmovgeq %rcx, %rdx
movq %rdx, 0x28(%r15)
movslq %r14d, %rbx
cmpl $0x2e, %r14d
je 0x5417
callq 0x2340
movq (%rax), %rax
testb $0x8, 0x1(%rax,%rbx,2)
je 0x5526
movq %rbp, 0x8(%rsp)
movq %r13, 0x10(%rsp)
callq 0x2340
movq %rax, %r12
movq (%rax), %rax
testb $0x8, 0x1(%rax,%rbx,2)
je 0x547a
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x4df3
movl %eax, %r13d
cmpl $-0x1, %eax
je 0x5459
movq 0x28(%r15), %rax
leaq -0x1(%rax), %rcx
cmpq $0x2, %rax
cmovlq %rbx, %rcx
movq %rcx, 0x28(%r15)
movl %r13d, %r14d
addl $-0x3a, %r13d
cmpl $-0xa, %r13d
jb 0x5471
movq %r15, %rdi
callq 0x4df3
movl %ebp, %r14d
movl %r14d, %ebp
cmpl $-0xb, %r13d
ja 0x5435
movl %r14d, %edi
callq 0x534d
testl %eax, %eax
je 0x5559
cmpl $0x2e, %r14d
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %rbp
jne 0x5526
movq %r15, %rdi
callq 0x4df3
movq (%r12), %rbx
movq %r15, %rdi
callq 0x4df3
cmpl $-0x1, %eax
je 0x54cd
movq 0x28(%r15), %rcx
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
cmpq $0x2, %rcx
cmovgeq %rdx, %rsi
movq %rsi, 0x28(%r15)
cltq
testb $0x8, 0x1(%rbx,%rax,2)
je 0x5526
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x4df3
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x54fb
movq 0x28(%r15), %rax
leaq -0x1(%rax), %rcx
cmpq $0x2, %rax
cmovlq %rbx, %rcx
movq %rcx, 0x28(%r15)
movl %ebp, %edi
addl $-0x3a, %ebp
cmpl $-0xa, %ebp
jb 0x5510
movq %r15, %rdi
callq 0x4df3
movl %r14d, %edi
movl %edi, %r14d
cmpl $-0xb, %ebp
ja 0x54d8
callq 0x534d
testl %eax, %eax
movq 0x8(%rsp), %rbp
je 0x55a4
leaq -0x1e0(%rip), %rsi      # 0x534d
movq %r15, %rdi
callq 0x5076
movq 0x8(%r15), %rdi
addq %rbp, %rdi
movq 0x28(%r15), %rsi
subq %rbp, %rsi
movq %r13, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4ac8
movq 0x8(%rsp), %rdi
addq 0x8(%r15), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x21d0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x28, %esi
xorl %edi, %edi
movq 0x10(%rsp), %rdx
callq 0x481c
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq 0x8(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x2090
movsd %xmm0, 0x8(%rsp)
movl $0x28, %esi
xorl %edi, %edi
movq %r13, %rdx
jmp 0x5585