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


x86 assembly (clang, -O0):
<branch_2_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <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   $0x3,-0x1c(%rbp)
jne    11fc <branch_2_check+0xac>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe69(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f7 <branch_2_check+0xa7>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f7 <branch_2_check+0xa7>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe34(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f7 <branch_2_check+0xa7>
mov    -0x18(%rbp),%rdi
call   1050 <destroyStringArray@plt>
movl   $0x1,-0x4(%rbp)
jmp    134d <branch_2_check+0x1fd>
jmp    11fc <branch_2_check+0xac>
cmpl   $0x4,-0x1c(%rbp)
jne    1297 <branch_2_check+0x147>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xdf6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1292 <branch_2_check+0x142>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1292 <branch_2_check+0x142>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdb4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1292 <branch_2_check+0x142>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xda0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1292 <branch_2_check+0x142>
mov    -0x18(%rbp),%rdi
call   1050 <destroyStringArray@plt>
movl   $0x1,-0x4(%rbp)
jmp    134d <branch_2_check+0x1fd>
jmp    1297 <branch_2_check+0x147>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1060 <isLabel@plt>
cmp    $0x0,%rax
je     12c2 <branch_2_check+0x172>
mov    -0x18(%rbp),%rdi
call   1050 <destroyStringArray@plt>
movl   $0x1,-0x4(%rbp)
jmp    134d <branch_2_check+0x1fd>
cmpl   $0x2,-0x1c(%rbp)
jne    133d <branch_2_check+0x1ed>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd37(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1323 <branch_2_check+0x1d3>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd1e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1323 <branch_2_check+0x1d3>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xcf8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1338 <branch_2_check+0x1e8>
mov    -0x18(%rbp),%rdi
call   1050 <destroyStringArray@plt>
movl   $0x1,-0x4(%rbp)
jmp    134d <branch_2_check+0x1fd>
jmp    133d <branch_2_check+0x1ed>
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):
<branch_2_check>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbp
xor    %eax,%eax
call   1070 <createStringArray@plt>
mov    %rax,%rbx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %rbp,%rdi
mov    %rax,%rsi
call   1030 <splitString@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
jne    11c7 <branch_2_check+0x77>
mov    (%rbx),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11c3 <branch_2_check+0x73>
mov    0x8(%rbx),%rdi
lea    0xe64(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11c3 <branch_2_check+0x73>
mov    0x10(%rbx),%rdi
lea    0xe52(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1287 <branch_2_check+0x137>
mov    0x4(%rsp),%eax
cmp    $0x4,%eax
jne    121f <branch_2_check+0xcf>
mov    (%rbx),%rdi
lea    0xe34(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    121f <branch_2_check+0xcf>
mov    0x8(%rbx),%rdi
lea    0xe19(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    121f <branch_2_check+0xcf>
mov    0x10(%rbx),%rdi
lea    0xe04(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    121f <branch_2_check+0xcf>
mov    0x18(%rbx),%rdi
lea    0xdf9(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1287 <branch_2_check+0x137>
mov    (%rbx),%rdi
call   1060 <isLabel@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1276 <branch_2_check+0x126>
cmpl   $0x2,0x4(%rsp)
jne    1274 <branch_2_check+0x124>
mov    (%rbx),%rdi
lea    0xdcf(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1276 <branch_2_check+0x126>
mov    (%rbx),%rdi
lea    0xdbf(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1276 <branch_2_check+0x126>
mov    (%rbx),%rdi
lea    0xda2(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1276 <branch_2_check+0x126>
xor    %ebp,%ebp
mov    %rbx,%rdi
call   1050 <destroyStringArray@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1,%ebp
jmp    1276 <branch_2_check+0x126>

LLVM IR (-O0):
@.str = [4 x i8] c"cmp\00"
@.str.1 = [3 x i8] c"r0\00"
@.str.2 = [3 x i8] c"\00"
@.str.3 = [4 x i8] c"sub\00"
@.str.4 = [3 x i8] c"\00"
@.str.5 = [4 x i8] c"ble\00"
@.str.6 = [4 x i8] c"bgt\00"
@.str.7 = [2 x i8] c"b\00"
define i32 @branch_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, 3
br i1 %11, label %12, label %34
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 %33
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 %33
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 ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %24
%31 = load i8**, i8*** %4
%32 = call i32 @destroyStringArray(i8** %31)
store i32 1, i32* %2
br label %102
33: ; preds = %24, %18, %12
br label %34
34: ; preds = %33, %1
%35 = load i32, i32* %5
%36 = icmp eq i32 %35, 4
br i1 %36, label %37, label %65
37: ; preds = %34
%38 = load i8**, i8*** %4
%39 = getelementptr inbounds i8*, i8** %38, i64 0
%40 = load i8*, i8** %39
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %64
43: ; preds = %37
%44 = load i8**, i8*** %4
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %64
49: ; preds = %43
%50 = load i8**, i8*** %4
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %64
55: ; preds = %49
%56 = load i8**, i8*** %4
%57 = getelementptr inbounds i8*, i8** %56, i64 3
%58 = load i8*, i8** %57
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %55
%62 = load i8**, i8*** %4
%63 = call i32 @destroyStringArray(i8** %62)
store i32 1, i32* %2
br label %102
64: ; preds = %55, %49, %43, %37
br label %65
65: ; preds = %64, %34
%66 = load i8**, i8*** %4
%67 = getelementptr inbounds i8*, i8** %66, i64 0
%68 = load i8*, i8** %67
%69 = call i64 @isLabel(i8* %68)
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %65
%72 = load i8**, i8*** %4
%73 = call i32 @destroyStringArray(i8** %72)
store i32 1, i32* %2
br label %102
74: ; preds = %65
%75 = load i32, i32* %5
%76 = icmp eq i32 %75, 2
br i1 %76, label %77, label %99
77: ; preds = %74
%78 = load i8**, i8*** %4
%79 = getelementptr inbounds i8*, i8** %78, i64 0
%80 = load i8*, i8** %79
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %95, label %83
83: ; preds = %77
%84 = load i8**, i8*** %4
%85 = getelementptr inbounds i8*, i8** %84, i64 0
%86 = load i8*, i8** %85
%87 = call i64 @strcmp(i8* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %95, label %89
89: ; preds = %83
%90 = load i8**, i8*** %4
%91 = getelementptr inbounds i8*, i8** %90, i64 0
%92 = load i8*, i8** %91
%93 = call i64 @strcmp(i8* %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %98
95: ; preds = %89, %83, %77
%96 = load i8**, i8*** %4
%97 = call i32 @destroyStringArray(i8** %96)
store i32 1, i32* %2
br label %102
98: ; preds = %89
br label %99
99: ; preds = %98, %74
%100 = load i8**, i8*** %4
%101 = call i32 @destroyStringArray(i8** %100)
store i32 0, i32* %2
br label %102
102: ; preds = %99, %95, %71, %61, %30
%103 = load i32, i32* %2
ret i32 %103
}

LLVM IR (-O2):
@.str = [4 x i8] c"cmp\00"
@.str.1 = [3 x i8] c"r0\00"
@.str.2 = [3 x i8] c"\00"
@.str.3 = [4 x i8] c"sub\00"
@.str.4 = [3 x i8] c"\00"
@.str.5 = [4 x i8] c"ble\00"
@.str.6 = [4 x i8] c"bgt\00"
@.str.7 = [2 x i8] c"b\00"
define i32 @branch_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, 3
br i1 %7, label %8, label %24
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 %22
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 %22
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 ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %66, label %22
22: ; preds = %17, %12, %8
%23 = load i32, i32* %2
br label %24
24: ; preds = %22, %1
%25 = phi i32 [ %23, %22 ], [ %6, %1 ]
%26 = icmp eq i32 %25, 4
br i1 %26, label %27, label %46
27: ; preds = %24
%28 = load i8*, i8** %3
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %46
31: ; preds = %27
%32 = getelementptr inbounds i8*, i8** %3, i64 1
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %46
36: ; preds = %31
%37 = getelementptr inbounds i8*, i8** %3, i64 2
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %36
%42 = getelementptr inbounds i8*, i8** %3, i64 3
%43 = load i8*, i8** %42
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %66, label %46
46: ; preds = %27, %31, %36, %41, %24
%47 = load i8*, i8** %3
%48 = call i64 @isLabel(i8* %47)
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %66
50: ; preds = %46
%51 = load i32, i32* %2
%52 = icmp eq i32 %51, 2
br i1 %52, label %53, label %65
53: ; preds = %50
%54 = load i8*, i8** %3
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %66, label %57
57: ; preds = %53
%58 = load i8*, i8** %3
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %66, label %61
61: ; preds = %57
%62 = load i8*, i8** %3
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %66, label %65
65: ; preds = %61, %50
br label %66
66: ; preds = %53, %57, %61, %46, %41, %17, %65
%67 = phi i32 [ 0, %65 ], [ 1, %17 ], [ 1, %41 ], [ 1, %46 ], [ 1, %61 ], [ 1, %57 ], [ 1, %53 ]
%68 = call i32 @destroyStringArray(i8** %3)
ret i32 %67
}