; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (arrays)

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

@.str.30 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [27 x i8], align 1
@__func__.array_interpolate_linear = external hidden unnamed_addr constant [25 x i8], align 1

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @array_interpolate_linear(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, double noundef %4, ptr noundef %5, ptr noundef %6, i32 noundef %7, ptr noundef %8) #3 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  store ptr %2, ptr %13, align 8, !tbaa !5
  store i32 %3, ptr %14, align 4, !tbaa !9
  store double %4, ptr %15, align 8, !tbaa !11
  store ptr %5, ptr %16, align 8, !tbaa !5
  store ptr %6, ptr %17, align 8, !tbaa !5
  store i32 %7, ptr %18, align 4, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  store i32 0, ptr %20, align 4, !tbaa !9
  %28 = load i32, ptr %12, align 4, !tbaa !9
  %29 = sub nsw i32 %28, 1
  store i32 %29, ptr %21, align 4, !tbaa !9
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = load i32, ptr %20, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds double, ptr %30, i64 %32
  %34 = load double, ptr %33, align 8, !tbaa !11
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = load i32, ptr %21, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds double, ptr %35, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !11
  %40 = fcmp olt double %34, %39
  br i1 %40, label %41, label %101

41:                                               ; preds = %9
  %42 = load double, ptr %15, align 8, !tbaa !11
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = load i32, ptr %20, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %43, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !11
  %48 = fcmp olt double %42, %47
  br i1 %48, label %49, label %58

49:                                               ; preds = %41
  %50 = load ptr, ptr %19, align 8, !tbaa !5
  %51 = load double, ptr %15, align 8, !tbaa !11
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = load i32, ptr %20, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %52, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !11
  %57 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %50, ptr noundef @.str.30, ptr noundef @__func__.array_interpolate_linear, i32 noundef 1854, double noundef %51, double noundef %56) #4
  store i32 1, ptr %10, align 4
  store i32 1, ptr %27, align 4
  br label %223

58:                                               ; preds = %41
  %59 = load double, ptr %15, align 8, !tbaa !11
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = load i32, ptr %21, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %60, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = fcmp ogt double %59, %64
  br i1 %65, label %66, label %75

66:                                               ; preds = %58
  %67 = load ptr, ptr %19, align 8, !tbaa !5
  %68 = load double, ptr %15, align 8, !tbaa !11
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = load i32, ptr %21, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %69, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !11
  %74 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %67, ptr noundef @.str.31, ptr noundef @__func__.array_interpolate_linear, i32 noundef 1859, double noundef %68, double noundef %73) #4
  store i32 1, ptr %10, align 4
  store i32 1, ptr %27, align 4
  br label %223

75:                                               ; preds = %58
  br label %76

76:                                               ; preds = %99, %75
  %77 = load i32, ptr %21, align 4, !tbaa !9
  %78 = load i32, ptr %20, align 4, !tbaa !9
  %79 = sub nsw i32 %77, %78
  %80 = icmp sgt i32 %79, 1
  br i1 %80, label %81, label %100

81:                                               ; preds = %76
  %82 = load i32, ptr %20, align 4, !tbaa !9
  %83 = load i32, ptr %21, align 4, !tbaa !9
  %84 = add nsw i32 %82, %83
  %85 = sitofp i32 %84 to double
  %86 = fmul double 5.000000e-01, %85
  %87 = fptosi double %86 to i32
  store i32 %87, ptr %22, align 4, !tbaa !9
  %88 = load double, ptr %15, align 8, !tbaa !11
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load i32, ptr %22, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds double, ptr %89, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !11
  %94 = fcmp olt double %88, %93
  br i1 %94, label %95, label %97

95:                                               ; preds = %81
  %96 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %96, ptr %21, align 4, !tbaa !9
  br label %99

97:                                               ; preds = %81
  %98 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %98, ptr %20, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %97, %95
  br label %76, !llvm.loop !13

100:                                              ; preds = %76
  br label %161

101:                                              ; preds = %9
  %102 = load double, ptr %15, align 8, !tbaa !11
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = load i32, ptr %21, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds double, ptr %103, i64 %105
  %107 = load double, ptr %106, align 8, !tbaa !11
  %108 = fcmp olt double %102, %107
  br i1 %108, label %109, label %118

109:                                              ; preds = %101
  %110 = load ptr, ptr %19, align 8, !tbaa !5
  %111 = load double, ptr %15, align 8, !tbaa !11
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = load i32, ptr %21, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds double, ptr %112, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !11
  %117 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %110, ptr noundef @.str.30, ptr noundef @__func__.array_interpolate_linear, i32 noundef 1876, double noundef %111, double noundef %116) #4
  store i32 1, ptr %10, align 4
  store i32 1, ptr %27, align 4
  br label %223

118:                                              ; preds = %101
  %119 = load double, ptr %15, align 8, !tbaa !11
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load i32, ptr %20, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds double, ptr %120, i64 %122
  %124 = load double, ptr %123, align 8, !tbaa !11
  %125 = fcmp ogt double %119, %124
  br i1 %125, label %126, label %135

126:                                              ; preds = %118
  %127 = load ptr, ptr %19, align 8, !tbaa !5
  %128 = load double, ptr %15, align 8, !tbaa !11
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = load i32, ptr %20, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !11
  %134 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %127, ptr noundef @.str.31, ptr noundef @__func__.array_interpolate_linear, i32 noundef 1881, double noundef %128, double noundef %133) #4
  store i32 1, ptr %10, align 4
  store i32 1, ptr %27, align 4
  br label %223

135:                                              ; preds = %118
  br label %136

136:                                              ; preds = %159, %135
  %137 = load i32, ptr %21, align 4, !tbaa !9
  %138 = load i32, ptr %20, align 4, !tbaa !9
  %139 = sub nsw i32 %137, %138
  %140 = icmp sgt i32 %139, 1
  br i1 %140, label %141, label %160

141:                                              ; preds = %136
  %142 = load i32, ptr %20, align 4, !tbaa !9
  %143 = load i32, ptr %21, align 4, !tbaa !9
  %144 = add nsw i32 %142, %143
  %145 = sitofp i32 %144 to double
  %146 = fmul double 5.000000e-01, %145
  %147 = fptosi double %146 to i32
  store i32 %147, ptr %22, align 4, !tbaa !9
  %148 = load double, ptr %15, align 8, !tbaa !11
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = load i32, ptr %22, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds double, ptr %149, i64 %151
  %153 = load double, ptr %152, align 8, !tbaa !11
  %154 = fcmp ogt double %148, %153
  br i1 %154, label %155, label %157

155:                                              ; preds = %141
  %156 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %156, ptr %21, align 4, !tbaa !9
  br label %159

157:                                              ; preds = %141
  %158 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %158, ptr %20, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %157, %155
  br label %136, !llvm.loop !15

160:                                              ; preds = %136
  br label %161

161:                                              ; preds = %160, %100
  %162 = load i32, ptr %20, align 4, !tbaa !9
  %163 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 %162, ptr %163, align 4, !tbaa !9
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  %165 = load i32, ptr %21, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds double, ptr %164, i64 %166
  %168 = load double, ptr %167, align 8, !tbaa !11
  %169 = load ptr, ptr %11, align 8, !tbaa !5
  %170 = load i32, ptr %20, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds double, ptr %169, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !11
  %174 = fsub double %168, %173
  store double %174, ptr %24, align 8, !tbaa !11
  %175 = load double, ptr %15, align 8, !tbaa !11
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  %177 = load i32, ptr %20, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds double, ptr %176, i64 %178
  %180 = load double, ptr %179, align 8, !tbaa !11
  %181 = fsub double %175, %180
  %182 = load double, ptr %24, align 8, !tbaa !11
  %183 = fdiv double %181, %182
  store double %183, ptr %26, align 8, !tbaa !11
  %184 = load double, ptr %26, align 8, !tbaa !11
  %185 = fsub double 1.000000e+00, %184
  store double %185, ptr %25, align 8, !tbaa !11
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %186

186:                                              ; preds = %219, %161
  %187 = load i32, ptr %23, align 4, !tbaa !9
  %188 = load i32, ptr %18, align 4, !tbaa !9
  %189 = icmp slt i32 %187, %188
  br i1 %189, label %190, label %222

190:                                              ; preds = %186
  %191 = load double, ptr %25, align 8, !tbaa !11
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = load i32, ptr %20, align 4, !tbaa !9
  %194 = load i32, ptr %14, align 4, !tbaa !9
  %195 = mul nsw i32 %193, %194
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds double, ptr %192, i64 %196
  %198 = load i32, ptr %23, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds double, ptr %197, i64 %199
  %201 = load double, ptr %200, align 8, !tbaa !11
  %202 = load double, ptr %26, align 8, !tbaa !11
  %203 = load ptr, ptr %13, align 8, !tbaa !5
  %204 = load i32, ptr %21, align 4, !tbaa !9
  %205 = load i32, ptr %14, align 4, !tbaa !9
  %206 = mul nsw i32 %204, %205
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds double, ptr %203, i64 %207
  %209 = load i32, ptr %23, align 4, !tbaa !9
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds double, ptr %208, i64 %210
  %212 = load double, ptr %211, align 8, !tbaa !11
  %213 = fmul double %202, %212
  %214 = call double @llvm.fmuladd.f64(double %191, double %201, double %213)
  %215 = load ptr, ptr %17, align 8, !tbaa !5
  %216 = load i32, ptr %23, align 4, !tbaa !9
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds double, ptr %215, i64 %217
  store double %214, ptr %218, align 8, !tbaa !11
  br label %219

219:                                              ; preds = %190
  %220 = load i32, ptr %23, align 4, !tbaa !9
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %23, align 4, !tbaa !9
  br label %186, !llvm.loop !16

222:                                              ; preds = %186
  store i32 0, ptr %10, align 4
  store i32 1, ptr %27, align 4
  br label %223

223:                                              ; preds = %222, %126, %109, %66, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %224 = load i32, ptr %10, align 4
  ret i32 %224
}

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

@.str.30 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [27 x i8], align 1
@__func__.array_interpolate_linear = external hidden unnamed_addr constant [25 x i8], align 1

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nofree nounwind uwtable
define dso_local range(i32 0, 2) i32 @array_interpolate_linear(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, double noundef %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6, i32 noundef %7, ptr nocapture noundef writeonly %8) local_unnamed_addr #2 {
  %10 = ptrtoint ptr %2 to i64
  %11 = ptrtoint ptr %6 to i64
  %12 = add nsw i32 %1, -1
  %13 = load double, ptr %0, align 8, !tbaa !5
  %14 = sext i32 %12 to i64
  %15 = getelementptr inbounds double, ptr %0, i64 %14
  %16 = load double, ptr %15, align 8, !tbaa !5
  %17 = fcmp olt double %13, %16
  br i1 %17, label %18, label %37

18:                                               ; preds = %9
  %19 = fcmp ogt double %13, %4
  br i1 %19, label %20, label %22

20:                                               ; preds = %18
  %21 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.30, ptr noundef nonnull @__func__.array_interpolate_linear, i32 noundef 1854, double noundef %4, double noundef %13) #4
  br label %.loopexit

22:                                               ; preds = %18
  %23 = fcmp olt double %16, %4
  br i1 %23, label %25, label %.preheader

.preheader:                                       ; preds = %22
  %24 = icmp sgt i32 %1, 2
  br i1 %24, label %.lr.ph100, label %.loopexit92

25:                                               ; preds = %22
  %26 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.31, ptr noundef nonnull @__func__.array_interpolate_linear, i32 noundef 1859, double noundef %4, double noundef %16) #4
  br label %.loopexit

.lr.ph100:                                        ; preds = %.preheader, %.lr.ph100
  %.07799 = phi i32 [ %.077., %.lr.ph100 ], [ 0, %.preheader ]
  %.07898 = phi i32 [ %..078, %.lr.ph100 ], [ %12, %.preheader ]
  %27 = add nsw i32 %.07799, %.07898
  %28 = sitofp i32 %27 to double
  %29 = fmul double %28, 5.000000e-01
  %30 = fptosi double %29 to i32
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds double, ptr %0, i64 %31
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = fcmp ogt double %33, %4
  %..078 = select i1 %34, i32 %30, i32 %.07898
  %.077. = select i1 %34, i32 %.07799, i32 %30
  %35 = sub nsw i32 %..078, %.077.
  %36 = icmp sgt i32 %35, 1
  br i1 %36, label %.lr.ph100, label %.loopexit92, !llvm.loop !9

37:                                               ; preds = %9
  %38 = fcmp ogt double %16, %4
  br i1 %38, label %39, label %41

39:                                               ; preds = %37
  %40 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.30, ptr noundef nonnull @__func__.array_interpolate_linear, i32 noundef 1876, double noundef %4, double noundef %16) #4
  br label %.loopexit

41:                                               ; preds = %37
  %42 = fcmp olt double %13, %4
  br i1 %42, label %44, label %.preheader93

.preheader93:                                     ; preds = %41
  %43 = icmp sgt i32 %1, 2
  br i1 %43, label %.lr.ph, label %.loopexit92

44:                                               ; preds = %41
  %45 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.31, ptr noundef nonnull @__func__.array_interpolate_linear, i32 noundef 1881, double noundef %4, double noundef %13) #4
  br label %.loopexit

.lr.ph:                                           ; preds = %.preheader93, %.lr.ph
  %.296 = phi i32 [ %.2., %.lr.ph ], [ 0, %.preheader93 ]
  %.28095 = phi i32 [ %..280, %.lr.ph ], [ %12, %.preheader93 ]
  %46 = add nsw i32 %.296, %.28095
  %47 = sitofp i32 %46 to double
  %48 = fmul double %47, 5.000000e-01
  %49 = fptosi double %48 to i32
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds double, ptr %0, i64 %50
  %52 = load double, ptr %51, align 8, !tbaa !5
  %53 = fcmp olt double %52, %4
  %..280 = select i1 %53, i32 %49, i32 %.28095
  %.2. = select i1 %53, i32 %.296, i32 %49
  %54 = sub nsw i32 %..280, %.2.
  %55 = icmp sgt i32 %54, 1
  br i1 %55, label %.lr.ph, label %.loopexit92, !llvm.loop !11

.loopexit92:                                      ; preds = %.lr.ph, %.lr.ph100, %.preheader93, %.preheader
  %.482 = phi i32 [ %12, %.preheader ], [ %12, %.preheader93 ], [ %..078, %.lr.ph100 ], [ %..280, %.lr.ph ]
  %.4 = phi i32 [ 0, %.preheader ], [ 0, %.preheader93 ], [ %.077., %.lr.ph100 ], [ %.2., %.lr.ph ]
  store i32 %.4, ptr %5, align 4, !tbaa !12
  %56 = sext i32 %.482 to i64
  %57 = getelementptr inbounds double, ptr %0, i64 %56
  %58 = load double, ptr %57, align 8, !tbaa !5
  %59 = sext i32 %.4 to i64
  %60 = getelementptr inbounds double, ptr %0, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !5
  %62 = fsub double %58, %61
  %63 = fsub double %4, %61
  %64 = fdiv double %63, %62
  %65 = fsub double 1.000000e+00, %64
  %66 = icmp sgt i32 %7, 0
  br i1 %66, label %.lr.ph104, label %.loopexit

.lr.ph104:                                        ; preds = %.loopexit92
  %67 = mul nsw i32 %.4, %3
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds double, ptr %2, i64 %68
  %70 = mul nsw i32 %.482, %3
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %2, i64 %71
  %wide.trip.count = zext nneg i32 %7 to i64
  %min.iters.check = icmp ult i32 %7, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph104
  %73 = sub i64 %11, %10
  %74 = shl nsw i64 %71, 3
  %75 = sub i64 %73, %74
  %diff.check = icmp ult i64 %75, 32
  %76 = shl nsw i64 %68, 3
  %77 = sub i64 %73, %76
  %diff.check109 = icmp ult i64 %77, 32
  %conflict.rdx = or i1 %diff.check, %diff.check109
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %64, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert113 = insertelement <2 x double> poison, double %65, i64 0
  %broadcast.splat114 = shufflevector <2 x double> %broadcast.splatinsert113, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %78 = getelementptr inbounds double, ptr %69, i64 %index
  %79 = getelementptr inbounds i8, ptr %78, i64 16
  %wide.load = load <2 x double>, ptr %78, align 8, !tbaa !5
  %wide.load110 = load <2 x double>, ptr %79, align 8, !tbaa !5
  %80 = getelementptr inbounds double, ptr %72, i64 %index
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  %wide.load111 = load <2 x double>, ptr %80, align 8, !tbaa !5
  %wide.load112 = load <2 x double>, ptr %81, align 8, !tbaa !5
  %82 = fmul <2 x double> %broadcast.splat, %wide.load111
  %83 = fmul <2 x double> %broadcast.splat, %wide.load112
  %84 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat114, <2 x double> %wide.load, <2 x double> %82)
  %85 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat114, <2 x double> %wide.load110, <2 x double> %83)
  %86 = getelementptr inbounds double, ptr %6, i64 %index
  %87 = getelementptr inbounds i8, ptr %86, i64 16
  store <2 x double> %84, ptr %86, align 8, !tbaa !5
  store <2 x double> %85, ptr %87, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %88 = icmp eq i64 %index.next, %n.vec
  br i1 %88, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph104
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph104 ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %89 = getelementptr inbounds double, ptr %69, i64 %indvars.iv.ph
  %90 = load double, ptr %89, align 8, !tbaa !5
  %91 = getelementptr inbounds double, ptr %72, i64 %indvars.iv.ph
  %92 = load double, ptr %91, align 8, !tbaa !5
  %93 = fmul double %64, %92
  %94 = tail call double @llvm.fmuladd.f64(double %65, double %90, double %93)
  %95 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.ph
  store double %94, ptr %95, align 8, !tbaa !5
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %96 = add nsw i64 %wide.trip.count, -1
  %97 = icmp eq i64 %indvars.iv.ph, %96
  br i1 %97, label %.loopexit, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %98 = getelementptr inbounds double, ptr %69, i64 %indvars.iv
  %99 = load double, ptr %98, align 8, !tbaa !5
  %100 = getelementptr inbounds double, ptr %72, i64 %indvars.iv
  %101 = load double, ptr %100, align 8, !tbaa !5
  %102 = fmul double %64, %101
  %103 = tail call double @llvm.fmuladd.f64(double %65, double %99, double %102)
  %104 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  store double %103, ptr %104, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %105 = getelementptr inbounds double, ptr %69, i64 %indvars.iv.next
  %106 = load double, ptr %105, align 8, !tbaa !5
  %107 = getelementptr inbounds double, ptr %72, i64 %indvars.iv.next
  %108 = load double, ptr %107, align 8, !tbaa !5
  %109 = fmul double %64, %108
  %110 = tail call double @llvm.fmuladd.f64(double %65, double %106, double %109)
  %111 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next
  store double %110, ptr %111, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %.loopexit, label %scalar.ph, !llvm.loop !17

.loopexit:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.loopexit92, %44, %39, %25, %20
  %.0 = phi i32 [ 1, %20 ], [ 1, %25 ], [ 1, %39 ], [ 1, %44 ], [ 0, %.loopexit92 ], [ 0, %middle.block ], [ 0, %scalar.ph ], [ 0, %scalar.ph.prol.loopexit ]
  ret i32 %.0
}

; 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>) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { nofree 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10, !15}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass