#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 main() {
  int num1, num2;
  char operation;
  while (1) {
    scanf("%d", &num1);
    scanf("%c", &operation);
    scanf("%d", &num2);
    if (operation == '+')
      printf("%d\n", num1 + num2);
    else
      printf("error");
    break;
    if (operation == '-')
      printf("%d\n", num1 - num2);
    else
      printf("error");
    break;
    if (operation == '*')
      printf("%d\n", num1 * num2);
    else
      printf("error");
    break;
    if (operation == '/')
      printf("%d\n", num1 / num2);
    else
      printf("error");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0xd(%rbp),%eax
cmp    $0x2b,%eax
jne    118b <main+0x6b>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1199 <main+0x79>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119e <main+0x7e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpb   $0x2b,0x7(%rsp)
jne    117c <main+0x5c>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    118a <main+0x6a>
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [6 x i8] c"error\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 = %0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 43
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %19
17: ; preds = %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17, %12
br label %20
20: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [6 x i8] c"error\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 i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 43
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = add nsw i32 %13, %12
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %18
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %11, %16
ret i32 0
}