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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [68 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

; Function Attrs: nounwind uwtable
define dso_local i32 @cvLsSolve(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, 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 i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.CVodeMemRec, ptr %24, i32 0, i32 174
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %30

28:                                               ; preds = %5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %29, i32 noundef -2, ptr noundef @.str, ptr noundef @.str.66, ptr noundef @.str.59)
  store i32 -2, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

30:                                               ; preds = %5
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.CVodeMemRec, ptr %31, i32 0, i32 174
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  store ptr %33, ptr %12, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.CVodeMemRec, ptr %34, i32 0, i32 22
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %30
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.CVodeMemRec, ptr %39, i32 0, i32 24
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = icmp eq i32 %41, 1
  br label %43

43:                                               ; preds = %38, %30
  %44 = phi i1 [ false, %30 ], [ %42, %38 ]
  %45 = zext i1 %44 to i32
  store i32 %45, ptr %20, align 4, !tbaa !16
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.CVodeMemRec, ptr %46, i32 0, i32 22
  %48 = load i32, ptr %47, align 4, !tbaa !14
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %55

50:                                               ; preds = %43
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.CVodeMemRec, ptr %51, i32 0, i32 24
  %53 = load i32, ptr %52, align 4, !tbaa !15
  %54 = icmp eq i32 %53, 2
  br label %55

55:                                               ; preds = %50, %43
  %56 = phi i1 [ false, %43 ], [ %54, %50 ]
  %57 = zext i1 %56 to i32
  store i32 %57, ptr %21, align 4, !tbaa !16
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.CVodeMemRec, ptr %58, i32 0, i32 22
  %60 = load i32, ptr %59, align 4, !tbaa !14
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %67

62:                                               ; preds = %55
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.CVodeMemRec, ptr %63, i32 0, i32 24
  %65 = load i32, ptr %64, align 4, !tbaa !15
  %66 = icmp eq i32 %65, 3
  br label %67

67:                                               ; preds = %62, %55
  %68 = phi i1 [ false, %55 ], [ %66, %62 ]
  %69 = zext i1 %68 to i32
  store i32 %69, ptr %22, align 4, !tbaa !16
  %70 = load i32, ptr %20, align 4, !tbaa !16
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %77

72:                                               ; preds = %67
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.CVodeMemRec, ptr %73, i32 0, i32 151
  %75 = load ptr, ptr %74, align 8, !tbaa !17
  %76 = call i32 @SUNNonlinSolGetCurIter(ptr noundef %75, ptr noundef %17)
  store i32 %76, ptr %19, align 4, !tbaa !16
  br label %110

77:                                               ; preds = %67
  %78 = load i32, ptr %21, align 4, !tbaa !16
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %90

80:                                               ; preds = %77
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.CVodeMemRec, ptr %81, i32 0, i32 159
  %83 = load i32, ptr %82, align 8, !tbaa !18
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %90

85:                                               ; preds = %80
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.CVodeMemRec, ptr %86, i32 0, i32 153
  %88 = load ptr, ptr %87, align 8, !tbaa !19
  %89 = call i32 @SUNNonlinSolGetCurIter(ptr noundef %88, ptr noundef %17)
  store i32 %89, ptr %19, align 4, !tbaa !16
  br label %109

90:                                               ; preds = %80, %77
  %91 = load i32, ptr %22, align 4, !tbaa !16
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %103

93:                                               ; preds = %90
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.CVodeMemRec, ptr %94, i32 0, i32 159
  %96 = load i32, ptr %95, align 8, !tbaa !18
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %103

98:                                               ; preds = %93
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.CVodeMemRec, ptr %99, i32 0, i32 155
  %101 = load ptr, ptr %100, align 8, !tbaa !20
  %102 = call i32 @SUNNonlinSolGetCurIter(ptr noundef %101, ptr noundef %17)
  store i32 %102, ptr %19, align 4, !tbaa !16
  br label %108

103:                                              ; preds = %93, %90
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.CVodeMemRec, ptr %104, i32 0, i32 149
  %106 = load ptr, ptr %105, align 8, !tbaa !21
  %107 = call i32 @SUNNonlinSolGetCurIter(ptr noundef %106, ptr noundef %17)
  store i32 %107, ptr %19, align 4, !tbaa !16
  br label %108

108:                                              ; preds = %103, %98
  br label %109

109:                                              ; preds = %108, %85
  br label %110

110:                                              ; preds = %109, %72
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.CVLsMemRec, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !22
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %147

115:                                              ; preds = %110
  %116 = load ptr, ptr %12, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.CVLsMemRec, ptr %116, i32 0, i32 7
  %118 = load double, ptr %117, align 8, !tbaa !24
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.CVodeMemRec, ptr %119, i32 0, i32 95
  %121 = getelementptr inbounds [6 x double], ptr %120, i64 0, i64 4
  %122 = load double, ptr %121, align 8, !tbaa !25
  %123 = fmul double %118, %122
  store double %123, ptr %14, align 8, !tbaa !25
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = call double @N_VWrmsNorm(ptr noundef %124, ptr noundef %125)
  store double %126, ptr %13, align 8, !tbaa !25
  %127 = load double, ptr %13, align 8, !tbaa !25
  %128 = load double, ptr %14, align 8, !tbaa !25
  %129 = fcmp ole double %127, %128
  br i1 %129, label %130, label %141

130:                                              ; preds = %115
  %131 = load i32, ptr %17, align 4, !tbaa !16
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %133, label %135

133:                                              ; preds = %130
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  call void @N_VConst(double noundef 0.000000e+00, ptr noundef %134)
  br label %135

135:                                              ; preds = %133, %130
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.CVLsMemRec, ptr %136, i32 0, i32 38
  store i32 0, ptr %137, align 8, !tbaa !26
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.CVLsMemRec, ptr %138, i32 0, i32 38
  %140 = load i32, ptr %139, align 8, !tbaa !26
  store i32 %140, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

141:                                              ; preds = %115
  %142 = load double, ptr %14, align 8, !tbaa !25
  %143 = load ptr, ptr %12, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.CVLsMemRec, ptr %143, i32 0, i32 8
  %145 = load double, ptr %144, align 8, !tbaa !27
  %146 = fmul double %142, %145
  store double %146, ptr %15, align 8, !tbaa !25
  br label %148

147:                                              ; preds = %110
  store double 0.000000e+00, ptr %15, align 8, !tbaa !25
  br label %148

148:                                              ; preds = %147, %141
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.CVLsMemRec, ptr %150, i32 0, i32 14
  store ptr %149, ptr %151, align 8, !tbaa !28
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.CVLsMemRec, ptr %153, i32 0, i32 15
  store ptr %152, ptr %154, align 8, !tbaa !29
  %155 = load ptr, ptr %12, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.CVLsMemRec, ptr %155, i32 0, i32 9
  %157 = load ptr, ptr %156, align 8, !tbaa !30
  %158 = getelementptr inbounds %struct._generic_SUNLinearSolver, ptr %157, i32 0, i32 1
  %159 = load ptr, ptr %158, align 8, !tbaa !31
  %160 = getelementptr inbounds %struct._generic_SUNLinearSolver_Ops, ptr %159, i32 0, i32 4
  %161 = load ptr, ptr %160, align 8, !tbaa !33
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %180

163:                                              ; preds = %148
  %164 = load ptr, ptr %12, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.CVLsMemRec, ptr %164, i32 0, i32 9
  %166 = load ptr, ptr %165, align 8, !tbaa !30
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = load ptr, ptr %9, align 8, !tbaa !5
  %169 = call i32 @SUNLinSolSetScalingVectors(ptr noundef %166, ptr noundef %167, ptr noundef %168)
  store i32 %169, ptr %19, align 4, !tbaa !16
  %170 = load i32, ptr %19, align 4, !tbaa !16
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %179

172:                                              ; preds = %163
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %173, i32 noundef -9, ptr noundef @.str, ptr noundef @.str.66, ptr noundef @.str.67)
  %174 = load ptr, ptr %12, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.CVLsMemRec, ptr %174, i32 0, i32 38
  store i32 -9, ptr %175, align 8, !tbaa !26
  %176 = load ptr, ptr %12, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.CVLsMemRec, ptr %176, i32 0, i32 38
  %178 = load i32, ptr %177, align 8, !tbaa !26
  store i32 %178, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

179:                                              ; preds = %163
  br label %198

180:                                              ; preds = %148
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.CVLsMemRec, ptr %181, i32 0, i32 0
  %183 = load i32, ptr %182, align 8, !tbaa !22
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %197

185:                                              ; preds = %180
  %186 = load ptr, ptr %12, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.CVLsMemRec, ptr %186, i32 0, i32 13
  %188 = load ptr, ptr %187, align 8, !tbaa !35
  call void @N_VConst(double noundef 1.000000e+00, ptr noundef %188)
  %189 = load ptr, ptr %9, align 8, !tbaa !5
  %190 = load ptr, ptr %12, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.CVLsMemRec, ptr %190, i32 0, i32 13
  %192 = load ptr, ptr %191, align 8, !tbaa !35
  %193 = call double @N_VWrmsNorm(ptr noundef %189, ptr noundef %192)
  store double %193, ptr %16, align 8, !tbaa !25
  %194 = load double, ptr %16, align 8, !tbaa !25
  %195 = load double, ptr %15, align 8, !tbaa !25
  %196 = fdiv double %195, %194
  store double %196, ptr %15, align 8, !tbaa !25
  br label %197

197:                                              ; preds = %185, %180
  br label %198

198:                                              ; preds = %197, %179
  %199 = load ptr, ptr %12, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.CVLsMemRec, ptr %199, i32 0, i32 13
  %201 = load ptr, ptr %200, align 8, !tbaa !35
  call void @N_VConst(double noundef 0.000000e+00, ptr noundef %201)
  %202 = load ptr, ptr %12, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.CVLsMemRec, ptr %202, i32 0, i32 9
  %204 = load ptr, ptr %203, align 8, !tbaa !30
  %205 = call i32 @SUNLinSolSetZeroGuess(ptr noundef %204, i32 noundef 1)
  store i32 %205, ptr %19, align 4, !tbaa !16
  %206 = load i32, ptr %19, align 4, !tbaa !16
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %208, label %209

208:                                              ; preds = %198
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

209:                                              ; preds = %198
  %210 = load ptr, ptr %12, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.CVLsMemRec, ptr %210, i32 0, i32 31
  %212 = load ptr, ptr %211, align 8, !tbaa !36
  %213 = icmp ne ptr %212, null
  br i1 %213, label %214, label %244

214:                                              ; preds = %209
  %215 = load ptr, ptr %12, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.CVLsMemRec, ptr %215, i32 0, i32 31
  %217 = load ptr, ptr %216, align 8, !tbaa !36
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.CVodeMemRec, ptr %218, i32 0, i32 92
  %220 = load double, ptr %219, align 8, !tbaa !37
  %221 = load ptr, ptr %10, align 8, !tbaa !5
  %222 = load ptr, ptr %11, align 8, !tbaa !5
  %223 = load ptr, ptr %12, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.CVLsMemRec, ptr %223, i32 0, i32 34
  %225 = load ptr, ptr %224, align 8, !tbaa !38
  %226 = call i32 %217(double noundef %220, ptr noundef %221, ptr noundef %222, ptr noundef %225)
  %227 = load ptr, ptr %12, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.CVLsMemRec, ptr %227, i32 0, i32 38
  store i32 %226, ptr %228, align 8, !tbaa !26
  %229 = load ptr, ptr %12, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.CVLsMemRec, ptr %229, i32 0, i32 24
  %231 = load i64, ptr %230, align 8, !tbaa !39
  %232 = add nsw i64 %231, 1
  store i64 %232, ptr %230, align 8, !tbaa !39
  %233 = load ptr, ptr %12, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.CVLsMemRec, ptr %233, i32 0, i32 38
  %235 = load i32, ptr %234, align 8, !tbaa !26
  %236 = icmp ne i32 %235, 0
  br i1 %236, label %237, label %243

237:                                              ; preds = %214
  %238 = load ptr, ptr %7, align 8, !tbaa !5
  %239 = load i32, ptr %19, align 4, !tbaa !16
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %238, i32 noundef %239, ptr noundef @.str, ptr noundef @.str.66, ptr noundef @.str.68)
  %240 = load ptr, ptr %12, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.CVLsMemRec, ptr %240, i32 0, i32 38
  %242 = load i32, ptr %241, align 8, !tbaa !26
  store i32 %242, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

243:                                              ; preds = %214
  br label %244

244:                                              ; preds = %243, %209
  %245 = load ptr, ptr %12, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.CVLsMemRec, ptr %245, i32 0, i32 9
  %247 = load ptr, ptr %246, align 8, !tbaa !30
  %248 = load ptr, ptr %12, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.CVLsMemRec, ptr %248, i32 0, i32 10
  %250 = load ptr, ptr %249, align 8, !tbaa !40
  %251 = load ptr, ptr %12, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.CVLsMemRec, ptr %251, i32 0, i32 13
  %253 = load ptr, ptr %252, align 8, !tbaa !35
  %254 = load ptr, ptr %8, align 8, !tbaa !5
  %255 = load double, ptr %15, align 8, !tbaa !25
  %256 = call i32 @SUNLinSolSolve(ptr noundef %247, ptr noundef %250, ptr noundef %253, ptr noundef %254, double noundef %255)
  store i32 %256, ptr %19, align 4, !tbaa !16
  %257 = load ptr, ptr %12, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.CVLsMemRec, ptr %257, i32 0, i32 13
  %259 = load ptr, ptr %258, align 8, !tbaa !35
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  call void @N_VScale(double noundef 1.000000e+00, ptr noundef %259, ptr noundef %260)
  %261 = load ptr, ptr %12, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.CVLsMemRec, ptr %261, i32 0, i32 6
  %263 = load i32, ptr %262, align 4, !tbaa !41
  %264 = icmp ne i32 %263, 0
  br i1 %264, label %265, label %278

265:                                              ; preds = %244
  %266 = load ptr, ptr %7, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.CVodeMemRec, ptr %266, i32 0, i32 100
  %268 = load double, ptr %267, align 8, !tbaa !42
  %269 = fcmp une double %268, 1.000000e+00
  br i1 %269, label %270, label %278

270:                                              ; preds = %265
  %271 = load ptr, ptr %7, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.CVodeMemRec, ptr %271, i32 0, i32 100
  %273 = load double, ptr %272, align 8, !tbaa !42
  %274 = fadd double 1.000000e+00, %273
  %275 = fdiv double 2.000000e+00, %274
  %276 = load ptr, ptr %8, align 8, !tbaa !5
  %277 = load ptr, ptr %8, align 8, !tbaa !5
  call void @N_VScale(double noundef %275, ptr noundef %276, ptr noundef %277)
  br label %278

278:                                              ; preds = %270, %265, %244
  store i32 0, ptr %18, align 4, !tbaa !16
  %279 = load ptr, ptr %12, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.CVLsMemRec, ptr %279, i32 0, i32 0
  %281 = load i32, ptr %280, align 8, !tbaa !22
  %282 = icmp ne i32 %281, 0
  br i1 %282, label %283, label %297

283:                                              ; preds = %278
  %284 = load ptr, ptr %12, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.CVLsMemRec, ptr %284, i32 0, i32 9
  %286 = load ptr, ptr %285, align 8, !tbaa !30
  %287 = getelementptr inbounds %struct._generic_SUNLinearSolver, ptr %286, i32 0, i32 1
  %288 = load ptr, ptr %287, align 8, !tbaa !31
  %289 = getelementptr inbounds %struct._generic_SUNLinearSolver_Ops, ptr %288, i32 0, i32 9
  %290 = load ptr, ptr %289, align 8, !tbaa !43
  %291 = icmp ne ptr %290, null
  br i1 %291, label %292, label %297

292:                                              ; preds = %283
  %293 = load ptr, ptr %12, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.CVLsMemRec, ptr %293, i32 0, i32 9
  %295 = load ptr, ptr %294, align 8, !tbaa !30
  %296 = call i32 @SUNLinSolNumIters(ptr noundef %295)
  store i32 %296, ptr %18, align 4, !tbaa !16
  br label %297

297:                                              ; preds = %292, %283, %278
  %298 = load i32, ptr %18, align 4, !tbaa !16
  %299 = sext i32 %298 to i64
  %300 = load ptr, ptr %12, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.CVLsMemRec, ptr %300, i32 0, i32 21
  %302 = load i64, ptr %301, align 8, !tbaa !44
  %303 = add nsw i64 %302, %299
  store i64 %303, ptr %301, align 8, !tbaa !44
  %304 = load i32, ptr %19, align 4, !tbaa !16
  %305 = icmp ne i32 %304, 0
  br i1 %305, label %306, label %311

306:                                              ; preds = %297
  %307 = load ptr, ptr %12, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.CVLsMemRec, ptr %307, i32 0, i32 23
  %309 = load i64, ptr %308, align 8, !tbaa !45
  %310 = add nsw i64 %309, 1
  store i64 %310, ptr %308, align 8, !tbaa !45
  br label %311

311:                                              ; preds = %306, %297
  %312 = load i32, ptr %19, align 4, !tbaa !16
  %313 = load ptr, ptr %12, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.CVLsMemRec, ptr %313, i32 0, i32 38
  store i32 %312, ptr %314, align 8, !tbaa !26
  %315 = load i32, ptr %19, align 4, !tbaa !16
  switch i32 %315, label %330 [
    i32 0, label %316
    i32 801, label %317
    i32 802, label %322
    i32 803, label %322
    i32 805, label %322
    i32 806, label %322
    i32 807, label %322
    i32 808, label %322
    i32 -801, label %323
    i32 -802, label %323
    i32 -803, label %323
    i32 -810, label %323
    i32 -811, label %323
    i32 -809, label %324
    i32 -805, label %326
    i32 -808, label %328
  ]

316:                                              ; preds = %311
  store i32 0, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

317:                                              ; preds = %311
  %318 = load i32, ptr %17, align 4, !tbaa !16
  %319 = icmp eq i32 %318, 0
  br i1 %319, label %320, label %321

320:                                              ; preds = %317
  store i32 0, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

321:                                              ; preds = %317
  store i32 1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

322:                                              ; preds = %311, %311, %311, %311, %311, %311
  store i32 1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

323:                                              ; preds = %311, %311, %311, %311, %311
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

324:                                              ; preds = %311
  %325 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %325, i32 noundef -809, ptr noundef @.str, ptr noundef @.str.66, ptr noundef @.str.69)
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

326:                                              ; preds = %311
  %327 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %327, i32 noundef -805, ptr noundef @.str, ptr noundef @.str.66, ptr noundef @.str.70)
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

328:                                              ; preds = %311
  %329 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %329, i32 noundef -808, ptr noundef @.str, ptr noundef @.str.66, ptr noundef @.str.71)
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

330:                                              ; preds = %311
  store i32 0, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %331

331:                                              ; preds = %330, %328, %326, %324, %323, %322, %321, %320, %316, %237, %208, %172, %135, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %332 = load i32, ptr %6, align 4
  ret i32 %332
}

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

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

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

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

declare i32 @SUNNonlinSolGetCurIter(ptr noundef, ptr noundef) #1

declare i32 @SUNLinSolSetScalingVectors(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @SUNLinSolSetZeroGuess(ptr noundef, i32 noundef) #1

declare i32 @SUNLinSolSolve(ptr noundef, ptr noundef, ptr noundef, ptr noundef, double noundef) #1

declare i32 @SUNLinSolNumIters(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 = !{!10, !12, i64 140}
!15 = !{!10, !12, i64 148}
!16 = !{!12, !12, i64 0}
!17 = !{!10, !6, i64 1736}
!18 = !{!10, !12, i64 1792}
!19 = !{!10, !6, i64 1752}
!20 = !{!10, !6, i64 1768}
!21 = !{!10, !6, i64 1720}
!22 = !{!23, !12, i64 0}
!23 = !{!"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}
!24 = !{!23, !11, i64 40}
!25 = !{!11, !11, i64 0}
!26 = !{!23, !12, i64 288}
!27 = !{!23, !11, i64 48}
!28 = !{!23, !6, i64 96}
!29 = !{!23, !6, i64 104}
!30 = !{!23, !6, i64 56}
!31 = !{!32, !6, i64 8}
!32 = !{!"_generic_SUNLinearSolver", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!34, !6, i64 32}
!34 = !{!"_generic_SUNLinearSolver_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, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112}
!35 = !{!23, !6, i64 88}
!36 = !{!23, !6, i64 232}
!37 = !{!10, !11, i64 1032}
!38 = !{!23, !6, i64 256}
!39 = !{!23, !13, i64 176}
!40 = !{!23, !6, i64 64}
!41 = !{!23, !12, i64 36}
!42 = !{!10, !11, i64 1336}
!43 = !{!34, !6, i64 72}
!44 = !{!23, !13, i64 152}
!45 = !{!23, !13, i64 168}


; 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.66 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [68 x i8], align 1

; Function Attrs: mustprogress 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, ...) local_unnamed_addr #1

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

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

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %0, i64 140
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %.thread113, label %14

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 148
  %16 = load i32, ptr %15, align 4, !tbaa !14
  switch i32 %16, label %.thread113 [
    i32 1, label %23
    i32 2, label %17
    i32 3, label %20
  ]

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %0, i64 1792
  %19 = load i32, ptr %18, align 8, !tbaa !15
  %.not97 = icmp eq i32 %19, 0
  br i1 %.not97, label %.thread113, label %23

20:                                               ; preds = %14
  %21 = getelementptr inbounds i8, ptr %0, i64 1792
  %22 = load i32, ptr %21, align 8, !tbaa !15
  %.not98 = icmp eq i32 %22, 0
  br i1 %.not98, label %.thread113, label %23

.thread113:                                       ; preds = %17, %14, %11, %20
  br label %23

23:                                               ; preds = %20, %17, %14, %.thread113
  %.sink = phi i64 [ 1720, %.thread113 ], [ 1736, %14 ], [ 1752, %17 ], [ 1768, %20 ]
  %24 = getelementptr inbounds i8, ptr %0, i64 %.sink
  %25 = load ptr, ptr %24, align 8, !tbaa !16
  %26 = call i32 @SUNNonlinSolGetCurIter(ptr noundef %25, ptr noundef nonnull %6) #3
  %27 = load i32, ptr %8, align 8, !tbaa !17
  %.not99 = icmp eq i32 %27, 0
  br i1 %.not99, label %46, label %28

28:                                               ; preds = %23
  %29 = getelementptr inbounds i8, ptr %8, i64 40
  %30 = load double, ptr %29, align 8, !tbaa !19
  %31 = getelementptr inbounds i8, ptr %0, i64 1192
  %32 = load double, ptr %31, align 8, !tbaa !20
  %33 = fmul double %30, %32
  %34 = call double @N_VWrmsNorm(ptr noundef %1, ptr noundef %2) #3
  %35 = fcmp ugt double %34, %33
  br i1 %35, label %42, label %36

36:                                               ; preds = %28
  %37 = load i32, ptr %6, align 4, !tbaa !21
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  call void @N_VConst(double noundef 0.000000e+00, ptr noundef %1) #3
  br label %40

40:                                               ; preds = %39, %36
  %41 = getelementptr inbounds i8, ptr %8, i64 288
  store i32 0, ptr %41, align 8, !tbaa !22
  br label %132

42:                                               ; preds = %28
  %43 = getelementptr inbounds i8, ptr %8, i64 48
  %44 = load double, ptr %43, align 8, !tbaa !23
  %45 = fmul double %33, %44
  br label %46

46:                                               ; preds = %23, %42
  %.088 = phi double [ %45, %42 ], [ 0.000000e+00, %23 ]
  %47 = getelementptr inbounds i8, ptr %8, i64 96
  store ptr %3, ptr %47, align 8, !tbaa !24
  %48 = getelementptr inbounds i8, ptr %8, i64 104
  store ptr %4, ptr %48, align 8, !tbaa !25
  %49 = getelementptr inbounds i8, ptr %8, i64 56
  %50 = load ptr, ptr %49, align 8, !tbaa !26
  %51 = getelementptr inbounds i8, ptr %50, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !27
  %53 = getelementptr inbounds i8, ptr %52, i64 32
  %54 = load ptr, ptr %53, align 8, !tbaa !29
  %.not100 = icmp eq ptr %54, null
  br i1 %.not100, label %59, label %55

55:                                               ; preds = %46
  %56 = call i32 @SUNLinSolSetScalingVectors(ptr noundef nonnull %50, ptr noundef %2, ptr noundef %2) #3
  %.not102 = icmp eq i32 %56, 0
  br i1 %.not102, label %67, label %57

57:                                               ; preds = %55
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -9, ptr noundef nonnull @.str, ptr noundef nonnull @.str.66, ptr noundef nonnull @.str.67) #3
  %58 = getelementptr inbounds i8, ptr %8, i64 288
  store i32 -9, ptr %58, align 8, !tbaa !22
  br label %132

59:                                               ; preds = %46
  %60 = load i32, ptr %8, align 8, !tbaa !17
  %.not101 = icmp eq i32 %60, 0
  br i1 %.not101, label %67, label %61

61:                                               ; preds = %59
  %62 = getelementptr inbounds i8, ptr %8, i64 88
  %63 = load ptr, ptr %62, align 8, !tbaa !31
  call void @N_VConst(double noundef 1.000000e+00, ptr noundef %63) #3
  %64 = load ptr, ptr %62, align 8, !tbaa !31
  %65 = call double @N_VWrmsNorm(ptr noundef %2, ptr noundef %64) #3
  %66 = fdiv double %.088, %65
  br label %67

67:                                               ; preds = %59, %61, %55
  %.1 = phi double [ %.088, %55 ], [ %66, %61 ], [ %.088, %59 ]
  %68 = getelementptr inbounds i8, ptr %8, i64 88
  %69 = load ptr, ptr %68, align 8, !tbaa !31
  call void @N_VConst(double noundef 0.000000e+00, ptr noundef %69) #3
  %70 = load ptr, ptr %49, align 8, !tbaa !26
  %71 = call i32 @SUNLinSolSetZeroGuess(ptr noundef %70, i32 noundef 1) #3
  %.not103 = icmp eq i32 %71, 0
  br i1 %.not103, label %72, label %132

72:                                               ; preds = %67
  %73 = getelementptr inbounds i8, ptr %8, i64 232
  %74 = load ptr, ptr %73, align 8, !tbaa !32
  %.not104 = icmp eq ptr %74, null
  br i1 %.not104, label %87, label %75

75:                                               ; preds = %72
  %76 = getelementptr inbounds i8, ptr %0, i64 1032
  %77 = load double, ptr %76, align 8, !tbaa !33
  %78 = getelementptr inbounds i8, ptr %8, i64 256
  %79 = load ptr, ptr %78, align 8, !tbaa !34
  %80 = call i32 %74(double noundef %77, ptr noundef %3, ptr noundef %4, ptr noundef %79) #3
  %81 = getelementptr inbounds i8, ptr %8, i64 288
  store i32 %80, ptr %81, align 8, !tbaa !22
  %82 = getelementptr inbounds i8, ptr %8, i64 176
  %83 = load i64, ptr %82, align 8, !tbaa !35
  %84 = add nsw i64 %83, 1
  store i64 %84, ptr %82, align 8, !tbaa !35
  %.not105 = icmp eq i32 %80, 0
  br i1 %.not105, label %87, label %85

85:                                               ; preds = %75
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef 0, ptr noundef nonnull @.str, ptr noundef nonnull @.str.66, ptr noundef nonnull @.str.68) #3
  %86 = load i32, ptr %81, align 8, !tbaa !22
  br label %132

87:                                               ; preds = %75, %72
  %88 = load ptr, ptr %49, align 8, !tbaa !26
  %89 = getelementptr inbounds i8, ptr %8, i64 64
  %90 = load ptr, ptr %89, align 8, !tbaa !36
  %91 = load ptr, ptr %68, align 8, !tbaa !31
  %92 = call i32 @SUNLinSolSolve(ptr noundef %88, ptr noundef %90, ptr noundef %91, ptr noundef %1, double noundef %.1) #3
  %93 = load ptr, ptr %68, align 8, !tbaa !31
  call void @N_VScale(double noundef 1.000000e+00, ptr noundef %93, ptr noundef %1) #3
  %94 = getelementptr inbounds i8, ptr %8, i64 36
  %95 = load i32, ptr %94, align 4, !tbaa !37
  %.not106 = icmp eq i32 %95, 0
  br i1 %.not106, label %103, label %96

96:                                               ; preds = %87
  %97 = getelementptr inbounds i8, ptr %0, i64 1336
  %98 = load double, ptr %97, align 8, !tbaa !38
  %99 = fcmp une double %98, 1.000000e+00
  br i1 %99, label %100, label %103

100:                                              ; preds = %96
  %101 = fadd double %98, 1.000000e+00
  %102 = fdiv double 2.000000e+00, %101
  call void @N_VScale(double noundef %102, ptr noundef %1, ptr noundef %1) #3
  br label %103

103:                                              ; preds = %100, %96, %87
  %104 = load i32, ptr %8, align 8, !tbaa !17
  %.not107 = icmp eq i32 %104, 0
  br i1 %.not107, label %114, label %105

105:                                              ; preds = %103
  %106 = load ptr, ptr %49, align 8, !tbaa !26
  %107 = getelementptr inbounds i8, ptr %106, i64 8
  %108 = load ptr, ptr %107, align 8, !tbaa !27
  %109 = getelementptr inbounds i8, ptr %108, i64 72
  %110 = load ptr, ptr %109, align 8, !tbaa !39
  %.not108 = icmp eq ptr %110, null
  br i1 %.not108, label %114, label %111

111:                                              ; preds = %105
  %112 = call i32 @SUNLinSolNumIters(ptr noundef nonnull %106) #3
  %113 = sext i32 %112 to i64
  br label %114

114:                                              ; preds = %111, %105, %103
  %.089 = phi i64 [ %113, %111 ], [ 0, %105 ], [ 0, %103 ]
  %115 = getelementptr inbounds i8, ptr %8, i64 152
  %116 = load i64, ptr %115, align 8, !tbaa !40
  %117 = add nsw i64 %116, %.089
  store i64 %117, ptr %115, align 8, !tbaa !40
  %.not109 = icmp eq i32 %92, 0
  br i1 %.not109, label %.thread114, label %119

.thread114:                                       ; preds = %114
  %118 = getelementptr inbounds i8, ptr %8, i64 288
  store i32 0, ptr %118, align 8, !tbaa !22
  br label %132

119:                                              ; preds = %114
  %120 = getelementptr inbounds i8, ptr %8, i64 168
  %121 = load i64, ptr %120, align 8, !tbaa !41
  %122 = add nsw i64 %121, 1
  store i64 %122, ptr %120, align 8, !tbaa !41
  %123 = getelementptr inbounds i8, ptr %8, i64 288
  store i32 %92, ptr %123, align 8, !tbaa !22
  switch i32 %92, label %132 [
    i32 -808, label %131
    i32 801, label %124
    i32 802, label %127
    i32 803, label %127
    i32 805, label %127
    i32 806, label %127
    i32 807, label %127
    i32 808, label %127
    i32 -801, label %128
    i32 -802, label %128
    i32 -803, label %128
    i32 -810, label %128
    i32 -811, label %128
    i32 -809, label %129
    i32 -805, label %130
  ]

124:                                              ; preds = %119
  %125 = load i32, ptr %6, align 4, !tbaa !21
  %126 = icmp ne i32 %125, 0
  %. = zext i1 %126 to i32
  br label %132

127:                                              ; preds = %119, %119, %119, %119, %119, %119
  br label %132

128:                                              ; preds = %119, %119, %119, %119, %119
  br label %132

129:                                              ; preds = %119
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -809, ptr noundef nonnull @.str, ptr noundef nonnull @.str.66, ptr noundef nonnull @.str.69) #3
  br label %132

130:                                              ; preds = %119
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -805, ptr noundef nonnull @.str, ptr noundef nonnull @.str.66, ptr noundef nonnull @.str.70) #3
  br label %132

131:                                              ; preds = %119
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -808, ptr noundef nonnull @.str, ptr noundef nonnull @.str.66, ptr noundef nonnull @.str.71) #3
  br label %132

132:                                              ; preds = %.thread114, %119, %124, %67, %131, %130, %129, %128, %127, %85, %57, %40, %10
  %.0 = phi i32 [ -2, %10 ], [ 0, %40 ], [ -9, %57 ], [ %86, %85 ], [ -1, %131 ], [ -1, %130 ], [ -1, %129 ], [ -1, %128 ], [ 1, %127 ], [ -1, %67 ], [ %., %124 ], [ 0, %119 ], [ 0, %.thread114 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  ret i32 %.0
}

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

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

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

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

declare i32 @SUNNonlinSolGetCurIter(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @SUNLinSolSetScalingVectors(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @SUNLinSolSetZeroGuess(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @SUNLinSolSolve(ptr noundef, ptr noundef, ptr noundef, ptr noundef, double noundef) local_unnamed_addr #1

declare i32 @SUNLinSolNumIters(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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, !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, !11, i64 140}
!14 = !{!6, !11, i64 148}
!15 = !{!6, !11, i64 1792}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !11, i64 0}
!18 = !{!"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}
!19 = !{!18, !10, i64 40}
!20 = !{!10, !10, i64 0}
!21 = !{!11, !11, i64 0}
!22 = !{!18, !11, i64 288}
!23 = !{!18, !10, i64 48}
!24 = !{!18, !7, i64 96}
!25 = !{!18, !7, i64 104}
!26 = !{!18, !7, i64 56}
!27 = !{!28, !7, i64 8}
!28 = !{!"_generic_SUNLinearSolver", !7, i64 0, !7, i64 8, !7, i64 16}
!29 = !{!30, !7, i64 32}
!30 = !{!"_generic_SUNLinearSolver_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, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112}
!31 = !{!18, !7, i64 88}
!32 = !{!18, !7, i64 232}
!33 = !{!6, !10, i64 1032}
!34 = !{!18, !7, i64 256}
!35 = !{!18, !12, i64 176}
!36 = !{!18, !7, i64 64}
!37 = !{!18, !11, i64 36}
!38 = !{!6, !10, i64 1336}
!39 = !{!30, !7, i64 72}
!40 = !{!18, !12, i64 152}
!41 = !{!18, !12, i64 168}


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