// File: /workspace/github_c_makefile_star2_O2/orangeduck[P]mpc/tests/regex.c
// Function: test_regex_basic
void test_regex_basic(void) {

  mpc_parser_t *re0, *re1, *re2, *re3, *re4, *re5;

  re0 = mpc_re("abc|bcd");
  re1 = mpc_re("abc|bcd|e");
  re2 = mpc_re("ab()c(ab)*");
  re3 = mpc_re("abc(abdd)?");
  re4 = mpc_re("ab|c(abdd)?");
  re5 = mpc_re("abc(ab|dd)+g$");

  PT_ASSERT(regex_test_pass(re0, "abc", "abc"));
  PT_ASSERT(regex_test_pass(re0, "bcd", "bcd"));
  PT_ASSERT(regex_test_fail(re0, "bc", "bc"));
  PT_ASSERT(regex_test_fail(re0, "ab", "ab"));
  PT_ASSERT(regex_test_pass(re1, "e", "e"));
  PT_ASSERT(regex_test_pass(re2, "abc", "abc"));
  PT_ASSERT(regex_test_pass(re2, "abcabab", "abcabab"));
  PT_ASSERT(regex_test_pass(re2, "abcababd", "abcabab"));
  PT_ASSERT(regex_test_pass(re5, "abcddg", "abcddg"));

  mpc_delete(re0);
  mpc_delete(re1);
  mpc_delete(re2);
  mpc_delete(re3);
  mpc_delete(re4);
  mpc_delete(re5);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xab59(%rip), %rdi      # 0xf2f0
callq 0x837c
movq %rax, %rbx
leaq 0xab52(%rip), %rdi      # 0xf2f8
callq 0x837c
movq %rax, %r14
leaq 0xab4d(%rip), %rdi      # 0xf302
callq 0x837c
movq %rax, %r15
leaq 0xab49(%rip), %rdi      # 0xf30d
callq 0x837c
movq %rax, 0x10(%rsp)
leaq 0xab43(%rip), %rdi      # 0xf318
callq 0x837c
movq %rax, 0x8(%rsp)
leaq 0xab3e(%rip), %rdi      # 0xf324
callq 0x837c
movq %rax, %rbp
leaq 0xab3d(%rip), %r13      # 0xf332
movq %rbx, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x472c
leaq 0xab2c(%rip), %rsi      # 0xf336
leaq 0xab48(%rip), %r12      # 0xf359
pushq $0x1d
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
leaq 0xaacf(%rip), %rdx      # 0xf2f4
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x472c
leaq 0xab30(%rip), %rsi      # 0xf367
pushq $0x1e
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
leaq 0xaae8(%rip), %rdx      # 0xf333
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x4768
leaq 0xab2d(%rip), %rsi      # 0xf38a
pushq $0x1f
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
leaq 0xaba2(%rip), %rdx      # 0xf413
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x4768
leaq 0xab28(%rip), %rsi      # 0xf3ab
pushq $0x20
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
leaq 0xb911(%rip), %rdx      # 0x101a8
movq %r14, %rdi
movq %rdx, %rsi
callq 0x472c
leaq 0xab23(%rip), %rsi      # 0xf3cc
pushq $0x21
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
movq %r15, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x472c
leaq 0xab20(%rip), %rsi      # 0xf3eb
pushq $0x22
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
leaq 0xab2f(%rip), %r13      # 0xf40e
movq %r15, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x472c
leaq 0xab22(%rip), %rsi      # 0xf416
pushq $0x23
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
leaq 0xab39(%rip), %rsi      # 0xf441
movq %r15, %rdi
movq %r13, %rdx
callq 0x472c
leaq 0xab30(%rip), %rsi      # 0xf44a
pushq $0x24
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
leaq 0xab48(%rip), %rdx      # 0xf476
movq %rbp, %rdi
movq %rdx, %rsi
callq 0x472c
leaq 0xab3d(%rip), %rsi      # 0xf47d
pushq $0x25
popq %rcx
movl %eax, %edi
movq %r12, %rdx
callq 0x4040
movq %rbx, %rdi
callq 0x68f0
movq %r14, %rdi
callq 0x68f0
movq %r15, %rdi
callq 0x68f0
movq 0x10(%rsp), %rdi
callq 0x68f0
movq 0x8(%rsp), %rdi
callq 0x68f0
movq %rbp, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x68f0