#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__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *, char *, int *);
int main(void) {
  int a, b;
  char ch;
  while (scanf("%d %c %d", &a, &ch, &b) != EOF) {
    switch (ch) {
    case '+':
      a += b;
      break;
    case '-':
      a -= b;
      break;
    case '*':
      a *= b;
      break;
    case '/':
      a /= b;
      break;
    }
    printf("%d\n", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xd(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     11ce <main+0xae>
movsbl -0xd(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     11ba <main+0x9a>
mov    -0x18(%rbp),%rax
lea    0xe88(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11ba <main+0x9a>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    11ba <main+0x9a>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11ba <main+0x9a>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xee3(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xf(%rsp),%rdx
lea    0x14(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x2e98(%rip),%rbp
cmp    0x0(%rbp),%rax
jne    1167 <main+0x47>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xeaa(%rip),%r15
lea    0x10(%rsp),%r12
lea    0xf(%rsp),%r13
lea    0x14(%rsp),%rbx
lea    0xe7c(%rip),%r14
jmp    11c3 <main+0xa3>
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp),%eax
cltd
idivl  0x14(%rsp)
mov    %eax,%esi
mov    %eax,0x10(%rsp)
nop
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
cmp    0x0(%rbp),%rax
je     1156 <main+0x36>
movsbl 0xf(%rsp),%eax
add    $0xffffffd6,%eax
cmp    $0x5,%eax
ja     1200 <main+0xe0>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    0x10(%rsp),%esi
imul   0x14(%rsp),%esi
mov    %esi,0x10(%rsp)
jmp    11a0 <main+0x80>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%esi
add    0x14(%rsp),%esi
mov    %esi,0x10(%rsp)
jmp    11a0 <main+0x80>
xchg   %ax,%ax
mov    0x10(%rsp),%esi
jmp    11a0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp),%esi
sub    0x14(%rsp),%esi
mov    %esi,0x10(%rsp)
jmp    11a0 <main+0x80>

LLVM IR (-O0):
@.str = [9 x i8] c"%d %c %d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
br label %5
5: ; preds = %28, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i8* %4, i32* %3)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %31
9: ; preds = %5
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
switch i32 %11, label %28 [
i32 43, label %12
i32 45, label %16
i32 42, label %20
i32 47, label %24
]
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
br label %28
16: ; preds = %9
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, %17
store i32 %19, i32* %2
br label %28
20: ; preds = %9
%21 = load i32, i32* %3
%22 = load i32, i32* %2
%23 = mul nsw i32 %22, %21
store i32 %23, i32* %2
br label %28
24: ; preds = %9
%25 = load i32, i32* %3
%26 = load i32, i32* %2
%27 = sdiv i32 %26, %25
store i32 %27, i32* %2
br label %28
28: ; preds = %9, %24, %20, %16, %12
%29 = load i32, i32* %2
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %5
31: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %c %d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %3, i32* %2)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %36, label %9
9: ; preds = %0, %30
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
switch i32 %11, label %12 [
i32 43, label %14
i32 45, label %18
i32 42, label %22
i32 47, label %26
]
12: ; preds = %9
%13 = load i32, i32* %1
br label %30
14: ; preds = %9
%15 = load i32, i32* %2
%16 = load i32, i32* %1
%17 = add nsw i32 %16, %15
store i32 %17, i32* %1
br label %30
18: ; preds = %9
%19 = load i32, i32* %2
%20 = load i32, i32* %1
%21 = sub nsw i32 %20, %19
store i32 %21, i32* %1
br label %30
22: ; preds = %9
%23 = load i32, i32* %2
%24 = load i32, i32* %1
%25 = mul nsw i32 %24, %23
store i32 %25, i32* %1
br label %30
26: ; preds = %9
%27 = load i32, i32* %2
%28 = load i32, i32* %1
%29 = sdiv i32 %28, %27
store i32 %29, i32* %1
br label %30
30: ; preds = %12, %26, %22, %18, %14
%31 = phi i32 [ %13, %12 ], [ %29, %26 ], [ %25, %22 ], [ %21, %18 ], [ %17, %14 ]
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %3, i32* %2)
%34 = load i64, i64* @EOF
%35 = icmp eq i64 %33, %34
br i1 %35, label %36, label %9
36: ; preds = %30, %0
ret i32 0
}