; 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.CPDlsProjMemRec = type { i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, i32, i64, i64, i64 }
%struct._DlsMat = type { i32, i32, i32, i32, i32, i32, i32, ptr, i32, 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

declare ptr @N_VGetArrayPointer(ptr noundef) #1

declare double @RSqrt(double noundef) #1

declare double @RAbs(double noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @cpDlsDenseProjDQJac(i32 noundef %0, i32 noundef %1, double noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) #2 {
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, 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 ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  store i32 %0, ptr %10, align 4, !tbaa !5
  store i32 %1, ptr %11, align 4, !tbaa !5
  store double %2, ptr %12, align 8, !tbaa !9
  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 4, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #3
  store i32 0, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #3
  %33 = load ptr, ptr %16, align 8, !tbaa !11
  store ptr %33, ptr %31, align 8, !tbaa !11
  %34 = load ptr, ptr %31, align 8, !tbaa !11
  %35 = getelementptr inbounds %struct.CPodeMemRec, ptr %34, i32 0, i32 136
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  store ptr %36, ptr %32, align 8, !tbaa !11
  %37 = load ptr, ptr %17, align 8, !tbaa !11
  store ptr %37, ptr %26, align 8, !tbaa !11
  %38 = load ptr, ptr %18, align 8, !tbaa !11
  store ptr %38, ptr %27, align 8, !tbaa !11
  %39 = load ptr, ptr %31, align 8, !tbaa !11
  %40 = getelementptr inbounds %struct.CPodeMemRec, ptr %39, i32 0, i32 14
  %41 = load ptr, ptr %40, align 8, !tbaa !16
  %42 = call ptr @N_VGetArrayPointer(ptr noundef %41)
  store ptr %42, ptr %24, align 8, !tbaa !11
  %43 = load ptr, ptr %13, align 8, !tbaa !11
  %44 = call ptr @N_VGetArrayPointer(ptr noundef %43)
  store ptr %44, ptr %23, align 8, !tbaa !11
  %45 = load ptr, ptr %27, align 8, !tbaa !11
  %46 = call ptr @N_VGetArrayPointer(ptr noundef %45)
  store ptr %46, ptr %25, align 8, !tbaa !11
  %47 = load ptr, ptr %31, align 8, !tbaa !11
  %48 = getelementptr inbounds %struct.CPodeMemRec, ptr %47, i32 0, i32 0
  %49 = load double, ptr %48, align 8, !tbaa !17
  %50 = call double @RSqrt(double noundef %49)
  store double %50, ptr %22, align 8, !tbaa !9
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %153, %9
  %52 = load i32, ptr %29, align 4, !tbaa !5
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %55, label %156

55:                                               ; preds = %51
  %56 = load ptr, ptr %23, align 8, !tbaa !11
  %57 = load i32, ptr %29, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds double, ptr %56, i64 %58
  %60 = load double, ptr %59, align 8, !tbaa !9
  store double %60, ptr %21, align 8, !tbaa !9
  %61 = load double, ptr %22, align 8, !tbaa !9
  %62 = load double, ptr %21, align 8, !tbaa !9
  %63 = call double @RAbs(double noundef %62)
  %64 = fmul double %61, %63
  %65 = load ptr, ptr %24, align 8, !tbaa !11
  %66 = load i32, ptr %29, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %65, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !9
  %70 = fdiv double 1.000000e+00, %69
  %71 = fcmp ogt double %64, %70
  br i1 %71, label %72, label %77

72:                                               ; preds = %55
  %73 = load double, ptr %22, align 8, !tbaa !9
  %74 = load double, ptr %21, align 8, !tbaa !9
  %75 = call double @RAbs(double noundef %74)
  %76 = fmul double %73, %75
  br label %84

77:                                               ; preds = %55
  %78 = load ptr, ptr %24, align 8, !tbaa !11
  %79 = load i32, ptr %29, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %78, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = fdiv double 1.000000e+00, %82
  br label %84

84:                                               ; preds = %77, %72
  %85 = phi double [ %76, %72 ], [ %83, %77 ]
  store double %85, ptr %19, align 8, !tbaa !9
  %86 = load double, ptr %21, align 8, !tbaa !9
  %87 = load double, ptr %19, align 8, !tbaa !9
  %88 = fadd double %86, %87
  %89 = load double, ptr %21, align 8, !tbaa !9
  %90 = fsub double %88, %89
  store double %90, ptr %19, align 8, !tbaa !9
  %91 = load double, ptr %19, align 8, !tbaa !9
  %92 = load ptr, ptr %23, align 8, !tbaa !11
  %93 = load i32, ptr %29, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = fadd double %96, %91
  store double %97, ptr %95, align 8, !tbaa !9
  %98 = load ptr, ptr %31, align 8, !tbaa !11
  %99 = getelementptr inbounds %struct.CPodeMemRec, ptr %98, i32 0, i32 52
  %100 = load ptr, ptr %99, align 8, !tbaa !18
  %101 = load double, ptr %12, align 8, !tbaa !9
  %102 = load ptr, ptr %13, align 8, !tbaa !11
  %103 = load ptr, ptr %26, align 8, !tbaa !11
  %104 = load ptr, ptr %31, align 8, !tbaa !11
  %105 = getelementptr inbounds %struct.CPodeMemRec, ptr %104, i32 0, i32 53
  %106 = load ptr, ptr %105, align 8, !tbaa !19
  %107 = call i32 %100(double noundef %101, ptr noundef %102, ptr noundef %103, ptr noundef %106)
  store i32 %107, ptr %30, align 4, !tbaa !5
  %108 = load ptr, ptr %32, align 8, !tbaa !11
  %109 = getelementptr inbounds %struct.CPDlsProjMemRec, ptr %108, i32 0, i32 17
  %110 = load i64, ptr %109, align 8, !tbaa !20
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %109, align 8, !tbaa !20
  %112 = load i32, ptr %30, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %84
  br label %156

115:                                              ; preds = %84
  %116 = load double, ptr %19, align 8, !tbaa !9
  %117 = fdiv double 1.000000e+00, %116
  store double %117, ptr %20, align 8, !tbaa !9
  %118 = load double, ptr %20, align 8, !tbaa !9
  %119 = load ptr, ptr %26, align 8, !tbaa !11
  %120 = load double, ptr %20, align 8, !tbaa !9
  %121 = fneg double %120
  %122 = load ptr, ptr %14, align 8, !tbaa !11
  %123 = load ptr, ptr %27, align 8, !tbaa !11
  call void @N_VLinearSum(double noundef %118, ptr noundef %119, double noundef %121, ptr noundef %122, ptr noundef %123)
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %144, %115
  %125 = load i32, ptr %28, align 4, !tbaa !5
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %128, label %147

128:                                              ; preds = %124
  %129 = load ptr, ptr %25, align 8, !tbaa !11
  %130 = load i32, ptr %28, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !9
  %134 = load ptr, ptr %15, align 8, !tbaa !11
  %135 = getelementptr inbounds %struct._DlsMat, ptr %134, i32 0, i32 9
  %136 = load ptr, ptr %135, align 8, !tbaa !22
  %137 = load i32, ptr %28, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds ptr, ptr %136, i64 %138
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  %141 = load i32, ptr %29, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds double, ptr %140, i64 %142
  store double %133, ptr %143, align 8, !tbaa !9
  br label %144

144:                                              ; preds = %128
  %145 = load i32, ptr %28, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %28, align 4, !tbaa !5
  br label %124, !llvm.loop !24

147:                                              ; preds = %124
  %148 = load double, ptr %21, align 8, !tbaa !9
  %149 = load ptr, ptr %23, align 8, !tbaa !11
  %150 = load i32, ptr %29, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds double, ptr %149, i64 %151
  store double %148, ptr %152, align 8, !tbaa !9
  br label %153

153:                                              ; preds = %147
  %154 = load i32, ptr %29, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %29, align 4, !tbaa !5
  br label %51, !llvm.loop !26

156:                                              ; preds = %114, %51
  %157 = load i32, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 %157
}

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

!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 1512}
!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, !12, i64 800}
!19 = !{!14, !12, i64 808}
!20 = !{!21, !15, i64 120}
!21 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !12, i64 16, !12, i64 24, !6, i64 32, !6, i64 36, !12, i64 40, !12, i64 48, !6, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !6, i64 96, !15, i64 104, !15, i64 112, !15, i64 120}
!22 = !{!23, !12, i64 48}
!23 = !{!"_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}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}


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

declare ptr @N_VGetArrayPointer(ptr noundef) local_unnamed_addr #0

declare double @RSqrt(double noundef) local_unnamed_addr #0

declare double @RAbs(double noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @cpDlsDenseProjDQJac(i32 noundef %0, i32 noundef %1, double noundef %2, ptr noundef %3, ptr noundef %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readonly %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #1 {
  %10 = getelementptr inbounds i8, ptr %6, i64 1512
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %6, i64 200
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = tail call ptr @N_VGetArrayPointer(ptr noundef %13) #2
  %15 = tail call ptr @N_VGetArrayPointer(ptr noundef %3) #2
  %16 = tail call ptr @N_VGetArrayPointer(ptr noundef %8) #2
  %17 = load double, ptr %6, align 8, !tbaa !14
  %18 = tail call double @RSqrt(double noundef %17) #2
  %19 = icmp sgt i32 %1, 0
  br i1 %19, label %.lr.ph59, label %._crit_edge60

.lr.ph59:                                         ; preds = %9
  %20 = getelementptr inbounds i8, ptr %6, i64 800
  %21 = getelementptr inbounds i8, ptr %6, i64 808
  %22 = getelementptr inbounds i8, ptr %11, i64 120
  %23 = icmp sgt i32 %0, 0
  %24 = getelementptr inbounds i8, ptr %5, i64 48
  %wide.trip.count75 = zext nneg i32 %1 to i64
  br i1 %23, label %.lr.ph59.split.us.preheader, label %.lr.ph59.split

.lr.ph59.split.us.preheader:                      ; preds = %.lr.ph59
  %wide.trip.count70 = zext nneg i32 %0 to i64
  %xtraiter = and i64 %wide.trip.count70, 3
  %25 = icmp ult i32 %0, 4
  %unroll_iter = and i64 %wide.trip.count70, 2147483644
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph59.split.us

.lr.ph59.split.us:                                ; preds = %.lr.ph59.split.us.preheader, %._crit_edge.us
  %indvars.iv72 = phi i64 [ 0, %.lr.ph59.split.us.preheader ], [ %indvars.iv.next73, %._crit_edge.us ]
  %26 = getelementptr inbounds double, ptr %15, i64 %indvars.iv72
  %27 = load double, ptr %26, align 8, !tbaa !15
  %28 = tail call double @RAbs(double noundef %27) #2
  %29 = fmul double %18, %28
  %30 = getelementptr inbounds double, ptr %14, i64 %indvars.iv72
  %31 = load double, ptr %30, align 8, !tbaa !15
  %32 = fdiv double 1.000000e+00, %31
  %33 = fcmp ogt double %29, %32
  br i1 %33, label %34, label %37

34:                                               ; preds = %.lr.ph59.split.us
  %35 = tail call double @RAbs(double noundef %27) #2
  %36 = fmul double %18, %35
  br label %37

37:                                               ; preds = %34, %.lr.ph59.split.us
  %38 = phi double [ %36, %34 ], [ %32, %.lr.ph59.split.us ]
  %39 = fadd double %27, %38
  %40 = fsub double %39, %27
  %41 = load double, ptr %26, align 8, !tbaa !15
  %42 = fadd double %41, %40
  store double %42, ptr %26, align 8, !tbaa !15
  %43 = load ptr, ptr %20, align 8, !tbaa !16
  %44 = load ptr, ptr %21, align 8, !tbaa !17
  %45 = tail call i32 %43(double noundef %2, ptr noundef %3, ptr noundef %7, ptr noundef %44) #2
  %46 = load i64, ptr %22, align 8, !tbaa !18
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %22, align 8, !tbaa !18
  %.not.us = icmp eq i32 %45, 0
  br i1 %.not.us, label %.lr.ph.us, label %._crit_edge60

.lr.ph.us:                                        ; preds = %37
  %48 = fdiv double 1.000000e+00, %40
  %49 = fneg double %48
  tail call void @N_VLinearSum(double noundef %48, ptr noundef %7, double noundef %49, ptr noundef %4, ptr noundef %8) #2
  %50 = load ptr, ptr %24, align 8, !tbaa !20
  br i1 %25, label %._crit_edge.us.unr-lcssa, label %.lr.ph.us.new

.lr.ph.us.new:                                    ; preds = %.lr.ph.us, %.lr.ph.us.new
  %indvars.iv67 = phi i64 [ %indvars.iv.next68.3, %.lr.ph.us.new ], [ 0, %.lr.ph.us ]
  %niter = phi i64 [ %niter.next.3, %.lr.ph.us.new ], [ 0, %.lr.ph.us ]
  %51 = getelementptr inbounds double, ptr %16, i64 %indvars.iv67
  %52 = load double, ptr %51, align 8, !tbaa !15
  %53 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv67
  %54 = load ptr, ptr %53, align 8, !tbaa !22
  %55 = getelementptr inbounds double, ptr %54, i64 %indvars.iv72
  store double %52, ptr %55, align 8, !tbaa !15
  %indvars.iv.next68 = or disjoint i64 %indvars.iv67, 1
  %56 = getelementptr inbounds double, ptr %16, i64 %indvars.iv.next68
  %57 = load double, ptr %56, align 8, !tbaa !15
  %58 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv.next68
  %59 = load ptr, ptr %58, align 8, !tbaa !22
  %60 = getelementptr inbounds double, ptr %59, i64 %indvars.iv72
  store double %57, ptr %60, align 8, !tbaa !15
  %indvars.iv.next68.1 = or disjoint i64 %indvars.iv67, 2
  %61 = getelementptr inbounds double, ptr %16, i64 %indvars.iv.next68.1
  %62 = load double, ptr %61, align 8, !tbaa !15
  %63 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv.next68.1
  %64 = load ptr, ptr %63, align 8, !tbaa !22
  %65 = getelementptr inbounds double, ptr %64, i64 %indvars.iv72
  store double %62, ptr %65, align 8, !tbaa !15
  %indvars.iv.next68.2 = or disjoint i64 %indvars.iv67, 3
  %66 = getelementptr inbounds double, ptr %16, i64 %indvars.iv.next68.2
  %67 = load double, ptr %66, align 8, !tbaa !15
  %68 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv.next68.2
  %69 = load ptr, ptr %68, align 8, !tbaa !22
  %70 = getelementptr inbounds double, ptr %69, i64 %indvars.iv72
  store double %67, ptr %70, align 8, !tbaa !15
  %indvars.iv.next68.3 = add nuw nsw i64 %indvars.iv67, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.us.unr-lcssa, label %.lr.ph.us.new, !llvm.loop !23

._crit_edge.us.unr-lcssa:                         ; preds = %.lr.ph.us.new, %.lr.ph.us
  %indvars.iv67.unr = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next68.3, %.lr.ph.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa, %.epil.preheader
  %indvars.iv67.epil = phi i64 [ %indvars.iv.next68.epil, %.epil.preheader ], [ %indvars.iv67.unr, %._crit_edge.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.us.unr-lcssa ]
  %71 = getelementptr inbounds double, ptr %16, i64 %indvars.iv67.epil
  %72 = load double, ptr %71, align 8, !tbaa !15
  %73 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv67.epil
  %74 = load ptr, ptr %73, align 8, !tbaa !22
  %75 = getelementptr inbounds double, ptr %74, i64 %indvars.iv72
  store double %72, ptr %75, align 8, !tbaa !15
  %indvars.iv.next68.epil = add nuw nsw i64 %indvars.iv67.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge.us, label %.epil.preheader, !llvm.loop !25

._crit_edge.us:                                   ; preds = %.epil.preheader, %._crit_edge.us.unr-lcssa
  store double %27, ptr %26, align 8, !tbaa !15
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75
  br i1 %exitcond76.not, label %._crit_edge60, label %.lr.ph59.split.us, !llvm.loop !27

.lr.ph59.split:                                   ; preds = %.lr.ph59, %98
  %indvars.iv = phi i64 [ %indvars.iv.next, %98 ], [ 0, %.lr.ph59 ]
  %76 = getelementptr inbounds double, ptr %15, i64 %indvars.iv
  %77 = load double, ptr %76, align 8, !tbaa !15
  %78 = tail call double @RAbs(double noundef %77) #2
  %79 = fmul double %18, %78
  %80 = getelementptr inbounds double, ptr %14, i64 %indvars.iv
  %81 = load double, ptr %80, align 8, !tbaa !15
  %82 = fdiv double 1.000000e+00, %81
  %83 = fcmp ogt double %79, %82
  br i1 %83, label %84, label %87

84:                                               ; preds = %.lr.ph59.split
  %85 = tail call double @RAbs(double noundef %77) #2
  %86 = fmul double %18, %85
  br label %87

87:                                               ; preds = %.lr.ph59.split, %84
  %88 = phi double [ %86, %84 ], [ %82, %.lr.ph59.split ]
  %89 = fadd double %77, %88
  %90 = fsub double %89, %77
  %91 = load double, ptr %76, align 8, !tbaa !15
  %92 = fadd double %91, %90
  store double %92, ptr %76, align 8, !tbaa !15
  %93 = load ptr, ptr %20, align 8, !tbaa !16
  %94 = load ptr, ptr %21, align 8, !tbaa !17
  %95 = tail call i32 %93(double noundef %2, ptr noundef %3, ptr noundef %7, ptr noundef %94) #2
  %96 = load i64, ptr %22, align 8, !tbaa !18
  %97 = add nsw i64 %96, 1
  store i64 %97, ptr %22, align 8, !tbaa !18
  %.not = icmp eq i32 %95, 0
  br i1 %.not, label %98, label %._crit_edge60

98:                                               ; preds = %87
  %99 = fdiv double 1.000000e+00, %90
  %100 = fneg double %99
  tail call void @N_VLinearSum(double noundef %99, ptr noundef %7, double noundef %100, ptr noundef %4, ptr noundef %8) #2
  store double %77, ptr %76, align 8, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count75
  br i1 %exitcond.not, label %._crit_edge60, label %.lr.ph59.split, !llvm.loop !27

._crit_edge60:                                    ; preds = %98, %87, %._crit_edge.us, %37, %9
  %.1 = phi i32 [ 0, %9 ], [ %45, %37 ], [ 0, %._crit_edge.us ], [ %95, %87 ], [ 0, %98 ]
  ret i32 %.1
}

attributes #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 = { 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 = { 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 1512}
!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 = !{!7, !7, i64 0}
!16 = !{!6, !11, i64 800}
!17 = !{!6, !11, i64 808}
!18 = !{!19, !12, i64 120}
!19 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !11, i64 16, !11, i64 24, !10, i64 32, !10, i64 36, !11, i64 40, !11, i64 48, !10, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !10, i64 96, !12, i64 104, !12, i64 112, !12, i64 120}
!20 = !{!21, !11, i64 48}
!21 = !{!"_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}
!22 = !{!11, !11, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.unroll.disable"}
!27 = distinct !{!27, !24}


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