// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x61, %edi
callq 0x79a1
movq %rax, %rbx
movl $0x62, %edi
callq 0x79a1
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x807e
movq %rax, %rbx
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x71e1
leaq 0x6235(%rip), %rsi      # 0x84f1
movq 0x15d05(%rip), %r8      # 0x17fc8
movl $0x2, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x818f
movq %rax, %rbx
leaq 0xcd32(%rip), %r14      # 0xf011
leaq 0xd2cd(%rip), %r13      # 0xf5b3
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x6ba1
leaq 0xcd45(%rip), %rbp      # 0xf048
leaq 0xce3a(%rip), %r12      # 0xf144
movl %eax, %edi
movq %rbp, %rsi
movq %r12, %rdx
movl $0x96, %ecx
callq 0x4050
movq (%r15), %rdi
movq %r13, %rsi
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xd289(%rip), %rsi      # 0xf5bf
movq %r12, %rdx
movl $0x97, %ecx
callq 0x4050
movq (%r15), %rdi
callq 0x1270
leaq 0xd28b(%rip), %r13      # 0xf5dd
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x6ba1
movl %eax, %edi
movq %rbp, %rsi
movq %r12, %rdx
movl $0x9b, %ecx
callq 0x4050
movq (%r15), %rdi
movq %r13, %rsi
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xd251(%rip), %rsi      # 0xf5e0
movq %r12, %rdx
movl $0x9c, %ecx
callq 0x4050
movq (%r15), %rdi
callq 0x1270
leaq 0xf068(%rip), %r13      # 0x11413
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x6ba1
movl %eax, %edi
movq %rbp, %rsi
movq %r12, %rdx
movl $0xa0, %ecx
callq 0x4050
movq (%r15), %rdi
movq %r13, %rsi
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xd216(%rip), %rsi      # 0xf5fe
movq %r12, %rdx
movl $0xa1, %ecx
callq 0x4050
movq (%r15), %rdi
callq 0x1270
leaq 0xd218(%rip), %r13      # 0xf61c
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x6ba1
movl %eax, %edi
movq %rbp, %rsi
movq %r12, %rdx
movl $0xa5, %ecx
callq 0x4050
movq (%r15), %rdi
movq %r13, %rsi
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xd1de(%rip), %rsi      # 0xf61f
movq %r12, %rdx
movl $0xa6, %ecx
callq 0x4050
movq (%r15), %rdi
callq 0x1270
leaq 0xde15(%rip), %rsi      # 0x10272
movq %r14, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rdx
movq %r15, %rcx
callq 0x6ba1
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xcbc8(%rip), %rsi      # 0xf047
movq %r12, %rdx
movl $0xaa, %ecx
callq 0x4050
movq (%r15), %rdi
callq 0x566c
movq %r14, %rdi
callq 0x71e1
movq %rax, %rdi
callq 0x7052
movq %rbx, %rdi
callq 0x71e1
movq %rax, %rdi
callq 0x7052
movq %rbx, %rdi
callq 0x7052
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq