// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x61
popq %rdi
callq 0x7106
movq %rax, %rbx
pushq $0x62
popq %rdi
callq 0x7106
xorl %ebp, %ebp
pushq $0x2
popq %r15
movl %r15d, %edi
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x7646
movq %rax, %r14
movq %rax, %rdi
callq 0x6a6b
leaq 0x5796(%rip), %rsi      # 0x79cc
movq 0x13d8b(%rip), %r8      # 0x15fc8
movl %r15d, %edi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x773b
movq %rax, %rbx
leaq 0xadba(%rip), %rdi      # 0xd011
leaq 0xb355(%rip), %rsi      # 0xd5b3
leaq 0x8(%rsp), %r15
movq %rax, %rdx
movq %r15, %rcx
callq 0x646d
leaq 0xadd3(%rip), %rsi      # 0xd048
leaq 0xaec8(%rip), %rdx      # 0xd144
movl %eax, %edi
movl $0x96, %ecx
callq 0x4040
movq (%r15), %rax
cmpb $0x61, (%rax)
movl $0x0, %edi
jne 0x22a5
cmpb $0x61, 0x1(%rax)
jne 0x22a5
xorl %edi, %edi
cmpb $0x0, 0x2(%rax)
sete %dil
leaq 0xb313(%rip), %rsi      # 0xd5bf
leaq 0xae91(%rip), %r15      # 0xd144
movq %r15, %rdx
movl $0x97, %ecx
callq 0x4040
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
callq 0x1270
leaq 0xad3c(%rip), %rdi      # 0xd011
leaq 0xb301(%rip), %rsi      # 0xd5dd
movq %rbx, %rdx
movq %r12, %rcx
callq 0x646d
leaq 0xad5a(%rip), %rsi      # 0xd048
movl %eax, %edi
movq %r15, %rdx
movl $0x9b, %ecx
callq 0x4040
movq (%r12), %rax
cmpb $0x62, (%rax)
jne 0x2316
cmpb $0x62, 0x1(%rax)
jne 0x2316
xorl %ebp, %ebp
cmpb $0x0, 0x2(%rax)
sete %bpl
leaq 0xb2c3(%rip), %rsi      # 0xd5e0
leaq 0xae20(%rip), %r15      # 0xd144
movl %ebp, %edi
movq %r15, %rdx
movl $0x9c, %ecx
callq 0x4040
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
callq 0x1270
leaq 0xacc9(%rip), %rdi      # 0xd011
leaq 0xd0c4(%rip), %rsi      # 0xf413
movq %rbx, %rdx
movq %r12, %rcx
callq 0x646d
leaq 0xace7(%rip), %rsi      # 0xd048
movl %eax, %edi
movq %r15, %rdx
movl $0xa0, %ecx
callq 0x4040
movq (%r12), %rax
xorl %ebp, %ebp
cmpb $0x61, (%rax)
movl $0x0, %edi
jne 0x2390
cmpb $0x62, 0x1(%rax)
jne 0x2390
xorl %edi, %edi
cmpb $0x0, 0x2(%rax)
sete %dil
leaq 0xb267(%rip), %rsi      # 0xd5fe
leaq 0xada6(%rip), %r15      # 0xd144
movq %r15, %rdx
movl $0xa1, %ecx
callq 0x4040
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
callq 0x1270
leaq 0xac51(%rip), %rdi      # 0xd011
leaq 0xb255(%rip), %rsi      # 0xd61c
movq %rbx, %rdx
movq %r12, %rcx
callq 0x646d
leaq 0xac6f(%rip), %rsi      # 0xd048
movl %eax, %edi
movq %r15, %rdx
movl $0xa5, %ecx
callq 0x4040
movq (%r12), %rax
cmpb $0x62, (%rax)
jne 0x2401
cmpb $0x61, 0x1(%rax)
jne 0x2401
xorl %ebp, %ebp
cmpb $0x0, 0x2(%rax)
sete %bpl
leaq 0xb217(%rip), %rsi      # 0xd61f
leaq 0xad35(%rip), %r15      # 0xd144
movl %ebp, %edi
movq %r15, %rdx
movl $0xa6, %ecx
callq 0x4040
leaq 0x8(%rsp), %r12
movq (%r12), %rdi
callq 0x1270
leaq 0xabde(%rip), %rdi      # 0xd011
leaq 0xbe38(%rip), %rsi      # 0xe272
movq %r14, %rdx
movq %r12, %rcx
callq 0x646d
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xabf3(%rip), %rsi      # 0xd047
movq %r15, %rdx
movl $0xaa, %ecx
callq 0x4040
movq (%r12), %rdi
callq 0x5270
movq %r14, %rdi
callq 0x6a6b
movq %rax, %rdi
callq 0x68f0
movq %rbx, %rdi
callq 0x6a6b
movq %rax, %rdi
callq 0x68f0
movq %rbx, %rdi
callq 0x68f0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq