// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl $0x61, %edi
callq 0x794e
movq %rax, %rbx
movl $0x62, %edi
callq 0x794e
xorl %ebp, %ebp
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x7f80
movq %rax, %r14
movq %rax, %rdi
callq 0x7211
leaq 0x611f(%rip), %rsi      # 0x83c6
movq 0x15d1a(%rip), %r8      # 0x17fc8
movl $0x2, %edi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x8088
movq %rax, %rbx
leaq 0xcd47(%rip), %rdi      # 0xf011
leaq 0xd2e2(%rip), %rsi      # 0xf5b3
leaq 0x8(%rsp), %r15
movq %rax, %rdx
movq %r15, %rcx
callq 0x6bd7
leaq 0xcd60(%rip), %rsi      # 0xf048
leaq 0xce55(%rip), %rdx      # 0xf144
movl %eax, %edi
movl $0x96, %ecx
callq 0x4094
movq (%r15), %rax
cmpb $0x61, (%rax)
movl $0x0, %edi
jne 0x2318
cmpb $0x61, 0x1(%rax)
jne 0x2318
xorl %edi, %edi
cmpb $0x0, 0x2(%rax)
sete %dil
leaq 0xd2a0(%rip), %rsi      # 0xf5bf
leaq 0xce1e(%rip), %r15      # 0xf144
movq %r15, %rdx
movl $0x97, %ecx
callq 0x4094
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
callq 0x1270
leaq 0xccc9(%rip), %rdi      # 0xf011
leaq 0xd28e(%rip), %rsi      # 0xf5dd
movq %rbx, %rdx
movq %r12, %rcx
callq 0x6bd7
leaq 0xcce7(%rip), %rsi      # 0xf048
movl %eax, %edi
movq %r15, %rdx
movl $0x9b, %ecx
callq 0x4094
movq (%r12), %rax
cmpb $0x62, (%rax)
jne 0x2389
cmpb $0x62, 0x1(%rax)
jne 0x2389
xorl %ebp, %ebp
cmpb $0x0, 0x2(%rax)
sete %bpl
leaq 0xd250(%rip), %rsi      # 0xf5e0
leaq 0xcdad(%rip), %r15      # 0xf144
movl %ebp, %edi
movq %r15, %rdx
movl $0x9c, %ecx
callq 0x4094
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
callq 0x1270
leaq 0xcc56(%rip), %rdi      # 0xf011
leaq 0xf051(%rip), %rsi      # 0x11413
movq %rbx, %rdx
movq %r12, %rcx
callq 0x6bd7
leaq 0xcc74(%rip), %rsi      # 0xf048
movl %eax, %edi
movq %r15, %rdx
movl $0xa0, %ecx
callq 0x4094
movq (%r12), %rax
xorl %ebp, %ebp
cmpb $0x61, (%rax)
movl $0x0, %edi
jne 0x2403
cmpb $0x62, 0x1(%rax)
jne 0x2403
xorl %edi, %edi
cmpb $0x0, 0x2(%rax)
sete %dil
leaq 0xd1f4(%rip), %rsi      # 0xf5fe
leaq 0xcd33(%rip), %r15      # 0xf144
movq %r15, %rdx
movl $0xa1, %ecx
callq 0x4094
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
callq 0x1270
leaq 0xcbde(%rip), %rdi      # 0xf011
leaq 0xd1e2(%rip), %rsi      # 0xf61c
movq %rbx, %rdx
movq %r12, %rcx
callq 0x6bd7
leaq 0xcbfc(%rip), %rsi      # 0xf048
movl %eax, %edi
movq %r15, %rdx
movl $0xa5, %ecx
callq 0x4094
movq (%r12), %rax
cmpb $0x62, (%rax)
jne 0x2474
cmpb $0x61, 0x1(%rax)
jne 0x2474
xorl %ebp, %ebp
cmpb $0x0, 0x2(%rax)
sete %bpl
leaq 0xd1a4(%rip), %rsi      # 0xf61f
leaq 0xccc2(%rip), %r15      # 0xf144
movl %ebp, %edi
movq %r15, %rdx
movl $0xa6, %ecx
callq 0x4094
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
callq 0x1270
leaq 0xcb6b(%rip), %rdi      # 0xf011
leaq 0xddc5(%rip), %rsi      # 0x10272
movq %r14, %rdx
movq %r12, %rcx
callq 0x6bd7
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xcb80(%rip), %rsi      # 0xf047
movq %r15, %rdx
movl $0xaa, %ecx
callq 0x4094
movq (%r12), %rdi
callq 0x56b0
movq %r14, %rdi
callq 0x7211
movq %rax, %rdi
callq 0x708b
movq %rbx, %rdi
callq 0x7211
movq %rax, %rdi
callq 0x708b
movq %rbx, %rdi
callq 0x708b
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq