#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 */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main() {
  int f, g, h;
  char ur[120];
  scanf("%d", &f);
  scanf("%s", ur);
  scanf("%d", &g);
  if (!strcmp(ur, "add")) {
    h = f + g;
    printf("%d\n", h);
  } else {
    if (!strcmp(ur, "sub")) {
      h = f - g;
      printf("%d\n", h);
    } else {
      if (!strcmp(ur, "mul")) {
        h = f * g;
        printf("%d\n", h);
      } else {
        if (!strcmp(ur, "div")) {
          h = f / g;
          printf("%d\n", h);
        } else {
          if (!strcmp(ur, "mod")) {
            h = f % g;
            printf("%d\n", h);
          } else {
            printf("error\n");
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x90(%rbp),%rsi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe90(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x90(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11b6 <main+0x86>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c7 <main+0x197>
lea    -0x90(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11f1 <main+0xc1>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c2 <main+0x192>
lea    -0x90(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    122d <main+0xfd>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bd <main+0x18d>
lea    -0x90(%rbp),%rdi
lea    0xddb(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1269 <main+0x139>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b8 <main+0x188>
lea    -0x90(%rbp),%rdi
lea    0xda3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12a5 <main+0x175>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b3 <main+0x183>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b8 <main+0x188>
jmp    12bd <main+0x18d>
jmp    12c2 <main+0x192>
jmp    12c7 <main+0x197>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
lea    0xec1(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    $0x646f6c,%eax
jle    11a4 <main+0x74>
cmp    $0x646f6d,%eax
je     11bc <main+0x8c>
cmp    $0x6c756d,%eax
je     11d0 <main+0xa0>
cmp    $0x766964,%eax
jne    11fc <main+0xcc>
mov    0xc(%rsp),%eax
cltd
idivl  0x8(%rsp)
lea    0xe66(%rip),%rdi
mov    %eax,%esi
jmp    11ea <main+0xba>
cmp    $0x627573,%eax
je     11db <main+0xab>
cmp    $0x646461,%eax
jne    11fc <main+0xcc>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
jmp    11e3 <main+0xb3>
mov    0xc(%rsp),%eax
cltd
idivl  0x8(%rsp)
lea    0xe3a(%rip),%rdi
mov    %edx,%esi
jmp    11ea <main+0xba>
mov    0x8(%rsp),%esi
imul   0xc(%rsp),%esi
jmp    11e3 <main+0xb3>
mov    0xc(%rsp),%esi
sub    0x8(%rsp),%esi
lea    0xe1c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret
lea    0xe07(%rip),%rdi
call   1030 <puts@plt>
jmp    11f1 <main+0xc1>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@str = [6 x i8] c"error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [120 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [120 x i8], [120 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = bitcast [120 x i8]* %3 to i32*
%11 = load i32, i32* %10
switch i32 %11, label %37 [
i32 6579297, label %12
i32 6452595, label %17
i32 7107949, label %22
i32 7760228, label %27
i32 6582125, label %32
]
12: ; preds = %0
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %15)
br label %39
17: ; preds = %0
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = sub nsw i32 %18, %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %39
22: ; preds = %0
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = mul nsw i32 %24, %23
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %25)
br label %39
27: ; preds = %0
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = sdiv i32 %28, %29
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %30)
br label %39
32: ; preds = %0
%33 = load i32, i32* %1
%34 = load i32, i32* %2
%35 = srem i32 %33, %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %35)
br label %39
37: ; preds = %0
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %39
39: ; preds = %17, %27, %37, %32, %22, %12
ret i32 0
}