#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 x, y;
  scanf("%d %d", &x, &y);
  switch (x) {
  case 1:
    printf("Total: R$ %0.2f\n", 4.00 * y);
    break;
  case 2:
    printf("Total: R$ %0.2f\n", 4.50 * y);
    break;
  case 3:
    printf("Total: R$ %0.2f\n", 5.00 * y);
    break;
  case 4:
    printf("Total: R$ %0.2f\n", 2.00 * y);
    break;
  case 5:
    printf("Total: R$ %0.2f\n", 1.50 * y);
    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     1211 <main+0xf1>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xea7(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1211 <main+0xf1>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe7d(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    1211 <main+0xf1>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe53(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    1211 <main+0xf1>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe29(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
jmp    1211 <main+0xf1>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xdff(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
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>
cltq
lea    0xece(%rip),%rcx
cvtsi2sdl (%rsp),%xmm0
mulsd  (%rcx,%rax,8),%xmm0
lea    0xeab(%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 = [17 x i8] c"Total: R$ %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
switch i32 %5, label %31 [
i32 1, label %6
i32 2, label %11
i32 3, label %16
i32 4, label %21
i32 5, label %26
]
6: ; preds = %0
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fmul double 4.000000e+00, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %9)
br label %31
11: ; preds = %0
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = fmul double 4.500000e+00, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %14)
br label %31
16: ; preds = %0
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to double
%19 = fmul double 5.000000e+00, %18
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %19)
br label %31
21: ; preds = %0
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to double
%24 = fmul double 2.000000e+00, %23
%25 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %24)
br label %31
26: ; preds = %0
%27 = load i32, i32* %3
%28 = sitofp i32 %27 to double
%29 = fmul double 1.500000e+00, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %29)
br label %31
31: ; preds = %0, %26, %21, %16, %11, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [17 x i8] c"Total: R$ %0.2f\0A\00"
@switch.table.main = [5 x double] [double 4.000000e+00, double 4.500000e+00, double 5.000000e+00, double 2.000000e+00, double 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 ([6 x i8], [6 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 double], [5 x double]* @switch.table.main, i64 0, i64 %10
%12 = load double, double* %11
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = fmul double %12, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %15)
br label %17
17: ; preds = %0, %9
ret i32 0
}