int supported_operation(char *operation) {
  const char operations[7][2] = {"+", "++", "-", "*", "/", "%", "!"};
  if (strlen(operation) > 2) {
    return 0;
  }
  for (int i = 0; i < 7; i++) {
    if (operation[0] == '+' && operation[1] == '+') {
      return 1;
    }
    if (strcmp(operation, operations[i]) == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<supported_operation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%rax
jbe    116a <supported_operation+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    11ef <supported_operation+0xcf>
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    11e8 <supported_operation+0xc8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    11a8 <supported_operation+0x88>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2b,%eax
jne    11a8 <supported_operation+0x88>
movl   $0x1,-0x4(%rbp)
jmp    11ef <supported_operation+0xcf>
mov    -0x10(%rbp),%rdi
movslq -0x24(%rbp),%rax
lea    -0x1e(%rbp),%rsi
shl    $0x1,%rax
add    %rax,%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11d5 <supported_operation+0xb5>
movl   $0x1,-0x4(%rbp)
jmp    11ef <supported_operation+0xcf>
jmp    11da <supported_operation+0xba>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1171 <supported_operation+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supported_operation>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x2,%rax
jbe    113b <supported_operation+0x1b>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    (%rbx),%r14b
cmp    $0x2b,%r14b
jne    119c <supported_operation+0x7c>
mov    $0x1,%ebp
cmpb   $0x2b,0x1(%rbx)
je     1134 <supported_operation+0x14>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1134 <supported_operation+0x14>
cmpb   $0x2b,0x1(%rbx)
je     1134 <supported_operation+0x14>
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1134 <supported_operation+0x14>
cmp    $0x2b,%r14b
jne    11cb <supported_operation+0xab>
cmpb   $0x2b,0x1(%rbx)
je     1134 <supported_operation+0x14>
lea    0xe76(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    11f7 <supported_operation+0xd7>
jmp    1134 <supported_operation+0x14>
lea    0xe5d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1134 <supported_operation+0x14>
lea    0xe47(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1134 <supported_operation+0x14>
lea    0xe32(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1134 <supported_operation+0x14>
cmp    $0x2b,%r14b
jne    123b <supported_operation+0x11b>
cmpb   $0x2b,0x1(%rbx)
je     1134 <supported_operation+0x14>
lea    0xe08(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1134 <supported_operation+0x14>
cmp    $0x2b,%r14b
jne    1252 <supported_operation+0x132>
cmpb   $0x2b,0x1(%rbx)
je     1134 <supported_operation+0x14>
lea    0xdde(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    127e <supported_operation+0x15e>
jmp    1134 <supported_operation+0x14>
lea    0xdc4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1134 <supported_operation+0x14>
lea    0xdaf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1134 <supported_operation+0x14>
cmp    $0x2b,%r14b
jne    12ac <supported_operation+0x18c>
cmpb   $0x2b,0x1(%rbx)
je     1134 <supported_operation+0x14>
lea    0xd85(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1134 <supported_operation+0x14>
cmp    $0x2b,%r14b
jne    12c3 <supported_operation+0x1a3>
cmpb   $0x2b,0x1(%rbx)
je     1134 <supported_operation+0x14>
jmp    12c3 <supported_operation+0x1a3>
lea    0xd57(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1134 <supported_operation+0x14>
lea    0xd42(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
jmp    1134 <supported_operation+0x14>

LLVM IR (-O0):
@__const.supported_operation.operations = [7 x [2 x i8]] [[2 x i8] c"+\00", [2 x i8] c"++", [2 x i8] c"-\00", [2 x i8] c"*\00", [2 x i8] c"/\00", [2 x i8] c"%\00", [2 x i8] c"!\00"]
define i32 @supported_operation(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [7 x [2 x i8]]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [7 x [2 x i8]]* %4 to i8*
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = icmp ugt i64 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %42
11: ; preds = %1
store i32 0, i32* %5
br label %12
12: ; preds = %38, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 7
br i1 %14, label %15, label %41
15: ; preds = %12
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 43
br i1 %20, label %21, label %28
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 43
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 1, i32* %2
br label %42
28: ; preds = %21, %15
%29 = load i8*, i8** %3
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [7 x [2 x i8]], [7 x [2 x i8]]* %4, i64 0, i64 %31
%33 = getelementptr inbounds [2 x i8], [2 x i8]* %32, i64 0, i64 0
%34 = call i32 @strcmp(i8* %29, i8* %33)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %28
store i32 1, i32* %2
br label %42
37: ; preds = %28
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %12
41: ; preds = %12
store i32 0, i32* %2
br label %42
42: ; preds = %41, %36, %27, %10
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
@__const.supported_operation.operations = [7 x [2 x i8]] [[2 x i8] c"+\00", [2 x i8] c"++", [2 x i8] c"-\00", [2 x i8] c"*\00", [2 x i8] c"/\00", [2 x i8] c"%\00", [2 x i8] c"!\00"]
define i32 @supported_operation(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp ugt i64 %2, 2
br i1 %3, label %74, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 43
br i1 %7, label %65, label %71
8: ; preds = %68
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 43
br i1 %10, label %74, label %11
11: ; preds = %8
%12 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 1, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %74, label %17
14: ; preds = %71
%15 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 1, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %74, label %21
17: ; preds = %11
br i1 %7, label %18, label %21
18: ; preds = %17
%19 = load i8, i8* %5
%20 = icmp eq i8 %19, 43
br i1 %20, label %74, label %24
21: ; preds = %14, %17
%22 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 2, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %74, label %27
24: ; preds = %18
%25 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 2, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %74, label %31
27: ; preds = %21
br i1 %7, label %28, label %34
28: ; preds = %27
%29 = load i8, i8* %5
%30 = icmp eq i8 %29, 43
br i1 %30, label %74, label %31
31: ; preds = %24, %28
%32 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 3, i64 0))
%33 = icmp eq i32 %32, 0
br i1 %33, label %74, label %37
34: ; preds = %27
%35 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 3, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %74, label %41
37: ; preds = %31
br i1 %7, label %38, label %41
38: ; preds = %37
%39 = load i8, i8* %5
%40 = icmp eq i8 %39, 43
br i1 %40, label %74, label %44
41: ; preds = %34, %37
%42 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 4, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %74, label %47
44: ; preds = %38
%45 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 4, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %74, label %51
47: ; preds = %41
br i1 %7, label %48, label %54
48: ; preds = %47
%49 = load i8, i8* %5
%50 = icmp eq i8 %49, 43
br i1 %50, label %74, label %51
51: ; preds = %44, %48
%52 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 5, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %74, label %57
54: ; preds = %47
%55 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 5, i64 0))
%56 = icmp eq i32 %55, 0
br i1 %56, label %74, label %61
57: ; preds = %51
br i1 %7, label %58, label %61
58: ; preds = %57
%59 = load i8, i8* %5
%60 = icmp eq i8 %59, 43
br i1 %60, label %74, label %61
61: ; preds = %54, %58, %57
%62 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 6, i64 0))
%63 = icmp eq i32 %62, 0
%64 = zext i1 %63 to i32
br label %74
65: ; preds = %4
%66 = load i8, i8* %5
%67 = icmp eq i8 %66, 43
br i1 %67, label %74, label %68
68: ; preds = %65
%69 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 0, i64 0))
%70 = icmp eq i32 %69, 0
br i1 %70, label %74, label %8
71: ; preds = %4
%72 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x [2 x i8]], [7 x [2 x i8]]* @__const.supported_operation.operations, i64 0, i64 0, i64 0))
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %14
74: ; preds = %61, %68, %65, %8, %11, %18, %21, %28, %31, %38, %41, %48, %51, %58, %71, %14, %24, %34, %44, %54, %1
%75 = phi i32 [ 0, %1 ], [ 1, %65 ], [ 1, %68 ], [ 1, %8 ], [ 1, %11 ], [ 1, %18 ], [ 1, %21 ], [ 1, %28 ], [ 1, %31 ], [ 1, %38 ], [ 1, %41 ], [ 1, %48 ], [ 1, %51 ], [ 1, %58 ], [ 1, %71 ], [ 1, %14 ], [ 1, %24 ], [ 1, %34 ], [ 1, %44 ], [ 1, %54 ], [ %64, %61 ]
ret i32 %75
}