#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 */
scalar_t__ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(int argc, const char *argv[]) {
  double n;
  scanf("%lf", &n);
  if (n <= 100000)
    printf("%.0lf\n", n * 0.1);
  else if (n <= 200000)
    printf("%.0lf\n", (n - 100000) * 0.075) + 10000;
  else if (n <= 400000)
    printf("%.0lf\n", (n - 200000) * 0.05 + 17500);
  else if (n <= 600000)
    printf("%.0lf\n", (n - 400000) * 0.03 + 27500);
  else if (n <= 1000000)
    printf("%.0lf\n", (n - 600000) * 0.015 + 6000 + 27500);
  else
    printf("%.0lf\n", (n - 1000000) * 0.01 + 45500);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xf3b(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb2(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1177 <main+0x57>
movsd  0xf0f(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xf0f(%rip),%rdi
call   1030 <printf@plt>
jmp    12f4 <main+0x1d4>
movsd  0xe89(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     11b8 <main+0x98>
movsd  -0x18(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    12ef <main+0x1cf>
movsd  0xe50(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1205 <main+0xe5>
movsd  -0x18(%rbp),%xmm0
movsd  0xe30(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe70(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    12ea <main+0x1ca>
movsd  0xe0b(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1252 <main+0x132>
movsd  -0x18(%rbp),%xmm0
movsd  0xdeb(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe1f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdfb(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    12e5 <main+0x1c5>
movsd  0xdc6(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     12ab <main+0x18b>
movsd  -0x18(%rbp),%xmm0
movsd  0xda6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xdc2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdbe(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xda2(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
jmp    12e0 <main+0x1c0>
movsd  -0x18(%rbp),%xmm0
movsd  0xd68(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd64(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd60(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xda1(%rip),%rdi
call   1030 <printf@plt>
jmp    12e5 <main+0x1c5>
jmp    12ea <main+0x1ca>
jmp    12ef <main+0x1cf>
jmp    12f4 <main+0x1d4>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf78(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1195 <main+0x75>
movsd  0xec5(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    119f <main+0x7f>
movsd  0xecf(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11b1 <main+0x91>
movsd  0xee1(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11cb <main+0xab>
movsd  0xef3(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11dd <main+0xbd>
addsd  0xf05(%rip),%xmm0
mulsd  0xf05(%rip),%xmm0
addsd  0xf05(%rip),%xmm0
jmp    11fd <main+0xdd>
mulsd  0xe6b(%rip),%xmm0
jmp    11fd <main+0xdd>
addsd  0xe71(%rip),%xmm0
mulsd  0xe71(%rip),%xmm0
jmp    11fd <main+0xdd>
addsd  0xe77(%rip),%xmm0
mulsd  0xe77(%rip),%xmm0
addsd  0xe77(%rip),%xmm0
jmp    11fd <main+0xdd>
addsd  0xe7d(%rip),%xmm0
mulsd  0xe7d(%rip),%xmm0
jmp    11f5 <main+0xd5>
addsd  0xe8b(%rip),%xmm0
mulsd  0xe8b(%rip),%xmm0
addsd  0xe8b(%rip),%xmm0
addsd  0xe63(%rip),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%8 = load double, double* %6
%9 = fcmp ole double %8, 1.000000e+05
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load double, double* %6
%12 = fmul double %11, 1.000000e-01
%13 = call i64 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %12)
br label %57
14: ; preds = %2
%15 = load double, double* %6
%16 = fcmp ole double %15, 2.000000e+05
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load double, double* %6
%19 = fsub double %18, 1.000000e+05
%20 = fmul double %19, 0x3FB3333333333333
%21 = call i64 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = add nsw i64 %21, 10000
br label %56
23: ; preds = %14
%24 = load double, double* %6
%25 = fcmp ole double %24, 4.000000e+05
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = load double, double* %6
%28 = fsub double %27, 2.000000e+05
%29 = call double @llvm.fmuladd.f64(double %28, double 5.000000e-02, double 1.750000e+04)
%30 = call i64 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %29)
br label %55
31: ; preds = %23
%32 = load double, double* %6
%33 = fcmp ole double %32, 6.000000e+05
br i1 %33, label %34, label %39
34: ; preds = %31
%35 = load double, double* %6
%36 = fsub double %35, 4.000000e+05
%37 = call double @llvm.fmuladd.f64(double %36, double 3.000000e-02, double 2.750000e+04)
%38 = call i64 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %37)
br label %54
39: ; preds = %31
%40 = load double, double* %6
%41 = fcmp ole double %40, 1.000000e+06
br i1 %41, label %42, label %48
42: ; preds = %39
%43 = load double, double* %6
%44 = fsub double %43, 6.000000e+05
%45 = call double @llvm.fmuladd.f64(double %44, double 1.500000e-02, double 6.000000e+03)
%46 = fadd double %45, 2.750000e+04
%47 = call i64 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %46)
br label %53
48: ; preds = %39
%49 = load double, double* %6
%50 = fsub double %49, 1.000000e+06
%51 = call double @llvm.fmuladd.f64(double %50, double 1.000000e-02, double 4.550000e+04)
%52 = call i64 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %51)
br label %53
53: ; preds = %48, %42
br label %54
54: ; preds = %53, %34
br label %55
55: ; preds = %54, %26
br label %56
56: ; preds = %55, %17
br label %57
57: ; preds = %56, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %3
%7 = fcmp ugt double %6, 1.000000e+05
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = fmul double %6, 1.000000e-01
br label %34
10: ; preds = %2
%11 = fcmp ugt double %6, 2.000000e+05
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = fadd double %6, -1.000000e+05
%14 = fmul double %13, 0x3FB3333333333333
br label %34
15: ; preds = %10
%16 = fcmp ugt double %6, 4.000000e+05
br i1 %16, label %20, label %17
17: ; preds = %15
%18 = fadd double %6, -2.000000e+05
%19 = call double @llvm.fmuladd.f64(double %18, double 5.000000e-02, double 1.750000e+04)
br label %34
20: ; preds = %15
%21 = fcmp ugt double %6, 6.000000e+05
br i1 %21, label %25, label %22
22: ; preds = %20
%23 = fadd double %6, -4.000000e+05
%24 = call double @llvm.fmuladd.f64(double %23, double 3.000000e-02, double 2.750000e+04)
br label %34
25: ; preds = %20
%26 = fcmp ugt double %6, 1.000000e+06
br i1 %26, label %31, label %27
27: ; preds = %25
%28 = fadd double %6, -6.000000e+05
%29 = call double @llvm.fmuladd.f64(double %28, double 1.500000e-02, double 6.000000e+03)
%30 = fadd double %29, 2.750000e+04
br label %34
31: ; preds = %25
%32 = fadd double %6, -1.000000e+06
%33 = call double @llvm.fmuladd.f64(double %32, double 1.000000e-02, double 4.550000e+04)
br label %34
34: ; preds = %12, %22, %31, %27, %17, %8
%35 = phi double [ %14, %12 ], [ %24, %22 ], [ %33, %31 ], [ %30, %27 ], [ %19, %17 ], [ %9, %8 ]
%36 = call i64 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %35)
ret i32 0
}