// File: /workspace/github_c_makefile_star2_O0/mtnygard[P]complisp/lisp.c
// Function: compile_code_with_no_params
TEST compile_code_with_no_params(Buffer *buf) {
  ASTNode *node = Reader_read("(code () 1)");
  int compile_result = Compile_code(buf, node);
  ASSERT_EQ(compile_result, 0);
  // clang-format off
  byte expected[] = {
      // mov rax, 0x2
      0x48, 0xc7, 0xc0, 0x04, 0x00, 0x00, 0x00,
      // ret
      0xc3,
  };
  // clang-format on
  EXPECT_EQUALS_BYTES(buf, expected);
  Buffer_make_executable(buf);
  uword result = Testing_execute_expr(buf);
  ASSERT_EQ_FMT(Object_encode_integer(1), result, "0x%lx");
  AST_heap_free(node);
  PASS();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x6942(%rip), %rdi      # 0x16785
callq 0x4e40
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43c0
movl %eax, -0x1c(%rbp)
movl 0xb2e2(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0xb2d9(%rip)      # 0x1b144
cmpl $0x0, -0x1c(%rbp)
je 0xfeb9
jmp 0xfe73
leaq 0x4829(%rip), %rax      # 0x146a3
movq %rax, 0xb2cf(%rip)      # 0x1b150
movl $0x937, 0xb2bd(%rip)    # imm = 0x937
leaq 0x61f3(%rip), %rax      # 0x16085
movq %rax, 0xb2bf(%rip)      # 0x1b158
movzbl 0xb260(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0xfead
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x100e8
jmp 0xfebb
movq 0x414e(%rip), %rax      # 0x14010
movq %rax, -0x24(%rbp)
leaq -0x24(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x8, -0x30(%rbp)
leaq 0xb200(%rip), %rax      # 0x1b0e8
movq %rax, -0x48(%rbp)
movl 0xb252(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0xb249(%rip)      # 0x1b144
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x11f00
cmpl $0x0, %eax
jne 0xffba
cmpq $0x0, -0x48(%rbp)
je 0xff2a
movq -0x48(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xff72
jmp 0xff2c
leaq 0x4770(%rip), %rax      # 0x146a3
movq %rax, 0xb216(%rip)      # 0x1b150
movl $0x940, 0xb204(%rip)    # imm = 0x940
leaq 0x5b92(%rip), %rax      # 0x15add
movq %rax, 0xb206(%rip)      # 0x1b158
movzbl 0xb1a7(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0xff66
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x100e8
jmp 0xff74
leaq 0x4728(%rip), %rax      # 0x146a3
movq %rax, 0xb1ce(%rip)      # 0x1b150
movl $0x940, 0xb1bc(%rip)    # imm = 0x940
leaq 0x63b4(%rip), %rax      # 0x16347
movq %rax, 0xb1be(%rip)      # 0x1b158
movzbl 0xb15f(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0xffae
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x100e8
jmp 0xffbc
jmp 0xffbe
movq -0x10(%rbp), %rdi
callq 0x1c50
movq -0x10(%rbp), %rdi
callq 0x4f20
movq %rax, -0x50(%rbp)
movl 0xb16a(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0xb161(%rip)      # 0x1b144
movl $0x1, %edi
callq 0x1290
cmpq -0x50(%rbp), %rax
je 0x100cb
movq 0xafd2(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x5726(%rip), %rsi      # 0x1572e
movb $0x0, %al
callq 0x1100
movq 0xafba(%rip), %rax      # 0x1afd0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl $0x1, %edi
callq 0x1290
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x6293(%rip), %rsi      # 0x162c8
movb $0x0, %al
callq 0x1100
movq 0xaf8d(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x56ed(%rip), %rsi      # 0x1573a
movb $0x0, %al
callq 0x1100
movq 0xaf75(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
movq -0x50(%rbp), %rdx
leaq 0x625f(%rip), %rsi      # 0x162c8
movb $0x0, %al
callq 0x1100
movq 0xaf59(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x693b(%rip), %rsi      # 0x169bc
movb $0x0, %al
callq 0x1100
leaq 0x4614(%rip), %rax      # 0x146a3
movq %rax, 0xb0ba(%rip)      # 0x1b150
movl $0x943, 0xb0a8(%rip)    # imm = 0x943
leaq 0x637c(%rip), %rax      # 0x16423
movq %rax, 0xb0aa(%rip)      # 0x1b158
movzbl 0xb04b(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x100c2
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x100e8
jmp 0x100cd
movq -0x18(%rbp), %rdi
callq 0x1800
movq $0x0, 0xb077(%rip) # 0x1b158
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)