#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 main(void) {
  int val;
  double price = 0;
  scanf("%d", &val);
  if (val > 400) {
    price += 0.5663 * (val - 400);
    val = 400;
  }
  if (val > 150) {
    price += 0.4663 * (val - 150);
    val = 150;
  }
  price += 0.4463 * val;
  printf("%.1f\n", price);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x190,-0x8(%rbp)
jle    1181 <main+0x61>
mov    -0x8(%rbp),%eax
sub    $0x190,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe93(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x190,-0x8(%rbp)
cmpl   $0x96,-0x8(%rbp)
jle    11bb <main+0x9b>
mov    -0x8(%rbp),%eax
sub    $0x96,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe61(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x96,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe43(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x191,%eax
jl     115d <main+0x3d>
add    $0xfffffe70,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xeb2(%rip),%xmm0
xorpd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
mov    $0x190,%eax
jmp    1168 <main+0x48>
xorpd  %xmm1,%xmm1
cmp    $0x97,%eax
jl     118d <main+0x6d>
add    $0xffffff6a,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe8c(%rip),%xmm0
addsd  %xmm0,%xmm1
movl   $0x96,0x4(%rsp)
mov    $0x96,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe74(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 400
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 400
%10 = sitofp i32 %9 to double
%11 = load double, double* %3
%12 = call double @llvm.fmuladd.f64(double 5.663000e-01, double %10, double %11)
store double %12, double* %3
store i32 400, i32* %2
br label %13
13: ; preds = %7, %0
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 150
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i32, i32* %2
%18 = sub nsw i32 %17, 150
%19 = sitofp i32 %18 to double
%20 = load double, double* %3
%21 = call double @llvm.fmuladd.f64(double 4.663000e-01, double %19, double %20)
store double %21, double* %3
store i32 150, i32* %2
br label %22
22: ; preds = %16, %13
%23 = load i32, i32* %2
%24 = sitofp i32 %23 to double
%25 = load double, double* %3
%26 = call double @llvm.fmuladd.f64(double 4.463000e-01, double %24, double %25)
store double %26, double* %3
%27 = load double, double* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %27)
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 400
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = add nsw i32 %4, -400
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 5.663000e-01, double 0.000000e+00)
br label %12
10: ; preds = %0
%11 = icmp sgt i32 %4, 150
br i1 %11, label %12, label %18
12: ; preds = %6, %10
%13 = phi double [ %9, %6 ], [ 0.000000e+00, %10 ]
%14 = phi i32 [ 400, %6 ], [ %4, %10 ]
%15 = add nsw i32 %14, -150
%16 = sitofp i32 %15 to double
%17 = call double @llvm.fmuladd.f64(double %16, double 4.663000e-01, double %13)
store i32 150, i32* %1
br label %18
18: ; preds = %12, %10
%19 = phi i32 [ 150, %12 ], [ %4, %10 ]
%20 = phi double [ %17, %12 ], [ 0.000000e+00, %10 ]
%21 = sitofp i32 %19 to double
%22 = call double @llvm.fmuladd.f64(double %21, double 4.463000e-01, double %20)
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %22)
ret i32 0
}