#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 *, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int n, q;
  double v;
  scanf("%d %d", &n, &q);
  switch (n) {
  case 1:
    printf("Total: R$ %.2f\n", v = 4 * q);
    break;
  case 2:
    printf("Total: R$ %.2f\n", v = 4.5 * q);
    break;
  case 3:
    printf("Total: R$ %.2f\n", v = 5 * q);
    break;
  case 4:
    printf("Total: R$ %.2f\n", v = 2 * q);
    break;
  case 5:
    printf("Total: R$ %.2f\n", v = 1.5 * q);
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%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,-0x20(%rbp)
sub    $0x4,%eax
ja     1218 <main+0xf8>
mov    -0x20(%rbp),%rax
lea    0xead(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    121d <main+0xfd>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe6f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    121d <main+0xfd>
imul   $0x5,-0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    121d <main+0xfd>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
jmp    121d <main+0xfd>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe02(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
jmp    121d <main+0xfd>
jmp    121d <main+0xfd>
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     119c <main+0x7c>
lea    0xec8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    (%rsp),%eax
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
jmp    1190 <main+0x70>
cvtsi2sdl (%rsp),%xmm0
mulsd  0xe9e(%rip),%xmm0
jmp    1190 <main+0x70>
mov    (%rsp),%eax
lea    (%rax,%rax,4),%eax
cvtsi2sd %eax,%xmm0
jmp    1190 <main+0x70>
mov    (%rsp),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm0
jmp    1190 <main+0x70>
cvtsi2sdl (%rsp),%xmm0
mulsd  0xe70(%rip),%xmm0
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [16 x i8] c"Total: R$ %.2f\0A\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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
switch i32 %6, label %30 [
i32 1, label %7
i32 2, label %11
i32 3, label %15
i32 4, label %19
i32 5, label %23
]
7: ; preds = %0
%8 = load i32, i32* %2
%9 = shl nsw i32 %8, 2
%10 = sitofp i32 %9 to double
br label %27
11: ; preds = %0
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 4.500000e+00
br label %27
15: ; preds = %0
%16 = load i32, i32* %2
%17 = mul nsw i32 %16, 5
%18 = sitofp i32 %17 to double
br label %27
19: ; preds = %0
%20 = load i32, i32* %2
%21 = shl nsw i32 %20, 1
%22 = sitofp i32 %21 to double
br label %27
23: ; preds = %0
%24 = load i32, i32* %2
%25 = sitofp i32 %24 to double
%26 = fmul double %25, 1.500000e+00
br label %27
27: ; preds = %7, %11, %15, %19, %23
%28 = phi double [ %26, %23 ], [ %22, %19 ], [ %18, %15 ], [ %14, %11 ], [ %10, %7 ]
%29 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %28)
br label %30
30: ; preds = %27, %0
ret i32 0
}