// File: /workspace/github_c_makefile_star2_O0/hughbarney[P]zepl/lisp.c
// Function: writeObject
void writeObject(Object * object, bool readably, Stream *stream)
{
	switch (object->type) {
#define CASE(type, ...)                                                      \
  case type:                                                                 \
    writeFmt(stream, __VA_ARGS__);                                              \
    break
		CASE(TYPE_NUMBER, "%g", object->number);
		CASE(TYPE_SYMBOL, "%s", object->string);
		CASE(TYPE_PRIMITIVE, "#<Primitive %s>", object->name);
#undef CASE
	case TYPE_STRING:
		if (readably) {
			writeChar('"', stream);
			for (char *string = object->string; *string; ++string) {
				switch (*string) {
				case '"':
					writeString("\\\"", stream);
					break;
				case '\t':
					writeString("\\t", stream);
					break;
				case '\r':
					writeString("\\r", stream);
					break;
				case '\n':
					writeString("\\n", stream);
					break;
				case '\\':
					writeString("\\\\", stream);
					break;
				default:
					writeChar(*string, stream);
					break;
				}
			}
			writeChar('"', stream);
		} else
			writeFmt(stream, "%s", object->string);
		break;
	case TYPE_CONS:
		writeChar('(', stream);
		writeObject(object->car, readably, stream);
		while (object->cdr != nil) {
			object = object->cdr;
			if (object->type == TYPE_CONS) {
				writeChar(' ', stream);
				writeObject(object->car, readably, stream);
			} else {
				writeString(" . ", stream);
				writeObject(object, readably, stream);
				break;
			}
		}
		writeChar(')', stream);
		break;
#define CASE(type, name, object)                                             \
  case type:                                                                 \
    writeFmt(stream, "#<%s ", name);                                            \
    writeObject(object, readably, stream);                                     \
    writeChar('>', stream);                                                    \
    break
		CASE(TYPE_LAMBDA, "Lambda", object->params);
		CASE(TYPE_MACRO, "Macro", object->params);
		CASE(TYPE_ENV, "Env", object->vars);
#undef CASE
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x28(%rbp)
subq $0x7, %rax
ja 0x552f
movq -0x28(%rbp), %rax
leaq 0x6209(%rip), %rcx      # 0xb440
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movsd 0x10(%rax), %xmm0
leaq 0x6479(%rip), %rsi      # 0xb6cd
movb $0x1, %al
callq 0x4f80
jmp 0x552f
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x10, %rdx
leaq 0x6340(%rip), %rsi      # 0xb5b3
movb $0x0, %al
callq 0x4f80
jmp 0x552f
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x643e(%rip), %rsi      # 0xb6d0
movb $0x0, %al
callq 0x4f80
jmp 0x552f
testb $0x1, -0x9(%rbp)
je 0x5397
movq -0x18(%rbp), %rsi
movl $0x22, %edi
callq 0x5070
movq -0x8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x5387
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x9, %eax
je 0x531a
jmp 0x52e0
movl -0x2c(%rbp), %eax
subl $0xa, %eax
je 0x533e
jmp 0x52ea
movl -0x2c(%rbp), %eax
subl $0xd, %eax
je 0x532c
jmp 0x52f4
movl -0x2c(%rbp), %eax
subl $0x22, %eax
je 0x5308
jmp 0x52fe
movl -0x2c(%rbp), %eax
subl $0x5c, %eax
je 0x5350
jmp 0x5362
movq -0x18(%rbp), %rsi
leaq 0x63cd(%rip), %rdi      # 0xb6e0
callq 0x4eb0
jmp 0x5374
movq -0x18(%rbp), %rsi
leaq 0x63be(%rip), %rdi      # 0xb6e3
callq 0x4eb0
jmp 0x5374
movq -0x18(%rbp), %rsi
leaq 0x63af(%rip), %rdi      # 0xb6e6
callq 0x4eb0
jmp 0x5374
movq -0x18(%rbp), %rsi
leaq 0x63a0(%rip), %rdi      # 0xb6e9
callq 0x4eb0
jmp 0x5374
movq -0x18(%rbp), %rsi
leaq 0x6391(%rip), %rdi      # 0xb6ec
callq 0x4eb0
jmp 0x5374
movq -0x20(%rbp), %rax
movb (%rax), %al
movq -0x18(%rbp), %rsi
movsbl %al, %edi
callq 0x5070
jmp 0x5376
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x52c2
movq -0x18(%rbp), %rsi
movl $0x22, %edi
callq 0x5070
jmp 0x53b1
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x10, %rdx
leaq 0x6209(%rip), %rsi      # 0xb5b3
movb $0x0, %al
callq 0x4f80
jmp 0x552f
movq -0x18(%rbp), %rsi
movl $0x28, %edi
callq 0x5070
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movb -0x9(%rbp), %al
movq -0x18(%rbp), %rdx
andb $0x1, %al
movzbl %al, %esi
callq 0x5200
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
cmpq 0x9e34(%rip), %rax      # 0xf220
je 0x5455
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x542c
movq -0x18(%rbp), %rsi
movl $0x20, %edi
callq 0x5070
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movb -0x9(%rbp), %al
movq -0x18(%rbp), %rdx
andb $0x1, %al
movzbl %al, %esi
callq 0x5200
jmp 0x5453
movq -0x18(%rbp), %rsi
leaq 0x62b8(%rip), %rdi      # 0xb6ef
callq 0x4eb0
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movq -0x18(%rbp), %rdx
andb $0x1, %al
movzbl %al, %esi
callq 0x5200
jmp 0x5455
jmp 0x53dd
movq -0x18(%rbp), %rsi
movl $0x29, %edi
callq 0x5070
jmp 0x552f
movq -0x18(%rbp), %rdi
leaq 0x6280(%rip), %rsi      # 0xb6f3
leaq 0x627f(%rip), %rdx      # 0xb6f9
movb $0x0, %al
callq 0x4f80
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movb -0x9(%rbp), %al
movq -0x18(%rbp), %rdx
andb $0x1, %al
movzbl %al, %esi
callq 0x5200
movq -0x18(%rbp), %rsi
movl $0x3e, %edi
callq 0x5070
jmp 0x552f
movq -0x18(%rbp), %rdi
leaq 0x623b(%rip), %rsi      # 0xb6f3
leaq 0x6241(%rip), %rdx      # 0xb700
movb $0x0, %al
callq 0x4f80
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movb -0x9(%rbp), %al
movq -0x18(%rbp), %rdx
andb $0x1, %al
movzbl %al, %esi
callq 0x5200
movq -0x18(%rbp), %rsi
movl $0x3e, %edi
callq 0x5070
jmp 0x552f
movq -0x18(%rbp), %rdi
leaq 0x61f9(%rip), %rsi      # 0xb6f3
leaq 0x6205(%rip), %rdx      # 0xb706
movb $0x0, %al
callq 0x4f80
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movb -0x9(%rbp), %al
movq -0x18(%rbp), %rdx
andb $0x1, %al
movzbl %al, %esi
callq 0x5200
movq -0x18(%rbp), %rsi
movl $0x3e, %edi
callq 0x5070
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)