#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 code;
  float cost;
  scanf("%i %f", &code, &cost);
  switch (code) {
  case 1:
    cost *= 4.00;
    break;
  case 2:
    cost *= 4.50;
    break;
  case 3:
    cost *= 5.00;
    break;
  case 4:
    cost *= 2.00;
    break;
  case 5:
    cost *= 1.50;
    break;
  }
  printf("Total: R$ %.2f\n", cost);
  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     1216 <main+0xf6>
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
movss  %xmm0,-0xc(%rbp)
jmp    1216 <main+0xf6>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe78(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1216 <main+0xf6>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe4d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1216 <main+0xf6>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe22(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1216 <main+0xf6>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe20(%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     1160 <main+0x40>
lea    0xec8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  (%rsp),%xmm0
mulss  0xeae(%rip),%xmm0
jmp    119d <main+0x7d>
movss  (%rsp),%xmm0
jmp    11a2 <main+0x82>
movss  (%rsp),%xmm0
mulss  0xe94(%rip),%xmm0
jmp    119d <main+0x7d>
movss  (%rsp),%xmm0
mulss  0xe81(%rip),%xmm0
jmp    119d <main+0x7d>
movss  (%rsp),%xmm0
addss  %xmm0,%xmm0
jmp    119d <main+0x7d>
movss  (%rsp),%xmm0
mulss  0xe63(%rip),%xmm0
movss  %xmm0,(%rsp)
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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