; LLVM IR from simbody/simbody :: SimTKmath/Integrators/src/CPodes/sundials/src/cpodes (cpodes_direct)

; 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.CPodeMemRec = type { double, i32, ptr, ptr, ptr, i32, i32, i32, double, double, ptr, ptr, ptr, [13 x ptr], ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, double, [14 x double], [6 x double], [13 x double], [13 x double], double, double, double, double, double, double, double, i32, i32, i32, i32, i64, i64, i32, i32, ptr, ptr, ptr, ptr, double, ptr, ptr, ptr, i64, i64, double, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i64, i64, i64, i64, i32, i32, ptr, ptr, i32, i32, double, double, ptr, [13 x ptr], ptr, ptr, ptr, ptr, double, i64, i64, i32, i32, i32, i64, i64, i32, i32, double, i32, i64, i32, i32, i32, i32, double, double, double, i64, i64, i64, i64, i64, i64, i32, double, double, double, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, double, double, double, i32, double, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, [6 x [4 x double]], i32, i64, i32, ptr, i32, ptr, ptr, ptr, ptr, double, double, double, ptr, ptr, ptr, double, i32, i32, i64, double, double, i32, i32, ptr, ptr }
%struct._DlsMat = type { i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr }
%struct.CPDlsMemRec = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i32 }

; 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
define dso_local i32 @cpDlsDenseDQJacExpl(i32 noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) #1 {
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  store i32 %0, ptr %10, align 4, !tbaa !5
  store double %1, ptr %11, align 8, !tbaa !9
  store ptr %2, ptr %12, align 8, !tbaa !11
  store ptr %3, ptr %13, align 8, !tbaa !11
  store ptr %4, ptr %14, align 8, !tbaa !11
  store ptr %5, ptr %15, align 8, !tbaa !11
  store ptr %6, ptr %16, align 8, !tbaa !11
  store ptr %7, ptr %17, align 8, !tbaa !11
  store ptr %8, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #3
  store i32 0, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #3
  %34 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %34, ptr %32, align 8, !tbaa !11
  %35 = load ptr, ptr %32, align 8, !tbaa !11
  %36 = getelementptr inbounds %struct.CPodeMemRec, ptr %35, i32 0, i32 129
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  store ptr %37, ptr %33, align 8, !tbaa !11
  %38 = load ptr, ptr %17, align 8, !tbaa !11
  %39 = call ptr @N_VGetArrayPointer(ptr noundef %38)
  store ptr %39, ptr %25, align 8, !tbaa !11
  %40 = load ptr, ptr %16, align 8, !tbaa !11
  store ptr %40, ptr %28, align 8, !tbaa !11
  %41 = load ptr, ptr %17, align 8, !tbaa !11
  store ptr %41, ptr %29, align 8, !tbaa !11
  %42 = load ptr, ptr %32, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct.CPodeMemRec, ptr %42, i32 0, i32 14
  %44 = load ptr, ptr %43, align 8, !tbaa !16
  %45 = call ptr @N_VGetArrayPointer(ptr noundef %44)
  store ptr %45, ptr %27, align 8, !tbaa !11
  %46 = load ptr, ptr %12, align 8, !tbaa !11
  %47 = call ptr @N_VGetArrayPointer(ptr noundef %46)
  store ptr %47, ptr %26, align 8, !tbaa !11
  %48 = load ptr, ptr %32, align 8, !tbaa !11
  %49 = getelementptr inbounds %struct.CPodeMemRec, ptr %48, i32 0, i32 0
  %50 = load double, ptr %49, align 8, !tbaa !17
  %51 = call double @RSqrt(double noundef %50)
  store double %51, ptr %24, align 8, !tbaa !9
  %52 = load ptr, ptr %13, align 8, !tbaa !11
  %53 = load ptr, ptr %32, align 8, !tbaa !11
  %54 = getelementptr inbounds %struct.CPodeMemRec, ptr %53, i32 0, i32 14
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = call double @N_VWrmsNorm(ptr noundef %52, ptr noundef %55)
  store double %56, ptr %19, align 8, !tbaa !9
  %57 = load double, ptr %19, align 8, !tbaa !9
  %58 = fcmp une double %57, 0.000000e+00
  br i1 %58, label %59, label %74

59:                                               ; preds = %9
  %60 = load ptr, ptr %32, align 8, !tbaa !11
  %61 = getelementptr inbounds %struct.CPodeMemRec, ptr %60, i32 0, i32 26
  %62 = load double, ptr %61, align 8, !tbaa !18
  %63 = call double @RAbs(double noundef %62)
  %64 = fmul double 1.000000e+03, %63
  %65 = load ptr, ptr %32, align 8, !tbaa !11
  %66 = getelementptr inbounds %struct.CPodeMemRec, ptr %65, i32 0, i32 0
  %67 = load double, ptr %66, align 8, !tbaa !17
  %68 = fmul double %64, %67
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = sitofp i32 %69 to double
  %71 = fmul double %68, %70
  %72 = load double, ptr %19, align 8, !tbaa !9
  %73 = fmul double %71, %72
  br label %75

74:                                               ; preds = %9
  br label %75

75:                                               ; preds = %74, %59
  %76 = phi double [ %73, %59 ], [ 1.000000e+00, %74 ]
  store double %76, ptr %20, align 8, !tbaa !9
  store i32 0, ptr %30, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %168, %75
  %78 = load i32, ptr %30, align 4, !tbaa !5
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %81, label %171

81:                                               ; preds = %77
  %82 = load ptr, ptr %14, align 8, !tbaa !11
  %83 = getelementptr inbounds %struct._DlsMat, ptr %82, i32 0, i32 9
  %84 = load ptr, ptr %83, align 8, !tbaa !19
  %85 = load i32, ptr %30, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds ptr, ptr %84, i64 %86
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  %89 = load ptr, ptr %29, align 8, !tbaa !11
  call void @N_VSetArrayPointer(ptr noundef %88, ptr noundef %89)
  %90 = load ptr, ptr %26, align 8, !tbaa !11
  %91 = load i32, ptr %30, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %90, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !9
  store double %94, ptr %23, align 8, !tbaa !9
  %95 = load double, ptr %24, align 8, !tbaa !9
  %96 = load double, ptr %23, align 8, !tbaa !9
  %97 = call double @RAbs(double noundef %96)
  %98 = fmul double %95, %97
  %99 = load double, ptr %20, align 8, !tbaa !9
  %100 = load ptr, ptr %27, align 8, !tbaa !11
  %101 = load i32, ptr %30, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %100, i64 %102
  %104 = load double, ptr %103, align 8, !tbaa !9
  %105 = fdiv double %99, %104
  %106 = fcmp ogt double %98, %105
  br i1 %106, label %107, label %112

107:                                              ; preds = %81
  %108 = load double, ptr %24, align 8, !tbaa !9
  %109 = load double, ptr %23, align 8, !tbaa !9
  %110 = call double @RAbs(double noundef %109)
  %111 = fmul double %108, %110
  br label %120

112:                                              ; preds = %81
  %113 = load double, ptr %20, align 8, !tbaa !9
  %114 = load ptr, ptr %27, align 8, !tbaa !11
  %115 = load i32, ptr %30, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds double, ptr %114, i64 %116
  %118 = load double, ptr %117, align 8, !tbaa !9
  %119 = fdiv double %113, %118
  br label %120

120:                                              ; preds = %112, %107
  %121 = phi double [ %111, %107 ], [ %119, %112 ]
  store double %121, ptr %21, align 8, !tbaa !9
  %122 = load double, ptr %21, align 8, !tbaa !9
  %123 = load ptr, ptr %26, align 8, !tbaa !11
  %124 = load i32, ptr %30, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %123, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !9
  %128 = fadd double %127, %122
  store double %128, ptr %126, align 8, !tbaa !9
  %129 = load ptr, ptr %32, align 8, !tbaa !11
  %130 = getelementptr inbounds %struct.CPodeMemRec, ptr %129, i32 0, i32 3
  %131 = load ptr, ptr %130, align 8, !tbaa !21
  %132 = load double, ptr %11, align 8, !tbaa !9
  %133 = load ptr, ptr %12, align 8, !tbaa !11
  %134 = load ptr, ptr %28, align 8, !tbaa !11
  %135 = load ptr, ptr %32, align 8, !tbaa !11
  %136 = getelementptr inbounds %struct.CPodeMemRec, ptr %135, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !22
  %138 = call i32 %131(double noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef %137)
  store i32 %138, ptr %31, align 4, !tbaa !5
  %139 = load ptr, ptr %33, align 8, !tbaa !11
  %140 = getelementptr inbounds %struct.CPDlsMemRec, ptr %139, i32 0, i32 15
  %141 = load i64, ptr %140, align 8, !tbaa !23
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %140, align 8, !tbaa !23
  %143 = load i32, ptr %31, align 4, !tbaa !5
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %120
  br label %171

146:                                              ; preds = %120
  %147 = load double, ptr %23, align 8, !tbaa !9
  %148 = load ptr, ptr %26, align 8, !tbaa !11
  %149 = load i32, ptr %30, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds double, ptr %148, i64 %150
  store double %147, ptr %151, align 8, !tbaa !9
  %152 = load double, ptr %21, align 8, !tbaa !9
  %153 = fdiv double 1.000000e+00, %152
  store double %153, ptr %22, align 8, !tbaa !9
  %154 = load double, ptr %22, align 8, !tbaa !9
  %155 = load ptr, ptr %28, align 8, !tbaa !11
  %156 = load double, ptr %22, align 8, !tbaa !9
  %157 = fneg double %156
  %158 = load ptr, ptr %13, align 8, !tbaa !11
  %159 = load ptr, ptr %29, align 8, !tbaa !11
  call void @N_VLinearSum(double noundef %154, ptr noundef %155, double noundef %157, ptr noundef %158, ptr noundef %159)
  %160 = load ptr, ptr %29, align 8, !tbaa !11
  %161 = call ptr @N_VGetArrayPointer(ptr noundef %160)
  %162 = load ptr, ptr %14, align 8, !tbaa !11
  %163 = getelementptr inbounds %struct._DlsMat, ptr %162, i32 0, i32 9
  %164 = load ptr, ptr %163, align 8, !tbaa !19
  %165 = load i32, ptr %30, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds ptr, ptr %164, i64 %166
  store ptr %161, ptr %167, align 8, !tbaa !11
  br label %168

168:                                              ; preds = %146
  %169 = load i32, ptr %30, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %30, align 4, !tbaa !5
  br label %77, !llvm.loop !25

171:                                              ; preds = %145, %77
  %172 = load ptr, ptr %25, align 8, !tbaa !11
  %173 = load ptr, ptr %17, align 8, !tbaa !11
  call void @N_VSetArrayPointer(ptr noundef %172, ptr noundef %173)
  %174 = load i32, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  ret i32 %174
}

declare ptr @N_VGetArrayPointer(ptr noundef) #2

declare double @RSqrt(double noundef) #2

declare double @N_VWrmsNorm(ptr noundef, ptr noundef) #2

declare double @RAbs(double noundef) #2

declare void @N_VSetArrayPointer(ptr noundef, ptr noundef) #2

declare void @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) #2

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 = { "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 }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !12, i64 1456}
!14 = !{!"CPodeMemRec", !10, i64 0, !6, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !6, i64 40, !6, i64 44, !6, i64 48, !10, i64 56, !10, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !7, i64 96, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !6, i64 248, !6, i64 252, !6, i64 256, !6, i64 260, !6, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !7, i64 336, !7, i64 448, !7, i64 496, !7, i64 600, !10, i64 704, !10, i64 712, !10, i64 720, !10, i64 728, !10, i64 736, !10, i64 744, !10, i64 752, !6, i64 760, !6, i64 764, !6, i64 768, !6, i64 772, !15, i64 776, !15, i64 784, !6, i64 792, !6, i64 796, !12, i64 800, !12, i64 808, !12, i64 816, !12, i64 824, !10, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !15, i64 864, !15, i64 872, !10, i64 880, !6, i64 888, !6, i64 892, !6, i64 896, !12, i64 904, !12, i64 912, !12, i64 920, !12, i64 928, !6, i64 936, !15, i64 944, !15, i64 952, !15, i64 960, !15, i64 968, !6, i64 976, !6, i64 980, !12, i64 984, !12, i64 992, !6, i64 1000, !6, i64 1004, !10, i64 1008, !10, i64 1016, !12, i64 1024, !7, i64 1032, !12, i64 1136, !12, i64 1144, !12, i64 1152, !12, i64 1160, !10, i64 1168, !15, i64 1176, !15, i64 1184, !6, i64 1192, !6, i64 1196, !6, i64 1200, !15, i64 1208, !15, i64 1216, !6, i64 1224, !6, i64 1228, !10, i64 1232, !6, i64 1240, !15, i64 1248, !6, i64 1256, !6, i64 1260, !6, i64 1264, !6, i64 1268, !10, i64 1272, !10, i64 1280, !10, i64 1288, !15, i64 1296, !15, i64 1304, !15, i64 1312, !15, i64 1320, !15, i64 1328, !15, i64 1336, !6, i64 1344, !10, i64 1352, !10, i64 1360, !10, i64 1368, !15, i64 1376, !15, i64 1384, !15, i64 1392, !15, i64 1400, !15, i64 1408, !15, i64 1416, !12, i64 1424, !12, i64 1432, !12, i64 1440, !12, i64 1448, !12, i64 1456, !6, i64 1464, !12, i64 1472, !12, i64 1480, !12, i64 1488, !12, i64 1496, !12, i64 1504, !12, i64 1512, !6, i64 1520, !6, i64 1524, !15, i64 1528, !10, i64 1536, !10, i64 1544, !10, i64 1552, !6, i64 1560, !10, i64 1568, !6, i64 1576, !6, i64 1580, !6, i64 1584, !6, i64 1588, !6, i64 1592, !6, i64 1596, !12, i64 1600, !12, i64 1608, !12, i64 1616, !6, i64 1624, !7, i64 1632, !6, i64 1824, !15, i64 1832, !6, i64 1840, !12, i64 1848, !6, i64 1856, !12, i64 1864, !12, i64 1872, !12, i64 1880, !12, i64 1888, !10, i64 1896, !10, i64 1904, !10, i64 1912, !12, i64 1920, !12, i64 1928, !12, i64 1936, !10, i64 1944, !6, i64 1952, !6, i64 1956, !15, i64 1960, !10, i64 1968, !10, i64 1976, !6, i64 1984, !6, i64 1988, !12, i64 1992, !12, i64 2000}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !12, i64 200}
!17 = !{!14, !10, i64 0}
!18 = !{!14, !10, i64 280}
!19 = !{!20, !12, i64 48}
!20 = !{!"_DlsMat", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !12, i64 32, !6, i64 40, !12, i64 48}
!21 = !{!14, !12, i64 24}
!22 = !{!14, !12, i64 32}
!23 = !{!24, !15, i64 104}
!24 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !15, i64 88, !15, i64 96, !15, i64 104, !6, i64 112}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; 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: nounwind uwtable
define dso_local i32 @cpDlsDenseDQJacExpl(i32 noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readonly %5, ptr noundef %6, ptr noundef %7, ptr nocapture noundef readnone %8) local_unnamed_addr #0 {
  %10 = getelementptr inbounds i8, ptr %5, i64 1456
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = tail call ptr @N_VGetArrayPointer(ptr noundef %7) #2
  %13 = getelementptr inbounds i8, ptr %5, i64 200
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = tail call ptr @N_VGetArrayPointer(ptr noundef %14) #2
  %16 = tail call ptr @N_VGetArrayPointer(ptr noundef %2) #2
  %17 = load double, ptr %5, align 8, !tbaa !14
  %18 = tail call double @RSqrt(double noundef %17) #2
  %19 = load ptr, ptr %13, align 8, !tbaa !13
  %20 = tail call double @N_VWrmsNorm(ptr noundef %3, ptr noundef %19) #2
  %21 = fcmp une double %20, 0.000000e+00
  br i1 %21, label %22, label %32

22:                                               ; preds = %9
  %23 = getelementptr inbounds i8, ptr %5, i64 280
  %24 = load double, ptr %23, align 8, !tbaa !15
  %25 = tail call double @RAbs(double noundef %24) #2
  %26 = fmul double %25, 1.000000e+03
  %27 = load double, ptr %5, align 8, !tbaa !14
  %28 = fmul double %26, %27
  %29 = sitofp i32 %0 to double
  %30 = fmul double %28, %29
  %31 = fmul double %20, %30
  br label %32

32:                                               ; preds = %9, %22
  %33 = phi double [ %31, %22 ], [ 1.000000e+00, %9 ]
  %34 = icmp sgt i32 %0, 0
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %32
  %35 = getelementptr inbounds i8, ptr %4, i64 48
  %36 = getelementptr inbounds i8, ptr %5, i64 24
  %37 = getelementptr inbounds i8, ptr %5, i64 32
  %38 = getelementptr inbounds i8, ptr %11, i64 104
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %39

39:                                               ; preds = %.lr.ph, %63
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %63 ]
  %40 = load ptr, ptr %35, align 8, !tbaa !16
  %41 = getelementptr inbounds ptr, ptr %40, i64 %indvars.iv
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  tail call void @N_VSetArrayPointer(ptr noundef %42, ptr noundef %7) #2
  %43 = getelementptr inbounds double, ptr %16, i64 %indvars.iv
  %44 = load double, ptr %43, align 8, !tbaa !19
  %45 = tail call double @RAbs(double noundef %44) #2
  %46 = fmul double %18, %45
  %47 = getelementptr inbounds double, ptr %15, i64 %indvars.iv
  %48 = load double, ptr %47, align 8, !tbaa !19
  %49 = fdiv double %33, %48
  %50 = fcmp ogt double %46, %49
  br i1 %50, label %51, label %54

51:                                               ; preds = %39
  %52 = tail call double @RAbs(double noundef %44) #2
  %53 = fmul double %18, %52
  br label %54

54:                                               ; preds = %39, %51
  %55 = phi double [ %53, %51 ], [ %49, %39 ]
  %56 = load double, ptr %43, align 8, !tbaa !19
  %57 = fadd double %55, %56
  store double %57, ptr %43, align 8, !tbaa !19
  %58 = load ptr, ptr %36, align 8, !tbaa !20
  %59 = load ptr, ptr %37, align 8, !tbaa !21
  %60 = tail call i32 %58(double noundef %1, ptr noundef %2, ptr noundef %6, ptr noundef %59) #2
  %61 = load i64, ptr %38, align 8, !tbaa !22
  %62 = add nsw i64 %61, 1
  store i64 %62, ptr %38, align 8, !tbaa !22
  %.not = icmp eq i32 %60, 0
  br i1 %.not, label %63, label %._crit_edge

63:                                               ; preds = %54
  store double %44, ptr %43, align 8, !tbaa !19
  %64 = fdiv double 1.000000e+00, %55
  %65 = fneg double %64
  tail call void @N_VLinearSum(double noundef %64, ptr noundef %6, double noundef %65, ptr noundef %3, ptr noundef %7) #2
  %66 = tail call ptr @N_VGetArrayPointer(ptr noundef %7) #2
  %67 = load ptr, ptr %35, align 8, !tbaa !16
  %68 = getelementptr inbounds ptr, ptr %67, i64 %indvars.iv
  store ptr %66, ptr %68, align 8, !tbaa !18
  %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 %39, !llvm.loop !24

._crit_edge:                                      ; preds = %63, %54, %32
  %.1 = phi i32 [ 0, %32 ], [ %60, %54 ], [ 0, %63 ]
  tail call void @N_VSetArrayPointer(ptr noundef %12, ptr noundef %7) #2
  ret i32 %.1
}

declare ptr @N_VGetArrayPointer(ptr noundef) local_unnamed_addr #1

declare double @RSqrt(double noundef) local_unnamed_addr #1

declare double @N_VWrmsNorm(ptr noundef, ptr noundef) local_unnamed_addr #1

declare double @RAbs(double noundef) local_unnamed_addr #1

declare void @N_VSetArrayPointer(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { "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 = { 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, !11, i64 1456}
!6 = !{!"CPodeMemRec", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !7, i64 56, !7, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !8, i64 96, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !10, i64 248, !10, i64 252, !10, i64 256, !10, i64 260, !10, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !8, i64 336, !8, i64 448, !8, i64 496, !8, i64 600, !7, i64 704, !7, i64 712, !7, i64 720, !7, i64 728, !7, i64 736, !7, i64 744, !7, i64 752, !10, i64 760, !10, i64 764, !10, i64 768, !10, i64 772, !12, i64 776, !12, i64 784, !10, i64 792, !10, i64 796, !11, i64 800, !11, i64 808, !11, i64 816, !11, i64 824, !7, i64 832, !11, i64 840, !11, i64 848, !11, i64 856, !12, i64 864, !12, i64 872, !7, i64 880, !10, i64 888, !10, i64 892, !10, i64 896, !11, i64 904, !11, i64 912, !11, i64 920, !11, i64 928, !10, i64 936, !12, i64 944, !12, i64 952, !12, i64 960, !12, i64 968, !10, i64 976, !10, i64 980, !11, i64 984, !11, i64 992, !10, i64 1000, !10, i64 1004, !7, i64 1008, !7, i64 1016, !11, i64 1024, !8, i64 1032, !11, i64 1136, !11, i64 1144, !11, i64 1152, !11, i64 1160, !7, i64 1168, !12, i64 1176, !12, i64 1184, !10, i64 1192, !10, i64 1196, !10, i64 1200, !12, i64 1208, !12, i64 1216, !10, i64 1224, !10, i64 1228, !7, i64 1232, !10, i64 1240, !12, i64 1248, !10, i64 1256, !10, i64 1260, !10, i64 1264, !10, i64 1268, !7, i64 1272, !7, i64 1280, !7, i64 1288, !12, i64 1296, !12, i64 1304, !12, i64 1312, !12, i64 1320, !12, i64 1328, !12, i64 1336, !10, i64 1344, !7, i64 1352, !7, i64 1360, !7, i64 1368, !12, i64 1376, !12, i64 1384, !12, i64 1392, !12, i64 1400, !12, i64 1408, !12, i64 1416, !11, i64 1424, !11, i64 1432, !11, i64 1440, !11, i64 1448, !11, i64 1456, !10, i64 1464, !11, i64 1472, !11, i64 1480, !11, i64 1488, !11, i64 1496, !11, i64 1504, !11, i64 1512, !10, i64 1520, !10, i64 1524, !12, i64 1528, !7, i64 1536, !7, i64 1544, !7, i64 1552, !10, i64 1560, !7, i64 1568, !10, i64 1576, !10, i64 1580, !10, i64 1584, !10, i64 1588, !10, i64 1592, !10, i64 1596, !11, i64 1600, !11, i64 1608, !11, i64 1616, !10, i64 1624, !8, i64 1632, !10, i64 1824, !12, i64 1832, !10, i64 1840, !11, i64 1848, !10, i64 1856, !11, i64 1864, !11, i64 1872, !11, i64 1880, !11, i64 1888, !7, i64 1896, !7, i64 1904, !7, i64 1912, !11, i64 1920, !11, i64 1928, !11, i64 1936, !7, i64 1944, !10, i64 1952, !10, i64 1956, !12, i64 1960, !7, i64 1968, !7, i64 1976, !10, i64 1984, !10, i64 1988, !11, i64 1992, !11, i64 2000}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !11, i64 200}
!14 = !{!6, !7, i64 0}
!15 = !{!6, !7, i64 280}
!16 = !{!17, !11, i64 48}
!17 = !{!"_DlsMat", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !11, i64 32, !10, i64 40, !11, i64 48}
!18 = !{!11, !11, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !11, i64 24}
!21 = !{!6, !11, i64 32}
!22 = !{!23, !12, i64 104}
!23 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !10, i64 112}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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