// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
leaq 0xca21(%rip), %rdi      # 0x112f0
callq 0x9153
movq %rax, %rbx
movq %rax, 0x10(%rsp)
leaq 0xca15(%rip), %rdi      # 0x112f8
callq 0x9153
movq %rax, %r15
movq %rax, 0x8(%rsp)
leaq 0xca0b(%rip), %rdi      # 0x11302
callq 0x9153
movq %rax, 0x18(%rsp)
leaq 0xca05(%rip), %rdi      # 0x1130d
callq 0x9153
movq %rax, 0x30(%rsp)
leaq 0xc9ff(%rip), %rdi      # 0x11318
callq 0x9153
movq %rax, 0x28(%rsp)
leaq 0xc9fa(%rip), %rdi      # 0x11324
callq 0x9153
movq %rax, 0x20(%rsp)
leaq 0xc9f7(%rip), %rdx      # 0x11332
leaq -0xc4(%rip), %r12       # 0x487e
movq 0x1367f(%rip), %r13     # 0x17fc8
leaq -0xc1(%rip), %r14       # 0x488f
movq %rbx, %rdi
movq %rdx, %rsi
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa93d
leaq 0xc9cb(%rip), %rsi      # 0x11336
leaq 0xc9e7(%rip), %rbp      # 0x11359
movl %eax, %edi
movq %rbp, %rdx
movl $0x1d, %ecx
callq 0x4094
leaq 0xc96c(%rip), %rdx      # 0x112f4
movq %rbx, %rdi
movq %rdx, %rsi
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa93d
leaq 0xc9c4(%rip), %rsi      # 0x11367
movl %eax, %edi
movq %rbp, %rdx
movl $0x1e, %ecx
callq 0x4094
leaq 0xc97a(%rip), %rdx      # 0x11333
movq %rbx, %rdi
movq %rdx, %rsi
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa8c1
leaq 0xc9b6(%rip), %rsi      # 0x1138a
movl %eax, %edi
movq %rbp, %rdx
movl $0x1f, %ecx
callq 0x4094
leaq 0xca29(%rip), %rdx      # 0x11413
movq %rbx, %rdi
movq %rdx, %rsi
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa8c1
leaq 0xc9a6(%rip), %rsi      # 0x113ab
movl %eax, %edi
movq %rbp, %rdx
movl $0x20, %ecx
callq 0x4094
leaq 0xd79d(%rip), %rdx      # 0x121b8
movq %r15, %rdi
movq %rdx, %rsi
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa93d
leaq 0xc996(%rip), %rsi      # 0x113cc
movl %eax, %edi
movq %rbp, %rdx
movl $0x21, %ecx
callq 0x4094
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
leaq 0xc8de(%rip), %rdx      # 0x11332
movq %rdx, %rsi
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa93d
leaq 0xc97f(%rip), %rsi      # 0x113eb
movl %eax, %edi
movq %rbp, %rdx
movl $0x22, %ecx
callq 0x4094
leaq 0xc98c(%rip), %r15      # 0x1140e
movq %rbx, %rdi
movq %r15, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa93d
leaq 0xc976(%rip), %rsi      # 0x11416
movl %eax, %edi
movq %rbp, %rdx
movl $0x23, %ecx
callq 0x4094
leaq 0xc98b(%rip), %rsi      # 0x11441
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa93d
leaq 0xc979(%rip), %rsi      # 0x1144a
movl %eax, %edi
movq %rbp, %rdx
movl $0x24, %ecx
callq 0x4094
leaq 0xc98f(%rip), %rdx      # 0x11476
movq 0x20(%rsp), %r15
movq %r15, %rdi
movq %rdx, %rsi
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0xa93d
leaq 0xc976(%rip), %rsi      # 0x1147d
movl %eax, %edi
movq %rbp, %rdx
movl $0x25, %ecx
callq 0x4094
movq 0x10(%rsp), %rdi
callq 0x708b
movq 0x8(%rsp), %rdi
callq 0x708b
movq %rbx, %rdi
callq 0x708b
movq 0x30(%rsp), %rdi
callq 0x708b
movq 0x28(%rsp), %rdi
callq 0x708b
movq %r15, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x708b