#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 *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int u;
  float b;
  printf("Enter unit : \n");
  scanf("%d", &u);
  if (u <= 50)
    b = 200;
  else if (u > 50 && u <= 100)
    b = 200 + (u - 509) * 2;
  else if (u > 100 && u <= 200)
    b = 200 + 50 * 2 + (u - 100) * 3;
  else if (u >= 200)
    b = 200 + 50 * 2 + 100 * 3 + (u - 200) * 5;
  printf("Bill = %.3f", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x32,-0x8(%rbp)
jg     1169 <main+0x49>
movss  0xea1(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1203 <main+0xe3>
cmpl   $0x32,-0x8(%rbp)
jle    119b <main+0x7b>
cmpl   $0x64,-0x8(%rbp)
jg     119b <main+0x7b>
mov    -0x8(%rbp),%eax
sub    $0x1fd,%eax
shl    $0x1,%eax
add    $0xc8,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11fe <main+0xde>
cmpl   $0x64,-0x8(%rbp)
jle    11ce <main+0xae>
cmpl   $0xc8,-0x8(%rbp)
jg     11ce <main+0xae>
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
imul   $0x3,%eax,%eax
add    $0x12c,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11f9 <main+0xd9>
cmpl   $0xc8,-0x8(%rbp)
jl     11f4 <main+0xd4>
mov    -0x8(%rbp),%eax
sub    $0xc8,%eax
imul   $0x5,%eax,%eax
add    $0x258,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11f9 <main+0xd9>
jmp    11fe <main+0xde>
jmp    1203 <main+0xe3>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe03(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x33,%eax
jge    1161 <main+0x31>
movss  0xea1(%rip),%xmm0
jmp    1187 <main+0x57>
cmp    $0x64,%eax
ja     116f <main+0x3f>
add    %eax,%eax
add    $0xfffffcce,%eax
jmp    1183 <main+0x53>
cmp    $0xc8,%eax
ja     117b <main+0x4b>
lea    (%rax,%rax,2),%eax
jmp    1183 <main+0x53>
lea    (%rax,%rax,4),%eax
add    $0xfffffe70,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe75(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter unit : \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"Bill = %.3f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 50
br i1 %7, label %8, label %9
8: ; preds = %0
store float 2.000000e+02, float* %3
br label %45
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 50
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 100
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 509
%18 = mul nsw i32 %17, 2
%19 = add nsw i32 200, %18
%20 = sitofp i32 %19 to float
store float %20, float* %3
br label %44
21: ; preds = %12, %9
%22 = load i32, i32* %2
%23 = icmp sgt i32 %22, 100
br i1 %23, label %24, label %33
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp sle i32 %25, 200
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 100
%30 = mul nsw i32 %29, 3
%31 = add nsw i32 300, %30
%32 = sitofp i32 %31 to float
store float %32, float* %3
br label %43
33: ; preds = %24, %21
%34 = load i32, i32* %2
%35 = icmp sge i32 %34, 200
br i1 %35, label %36, label %42
36: ; preds = %33
%37 = load i32, i32* %2
%38 = sub nsw i32 %37, 200
%39 = mul nsw i32 %38, 5
%40 = add nsw i32 600, %39
%41 = sitofp i32 %40 to float
store float %41, float* %3
br label %42
42: ; preds = %36, %33
br label %43
43: ; preds = %42, %27
br label %44
44: ; preds = %43, %15
br label %45
45: ; preds = %44, %8
%46 = load float, float* %3
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %47)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"Bill = %.3f\00"
@str = [14 x i8] c"Enter unit : \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 51
br i1 %6, label %22, label %7
7: ; preds = %0
%8 = icmp ult i32 %5, 101
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = shl nuw nsw i32 %5, 1
%11 = add nuw nsw i32 %10, -818
%12 = sitofp i32 %11 to float
br label %22
13: ; preds = %7
%14 = icmp ult i32 %5, 201
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = mul nuw nsw i32 %5, 3
%17 = sitofp i32 %16 to float
br label %22
18: ; preds = %13
%19 = mul i32 %5, 5
%20 = add i32 %19, -400
%21 = sitofp i32 %20 to float
br label %22
22: ; preds = %0, %9, %18, %15
%23 = phi float [ %12, %9 ], [ %17, %15 ], [ %21, %18 ], [ 2.000000e+02, %0 ]
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %24)
ret i32 0
}