#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 *, float);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  float p1 = 4.00, p2 = 4.50, p3 = 5.00, p4 = 2.00, p5 = 1.50;
  int X, Y;
  scanf("%d%d", &X, &Y);
  if (X == 1) {
    p1 = p1 * Y;
    printf("Total: R$ %0.2f\n", p1);
  } else if (X == 2) {
    p2 = p2 * Y;
    printf("Total: R$ %0.2f\n", p2);
  } else if (X == 3) {
    p3 = p3 * Y;
    printf("Total: R$ %0.2f\n", p3);
  } else if (X == 4) {
    p4 = p4 * Y;
    printf("Total: R$ %0.2f\n", p4);
  } else if (X == 5) {
    p5 = p5 * Y;
    printf("Total: R$ %0.2f\n", p5);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec8(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeb7(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xea6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe95(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xe9d(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x1,-0x1c(%rbp)
jne    11b7 <main+0x97>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
cmpl   $0x2,-0x1c(%rbp)
jne    11ea <main+0xca>
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
jmp    128d <main+0x16d>
cmpl   $0x3,-0x1c(%rbp)
jne    121d <main+0xfd>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
jmp    1288 <main+0x168>
cmpl   $0x4,-0x1c(%rbp)
jne    1250 <main+0x130>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xdd3(%rip),%rdi
call   1030 <printf@plt>
jmp    1283 <main+0x163>
cmpl   $0x5,-0x1c(%rbp)
jne    127e <main+0x15e>
movss  -0x18(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xda0(%rip),%rdi
call   1030 <printf@plt>
jmp    1283 <main+0x163>
jmp    1288 <main+0x168>
jmp    128d <main+0x16d>
jmp    1292 <main+0x172>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1160 <main+0x40>
cvtsi2ssl (%rsp),%xmm0
cltq
lea    0xec9(%rip),%rcx
mulss  (%rcx,%rax,4),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [17 x i8] c"Total: R$ %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store float 4.000000e+00, float* %2
store float 4.500000e+00, float* %3
store float 5.000000e+00, float* %4
store float 2.000000e+00, float* %5
store float 1.500000e+00, float* %6
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8)
%10 = load i32, i32* %7
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %19
12: ; preds = %0
%13 = load float, float* %2
%14 = load i32, i32* %8
%15 = sitofp i32 %14 to float
%16 = fmul float %13, %15
store float %16, float* %2
%17 = load float, float* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %17)
br label %63
19: ; preds = %0
%20 = load i32, i32* %7
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %29
22: ; preds = %19
%23 = load float, float* %3
%24 = load i32, i32* %8
%25 = sitofp i32 %24 to float
%26 = fmul float %23, %25
store float %26, float* %3
%27 = load float, float* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %27)
br label %62
29: ; preds = %19
%30 = load i32, i32* %7
%31 = icmp eq i32 %30, 3
br i1 %31, label %32, label %39
32: ; preds = %29
%33 = load float, float* %4
%34 = load i32, i32* %8
%35 = sitofp i32 %34 to float
%36 = fmul float %33, %35
store float %36, float* %4
%37 = load float, float* %4
%38 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %37)
br label %61
39: ; preds = %29
%40 = load i32, i32* %7
%41 = icmp eq i32 %40, 4
br i1 %41, label %42, label %49
42: ; preds = %39
%43 = load float, float* %5
%44 = load i32, i32* %8
%45 = sitofp i32 %44 to float
%46 = fmul float %43, %45
store float %46, float* %5
%47 = load float, float* %5
%48 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %47)
br label %60
49: ; preds = %39
%50 = load i32, i32* %7
%51 = icmp eq i32 %50, 5
br i1 %51, label %52, label %59
52: ; preds = %49
%53 = load float, float* %6
%54 = load i32, i32* %8
%55 = sitofp i32 %54 to float
%56 = fmul float %53, %55
store float %56, float* %6
%57 = load float, float* %6
%58 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %57)
br label %59
59: ; preds = %52, %49
br label %60
60: ; preds = %59, %42
br label %61
61: ; preds = %60, %32
br label %62
62: ; preds = %61, %22
br label %63
63: ; preds = %62, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [17 x i8] c"Total: R$ %0.2f\0A\00"
@switch.table.main = [5 x float] [float 4.000000e+00, float 4.500000e+00, float 5.000000e+00, float 2.000000e+00, float 1.500000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, 5
br i1 %8, label %9, label %17
9: ; preds = %0
%10 = sext i32 %7 to i64
%11 = getelementptr inbounds [5 x float], [5 x float]* @switch.table.main, i64 0, i64 %10
%12 = load float, float* %11
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to float
%15 = fmul float %12, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %15)
br label %17
17: ; preds = %0, %9
ret i32 0
}