#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 */
scalar_t__ strcmp(char *, char *);
int geraOpcode(char *nome) {
  if (strcmp(nome, "sum") == 0) {
    return 1;
  } else if (strcmp(nome, "sub") == 0) {
    return 3;
  } else if (strcmp(nome, "mul") == 0) {
    return 2;
  } else if (strcmp(nome, "div") == 0) {
    return 8;
  } else if ((strcmp(nome, "eq") == 0) || (strcmp(nome, "neq") == 0)) {
    return 28;
  } else if (strcmp(nome, "mor") == 0) {
    return 29;
  } else if (strcmp(nome, "leq") == 0) {
    return 30;
  } else if (strcmp(nome, "meq") == 0) {
    return 31;
  } else if (strcmp(nome, "les") == 0) {
    return 14;
  }
}


x86 assembly (clang, -O0):
<geraOpcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <geraOpcode+0x32>
movl   $0x1,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <geraOpcode+0x58>
movl   $0x3,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    118e <geraOpcode+0x7e>
movl   $0x2,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11b4 <geraOpcode+0xa4>
movl   $0x8,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11e8 <geraOpcode+0xd8>
mov    -0x10(%rbp),%rdi
lea    0xe37(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11f4 <geraOpcode+0xe4>
movl   $0x1c,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xe15(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    121a <geraOpcode+0x10a>
movl   $0x1d,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xdf3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1240 <geraOpcode+0x130>
movl   $0x1e,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xdd1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1266 <geraOpcode+0x156>
movl   $0x1f,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xdaf(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    128c <geraOpcode+0x17c>
movl   $0xe,-0x4(%rbp)
jmp    12b4 <geraOpcode+0x1a4>
jmp    1291 <geraOpcode+0x181>
jmp    1296 <geraOpcode+0x186>
jmp    129b <geraOpcode+0x18b>
jmp    12a0 <geraOpcode+0x190>
jmp    12a5 <geraOpcode+0x195>
jmp    12aa <geraOpcode+0x19a>
jmp    12af <geraOpcode+0x19f>
jmp    12b4 <geraOpcode+0x1a4>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geraOpcode>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11f6 <geraOpcode+0xe6>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11fd <geraOpcode+0xed>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1204 <geraOpcode+0xf4>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     120b <geraOpcode+0xfb>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    $0x1c,%ebp
test   %rax,%rax
je     1210 <geraOpcode+0x100>
lea    0xe79(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1210 <geraOpcode+0x100>
lea    0xe69(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1219 <geraOpcode+0x109>
lea    0xe59(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1220 <geraOpcode+0x110>
lea    0xe49(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1227 <geraOpcode+0x117>
lea    0xe39(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    $0xe,%ebp
jmp    1210 <geraOpcode+0x100>
mov    $0x1,%ebp
jmp    1210 <geraOpcode+0x100>
mov    $0x3,%ebp
jmp    1210 <geraOpcode+0x100>
mov    $0x2,%ebp
jmp    1210 <geraOpcode+0x100>
mov    $0x8,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1d,%ebp
jmp    1210 <geraOpcode+0x100>
mov    $0x1e,%ebp
jmp    1210 <geraOpcode+0x100>
mov    $0x1f,%ebp
jmp    1210 <geraOpcode+0x100>

LLVM IR (-O0):
@.str = [4 x i8] c"sum\00"
@.str.1 = [4 x i8] c"sub\00"
@.str.2 = [4 x i8] c"mul\00"
@.str.3 = [4 x i8] c"div\00"
@.str.4 = [3 x i8] c"eq\00"
@.str.5 = [4 x i8] c"neq\00"
@.str.6 = [4 x i8] c"mor\00"
@.str.7 = [4 x i8] c"leq\00"
@.str.8 = [4 x i8] c"meq\00"
@.str.9 = [4 x i8] c"les\00"
define i32 @geraOpcode(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %60
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 3, i32* %2
br label %60
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2, i32* %2
br label %60
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 8, i32* %2
br label %60
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i8*, i8** %3
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %27, %23
store i32 28, i32* %2
br label %60
32: ; preds = %27
%33 = load i8*, i8** %3
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 29, i32* %2
br label %60
37: ; preds = %32
%38 = load i8*, i8** %3
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 30, i32* %2
br label %60
42: ; preds = %37
%43 = load i8*, i8** %3
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 31, i32* %2
br label %60
47: ; preds = %42
%48 = load i8*, i8** %3
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 14, i32* %2
br label %60
52: ; preds = %47
br label %53
53: ; preds = %52
br label %54
54: ; preds = %53
br label %55
55: ; preds = %54
br label %56
56: ; preds = %55
br label %57
57: ; preds = %56
br label %58
58: ; preds = %57
br label %59
59: ; preds = %58
br label %60
60: ; preds = %7, %12, %17, %22, %31, %36, %41, %46, %51, %59
%61 = load i32, i32* %2
ret i32 %61
}

LLVM IR (-O2):
@.str = [4 x i8] c"sum\00"
@.str.1 = [4 x i8] c"sub\00"
@.str.2 = [4 x i8] c"mul\00"
@.str.3 = [4 x i8] c"div\00"
@.str.4 = [3 x i8] c"eq\00"
@.str.5 = [4 x i8] c"neq\00"
@.str.6 = [4 x i8] c"mor\00"
@.str.7 = [4 x i8] c"leq\00"
@.str.8 = [4 x i8] c"meq\00"
@.str.9 = [4 x i8] c"les\00"
define i32 @geraOpcode(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %30, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %30, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %30, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %30, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %30, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %30, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %30, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %30, label %25
25: ; preds = %22
%26 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %30
30: ; preds = %28, %25, %22, %19, %13, %16, %10, %7, %4, %1
%31 = phi i32 [ 1, %1 ], [ 3, %4 ], [ 2, %7 ], [ 8, %10 ], [ 28, %16 ], [ 28, %13 ], [ 29, %19 ], [ 30, %22 ], [ 31, %25 ], [ 14, %28 ]
ret i32 %31
}