#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*/ destroyStringArray(char **);
int /*<<< orphan*/ splitString(char *, char **, int *);
scalar_t__ strcmp(char *, char *);
int sdt_2_check(char *line) {
  char **splitted = createStringArray();
  int n = 0;
  splitString(line, splitted, &n);
  if (n == 4) {
    if (strcmp(splitted[0], "str") == 0 && strcmp(splitted[1], "r0") == 0 &&
        strcmp(splitted[2], "[r0]") == 0 && strcmp(splitted[3], "#2") == 0) {
      destroyStringArray(splitted);
      return 1;
    }
    if (strcmp(splitted[0], "str") == 0 && strcmp(splitted[1], "r0") == 0 &&
        strcmp(splitted[2], "[r0]") == 0 && strcmp(splitted[3], "#0x2") == 0) {
      destroyStringArray(splitted);
      return 1;
    }
  }
  destroyStringArray(splitted);
  return 0;
}


x86 assembly (clang, -O0):
<sdt_2_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <createStringArray@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <splitString@plt>
cmpl   $0x4,-0x1c(%rbp)
jne    1296 <sdt_2_check+0x156>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe79(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1205 <sdt_2_check+0xc5>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1205 <sdt_2_check+0xc5>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe44(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1205 <sdt_2_check+0xc5>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe2b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1205 <sdt_2_check+0xc5>
mov    -0x18(%rbp),%rdi
call   1050 <destroyStringArray@plt>
movl   $0x1,-0x4(%rbp)
jmp    12a6 <sdt_2_check+0x166>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xded(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1291 <sdt_2_check+0x151>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1291 <sdt_2_check+0x151>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdb8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1291 <sdt_2_check+0x151>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xda2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1291 <sdt_2_check+0x151>
mov    -0x18(%rbp),%rdi
call   1050 <destroyStringArray@plt>
movl   $0x1,-0x4(%rbp)
jmp    12a6 <sdt_2_check+0x166>
jmp    1296 <sdt_2_check+0x156>
mov    -0x18(%rbp),%rdi
call   1050 <destroyStringArray@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdt_2_check>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbp
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <createStringArray@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
mov    %rax,%rsi
call   1030 <splitString@plt>
cmpl   $0x4,0xc(%rsp)
jne    1221 <sdt_2_check+0xe1>
mov    (%rbx),%rdi
lea    0xe7b(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11ce <sdt_2_check+0x8e>
mov    0x8(%rbx),%rdi
lea    0xe6a(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11ce <sdt_2_check+0x8e>
mov    0x10(%rbx),%rdi
lea    0xe58(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11ce <sdt_2_check+0x8e>
mov    0x18(%rbx),%rdi
lea    0xe48(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1235 <sdt_2_check+0xf5>
mov    (%rbx),%rdi
lea    0xe28(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1221 <sdt_2_check+0xe1>
mov    0x8(%rbx),%rdi
lea    0xe17(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1221 <sdt_2_check+0xe1>
mov    0x10(%rbx),%rdi
lea    0xe05(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1221 <sdt_2_check+0xe1>
mov    0x18(%rbx),%rdi
lea    0xdf8(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1235 <sdt_2_check+0xf5>
mov    %rbx,%rdi
call   1050 <destroyStringArray@plt>
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
call   1050 <destroyStringArray@plt>
mov    $0x1,%r14d
jmp    1229 <sdt_2_check+0xe9>

LLVM IR (-O0):
@.str = [4 x i8] c"str\00"
@.str.1 = [3 x i8] c"r0\00"
@.str.2 = [5 x i8] c"[r0]\00"
@.str.3 = [3 x i8] c"\00"
@.str.4 = [5 x i8] c"x2\00"
define i32 @sdt_2_check(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %3
%6 = call i8** (...) @createStringArray()
store i8** %6, i8*** %4
store i32 0, i32* %5
%7 = load i8*, i8** %3
%8 = load i8**, i8*** %4
%9 = call i32 @splitString(i8* %7, i8** %8, i32* %5)
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %67
12: ; preds = %1
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %39
18: ; preds = %12
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %39
24: ; preds = %18
%25 = load i8**, i8*** %4
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %39
30: ; preds = %24
%31 = load i8**, i8*** %4
%32 = getelementptr inbounds i8*, i8** %31, i64 3
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = load i8**, i8*** %4
%38 = call i32 @destroyStringArray(i8** %37)
store i32 1, i32* %2
br label %70
39: ; preds = %30, %24, %18, %12
%40 = load i8**, i8*** %4
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %66
45: ; preds = %39
%46 = load i8**, i8*** %4
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %66
51: ; preds = %45
%52 = load i8**, i8*** %4
%53 = getelementptr inbounds i8*, i8** %52, i64 2
%54 = load i8*, i8** %53
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %66
57: ; preds = %51
%58 = load i8**, i8*** %4
%59 = getelementptr inbounds i8*, i8** %58, i64 3
%60 = load i8*, i8** %59
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %57
%64 = load i8**, i8*** %4
%65 = call i32 @destroyStringArray(i8** %64)
store i32 1, i32* %2
br label %70
66: ; preds = %57, %51, %45, %39
br label %67
67: ; preds = %66, %1
%68 = load i8**, i8*** %4
%69 = call i32 @destroyStringArray(i8** %68)
store i32 0, i32* %2
br label %70
70: ; preds = %67, %63, %36
%71 = load i32, i32* %2
ret i32 %71
}

LLVM IR (-O2):
@.str = [4 x i8] c"str\00"
@.str.1 = [3 x i8] c"r0\00"
@.str.2 = [5 x i8] c"[r0]\00"
@.str.3 = [3 x i8] c"\00"
@.str.4 = [5 x i8] c"x2\00"
define i32 @sdt_2_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 i32, i32* %2
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %50
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %29
12: ; preds = %8
%13 = getelementptr inbounds i8*, i8** %3, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %29
17: ; preds = %12
%18 = getelementptr inbounds i8*, i8** %3, i64 2
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = getelementptr inbounds i8*, i8** %3, i64 3
%24 = load i8*, i8** %23
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @destroyStringArray(i8** %3)
br label %52
29: ; preds = %22, %17, %12, %8
%30 = load i8*, i8** %3
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %50
33: ; preds = %29
%34 = getelementptr inbounds i8*, i8** %3, i64 1
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %50
38: ; preds = %33
%39 = getelementptr inbounds i8*, i8** %3, i64 2
%40 = load i8*, i8** %39
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %50
43: ; preds = %38
%44 = getelementptr inbounds i8*, i8** %3, i64 3
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %43
%49 = call i32 @destroyStringArray(i8** %3)
br label %52
50: ; preds = %29, %33, %38, %43, %1
%51 = call i32 @destroyStringArray(i8** %3)
br label %52
52: ; preds = %50, %48, %27
%53 = phi i32 [ 1, %27 ], [ 1, %48 ], [ 0, %50 ]
ret i32 %53
}