int isSupportedOperator(char *string) {
  char operators[7][3] = {"+", "++", "-", "*", "/", "%", "!"};
  int i, supported = 0;
  for (i = 0; i < 7; i++) {
    if (strcmp(operators[i], string) == 0) {
      supported = 1;
      break;
    }
  }
  return supported;
}


x86 assembly (clang, -O0):
<isSupportedOperator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed3(%rip),%al
mov    %al,-0xc(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    119c <isSupportedOperator+0x8c>
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rdi
imul   $0x3,%rax,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1189 <isSupportedOperator+0x79>
movl   $0x1,-0x28(%rbp)
jmp    119c <isSupportedOperator+0x8c>
jmp    118e <isSupportedOperator+0x7e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1152 <isSupportedOperator+0x42>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupportedOperator>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     11a4 <isSupportedOperator+0x94>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11a4 <isSupportedOperator+0x94>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11a4 <isSupportedOperator+0x94>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11a4 <isSupportedOperator+0x94>
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11a4 <isSupportedOperator+0x94>
lea    0xe8e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11a4 <isSupportedOperator+0x94>
lea    0xe7e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.isSupportedOperator.operators = [7 x [3 x i8]] [[3 x i8] c"+\00\00", [3 x i8] c"++\00", [3 x i8] c"-\00\00", [3 x i8] c"*\00\00", [3 x i8] c"/\00\00", [3 x i8] c"%\00\00", [3 x i8] c"!\00\00"]
define i32 @isSupportedOperator(i8* %0) {
%2 = alloca i8*
%3 = alloca [7 x [3 x i8]]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = bitcast [7 x [3 x i8]]* %3 to i8*
store i32 0, i32* %5
store i32 0, i32* %4
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [7 x [3 x i8]], [7 x [3 x i8]]* %3, i64 0, i64 %12
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%15 = load i8*, i8** %2
%16 = call i32 @strcmp(i8* %14, i8* %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %10
store i32 1, i32* %5
br label %23
19: ; preds = %10
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %7
23: ; preds = %18, %7
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
@__const.isSupportedOperator.operators = [7 x [3 x i8]] [[3 x i8] c"+\00\00", [3 x i8] c"++\00", [3 x i8] c"-\00\00", [3 x i8] c"*\00\00", [3 x i8] c"/\00\00", [3 x i8] c"%\00\00", [3 x i8] c"!\00\00"]
define i32 @isSupportedOperator(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* getelementptr inbounds ([7 x [3 x i8]], [7 x [3 x i8]]* @__const.isSupportedOperator.operators, i64 0, i64 0, i64 0), i8* dereferenceable(1) %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %23, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* getelementptr inbounds ([7 x [3 x i8]], [7 x [3 x i8]]* @__const.isSupportedOperator.operators, i64 0, i64 1, i64 0), i8* dereferenceable(1) %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* getelementptr inbounds ([7 x [3 x i8]], [7 x [3 x i8]]* @__const.isSupportedOperator.operators, i64 0, i64 2, i64 0), i8* dereferenceable(1) %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* getelementptr inbounds ([7 x [3 x i8]], [7 x [3 x i8]]* @__const.isSupportedOperator.operators, i64 0, i64 3, i64 0), i8* dereferenceable(1) %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %23, label %13
13: ; preds = %10
%14 = tail call i32 @strcmp(i8* getelementptr inbounds ([7 x [3 x i8]], [7 x [3 x i8]]* @__const.isSupportedOperator.operators, i64 0, i64 4, i64 0), i8* dereferenceable(1) %0)
%15 = icmp eq i32 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = tail call i32 @strcmp(i8* getelementptr inbounds ([7 x [3 x i8]], [7 x [3 x i8]]* @__const.isSupportedOperator.operators, i64 0, i64 5, i64 0), i8* dereferenceable(1) %0)
%18 = icmp eq i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = tail call i32 @strcmp(i8* getelementptr inbounds ([7 x [3 x i8]], [7 x [3 x i8]]* @__const.isSupportedOperator.operators, i64 0, i64 6, i64 0), i8* dereferenceable(1) %0)
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %16, %13, %10, %7, %4, %1
%24 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ %22, %19 ]
ret i32 %24
}