#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 */
const char *get_op(char c) {
  static const char *ops = "+a-a*b/b^c(())";
  const char *op = ops;
  while (*op) {
    if (*op == c) {
      return op;
    }
    op += 2;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<get_op>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    0x2f0f(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <get_op+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1142 <get_op+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <get_op+0x5b>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    1115 <get_op+0x15>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_op>:
add    $0xd8,%dil
cmp    $0x36,%dil
ja     113d <get_op+0x3d>
lea    0xfcb(%rip),%rax
movzbl %dil,%ecx
lea    0xee4(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xfba(%rip),%rax
ret
lea    0xfb4(%rip),%rax
ret
lea    0xfa4(%rip),%rax
ret
xor    %eax,%eax
ret
lea    0xf9b(%rip),%rax
ret
lea    0xf95(%rip),%rax
ret
lea    0xf87(%rip),%rax
ret

LLVM IR (-O0):
@get_op.ops = internal global i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)
@.str = [15 x i8] c"+a-a*b/b^c(())\00"
define i8* @get_op(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
%5 = load i8*, i8** @get_op.ops
store i8* %5, i8** %4
br label %6
6: ; preds = %19, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %23
19: ; preds = %10
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8* %21, i8** %4
br label %6
22: ; preds = %6
store i8* null, i8** %2
br label %23
23: ; preds = %22, %17
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
@.str = [15 x i8] c"+a-a*b/b^c(())\00"
define i8* @get_op(i8 signext %0) {
switch i8 %0, label %2 [
i8 43, label %9
i8 45, label %3
i8 42, label %4
i8 47, label %5
i8 94, label %6
i8 40, label %7
i8 41, label %8
]
2: ; preds = %1
br label %9
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3, %2
%10 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %1 ], [ null, %2 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 2), %3 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 4), %4 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 6), %5 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 8), %6 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 10), %7 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 12), %8 ]
ret i8* %10
}