// File: /workspace/github_c_makefile_star2_O0/orangeduck[P]mpc/tests/core.c
// Function: test_copy
void test_copy(void) {

  int success;
  mpc_result_t r;
  mpc_parser_t* p = mpc_or(2, mpc_char('a'), mpc_char('b'));
  mpc_parser_t* q = mpc_and(2, mpcf_strfold, p, mpc_copy(p), free);

  success = mpc_parse("test", "aa", q, &r);
  PT_ASSERT(success);
  PT_ASSERT_STR_EQ(r.output, "aa");
  free(r.output);

  success = mpc_parse("test", "bb", q, &r);
  PT_ASSERT(success);
  PT_ASSERT_STR_EQ(r.output, "bb");
  free(r.output);

  success = mpc_parse("test", "ab", q, &r);
  PT_ASSERT(success);
  PT_ASSERT_STR_EQ(r.output, "ab");
  free(r.output);

  success = mpc_parse("test", "ba", q, &r);
  PT_ASSERT(success);
  PT_ASSERT_STR_EQ(r.output, "ba");
  free(r.output);

  success = mpc_parse("test", "c", p, &r);
  PT_ASSERT(!success);
  mpc_err_delete(r.error);

  mpc_delete(mpc_copy(p));
  mpc_delete(mpc_copy(q));

  mpc_delete(q);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x61, %edi
callq 0x9f20
movq %rax, -0x30(%rbp)
movl $0x62, %edi
callq 0x9f20
movq -0x30(%rbp), %rsi
movq %rax, %rdx
movl $0x2, %edi
movb $0x0, %al
callq 0xa7b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9400
movq -0x28(%rbp), %rdx
movq %rax, %rcx
movl $0x2, %edi
leaq 0x7785(%rip), %rsi      # 0xad60
movq 0x189e6(%rip), %r8      # 0x1bfc8
movb $0x0, %al
callq 0xa910
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdx
leaq 0x10a19(%rip), %rdi     # 0x14011
leaq 0x10fb4(%rip), %rsi     # 0x145b3
leaq -0x10(%rbp), %rcx
callq 0x88a0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq 0x10a33(%rip), %rsi     # 0x14048
leaq 0x10b28(%rip), %rdx     # 0x14144
movl $0x96, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
leaq 0x10f82(%rip), %rsi     # 0x145b3
callq 0x2110
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x10f77(%rip), %rsi     # 0x145bf
leaq 0x10af5(%rip), %rdx     # 0x14144
movl $0x97, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0x2240
movq -0x20(%rbp), %rdx
leaq 0x109a4(%rip), %rdi     # 0x14011
leaq 0x10f69(%rip), %rsi     # 0x145dd
leaq -0x10(%rbp), %rcx
callq 0x88a0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq 0x109be(%rip), %rsi     # 0x14048
leaq 0x10ab3(%rip), %rdx     # 0x14144
movl $0x9b, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
leaq 0x10f37(%rip), %rsi     # 0x145dd
callq 0x2110
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x10f23(%rip), %rsi     # 0x145e0
leaq 0x10a80(%rip), %rdx     # 0x14144
movl $0x9c, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0x2240
movq -0x20(%rbp), %rdx
leaq 0x1092f(%rip), %rdi     # 0x14011
leaq 0x12ce6(%rip), %rsi     # 0x163cf
leaq -0x10(%rbp), %rcx
callq 0x88a0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq 0x10949(%rip), %rsi     # 0x14048
leaq 0x10a3e(%rip), %rdx     # 0x14144
movl $0xa0, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
leaq 0x12cb4(%rip), %rsi     # 0x163cf
callq 0x2110
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x10ecc(%rip), %rsi     # 0x145fe
leaq 0x10a0b(%rip), %rdx     # 0x14144
movl $0xa1, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0x2240
movq -0x20(%rbp), %rdx
leaq 0x108ba(%rip), %rdi     # 0x14011
leaq 0x10ebe(%rip), %rsi     # 0x1461c
leaq -0x10(%rbp), %rcx
callq 0x88a0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq 0x108d4(%rip), %rsi     # 0x14048
leaq 0x109c9(%rip), %rdx     # 0x14144
movl $0xa5, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
leaq 0x10e8c(%rip), %rsi     # 0x1461c
callq 0x2110
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x10e78(%rip), %rsi     # 0x1461f
leaq 0x10996(%rip), %rdx     # 0x14144
movl $0xa6, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0x2240
movq -0x18(%rbp), %rdx
leaq 0x10845(%rip), %rdi     # 0x14011
leaq 0x11a9f(%rip), %rsi     # 0x15272
leaq -0x10(%rbp), %rcx
callq 0x88a0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x10853(%rip), %rsi     # 0x14047
leaq 0x10949(%rip), %rdx     # 0x14144
movl $0xaa, %ecx
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0x6ed0
movq -0x18(%rbp), %rdi
callq 0x9400
movq %rax, %rdi
callq 0x9160
movq -0x20(%rbp), %rdi
callq 0x9400
movq %rax, %rdi
callq 0x9160
movq -0x20(%rbp), %rdi
callq 0x9160
addq $0x30, %rsp
popq %rbp
retq
nop