LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: writeString
void writeString(char *str, Stream *stream)
{
   int len;
   char *new;

   switch (stream->type) {
   case STREAM_TYPE_FILE:
        len = strlen(str);
        len = write(stream->fd, str, len);
	return;

    case STREAM_TYPE_STRING:
    default:		
        len = strlen(str);
	new = realloc(stream->buffer, stream->length + len + 1);
	assert(new != NULL);
	memcpy(new + stream->length, str, len);
	stream->buffer = new;
	stream->length += len;
	new[stream->length] = '\0';
	return;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %ebp
callq 0x20e0
cmpl $0x1, %ebp
jne 0x4249
movl 0x10(%rbx), %edi
movslq %eax, %rdx
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20b0
movq 0x8(%rbx), %rdi
movq 0x18(%rbx), %rcx
movslq %eax, %r15
leaq (%r15,%rcx), %rsi
incq %rsi
callq 0x2220
movq %rax, %r12
movq 0x18(%rbx), %r13
leaq (%rax,%r13), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x21e0
movq %r12, 0x8(%rbx)
addq %r15, %r13
movq %r13, 0x18(%rbx)
movb $0x0, (%r12,%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: writeFmt
void writeFmt(Stream *stream, char *format, ...)
{
    static char buf[WRITE_FMT_BUFSIZ];
    int nbytes;

    va_list args;
    va_start(args, format);
    nbytes = vsnprintf(buf, WRITE_FMT_BUFSIZ, format, args);
    va_end(args);

    switch (stream->type) {
    case STREAM_TYPE_FILE:
	nbytes = write(stream->fd, buf, nbytes);
	return;

    case STREAM_TYPE_STRING:
    default:
	writeString(buf, stream);
	return;
    }
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x42f3
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0x9b46(%rip), %rdi      # 0xde60
movl $0x800, %esi            # imm = 0x800
movq %r10, %rdx
callq 0x20a0
cmpl $0x1, (%rbx)
jne 0x4340
movl 0x10(%rbx), %edi
movslq %eax, %rdx
leaq 0x9b27(%rip), %rsi      # 0xde60
callq 0x20b0
jmp 0x434f
leaq 0x9b19(%rip), %rdi      # 0xde60
movq %rbx, %rsi
callq 0x4210
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: exceptionWithObject
void exceptionWithObject(Object * object, char *format, ...)
{
	static char buf[WRITE_FMT_BUFSIZ];
	
	writeString("error: ", &ostream);

	if (object) {
		writeObject(object, true, &ostream);
		writeChar(' ', &ostream);
	}

	va_list args;
	va_start(args, format);
	vsnprintf(buf, WRITE_FMT_BUFSIZ, format, args);
	va_end(args);

	writeString(buf, &ostream);
	writeChar('\n', &ostream);

	longjmp(exceptionEnv, 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x43e9
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
leaq 0x40a0(%rip), %rdi      # 0x8490
leaq 0x8dd9(%rip), %rsi      # 0xd1d0
callq 0x4210
testq %r14, %r14
je 0x4425
leaq 0x8dc8(%rip), %r15      # 0xd1d0
movq %r14, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0x4491
movl $0x20, %edi
movq %r15, %rsi
callq 0x4358
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xa20f(%rip), %r14      # 0xe660
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdi
movq %rbx, %rdx
callq 0x20a0
leaq 0x8d68(%rip), %rbx      # 0xd1d0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4210
movl $0xa, %edi
movq %rbx, %rsi
callq 0x4358
leaq 0xa9d9(%rip), %rdi      # 0xee60
movl $0x1, %esi
callq 0x2230
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: gcMoveObject
Object *gcMoveObject(Object * object)
{
	// skip object if it is not within from-space (i.e. on the stack)
	if (object < (Object *) memory->fromSpace || object >= (Object *) ((char *)memory->fromSpace + memory->fromOffset))
		return object;

	// if the object has already been moved, return its new location
	if (object->type == (Type) - 1)
		return object->forward;

	// copy object to to-space
	Object *forward = (Object *) ((char *)memory->toSpace + memory->toOffset);
	memcpy(forward, object, object->size);
	memory->toOffset += object->size;

	// mark object as moved and set forwarding pointer
	object->type = (Type) - 1;
	object->forward = forward;

	return object->forward;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0xa8ba(%rip), %rax      # 0xef78
cmpq %rdi, %rax
ja 0x4712
addq 0xa89e(%rip), %rax      # 0xef68
cmpq %rbx, %rax
jbe 0x4712
cmpl $-0x1, (%rbx)
je 0x470e
movq 0xa895(%rip), %r15      # 0xef70
movq 0xa89e(%rip), %r14      # 0xef80
addq %r15, %r14
movq 0x8(%rbx), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21e0
addq 0x8(%rbx), %r15
movq %r15, 0xa871(%rip)      # 0xef70
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %r14, 0x10(%rbx)
movq %r14, %rbx
jmp 0x4712
movq 0x10(%rbx), %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: gc
void gc(GC_PARAM)
{
	memory->toOffset = 0;

	// move symbols and root objects
	symbols = gcMoveObject(symbols);

	for (Object * object = GC_ROOTS; object != nil; object = object->cdr)
		object->car = gcMoveObject(object->car);

	// iterate over objects in to-space and move all objects they reference
	for (Object * object = memory->toSpace; object < (Object *) ((char *)memory->toSpace + memory->toOffset); object = (Object *) ((char *)object + object->size)) {

		switch (object->type) {
		case TYPE_NUMBER:
		case TYPE_STRING:
		case TYPE_SYMBOL:
		case TYPE_PRIMITIVE:
			break;
		case TYPE_CONS:
			object->car = gcMoveObject(object->car);
			object->cdr = gcMoveObject(object->cdr);
			break;
		case TYPE_LAMBDA:
		case TYPE_MACRO:
			object->params = gcMoveObject(object->params);
			object->body = gcMoveObject(object->body);
			object->env = gcMoveObject(object->env);
			break;
		case TYPE_ENV:
			object->parent = gcMoveObject(object->parent);
			object->vars = gcMoveObject(object->vars);
			object->vals = gcMoveObject(object->vals);
			break;
		}
	}

	// swap from- and to-space
	void *swap = memory->fromSpace;
	memory->fromSpace = memory->toSpace;
	memory->toSpace = swap;
	memory->fromOffset = memory->toOffset;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq $0x0, 0xa842(%rip) # 0xef70
movq 0xa7f3(%rip), %rdi      # 0xef28
callq 0x46af
movq %rax, 0xa7e7(%rip)      # 0xef28
cmpq %rbx, 0x8ac0(%rip)      # 0xd208
je 0x4764
movq 0x10(%rbx), %rdi
callq 0x46af
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rbx
cmpq 0x8aa6(%rip), %rbx      # 0xd208
jne 0x474a
movq 0xa815(%rip), %rbx      # 0xef80
movq 0xa7fe(%rip), %rax      # 0xef70
testq %rax, %rax
jle 0x47e9
movl (%rbx), %eax
leal -0x4(%rax), %ecx
cmpl $0x2, %ecx
jb 0x478b
cmpl $0x3, %eax
je 0x47a6
cmpl $0x7, %eax
jne 0x47cc
movq 0x10(%rbx), %rdi
callq 0x46af
movq %rax, 0x10(%rbx)
movl $0x20, %r14d
movl $0x18, %r15d
jmp 0x47b2
movl $0x18, %r14d
movl $0x10, %r15d
movq (%rbx,%r15), %rdi
callq 0x46af
movq %rax, (%rbx,%r15)
movq (%rbx,%r14), %rdi
callq 0x46af
movq %rax, (%rbx,%r14)
addq 0x8(%rbx), %rbx
movq 0xa7a9(%rip), %rcx      # 0xef80
movq 0xa792(%rip), %rax      # 0xef70
leaq (%rcx,%rax), %rdx
cmpq %rdx, %rbx
jb 0x4777
jmp 0x47ec
movq %rbx, %rcx
movq 0xa785(%rip), %rdx      # 0xef78
movq %rcx, 0xa77e(%rip)      # 0xef78
movq %rdx, 0xa77f(%rip)      # 0xef80
movq %rax, 0xa760(%rip)      # 0xef68
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: memoryAllocObject
Object *memoryAllocObject(Type type, size_t size, GC_PARAM)
{
	size = memoryAlign(size, sizeof(void *));

	// allocate from- and to-space
	if (!memory->fromSpace) {
		if (!(memory->fromSpace = mmap(NULL, memory->capacity * 2, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)))
			exception("mmap() failed, %s", strerror(errno));

		memory->toSpace = (char *)memory->fromSpace + memory->capacity;
	}
	// run garbage collection if capacity exceeded
	if (memory->fromOffset + size >= memory->capacity)
		gc(GC_ROOTS);
	if (memory->fromOffset + size >= memory->capacity)
		exception("out of memory, %lu bytes", (unsigned long)size);

	// allocate object in from-space
	Object *object = (Object *) ((char *)memory->fromSpace + memory->fromOffset);
	object->type = type;
	object->size = size;
	memory->fromOffset += size;

	return object;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
cmpq $0x0, 0xa748(%rip)      # 0xef78
jne 0x486a
movl $0x40000, %esi          # imm = 0x40000
xorl %edi, %edi
movl $0x3, %edx
movl $0x22, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x2100
movq %rax, 0xa720(%rip)      # 0xef78
testq %rax, %rax
je 0x48cd
addq $0x20000, %rax          # imm = 0x20000
movq %rax, 0xa716(%rip)      # 0xef80
addq $0x7, %rbx
andq $-0x8, %rbx
movq 0xa6ef(%rip), %rax      # 0xef68
addq %rbx, %rax
cmpq $0x20000, %rax          # imm = 0x20000
jb 0x488c
movq %r14, %rdi
callq 0x471b
movq 0xa6d5(%rip), %rcx      # 0xef68
leaq (%rcx,%rbx), %rdx
cmpq $0x20000, %rdx          # imm = 0x20000
jae 0x48bf
movq 0xa6d1(%rip), %rsi      # 0xef78
leaq (%rsi,%rcx), %rax
movl %ebp, (%rsi,%rcx)
movq %rbx, 0x8(%rsi,%rcx)
movq %rdx, 0xa6ae(%rip)      # 0xef68
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3be4(%rip), %rsi      # 0x84aa
xorl %edi, %edi
movq %rbx, %rdx
jmp 0x48e5
callq 0x2060
movl (%rax), %edi
callq 0x2300
leaq 0x3bb8(%rip), %rsi      # 0x8498
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: newStringWithLength
Object *newStringWithLength(char *string, size_t length, GC_PARAM)
{
	int nEscapes = 0;

	for (int i = 1; i < length; ++i)
		if (string[i - 1] == '\\' && strchr("\\\"trn", string[i]))
			++i, ++nEscapes;

	Object *object = newObjectWithString(TYPE_STRING,
					     length - nEscapes + 1, GC_ROOTS);

	for (int r = 1, w = 0; r <= length; ++r) {
		if (string[r - 1] == '\\' && r < length) {
			switch (string[r]) {
			case '\\':
				object->string[w++] = '\\';
				r++;
				break;
			case '"':
				object->string[w++] = '"';
				r++;
				break;
			case 't':
				object->string[w++] = '\t';
				r++;
				break;
			case 'r':
				object->string[w++] = '\r';
				r++;
				break;
			case 'n':
				object->string[w++] = '\n';
				r++;
				break;
			default:
				object->string[w++] = '\\';
				break;
			}
		} else
			object->string[w++] = string[r - 1];
	}

	object->string[length - nEscapes] = '\0';
	return object;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
cmpq $0x2, %rsi
jb 0x49b1
movl $0x1, %ebp
movl $0x1, %eax
leaq 0x3b43(%rip), %r12      # 0x84c3
cmpb $0x5c, -0x1(%r14,%rax)
jne 0x49a4
movsbl (%r14,%rax), %esi
movl $0x6, %edx
movq %r12, %rdi
callq 0x2160
testq %rax, %rax
je 0x49a4
incl %ebp
incl %r13d
incl %ebp
movslq %ebp, %rax
cmpq %rbx, %rax
jb 0x4980
movslq %r13d, %r13
movq %rbx, %r12
subq %r13, %r12
negq %r13
leaq (%rbx,%r13), %rax
incq %rax
xorl %esi, %esi
subq $0x18, %rax
cmovaeq %rax, %rsi
addq $0x28, %rsi
movl $0x1, %ebp
movl $0x1, %edi
movq %r15, %rdx
callq 0x481c
testq %rbx, %rbx
je 0x4a60
movq %rax, %rcx
addq $0x10, %rcx
movl $0x1, %edx
movb -0x1(%r14,%rdx), %sil
cmpb $0x5c, %sil
setne %dil
cmpq %rbx, %rdx
setae %r8b
orb %dil, %r8b
jne 0x4a29
movzbl (%r14,%rdx), %edx
cmpl $0x6d, %edx
jle 0x4a2e
cmpl $0x6e, %edx
je 0x4a3d
cmpl $0x72, %edx
je 0x4a42
cmpl $0x74, %edx
jne 0x4a5b
movb $0x9, (%rcx)
jmp 0x4a4a
movb %sil, (%rcx)
jmp 0x4a4c
cmpl $0x22, %edx
je 0x4a47
cmpl $0x5c, %edx
jne 0x4a5b
movb $0x5c, (%rcx)
jmp 0x4a4a
movb $0xa, (%rcx)
jmp 0x4a4a
movb $0xd, (%rcx)
jmp 0x4a4a
movb $0x22, (%rcx)
incl %ebp
incl %ebp
movslq %ebp, %rdx
incq %rcx
cmpq %rbx, %rdx
jbe 0x49f2
jmp 0x4a60
movb $0x5c, (%rcx)
jmp 0x4a4c
movb $0x0, 0x10(%rax,%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: newCons
Object *newCons(Object ** car, Object ** cdr, GC_PARAM)
{
	Object *object = newObject(TYPE_CONS, GC_ROOTS);
	object->car = *car;
	object->cdr = *cdr;
	return object;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x28, %esi
movl $0x3, %edi
callq 0x481c
movq (%r14), %rcx
movq %rcx, 0x10(%rax)
movq (%rbx), %rcx
movq %rcx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: newSymbolWithLength
Object *newSymbolWithLength(char *string, size_t length, GC_PARAM)
{
	for (Object * object = symbols; object != nil; object = object->cdr)
		if (memcmp(object->car->string, string, length) == 0 && object->car->string[length] == '\0')
			return object->car;

	GC_TRACE(gcObject, newObjectWithString(TYPE_SYMBOL, length + 1, GC_ROOTS));
	memcpy((*gcObject)->string, string, length);
	(*gcObject)->string[length] = '\0';

	symbols = newCons(gcObject, &symbols, GC_ROOTS);

	return *gcObject;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, (%rsp)
movq 0x871f(%rip), %r15      # 0xd208
movq 0xa438(%rip), %r14      # 0xef28
cmpq %r15, %r14
sete %bpl
je 0x4b2c
movq 0x10(%r14), %r12
leaq 0x10(%r12), %r13
movq %r13, %rdi
movq (%rsp), %rsi
movq %rbx, %rdx
callq 0x2210
testl %eax, %eax
jne 0x4b1d
cmpb $0x0, (%r13,%rbx)
je 0x4b2c
movq 0x18(%r14), %r14
cmpq %r15, %r14
sete %bpl
jne 0x4af9
jmp 0x4b2c
testb $0x1, %bpl
je 0x4bc2
leaq 0x10(%rsp), %r12
movl $0x3, (%r12)
xorl %eax, %eax
movq %rax, 0x8(%r12)
leaq 0x1(%rbx), %rsi
subq $0x18, %rsi
cmovbq %rax, %rsi
addq $0x28, %rsi
movl $0x2, %edi
movq 0x8(%rsp), %r14
movq %r14, %rdx
callq 0x481c
movq %rax, 0x10(%r12)
movq %r14, 0x18(%r12)
leaq 0x10(%rax), %rdi
movq (%rsp), %rsi
movq %rbx, %rdx
callq 0x21e0
movq 0x10(%r12), %rax
movb $0x0, 0x10(%rax,%rbx)
movl $0x28, %esi
movl $0x3, %edi
movq %r12, %rdx
callq 0x481c
movq 0x10(%r12), %rcx
movq %rcx, 0x10(%rax)
movq 0xa376(%rip), %rcx      # 0xef28
movq %rcx, 0x18(%rax)
movq %rax, 0xa36b(%rip)      # 0xef28
movq 0x10(%r12), %r12
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: newObjectWithClosure
Object *newObjectWithClosure(Type type, Object ** params, Object ** body, Object ** env, GC_PARAM)
{
	Object *list;

	for (list = *params; list->type == TYPE_CONS; list = list->cdr) {
		if (list->car->type != TYPE_SYMBOL)
			exceptionWithObject(list->car, "is not a symbol");
		if (list->car == nil || list->car == t)
			exceptionWithObject(list->car, "cannot be used as a parameter");
	}

	if (list != nil && list->type != TYPE_SYMBOL)
		exceptionWithObject(list, "is not a symbol");

	Object *object = newObject(type, GC_ROOTS);
	object->params = *params;
	object->body = *body;
	object->env = *env;
	return object;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %eax
movq (%rsi), %rdi
movl (%rdi), %ecx
cmpl $0x3, %ecx
jne 0x4c3e
movq 0x85ef(%rip), %rdx      # 0xd208
movq 0x85f0(%rip), %rsi      # 0xd210
movq 0x10(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x4c7f
cmpq %rdx, %rcx
je 0x4c76
cmpq %rsi, %rcx
je 0x4c76
movq 0x18(%rdi), %rdi
movl (%rdi), %ecx
cmpl $0x3, %ecx
je 0x4c20
cmpl $0x2, %ecx
je 0x4c4c
cmpq 0x85be(%rip), %rdi      # 0xd208
jne 0x4c90
movl $0x28, %esi
movl %eax, %edi
movq %r8, %rdx
callq 0x481c
movq (%r15), %rcx
movq %rcx, 0x10(%rax)
movq (%r14), %rcx
movq %rcx, 0x18(%rax)
movq (%rbx), %rcx
movq %rcx, 0x20(%rax)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x385c(%rip), %rsi      # 0x84d9
jmp 0x4c86
leaq 0x3843(%rip), %rsi      # 0x84c9
movq %rcx, %rdi
xorl %eax, %eax
callq 0x4388
leaq 0x3832(%rip), %rsi      # 0x84c9
jmp 0x4c89
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: newPrimitive
Object *newPrimitive(int primitive, char *name, GC_PARAM)
{
	Object *object = newObject(TYPE_PRIMITIVE, GC_ROOTS);
	object->primitive = primitive;
	object->name = name;
	return object;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movl $0x28, %esi
movl $0x6, %edi
callq 0x481c
movl %ebp, 0x10(%rax)
movq %rbx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: newEnv
Object *newEnv(Object ** func, Object ** vals, GC_PARAM)
{
	Object *object = newObject(TYPE_ENV, GC_ROOTS);

	if ((*func) == nil)
		object->parent = object->vars = object->vals = nil;
	else {
		Object *param = (*func)->params, *val = *vals;

		for (int nArgs = 0;; param = param->cdr, val = val->cdr, ++nArgs) {
			if (param == nil && val == nil)
				break;
			else if (param != nil && param->type == TYPE_SYMBOL)
				break;
			else if (val != nil && val->type != TYPE_CONS)
				exceptionWithObject(val, "is not a list");
			else if (param == nil && val != nil)
				exceptionWithObject(*func, "expects at most %d arguments", nArgs);
			else if (param != nil && val == nil) {
				for (; param->type == TYPE_CONS; param = param->cdr, ++nArgs);
				exceptionWithObject(*func, "expects at least %d arguments", nArgs);
			}
		}

		object->parent = (*func)->env;
		object->vars = (*func)->params;
		object->vals = *vals;
	}

	return object;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x28, %esi
movl $0x7, %edi
callq 0x481c
movq (%r14), %rdi
movq 0x84fb(%rip), %r8       # 0xd208
cmpq %r8, %rdi
je 0x4dc0
movq (%rbx), %rcx
movq 0x10(%rdi), %rsi
cmpq %r8, %rsi
sete %r10b
cmpq %r8, %rcx
sete %r9b
testb %r9b, %r10b
jne 0x4d90
xorl %edx, %edx
testb $0x1, %r10b
jne 0x4d3d
cmpl $0x2, (%rsi)
je 0x4d90
testb $0x1, %r9b
jne 0x4d4c
cmpl $0x3, (%rcx)
jne 0x4de2
cmpq %r8, %rsi
setne %r10b
orb %r9b, %r10b
testb $0x1, %r10b
je 0x4dd4
cmpq %r8, %rsi
setne %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
je 0x4db2
incl %edx
movq 0x18(%rcx), %rcx
movq 0x18(%rsi), %rsi
cmpq %r8, %rsi
sete %r10b
cmpq %r8, %rcx
sete %r9b
movl %r10d, %r11d
andb %r9b, %r11b
cmpb $0x1, %r11b
jne 0x4d32
movq 0x20(%rdi), %rcx
movq %rcx, 0x10(%rax)
movq (%r14), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq (%rbx), %rcx
movq %rcx, 0x20(%rax)
jmp 0x4dcc
movq 0x18(%rsi), %rsi
incl %edx
cmpl $0x3, (%rsi)
je 0x4dac
leaq 0x3764(%rip), %rsi      # 0x8522
jmp 0x4ddb
movq %r8, 0x20(%rax)
movq %r8, 0x18(%rax)
movq %r8, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x372a(%rip), %rsi      # 0x8505
xorl %eax, %eax
callq 0x4388
leaq 0x370e(%rip), %rsi      # 0x84f7
movq %rcx, %rdi
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: streamSeek
Stream *streamSeek(Stream * stream, int offset)
{
	if (offset < 0 && -offset >= stream->offset)
		stream->offset = 0;
	else
		stream->offset += offset;
	return stream;
}

// Assembly:
movq %rdi, %rax
testl %esi, %esi
jns 0x4fcf
movl %esi, %ecx
negl %ecx
cmpq %rcx, 0x28(%rax)
jle 0x4fd7
movslq %esi, %rcx
addq %rcx, 0x28(%rax)
retq
movq $0x0, 0x28(%rax)
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: streamPeek
int streamPeek(Stream * stream)
{
	int ch = streamGetc(stream);
	if (ch != EOF)
		streamSeek(stream, -1);
	return ch;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4df3
cmpl $-0x1, %eax
je 0x5004
movq 0x28(%rbx), %rcx
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
cmpq $0x2, %rcx
cmovgeq %rdx, %rsi
movq %rsi, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: readNext
int readNext(Stream * stream)
{
	for (;;) {
		int ch = streamGetc(stream);
		if (ch == ';')
			while ((ch = streamGetc(stream)) != EOF && ch != '\n');
		if (isspace(ch))
			continue;
		return ch;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq %r14, %rdi
callq 0x4df3
movl %eax, %ebp
cmpl $0x3b, %eax
jne 0x5030
movq %r14, %rdi
callq 0x4df3
movl %eax, %ebp
cmpl $0xa, %eax
je 0x5030
cmpl $-0x1, %ebp
jne 0x501c
callq 0x2340
movq (%rax), %rax
movslq %ebp, %rcx
movzwl (%rax,%rcx,2), %eax
testl $0x2000, %eax           # imm = 0x2000
cmovel %ecx, %ebx
jne 0x500d
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: peekNext
int peekNext(Stream * stream)
{
	int ch = readNext(stream);
	if (ch != EOF)
		streamSeek(stream, -1);
	return ch;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x5006
cmpl $-0x1, %eax
je 0x5074
movq 0x28(%rbx), %rcx
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
cmpq $0x2, %rcx
cmovgeq %rdx, %rsi
movq %rsi, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: readWhile
int readWhile(Stream * stream, int (*predicate) (int ch))
{
	for (;;) {
		int ch = streamPeek(stream);
		if (!predicate(ch))
			return ch;
		streamGetc(stream);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x4df3
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x50ad
movq 0x28(%r14), %rax
leaq -0x1(%rax), %rcx
cmpq $0x2, %rax
cmovlq %r12, %rcx
movq %rcx, 0x28(%r14)
movl %ebp, %edi
callq *%rbx
movl %eax, %r15d
testl %eax, %eax
je 0x50c3
movq %r14, %rdi
callq 0x4df3
movl %r13d, %ebp
movl %ebp, %r13d
testl %r15d, %r15d
jne 0x508a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: readUnary
Object *readUnary(Stream * stream, char *symbol, GC_PARAM)
{
	if (peekNext(stream) == EOF)
		exception("unexpected end of stream in %s", symbol);

	GC_TRACE(gcSymbol, newSymbol(symbol, GC_ROOTS));
	GC_TRACE(gcObject, readExpr(stream, GC_ROOTS));

	*gcObject = newCons(gcObject, &nil, GC_ROOTS);
	*gcObject = newCons(gcSymbol, gcObject, GC_ROOTS);

	return *gcObject;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
callq 0x5006
cmpl $-0x1, %eax
je 0x51bf
movq 0x28(%r14), %rax
leaq -0x1(%rax), %rcx
xorl %r13d, %r13d
cmpq $0x2, %rax
cmovlq %r13, %rcx
movq %rcx, 0x28(%r14)
movl $0x3, %ebp
leaq 0x30(%rsp), %rbx
movl %ebp, (%rbx)
movq %r13, 0x8(%rbx)
movq %r15, %rdi
callq 0x20e0
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x4ac8
movq %rax, 0x10(%rbx)
movq %r12, 0x18(%rbx)
leaq 0x8(%rsp), %r15
movl %ebp, (%r15)
movq %r13, 0x8(%r15)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x51d2
movq %rax, 0x10(%r15)
movq %rbx, 0x18(%r15)
movl $0x28, %esi
movl $0x3, %edi
movq %r15, %rdx
callq 0x481c
movq 0x10(%r15), %rcx
movq %rcx, 0x10(%rax)
movq 0x8082(%rip), %rcx      # 0xd208
movq %rcx, 0x18(%rax)
movq %rax, 0x10(%r15)
movl $0x28, %esi
movl $0x3, %edi
movq %r15, %rdx
callq 0x481c
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%r15), %rcx
movq %rcx, 0x18(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x33b8(%rip), %rsi      # 0x857e
xorl %edi, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: readExpr
Object *readExpr(Stream * stream, GC_PARAM)
{
	for (;;) {

		int ch = readNext(stream);

		if (ch == EOF)
			return NULL;
		else if (ch == '\'')
			return readUnary(stream, "quote", GC_ROOTS);
		else if (ch == '"')
			return readString(stream, GC_ROOTS);
		else if (ch == '(')
			return readList(stream, GC_ROOTS);
		else if (isSymbolChar(ch)
			 && (ch != '.' || isSymbolChar(streamPeek(stream))))
			return readNumberOrSymbol(streamSeek(stream, -1), GC_ROOTS);
		else
			exception("unexpected character, `%c'", ch);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5006
movl %eax, %ebp
cmpl $0x26, %eax
jg 0x5205
cmpl $-0x1, %ebp
je 0x528c
cmpl $0x22, %ebp
jne 0x5229
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x52b4
cmpl $0x28, %ebp
je 0x5293
cmpl $0x27, %ebp
jne 0x5229
leaq 0x345a(%rip), %rsi      # 0x8674
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x50dc
movl %ebp, %edi
callq 0x534d
testl %eax, %eax
je 0x52a2
cmpl $0x2e, %ebp
jne 0x5267
movq %r14, %rdi
callq 0x4df3
cmpl $-0x1, %eax
je 0x525c
movq 0x28(%r14), %rcx
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
cmpq $0x2, %rcx
cmovgeq %rdx, %rsi
movq %rsi, 0x28(%r14)
movl %eax, %edi
callq 0x534d
testl %eax, %eax
je 0x52a2
movq 0x28(%r14), %rax
leaq -0x1(%rax), %rcx
xorl %edx, %edx
cmpq $0x2, %rax
cmovgeq %rcx, %rdx
movq %rdx, 0x28(%r14)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x5386
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x55eb
leaq 0x33d1(%rip), %rsi      # 0x867a
xorl %edi, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: readString
Object *readString(Stream * stream, GC_PARAM)
{
	size_t offset = stream->offset;

	for (bool isEscaped = false;;) {
		int ch = streamGetc(stream);
		if (ch == EOF)
			exception("unexpected end of stream in string literal \"%.*s\"", (int)(stream->offset - offset), stream->buffer + offset);
		if (ch == '"' && !isEscaped)
			return newStringWithLength(stream->buffer + offset, stream->offset - offset - 1, GC_ROOTS);

		isEscaped = (ch == '\\' && !isEscaped);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movq 0x28(%rdi), %r13
movq %r13, (%rsp)
notq %r13
xorl %ebp, %ebp
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x4df3
cmpl $0x22, %eax
je 0x52e8
cmpl $-0x1, %eax
jne 0x52ed
jmp 0x532f
testb $0x1, %bl
je 0x52fd
xorb $0x1, %bl
cmpl $0x5c, %eax
movzbl %bl, %ebx
cmovnel %ebp, %ebx
movb $0x1, %al
jmp 0x5319
movq 0x8(%r14), %rdi
addq (%rsp), %rdi
movq 0x28(%r14), %rsi
addq %r13, %rsi
movq %r15, %rdx
callq 0x4952
movq %rax, %r12
xorl %eax, %eax
testb %al, %al
jne 0x52d4
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x28(%r14), %edx
movq (%rsp), %rcx
subl %ecx, %edx
addq 0x8(%r14), %rcx
leaq 0x3259(%rip), %rsi      # 0x859d
xorl %edi, %edi
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: reverseList
Object *reverseList(Object * list)
{
	Object *object = nil;

	while (list != nil) {
		Object *swap = list;
		list = list->cdr;
		swap->cdr = object;
		object = swap;
	}

	return object;
}

// Assembly:
movq 0x7c3d(%rip), %rcx      # 0xd208
cmpq %rdi, %rcx
je 0x55e7
movq %rcx, %rdx
movq %rdi, %rax
movq 0x18(%rdi), %rdi
movq %rdx, 0x18(%rax)
movq %rax, %rdx
cmpq %rcx, %rdi
jne 0x55d3
retq
movq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: envLookup
Object *envLookup(Object * var, Object * env)
{
	for (; env != nil; env = env->parent) {
		Object *vars = env->vars, *vals = env->vals;

		for (; vars->type == TYPE_CONS; vars = vars->cdr, vals = vals->cdr)
			if (vars->car == var)
				return vals->car;

		if (vars == var)
			return vals;
	}

	exceptionWithObject(var, "has no value");
}

// Assembly:
pushq %rax
movq 0x79f0(%rip), %rcx      # 0xd208
cmpq %rsi, %rcx
je 0x585d
movq 0x18(%rsi), %r8
movq 0x20(%rsi), %rdx
cmpl $0x3, (%r8)
jne 0x583b
cmpq %rdi, 0x10(%r8)
je 0x5848
movq 0x18(%rdx), %rdx
movq 0x18(%r8), %r8
jmp 0x5825
cmpq %rdi, %r8
setne %r8b
cmoveq %rdx, %rax
jmp 0x584f
movq 0x10(%rdx), %rax
xorl %r8d, %r8d
testb %r8b, %r8b
je 0x586b
movq 0x10(%rsi), %rsi
cmpq %rcx, %rsi
jne 0x581d
leaq 0x2e6e(%rip), %rsi      # 0x86d2
xorl %eax, %eax
callq 0x4388
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: envAdd
Object *envAdd(Object ** var, Object ** val, Object ** env, GC_PARAM)
{
	GC_TRACE(gcVars, newCons(var, &nil, GC_ROOTS));
	GC_TRACE(gcVals, newCons(val, &nil, GC_ROOTS));

	(*gcVars)->cdr = (*env)->vars, (*env)->vars = *gcVars;
	(*gcVals)->cdr = (*env)->vals, (*env)->vals = *gcVals;

	return *val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
leaq 0x8(%rsp), %r15
movl $0x3, (%r15)
movq $0x0, 0x8(%r15)
movl $0x28, %esi
movl $0x3, %edi
movq %rcx, %rdx
callq 0x481c
movq (%r13), %rcx
movq %rcx, 0x10(%rax)
movq 0x794d(%rip), %rcx      # 0xd208
movq %rcx, 0x18(%rax)
movq %rax, 0x10(%r15)
movq %r12, 0x18(%r15)
movl $0x28, %esi
movl $0x3, %edi
movq %r15, %rdx
callq 0x481c
movq (%rbx), %rcx
movq %rcx, 0x10(%rax)
movq 0x7921(%rip), %rcx      # 0xd208
movq %rcx, 0x18(%rax)
movq (%r14), %rcx
movq 0x18(%rcx), %rcx
movq 0x10(%r15), %rdx
movq %rcx, 0x18(%rdx)
movq (%r14), %rcx
movq %rdx, 0x18(%rcx)
movq (%r14), %rcx
movq 0x20(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq (%r14), %rcx
movq %rax, 0x20(%rcx)
movq (%rbx), %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: envSet
Object *envSet(Object ** var, Object ** val, Object ** env, GC_PARAM)
{
	GC_TRACE(gcEnv, *env);

	for (;;) {
		Object *vars = (*gcEnv)->vars, *vals = (*gcEnv)->vals;

		for (; vars->type == TYPE_CONS; vars = vars->cdr, vals = vals->cdr) {
			if (vars->car == *var)
				return vals->car = *val;
			if (vars->cdr == *var)
				return vals->cdr = *val;
		}

		if ((*gcEnv)->parent == nil)
			return envAdd(var, val, gcEnv, GC_ROOTS);
		else
			*gcEnv = (*gcEnv)->parent;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
movl $0x3, -0x10(%r15)
movq $0x0, -0x8(%r15)
movq (%rdx), %rax
movq %rax, (%r15)
movq %rcx, 0x8(%r15)
movq %rsp, %r12
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rdx
cmpl $0x3, (%rdx)
jne 0x5987
leaq 0x20(%rcx), %rsi
movq (%r14), %rdi
movq (%rsi), %rsi
cmpq %rdi, 0x10(%rdx)
je 0x59b0
movq 0x18(%rdx), %rdx
cmpq %rdi, %rdx
je 0x59b9
addq $0x18, %rsi
cmpl $0x3, (%rdx)
je 0x596c
movq 0x10(%rcx), %rcx
cmpq 0x7876(%rip), %rcx      # 0xd208
je 0x599d
movq %rcx, 0x10(%rsp)
movb $0x1, %cl
jmp 0x59c2
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x586d
jmp 0x59c0
movq (%rbx), %rax
movq %rax, 0x10(%rsi)
jmp 0x59c0
movq (%rbx), %rax
movq %rax, 0x18(%rsi)
xorl %ecx, %ecx
testb %cl, %cl
jne 0x5957
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: primitiveEq
Object *primitiveEq(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car, *second = (*args)->cdr->car;

	if (first->type == TYPE_NUMBER && second->type == TYPE_NUMBER)
		return (first->number == second->number) ? t : nil;
	else if (first->type == TYPE_STRING && second->type == TYPE_STRING)
		return !strcmp(first->string, second->string) ? t : nil;
	else
		return (first == second) ? t : nil;
}

// Assembly:
pushq %rax
movq (%rdi), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rax), %rax
movq 0x10(%rax), %rsi
movl (%rdi), %eax
cmpl $0x1, %eax
je 0x5a17
testl %eax, %eax
jne 0x5a2d
cmpl $0x0, (%rsi)
je 0x5a4c
cmpl $0x1, %eax
jne 0x5a2d
cmpl $0x1, (%rsi)
jne 0x5a2d
addq $0x10, %rdi
addq $0x10, %rsi
callq 0x2190
testl %eax, %eax
jmp 0x5a30
cmpq %rsi, %rdi
sete %al
leaq 0x77d6(%rip), %rcx      # 0xd210
leaq 0x77c7(%rip), %rdx      # 0xd208
testb %al, %al
cmovneq %rcx, %rdx
movq (%rdx), %rax
popq %rcx
retq
movsd 0x10(%rsi), %xmm0
cmpeqsd 0x10(%rdi), %xmm0
movq %xmm0, %rax
andl $0x1, %eax
jmp 0x5a33
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: primitiveCar
Object *primitiveCar(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car;

	if (first == nil)
		return nil;
	else if (first->type == TYPE_CONS)
		return first->car;
	else
		exceptionWithObject(first, "is not a list");
}

// Assembly:
movq (%rdi), %rax
movq 0x10(%rax), %rdi
movq 0x7799(%rip), %rax      # 0xd208
cmpq %rax, %rdi
je 0x5a7d
cmpl $0x3, (%rdi)
jne 0x5a7e
movq 0x10(%rdi), %rax
retq
pushq %rax
leaq 0x2a71(%rip), %rsi      # 0x84f7
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: primitiveCdr
Object *primitiveCdr(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car;

	if (first == nil)
		return nil;
	else if (first->type == TYPE_CONS)
		return first->cdr;
	else
		exceptionWithObject(first, "is not a list");
}

// Assembly:
movq (%rdi), %rax
movq 0x10(%rax), %rdi
movq 0x776d(%rip), %rax      # 0xd208
cmpq %rax, %rdi
je 0x5aa9
cmpl $0x3, (%rdi)
jne 0x5aaa
movq 0x18(%rdi), %rax
retq
pushq %rax
leaq 0x2a45(%rip), %rsi      # 0x84f7
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: primitivePrint
Object *primitivePrint(Object ** args, GC_PARAM)
{
	writeChar('\n', &ostream);
	writeObject((*args)->car, true, &ostream);
	writeChar(' ', &ostream);
	return (*args)->car;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x769b(%rip), %r14      # 0xd1d0
movl $0xa, %edi
movq %r14, %rsi
callq 0x4358
movq (%rbx), %rax
movq 0x10(%rax), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x4491
movl $0x20, %edi
movq %r14, %rsi
callq 0x4358
movq (%rbx), %rax
movq 0x10(%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: stringAppend
Object *stringAppend(Object ** args, GC_PARAM)
{
	TWO_STRING_ARGS();

	int len1 = strlen(first->string);
	int len2 = strlen(second->string);
	char *new = strdup(first->string);
	new = realloc(new, len1 + len2 + 1);
	assert(new != NULL);
	memcpy(new + len1, second->string, len2);
	new[len1 + len2] = '\0';

	Object *obj = newStringWithLength(new, len1 + len2, GC_ROOTS);	
	free(new);

	return obj;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rax
movq 0x10(%rax), %r15
cmpl $0x1, (%r15)
jne 0x5ead
movq 0x18(%rax), %rax
movq 0x10(%rax), %r14
cmpl $0x1, (%r14)
jne 0x5eb9
movq %rsi, %rbx
addq $0x10, %r15
movq %r15, %rdi
callq 0x20e0
movq %rax, %r12
addq $0x10, %r14
movq %r14, %rdi
callq 0x20e0
movq %rax, %r13
movq %r15, %rdi
callq 0x22f0
leal (%r12,%r13), %ebp
leal (%r12,%r13), %ecx
incl %ecx
movslq %ecx, %rsi
movq %rax, %rdi
callq 0x2220
movq %rax, %r15
movslq %r12d, %rdi
addq %rax, %rdi
movslq %r13d, %rdx
movq %r14, %rsi
callq 0x21e0
movslq %ebp, %rsi
movb $0x0, (%r15,%rsi)
movq %r15, %rdi
movq %rbx, %rdx
callq 0x4952
movq %rax, %rbx
movq %r15, %rdi
callq 0x2050
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x282b(%rip), %rsi      # 0x86df
movq %r15, %rdi
jmp 0x5ec3
leaq 0x281f(%rip), %rsi      # 0x86df
movq %r14, %rdi
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: stringSubstring
Object *stringSubstring(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car;
	Object *second = (*args)->cdr->car;
	Object *third = (*args)->cdr->cdr->car;

	if (first->type != TYPE_STRING)
	    exceptionWithObject(first, "is not a string");
	if (second->type != TYPE_NUMBER)
	    exceptionWithObject(second, "is not a number");  
	if (third->type != TYPE_NUMBER)
	    exceptionWithObject(third, "is not a number");  

	int start = (int)(second->number);
	int end = (int)(third->number);
	int len = strlen(first->string);

	if (start < 0 || start > len -1)
	    exceptionWithObject(second, "is out of bounds");
	if (end < 0 || end > len -1)
	    exceptionWithObject(third, "is out of bounds");
	if (start > end)
	    exceptionWithObject(second, "start index greater than end index");

	char *sub = strdup(first->string);
	int newlen = end - start + 1;

	memcpy(sub, (first->string + start), newlen);
	*(sub + newlen) = '\0';
	Object *obj = newStringWithLength(sub, newlen, GC_ROOTS);
	free(sub);

	return obj;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rax
movq 0x10(%rax), %r14
cmpl $0x1, (%r14)
jne 0x5fa8
movq 0x18(%rax), %rax
movq 0x10(%rax), %r15
cmpl $0x0, (%r15)
jne 0x5fb4
movq 0x18(%rax), %rax
movq 0x10(%rax), %r12
cmpl $0x0, (%r12)
jne 0x5fbd
cvttsd2si 0x10(%r15), %ebp
testl %ebp, %ebp
js 0x5f9f
movq %rsi, %rbx
cvttsd2si 0x10(%r12), %r13d
addq $0x10, %r14
movq %r14, %rdi
callq 0x20e0
cmpl %ebp, %eax
jle 0x5f9f
testl %r13d, %r13d
js 0x5fc6
cmpl %r13d, %eax
jle 0x5fc6
subl %ebp, %r13d
jl 0x5fd2
movq %r14, %rdi
callq 0x22f0
movq %rax, %r15
incl %r13d
movl %ebp, %esi
addq %r14, %rsi
movslq %r13d, %r14
movq %rax, %rdi
movq %r14, %rdx
callq 0x21e0
movb $0x0, (%r15,%r14)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4952
movq %rax, %rbx
movq %r15, %rdi
callq 0x2050
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2759(%rip), %rsi      # 0x86ff
jmp 0x5fd9
leaq 0x2730(%rip), %rsi      # 0x86df
movq %r14, %rdi
jmp 0x5fdc
leaq 0x2734(%rip), %rsi      # 0x86ef
jmp 0x5fd9
leaq 0x272b(%rip), %rsi      # 0x86ef
jmp 0x5fcd
leaq 0x2732(%rip), %rsi      # 0x86ff
movq %r12, %rdi
jmp 0x5fdc
leaq 0x2737(%rip), %rsi      # 0x8710
movq %r15, %rdi
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: stringLength
Object *stringLength(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car;
	if (first->type != TYPE_STRING)
	    exceptionWithObject(first, "is not a string");

	return newNumber(strlen(first->string), GC_ROOTS);	
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %rax
movq 0x10(%rax), %rdi
cmpl $0x1, (%rdi)
jne 0x6044
movq %rsi, %rbx
addq $0x10, %rdi
callq 0x20e0
movq %rax, %xmm0
punpckldq 0x2453(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x245b(%rip), %xmm0     # 0x8470
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movl $0x28, %esi
xorl %edi, %edi
movq %rbx, %rdx
callq 0x481c
movaps (%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
addq $0x10, %rsp
popq %rbx
retq
leaq 0x2694(%rip), %rsi      # 0x86df
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: stringToNumber
Object *stringToNumber(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car;

	if (first->type != TYPE_STRING)
	    exceptionWithObject(first, "is not a string");

	double num = strtod(first->string, NULL);
	return newNumber(num, GC_ROOTS);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %rax
movq 0x10(%rax), %rdi
cmpl $0x1, (%rdi)
jne 0x6136
movq %rsi, %rbx
addq $0x10, %rdi
xorl %esi, %esi
callq 0x2090
movsd %xmm0, 0x8(%rsp)
movl $0x28, %esi
xorl %edi, %edi
movq %rbx, %rdx
callq 0x481c
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
addq $0x10, %rsp
popq %rbx
retq
leaq 0x25a2(%rip), %rsi      # 0x86df
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: numberToString
Object *numberToString(Object ** args, GC_PARAM)
{
	char buf[40];
	Object *first = (*args)->car;

	if (first->type != TYPE_NUMBER)
	    exceptionWithObject(first, "is not a number");

	if (first->number == (long)first->number)
		sprintf(buf, "%ld", (long)first->number);
	else
		sprintf(buf, "%lf", first->number);

	return newStringWithLength(buf, strlen(buf), GC_ROOTS);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq (%rdi), %rax
movq 0x10(%rax), %rdi
cmpl $0x0, (%rdi)
jne 0x61b6
movq %rsi, %rbx
movsd 0x10(%rdi), %xmm0
cvttsd2si %xmm0, %rdx
cvtsi2sd %rdx, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6184
jp 0x6184
leaq 0x25bb(%rip), %rsi      # 0x8733
movq %rsp, %rdi
xorl %eax, %eax
callq 0x22b0
jmp 0x6195
leaq 0x25ac(%rip), %rsi      # 0x8737
movq %rsp, %rdi
movb $0x1, %al
callq 0x22b0
movq %rsp, %r14
movq %r14, %rdi
callq 0x20e0
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x4952
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x2532(%rip), %rsi      # 0x86ef
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: os_getenv
Object *os_getenv(Object ** args, GC_PARAM)
{
	ONE_STRING_ARG();

	char *e = getenv(first->string);
	if (e == NULL) return nil;
	return newStringWithLength(e, strlen(e), GC_ROOTS);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rax
movq 0x10(%rax), %rdi
cmpl $0x1, (%rdi)
jne 0x6214
movq %rsi, %rbx
addq $0x10, %rdi
callq 0x2030
testq %rax, %rax
je 0x6205
movq %rax, %r14
movq %rax, %rdi
callq 0x20e0
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4952
movq 0x6ffc(%rip), %rax      # 0xd208
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x24c4(%rip), %rsi      # 0x86df
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: e_search_forward
Object *e_search_forward(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car;
	Object *second = (*args)->cdr->car;

	if (first->type != TYPE_NUMBER)
	    exceptionWithObject(first, "is not a number");
	if (second->type != TYPE_STRING)
	    exceptionWithObject(first, "is not a string");

	double num = search_forward_curbp((point_t)first->number, second->string);
	return newNumber(num, GC_ROOTS);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %rax
movq 0x10(%rax), %rdi
cmpl $0x0, (%rdi)
jne 0x627d
movq %rsi, %rbx
movq 0x18(%rax), %rax
movq 0x10(%rax), %rsi
cmpl $0x1, (%rsi)
jne 0x6286
cvttsd2si 0x10(%rdi), %rdi
addq $0x10, %rsi
callq 0x3803
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x28, %esi
xorl %edi, %edi
movq %rbx, %rdx
callq 0x481c
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
addq $0x10, %rsp
popq %rbx
retq
leaq 0x246b(%rip), %rsi      # 0x86ef
jmp 0x628d
leaq 0x2452(%rip), %rsi      # 0x86df
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: e_getch
Object *e_getch(Object ** args, GC_PARAM)
{
	char ch[2];
	ch[0] = (unsigned char)getch();
	ch[1] = '\0';
	return newStringWithLength(ch, 1, GC_ROOTS);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq 0x6d2d(%rip), %rax      # 0xcfd0
movq (%rax), %rdi
callq 0x20c0
leaq 0xe(%rsp), %rdi
movb %al, (%rdi)
movb $0x0, 0x1(%rdi)
movl $0x1, %esi
movq %rbx, %rdx
callq 0x4952
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: asciiToString
Object *asciiToString(Object ** args, GC_PARAM)
{
	char ch[2];
	Object *first = (*args)->car;

	if (first->type != TYPE_NUMBER)
	    exceptionWithObject(first, "is not a number");
	if (first->type < 0 || first->type > 255)
	    exceptionWithObject(first, "is not in range 0-255");

	ch[0] = (unsigned char)first->number;
	ch[1] = '\0';
	return newStringWithLength(ch, 1, GC_ROOTS);
}

// Assembly:
pushq %rax
movq (%rdi), %rax
movq 0x10(%rax), %rdi
cmpl $0x0, (%rdi)
jne 0x62f5
movq %rsi, %rdx
cvttsd2si 0x10(%rdi), %eax
leaq 0x6(%rsp), %rdi
movb %al, (%rdi)
movb $0x0, 0x1(%rdi)
movl $0x1, %esi
callq 0x4952
popq %rcx
retq
leaq 0x23f3(%rip), %rsi      # 0x86ef
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: asciiToNumber
Object *asciiToNumber(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car;

	if (first->type != TYPE_STRING)
	    exceptionWithObject(first, "is not a number");
	if (strlen(first->string) < 1)
	    exceptionWithObject(first, "is empty");

	return newNumber((double)*first->string, GC_ROOTS);
}

// Assembly:
pushq %rax
movq (%rdi), %rax
movq 0x10(%rax), %rdi
cmpl $0x1, (%rdi)
jne 0x633e
movb 0x10(%rdi), %al
testb %al, %al
je 0x6347
movq %rsi, %rdx
movsbl %al, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, (%rsp)
movl $0x28, %esi
xorl %edi, %edi
callq 0x481c
movsd (%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
popq %rcx
retq
leaq 0x23aa(%rip), %rsi      # 0x86ef
jmp 0x634e
leaq 0x23ed(%rip), %rsi      # 0x873b
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: e_load
Object *e_load(Object ** args, GC_PARAM)
{
	int fd;
	char ebuf[81];
	Object *first = (*args)->car;
	if (first->type != TYPE_STRING)
	    exceptionWithObject(first, "is not a string");

	if ((fd = open(first->string, O_RDONLY)) == -1) {
		snprintf(ebuf, 80, "failed to open %s\n", first->string);
		ebuf[80] ='\0';
		writeString(ebuf, &ostream);
		close(fd);
		return nil;
	}

	char *out = load_file(fd);
	close(fd);
	return (NULL == strstr(out, "error:")) ? t : nil;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq (%rdi), %rax
movq 0x10(%rax), %rbx
cmpl $0x1, (%rbx)
jne 0x6433
addq $0x10, %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2260
cmpl $-0x1, %eax
je 0x63e9
movl %eax, %ebp
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movq $0x0, 0x30(%rdx)
movl $0x1, (%rdx)
movl %eax, 0x10(%rdx)
movq 0x8b8b(%rip), %rsi      # 0xef38
callq 0x771c
movq 0x6e1f(%rip), %rbx      # 0xd1d8
movl %ebp, %edi
callq 0x2150
leaq 0x1de8(%rip), %rsi      # 0x81af
movq %rbx, %rdi
callq 0x2330
testq %rax, %rax
leaq 0x6e37(%rip), %rax      # 0xd210
leaq 0x6e28(%rip), %rcx      # 0xd208
cmoveq %rax, %rcx
movq (%rcx), %rax
jmp 0x642a
leaq 0x2354(%rip), %rdx      # 0x8744
movq %rsp, %r14
movl $0x50, %esi
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2120
movb $0x0, 0x50(%r14)
leaq 0x6dbf(%rip), %rsi      # 0xd1d0
movq %r14, %rdi
callq 0x4210
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2150
movq 0x6dde(%rip), %rax      # 0xd208
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x22a5(%rip), %rsi      # 0x86df
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: load_file
char *load_file(int infd)
{
	//debug("load_file fd=%d\n", infd);
	Stream input_stream = { .type = STREAM_TYPE_FILE, .fd = -1 };
	set_stream_file(&input_stream, infd);
	load_file_body(theEnv, theRoot, &input_stream);
	return ostream.buffer;
}

// Assembly:
subq $0x38, %rsp
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movq $0x0, 0x30(%rdx)
movl $0x1, (%rdx)
movl %edi, 0x10(%rdx)
movq 0x8ac7(%rip), %rsi      # 0xef38
callq 0x771c
movq 0x6d5b(%rip), %rax      # 0xd1d8
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: e_set_point
Object *e_set_point(Object ** args, GC_PARAM)
{
	Object *first = (*args)->car;
	if (first->type != TYPE_NUMBER)
	    exceptionWithObject(first, "is not a number");
	set_point(first->number);
	return t;
}

// Assembly:
pushq %rax
movq (%rdi), %rax
movq 0x10(%rax), %rdi
cmpl $0x0, (%rdi)
jne 0x64ff
cvttsd2si 0x10(%rdi), %rdi
callq 0x372c
movq 0x6d13(%rip), %rax      # 0xd210
popq %rcx
retq
leaq 0x21e9(%rip), %rsi      # 0x86ef
xorl %eax, %eax
callq 0x4388
// File: /workspace/github_c_makefile_star2_O1/hughbarney[P]zepl/lisp.c
// Function: evalIf
Object *evalIf(Object ** args, Object ** env, GC_PARAM)
{
	GC_TRACE(gcObject, (*args)->car);

	if (evalExpr(gcObject, env, GC_ROOTS) != nil)
		return (*args)->cdr->car;
	else if ((*args)->cdr->cdr != nil)
		return (*args)->cdr->cdr->car;
	else
		return nil;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
movl $0x3, -0x10(%rdi)
movq $0x0, -0x8(%rdi)
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq %rax, (%rdi)
movq %rdx, 0x8(%rdi)
leaq 0x8(%rsp), %rdx
callq 0x6c9c
movq %rax, %rcx
movq 0x6109(%rip), %rax      # 0xd208
movq (%rbx), %rdx
movq 0x18(%rdx), %rdx
cmpq %rax, %rcx
jne 0x7114
movq 0x18(%rdx), %rdx
cmpq %rax, %rdx
je 0x7118
movq 0x10(%rdx), %rax
addq $0x30, %rsp
popq %rbx
retq