; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/src/cvodes (cvodes_ls)

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

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

declare void @N_VDestroy(ptr noundef) #1

; Function Attrs: nounwind
declare double @sqrt(double noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @cvLsDenseDQJac(double noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #3 {
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  store double %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !11
  store ptr null, ptr %22, align 8, !tbaa !9
  %29 = load ptr, ptr %11, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.CVodeMemRec, ptr %29, i32 0, i32 174
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  store ptr %31, ptr %27, align 8, !tbaa !9
  %32 = load ptr, ptr %10, align 8, !tbaa !9
  %33 = call i64 @SUNDenseMatrix_Columns(ptr noundef %32)
  store i64 %33, ptr %26, align 8, !tbaa !16
  %34 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %34, ptr %23, align 8, !tbaa !9
  %35 = load ptr, ptr %12, align 8, !tbaa !9
  %36 = call ptr @N_VCloneEmpty(ptr noundef %35)
  store ptr %36, ptr %24, align 8, !tbaa !9
  %37 = load ptr, ptr %11, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.CVodeMemRec, ptr %37, i32 0, i32 52
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = call ptr @N_VGetArrayPointer(ptr noundef %39)
  store ptr %40, ptr %21, align 8, !tbaa !9
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  %42 = call ptr @N_VGetArrayPointer(ptr noundef %41)
  store ptr %42, ptr %20, align 8, !tbaa !9
  %43 = load ptr, ptr %11, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.CVodeMemRec, ptr %43, i32 0, i32 13
  %45 = load i32, ptr %44, align 8, !tbaa !18
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %52

47:                                               ; preds = %6
  %48 = load ptr, ptr %11, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.CVodeMemRec, ptr %48, i32 0, i32 60
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  %51 = call ptr @N_VGetArrayPointer(ptr noundef %50)
  store ptr %51, ptr %22, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %47, %6
  %53 = load ptr, ptr %11, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.CVodeMemRec, ptr %53, i32 0, i32 1
  %55 = load double, ptr %54, align 8, !tbaa !20
  %56 = fcmp ole double %55, 0.000000e+00
  br i1 %56, label %57, label %58

57:                                               ; preds = %52
  br label %63

58:                                               ; preds = %52
  %59 = load ptr, ptr %11, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.CVodeMemRec, ptr %59, i32 0, i32 1
  %61 = load double, ptr %60, align 8, !tbaa !20
  %62 = call double @sqrt(double noundef %61) #5
  br label %63

63:                                               ; preds = %58, %57
  %64 = phi double [ 0.000000e+00, %57 ], [ %62, %58 ]
  store double %64, ptr %18, align 8, !tbaa !5
  %65 = load ptr, ptr %9, align 8, !tbaa !9
  %66 = load ptr, ptr %11, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct.CVodeMemRec, ptr %66, i32 0, i32 52
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = call double @N_VWrmsNorm(ptr noundef %65, ptr noundef %68)
  store double %69, ptr %13, align 8, !tbaa !5
  %70 = load double, ptr %13, align 8, !tbaa !5
  %71 = fcmp une double %70, 0.000000e+00
  br i1 %71, label %72, label %87

72:                                               ; preds = %63
  %73 = load ptr, ptr %11, align 8, !tbaa !9
  %74 = getelementptr inbounds %struct.CVodeMemRec, ptr %73, i32 0, i32 87
  %75 = load double, ptr %74, align 8, !tbaa !21
  %76 = call double @llvm.fabs.f64(double %75)
  %77 = fmul double 1.000000e+03, %76
  %78 = load ptr, ptr %11, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.CVodeMemRec, ptr %78, i32 0, i32 1
  %80 = load double, ptr %79, align 8, !tbaa !20
  %81 = fmul double %77, %80
  %82 = load i64, ptr %26, align 8, !tbaa !16
  %83 = sitofp i64 %82 to double
  %84 = fmul double %81, %83
  %85 = load double, ptr %13, align 8, !tbaa !5
  %86 = fmul double %84, %85
  br label %88

87:                                               ; preds = %63
  br label %88

88:                                               ; preds = %87, %72
  %89 = phi double [ %86, %72 ], [ 1.000000e+00, %87 ]
  store double %89, ptr %14, align 8, !tbaa !5
  store i64 0, ptr %25, align 8, !tbaa !16
  br label %90

90:                                               ; preds = %205, %88
  %91 = load i64, ptr %25, align 8, !tbaa !16
  %92 = load i64, ptr %26, align 8, !tbaa !16
  %93 = icmp slt i64 %91, %92
  br i1 %93, label %94, label %208

94:                                               ; preds = %90
  %95 = load ptr, ptr %10, align 8, !tbaa !9
  %96 = load i64, ptr %25, align 8, !tbaa !16
  %97 = call ptr @SUNDenseMatrix_Column(ptr noundef %95, i64 noundef %96)
  %98 = load ptr, ptr %24, align 8, !tbaa !9
  call void @N_VSetArrayPointer(ptr noundef %97, ptr noundef %98)
  %99 = load ptr, ptr %20, align 8, !tbaa !9
  %100 = load i64, ptr %25, align 8, !tbaa !16
  %101 = getelementptr inbounds double, ptr %99, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !5
  store double %102, ptr %17, align 8, !tbaa !5
  %103 = load double, ptr %18, align 8, !tbaa !5
  %104 = load double, ptr %17, align 8, !tbaa !5
  %105 = call double @llvm.fabs.f64(double %104)
  %106 = fmul double %103, %105
  %107 = load double, ptr %14, align 8, !tbaa !5
  %108 = load ptr, ptr %21, align 8, !tbaa !9
  %109 = load i64, ptr %25, align 8, !tbaa !16
  %110 = getelementptr inbounds double, ptr %108, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !5
  %112 = fdiv double %107, %111
  %113 = fcmp ogt double %106, %112
  br i1 %113, label %114, label %119

114:                                              ; preds = %94
  %115 = load double, ptr %18, align 8, !tbaa !5
  %116 = load double, ptr %17, align 8, !tbaa !5
  %117 = call double @llvm.fabs.f64(double %116)
  %118 = fmul double %115, %117
  br label %126

119:                                              ; preds = %94
  %120 = load double, ptr %14, align 8, !tbaa !5
  %121 = load ptr, ptr %21, align 8, !tbaa !9
  %122 = load i64, ptr %25, align 8, !tbaa !16
  %123 = getelementptr inbounds double, ptr %121, i64 %122
  %124 = load double, ptr %123, align 8, !tbaa !5
  %125 = fdiv double %120, %124
  br label %126

126:                                              ; preds = %119, %114
  %127 = phi double [ %118, %114 ], [ %125, %119 ]
  store double %127, ptr %15, align 8, !tbaa !5
  %128 = load ptr, ptr %11, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct.CVodeMemRec, ptr %128, i32 0, i32 13
  %130 = load i32, ptr %129, align 8, !tbaa !18
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %168

132:                                              ; preds = %126
  %133 = load ptr, ptr %22, align 8, !tbaa !9
  %134 = load i64, ptr %25, align 8, !tbaa !16
  %135 = getelementptr inbounds double, ptr %133, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !5
  store double %136, ptr %19, align 8, !tbaa !5
  %137 = load double, ptr %19, align 8, !tbaa !5
  %138 = call double @llvm.fabs.f64(double %137)
  %139 = fcmp oeq double %138, 1.000000e+00
  br i1 %139, label %140, label %151

140:                                              ; preds = %132
  %141 = load double, ptr %17, align 8, !tbaa !5
  %142 = load double, ptr %15, align 8, !tbaa !5
  %143 = fadd double %141, %142
  %144 = load double, ptr %19, align 8, !tbaa !5
  %145 = fmul double %143, %144
  %146 = fcmp olt double %145, 0.000000e+00
  br i1 %146, label %147, label %150

147:                                              ; preds = %140
  %148 = load double, ptr %15, align 8, !tbaa !5
  %149 = fneg double %148
  store double %149, ptr %15, align 8, !tbaa !5
  br label %150

150:                                              ; preds = %147, %140
  br label %167

151:                                              ; preds = %132
  %152 = load double, ptr %19, align 8, !tbaa !5
  %153 = call double @llvm.fabs.f64(double %152)
  %154 = fcmp oeq double %153, 2.000000e+00
  br i1 %154, label %155, label %166

155:                                              ; preds = %151
  %156 = load double, ptr %17, align 8, !tbaa !5
  %157 = load double, ptr %15, align 8, !tbaa !5
  %158 = fadd double %156, %157
  %159 = load double, ptr %19, align 8, !tbaa !5
  %160 = fmul double %158, %159
  %161 = fcmp ole double %160, 0.000000e+00
  br i1 %161, label %162, label %165

162:                                              ; preds = %155
  %163 = load double, ptr %15, align 8, !tbaa !5
  %164 = fneg double %163
  store double %164, ptr %15, align 8, !tbaa !5
  br label %165

165:                                              ; preds = %162, %155
  br label %166

166:                                              ; preds = %165, %151
  br label %167

167:                                              ; preds = %166, %150
  br label %168

168:                                              ; preds = %167, %126
  %169 = load double, ptr %15, align 8, !tbaa !5
  %170 = load ptr, ptr %20, align 8, !tbaa !9
  %171 = load i64, ptr %25, align 8, !tbaa !16
  %172 = getelementptr inbounds double, ptr %170, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !5
  %174 = fadd double %173, %169
  store double %174, ptr %172, align 8, !tbaa !5
  %175 = load ptr, ptr %11, align 8, !tbaa !9
  %176 = getelementptr inbounds %struct.CVodeMemRec, ptr %175, i32 0, i32 2
  %177 = load ptr, ptr %176, align 8, !tbaa !22
  %178 = load double, ptr %7, align 8, !tbaa !5
  %179 = load ptr, ptr %8, align 8, !tbaa !9
  %180 = load ptr, ptr %23, align 8, !tbaa !9
  %181 = load ptr, ptr %11, align 8, !tbaa !9
  %182 = getelementptr inbounds %struct.CVodeMemRec, ptr %181, i32 0, i32 3
  %183 = load ptr, ptr %182, align 8, !tbaa !23
  %184 = call i32 %177(double noundef %178, ptr noundef %179, ptr noundef %180, ptr noundef %183)
  store i32 %184, ptr %28, align 4, !tbaa !11
  %185 = load ptr, ptr %27, align 8, !tbaa !9
  %186 = getelementptr inbounds %struct.CVLsMemRec, ptr %185, i32 0, i32 18
  %187 = load i64, ptr %186, align 8, !tbaa !24
  %188 = add nsw i64 %187, 1
  store i64 %188, ptr %186, align 8, !tbaa !24
  %189 = load i32, ptr %28, align 4, !tbaa !11
  %190 = icmp ne i32 %189, 0
  br i1 %190, label %191, label %192

191:                                              ; preds = %168
  br label %208

192:                                              ; preds = %168
  %193 = load double, ptr %17, align 8, !tbaa !5
  %194 = load ptr, ptr %20, align 8, !tbaa !9
  %195 = load i64, ptr %25, align 8, !tbaa !16
  %196 = getelementptr inbounds double, ptr %194, i64 %195
  store double %193, ptr %196, align 8, !tbaa !5
  %197 = load double, ptr %15, align 8, !tbaa !5
  %198 = fdiv double 1.000000e+00, %197
  store double %198, ptr %16, align 8, !tbaa !5
  %199 = load double, ptr %16, align 8, !tbaa !5
  %200 = load ptr, ptr %23, align 8, !tbaa !9
  %201 = load double, ptr %16, align 8, !tbaa !5
  %202 = fneg double %201
  %203 = load ptr, ptr %9, align 8, !tbaa !9
  %204 = load ptr, ptr %24, align 8, !tbaa !9
  call void @N_VLinearSum(double noundef %199, ptr noundef %200, double noundef %202, ptr noundef %203, ptr noundef %204)
  br label %205

205:                                              ; preds = %192
  %206 = load i64, ptr %25, align 8, !tbaa !16
  %207 = add nsw i64 %206, 1
  store i64 %207, ptr %25, align 8, !tbaa !16
  br label %90, !llvm.loop !26

208:                                              ; preds = %191, %90
  %209 = load ptr, ptr %24, align 8, !tbaa !9
  call void @N_VSetArrayPointer(ptr noundef null, ptr noundef %209)
  %210 = load ptr, ptr %24, align 8, !tbaa !9
  call void @N_VDestroy(ptr noundef %210)
  %211 = load i32, ptr %28, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  ret i32 %211
}

declare i64 @SUNDenseMatrix_Columns(ptr noundef) #1

declare ptr @N_VCloneEmpty(ptr noundef) #1

declare ptr @N_VGetArrayPointer(ptr noundef) #1

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

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

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

declare ptr @SUNDenseMatrix_Column(ptr noundef, i64 noundef) #1

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 "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 1904}
!14 = !{!"CVodeMemRec", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !12, i64 36, !6, i64 40, !6, i64 48, !10, i64 56, !12, i64 64, !12, i64 68, !10, i64 72, !10, i64 80, !12, i64 88, !12, i64 92, !10, i64 96, !12, i64 104, !12, i64 108, !6, i64 112, !6, i64 120, !10, i64 128, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !10, i64 152, !10, i64 160, !10, i64 168, !12, i64 176, !12, i64 180, !10, i64 184, !10, i64 192, !10, i64 200, !12, i64 208, !6, i64 216, !12, i64 224, !12, i64 228, !6, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !12, i64 264, !10, i64 272, !10, i64 280, !12, i64 288, !12, i64 292, !12, i64 296, !6, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !7, i64 336, !10, i64 440, !10, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !7, i64 512, !10, i64 616, !10, i64 624, !10, i64 632, !10, i64 640, !7, i64 648, !10, i64 752, !10, i64 760, !10, i64 768, !10, i64 776, !10, i64 784, !12, i64 792, !7, i64 800, !10, i64 904, !10, i64 912, !10, i64 920, !10, i64 928, !10, i64 936, !12, i64 944, !6, i64 952, !12, i64 960, !12, i64 964, !12, i64 968, !12, i64 972, !12, i64 976, !6, i64 984, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !7, i64 1048, !7, i64 1160, !7, i64 1208, !6, i64 1312, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !6, i64 1360, !6, i64 1368, !12, i64 1376, !6, i64 1384, !6, i64 1392, !12, i64 1400, !6, i64 1408, !6, i64 1416, !10, i64 1424, !12, i64 1432, !15, i64 1440, !12, i64 1448, !12, i64 1452, !12, i64 1456, !6, i64 1464, !6, i64 1472, !6, i64 1480, !15, i64 1488, !15, i64 1496, !15, i64 1504, !15, i64 1512, !15, i64 1520, !15, i64 1528, !15, i64 1536, !15, i64 1544, !15, i64 1552, !10, i64 1560, !15, i64 1568, !15, i64 1576, !10, i64 1584, !15, i64 1592, !15, i64 1600, !15, i64 1608, !15, i64 1616, !15, i64 1624, !15, i64 1632, !12, i64 1640, !6, i64 1648, !6, i64 1656, !6, i64 1664, !15, i64 1672, !15, i64 1680, !15, i64 1688, !15, i64 1696, !15, i64 1704, !15, i64 1712, !10, i64 1720, !12, i64 1728, !10, i64 1736, !12, i64 1744, !10, i64 1752, !12, i64 1760, !10, i64 1768, !12, i64 1776, !12, i64 1780, !15, i64 1784, !12, i64 1792, !10, i64 1800, !12, i64 1808, !10, i64 1816, !10, i64 1824, !10, i64 1832, !10, i64 1840, !10, i64 1848, !10, i64 1856, !12, i64 1864, !12, i64 1868, !10, i64 1872, !10, i64 1880, !10, i64 1888, !10, i64 1896, !10, i64 1904, !15, i64 1912, !12, i64 1920, !12, i64 1924, !15, i64 1928, !6, i64 1936, !6, i64 1944, !6, i64 1952, !12, i64 1960, !12, i64 1964, !6, i64 1968, !12, i64 1976, !12, i64 1980, !12, i64 1984, !12, i64 1988, !12, i64 1992, !12, i64 1996, !12, i64 2000, !12, i64 2004, !12, i64 2008, !12, i64 2012, !12, i64 2016, !12, i64 2020, !12, i64 2024, !12, i64 2028, !12, i64 2032, !12, i64 2036, !10, i64 2040, !10, i64 2048, !10, i64 2056, !10, i64 2064, !15, i64 2072, !12, i64 2080, !7, i64 2088, !12, i64 2280, !15, i64 2288, !10, i64 2296, !12, i64 2304, !10, i64 2312, !10, i64 2320, !6, i64 2328, !6, i64 2336, !6, i64 2344, !10, i64 2352, !10, i64 2360, !10, i64 2368, !6, i64 2376, !6, i64 2384, !12, i64 2392, !12, i64 2396, !15, i64 2400, !10, i64 2408, !12, i64 2416, !10, i64 2424, !10, i64 2432, !10, i64 2440, !12, i64 2448, !10, i64 2456, !12, i64 2464}
!15 = !{!"long", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!14, !10, i64 440}
!18 = !{!14, !12, i64 88}
!19 = !{!14, !10, i64 504}
!20 = !{!14, !6, i64 8}
!21 = !{!14, !6, i64 992}
!22 = !{!14, !10, i64 16}
!23 = !{!14, !10, i64 24}
!24 = !{!25, !15, i64 128}
!25 = !{!"CVLsMemRec", !12, i64 0, !12, i64 4, !12, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !12, i64 36, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !15, i64 112, !15, i64 120, !15, i64 128, !15, i64 136, !15, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !15, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !12, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !12, i64 264, !10, i64 272, !10, i64 280, !12, i64 288}
!26 = distinct !{!26, !27}
!27 = !{!"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"

declare void @N_VDestroy(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #1

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 @cvLsDenseDQJac(double noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4, ptr noundef %5) local_unnamed_addr #2 {
  %7 = getelementptr inbounds i8, ptr %4, i64 1904
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call i64 @SUNDenseMatrix_Columns(ptr noundef %3) #4
  %10 = tail call ptr @N_VCloneEmpty(ptr noundef %5) #4
  %11 = getelementptr inbounds i8, ptr %4, i64 440
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = tail call ptr @N_VGetArrayPointer(ptr noundef %12) #4
  %14 = tail call ptr @N_VGetArrayPointer(ptr noundef %1) #4
  %15 = getelementptr inbounds i8, ptr %4, i64 88
  %16 = load i32, ptr %15, align 8, !tbaa !14
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %21, label %17

17:                                               ; preds = %6
  %18 = getelementptr inbounds i8, ptr %4, i64 504
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = tail call ptr @N_VGetArrayPointer(ptr noundef %19) #4
  br label %21

21:                                               ; preds = %17, %6
  %.070 = phi ptr [ %20, %17 ], [ null, %6 ]
  %22 = getelementptr inbounds i8, ptr %4, i64 8
  %23 = load double, ptr %22, align 8, !tbaa !16
  %24 = fcmp ugt double %23, 0.000000e+00
  br i1 %24, label %25, label %27

25:                                               ; preds = %21
  %26 = tail call double @sqrt(double noundef %23) #4
  br label %27

27:                                               ; preds = %21, %25
  %28 = phi double [ %26, %25 ], [ 0.000000e+00, %21 ]
  %29 = load ptr, ptr %11, align 8, !tbaa !13
  %30 = tail call double @N_VWrmsNorm(ptr noundef %2, ptr noundef %29) #4
  %31 = fcmp une double %30, 0.000000e+00
  br i1 %31, label %32, label %42

32:                                               ; preds = %27
  %33 = getelementptr inbounds i8, ptr %4, i64 992
  %34 = load double, ptr %33, align 8, !tbaa !17
  %35 = tail call double @llvm.fabs.f64(double %34)
  %36 = fmul double %35, 1.000000e+03
  %37 = load double, ptr %22, align 8, !tbaa !16
  %38 = fmul double %37, %36
  %39 = sitofp i64 %9 to double
  %40 = fmul double %38, %39
  %41 = fmul double %30, %40
  br label %42

42:                                               ; preds = %27, %32
  %43 = phi double [ %41, %32 ], [ 1.000000e+00, %27 ]
  %44 = icmp sgt i64 %9, 0
  br i1 %44, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %42
  %45 = getelementptr inbounds i8, ptr %4, i64 16
  %46 = getelementptr inbounds i8, ptr %4, i64 24
  %47 = getelementptr inbounds i8, ptr %8, i64 128
  br label %48

48:                                               ; preds = %.lr.ph, %85
  %.07181 = phi i64 [ 0, %.lr.ph ], [ %88, %85 ]
  %49 = tail call ptr @SUNDenseMatrix_Column(ptr noundef %3, i64 noundef %.07181) #4
  tail call void @N_VSetArrayPointer(ptr noundef %49, ptr noundef %10) #4
  %50 = getelementptr inbounds double, ptr %14, i64 %.07181
  %51 = load double, ptr %50, align 8, !tbaa !18
  %52 = tail call double @llvm.fabs.f64(double %51)
  %53 = fmul double %28, %52
  %54 = getelementptr inbounds double, ptr %13, i64 %.07181
  %55 = load double, ptr %54, align 8, !tbaa !18
  %56 = fdiv double %43, %55
  %57 = fcmp ogt double %53, %56
  %. = select i1 %57, double %53, double %56
  %58 = load i32, ptr %15, align 8, !tbaa !14
  %.not79 = icmp eq i32 %58, 0
  br i1 %.not79, label %78, label %59

59:                                               ; preds = %48
  %60 = getelementptr inbounds double, ptr %.070, i64 %.07181
  %61 = load double, ptr %60, align 8, !tbaa !18
  %62 = tail call double @llvm.fabs.f64(double %61)
  %63 = fcmp oeq double %62, 1.000000e+00
  br i1 %63, label %64, label %70

64:                                               ; preds = %59
  %65 = fadd double %51, %.
  %66 = fmul double %65, %61
  %67 = fcmp olt double %66, 0.000000e+00
  br i1 %67, label %68, label %78

68:                                               ; preds = %64
  %69 = fneg double %.
  br label %78

70:                                               ; preds = %59
  %71 = fcmp oeq double %62, 2.000000e+00
  br i1 %71, label %72, label %78

72:                                               ; preds = %70
  %73 = fadd double %51, %.
  %74 = fmul double %73, %61
  %75 = fcmp ugt double %74, 0.000000e+00
  br i1 %75, label %78, label %76

76:                                               ; preds = %72
  %77 = fneg double %.
  br label %78

78:                                               ; preds = %68, %64, %72, %76, %70, %48
  %.069 = phi double [ %69, %68 ], [ %., %64 ], [ %77, %76 ], [ %., %72 ], [ %., %70 ], [ %., %48 ]
  %79 = fadd double %51, %.069
  store double %79, ptr %50, align 8, !tbaa !18
  %80 = load ptr, ptr %45, align 8, !tbaa !19
  %81 = load ptr, ptr %46, align 8, !tbaa !20
  %82 = tail call i32 %80(double noundef %0, ptr noundef %1, ptr noundef %5, ptr noundef %81) #4
  %83 = load i64, ptr %47, align 8, !tbaa !21
  %84 = add nsw i64 %83, 1
  store i64 %84, ptr %47, align 8, !tbaa !21
  %.not80 = icmp eq i32 %82, 0
  br i1 %.not80, label %85, label %._crit_edge

85:                                               ; preds = %78
  store double %51, ptr %50, align 8, !tbaa !18
  %86 = fdiv double 1.000000e+00, %.069
  %87 = fneg double %86
  tail call void @N_VLinearSum(double noundef %86, ptr noundef %5, double noundef %87, ptr noundef %2, ptr noundef %10) #4
  %88 = add nuw nsw i64 %.07181, 1
  %exitcond.not = icmp eq i64 %88, %9
  br i1 %exitcond.not, label %._crit_edge, label %48, !llvm.loop !23

._crit_edge:                                      ; preds = %85, %78, %42
  %.1 = phi i32 [ 0, %42 ], [ %82, %78 ], [ 0, %85 ]
  tail call void @N_VSetArrayPointer(ptr noundef null, ptr noundef %10) #4
  tail call void @N_VDestroy(ptr noundef %10) #4
  ret i32 %.1
}

declare i64 @SUNDenseMatrix_Columns(ptr noundef) local_unnamed_addr #0

declare ptr @N_VCloneEmpty(ptr noundef) local_unnamed_addr #0

declare ptr @N_VGetArrayPointer(ptr noundef) local_unnamed_addr #0

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

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

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

declare ptr @SUNDenseMatrix_Column(ptr noundef, i64 noundef) local_unnamed_addr #0

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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress 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 1904}
!6 = !{!"CVodeMemRec", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !11, i64 36, !10, i64 40, !10, i64 48, !7, i64 56, !11, i64 64, !11, i64 68, !7, i64 72, !7, i64 80, !11, i64 88, !11, i64 92, !7, i64 96, !11, i64 104, !11, i64 108, !10, i64 112, !10, i64 120, !7, i64 128, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !7, i64 152, !7, i64 160, !7, i64 168, !11, i64 176, !11, i64 180, !7, i64 184, !7, i64 192, !7, i64 200, !11, i64 208, !10, i64 216, !11, i64 224, !11, i64 228, !10, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !11, i64 264, !7, i64 272, !7, i64 280, !11, i64 288, !11, i64 292, !11, i64 296, !10, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !8, i64 336, !7, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !7, i64 480, !7, i64 488, !7, i64 496, !7, i64 504, !8, i64 512, !7, i64 616, !7, i64 624, !7, i64 632, !7, i64 640, !8, i64 648, !7, i64 752, !7, i64 760, !7, i64 768, !7, i64 776, !7, i64 784, !11, i64 792, !8, i64 800, !7, i64 904, !7, i64 912, !7, i64 920, !7, i64 928, !7, i64 936, !11, i64 944, !10, i64 952, !11, i64 960, !11, i64 964, !11, i64 968, !11, i64 972, !11, i64 976, !10, i64 984, !10, i64 992, !10, i64 1000, !10, i64 1008, !10, i64 1016, !10, i64 1024, !10, i64 1032, !10, i64 1040, !8, i64 1048, !8, i64 1160, !8, i64 1208, !10, i64 1312, !10, i64 1320, !10, i64 1328, !10, i64 1336, !10, i64 1344, !10, i64 1352, !10, i64 1360, !10, i64 1368, !11, i64 1376, !10, i64 1384, !10, i64 1392, !11, i64 1400, !10, i64 1408, !10, i64 1416, !7, i64 1424, !11, i64 1432, !12, i64 1440, !11, i64 1448, !11, i64 1452, !11, i64 1456, !10, i64 1464, !10, i64 1472, !10, i64 1480, !12, i64 1488, !12, i64 1496, !12, i64 1504, !12, i64 1512, !12, i64 1520, !12, i64 1528, !12, i64 1536, !12, i64 1544, !12, i64 1552, !7, i64 1560, !12, i64 1568, !12, i64 1576, !7, i64 1584, !12, i64 1592, !12, i64 1600, !12, i64 1608, !12, i64 1616, !12, i64 1624, !12, i64 1632, !11, i64 1640, !10, i64 1648, !10, i64 1656, !10, i64 1664, !12, i64 1672, !12, i64 1680, !12, i64 1688, !12, i64 1696, !12, i64 1704, !12, i64 1712, !7, i64 1720, !11, i64 1728, !7, i64 1736, !11, i64 1744, !7, i64 1752, !11, i64 1760, !7, i64 1768, !11, i64 1776, !11, i64 1780, !12, i64 1784, !11, i64 1792, !7, i64 1800, !11, i64 1808, !7, i64 1816, !7, i64 1824, !7, i64 1832, !7, i64 1840, !7, i64 1848, !7, i64 1856, !11, i64 1864, !11, i64 1868, !7, i64 1872, !7, i64 1880, !7, i64 1888, !7, i64 1896, !7, i64 1904, !12, i64 1912, !11, i64 1920, !11, i64 1924, !12, i64 1928, !10, i64 1936, !10, i64 1944, !10, i64 1952, !11, i64 1960, !11, i64 1964, !10, i64 1968, !11, i64 1976, !11, i64 1980, !11, i64 1984, !11, i64 1988, !11, i64 1992, !11, i64 1996, !11, i64 2000, !11, i64 2004, !11, i64 2008, !11, i64 2012, !11, i64 2016, !11, i64 2020, !11, i64 2024, !11, i64 2028, !11, i64 2032, !11, i64 2036, !7, i64 2040, !7, i64 2048, !7, i64 2056, !7, i64 2064, !12, i64 2072, !11, i64 2080, !8, i64 2088, !11, i64 2280, !12, i64 2288, !7, i64 2296, !11, i64 2304, !7, i64 2312, !7, i64 2320, !10, i64 2328, !10, i64 2336, !10, i64 2344, !7, i64 2352, !7, i64 2360, !7, i64 2368, !10, i64 2376, !10, i64 2384, !11, i64 2392, !11, i64 2396, !12, i64 2400, !7, i64 2408, !11, i64 2416, !7, i64 2424, !7, i64 2432, !7, i64 2440, !11, i64 2448, !7, i64 2456, !11, i64 2464}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !7, i64 440}
!14 = !{!6, !11, i64 88}
!15 = !{!6, !7, i64 504}
!16 = !{!6, !10, i64 8}
!17 = !{!6, !10, i64 992}
!18 = !{!10, !10, i64 0}
!19 = !{!6, !7, i64 16}
!20 = !{!6, !7, i64 24}
!21 = !{!22, !12, i64 128}
!22 = !{!"CVLsMemRec", !11, i64 0, !11, i64 4, !11, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !11, i64 36, !10, i64 40, !10, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !11, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !11, i64 264, !7, i64 272, !7, i64 280, !11, i64 288}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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