#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() {
  int x, y;
  float cost = 0;
  scanf("%d %d", &x, &y);
  switch (x) {
  case 1:
    cost = y * 4;
    break;
  case 2:
    cost = y * 4.5;
    break;
  case 3:
    cost = y * 5;
    break;
  case 4:
    cost = y * 2;
    break;
  case 5:
    cost = y * 1.5;
    break;
  }
  printf("Total: R$ %.2f\n", cost);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xee7(%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     11e6 <main+0xc6>
mov    -0x18(%rbp),%rax
lea    0xea6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11e6 <main+0xc6>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe74(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11e6 <main+0xc6>
imul   $0x5,-0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11e6 <main+0xc6>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11e6 <main+0xc6>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe27(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%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     115d <main+0x3d>
lea    0xec8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    (%rsp),%eax
shl    $0x2,%eax
cvtsi2ss %eax,%xmm0
jmp    1199 <main+0x79>
xorps  %xmm0,%xmm0
jmp    1199 <main+0x79>
cvtsi2sdl (%rsp),%xmm0
mulsd  0xe99(%rip),%xmm0
jmp    1195 <main+0x75>
mov    (%rsp),%eax
lea    (%rax,%rax,4),%eax
cvtsi2ss %eax,%xmm0
jmp    1199 <main+0x79>
mov    (%rsp),%eax
add    %eax,%eax
cvtsi2ss %eax,%xmm0
jmp    1199 <main+0x79>
cvtsi2sdl (%rsp),%xmm0
mulsd  0xe6b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe8a(%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 float
store i32 0, i32* %1
store float 0.000000e+00, float* %4
%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 %29 [
i32 1, label %7
i32 2, label %11
i32 3, label %16
i32 4, label %20
i32 5, label %24
]
7: ; preds = %0
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 4
%10 = sitofp i32 %9 to float
store float %10, float* %4
br label %29
11: ; preds = %0
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 4.500000e+00
%15 = fptrunc double %14 to float
store float %15, float* %4
br label %29
16: ; preds = %0
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 5
%19 = sitofp i32 %18 to float
store float %19, float* %4
br label %29
20: ; preds = %0
%21 = load i32, i32* %3
%22 = mul nsw i32 %21, 2
%23 = sitofp i32 %22 to float
store float %23, float* %4
br label %29
24: ; preds = %0
%25 = load i32, i32* %3
%26 = sitofp i32 %25 to double
%27 = fmul double %26, 1.500000e+00
%28 = fptrunc double %27 to float
store float %28, float* %4
br label %29
29: ; preds = %0, %24, %20, %16, %11, %7
%30 = load float, float* %4
%31 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %30)
%32 = load i32, i32* %1
ret i32 %32
}

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