#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exec_regex_basic(char *, char *);
int /*<<< orphan*/ exec_regex_extended(char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Executing basic Regex\n");
  exec_regex_basic("buteco123xxxxx", "\\([a-z]*\\)");
  exec_regex_basic("buteco123xxxxx", "\\([a-z]+\\)\\([0-9]+\\)");
  exec_regex_basic("buteco123xxxxx", "\\([a-z]*\\)\\([0-9]*\\)");
  exec_regex_basic("buteco123xxxxx", "\\([[:alpha:]]*\\)");
  printf("\nExecuting extended Regex\n");
  exec_regex_extended("buteco123xxxxx", "([a-z]*)");
  exec_regex_extended("buteco123xxxxx", "([a-z]+)([0-9]+)");
  exec_regex_extended("buteco123xxxxx", "([a-z]*)([0-9]*)");
  exec_regex_extended("buteco123xxxxx", "([[:alpha:]]*)");
  exec_regex_extended("buteco123xxxxx", "([^[:space:]]+)");
  exec_regex_extended("buteco123xxxxx", "([[:digit:]]+)");
  exec_regex_extended("buteco123xxxxx", "([[:upper:]]+)");
  exec_regex_extended("buteco123xxxxx", "([[:lower:]])");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1040 <exec_regex_basic@plt>
lea    0xea2(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <exec_regex_basic@plt>
lea    0xe8f(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <exec_regex_basic@plt>
lea    0xe7c(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <exec_regex_basic@plt>
lea    0xebe(%rip),%rdi
call   1050 <printf@plt>
lea    0xe5d(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1030 <exec_regex_extended@plt>
lea    0xe4a(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1030 <exec_regex_extended@plt>
lea    0xe37(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1030 <exec_regex_extended@plt>
lea    0xe24(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <exec_regex_extended@plt>
lea    0xe11(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <exec_regex_extended@plt>
lea    0xdfe(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <exec_regex_extended@plt>
lea    0xdeb(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <exec_regex_extended@plt>
lea    0xdd8(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1030 <exec_regex_extended@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf83(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rbx
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1050 <exec_regex_basic@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <exec_regex_basic@plt>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1050 <exec_regex_basic@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1050 <exec_regex_basic@plt>
lea    0xf4a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <exec_regex_extended@plt>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1040 <exec_regex_extended@plt>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <exec_regex_extended@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <exec_regex_extended@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <exec_regex_extended@plt>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <exec_regex_extended@plt>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <exec_regex_extended@plt>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <exec_regex_extended@plt>
mov    0x2dc5(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Executing basic Regex\0A\00"
@.str.1 = [15 x i8] c"buteco123xxxxx\00"
@.str.2 = [11 x i8] c"\\([a-z]*\\)\00"
@.str.3 = [21 x i8] c"\\([a-z]+\\)\\([0-9]+\\)\00"
@.str.4 = [21 x i8] c"\\([a-z]*\\)\\([0-9]*\\)\00"
@.str.5 = [17 x i8] c"\\([[:alpha:]]*\\)\00"
@.str.6 = [27 x i8] c"\0AExecuting extended Regex\0A\00"
@.str.7 = [9 x i8] c"([a-z]*)\00"
@.str.8 = [17 x i8] c"([a-z]+)([0-9]+)\00"
@.str.9 = [17 x i8] c"([a-z]*)([0-9]*)\00"
@.str.10 = [15 x i8] c"([[:alpha:]]*)\00"
@.str.11 = [16 x i8] c"([^[:space:]]+)\00"
@.str.12 = [15 x i8] c"([[:digit:]]+)\00"
@.str.13 = [15 x i8] c"([[:upper:]]+)\00"
@.str.14 = [14 x i8] c"([[:lower:]])\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exec_regex_basic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exec_regex_basic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exec_regex_basic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @exec_regex_basic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
%14 = call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
%15 = call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
%16 = load i32, i32* @EXIT_SUCCESS
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"buteco123xxxxx\00"
@.str.2 = [11 x i8] c"\\([a-z]*\\)\00"
@.str.3 = [21 x i8] c"\\([a-z]+\\)\\([0-9]+\\)\00"
@.str.4 = [21 x i8] c"\\([a-z]*\\)\\([0-9]*\\)\00"
@.str.5 = [17 x i8] c"\\([[:alpha:]]*\\)\00"
@.str.7 = [9 x i8] c"([a-z]*)\00"
@.str.8 = [17 x i8] c"([a-z]+)([0-9]+)\00"
@.str.9 = [17 x i8] c"([a-z]*)([0-9]*)\00"
@.str.10 = [15 x i8] c"([[:alpha:]]*)\00"
@.str.11 = [16 x i8] c"([^[:space:]]+)\00"
@.str.12 = [15 x i8] c"([[:digit:]]+)\00"
@.str.13 = [15 x i8] c"([[:upper:]]+)\00"
@.str.14 = [14 x i8] c"([[:lower:]])\00"
@EXIT_SUCCESS = global i32 0
@str = [22 x i8] c"Executing basic Regex\00"
@str.15 = [26 x i8] c"\0AExecuting extended Regex\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exec_regex_basic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exec_regex_basic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @exec_regex_basic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @exec_regex_basic(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%8 = tail call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%9 = tail call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%10 = tail call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0))
%11 = tail call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%12 = tail call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
%13 = tail call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
%14 = tail call i32 @exec_regex_extended(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
%15 = load i32, i32* @EXIT_SUCCESS
%16 = tail call i32 @exit(i32 %15)
unreachable
}