#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*/ ops;

/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int isop(char *str) {
  int i, s = 0;
  char *ops[] = {
      "+", "-", "*", "/", "<<", ">>",
  };
  for (i = 0; i < (sizeof(ops) / sizeof(char *)); i++) {
    s |= (strcmp(ops[i], str) == 0) ? 1 : 0;
  }
  return s;
}


x86 assembly (clang, -O0):
<isop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
lea    0xeb6(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xead(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xea4(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe92(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x6,%rax
jae    11d1 <isop+0xb1>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118c <isop+0x6c>
mov    -0x10(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isop>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbp
lea    0xedf(%rip),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %bl
lea    0xecc(%rip),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %r14b
or     %bl,%r14b
lea    0xeb5(%rip),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %r15b
lea    0xea1(%rip),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %bl
or     %r15b,%bl
or     %r14b,%bl
lea    0xe88(%rip),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %r14b
lea    0xe75(%rip),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %al
or     %r14b,%al
or     %bl,%al
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [3 x i8] c"<<\00"
@.str.5 = [3 x i8] c">>\00"
define i32 @isop(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [6 x i8*]
store i8* %0, i8** %2
store i32 0, i32* %4
%6 = bitcast [6 x i8*]* %5 to i8*
%7 = bitcast i8* %6 to [6 x i8*]*
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 0
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 4
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8** %13
store i32 0, i32* %3
br label %14
14: ; preds = %30, %1
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = icmp ult i64 %16, 6
br i1 %17, label %18, label %33
18: ; preds = %14
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 %20
%22 = load i8*, i8** %21
%23 = load i8*, i8** %2
%24 = call i64 @strcmp(i8* %22, i8* %23)
%25 = icmp eq i64 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 1, i32 0
%28 = load i32, i32* %4
%29 = or i32 %28, %27
store i32 %29, i32* %4
br label %30
30: ; preds = %18
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %14
33: ; preds = %14
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
@.str = [2 x i8] c"+\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [3 x i8] c"<<\00"
@.str.5 = [3 x i8] c">>\00"
define i32 @isop(i8* %0) {
%2 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
%4 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = icmp eq i64 %4, 0
%6 = or i1 %3, %5
%7 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%8 = icmp eq i64 %7, 0
%9 = or i1 %6, %8
%10 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%11 = icmp eq i64 %10, 0
%12 = or i1 %9, %11
%13 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%14 = icmp eq i64 %13, 0
%15 = or i1 %12, %14
%16 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%17 = icmp eq i64 %16, 0
%18 = or i1 %15, %17
%19 = zext i1 %18 to i32
ret i32 %19
}