#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 */
char **createStringArray();
int /*<<< orphan*/ splitString(char *, char **, int *);
scalar_t__ strcmp(char *, char *);
int dp_5_check(char *line) {
  char **splitted = createStringArray();
  int n = 0;
  splitString(line, splitted, &n);
  int isEor = !strcmp(splitted[0], "eor");
  int noTemp = 0;
  if ((strcmp(splitted[1], "r1") == 0 || strcmp(splitted[1], "r0") == 0) &&
      (strcmp(splitted[2], "r1") == 0 || strcmp(splitted[2], "r0") == 0) &&
      (strcmp(splitted[3], "r1") == 0 || strcmp(splitted[3], "r0") == 0)) {
    noTemp = 1;
  }
  return noTemp * isEor;
}


x86 assembly (clang, -O0):
<dp_5_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <createStringArray@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <splitString@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe93(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11c6 <dp_5_check+0x96>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe50(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1245 <dp_5_check+0x115>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe2f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1202 <dp_5_check+0xd2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe14(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1245 <dp_5_check+0x115>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdf3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     123e <dp_5_check+0x10e>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdd8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1245 <dp_5_check+0x115>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dp_5_check>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <createStringArray@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <splitString@plt>
mov    (%rbx),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
lea    0xe88(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     119b <dp_5_check+0x6b>
mov    0x8(%rbx),%rdi
lea    0xe76(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11f4 <dp_5_check+0xc4>
mov    0x10(%rbx),%rdi
lea    0xe5e(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11c5 <dp_5_check+0x95>
mov    0x10(%rbx),%rdi
lea    0xe4c(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11f4 <dp_5_check+0xc4>
mov    0x18(%rbx),%rdi
lea    0xe34(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11ef <dp_5_check+0xbf>
mov    0x18(%rbx),%rdi
lea    0xe22(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11f4 <dp_5_check+0xc4>
mov    $0x1,%ebp
xor    %eax,%eax
test   %r14,%r14
cmove  %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"eor\00"
@.str.1 = [3 x i8] c"r1\00"
@.str.2 = [3 x i8] c"r0\00"
define i32 @dp_5_check(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = call i8** (...) @createStringArray()
store i8** %7, i8*** %3
store i32 0, i32* %4
%8 = load i8*, i8** %2
%9 = load i8**, i8*** %3
%10 = call i32 @splitString(i8* %8, i8** %9, i32* %4)
%11 = load i8**, i8*** %3
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
store i32 %17, i32* %5
store i32 0, i32* %6
%18 = load i8**, i8*** %3
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %29, label %23
23: ; preds = %1
%24 = load i8**, i8*** %3
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %54
29: ; preds = %23, %1
%30 = load i8**, i8*** %3
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %41, label %35
35: ; preds = %29
%36 = load i8**, i8*** %3
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %54
41: ; preds = %35, %29
%42 = load i8**, i8*** %3
%43 = getelementptr inbounds i8*, i8** %42, i64 3
%44 = load i8*, i8** %43
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %53, label %47
47: ; preds = %41
%48 = load i8**, i8*** %3
%49 = getelementptr inbounds i8*, i8** %48, i64 3
%50 = load i8*, i8** %49
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %47, %41
store i32 1, i32* %6
br label %54
54: ; preds = %53, %47, %35, %23
%55 = load i32, i32* %6
%56 = load i32, i32* %5
%57 = mul nsw i32 %55, %56
ret i32 %57
}

LLVM IR (-O2):
@.str = [4 x i8] c"eor\00"
@.str.1 = [3 x i8] c"r1\00"
@.str.2 = [3 x i8] c"r0\00"
define i32 @dp_5_check(i8* %0) {
%2 = alloca i32
%3 = tail call i8** (...) @createStringArray()
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @splitString(i8* %0, i8** %3, i32* %2)
%6 = load i8*, i8** %3
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds i8*, i8** %3, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %1
%13 = load i8*, i8** %8
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %35
16: ; preds = %12, %1
%17 = getelementptr inbounds i8*, i8** %3, i64 2
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %16
%22 = load i8*, i8** %17
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %21, %16
%26 = getelementptr inbounds i8*, i8** %3, i64 3
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %34, label %30
30: ; preds = %25
%31 = load i8*, i8** %26
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %30, %25
br label %35
35: ; preds = %34, %30, %21, %12
%36 = phi i32 [ 1, %34 ], [ 0, %30 ], [ 0, %21 ], [ 0, %12 ]
%37 = icmp eq i64 %7, 0
%38 = select i1 %37, i32 %36, i32 0
ret i32 %38
}