; 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 }
%struct._generic_SUNMatrix = type { ptr, ptr, ptr }
%struct._generic_SUNMatrix_Ops = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [53 x i8], align 1

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

declare void @cvProcessError(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ...) #1

declare i32 @SUNLinSolGetType(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @cvLsInitialize(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.CVodeMemRec, ptr %7, i32 0, i32 174
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %13

11:                                               ; preds = %1
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %12, i32 noundef -2, ptr noundef @.str, ptr noundef @.str.62, ptr noundef @.str.59)
  store i32 -2, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %181

13:                                               ; preds = %1
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.CVodeMemRec, ptr %14, i32 0, i32 174
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.CVLsMemRec, ptr %17, i32 0, i32 10
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %113

21:                                               ; preds = %13
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.CVLsMemRec, ptr %22, i32 0, i32 35
  %24 = load i32, ptr %23, align 8, !tbaa !16
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %32

26:                                               ; preds = %21
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.CVodeMemRec, ptr %27, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.CVLsMemRec, ptr %30, i32 0, i32 37
  store ptr %29, ptr %31, align 8, !tbaa !18
  br label %112

32:                                               ; preds = %21
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.CVLsMemRec, ptr %33, i32 0, i32 36
  store ptr @cvLsLinSys, ptr %34, align 8, !tbaa !19
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.CVLsMemRec, ptr %36, i32 0, i32 37
  store ptr %35, ptr %37, align 8, !tbaa !18
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.CVLsMemRec, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 8, !tbaa !20
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %84

42:                                               ; preds = %32
  store i32 0, ptr %5, align 4, !tbaa !21
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.CVLsMemRec, ptr %43, i32 0, i32 10
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  %46 = getelementptr inbounds %struct._generic_SUNMatrix, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !22
  %48 = getelementptr inbounds %struct._generic_SUNMatrix_Ops, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !24
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %73

51:                                               ; preds = %42
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.CVLsMemRec, ptr %52, i32 0, i32 10
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = call i32 @SUNMatGetID(ptr noundef %54)
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %63, label %57

57:                                               ; preds = %51
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.CVLsMemRec, ptr %58, i32 0, i32 10
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  %61 = call i32 @SUNMatGetID(ptr noundef %60)
  %62 = icmp eq i32 %61, 3
  br i1 %62, label %63, label %69

63:                                               ; preds = %57, %51
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.CVLsMemRec, ptr %64, i32 0, i32 3
  store ptr @cvLsDQJac, ptr %65, align 8, !tbaa !26
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.CVLsMemRec, ptr %67, i32 0, i32 4
  store ptr %66, ptr %68, align 8, !tbaa !27
  br label %72

69:                                               ; preds = %57
  %70 = load i32, ptr %5, align 4, !tbaa !21
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %5, align 4, !tbaa !21
  br label %72

72:                                               ; preds = %69, %63
  br label %76

73:                                               ; preds = %42
  %74 = load i32, ptr %5, align 4, !tbaa !21
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %5, align 4, !tbaa !21
  br label %76

76:                                               ; preds = %73, %72
  %77 = load i32, ptr %5, align 4, !tbaa !21
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %83

79:                                               ; preds = %76
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %80, i32 noundef -3, ptr noundef @.str, ptr noundef @.str.62, ptr noundef @.str.63)
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.CVLsMemRec, ptr %81, i32 0, i32 38
  store i32 -3, ptr %82, align 8, !tbaa !28
  store i32 -3, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %181

83:                                               ; preds = %76
  br label %90

84:                                               ; preds = %32
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.CVodeMemRec, ptr %85, i32 0, i32 3
  %87 = load ptr, ptr %86, align 8, !tbaa !17
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.CVLsMemRec, ptr %88, i32 0, i32 4
  store ptr %87, ptr %89, align 8, !tbaa !27
  br label %90

90:                                               ; preds = %84, %83
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.CVLsMemRec, ptr %91, i32 0, i32 11
  %93 = load ptr, ptr %92, align 8, !tbaa !29
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %111

95:                                               ; preds = %90
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.CVLsMemRec, ptr %96, i32 0, i32 10
  %98 = load ptr, ptr %97, align 8, !tbaa !14
  %99 = call ptr @SUNMatClone(ptr noundef %98)
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.CVLsMemRec, ptr %100, i32 0, i32 11
  store ptr %99, ptr %101, align 8, !tbaa !29
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.CVLsMemRec, ptr %102, i32 0, i32 11
  %104 = load ptr, ptr %103, align 8, !tbaa !29
  %105 = icmp eq ptr %104, null
  br i1 %105, label %106, label %110

106:                                              ; preds = %95
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %107, i32 noundef -4, ptr noundef @.str, ptr noundef @.str.62, ptr noundef @.str.11)
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.CVLsMemRec, ptr %108, i32 0, i32 38
  store i32 -4, ptr %109, align 8, !tbaa !28
  store i32 -4, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %181

110:                                              ; preds = %95
  br label %111

111:                                              ; preds = %110, %90
  br label %112

112:                                              ; preds = %111, %26
  br label %126

113:                                              ; preds = %13
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.CVLsMemRec, ptr %114, i32 0, i32 2
  store i32 0, ptr %115, align 8, !tbaa !20
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.CVLsMemRec, ptr %116, i32 0, i32 3
  store ptr null, ptr %117, align 8, !tbaa !26
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.CVLsMemRec, ptr %118, i32 0, i32 4
  store ptr null, ptr %119, align 8, !tbaa !27
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.CVLsMemRec, ptr %120, i32 0, i32 35
  store i32 0, ptr %121, align 8, !tbaa !16
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.CVLsMemRec, ptr %122, i32 0, i32 36
  store ptr null, ptr %123, align 8, !tbaa !19
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.CVLsMemRec, ptr %124, i32 0, i32 37
  store ptr null, ptr %125, align 8, !tbaa !18
  br label %126

126:                                              ; preds = %113, %112
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = call i32 @cvLsInitializeCounters(ptr noundef %127)
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.CVLsMemRec, ptr %129, i32 0, i32 30
  %131 = load i32, ptr %130, align 8, !tbaa !30
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %141

133:                                              ; preds = %126
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.CVLsMemRec, ptr %134, i32 0, i32 31
  store ptr null, ptr %135, align 8, !tbaa !31
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.CVLsMemRec, ptr %136, i32 0, i32 32
  store ptr @cvLsDQJtimes, ptr %137, align 8, !tbaa !32
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.CVLsMemRec, ptr %139, i32 0, i32 34
  store ptr %138, ptr %140, align 8, !tbaa !33
  br label %147

141:                                              ; preds = %126
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.CVodeMemRec, ptr %142, i32 0, i32 3
  %144 = load ptr, ptr %143, align 8, !tbaa !17
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.CVLsMemRec, ptr %145, i32 0, i32 34
  store ptr %144, ptr %146, align 8, !tbaa !33
  br label %147

147:                                              ; preds = %141, %133
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.CVLsMemRec, ptr %148, i32 0, i32 10
  %150 = load ptr, ptr %149, align 8, !tbaa !14
  %151 = icmp eq ptr %150, null
  br i1 %151, label %152, label %160

152:                                              ; preds = %147
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.CVLsMemRec, ptr %153, i32 0, i32 26
  %155 = load ptr, ptr %154, align 8, !tbaa !34
  %156 = icmp eq ptr %155, null
  br i1 %156, label %157, label %160

157:                                              ; preds = %152
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.CVodeMemRec, ptr %158, i32 0, i32 171
  store ptr null, ptr %159, align 8, !tbaa !35
  br label %160

160:                                              ; preds = %157, %152, %147
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.CVLsMemRec, ptr %161, i32 0, i32 9
  %163 = load ptr, ptr %162, align 8, !tbaa !36
  %164 = call i32 @SUNLinSolGetType(ptr noundef %163)
  %165 = icmp eq i32 %164, 3
  br i1 %165, label %166, label %171

166:                                              ; preds = %160
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.CVodeMemRec, ptr %167, i32 0, i32 171
  store ptr null, ptr %168, align 8, !tbaa !35
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.CVLsMemRec, ptr %169, i32 0, i32 6
  store i32 0, ptr %170, align 4, !tbaa !37
  br label %171

171:                                              ; preds = %166, %160
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.CVLsMemRec, ptr %172, i32 0, i32 9
  %174 = load ptr, ptr %173, align 8, !tbaa !36
  %175 = call i32 @SUNLinSolInitialize(ptr noundef %174)
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.CVLsMemRec, ptr %176, i32 0, i32 38
  store i32 %175, ptr %177, align 8, !tbaa !28
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.CVLsMemRec, ptr %178, i32 0, i32 38
  %180 = load i32, ptr %179, align 8, !tbaa !28
  store i32 %180, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %181

181:                                              ; preds = %171, %106, %79, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %182 = load i32, ptr %2, align 4
  ret i32 %182
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @cvLsDQJac(double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @cvLsDQJtimes(ptr noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @cvLsLinSys(double noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @cvLsInitializeCounters(ptr noundef) #2

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

declare i32 @SUNMatGetID(ptr noundef) #1

declare ptr @SUNMatClone(ptr noundef) #1

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [53 x i8], align 1

declare void @cvProcessError(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

declare i32 @SUNLinSolGetType(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @cvLsInitialize(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 1904
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = icmp eq ptr %3, null
  br i1 %4, label %5, label %6

5:                                                ; preds = %1
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -2, ptr noundef nonnull @.str, ptr noundef nonnull @.str.62, ptr noundef nonnull @.str.59) #3
  br label %85

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %3, i64 64
  %8 = load ptr, ptr %7, align 8, !tbaa !13
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %48, label %9

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %3, i64 264
  %11 = load i32, ptr %10, align 8, !tbaa !15
  %.not55 = icmp eq i32 %11, 0
  %12 = getelementptr inbounds i8, ptr %3, i64 280
  br i1 %.not55, label %16, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !16
  store ptr %15, ptr %12, align 8, !tbaa !17
  br label %53

16:                                               ; preds = %9
  %17 = getelementptr inbounds i8, ptr %3, i64 272
  store ptr @cvLsLinSys, ptr %17, align 8, !tbaa !18
  store ptr %0, ptr %12, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %3, i64 8
  %19 = load i32, ptr %18, align 8, !tbaa !19
  %.not56 = icmp eq i32 %19, 0
  br i1 %.not56, label %34, label %20

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %8, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !20
  %23 = load ptr, ptr %22, align 8, !tbaa !22
  %.not57 = icmp eq ptr %23, null
  br i1 %.not57, label %32, label %24

24:                                               ; preds = %20
  %25 = tail call i32 @SUNMatGetID(ptr noundef nonnull %8) #3
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %.critedge, label %27

27:                                               ; preds = %24
  %28 = load ptr, ptr %7, align 8, !tbaa !13
  %29 = tail call i32 @SUNMatGetID(ptr noundef %28) #3
  %30 = icmp eq i32 %29, 3
  br i1 %30, label %.critedge, label %32

.critedge:                                        ; preds = %27, %24
  %31 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr @cvLsDQJac, ptr %31, align 8, !tbaa !24
  br label %37

32:                                               ; preds = %27, %20
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -3, ptr noundef nonnull @.str, ptr noundef nonnull @.str.62, ptr noundef nonnull @.str.63) #3
  %33 = getelementptr inbounds i8, ptr %3, i64 288
  store i32 -3, ptr %33, align 8, !tbaa !25
  br label %85

34:                                               ; preds = %16
  %35 = getelementptr inbounds i8, ptr %0, i64 24
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  br label %37

37:                                               ; preds = %.critedge, %34
  %.sink60 = phi ptr [ %0, %.critedge ], [ %36, %34 ]
  %38 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %.sink60, ptr %38, align 8, !tbaa !26
  %39 = getelementptr inbounds i8, ptr %3, i64 72
  %40 = load ptr, ptr %39, align 8, !tbaa !27
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %53

42:                                               ; preds = %37
  %43 = load ptr, ptr %7, align 8, !tbaa !13
  %44 = tail call ptr @SUNMatClone(ptr noundef %43) #3
  store ptr %44, ptr %39, align 8, !tbaa !27
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %53

46:                                               ; preds = %42
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -4, ptr noundef nonnull @.str, ptr noundef nonnull @.str.62, ptr noundef nonnull @.str.11) #3
  %47 = getelementptr inbounds i8, ptr %3, i64 288
  store i32 -4, ptr %47, align 8, !tbaa !25
  br label %85

48:                                               ; preds = %6
  %49 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 0, ptr %49, align 8, !tbaa !19
  %50 = getelementptr inbounds i8, ptr %3, i64 16
  %51 = getelementptr inbounds i8, ptr %3, i64 264
  store i32 0, ptr %51, align 8, !tbaa !15
  %52 = getelementptr inbounds i8, ptr %3, i64 272
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %50, i8 0, i64 16, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %52, i8 0, i64 16, i1 false)
  br label %53

53:                                               ; preds = %13, %42, %37, %48
  %54 = tail call i32 @cvLsInitializeCounters(ptr noundef nonnull %3)
  %55 = getelementptr inbounds i8, ptr %3, i64 224
  %56 = load i32, ptr %55, align 8, !tbaa !28
  %.not59 = icmp eq i32 %56, 0
  br i1 %.not59, label %60, label %57

57:                                               ; preds = %53
  %58 = getelementptr inbounds i8, ptr %3, i64 232
  store ptr null, ptr %58, align 8, !tbaa !29
  %59 = getelementptr inbounds i8, ptr %3, i64 240
  store ptr @cvLsDQJtimes, ptr %59, align 8, !tbaa !30
  br label %63

60:                                               ; preds = %53
  %61 = getelementptr inbounds i8, ptr %0, i64 24
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  br label %63

63:                                               ; preds = %60, %57
  %.sink = phi ptr [ %62, %60 ], [ %0, %57 ]
  %64 = getelementptr inbounds i8, ptr %3, i64 256
  store ptr %.sink, ptr %64, align 8
  %65 = load ptr, ptr %7, align 8, !tbaa !13
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %73

67:                                               ; preds = %63
  %68 = getelementptr inbounds i8, ptr %3, i64 192
  %69 = load ptr, ptr %68, align 8, !tbaa !31
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %73

71:                                               ; preds = %67
  %72 = getelementptr inbounds i8, ptr %0, i64 1880
  store ptr null, ptr %72, align 8, !tbaa !32
  br label %73

73:                                               ; preds = %71, %67, %63
  %74 = getelementptr inbounds i8, ptr %3, i64 56
  %75 = load ptr, ptr %74, align 8, !tbaa !33
  %76 = tail call i32 @SUNLinSolGetType(ptr noundef %75) #3
  %77 = icmp eq i32 %76, 3
  br i1 %77, label %78, label %81

78:                                               ; preds = %73
  %79 = getelementptr inbounds i8, ptr %0, i64 1880
  store ptr null, ptr %79, align 8, !tbaa !32
  %80 = getelementptr inbounds i8, ptr %3, i64 36
  store i32 0, ptr %80, align 4, !tbaa !34
  br label %81

81:                                               ; preds = %78, %73
  %82 = load ptr, ptr %74, align 8, !tbaa !33
  %83 = tail call i32 @SUNLinSolInitialize(ptr noundef %82) #3
  %84 = getelementptr inbounds i8, ptr %3, i64 288
  store i32 %83, ptr %84, align 8, !tbaa !25
  br label %85

85:                                               ; preds = %81, %46, %32, %5
  %.053 = phi i32 [ -2, %5 ], [ %83, %81 ], [ -3, %32 ], [ -4, %46 ]
  ret i32 %.053
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @cvLsDQJac(double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @cvLsDQJtimes(ptr noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @cvLsLinSys(double noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @cvLsInitializeCounters(ptr noundef) local_unnamed_addr #1

declare i32 @SUNMatGetID(ptr noundef) local_unnamed_addr #0

declare ptr @SUNMatClone(ptr noundef) local_unnamed_addr #0

declare i32 @SUNLinSolInitialize(ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !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 = !{!14, !7, i64 64}
!14 = !{!"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}
!15 = !{!14, !11, i64 264}
!16 = !{!6, !7, i64 24}
!17 = !{!14, !7, i64 280}
!18 = !{!14, !7, i64 272}
!19 = !{!14, !11, i64 8}
!20 = !{!21, !7, i64 8}
!21 = !{!"_generic_SUNMatrix", !7, i64 0, !7, i64 8, !7, i64 16}
!22 = !{!23, !7, i64 0}
!23 = !{!"_generic_SUNMatrix_Ops", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72}
!24 = !{!14, !7, i64 16}
!25 = !{!14, !11, i64 288}
!26 = !{!14, !7, i64 24}
!27 = !{!14, !7, i64 72}
!28 = !{!14, !11, i64 224}
!29 = !{!14, !7, i64 232}
!30 = !{!14, !7, i64 240}
!31 = !{!14, !7, i64 192}
!32 = !{!6, !7, i64 1880}
!33 = !{!14, !7, i64 56}
!34 = !{!14, !11, i64 36}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass,TailCallElimPass