; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf1598_C.ll (Z5solvev)

; 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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [200010 x double], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca double, align 8
  %3 = alloca i32, align 4
  %4 = alloca double, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  store double 0.000000e+00, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %31, %0
  %16 = load i32, ptr %3, align 4, !tbaa !9
  %17 = load i32, ptr %1, align 4, !tbaa !9
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %34

20:                                               ; preds = %15
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %26
  %28 = load double, ptr %27, align 8, !tbaa !5
  %29 = load double, ptr %2, align 8, !tbaa !5
  %30 = fadd double %29, %28
  store double %30, ptr %2, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %20
  %32 = load i32, ptr %3, align 4, !tbaa !9
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %3, align 4, !tbaa !9
  br label %15, !llvm.loop !11

34:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %35 = load double, ptr %2, align 8, !tbaa !5
  %36 = load i32, ptr %1, align 4, !tbaa !9
  %37 = sitofp i32 %36 to double
  %38 = fdiv double %35, %37
  store double %38, ptr %4, align 8, !tbaa !5
  %39 = load double, ptr %4, align 8, !tbaa !5
  %40 = fmul double %39, 2.000000e+00
  store double %40, ptr %4, align 8, !tbaa !5
  %41 = load i32, ptr %1, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr getelementptr inbounds (double, ptr @a, i64 1), i64 %42
  call void @_ZSt4sortIPdEvT_S1_(ptr noundef getelementptr inbounds (double, ptr @a, i64 1), ptr noundef %43)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %156, %34
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = load i32, ptr %1, align 4, !tbaa !9
  %47 = icmp sle i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %159

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %50 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %50, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %51 = load i32, ptr %1, align 4, !tbaa !9
  store i32 %51, ptr %10, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %77, %49
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %56, label %78

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = add nsw i32 %57, %58
  %60 = ashr i32 %59, 1
  store i32 %60, ptr %11, align 4, !tbaa !9
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !5
  %65 = load double, ptr %4, align 8, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !5
  %70 = fsub double %65, %69
  %71 = fcmp olt double %64, %70
  br i1 %71, label %72, label %75

72:                                               ; preds = %56
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %9, align 4, !tbaa !9
  br label %77

75:                                               ; preds = %56
  %76 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %76, ptr %10, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %75, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %52, !llvm.loop !15

78:                                               ; preds = %52
  %79 = load i32, ptr %6, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !5
  %87 = fadd double %82, %86
  %88 = load double, ptr %4, align 8, !tbaa !5
  %89 = fcmp oeq double %87, %88
  br i1 %89, label %90, label %92

90:                                               ; preds = %78
  %91 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %91, ptr %7, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %90, %78
  %93 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %93, ptr %9, align 4, !tbaa !9
  %94 = load i32, ptr %1, align 4, !tbaa !9
  store i32 %94, ptr %10, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %121, %92
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %99, label %122

99:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %100 = load i32, ptr %9, align 4, !tbaa !9
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = add nsw i32 %100, %101
  %103 = add nsw i32 %102, 1
  %104 = ashr i32 %103, 1
  store i32 %104, ptr %12, align 4, !tbaa !9
  %105 = load i32, ptr %12, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !5
  %109 = load double, ptr %4, align 8, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !5
  %114 = fsub double %109, %113
  %115 = fcmp ogt double %108, %114
  br i1 %115, label %116, label %119

116:                                              ; preds = %99
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = sub nsw i32 %117, 1
  store i32 %118, ptr %10, align 4, !tbaa !9
  br label %121

119:                                              ; preds = %99
  %120 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %120, ptr %9, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %119, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %95, !llvm.loop !16

122:                                              ; preds = %95
  %123 = load i32, ptr %6, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !5
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !5
  %131 = fadd double %126, %130
  %132 = load double, ptr %4, align 8, !tbaa !5
  %133 = fcmp oeq double %131, %132
  br i1 %133, label %134, label %136

134:                                              ; preds = %122
  %135 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %135, ptr %8, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %134, %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %144

139:                                              ; preds = %136
  %140 = load i32, ptr %8, align 4, !tbaa !9
  %141 = load i32, ptr %7, align 4, !tbaa !9
  %142 = sub nsw i32 %140, %141
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %13, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %139, %136
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = load i32, ptr %6, align 4, !tbaa !9
  %147 = icmp eq i32 %145, %146
  br i1 %147, label %148, label %151

148:                                              ; preds = %144
  %149 = load i32, ptr %13, align 4, !tbaa !9
  %150 = add nsw i32 %149, -1
  store i32 %150, ptr %13, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %148, %144
  %152 = load i32, ptr %13, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = load i64, ptr %5, align 8, !tbaa !13
  %155 = add nsw i64 %154, %153
  store i64 %155, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %156

156:                                              ; preds = %151
  %157 = load i32, ptr %6, align 4, !tbaa !9
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %6, align 4, !tbaa !9
  br label %44, !llvm.loop !17

159:                                              ; preds = %48
  %160 = load i64, ptr %5, align 8, !tbaa !13
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %160)
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %161, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPdEvT_S1_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { inlinehint 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 #4 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; 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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [200010 x double], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not61 = icmp slt i32 %3, 1
  br i1 %.not61, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre88 = sext i32 %3 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre88, %.._crit_edge_crit_edge ], [ %16, %.lr.ph ]
  %.045.lcssa = phi double [ 0.000000e+00, %.._crit_edge_crit_edge ], [ %14, %.lr.ph ]
  %.lcssa = phi i32 [ %3, %.._crit_edge_crit_edge ], [ %15, %.lr.ph ]
  %4 = sitofp i32 %.lcssa to double
  %5 = fdiv double %.045.lcssa, %4
  %6 = fmul double %5, 2.000000e+00
  %7 = getelementptr inbounds double, ptr getelementptr inbounds (i8, ptr @a, i64 8), i64 %.pre-phi
  call void @_ZSt4sortIPdEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 8), ptr noundef nonnull %7)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %.not5976 = icmp slt i32 %8, 1
  br i1 %.not5976, label %._crit_edge79, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge
  %9 = zext nneg i32 %8 to i64
  %10 = add nuw i32 %8, 1
  %wide.trip.count = zext i32 %10 to i64
  br label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %.04563 = phi double [ %14, %.lr.ph ], [ 0.000000e+00, %0 ]
  %11 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %indvars.iv
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %13 = load double, ptr %11, align 8, !tbaa !9
  %14 = fadd double %.04563, %13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %.not.not = icmp slt i64 %indvars.iv, %16
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge74
  %indvars.iv85 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next86, %._crit_edge74 ]
  %.05677 = phi i64 [ 0, %.preheader.preheader ], [ %64, %._crit_edge74 ]
  %17 = icmp ult i64 %indvars.iv85, %9
  %18 = trunc nuw nsw i64 %indvars.iv85 to i32
  %19 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %indvars.iv85
  %20 = load double, ptr %19, align 8, !tbaa !9
  br i1 %17, label %.lr.ph67, label %._crit_edge68.thread

._crit_edge68.thread:                             ; preds = %.preheader
  %sext = shl i64 %indvars.iv85, 32
  %21 = ashr exact i64 %sext, 32
  %22 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %21
  %23 = load double, ptr %22, align 8, !tbaa !9
  %24 = fadd double %20, %23
  %25 = fcmp oeq double %24, %6
  %.05490 = select i1 %25, i32 %18, i32 0
  br label %._crit_edge74

.lr.ph67:                                         ; preds = %.preheader
  %26 = fsub double %6, %20
  br label %29

._crit_edge79:                                    ; preds = %._crit_edge74, %._crit_edge
  %.056.lcssa = phi i64 [ 0, %._crit_edge ], [ %64, %._crit_edge74 ]
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.056.lcssa)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %27, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void

29:                                               ; preds = %.lr.ph67, %29
  %.04766 = phi i32 [ %8, %.lr.ph67 ], [ %.148, %29 ]
  %.04965 = phi i32 [ %18, %.lr.ph67 ], [ %.150, %29 ]
  %30 = add nsw i32 %.04766, %.04965
  %31 = ashr i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %32
  %34 = load double, ptr %33, align 8, !tbaa !9
  %35 = fcmp olt double %34, %26
  %36 = add nsw i32 %31, 1
  %.150 = select i1 %35, i32 %36, i32 %.04965
  %.148 = select i1 %35, i32 %.04766, i32 %31
  %37 = icmp slt i32 %.150, %.148
  br i1 %37, label %29, label %._crit_edge68, !llvm.loop !13

._crit_edge68:                                    ; preds = %29
  %38 = sext i32 %.150 to i64
  %39 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !9
  %41 = fadd double %20, %40
  %42 = fcmp oeq double %41, %6
  %.054 = select i1 %42, i32 %.150, i32 0
  br i1 %17, label %.lr.ph73, label %._crit_edge74

.lr.ph73:                                         ; preds = %._crit_edge68
  %43 = fsub double %6, %20
  br label %44

44:                                               ; preds = %.lr.ph73, %44
  %.271 = phi i32 [ %8, %.lr.ph73 ], [ %.3, %44 ]
  %.25170 = phi i32 [ %18, %.lr.ph73 ], [ %.352, %44 ]
  %45 = add i32 %.25170, 1
  %46 = add i32 %45, %.271
  %47 = ashr i32 %46, 1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %48
  %50 = load double, ptr %49, align 8, !tbaa !9
  %51 = fcmp ogt double %50, %43
  %52 = add nsw i32 %47, -1
  %.352 = select i1 %51, i32 %.25170, i32 %47
  %.3 = select i1 %51, i32 %52, i32 %.271
  %53 = icmp slt i32 %.352, %.3
  br i1 %53, label %44, label %._crit_edge74, !llvm.loop !14

._crit_edge74:                                    ; preds = %44, %._crit_edge68.thread, %._crit_edge68
  %.05491 = phi i32 [ %.054, %._crit_edge68 ], [ %.05490, %._crit_edge68.thread ], [ %.054, %44 ]
  %.251.lcssa = phi i32 [ %18, %._crit_edge68 ], [ %18, %._crit_edge68.thread ], [ %.352, %44 ]
  %54 = sext i32 %.251.lcssa to i64
  %55 = getelementptr inbounds [200010 x double], ptr @a, i64 0, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !9
  %57 = fadd double %20, %56
  %58 = fcmp oeq double %57, %6
  %.053 = select i1 %58, i32 %.251.lcssa, i32 0
  %.not60 = icmp eq i32 %.05491, 0
  %reass.sub = sub i32 %.053, %.05491
  %59 = add i32 %reass.sub, 1
  %.0 = select i1 %.not60, i32 0, i32 %59
  %60 = zext i32 %.05491 to i64
  %61 = icmp eq i64 %indvars.iv85, %60
  %62 = sext i1 %61 to i32
  %.1 = add nsw i32 %.0, %62
  %63 = sext i32 %.1 to i64
  %64 = add nsw i64 %.05677, %63
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge79, label %.preheader, !llvm.loop !15
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPdEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { inlinehint 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 #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass