; LLVM IR from AnneLivia/Competitive-Programming :: Online Judges/URI/1048 (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca float, align 4
  %3 = alloca float, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERf(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %5 = load float, ptr %2, align 4, !tbaa !5
  %6 = fcmp oge float %5, 0.000000e+00
  br i1 %6, label %7, label %23

7:                                                ; preds = %0
  %8 = load float, ptr %2, align 4, !tbaa !5
  %9 = fpext float %8 to double
  %10 = fcmp ole double %9, 4.000000e+02
  br i1 %10, label %11, label %23

11:                                               ; preds = %7
  %12 = load float, ptr %2, align 4, !tbaa !5
  %13 = fpext float %12 to double
  %14 = load float, ptr %2, align 4, !tbaa !5
  %15 = fpext float %14 to double
  %16 = call double @llvm.fmuladd.f64(double %13, double 1.500000e-01, double %15)
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %16)
  %18 = load float, ptr %2, align 4, !tbaa !5
  %19 = fpext float %18 to double
  %20 = fmul double %19, 1.500000e-01
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %20)
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %103

23:                                               ; preds = %7, %0
  %24 = load float, ptr %2, align 4, !tbaa !5
  %25 = fpext float %24 to double
  %26 = fcmp oge double %25, 4.000100e+02
  br i1 %26, label %27, label %43

27:                                               ; preds = %23
  %28 = load float, ptr %2, align 4, !tbaa !5
  %29 = fpext float %28 to double
  %30 = fcmp ole double %29, 8.000000e+02
  br i1 %30, label %31, label %43

31:                                               ; preds = %27
  %32 = load float, ptr %2, align 4, !tbaa !5
  %33 = fpext float %32 to double
  %34 = load float, ptr %2, align 4, !tbaa !5
  %35 = fpext float %34 to double
  %36 = call double @llvm.fmuladd.f64(double %33, double 1.200000e-01, double %35)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %36)
  %38 = load float, ptr %2, align 4, !tbaa !5
  %39 = fpext float %38 to double
  %40 = fmul double %39, 1.200000e-01
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %40)
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %102

43:                                               ; preds = %27, %23
  %44 = load float, ptr %2, align 4, !tbaa !5
  %45 = fpext float %44 to double
  %46 = fcmp oge double %45, 0x408900147AE147AE
  br i1 %46, label %47, label %63

47:                                               ; preds = %43
  %48 = load float, ptr %2, align 4, !tbaa !5
  %49 = fpext float %48 to double
  %50 = fcmp ole double %49, 1.200000e+03
  br i1 %50, label %51, label %63

51:                                               ; preds = %47
  %52 = load float, ptr %2, align 4, !tbaa !5
  %53 = fpext float %52 to double
  %54 = load float, ptr %2, align 4, !tbaa !5
  %55 = fpext float %54 to double
  %56 = call double @llvm.fmuladd.f64(double %53, double 1.000000e-01, double %55)
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %56)
  %58 = load float, ptr %2, align 4, !tbaa !5
  %59 = fpext float %58 to double
  %60 = fmul double %59, 1.000000e-01
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %60)
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %101

63:                                               ; preds = %47, %43
  %64 = load float, ptr %2, align 4, !tbaa !5
  %65 = fpext float %64 to double
  %66 = fcmp oge double %65, 1.200010e+03
  br i1 %66, label %67, label %83

67:                                               ; preds = %63
  %68 = load float, ptr %2, align 4, !tbaa !5
  %69 = fpext float %68 to double
  %70 = fcmp ole double %69, 2.000000e+03
  br i1 %70, label %71, label %83

71:                                               ; preds = %67
  %72 = load float, ptr %2, align 4, !tbaa !5
  %73 = fpext float %72 to double
  %74 = load float, ptr %2, align 4, !tbaa !5
  %75 = fpext float %74 to double
  %76 = call double @llvm.fmuladd.f64(double %73, double 7.000000e-02, double %75)
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %76)
  %78 = load float, ptr %2, align 4, !tbaa !5
  %79 = fpext float %78 to double
  %80 = fmul double %79, 7.000000e-02
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %80)
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %100

83:                                               ; preds = %67, %63
  %84 = load float, ptr %2, align 4, !tbaa !5
  %85 = fpext float %84 to double
  %86 = fcmp ogt double %85, 2.000000e+03
  br i1 %86, label %87, label %99

87:                                               ; preds = %83
  %88 = load float, ptr %2, align 4, !tbaa !5
  %89 = fpext float %88 to double
  %90 = load float, ptr %2, align 4, !tbaa !5
  %91 = fpext float %90 to double
  %92 = call double @llvm.fmuladd.f64(double %89, double 4.000000e-02, double %91)
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %92)
  %94 = load float, ptr %2, align 4, !tbaa !5
  %95 = fpext float %94 to double
  %96 = fmul double %95, 4.000000e-02
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %96)
  %98 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %99

99:                                               ; preds = %87, %83
  br label %100

100:                                              ; preds = %99, %71
  br label %101

101:                                              ; preds = %100, %51
  br label %102

102:                                              ; preds = %101, %31
  br label %103

103:                                              ; preds = %102, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERf(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERf(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %3 = load float, ptr %1, align 4, !tbaa !5
  %4 = fcmp ult float %3, 0.000000e+00
  %5 = fcmp ugt float %3, 4.000000e+02
  %or.cond = or i1 %4, %5
  %6 = fpext float %3 to double
  br i1 %or.cond, label %9, label %7

7:                                                ; preds = %0
  %8 = call double @llvm.fmuladd.f64(double %6, double 1.500000e-01, double %6)
  br label %.sink.split

9:                                                ; preds = %0
  %10 = fcmp ult double %6, 4.000100e+02
  %11 = fcmp ugt float %3, 8.000000e+02
  %or.cond6 = or i1 %11, %10
  br i1 %or.cond6, label %14, label %12

12:                                               ; preds = %9
  %13 = call double @llvm.fmuladd.f64(double %6, double 1.200000e-01, double %6)
  br label %.sink.split

14:                                               ; preds = %9
  %15 = fcmp ult double %6, 0x408900147AE147AE
  %16 = fcmp ugt float %3, 1.200000e+03
  %or.cond7 = or i1 %16, %15
  br i1 %or.cond7, label %19, label %17

17:                                               ; preds = %14
  %18 = call double @llvm.fmuladd.f64(double %6, double 1.000000e-01, double %6)
  br label %.sink.split

19:                                               ; preds = %14
  %20 = fcmp ult double %6, 1.200010e+03
  %21 = fcmp ugt float %3, 2.000000e+03
  %or.cond8 = or i1 %21, %20
  br i1 %or.cond8, label %24, label %22

22:                                               ; preds = %19
  %23 = call double @llvm.fmuladd.f64(double %6, double 7.000000e-02, double %6)
  br label %.sink.split

24:                                               ; preds = %19
  %25 = fcmp ogt float %3, 2.000000e+03
  br i1 %25, label %26, label %33

26:                                               ; preds = %24
  %27 = call double @llvm.fmuladd.f64(double %6, double 4.000000e-02, double %6)
  br label %.sink.split

.sink.split:                                      ; preds = %7, %17, %26, %22, %12
  %.sink11 = phi double [ %8, %7 ], [ %18, %17 ], [ %27, %26 ], [ %23, %22 ], [ %13, %12 ]
  %.sink10 = phi double [ 1.500000e-01, %7 ], [ 1.000000e-01, %17 ], [ 4.000000e-02, %26 ], [ 7.000000e-02, %22 ], [ 1.200000e-01, %12 ]
  %.str.3.sink = phi ptr [ @.str.2, %7 ], [ @.str.4, %17 ], [ @.str.6, %26 ], [ @.str.5, %22 ], [ @.str.3, %12 ]
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %.sink11)
  %.sink = load float, ptr %1, align 4, !tbaa !5
  %29 = fpext float %.sink to double
  %30 = fmul double %.sink10, %29
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %30)
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  br label %33

33:                                               ; preds = %.sink.split, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERf(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass