int binary_check(char *symbol) {
  char operations[5][3] = {"+", "-", "*", "%", "!"};
  int j = 0;
  if (strcmp(symbol, "") == 0)
    return 0;
  for (j = 0; j < 5; j++)
    if (strcmp(symbol, operations[j]) == 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<binary_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x11(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1170 <binary_check+0x60>
movl   $0x0,-0x4(%rbp)
jmp    11c8 <binary_check+0xb8>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    11c1 <binary_check+0xb1>
mov    -0x10(%rbp),%rdi
movslq -0x24(%rbp),%rax
lea    -0x1f(%rbp),%rsi
imul   $0x3,%rax,%rax
add    %rax,%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11ae <binary_check+0x9e>
movl   $0x1,-0x4(%rbp)
jmp    11c8 <binary_check+0xb8>
jmp    11b3 <binary_check+0xa3>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1177 <binary_check+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_check>:
push   %rbp
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1182 <binary_check+0x72>
mov    %rdi,%rbx
lea    0xede(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1184 <binary_check+0x74>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1184 <binary_check+0x74>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1184 <binary_check+0x74>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1184 <binary_check+0x74>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
jmp    1184 <binary_check+0x74>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.binary_check.operations = [5 x [3 x i8]] [[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"]
@.str = [1 x i8] zeroinitializer
define i32 @binary_check(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [5 x [3 x i8]]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [5 x [3 x i8]]* %4 to i8*
store i32 0, i32* %5
%7 = load i8*, i8** %3
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %29
11: ; preds = %1
store i32 0, i32* %5
br label %12
12: ; preds = %25, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %28
15: ; preds = %12
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [5 x [3 x i8]], [5 x [3 x i8]]* %4, i64 0, i64 %18
%20 = getelementptr inbounds [3 x i8], [3 x i8]* %19, i64 0, i64 0
%21 = call i32 @strcmp(i8* %16, i8* %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %15
store i32 1, i32* %2
br label %29
24: ; preds = %15
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %12
28: ; preds = %12
store i32 0, i32* %2
br label %29
29: ; preds = %28, %23, %10
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@__const.binary_check.operations = [5 x [3 x i8]] [[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 @binary_check(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x [3 x i8]], [5 x [3 x i8]]* @__const.binary_check.operations, i64 0, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %20, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x [3 x i8]], [5 x [3 x i8]]* @__const.binary_check.operations, i64 0, i64 1, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %20, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x [3 x i8]], [5 x [3 x i8]]* @__const.binary_check.operations, i64 0, i64 2, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %10
%14 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x [3 x i8]], [5 x [3 x i8]]* @__const.binary_check.operations, i64 0, i64 3, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %13
%17 = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x [3 x i8]], [5 x [3 x i8]]* @__const.binary_check.operations, i64 0, i64 4, i64 0))
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %16, %4, %7, %10, %13, %1
%21 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ %19, %16 ]
ret i32 %21
}