; LLVM IR from PymZoR/S-curve-Planner :: lib (bbpr)

; 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"

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @find_quad(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = add nsw i32 %23, 1
  %25 = sext i32 %24 to i64
  %26 = mul i64 %25, 8
  %27 = call noalias ptr @malloc(i64 noundef %26) #6
  store ptr %27, ptr %13, align 8, !tbaa !5
  %28 = load ptr, ptr %13, align 8, !tbaa !5
  %29 = getelementptr inbounds double, ptr %28, i64 0
  store double 1.000000e+00, ptr %29, align 8, !tbaa !11
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = getelementptr inbounds double, ptr %30, i64 1
  %32 = load double, ptr %31, align 8, !tbaa !11
  store double %32, ptr %20, align 8, !tbaa !11
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds double, ptr %33, i64 0
  %35 = load double, ptr %34, align 8, !tbaa !11
  store double %35, ptr %21, align 8, !tbaa !11
  store double 1.000000e-15, ptr %19, align 8, !tbaa !11
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 1, ptr %36, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %232, %6
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = icmp sgt i32 %39, 500
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  br label %240

42:                                               ; preds = %37
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = srem i32 %44, 200
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %50

47:                                               ; preds = %42
  %48 = load double, ptr %19, align 8, !tbaa !11
  %49 = fmul double %48, 1.000000e+01
  store double %49, ptr %19, align 8, !tbaa !11
  br label %50

50:                                               ; preds = %47, %42
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds double, ptr %51, i64 1
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = load double, ptr %20, align 8, !tbaa !11
  %55 = fsub double %53, %54
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds double, ptr %56, i64 1
  store double %55, ptr %57, align 8, !tbaa !11
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds double, ptr %58, i64 1
  %60 = load double, ptr %59, align 8, !tbaa !11
  %61 = load double, ptr %20, align 8, !tbaa !11
  %62 = fsub double %60, %61
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds double, ptr %63, i64 1
  store double %62, ptr %64, align 8, !tbaa !11
  store i32 2, ptr %22, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %124, %50
  %66 = load i32, ptr %22, align 4, !tbaa !9
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %69, label %127

69:                                               ; preds = %65
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load i32, ptr %22, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds double, ptr %70, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !11
  %75 = load double, ptr %20, align 8, !tbaa !11
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load i32, ptr %22, align 4, !tbaa !9
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds double, ptr %76, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !11
  %82 = fneg double %75
  %83 = call double @llvm.fmuladd.f64(double %82, double %81, double %74)
  %84 = load double, ptr %21, align 8, !tbaa !11
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = load i32, ptr %22, align 4, !tbaa !9
  %87 = sub nsw i32 %86, 2
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %85, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !11
  %91 = fneg double %84
  %92 = call double @llvm.fmuladd.f64(double %91, double %90, double %83)
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = load i32, ptr %22, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %93, i64 %95
  store double %92, ptr %96, align 8, !tbaa !11
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = load i32, ptr %22, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds double, ptr %97, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !11
  %102 = load double, ptr %20, align 8, !tbaa !11
  %103 = load ptr, ptr %13, align 8, !tbaa !5
  %104 = load i32, ptr %22, align 4, !tbaa !9
  %105 = sub nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %103, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = fneg double %102
  %110 = call double @llvm.fmuladd.f64(double %109, double %108, double %101)
  %111 = load double, ptr %21, align 8, !tbaa !11
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = load i32, ptr %22, align 4, !tbaa !9
  %114 = sub nsw i32 %113, 2
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %112, i64 %115
  %117 = load double, ptr %116, align 8, !tbaa !11
  %118 = fneg double %111
  %119 = call double @llvm.fmuladd.f64(double %118, double %117, double %110)
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = load i32, ptr %22, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds double, ptr %120, i64 %122
  store double %119, ptr %123, align 8, !tbaa !11
  br label %124

124:                                              ; preds = %69
  %125 = load i32, ptr %22, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %22, align 4, !tbaa !9
  br label %65, !llvm.loop !13

127:                                              ; preds = %65
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = load i32, ptr %8, align 4, !tbaa !9
  %130 = sub nsw i32 %129, 1
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %128, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !11
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = load i32, ptr %8, align 4, !tbaa !9
  %136 = sub nsw i32 %135, 3
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds double, ptr %134, i64 %137
  %139 = load double, ptr %138, align 8, !tbaa !11
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = load i32, ptr %8, align 4, !tbaa !9
  %142 = sub nsw i32 %141, 2
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds double, ptr %140, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !11
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  %147 = load i32, ptr %8, align 4, !tbaa !9
  %148 = sub nsw i32 %147, 2
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds double, ptr %146, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = fmul double %145, %151
  %153 = fneg double %152
  %154 = call double @llvm.fmuladd.f64(double %133, double %139, double %153)
  store double %154, ptr %14, align 8, !tbaa !11
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = load i32, ptr %8, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds double, ptr %155, i64 %157
  %159 = load double, ptr %158, align 8, !tbaa !11
  %160 = load ptr, ptr %13, align 8, !tbaa !5
  %161 = load i32, ptr %8, align 4, !tbaa !9
  %162 = sub nsw i32 %161, 3
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds double, ptr %160, i64 %163
  %165 = load double, ptr %164, align 8, !tbaa !11
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = load i32, ptr %8, align 4, !tbaa !9
  %168 = sub nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds double, ptr %166, i64 %169
  %171 = load double, ptr %170, align 8, !tbaa !11
  %172 = load ptr, ptr %13, align 8, !tbaa !5
  %173 = load i32, ptr %8, align 4, !tbaa !9
  %174 = sub nsw i32 %173, 2
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds double, ptr %172, i64 %175
  %177 = load double, ptr %176, align 8, !tbaa !11
  %178 = fmul double %171, %177
  %179 = fneg double %178
  %180 = call double @llvm.fmuladd.f64(double %159, double %165, double %179)
  store double %180, ptr %17, align 8, !tbaa !11
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = load i32, ptr %8, align 4, !tbaa !9
  %183 = sub nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds double, ptr %181, i64 %184
  %186 = load double, ptr %185, align 8, !tbaa !11
  %187 = load ptr, ptr %13, align 8, !tbaa !5
  %188 = load i32, ptr %8, align 4, !tbaa !9
  %189 = sub nsw i32 %188, 1
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds double, ptr %187, i64 %190
  %192 = load double, ptr %191, align 8, !tbaa !11
  %193 = load ptr, ptr %9, align 8, !tbaa !5
  %194 = load i32, ptr %8, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds double, ptr %193, i64 %195
  %197 = load double, ptr %196, align 8, !tbaa !11
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = load i32, ptr %8, align 4, !tbaa !9
  %200 = sub nsw i32 %199, 2
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds double, ptr %198, i64 %201
  %203 = load double, ptr %202, align 8, !tbaa !11
  %204 = fmul double %197, %203
  %205 = fneg double %204
  %206 = call double @llvm.fmuladd.f64(double %186, double %192, double %205)
  store double %206, ptr %18, align 8, !tbaa !11
  %207 = load double, ptr %14, align 8, !tbaa !11
  %208 = call double @llvm.fabs.f64(double %207)
  %209 = fcmp olt double %208, 1.000000e-10
  br i1 %209, label %210, label %216

210:                                              ; preds = %127
  %211 = load double, ptr %14, align 8, !tbaa !11
  %212 = fcmp olt double %211, 0.000000e+00
  br i1 %212, label %213, label %214

213:                                              ; preds = %210
  store double -1.000000e-08, ptr %14, align 8, !tbaa !11
  br label %215

214:                                              ; preds = %210
  store double 1.000000e-08, ptr %14, align 8, !tbaa !11
  br label %215

215:                                              ; preds = %214, %213
  br label %216

216:                                              ; preds = %215, %127
  %217 = load double, ptr %17, align 8, !tbaa !11
  %218 = load double, ptr %14, align 8, !tbaa !11
  %219 = fdiv double %217, %218
  store double %219, ptr %15, align 8, !tbaa !11
  %220 = load double, ptr %18, align 8, !tbaa !11
  %221 = load double, ptr %14, align 8, !tbaa !11
  %222 = fdiv double %220, %221
  store double %222, ptr %16, align 8, !tbaa !11
  %223 = load double, ptr %15, align 8, !tbaa !11
  %224 = load double, ptr %20, align 8, !tbaa !11
  %225 = fadd double %224, %223
  store double %225, ptr %20, align 8, !tbaa !11
  %226 = load double, ptr %16, align 8, !tbaa !11
  %227 = load double, ptr %21, align 8, !tbaa !11
  %228 = fadd double %227, %226
  store double %228, ptr %21, align 8, !tbaa !11
  %229 = load ptr, ptr %12, align 8, !tbaa !5
  %230 = load i32, ptr %229, align 4, !tbaa !9
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %229, align 4, !tbaa !9
  br label %232

232:                                              ; preds = %216
  %233 = load double, ptr %15, align 8, !tbaa !11
  %234 = call double @llvm.fabs.f64(double %233)
  %235 = load double, ptr %16, align 8, !tbaa !11
  %236 = call double @llvm.fabs.f64(double %235)
  %237 = fadd double %234, %236
  %238 = load double, ptr %19, align 8, !tbaa !11
  %239 = fcmp ogt double %237, %238
  br i1 %239, label %37, label %240, !llvm.loop !15

240:                                              ; preds = %232, %41
  %241 = load double, ptr %21, align 8, !tbaa !11
  %242 = load ptr, ptr %10, align 8, !tbaa !5
  %243 = getelementptr inbounds double, ptr %242, i64 0
  store double %241, ptr %243, align 8, !tbaa !11
  %244 = load double, ptr %20, align 8, !tbaa !11
  %245 = load ptr, ptr %10, align 8, !tbaa !5
  %246 = getelementptr inbounds double, ptr %245, i64 1
  store double %244, ptr %246, align 8, !tbaa !11
  %247 = load double, ptr %16, align 8, !tbaa !11
  %248 = call double @llvm.fabs.f64(double %247)
  %249 = load double, ptr %15, align 8, !tbaa !11
  %250 = call double @llvm.fabs.f64(double %249)
  %251 = fadd double %248, %250
  %252 = load ptr, ptr %11, align 8, !tbaa !5
  store double %251, ptr %252, align 8, !tbaa !11
  %253 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %253) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  ret void
}

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = { nounwind allocsize(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 "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 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !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}


; 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"

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

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

; Function Attrs: nounwind uwtable
define dso_local void @find_quad(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef %2, ptr nocapture noundef %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #1 {
  %7 = add i32 %1, 1
  %8 = sext i32 %7 to i64
  %9 = shl nsw i64 %8, 3
  %10 = tail call noalias ptr @malloc(i64 noundef %9) #5
  store double 1.000000e+00, ptr %10, align 8, !tbaa !5
  %11 = load <2 x double>, ptr %3, align 8, !tbaa !5
  %12 = add nsw i32 %1, -1
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds double, ptr %10, i64 %13
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = getelementptr inbounds i8, ptr %2, i64 8
  %17 = getelementptr inbounds i8, ptr %10, i64 8
  %.not94 = icmp slt i32 %1, 2
  %18 = sext i32 %1 to i64
  %19 = getelementptr double, ptr %10, i64 %18
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = getelementptr i8, ptr %19, i64 -16
  %22 = getelementptr inbounds double, ptr %2, i64 %18
  %23 = getelementptr inbounds double, ptr %2, i64 %13
  %wide.trip.count = zext i32 %7 to i64
  br label %24

24:                                               ; preds = %._crit_edge, %6
  %.08596 = phi double [ 1.000000e-15, %6 ], [ %.186, %._crit_edge ]
  %25 = phi i32 [ 1, %6 ], [ %79, %._crit_edge ]
  %26 = phi <2 x double> [ %11, %6 ], [ %78, %._crit_edge ]
  %.lhs.trunc = trunc i32 %25 to i16
  %27 = urem i16 %.lhs.trunc, 200
  %28 = icmp eq i16 %27, 0
  %29 = fmul double %.08596, 1.000000e+01
  %.186 = select i1 %28, double %29, double %.08596
  %30 = load double, ptr %15, align 8, !tbaa !5
  %31 = extractelement <2 x double> %26, i64 1
  %32 = fsub double %30, %31
  store double %32, ptr %16, align 8, !tbaa !5
  %33 = fsub double %32, %31
  store double %33, ptr %17, align 8, !tbaa !5
  br i1 %.not94, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %34 = fneg double %31
  %35 = extractelement <2 x double> %26, i64 0
  %36 = fneg double %35
  br label %37

37:                                               ; preds = %.lr.ph, %37
  %38 = phi double [ %33, %.lr.ph ], [ %51, %37 ]
  %39 = phi double [ %32, %.lr.ph ], [ %46, %37 ]
  %indvars.iv = phi i64 [ 2, %.lr.ph ], [ %indvars.iv.next, %37 ]
  %40 = getelementptr inbounds double, ptr %0, i64 %indvars.iv
  %41 = load double, ptr %40, align 8, !tbaa !5
  %42 = tail call double @llvm.fmuladd.f64(double %34, double %39, double %41)
  %43 = add nsw i64 %indvars.iv, -2
  %44 = getelementptr inbounds double, ptr %2, i64 %43
  %45 = load double, ptr %44, align 8, !tbaa !5
  %46 = tail call double @llvm.fmuladd.f64(double %36, double %45, double %42)
  %47 = getelementptr inbounds double, ptr %2, i64 %indvars.iv
  store double %46, ptr %47, align 8, !tbaa !5
  %48 = tail call double @llvm.fmuladd.f64(double %34, double %38, double %46)
  %49 = getelementptr inbounds double, ptr %10, i64 %43
  %50 = load double, ptr %49, align 8, !tbaa !5
  %51 = tail call double @llvm.fmuladd.f64(double %36, double %50, double %48)
  %52 = getelementptr inbounds double, ptr %10, i64 %indvars.iv
  store double %51, ptr %52, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %37, !llvm.loop !9

._crit_edge:                                      ; preds = %37, %24
  %53 = load double, ptr %14, align 8, !tbaa !5
  %54 = load double, ptr %20, align 8, !tbaa !5
  %55 = load double, ptr %21, align 8, !tbaa !5
  %56 = fneg double %55
  %57 = fmul double %55, %56
  %58 = tail call double @llvm.fmuladd.f64(double %53, double %54, double %57)
  %59 = load double, ptr %22, align 8, !tbaa !5
  %60 = load double, ptr %23, align 8, !tbaa !5
  %61 = tail call double @llvm.fabs.f64(double %58)
  %62 = fcmp olt double %61, 1.000000e-10
  %63 = fcmp olt double %58, 0.000000e+00
  %. = select i1 %63, double -1.000000e-08, double 1.000000e-08
  %.087 = select i1 %62, double %., double %58
  %64 = insertelement <2 x double> poison, double %59, i64 0
  %65 = insertelement <2 x double> %64, double %60, i64 1
  %66 = fneg <2 x double> %65
  %67 = insertelement <2 x double> poison, double %55, i64 0
  %68 = shufflevector <2 x double> %67, <2 x double> poison, <2 x i32> zeroinitializer
  %69 = fmul <2 x double> %68, %66
  %70 = insertelement <2 x double> poison, double %60, i64 0
  %71 = insertelement <2 x double> %70, double %59, i64 1
  %72 = insertelement <2 x double> poison, double %53, i64 0
  %73 = insertelement <2 x double> %72, double %54, i64 1
  %74 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %71, <2 x double> %73, <2 x double> %69)
  %75 = insertelement <2 x double> poison, double %.087, i64 0
  %76 = shufflevector <2 x double> %75, <2 x double> poison, <2 x i32> zeroinitializer
  %77 = fdiv <2 x double> %74, %76
  %78 = fadd <2 x double> %26, %77
  %79 = add nuw nsw i32 %25, 1
  %80 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %77)
  %shift = shufflevector <2 x double> %80, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %81 = fadd <2 x double> %shift, %80
  %82 = extractelement <2 x double> %81, i64 0
  %83 = fcmp ule double %82, %.186
  %84 = icmp ugt i32 %25, 499
  %or.cond = select i1 %83, i1 true, i1 %84
  br i1 %or.cond, label %85, label %24, !llvm.loop !11

85:                                               ; preds = %._crit_edge
  store i32 %79, ptr %5, align 4, !tbaa !12
  store <2 x double> %78, ptr %3, align 8, !tbaa !5
  store double %82, ptr %4, align 8, !tbaa !5
  tail call void @free(ptr noundef nonnull %10) #6
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fabs.v2f64(<2 x double>) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }
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 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass