// File: /workspace/github_c_makefile_star2_O0/hughbarney[P]zepl/lisp.c
// Function: newRootEnv
Object *newRootEnv(GC_PARAM)
{
	GC_TRACE(gcEnv, newEnv(&nil, &nil, GC_ROOTS));
	GC_TRACE(gcVar, nil);
	GC_TRACE(gcVal, nil);

	// add constants
	envSet(&nil, &nil, gcEnv, GC_ROOTS);
	envSet(&t, &t, gcEnv, GC_ROOTS);

	// add primitives
	int nPrimitives = sizeof(primitives) / sizeof(primitives[0]);

	for (int i = 0; i < nPrimitives; ++i) {
		*gcVar = newSymbol(primitives[i].name, GC_ROOTS);
		*gcVal = newPrimitive(i, primitives[i].name, GC_ROOTS);

		envSet(gcVar, gcVal, gcEnv, GC_ROOTS);
	}

	// add standard library
	Stream stream = { STREAM_TYPE_STRING,.buffer = stdlib };
	GC_TRACE(gcObject, nil);

	while (peekNext(&stream) != EOF) {
		*gcObject = nil;
		*gcObject = readExpr(&stream, GC_ROOTS);
		evalExpr(gcObject, gcEnv, GC_ROOTS);
	}

	return *gcEnv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movl $0x3, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdx
leaq 0x5217(%rip), %rsi      # 0xf220
movq %rsi, %rdi
callq 0x60e0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq -0x30(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x3, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq 0x51d9(%rip), %rax      # 0xf220
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x60(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x3, -0x90(%rbp)
movq $0x0, -0x88(%rbp)
movq 0x519d(%rip), %rax      # 0xf220
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x90(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x38(%rbp), %rdx
movq -0x8(%rbp), %rcx
leaq 0x5165(%rip), %rsi      # 0xf220
movq %rsi, %rdi
callq 0x7060
movq -0x38(%rbp), %rdx
movq -0x8(%rbp), %rcx
leaq 0x5156(%rip), %rsi      # 0xf228
movq %rsi, %rdi
callq 0x7060
movl $0x43, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jge 0xa18b
movslq -0xa0(%rbp), %rcx
leaq 0x5132(%rip), %rax      # 0xf240
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x5ec0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
movl -0xa0(%rbp), %edi
movslq -0xa0(%rbp), %rcx
leaq 0x5101(%rip), %rax      # 0xf240
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x8(%rbp), %rdx
callq 0x6090
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, (%rax)
movq -0x68(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x8(%rbp), %rcx
callq 0x7060
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0xa0ee
leaq -0xd8(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x2170
movl $0x0, -0xd8(%rbp)
movq 0x56d9(%rip), %rax      # 0xf888
movq %rax, -0xd0(%rbp)
movl $0x3, -0x100(%rbp)
movq $0x0, -0xf8(%rbp)
movq 0x504e(%rip), %rax      # 0xf220
movq %rax, -0xf0(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x108(%rbp)
leaq -0x100(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x6700
cmpl $-0x1, %eax
je 0xa256
movq 0x5007(%rip), %rcx      # 0xf220
movq -0x108(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x6880
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, (%rax)
movq -0x108(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x8(%rbp), %rdx
callq 0x9220
jmp 0xa201
movq -0x38(%rbp), %rax
movq (%rax), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)