#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 strlen(char *);
int check_if_ic(char *big) {
  char c;
  int n = strlen(big);
  int j;
  j = 0;
  while (1) {
    c = big[j];
    if (c == ']') {
      if ((big[j + 1] == '(') && (big[j + 2] == '0') && (big[j + 3] == ')')) {
        return 1;
      }
    }
    j++;
    if (j >= n)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_if_ic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x5d,%eax
jne    11a9 <check_if_ic+0x99>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x28,%eax
jne    11a4 <check_if_ic+0x94>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jne    11a4 <check_if_ic+0x94>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x29,%eax
jne    11a4 <check_if_ic+0x94>
movl   $0x1,-0x4(%rbp)
jmp    11cf <check_if_ic+0xbf>
jmp    11a9 <check_if_ic+0x99>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     11c3 <check_if_ic+0xb3>
jmp    11c8 <check_if_ic+0xb8>
jmp    112f <check_if_ic+0x1f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_ic>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
mov    $0x1,%ecx
cmovge %eax,%ecx
xor    %eax,%eax
jmp    1139 <check_if_ic+0x29>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    %rax,%rcx
je     115b <check_if_ic+0x4b>
cmpb   $0x5d,(%rbx,%rax,1)
jne    1130 <check_if_ic+0x20>
cmpb   $0x28,0x1(%rbx,%rax,1)
jne    1130 <check_if_ic+0x20>
cmpb   $0x30,0x2(%rbx,%rax,1)
jne    1130 <check_if_ic+0x20>
cmpb   $0x29,0x3(%rbx,%rax,1)
jne    1130 <check_if_ic+0x20>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_if_ic(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
store i32 0, i32* %6
br label %9
9: ; preds = %1, %54
%10 = load i8*, i8** %3
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
store i8 %14, i8* %4
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 93
br i1 %17, label %18, label %47
18: ; preds = %9
%19 = load i8*, i8** %3
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 40
br i1 %26, label %27, label %46
27: ; preds = %18
%28 = load i8*, i8** %3
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %28, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 48
br i1 %35, label %36, label %46
36: ; preds = %27
%37 = load i8*, i8** %3
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %37, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 41
br i1 %44, label %45, label %46
45: ; preds = %36
store i32 1, i32* %2
br label %56
46: ; preds = %36, %27, %18
br label %47
47: ; preds = %46, %9
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
store i32 %49, i32* %6
%50 = load i32, i32* %6
%51 = load i32, i32* %5
%52 = icmp sge i32 %50, %51
br i1 %52, label %53, label %54
53: ; preds = %47
br label %55
54: ; preds = %47
br label %9
55: ; preds = %53
store i32 0, i32* %2
br label %56
56: ; preds = %55, %45
%57 = load i32, i32* %2
ret i32 %57
}

LLVM IR (-O2):
define i32 @check_if_ic(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = call i32 @llvm.smax.i32(i32 %2, i32 1)
%4 = zext i32 %3 to i64
br label %5
5: ; preds = %25, %1
%6 = phi i64 [ %10, %25 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 93
%10 = add nuw nsw i64 %6, 1
br i1 %9, label %11, label %25
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %0, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 40
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = add nuw nsw i64 %6, 2
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 48
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = add nuw nsw i64 %6, 3
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 41
br i1 %24, label %27, label %25
25: ; preds = %5, %11, %15, %20
%26 = icmp eq i64 %10, %4
br i1 %26, label %27, label %5
27: ; preds = %25, %20
%28 = phi i32 [ 1, %20 ], [ 0, %25 ]
ret i32 %28
}