#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ tstre(char *, char *);
void test_regexp(void) {
  tstre("abc123", "*");
  tstre("abc123", "abc123");
  tstre("abc123", "abc123*");
  tstre("abc123", "aXc123");
  tstre("abc123", "a?c123");
  tstre("abc123", "abc*");
  tstre("abc123", "*123");
  tstre("abc123", "a*3");
  tstre("abc123", "a*1?3");
  tstre("abc1X3", "a*1?3");
  tstre("abc123", "a*1?4?");
  tstre("abc123", "a*1?3*");
  tstre("ab?123", "a*1?3*");
  tstre("ab\\123", "ab\\\\123");
  tstre("ab?123", "ab\\?12*");
  tstre("st2sub1", "st?sub*");
}


x86 assembly (clang, -O0):
<test_regexp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf40(%rip),%rsi
call   1030 <tstre@plt>
lea    0xed2(%rip),%rsi
mov    %rsi,%rdi
call   1030 <tstre@plt>
lea    0xec3(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1030 <tstre@plt>
lea    0xeb0(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe9d(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe8a(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe77(%rip),%rdi
lea    0xe92(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe64(%rip),%rdi
lea    0xe84(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe51(%rip),%rdi
lea    0xe75(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe6f(%rip),%rdi
lea    0xe62(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe2b(%rip),%rdi
lea    0xe5c(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe18(%rip),%rdi
lea    0xe50(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe4b(%rip),%rdi
lea    0xe3d(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe3f(%rip),%rdi
lea    0xe3f(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe25(%rip),%rdi
lea    0xe34(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe30(%rip),%rdi
lea    0xe31(%rip),%rsi
call   1030 <tstre@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_regexp>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
lea    0xf40(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <tstre@plt>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
lea    0xe95(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <tstre@plt>
lea    0xe89(%rip),%rdi
mov    %r14,%rsi
call   1030 <tstre@plt>
lea    0xe81(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
lea    0xe79(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <tstre@plt>
lea    0xe6e(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <tstre@plt>
lea    0xe63(%rip),%rdi
lea    0xe63(%rip),%rsi
call   1030 <tstre@plt>
lea    0xe5f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <tstre@plt>
lea    0xe58(%rip),%rdi
lea    0xe59(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <tstre@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"abc123\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [8 x i8] c"abc123*\00"
@.str.3 = [7 x i8] c"aXc123\00"
@.str.4 = [7 x i8] c"a?c123\00"
@.str.5 = [5 x i8] c"abc*\00"
@.str.6 = [5 x i8] c"*123\00"
@.str.7 = [4 x i8] c"a*3\00"
@.str.8 = [6 x i8] c"a*1?3\00"
@.str.9 = [7 x i8] c"abc1X3\00"
@.str.10 = [7 x i8] c"a*1?4?\00"
@.str.11 = [7 x i8] c"a*1?3*\00"
@.str.12 = [7 x i8] c"ab?123\00"
@.str.13 = [7 x i8] c"ab\\123\00"
@.str.14 = [8 x i8] c"ab\\\\123\00"
@.str.15 = [8 x i8] c"ab\\?12*\00"
@.str.16 = [8 x i8] c"st2sub1\00"
@.str.17 = [8 x i8] c"st?sub*\00"
define void @test_regexp() {
%1 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%15 = call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%16 = call i32 @tstre(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"abc123\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [8 x i8] c"abc123*\00"
@.str.3 = [7 x i8] c"aXc123\00"
@.str.4 = [7 x i8] c"a?c123\00"
@.str.5 = [5 x i8] c"abc*\00"
@.str.6 = [5 x i8] c"*123\00"
@.str.7 = [4 x i8] c"a*3\00"
@.str.8 = [6 x i8] c"a*1?3\00"
@.str.9 = [7 x i8] c"abc1X3\00"
@.str.10 = [7 x i8] c"a*1?4?\00"
@.str.11 = [7 x i8] c"a*1?3*\00"
@.str.12 = [7 x i8] c"ab?123\00"
@.str.13 = [7 x i8] c"ab\\123\00"
@.str.14 = [8 x i8] c"ab\\\\123\00"
@.str.15 = [8 x i8] c"ab\\?12*\00"
@.str.16 = [8 x i8] c"st2sub1\00"
@.str.17 = [8 x i8] c"st?sub*\00"
define void @test_regexp() {
%1 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%10 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%12 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%13 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%14 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%15 = tail call i32 @tstre(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%16 = tail call i32 @tstre(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
ret void
}