#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 *, float *);
int main() {
  int op;
  float qtd;
  scanf(" %d %f", &op, &qtd);
  switch (op) {
  case 1:
    printf("Total: R$ %0.2f\n", qtd * 4.00);
    break;
  case 2:
    printf("Total: R$ %0.2f\n", qtd * 4.50);
    break;
  case 3:
    printf("Total: R$ %0.2f\n", qtd * 5.00);
    break;
  case 4:
    printf("Total: R$ %0.2f\n", qtd * 2.00);
    break;
  case 5:
    printf("Total: R$ %0.2f\n", qtd * 1.50);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf06(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     1239 <main+0x119>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    1239 <main+0x119>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe71(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    1239 <main+0x119>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3f(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    1239 <main+0x119>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
jmp    1239 <main+0x119>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xddb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     11a2 <main+0x82>
lea    0xec8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  (%rsp),%xmm0
mulss  0xeae(%rip),%xmm0
jmp    1196 <main+0x76>
movss  (%rsp),%xmm0
mulss  0xe9b(%rip),%xmm0
jmp    1196 <main+0x76>
movss  (%rsp),%xmm0
mulss  0xe88(%rip),%xmm0
jmp    1196 <main+0x76>
movss  (%rsp),%xmm0
addss  %xmm0,%xmm0
jmp    1196 <main+0x76>
movss  (%rsp),%xmm0
mulss  0xe6a(%rip),%xmm0
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" %d %f\00"
@.str.1 = [17 x i8] c"Total: R$ %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
%5 = load i32, i32* %2
switch i32 %5, label %36 [
i32 1, label %6
i32 2, label %12
i32 3, label %18
i32 4, label %24
i32 5, label %30
]
6: ; preds = %0
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fmul double %8, 4.000000e+00
%10 = fptrunc double %9 to float
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %10)
br label %36
12: ; preds = %0
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fmul double %14, 4.500000e+00
%16 = fptrunc double %15 to float
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %16)
br label %36
18: ; preds = %0
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = fmul double %20, 5.000000e+00
%22 = fptrunc double %21 to float
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %22)
br label %36
24: ; preds = %0
%25 = load float, float* %3
%26 = fpext float %25 to double
%27 = fmul double %26, 2.000000e+00
%28 = fptrunc double %27 to float
%29 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %28)
br label %36
30: ; preds = %0
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = fmul double %32, 1.500000e+00
%34 = fptrunc double %33 to float
%35 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %34)
br label %36
36: ; preds = %0, %30, %24, %18, %12, %6
ret i32 0
}

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