#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 inputint(char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main() {
  int a, b;
  char *c;
  a = inputint("a", a);
  b = inputint("b", b);
  printf("Seleziona operazione fra +,-,* o /\n");
  scanf("%s", c);
  if (strcmp(c, "+") == 0) {
    a += b;
  } else if (strcmp(c, "-") == 0) {
    a -= b;
  } else if (strcmp(c, "*") == 0) {
    a = a * b;
  } else {
    a = a / b;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1060 <inputint@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1060 <inputint@plt>
mov    %eax,-0xc(%rbp)
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b7 <main+0x77>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    121e <main+0xde>
mov    -0x18(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11e1 <main+0xa1>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1219 <main+0xd9>
mov    -0x18(%rbp),%rdi
lea    0xe43(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    120a <main+0xca>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1214 <main+0xd4>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1219 <main+0xd9>
jmp    121e <main+0xde>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1060 <inputint@plt>
lea    0xeae(%rip),%rdi
call   1060 <inputint@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
call   1050 <scanf@plt>
lea    0xe8f(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     119f <main+0x5f>
lea    0xe80(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     119f <main+0x5f>
lea    0xe71(%rip),%rsi
call   1040 <strcmp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
@.str.2 = [36 x i8] c"Seleziona operazione fra +,-,* o /\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"+\00"
@.str.5 = [2 x i8] c"-\00"
@.str.6 = [2 x i8] c"*\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @inputint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @inputint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 %8, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%10 = load i8*, i8** %4
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %0
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = add nsw i32 %17, %16
store i32 %18, i32* %2
br label %41
19: ; preds = %0
%20 = load i8*, i8** %4
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = sub nsw i32 %25, %24
store i32 %26, i32* %2
br label %40
27: ; preds = %19
%28 = load i8*, i8** %4
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = mul nsw i32 %32, %33
store i32 %34, i32* %2
br label %39
35: ; preds = %27
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = sdiv i32 %36, %37
store i32 %38, i32* %2
br label %39
39: ; preds = %35, %31
br label %40
40: ; preds = %39, %23
br label %41
41: ; preds = %40, %15
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"+\00"
@.str.5 = [2 x i8] c"-\00"
@.str.6 = [2 x i8] c"*\00"
@str = [35 x i8] c"Seleziona operazione fra +,-,* o /\00"
define i32 @main() {
%1 = tail call i32 @inputint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @inputint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* undef)
%5 = tail call i64 @strcmp(i8* undef, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %0
%8 = tail call i64 @strcmp(i8* undef, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* undef, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %12
12: ; preds = %10, %7, %0
ret i32 0
}