#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() {
  char operacao;
  printf("Escolha a opecaracao que deseja realizar: ");
  scanf("%c", &operacao);
  switch (operacao) {
  case '+': {
    int n1, n2;
    printf("\nInsira N1: ");
    scanf("%d", &n1);
    printf("\nInsira N2: ");
    scanf("%d", &n2);
    printf("\n%d + %d = %d", n1, n2, n1 + n2);
    break;
  }
  case '-': {
    int n1, n2;
    printf("\n Insira N1: ");
    scanf("%d", &n1);
    printf("\n Insira N2: ");
    scanf("%d", &n2);
    printf("\n %d - %d = %d", n1, n2, n1 - n2);
    break;
  }
  case '*': {
    int n1, n2;
    printf("\n Insira N1: ");
    scanf("%d", &n1);
    printf("\n Insira N2: ");
    scanf("%d", &n2);
    printf("\n %d X %d = %d", n1, n2, n1 * n2);
    break;
  }
  case '/': {
    int n1, n2;
    printf("\n Insira N1: ");
    scanf("%d", &n1);
    printf("\n Insira N2: ");
    scanf("%d", &n2);
    printf("\n %d / %d = %.2f", n1, n2, (float)n1 / n2);
    break;
  }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x31(%rbp)
call   1030 <printf@plt>
mov    -0x31(%rbp),%al
lea    0xef9(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x5,%eax
ja     1301 <main+0x1e1>
mov    -0x30(%rbp),%rax
lea    0xe8c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1301 <main+0x1e1>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
sub    -0x18(%rbp),%ecx
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1301 <main+0x1e1>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1b(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfb(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1301 <main+0x1e1>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdbb(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd9b(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
cvtsi2ssl -0x24(%rbp),%xmm0
cvtsi2ssl -0x28(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdae(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeec(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%eax
add    $0xffffffd6,%eax
cmp    $0x5,%eax
ja     12da <main+0x1ba>
lea    0xea2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf00(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
lea    0xedd(%rip),%rdi
jmp    126a <main+0x14a>
lea    0xe7e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe95(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe67(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
lea    (%rdx,%rsi,1),%ecx
lea    0xe4c(%rip),%rdi
jmp    126a <main+0x14a>
lea    0xe51(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe40(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe3b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %esi,%ecx
sub    %edx,%ecx
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    12da <main+0x1ba>
lea    0xdf4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xde3(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xdde(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
cvtsi2ss %esi,%xmm0
mov    0x4(%rsp),%edx
cvtsi2ss %edx,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Escolha a opecaracao que deseja realizar: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [13 x i8] c"\0AInsira N1: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [13 x i8] c"\0AInsira N2: \00"
@.str.5 = [14 x i8] c"\0A%d + %d = %d\00"
@.str.6 = [14 x i8] c"\0A Insira N1: \00"
@.str.7 = [14 x i8] c"\0A Insira N2: \00"
@.str.8 = [15 x i8] c"\0A %d - %d = %d\00"
@.str.9 = [15 x i8] c"\0A %d X %d = %d\00"
@.str.10 = [17 x i8] c"\0A %d / %d = %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
switch i32 %14, label %62 [
i32 43, label %15
i32 45, label %26
i32 42, label %37
i32 47, label %48
]
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %22, %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %20, i32 %21, i32 %24)
br label %62
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = sub nsw i32 %33, %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %31, i32 %32, i32 %35)
br label %62
37: ; preds = %0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%42 = load i32, i32* %7
%43 = load i32, i32* %8
%44 = load i32, i32* %7
%45 = load i32, i32* %8
%46 = mul nsw i32 %44, %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %42, i32 %43, i32 %46)
br label %62
48: ; preds = %0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%52 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%53 = load i32, i32* %9
%54 = load i32, i32* %10
%55 = load i32, i32* %9
%56 = sitofp i32 %55 to float
%57 = load i32, i32* %10
%58 = sitofp i32 %57 to float
%59 = fdiv float %56, %58
%60 = fpext float %59 to double
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 %53, i32 %54, double %60)
br label %62
62: ; preds = %0, %48, %37, %26, %15
%63 = load i32, i32* %1
ret i32 %63
}

LLVM IR (-O2):
@.str = [43 x i8] c"Escolha a opecaracao que deseja realizar: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [13 x i8] c"\0AInsira N1: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [13 x i8] c"\0AInsira N2: \00"
@.str.5 = [14 x i8] c"\0A%d + %d = %d\00"
@.str.6 = [14 x i8] c"\0A Insira N1: \00"
@.str.7 = [14 x i8] c"\0A Insira N2: \00"
@.str.8 = [15 x i8] c"\0A %d - %d = %d\00"
@.str.9 = [15 x i8] c"\0A %d X %d = %d\00"
@.str.10 = [17 x i8] c"\0A %d / %d = %.2f\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
switch i32 %13, label %61 [
i32 43, label %14
i32 45, label %25
i32 42, label %36
i32 47, label %47
]
14: ; preds = %0
%15 = bitcast i32* %2 to i8*
%16 = bitcast i32* %3 to i8*
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = add nsw i32 %22, %21
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
br label %61
25: ; preds = %0
%26 = bitcast i32* %4 to i8*
%27 = bitcast i32* %5 to i8*
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = sub nsw i32 %32, %33
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %32, i32 %33, i32 %34)
br label %61
36: ; preds = %0
%37 = bitcast i32* %6 to i8*
%38 = bitcast i32* %7 to i8*
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%43 = load i32, i32* %6
%44 = load i32, i32* %7
%45 = mul nsw i32 %44, %43
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %43, i32 %44, i32 %45)
br label %61
47: ; preds = %0
%48 = bitcast i32* %8 to i8*
%49 = bitcast i32* %9 to i8*
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%51 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%54 = load i32, i32* %8
%55 = load i32, i32* %9
%56 = sitofp i32 %54 to float
%57 = sitofp i32 %55 to float
%58 = fdiv float %56, %57
%59 = fpext float %58 to double
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i32 %54, i32 %55, double %59)
br label %61
61: ; preds = %0, %47, %36, %25, %14
ret i32 0
}