// File: /workspace/github_c_makefile_star2_O0/mtnygard[P]complisp/lisp.c
// Function: compile_labelcall_with_one_param
TEST compile_labelcall_with_one_param(Buffer *buf) {
  ASTNode *node = Reader_read("(labels ((id (code (x) x))) (labelcall id 5))");
  int compile_result = Compile_entry(buf, node);
  ASSERT_EQ(compile_result, 0);
  // clang-format off
  byte expected[] = {
      // mov rsi, rdi
      0x48, 0x89, 0xfe,
      // jmp 0x06
      0xe9, 0x06, 0x00, 0x00, 0x00,
      // mov rax, [rsp-8]
      0x48, 0x8b, 0x44, 0x24, 0xf8,
      // ret
      0xc3,
      // mov rax, compile(5)
      0x48, 0xc7, 0xc0, 0x14, 0x00, 0x00, 0x00,
      // mov [rsp-16], rax
      0x48, 0x89, 0x44, 0x24, 0xf0,
      // call `id`
      0xe8, 0xe9, 0xff, 0xff, 0xff,
      // 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(5), result, "0x%lx");
  AST_heap_free(node);
  PASS();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x5852(%rip), %rdi      # 0x16875
callq 0x4e40
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4690
movl %eax, -0x1c(%rbp)
movl 0xa102(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0xa0f9(%rip)      # 0x1b144
cmpl $0x0, -0x1c(%rbp)
je 0x11099
jmp 0x11053
leaq 0x3649(%rip), %rax      # 0x146a3
movq %rax, 0xa0ef(%rip)      # 0x1b150
movl $0x9e9, 0xa0dd(%rip)    # imm = 0x9E9
leaq 0x5013(%rip), %rax      # 0x16085
movq %rax, 0xa0df(%rip)      # 0x1b158
movzbl 0xa080(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1108d
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x112ed
jmp 0x1109b
movq 0x5afe(%rip), %rax      # 0x16ba0
movq %rax, -0x40(%rbp)
movq 0x5afb(%rip), %rax      # 0x16ba8
movq %rax, -0x38(%rbp)
movq 0x5af8(%rip), %rax      # 0x16bb0
movq %rax, -0x30(%rbp)
movq 0x5af5(%rip), %rax      # 0x16bb8
movq %rax, -0x28(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq $0x20, -0x48(%rbp)
leaq 0x9fff(%rip), %rax      # 0x1b0e8
movq %rax, -0x60(%rbp)
movl 0xa051(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0xa048(%rip)      # 0x1b144
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0x11f00
cmpl $0x0, %eax
jne 0x111bb
cmpq $0x0, -0x60(%rbp)
je 0x1112b
movq -0x60(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x11173
jmp 0x1112d
leaq 0x356f(%rip), %rax      # 0x146a3
movq %rax, 0xa015(%rip)      # 0x1b150
movl $0x9fe, 0xa003(%rip)    # imm = 0x9FE
leaq 0x4991(%rip), %rax      # 0x15add
movq %rax, 0xa005(%rip)      # 0x1b158
movzbl 0x9fa6(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x11167
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x112ed
jmp 0x11175
leaq 0x3527(%rip), %rax      # 0x146a3
movq %rax, 0x9fcd(%rip)      # 0x1b150
movl $0x9fe, 0x9fbb(%rip)    # imm = 0x9FE
leaq 0x51b3(%rip), %rax      # 0x16347
movq %rax, 0x9fbd(%rip)      # 0x1b158
movzbl 0x9f5e(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x111af
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x112ed
jmp 0x111bd
jmp 0x111bf
movq -0x10(%rbp), %rdi
callq 0x1c50
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4e70
movq %rax, -0x68(%rbp)
movl 0x9f65(%rip), %eax      # 0x1b144
addl $0x1, %eax
movl %eax, 0x9f5c(%rip)      # 0x1b144
movl $0x5, %edi
callq 0x1290
cmpq -0x68(%rbp), %rax
je 0x112d0
movq 0x9dcd(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x4521(%rip), %rsi      # 0x1572e
movb $0x0, %al
callq 0x1100
movq 0x9db5(%rip), %rax      # 0x1afd0
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movl $0x5, %edi
callq 0x1290
movq -0x70(%rbp), %rdi
movq %rax, %rdx
leaq 0x508e(%rip), %rsi      # 0x162c8
movb $0x0, %al
callq 0x1100
movq 0x9d88(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x44e8(%rip), %rsi      # 0x1573a
movb $0x0, %al
callq 0x1100
movq 0x9d70(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
movq -0x68(%rbp), %rdx
leaq 0x505a(%rip), %rsi      # 0x162c8
movb $0x0, %al
callq 0x1100
movq 0x9d54(%rip), %rax      # 0x1afd0
movq (%rax), %rdi
leaq 0x5736(%rip), %rsi      # 0x169bc
movb $0x0, %al
callq 0x1100
leaq 0x340f(%rip), %rax      # 0x146a3
movq %rax, 0x9eb5(%rip)      # 0x1b150
movl $0xa01, 0x9ea3(%rip)    # imm = 0xA01
leaq 0x5567(%rip), %rax      # 0x16813
movq %rax, 0x9ea5(%rip)      # 0x1b158
movzbl 0x9e46(%rip), %eax      # 0x1b100
andl $0x4, %eax
cmpl $0x0, %eax
je 0x112c7
callq 0x1040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x112ed
jmp 0x112d2
movq -0x18(%rbp), %rdi
callq 0x1800
movq $0x0, 0x9e72(%rip) # 0x1b158
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)