; LLVM IR from sympiler/nasoq :: src/common/Norm.ll (ZN5nasoq10norm_denseEiiPdi)

; 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_ostream" = type { ptr, %"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 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN5nasoq10norm_denseEiiPdi(i32 noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !5
  %20 = load i32, ptr %9, align 4, !tbaa !5
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %31, label %22

22:                                               ; preds = %4
  %23 = load i32, ptr %9, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 2
  br i1 %24, label %31, label %25

25:                                               ; preds = %22
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = icmp eq i32 %26, 2
  br i1 %27, label %28, label %33

28:                                               ; preds = %25
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 1
  br i1 %30, label %31, label %33

31:                                               ; preds = %28, %22, %4
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store double -1.000000e+00, ptr %5, align 8
  br label %155

33:                                               ; preds = %28, %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %34 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %34, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store double 0.000000e+00, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store double 0.000000e+00, ptr %12, align 8, !tbaa !11
  %35 = load i32, ptr %9, align 4, !tbaa !5
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %82

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %78, %37
  %39 = load i32, ptr %13, align 4, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %81

43:                                               ; preds = %38
  store double 0.000000e+00, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %62, %43
  %45 = load i32, ptr %15, align 4, !tbaa !5
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %65

49:                                               ; preds = %44
  %50 = load ptr, ptr %8, align 8, !tbaa !9
  %51 = load i32, ptr %13, align 4, !tbaa !5
  %52 = load i32, ptr %15, align 4, !tbaa !5
  %53 = load i32, ptr %10, align 4, !tbaa !5
  %54 = mul nsw i32 %52, %53
  %55 = add nsw i32 %51, %54
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %50, i64 %56
  %58 = load double, ptr %57, align 8, !tbaa !11
  %59 = call noundef double @_ZSt3absd(double noundef %58)
  %60 = load double, ptr %12, align 8, !tbaa !11
  %61 = fadd double %60, %59
  store double %61, ptr %12, align 8, !tbaa !11
  br label %62

62:                                               ; preds = %49
  %63 = load i32, ptr %15, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %15, align 4, !tbaa !5
  br label %44, !llvm.loop !13

65:                                               ; preds = %48
  %66 = load double, ptr %12, align 8, !tbaa !11
  %67 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %66)
  br i1 %67, label %68, label %72

68:                                               ; preds = %65
  %69 = load double, ptr %12, align 8, !tbaa !11
  %70 = load double, ptr %11, align 8, !tbaa !11
  %71 = fcmp ogt double %69, %70
  br i1 %71, label %72, label %77

72:                                               ; preds = %68, %65
  %73 = load double, ptr %11, align 8, !tbaa !11
  %74 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %73)
  br i1 %74, label %75, label %77

75:                                               ; preds = %72
  %76 = load double, ptr %12, align 8, !tbaa !11
  store double %76, ptr %11, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %75, %72, %68
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %13, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %13, align 4, !tbaa !5
  br label %38, !llvm.loop !15

81:                                               ; preds = %42
  br label %153

82:                                               ; preds = %33
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = icmp eq i32 %83, 1
  br i1 %84, label %85, label %130

85:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %126, %85
  %87 = load i32, ptr %16, align 4, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %129

91:                                               ; preds = %86
  store double 0.000000e+00, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %110, %91
  %93 = load i32, ptr %17, align 4, !tbaa !5
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %113

97:                                               ; preds = %92
  %98 = load ptr, ptr %8, align 8, !tbaa !9
  %99 = load i32, ptr %17, align 4, !tbaa !5
  %100 = load i32, ptr %16, align 4, !tbaa !5
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = mul nsw i32 %100, %101
  %103 = add nsw i32 %99, %102
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds double, ptr %98, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !11
  %107 = call noundef double @_ZSt3absd(double noundef %106)
  %108 = load double, ptr %12, align 8, !tbaa !11
  %109 = fadd double %108, %107
  store double %109, ptr %12, align 8, !tbaa !11
  br label %110

110:                                              ; preds = %97
  %111 = load i32, ptr %17, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %17, align 4, !tbaa !5
  br label %92, !llvm.loop !16

113:                                              ; preds = %96
  %114 = load double, ptr %12, align 8, !tbaa !11
  %115 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %114)
  br i1 %115, label %116, label %120

116:                                              ; preds = %113
  %117 = load double, ptr %12, align 8, !tbaa !11
  %118 = load double, ptr %11, align 8, !tbaa !11
  %119 = fcmp ogt double %117, %118
  br i1 %119, label %120, label %125

120:                                              ; preds = %116, %113
  %121 = load double, ptr %11, align 8, !tbaa !11
  %122 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %121)
  br i1 %122, label %123, label %125

123:                                              ; preds = %120
  %124 = load double, ptr %12, align 8, !tbaa !11
  store double %124, ptr %11, align 8, !tbaa !11
  br label %125

125:                                              ; preds = %123, %120, %116
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %16, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %16, align 4, !tbaa !5
  br label %86, !llvm.loop !17

129:                                              ; preds = %90
  br label %152

130:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %146, %130
  %132 = load i32, ptr %18, align 4, !tbaa !5
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 14, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %149

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %137 = load ptr, ptr %8, align 8, !tbaa !9
  %138 = load i32, ptr %18, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds double, ptr %137, i64 %139
  %141 = load double, ptr %140, align 8, !tbaa !11
  store double %141, ptr %19, align 8, !tbaa !11
  %142 = load double, ptr %19, align 8, !tbaa !11
  %143 = load double, ptr %19, align 8, !tbaa !11
  %144 = load double, ptr %11, align 8, !tbaa !11
  %145 = call double @llvm.fmuladd.f64(double %142, double %143, double %144)
  store double %145, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %146

146:                                              ; preds = %136
  %147 = load i32, ptr %18, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %18, align 4, !tbaa !5
  br label %131, !llvm.loop !18

149:                                              ; preds = %135
  %150 = load double, ptr %11, align 8, !tbaa !11
  %151 = call double @sqrt(double noundef %150) #7
  store double %151, ptr %11, align 8, !tbaa !11
  br label %152

152:                                              ; preds = %149, %129
  br label %153

153:                                              ; preds = %152, %81
  %154 = load double, ptr %11, align 8, !tbaa !11
  store double %154, ptr %5, align 8
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %155

155:                                              ; preds = %153, %31
  %156 = load double, ptr %5, align 8
  ret double %156
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinited(double noundef) #4

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #6

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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind 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 = { mustprogress nounwind 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { 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 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; 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_ostream" = type { ptr, %"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 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN5nasoq10norm_denseEiiPdi(i32 noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3) local_unnamed_addr #0 {
  %or.cond = icmp ugt i32 %3, 2
  br i1 %or.cond, label %8, label %5

5:                                                ; preds = %4
  %6 = icmp eq i32 %3, 2
  %7 = icmp sgt i32 %1, 1
  %or.cond3 = and i1 %7, %6
  br i1 %or.cond3, label %8, label %10

8:                                                ; preds = %5, %4
  %9 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %.loopexit

10:                                               ; preds = %5
  switch i32 %3, label %.preheader [
    i32 0, label %.preheader69
    i32 1, label %.preheader71
  ]

.preheader71:                                     ; preds = %10
  %11 = icmp sgt i32 %1, 0
  br i1 %11, label %.preheader70.lr.ph, label %.loopexit

.preheader70.lr.ph:                               ; preds = %.preheader71
  %12 = icmp sgt i32 %0, 0
  br i1 %12, label %.preheader70.us.preheader, label %.preheader70

.preheader70.us.preheader:                        ; preds = %.preheader70.lr.ph
  %13 = zext nneg i32 %0 to i64
  %wide.trip.count98 = zext nneg i32 %1 to i64
  br label %.preheader70.us

.preheader70.us:                                  ; preds = %.preheader70.us.preheader, %18
  %indvars.iv95 = phi i64 [ 0, %.preheader70.us.preheader ], [ %indvars.iv.next96, %18 ]
  %.275.us = phi double [ 0.000000e+00, %.preheader70.us.preheader ], [ %.3.us, %18 ]
  %14 = mul nuw nsw i64 %indvars.iv95, %13
  %invariant.gep = getelementptr inbounds double, ptr %2, i64 %14
  br label %19

15:                                               ; preds = %._crit_edge.us
  %16 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %.275.us)
  br i1 %16, label %17, label %18

17:                                               ; preds = %15
  br label %18

18:                                               ; preds = %17, %15, %._crit_edge.us
  %.3.us = phi double [ %22, %17 ], [ %.275.us, %15 ], [ %.275.us, %._crit_edge.us ]
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98
  br i1 %exitcond99.not, label %.loopexit, label %.preheader70.us, !llvm.loop !5

19:                                               ; preds = %.preheader70.us, %19
  %indvars.iv = phi i64 [ 0, %.preheader70.us ], [ %indvars.iv.next, %19 ]
  %.173.us = phi double [ 0.000000e+00, %.preheader70.us ], [ %22, %19 ]
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv
  %20 = load double, ptr %gep, align 8, !tbaa !7
  %21 = tail call noundef double @_ZSt3absd(double noundef %20)
  %22 = fadd double %.173.us, %21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond94.not = icmp eq i64 %indvars.iv.next, %13
  br i1 %exitcond94.not, label %._crit_edge.us, label %19, !llvm.loop !11

._crit_edge.us:                                   ; preds = %19
  %23 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %22)
  %24 = fcmp ule double %22, %.275.us
  %or.cond65.not.us = select i1 %23, i1 %24, i1 false
  br i1 %or.cond65.not.us, label %18, label %15

.preheader69:                                     ; preds = %10
  %25 = icmp sgt i32 %0, 0
  br i1 %25, label %.preheader68.lr.ph, label %.loopexit

.preheader68.lr.ph:                               ; preds = %.preheader69
  %26 = icmp sgt i32 %1, 0
  br i1 %26, label %.preheader68.us.preheader, label %.preheader68

.preheader68.us.preheader:                        ; preds = %.preheader68.lr.ph
  %27 = zext nneg i32 %0 to i64
  %wide.trip.count104 = zext nneg i32 %1 to i64
  br label %.preheader68.us

.preheader68.us:                                  ; preds = %.preheader68.us.preheader, %31
  %indvars.iv106 = phi i64 [ 0, %.preheader68.us.preheader ], [ %indvars.iv.next107, %31 ]
  %.05880.us = phi double [ 0.000000e+00, %.preheader68.us.preheader ], [ %.159.us, %31 ]
  %invariant.gep121 = getelementptr inbounds double, ptr %2, i64 %indvars.iv106
  br label %32

28:                                               ; preds = %._crit_edge.us83
  %29 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %.05880.us)
  br i1 %29, label %30, label %31

30:                                               ; preds = %28
  br label %31

31:                                               ; preds = %30, %28, %._crit_edge.us83
  %.159.us = phi double [ %36, %30 ], [ %.05880.us, %28 ], [ %.05880.us, %._crit_edge.us83 ]
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next107, %27
  br i1 %exitcond110.not, label %.loopexit, label %.preheader68.us, !llvm.loop !12

32:                                               ; preds = %.preheader68.us, %32
  %indvars.iv101 = phi i64 [ 0, %.preheader68.us ], [ %indvars.iv.next102, %32 ]
  %.05778.us = phi double [ 0.000000e+00, %.preheader68.us ], [ %36, %32 ]
  %33 = mul nuw nsw i64 %indvars.iv101, %27
  %gep122 = getelementptr inbounds double, ptr %invariant.gep121, i64 %33
  %34 = load double, ptr %gep122, align 8, !tbaa !7
  %35 = tail call noundef double @_ZSt3absd(double noundef %34)
  %36 = fadd double %.05778.us, %35
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
  br i1 %exitcond105.not, label %._crit_edge.us83, label %32, !llvm.loop !13

._crit_edge.us83:                                 ; preds = %32
  %37 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %36)
  %38 = fcmp ule double %36, %.05880.us
  %or.cond63.not.us = select i1 %37, i1 %38, i1 false
  br i1 %or.cond63.not.us, label %31, label %28

.preheader:                                       ; preds = %10
  %39 = icmp sgt i32 %0, 0
  br i1 %39, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count114 = zext nneg i32 %0 to i64
  %xtraiter = and i64 %wide.trip.count114, 3
  %40 = icmp ult i32 %0, 4
  br i1 %40, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count114, 2147483644
  br label %.lr.ph

.preheader68:                                     ; preds = %.preheader68.lr.ph, %44
  %.05681 = phi i32 [ %45, %44 ], [ 0, %.preheader68.lr.ph ]
  %41 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef 0.000000e+00)
  br i1 %41, label %44, label %42

42:                                               ; preds = %.preheader68
  %43 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef 0.000000e+00)
  br label %44

44:                                               ; preds = %42, %.preheader68
  %45 = add nuw nsw i32 %.05681, 1
  %exitcond100.not = icmp eq i32 %45, %0
  br i1 %exitcond100.not, label %.loopexit, label %.preheader68, !llvm.loop !12

.preheader70:                                     ; preds = %.preheader70.lr.ph, %49
  %.05476 = phi i32 [ %50, %49 ], [ 0, %.preheader70.lr.ph ]
  %46 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef 0.000000e+00)
  br i1 %46, label %49, label %47

47:                                               ; preds = %.preheader70
  %48 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef 0.000000e+00)
  br label %49

49:                                               ; preds = %47, %.preheader70
  %50 = add nuw nsw i32 %.05476, 1
  %exitcond.not = icmp eq i32 %50, %1
  br i1 %exitcond.not, label %.loopexit, label %.preheader70, !llvm.loop !5

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa.ph = phi double [ poison, %.lr.ph.preheader ], [ %66, %.lr.ph ]
  %indvars.iv111.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next112.3, %.lr.ph ]
  %.486.unr = phi double [ 0.000000e+00, %.lr.ph.preheader ], [ %66, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv111.epil = phi i64 [ %indvars.iv.next112.epil, %.lr.ph.epil ], [ %indvars.iv111.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.486.epil = phi double [ %53, %.lr.ph.epil ], [ %.486.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %51 = getelementptr inbounds double, ptr %2, i64 %indvars.iv111.epil
  %52 = load double, ptr %51, align 8, !tbaa !7
  %53 = tail call double @llvm.fmuladd.f64(double %52, double %52, double %.486.epil)
  %indvars.iv.next112.epil = add nuw nsw i64 %indvars.iv111.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph.epil, !llvm.loop !14

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil, %.preheader
  %.4.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %53, %.lr.ph.epil ]
  %54 = tail call double @sqrt(double noundef %.4.lcssa) #6
  br label %.loopexit

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv111 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next112.3, %.lr.ph ]
  %.486 = phi double [ 0.000000e+00, %.lr.ph.preheader.new ], [ %66, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %55 = getelementptr inbounds double, ptr %2, i64 %indvars.iv111
  %56 = load double, ptr %55, align 8, !tbaa !7
  %57 = tail call double @llvm.fmuladd.f64(double %56, double %56, double %.486)
  %indvars.iv.next112 = or disjoint i64 %indvars.iv111, 1
  %58 = getelementptr inbounds double, ptr %2, i64 %indvars.iv.next112
  %59 = load double, ptr %58, align 8, !tbaa !7
  %60 = tail call double @llvm.fmuladd.f64(double %59, double %59, double %57)
  %indvars.iv.next112.1 = or disjoint i64 %indvars.iv111, 2
  %61 = getelementptr inbounds double, ptr %2, i64 %indvars.iv.next112.1
  %62 = load double, ptr %61, align 8, !tbaa !7
  %63 = tail call double @llvm.fmuladd.f64(double %62, double %62, double %60)
  %indvars.iv.next112.2 = or disjoint i64 %indvars.iv111, 3
  %64 = getelementptr inbounds double, ptr %2, i64 %indvars.iv.next112.2
  %65 = load double, ptr %64, align 8, !tbaa !7
  %66 = tail call double @llvm.fmuladd.f64(double %65, double %65, double %63)
  %indvars.iv.next112.3 = add nuw nsw i64 %indvars.iv111, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !16

.loopexit:                                        ; preds = %49, %18, %44, %31, %.preheader71, %.preheader69, %._crit_edge, %8
  %.0 = phi double [ -1.000000e+00, %8 ], [ %54, %._crit_edge ], [ 0.000000e+00, %.preheader69 ], [ 0.000000e+00, %.preheader71 ], [ %.159.us, %31 ], [ 0.000000e+00, %44 ], [ %.3.us, %18 ], [ 0.000000e+00, %49 ]
  ret double %.0
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinited(double noundef) 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 nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #5

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 = { 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 #2 = { inlinehint mustprogress nounwind 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 = { mustprogress nounwind 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(write) "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 #6 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !6}


; Effective O3 passes: ADCEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass