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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [56 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 @cvLsSetup(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #2 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i32 %1, ptr %11, align 4, !tbaa !9
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.CVodeMemRec, ptr %22, i32 0, i32 174
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %28

26:                                               ; preds = %8
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %27, i32 noundef -2, ptr noundef @.str, ptr noundef @.str.64, ptr noundef @.str.59)
  store i32 -2, ptr %9, align 4
  store i32 1, ptr %21, align 4
  br label %201

28:                                               ; preds = %8
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.CVodeMemRec, ptr %29, i32 0, i32 174
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  store ptr %31, ptr %18, align 8, !tbaa !5
  %32 = load ptr, ptr %18, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.CVLsMemRec, ptr %32, i32 0, i32 9
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %35 = call i32 @SUNLinSolGetType(ptr noundef %34)
  %36 = icmp eq i32 %35, 3
  br i1 %36, label %37, label %43

37:                                               ; preds = %28
  %38 = load ptr, ptr %18, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.CVLsMemRec, ptr %38, i32 0, i32 38
  store i32 0, ptr %39, align 8, !tbaa !17
  %40 = load ptr, ptr %18, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.CVLsMemRec, ptr %40, i32 0, i32 38
  %42 = load i32, ptr %41, align 8, !tbaa !17
  store i32 %42, ptr %9, align 4
  store i32 1, ptr %21, align 4
  br label %201

43:                                               ; preds = %28
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = load ptr, ptr %18, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.CVLsMemRec, ptr %45, i32 0, i32 14
  store ptr %44, ptr %46, align 8, !tbaa !18
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = load ptr, ptr %18, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.CVLsMemRec, ptr %48, i32 0, i32 15
  store ptr %47, ptr %49, align 8, !tbaa !19
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.CVodeMemRec, ptr %50, i32 0, i32 98
  %52 = load double, ptr %51, align 8, !tbaa !20
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.CVodeMemRec, ptr %53, i32 0, i32 99
  %55 = load double, ptr %54, align 8, !tbaa !21
  %56 = fdiv double %52, %55
  %57 = fsub double %56, 1.000000e+00
  %58 = call double @llvm.fabs.f64(double %57)
  store double %58, ptr %19, align 8, !tbaa !22
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.CVodeMemRec, ptr %59, i32 0, i32 120
  %61 = load i64, ptr %60, align 8, !tbaa !23
  %62 = icmp eq i64 %61, 0
  br i1 %62, label %84, label %63

63:                                               ; preds = %43
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.CVodeMemRec, ptr %64, i32 0, i32 120
  %66 = load i64, ptr %65, align 8, !tbaa !23
  %67 = load ptr, ptr %18, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.CVLsMemRec, ptr %67, i32 0, i32 19
  %69 = load i64, ptr %68, align 8, !tbaa !24
  %70 = load ptr, ptr %18, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.CVLsMemRec, ptr %70, i32 0, i32 16
  %72 = load i64, ptr %71, align 8, !tbaa !25
  %73 = add nsw i64 %69, %72
  %74 = icmp sge i64 %66, %73
  br i1 %74, label %84, label %75

75:                                               ; preds = %63
  %76 = load i32, ptr %11, align 4, !tbaa !9
  %77 = icmp eq i32 %76, 1
  br i1 %77, label %78, label %81

78:                                               ; preds = %75
  %79 = load double, ptr %19, align 8, !tbaa !22
  %80 = fcmp olt double %79, 2.000000e-01
  br i1 %80, label %84, label %81

81:                                               ; preds = %78, %75
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = icmp eq i32 %82, 2
  br label %84

84:                                               ; preds = %81, %78, %63, %43
  %85 = phi i1 [ true, %78 ], [ true, %63 ], [ true, %43 ], [ %83, %81 ]
  %86 = zext i1 %85 to i32
  %87 = load ptr, ptr %18, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.CVLsMemRec, ptr %87, i32 0, i32 5
  store i32 %86, ptr %88, align 8, !tbaa !26
  %89 = load ptr, ptr %18, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.CVLsMemRec, ptr %89, i32 0, i32 10
  %91 = load ptr, ptr %90, align 8, !tbaa !27
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %156

93:                                               ; preds = %84
  %94 = load ptr, ptr %18, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.CVLsMemRec, ptr %94, i32 0, i32 36
  %96 = load ptr, ptr %95, align 8, !tbaa !28
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.CVodeMemRec, ptr %97, i32 0, i32 92
  %99 = load double, ptr %98, align 8, !tbaa !29
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = load ptr, ptr %18, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.CVLsMemRec, ptr %102, i32 0, i32 10
  %104 = load ptr, ptr %103, align 8, !tbaa !27
  %105 = load ptr, ptr %18, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.CVLsMemRec, ptr %105, i32 0, i32 5
  %107 = load i32, ptr %106, align 8, !tbaa !26
  %108 = icmp ne i32 %107, 0
  %109 = xor i1 %108, true
  %110 = zext i1 %109 to i32
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.CVodeMemRec, ptr %112, i32 0, i32 98
  %114 = load double, ptr %113, align 8, !tbaa !20
  %115 = load ptr, ptr %18, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.CVLsMemRec, ptr %115, i32 0, i32 37
  %117 = load ptr, ptr %116, align 8, !tbaa !30
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = load ptr, ptr %17, align 8, !tbaa !5
  %121 = call i32 %96(double noundef %99, ptr noundef %100, ptr noundef %101, ptr noundef %104, i32 noundef %110, ptr noundef %111, double noundef %114, ptr noundef %117, ptr noundef %118, ptr noundef %119, ptr noundef %120)
  store i32 %121, ptr %20, align 4, !tbaa !9
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = load i32, ptr %122, align 4, !tbaa !9
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %135

125:                                              ; preds = %93
  %126 = load ptr, ptr %18, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.CVLsMemRec, ptr %126, i32 0, i32 17
  %128 = load i64, ptr %127, align 8, !tbaa !31
  %129 = add nsw i64 %128, 1
  store i64 %129, ptr %127, align 8, !tbaa !31
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.CVodeMemRec, ptr %130, i32 0, i32 120
  %132 = load i64, ptr %131, align 8, !tbaa !23
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.CVLsMemRec, ptr %133, i32 0, i32 19
  store i64 %132, ptr %134, align 8, !tbaa !24
  br label %135

135:                                              ; preds = %125, %93
  %136 = load i32, ptr %20, align 4, !tbaa !9
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %155

138:                                              ; preds = %135
  %139 = load ptr, ptr %18, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.CVLsMemRec, ptr %139, i32 0, i32 35
  %141 = load i32, ptr %140, align 8, !tbaa !32
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %153

143:                                              ; preds = %138
  %144 = load i32, ptr %20, align 4, !tbaa !9
  %145 = icmp slt i32 %144, 0
  br i1 %145, label %146, label %150

146:                                              ; preds = %143
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %147, i32 noundef -6, ptr noundef @.str, ptr noundef @.str.64, ptr noundef @.str.65)
  %148 = load ptr, ptr %18, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.CVLsMemRec, ptr %148, i32 0, i32 38
  store i32 -6, ptr %149, align 8, !tbaa !17
  store i32 -1, ptr %9, align 4
  store i32 1, ptr %21, align 4
  br label %201

150:                                              ; preds = %143
  %151 = load ptr, ptr %18, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.CVLsMemRec, ptr %151, i32 0, i32 38
  store i32 -7, ptr %152, align 8, !tbaa !17
  store i32 1, ptr %9, align 4
  store i32 1, ptr %21, align 4
  br label %201

153:                                              ; preds = %138
  %154 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %154, ptr %9, align 4
  store i32 1, ptr %21, align 4
  br label %201

155:                                              ; preds = %135
  br label %161

156:                                              ; preds = %84
  %157 = load ptr, ptr %18, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.CVLsMemRec, ptr %157, i32 0, i32 5
  %159 = load i32, ptr %158, align 8, !tbaa !26
  %160 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 %159, ptr %160, align 4, !tbaa !9
  br label %161

161:                                              ; preds = %156, %155
  %162 = load ptr, ptr %18, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.CVLsMemRec, ptr %162, i32 0, i32 9
  %164 = load ptr, ptr %163, align 8, !tbaa !15
  %165 = load ptr, ptr %18, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.CVLsMemRec, ptr %165, i32 0, i32 10
  %167 = load ptr, ptr %166, align 8, !tbaa !27
  %168 = call i32 @SUNLinSolSetup(ptr noundef %164, ptr noundef %167)
  %169 = load ptr, ptr %18, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.CVLsMemRec, ptr %169, i32 0, i32 38
  store i32 %168, ptr %170, align 8, !tbaa !17
  %171 = load ptr, ptr %18, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.CVLsMemRec, ptr %171, i32 0, i32 10
  %173 = load ptr, ptr %172, align 8, !tbaa !27
  %174 = icmp eq ptr %173, null
  br i1 %174, label %175, label %197

175:                                              ; preds = %161
  %176 = load ptr, ptr %14, align 8, !tbaa !5
  %177 = load i32, ptr %176, align 4, !tbaa !9
  %178 = icmp ne i32 %177, 0
  br i1 %178, label %179, label %189

179:                                              ; preds = %175
  %180 = load ptr, ptr %18, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.CVLsMemRec, ptr %180, i32 0, i32 20
  %182 = load i64, ptr %181, align 8, !tbaa !33
  %183 = add nsw i64 %182, 1
  store i64 %183, ptr %181, align 8, !tbaa !33
  %184 = load ptr, ptr %10, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.CVodeMemRec, ptr %184, i32 0, i32 120
  %186 = load i64, ptr %185, align 8, !tbaa !23
  %187 = load ptr, ptr %18, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.CVLsMemRec, ptr %187, i32 0, i32 19
  store i64 %186, ptr %188, align 8, !tbaa !24
  br label %189

189:                                              ; preds = %179, %175
  %190 = load ptr, ptr %18, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.CVLsMemRec, ptr %190, i32 0, i32 5
  %192 = load i32, ptr %191, align 8, !tbaa !26
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %194, label %196

194:                                              ; preds = %189
  %195 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 1, ptr %195, align 4, !tbaa !9
  br label %196

196:                                              ; preds = %194, %189
  br label %197

197:                                              ; preds = %196, %161
  %198 = load ptr, ptr %18, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.CVLsMemRec, ptr %198, i32 0, i32 38
  %200 = load i32, ptr %199, align 8, !tbaa !17
  store i32 %200, ptr %9, align 4
  store i32 1, ptr %21, align 4
  br label %201

201:                                              ; preds = %197, %153, %150, %146, %37, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %202 = load i32, ptr %9, align 4
  ret i32 %202
}

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

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

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


; 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.59 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [56 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 @cvLsSetup(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) local_unnamed_addr #1 {
  %9 = getelementptr inbounds i8, ptr %0, i64 1904
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %8
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -2, ptr noundef nonnull @.str, ptr noundef nonnull @.str.64, ptr noundef nonnull @.str.59) #3
  br label %95

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %10, i64 56
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  %16 = tail call i32 @SUNLinSolGetType(ptr noundef %15) #3
  %17 = icmp eq i32 %16, 3
  br i1 %17, label %18, label %20

18:                                               ; preds = %13
  %19 = getelementptr inbounds i8, ptr %10, i64 288
  store i32 0, ptr %19, align 8, !tbaa !15
  br label %95

20:                                               ; preds = %13
  %21 = getelementptr inbounds i8, ptr %10, i64 96
  store ptr %2, ptr %21, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %10, i64 104
  store ptr %3, ptr %22, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %0, i64 1320
  %24 = load double, ptr %23, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %0, i64 1328
  %26 = load double, ptr %25, align 8, !tbaa !19
  %27 = fdiv double %24, %26
  %28 = fadd double %27, -1.000000e+00
  %29 = tail call double @llvm.fabs.f64(double %28)
  %30 = getelementptr inbounds i8, ptr %0, i64 1488
  %31 = load i64, ptr %30, align 8, !tbaa !20
  %32 = icmp eq i64 %31, 0
  br i1 %32, label %43, label %33

33:                                               ; preds = %20
  %34 = getelementptr inbounds i8, ptr %10, i64 136
  %35 = load i64, ptr %34, align 8, !tbaa !21
  %36 = getelementptr inbounds i8, ptr %10, i64 112
  %37 = load i64, ptr %36, align 8, !tbaa !22
  %38 = add nsw i64 %37, %35
  %.not = icmp slt i64 %31, %38
  br i1 %.not, label %39, label %43

39:                                               ; preds = %33
  %40 = icmp eq i32 %1, 1
  %41 = fcmp olt double %29, 2.000000e-01
  %or.cond = select i1 %40, i1 %41, i1 false
  %42 = icmp eq i32 %1, 2
  %spec.select = or i1 %42, %or.cond
  br label %43

43:                                               ; preds = %39, %33, %20
  %44 = phi i1 [ true, %33 ], [ true, %20 ], [ %spec.select, %39 ]
  %45 = zext i1 %44 to i32
  %46 = getelementptr inbounds i8, ptr %10, i64 32
  store i32 %45, ptr %46, align 8, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %10, i64 64
  %48 = load ptr, ptr %47, align 8, !tbaa !24
  %.not62 = icmp eq ptr %48, null
  br i1 %.not62, label %76, label %49

49:                                               ; preds = %43
  %50 = getelementptr inbounds i8, ptr %10, i64 272
  %51 = load ptr, ptr %50, align 8, !tbaa !25
  %52 = getelementptr inbounds i8, ptr %0, i64 1032
  %53 = load double, ptr %52, align 8, !tbaa !26
  %54 = xor i1 %44, true
  %55 = zext i1 %54 to i32
  %56 = getelementptr inbounds i8, ptr %10, i64 280
  %57 = load ptr, ptr %56, align 8, !tbaa !27
  %58 = tail call i32 %51(double noundef %53, ptr noundef %2, ptr noundef %3, ptr noundef nonnull %48, i32 noundef %55, ptr noundef %4, double noundef %24, ptr noundef %57, ptr noundef %5, ptr noundef %6, ptr noundef %7) #3
  %59 = load i32, ptr %4, align 4, !tbaa !28
  %.not63 = icmp eq i32 %59, 0
  br i1 %.not63, label %66, label %60

60:                                               ; preds = %49
  %61 = getelementptr inbounds i8, ptr %10, i64 120
  %62 = load i64, ptr %61, align 8, !tbaa !29
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %61, align 8, !tbaa !29
  %64 = load i64, ptr %30, align 8, !tbaa !20
  %65 = getelementptr inbounds i8, ptr %10, i64 136
  store i64 %64, ptr %65, align 8, !tbaa !21
  br label %66

66:                                               ; preds = %60, %49
  %.not64 = icmp eq i32 %58, 0
  br i1 %.not64, label %._crit_edge, label %67

._crit_edge:                                      ; preds = %66
  %.pre = load ptr, ptr %47, align 8, !tbaa !24
  br label %77

67:                                               ; preds = %66
  %68 = getelementptr inbounds i8, ptr %10, i64 264
  %69 = load i32, ptr %68, align 8, !tbaa !30
  %.not67 = icmp eq i32 %69, 0
  br i1 %.not67, label %95, label %70

70:                                               ; preds = %67
  %71 = icmp slt i32 %58, 0
  br i1 %71, label %72, label %74

72:                                               ; preds = %70
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -6, ptr noundef nonnull @.str, ptr noundef nonnull @.str.64, ptr noundef nonnull @.str.65) #3
  %73 = getelementptr inbounds i8, ptr %10, i64 288
  store i32 -6, ptr %73, align 8, !tbaa !15
  br label %95

74:                                               ; preds = %70
  %75 = getelementptr inbounds i8, ptr %10, i64 288
  store i32 -7, ptr %75, align 8, !tbaa !15
  br label %95

76:                                               ; preds = %43
  store i32 %45, ptr %4, align 4, !tbaa !28
  br label %77

77:                                               ; preds = %._crit_edge, %76
  %78 = phi ptr [ %.pre, %._crit_edge ], [ null, %76 ]
  %79 = load ptr, ptr %14, align 8, !tbaa !13
  %80 = tail call i32 @SUNLinSolSetup(ptr noundef %79, ptr noundef %78) #3
  %81 = getelementptr inbounds i8, ptr %10, i64 288
  store i32 %80, ptr %81, align 8, !tbaa !15
  %82 = load ptr, ptr %47, align 8, !tbaa !24
  %83 = icmp eq ptr %82, null
  br i1 %83, label %84, label %95

84:                                               ; preds = %77
  %85 = load i32, ptr %4, align 4, !tbaa !28
  %.not65 = icmp eq i32 %85, 0
  br i1 %.not65, label %92, label %86

86:                                               ; preds = %84
  %87 = getelementptr inbounds i8, ptr %10, i64 144
  %88 = load i64, ptr %87, align 8, !tbaa !31
  %89 = add nsw i64 %88, 1
  store i64 %89, ptr %87, align 8, !tbaa !31
  %90 = load i64, ptr %30, align 8, !tbaa !20
  %91 = getelementptr inbounds i8, ptr %10, i64 136
  store i64 %90, ptr %91, align 8, !tbaa !21
  br label %92

92:                                               ; preds = %86, %84
  %93 = load i32, ptr %46, align 8, !tbaa !23
  %.not66 = icmp eq i32 %93, 0
  br i1 %.not66, label %95, label %94

94:                                               ; preds = %92
  store i32 1, ptr %4, align 4, !tbaa !28
  %.pre68 = load i32, ptr %81, align 8, !tbaa !15
  br label %95

95:                                               ; preds = %77, %94, %92, %67, %74, %72, %18, %12
  %.0 = phi i32 [ -2, %12 ], [ 0, %18 ], [ -1, %72 ], [ 1, %74 ], [ %58, %67 ], [ %80, %92 ], [ %.pre68, %94 ], [ %80, %77 ]
  ret i32 %.0
}

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

declare i32 @SUNLinSolSetup(ptr noundef, ptr 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 56}
!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 288}
!16 = !{!14, !7, i64 96}
!17 = !{!14, !7, i64 104}
!18 = !{!6, !10, i64 1320}
!19 = !{!6, !10, i64 1328}
!20 = !{!6, !12, i64 1488}
!21 = !{!14, !12, i64 136}
!22 = !{!14, !12, i64 112}
!23 = !{!14, !11, i64 32}
!24 = !{!14, !7, i64 64}
!25 = !{!14, !7, i64 272}
!26 = !{!6, !10, i64 1032}
!27 = !{!14, !7, i64 280}
!28 = !{!11, !11, i64 0}
!29 = !{!14, !12, i64 120}
!30 = !{!14, !11, i64 264}
!31 = !{!14, !12, i64 144}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass