#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 */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int /*<<< orphan*/ REG_EXTENDED;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ regcomp(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void compile_expressions(regex_t *rect, regex_t *rotate_row,
                         regex_t *rotate_column) {
  if (regcomp(rect, "rect ([0-9]+)x([0-9]+)", REG_EXTENDED)) {
    fprintf(stderr, "Could not compile regex: %s\n", "rect ([0-9]+)x([0-9]+)");
    exit(1);
  }
  if (regcomp(rotate_row, "rotate row y=([0-9]+) by ([0-9]+)", REG_EXTENDED)) {
    fprintf(stderr, "Could not compile regex: %s\n",
            "rotate row y=([0-9]+) by ([0-9]+)");
    exit(1);
  }
  if (regcomp(rotate_column, "rotate column x=([0-9]+) by ([0-9]+)",
              REG_EXTENDED)) {
    fprintf(stderr, "Could not compile regex: %s\n",
            "rotate column x=([0-9]+) by ([0-9]+)");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<compile_expressions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
lea    0xea8(%rip),%rsi
call   1030 <regcomp@plt>
cmp    $0x0,%rax
je     118d <compile_expressions+0x5d>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
lea    0xe82(%rip),%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e40(%rip),%rax
mov    (%rax),%edx
lea    0xe93(%rip),%rsi
call   1030 <regcomp@plt>
cmp    $0x0,%rax
je     11d6 <compile_expressions+0xa6>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
lea    0xe57(%rip),%rsi
lea    0xe6d(%rip),%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    0x2df7(%rip),%rax
mov    (%rax),%edx
lea    0xe6c(%rip),%rsi
call   1030 <regcomp@plt>
cmp    $0x0,%rax
je     121f <compile_expressions+0xef>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
lea    0xe0e(%rip),%rsi
lea    0xe46(%rip),%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compile_expressions>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    0x2e96(%rip),%r15
mov    (%r15),%edx
lea    0xeb4(%rip),%rsi
call   1030 <regcomp@plt>
test   %rax,%rax
jne    118a <compile_expressions+0x5a>
mov    (%r15),%edx
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <regcomp@plt>
test   %rax,%rax
jne    11a3 <compile_expressions+0x73>
mov    (%r15),%edx
lea    0xedf(%rip),%rsi
mov    %r14,%rdi
call   1030 <regcomp@plt>
test   %rax,%rax
jne    11bc <compile_expressions+0x8c>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    0xe7d(%rip),%rsi
lea    0xe5f(%rip),%rdx
jmp    11d3 <compile_expressions+0xa3>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
lea    0xe64(%rip),%rsi
lea    0xe7a(%rip),%rdx
jmp    11d3 <compile_expressions+0xa3>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
lea    0xe83(%rip),%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"rect ([0-9]+)x([0-9]+)\00"
@REG_EXTENDED = global i32 0
@stderr = global i32 0
@.str.1 = [29 x i8] c"Could not compile regex: %s\0A\00"
@.str.2 = [34 x i8] c"rotate row y=([0-9]+) by ([0-9]+)\00"
@.str.3 = [37 x i8] c"rotate column x=([0-9]+) by ([0-9]+)\00"
define void @compile_expressions(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* @REG_EXTENDED
%9 = call i64 @regcomp(i32* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
%16 = load i32*, i32** %5
%17 = load i32, i32* @REG_EXTENDED
%18 = call i64 @regcomp(i32* %16, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %15
%25 = load i32*, i32** %6
%26 = load i32, i32* @REG_EXTENDED
%27 = call i64 @regcomp(i32* %25, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %24
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"rect ([0-9]+)x([0-9]+)\00"
@REG_EXTENDED = global i32 0
@stderr = global i32 0
@.str.1 = [29 x i8] c"Could not compile regex: %s\0A\00"
@.str.2 = [34 x i8] c"rotate row y=([0-9]+) by ([0-9]+)\00"
@.str.3 = [37 x i8] c"rotate column x=([0-9]+) by ([0-9]+)\00"
define void @compile_expressions(i32* %0, i32* %1, i32* %2) {
%4 = load i32, i32* @REG_EXTENDED
%5 = tail call i64 @regcomp(i32* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %3
%12 = load i32, i32* @REG_EXTENDED
%13 = tail call i64 @regcomp(i32* %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %11
%20 = load i32, i32* @REG_EXTENDED
%21 = tail call i64 @regcomp(i32* %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%26 = tail call i32 @exit(i32 1)
unreachable
27: ; preds = %19
ret void
}