; LLVM IR from VT-ICAM/cfem :: cfem (cf_supg_test_function_gradient)

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

%struct.cf_convection_s = type { [2 x double], [2 x double], [2 x double] }
%struct.cf_ref_arrays_s = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double }
%struct.cf_local_element_s = type { [3 x double], [3 x double], [4 x double], [2 x double], double, double, ptr }

; 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: nounwind uwtable
declare dso_local void @cf_affine_transformation(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @cf_physical_gradients(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8) #1

; Function Attrs: nounwind uwtable
declare dso_local void @cf_physical_hessian(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8, ptr noundef nonnull align 8) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

; Function Attrs: nounwind uwtable
define dso_local void @cf_supg_test_function_gradient(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noalias noundef %3, ptr noalias noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.cf_convection_s, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca %struct.cf_convection_s, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !9
  store i32 %29, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !14
  store i32 %32, ptr %15, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %33 = load i32, ptr %14, align 4, !tbaa !13
  %34 = load i32, ptr %15, align 4, !tbaa !13
  %35 = mul nsw i32 %33, %34
  store i32 %35, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 48, ptr %17) #5
  %36 = load i32, ptr %16, align 4, !tbaa !13
  %37 = zext i32 %36 to i64
  %38 = call ptr @llvm.stacksave.p0()
  store ptr %38, ptr %18, align 8
  %39 = alloca double, i64 %37, align 16
  store i64 %37, ptr %19, align 8
  %40 = load i32, ptr %16, align 4, !tbaa !13
  %41 = zext i32 %40 to i64
  %42 = alloca double, i64 %41, align 16
  store i64 %41, ptr %20, align 8
  %43 = load i32, ptr %16, align 4, !tbaa !13
  %44 = zext i32 %43 to i64
  %45 = alloca double, i64 %44, align 16
  store i64 %44, ptr %21, align 8
  %46 = load i32, ptr %16, align 4, !tbaa !13
  %47 = zext i32 %46 to i64
  %48 = alloca double, i64 %47, align 16
  store i64 %47, ptr %22, align 8
  %49 = load i32, ptr %16, align 4, !tbaa !13
  %50 = zext i32 %49 to i64
  %51 = alloca double, i64 %50, align 16
  store i64 %50, ptr %23, align 8
  %52 = load i32, ptr %14, align 4, !tbaa !13
  %53 = zext i32 %52 to i64
  %54 = alloca double, i64 %53, align 16
  store i64 %53, ptr %24, align 8
  %55 = load i32, ptr %14, align 4, !tbaa !13
  %56 = zext i32 %55 to i64
  %57 = alloca double, i64 %56, align 16
  store i64 %56, ptr %25, align 8
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  call void @cf_affine_transformation(ptr noundef %58, ptr noundef %59, ptr noundef %54, ptr noundef %57)
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  call void @cf_physical_gradients(ptr noundef %60, ptr noundef %61, ptr noundef %39, ptr noundef %42)
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  call void @cf_physical_hessian(ptr noundef %62, ptr noundef %63, ptr noundef %45, ptr noundef %48, ptr noundef %51)
  store i32 0, ptr %11, align 4, !tbaa !13
  br label %64

64:                                               ; preds = %184, %5
  %65 = load i32, ptr %11, align 4, !tbaa !13
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !9
  %69 = icmp slt i32 %65, %68
  br i1 %69, label %70, label %187

70:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 48, ptr %26) #5
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load i32, ptr %11, align 4, !tbaa !13
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %54, i64 %73
  %75 = load double, ptr %74, align 8, !tbaa !15
  %76 = load i32, ptr %11, align 4, !tbaa !13
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %57, i64 %77
  %79 = load double, ptr %78, align 8, !tbaa !15
  call void %71(ptr dead_on_unwind writable sret(%struct.cf_convection_s) align 8 %26, double noundef %75, double noundef %79)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %26, i64 48, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #5
  store i32 0, ptr %12, align 4, !tbaa !13
  br label %80

80:                                               ; preds = %180, %70
  %81 = load i32, ptr %12, align 4, !tbaa !13
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %85 = icmp slt i32 %81, %84
  br i1 %85, label %86, label %183

86:                                               ; preds = %80
  %87 = load i32, ptr %12, align 4, !tbaa !13
  %88 = load i32, ptr %14, align 4, !tbaa !13
  %89 = mul nsw i32 %87, %88
  %90 = load i32, ptr %11, align 4, !tbaa !13
  %91 = add nsw i32 %89, %90
  store i32 %91, ptr %13, align 4, !tbaa !13
  %92 = load i32, ptr %13, align 4, !tbaa !13
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds double, ptr %39, i64 %93
  %95 = load double, ptr %94, align 8, !tbaa !15
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.cf_local_element_s, ptr %96, i32 0, i32 5
  %98 = load double, ptr %97, align 8, !tbaa !18
  %99 = getelementptr inbounds %struct.cf_convection_s, ptr %17, i32 0, i32 1
  %100 = getelementptr inbounds [2 x double], ptr %99, i64 0, i64 0
  %101 = load double, ptr %100, align 8, !tbaa !15
  %102 = load i32, ptr %13, align 4, !tbaa !13
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %39, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !15
  %106 = getelementptr inbounds %struct.cf_convection_s, ptr %17, i32 0, i32 0
  %107 = getelementptr inbounds [2 x double], ptr %106, i64 0, i64 0
  %108 = load double, ptr %107, align 8, !tbaa !15
  %109 = load i32, ptr %13, align 4, !tbaa !13
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds double, ptr %45, i64 %110
  %112 = load double, ptr %111, align 8, !tbaa !15
  %113 = fmul double %108, %112
  %114 = call double @llvm.fmuladd.f64(double %101, double %105, double %113)
  %115 = getelementptr inbounds %struct.cf_convection_s, ptr %17, i32 0, i32 1
  %116 = getelementptr inbounds [2 x double], ptr %115, i64 0, i64 1
  %117 = load double, ptr %116, align 8, !tbaa !15
  %118 = load i32, ptr %13, align 4, !tbaa !13
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds double, ptr %42, i64 %119
  %121 = load double, ptr %120, align 8, !tbaa !15
  %122 = call double @llvm.fmuladd.f64(double %117, double %121, double %114)
  %123 = getelementptr inbounds %struct.cf_convection_s, ptr %17, i32 0, i32 0
  %124 = getelementptr inbounds [2 x double], ptr %123, i64 0, i64 1
  %125 = load double, ptr %124, align 8, !tbaa !15
  %126 = load i32, ptr %13, align 4, !tbaa !13
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds double, ptr %48, i64 %127
  %129 = load double, ptr %128, align 8, !tbaa !15
  %130 = call double @llvm.fmuladd.f64(double %125, double %129, double %122)
  %131 = call double @llvm.fmuladd.f64(double %98, double %130, double %95)
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = load i32, ptr %13, align 4, !tbaa !13
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %132, i64 %134
  store double %131, ptr %135, align 8, !tbaa !15
  %136 = load i32, ptr %13, align 4, !tbaa !13
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds double, ptr %42, i64 %137
  %139 = load double, ptr %138, align 8, !tbaa !15
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.cf_local_element_s, ptr %140, i32 0, i32 5
  %142 = load double, ptr %141, align 8, !tbaa !18
  %143 = getelementptr inbounds %struct.cf_convection_s, ptr %17, i32 0, i32 2
  %144 = getelementptr inbounds [2 x double], ptr %143, i64 0, i64 0
  %145 = load double, ptr %144, align 8, !tbaa !15
  %146 = load i32, ptr %13, align 4, !tbaa !13
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds double, ptr %39, i64 %147
  %149 = load double, ptr %148, align 8, !tbaa !15
  %150 = getelementptr inbounds %struct.cf_convection_s, ptr %17, i32 0, i32 0
  %151 = getelementptr inbounds [2 x double], ptr %150, i64 0, i64 0
  %152 = load double, ptr %151, align 8, !tbaa !15
  %153 = load i32, ptr %13, align 4, !tbaa !13
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds double, ptr %48, i64 %154
  %156 = load double, ptr %155, align 8, !tbaa !15
  %157 = fmul double %152, %156
  %158 = call double @llvm.fmuladd.f64(double %145, double %149, double %157)
  %159 = getelementptr inbounds %struct.cf_convection_s, ptr %17, i32 0, i32 2
  %160 = getelementptr inbounds [2 x double], ptr %159, i64 0, i64 1
  %161 = load double, ptr %160, align 8, !tbaa !15
  %162 = load i32, ptr %13, align 4, !tbaa !13
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds double, ptr %42, i64 %163
  %165 = load double, ptr %164, align 8, !tbaa !15
  %166 = call double @llvm.fmuladd.f64(double %161, double %165, double %158)
  %167 = getelementptr inbounds %struct.cf_convection_s, ptr %17, i32 0, i32 0
  %168 = getelementptr inbounds [2 x double], ptr %167, i64 0, i64 1
  %169 = load double, ptr %168, align 8, !tbaa !15
  %170 = load i32, ptr %13, align 4, !tbaa !13
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds double, ptr %51, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !15
  %174 = call double @llvm.fmuladd.f64(double %169, double %173, double %166)
  %175 = call double @llvm.fmuladd.f64(double %142, double %174, double %139)
  %176 = load ptr, ptr %10, align 8, !tbaa !5
  %177 = load i32, ptr %13, align 4, !tbaa !13
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds double, ptr %176, i64 %178
  store double %175, ptr %179, align 8, !tbaa !15
  br label %180

180:                                              ; preds = %86
  %181 = load i32, ptr %12, align 4, !tbaa !13
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %12, align 4, !tbaa !13
  br label %80, !llvm.loop !20

183:                                              ; preds = %80
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %11, align 4, !tbaa !13
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %11, align 4, !tbaa !13
  br label %64, !llvm.loop !22

187:                                              ; preds = %64
  %188 = load ptr, ptr %18, align 8
  call void @llvm.stackrestore.p0(ptr %188)
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !12, i64 80}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 4}
!15 = !{!12, !12, i64 0}
!16 = !{i64 0, i64 16, !17, i64 16, i64 16, !17, i64 32, i64 16, !17}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !12, i64 104}
!19 = !{!"", !7, i64 0, !7, i64 24, !7, i64 48, !7, i64 80, !12, i64 96, !12, i64 104, !6, i64 112}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

%struct.cf_convection_s = type { [2 x double], [2 x double], [2 x double] }

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @cf_affine_transformation(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @cf_physical_gradients(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @cf_physical_hessian(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8, ptr noundef nonnull align 8) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @cf_supg_test_function_gradient(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr noalias nocapture noundef writeonly %3, ptr noalias nocapture noundef writeonly %4) local_unnamed_addr #1 {
  %6 = alloca %struct.cf_convection_s, align 8
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !12
  %10 = mul nsw i32 %9, %7
  %11 = zext i32 %10 to i64
  %12 = alloca double, i64 %11, align 16
  %13 = alloca double, i64 %11, align 16
  %14 = alloca double, i64 %11, align 16
  %15 = alloca double, i64 %11, align 16
  %16 = alloca double, i64 %11, align 16
  %17 = zext i32 %7 to i64
  %18 = alloca double, i64 %17, align 16
  %19 = alloca double, i64 %17, align 16
  call void @cf_affine_transformation(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %18, ptr noundef %19)
  call void @cf_physical_gradients(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %12, ptr noundef %13)
  call void @cf_physical_hessian(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %14, ptr noundef %15, ptr noundef %16)
  %20 = load i32, ptr %0, align 8, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph51, label %._crit_edge52

.lr.ph51:                                         ; preds = %5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 16
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 24
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 32
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 40
  %22 = getelementptr inbounds i8, ptr %1, i64 104
  %23 = sext i32 %7 to i64
  %ident.check.not = icmp eq i32 %7, 1
  br label %24

24:                                               ; preds = %.lr.ph51, %._crit_edge
  %indvars.iv54 = phi i64 [ 0, %.lr.ph51 ], [ %indvars.iv.next55, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #4
  %25 = getelementptr inbounds double, ptr %18, i64 %indvars.iv54
  %26 = load double, ptr %25, align 8, !tbaa !13
  %27 = getelementptr inbounds double, ptr %19, i64 %indvars.iv54
  %28 = load double, ptr %27, align 8, !tbaa !13
  call void %2(ptr dead_on_unwind nonnull writable sret(%struct.cf_convection_s) align 8 %6, double noundef %26, double noundef %28) #4
  %.sroa.0.0.copyload = load double, ptr %6, align 8
  %.sroa.5.0.copyload = load double, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !14
  %.sroa.7.0.copyload = load double, ptr %.sroa.7.0..sroa_idx, align 8
  %.sroa.8.0.copyload = load double, ptr %.sroa.8.0..sroa_idx, align 8, !tbaa !14
  %.sroa.9.0.copyload = load double, ptr %.sroa.9.0..sroa_idx, align 8
  %.sroa.10.0.copyload = load double, ptr %.sroa.10.0..sroa_idx, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #4
  %29 = load i32, ptr %8, align 4, !tbaa !12
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %24
  %31 = load double, ptr %22, align 8, !tbaa !15
  %wide.trip.count = zext nneg i32 %29 to i64
  %min.iters.check = icmp ne i32 %29, 1
  %or.cond = select i1 %min.iters.check, i1 %ident.check.not, i1 false
  br i1 %or.cond, label %vector.ph, label %scalar.ph.preheader

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483646
  %broadcast.splatinsert = insertelement <2 x double> poison, double %.sroa.0.0.copyload, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert58 = insertelement <2 x double> poison, double %.sroa.7.0.copyload, i64 0
  %broadcast.splat59 = shufflevector <2 x double> %broadcast.splatinsert58, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert61 = insertelement <2 x double> poison, double %.sroa.8.0.copyload, i64 0
  %broadcast.splat62 = shufflevector <2 x double> %broadcast.splatinsert61, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert64 = insertelement <2 x double> poison, double %.sroa.5.0.copyload, i64 0
  %broadcast.splat65 = shufflevector <2 x double> %broadcast.splatinsert64, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert66 = insertelement <2 x double> poison, double %31, i64 0
  %broadcast.splat67 = shufflevector <2 x double> %broadcast.splatinsert66, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert68 = insertelement <2 x double> poison, double %.sroa.9.0.copyload, i64 0
  %broadcast.splat69 = shufflevector <2 x double> %broadcast.splatinsert68, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert70 = insertelement <2 x double> poison, double %.sroa.10.0.copyload, i64 0
  %broadcast.splat71 = shufflevector <2 x double> %broadcast.splatinsert70, <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 ]
  %32 = add nsw i64 %index, %indvars.iv54
  %33 = getelementptr inbounds double, ptr %12, i64 %32
  %wide.load = load <2 x double>, ptr %33, align 8, !tbaa !13
  %34 = getelementptr inbounds double, ptr %14, i64 %32
  %wide.load57 = load <2 x double>, ptr %34, align 8, !tbaa !13
  %35 = fmul <2 x double> %broadcast.splat, %wide.load57
  %36 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat59, <2 x double> %wide.load, <2 x double> %35)
  %37 = getelementptr inbounds double, ptr %13, i64 %32
  %wide.load60 = load <2 x double>, ptr %37, align 8, !tbaa !13
  %38 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat62, <2 x double> %wide.load60, <2 x double> %36)
  %39 = getelementptr inbounds double, ptr %15, i64 %32
  %wide.load63 = load <2 x double>, ptr %39, align 8, !tbaa !13
  %40 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat65, <2 x double> %wide.load63, <2 x double> %38)
  %41 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat67, <2 x double> %40, <2 x double> %wide.load)
  %42 = getelementptr inbounds double, ptr %3, i64 %32
  store <2 x double> %41, ptr %42, align 8, !tbaa !13
  %43 = fmul <2 x double> %broadcast.splat, %wide.load63
  %44 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat69, <2 x double> %wide.load, <2 x double> %43)
  %45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat71, <2 x double> %wide.load60, <2 x double> %44)
  %46 = getelementptr inbounds double, ptr %16, i64 %32
  %wide.load72 = load <2 x double>, ptr %46, align 8, !tbaa !13
  %47 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat65, <2 x double> %wide.load72, <2 x double> %45)
  %48 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat67, <2 x double> %47, <2 x double> %wide.load60)
  %49 = getelementptr inbounds double, ptr %4, i64 %32
  store <2 x double> %48, ptr %49, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 2
  %50 = icmp eq i64 %index.next, %n.vec
  br i1 %50, label %middle.block, label %vector.body, !llvm.loop !17

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

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %51 = mul nsw i64 %indvars.iv, %23
  %52 = add nsw i64 %51, %indvars.iv54
  %53 = getelementptr inbounds double, ptr %12, i64 %52
  %54 = load double, ptr %53, align 8, !tbaa !13
  %55 = getelementptr inbounds double, ptr %14, i64 %52
  %56 = load double, ptr %55, align 8, !tbaa !13
  %57 = fmul double %.sroa.0.0.copyload, %56
  %58 = call double @llvm.fmuladd.f64(double %.sroa.7.0.copyload, double %54, double %57)
  %59 = getelementptr inbounds double, ptr %13, i64 %52
  %60 = load double, ptr %59, align 8, !tbaa !13
  %61 = call double @llvm.fmuladd.f64(double %.sroa.8.0.copyload, double %60, double %58)
  %62 = getelementptr inbounds double, ptr %15, i64 %52
  %63 = load double, ptr %62, align 8, !tbaa !13
  %64 = call double @llvm.fmuladd.f64(double %.sroa.5.0.copyload, double %63, double %61)
  %65 = call double @llvm.fmuladd.f64(double %31, double %64, double %54)
  %66 = getelementptr inbounds double, ptr %3, i64 %52
  store double %65, ptr %66, align 8, !tbaa !13
  %67 = fmul double %.sroa.0.0.copyload, %63
  %68 = call double @llvm.fmuladd.f64(double %.sroa.9.0.copyload, double %54, double %67)
  %69 = call double @llvm.fmuladd.f64(double %.sroa.10.0.copyload, double %60, double %68)
  %70 = getelementptr inbounds double, ptr %16, i64 %52
  %71 = load double, ptr %70, align 8, !tbaa !13
  %72 = call double @llvm.fmuladd.f64(double %.sroa.5.0.copyload, double %71, double %69)
  %73 = call double @llvm.fmuladd.f64(double %31, double %72, double %60)
  %74 = getelementptr inbounds double, ptr %4, i64 %52
  store double %73, ptr %74, align 8, !tbaa !13
  %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 %scalar.ph, !llvm.loop !21

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %24
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %75 = load i32, ptr %0, align 8, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next55, %76
  br i1 %77, label %24, label %._crit_edge52, !llvm.loop !22

._crit_edge52:                                    ; preds = %._crit_edge, %5
  ret void
}

; 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 willreturn memory(argmem: readwrite) }
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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !11, i64 80}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!11, !11, i64 0}
!14 = !{!8, !8, i64 0}
!15 = !{!16, !11, i64 104}
!16 = !{!"", !8, i64 0, !8, i64 24, !8, i64 48, !8, i64 80, !11, i64 96, !11, i64 104, !10, i64 112}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !18, !19}
!22 = distinct !{!22, !18}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass