// File: /workspace/github_c_makefile_star2_O0/mtnygard[P]complisp/lisp.c
// Function: compile_labels_with_no_labels
TEST compile_labels_with_no_labels(Buffer *buf) {
  ASTNode *node = Reader_read("(labels () 1)");
  int compile_result = Compile_entry(buf, node);
  ASSERT_EQ(compile_result, 0);
  // clang-format off
  byte expected[] = {
      // mov rsi, rdi
      0x48, 0x89, 0xfe,
      // jmp 0x00
      0xe9, 0x00, 0x00, 0x00, 0x00,
      // 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_entry(buf, /*heap=*/NULL);
  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 0x6310(%rip), %rdi      # 0x167b3
callq 0x4e40
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4690
movl %eax, -0x1c(%rbp)
movl 0xac82(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0xac79(%rip)      # 0x1b144
cmpl $0x0, -0x1c(%rbp)
je 0x10519
jmp 0x104d3
leaq 0x41c9(%rip), %rax      # 0x146a3
movq %rax, 0xac6f(%rip)      # 0x1b150
movl $0x973, 0xac5d(%rip)    # imm = 0x973
leaq 0x5b93(%rip), %rax      # 0x16085
movq %rax, 0xac5f(%rip)      # 0x1b158
movzbl 0xac00(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1050d
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10757
jmp 0x1051b
movq 0x666e(%rip), %rax      # 0x16b90
movq %rax, -0x30(%rbp)
movq 0x666b(%rip), %rax      # 0x16b98
movq %rax, -0x28(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq $0x10, -0x38(%rbp)
leaq 0xab95(%rip), %rax      # 0x1b0e8
movq %rax, -0x50(%rbp)
movl 0xabe7(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0xabde(%rip)      # 0x1b144
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0x11f00
cmpl $0x0, %eax
jne 0x10625
cmpq $0x0, -0x50(%rbp)
je 0x10595
movq -0x50(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x105dd
jmp 0x10597
leaq 0x4105(%rip), %rax      # 0x146a3
movq %rax, 0xabab(%rip)      # 0x1b150
movl $0x980, 0xab99(%rip)    # imm = 0x980
leaq 0x5527(%rip), %rax      # 0x15add
movq %rax, 0xab9b(%rip)      # 0x1b158
movzbl 0xab3c(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x105d1
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10757
jmp 0x105df
leaq 0x40bd(%rip), %rax      # 0x146a3
movq %rax, 0xab63(%rip)      # 0x1b150
movl $0x980, 0xab51(%rip)    # imm = 0x980
leaq 0x5d49(%rip), %rax      # 0x16347
movq %rax, 0xab53(%rip)      # 0x1b158
movzbl 0xaaf4(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x10619
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10757
jmp 0x10627
jmp 0x10629
movq -0x10(%rbp), %rdi
callq 0x1c50
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4e70
movq %rax, -0x58(%rbp)
movl 0xaafb(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0xaaf2(%rip)      # 0x1b144
movl $0x1, %edi
callq 0x1290
cmpq -0x58(%rbp), %rax
je 0x1073a
movq 0xa963(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x50b7(%rip), %rsi      # 0x1572e
movb $0x0, %al
callq 0x1100
movq 0xa94b(%rip), %rax      # 0x1afd0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movl $0x1, %edi
callq 0x1290
movq -0x60(%rbp), %rdi
movq %rax, %rdx
leaq 0x5c24(%rip), %rsi      # 0x162c8
movb $0x0, %al
callq 0x1100
movq 0xa91e(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x507e(%rip), %rsi      # 0x1573a
movb $0x0, %al
callq 0x1100
movq 0xa906(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
movq -0x58(%rbp), %rdx
leaq 0x5bf0(%rip), %rsi      # 0x162c8
movb $0x0, %al
callq 0x1100
movq 0xa8ea(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x62cc(%rip), %rsi      # 0x169bc
movb $0x0, %al
callq 0x1100
leaq 0x3fa5(%rip), %rax      # 0x146a3
movq %rax, 0xaa4b(%rip)      # 0x1b150
movl $0x983, 0xaa39(%rip)    # imm = 0x983
leaq 0x5d0d(%rip), %rax      # 0x16423
movq %rax, 0xaa3b(%rip)      # 0x1b158
movzbl 0xa9dc(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x10731
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10757
jmp 0x1073c
movq -0x18(%rbp), %rdi
callq 0x1800
movq $0x0, 0xaa08(%rip) # 0x1b158
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq