; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/src/kinsol (kinsol_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.KINMemRec = type { ptr, double, ptr, ptr, double, double, i32, i32, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, double, double, i32, double, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, double, ptr, ptr, ptr, ptr, ptr, double, ptr, ptr, ptr, ptr, i64, i64, i32, ptr, ptr, i32, ptr, ptr, i64, i64, i64, i64, ptr, ptr, ptr, ptr, i32, ptr, double, double, double, double, double, i32, double, double, double, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.KINLsMemRec = type { i32, i32, i32, ptr, ptr, ptr, ptr, double, i64, i64, i64, i64, i64, i64, i64, i32, i32, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr }
%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.44 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [39 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 @KINProcessError(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @kinLsSolve(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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = 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 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, 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
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.KINMemRec, ptr %18, i32 0, i32 79
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %24

22:                                               ; preds = %5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef %23, i32 noundef -2, ptr noundef @.str, ptr noundef @.str.54, ptr noundef @.str.44)
  store i32 -2, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %222

24:                                               ; preds = %5
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.KINMemRec, ptr %25, i32 0, i32 79
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  store ptr %27, ptr %12, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.KINMemRec, ptr %28, i32 0, i32 25
  %30 = load double, ptr %29, align 8, !tbaa !14
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.KINLsMemRec, ptr %31, i32 0, i32 7
  %33 = load double, ptr %32, align 8, !tbaa !15
  %34 = fmul double %30, %33
  store double %34, ptr %16, align 8, !tbaa !17
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  call void @N_VConst(double noundef 0.000000e+00, ptr noundef %35)
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.KINLsMemRec, ptr %36, i32 0, i32 5
  %38 = load ptr, ptr %37, align 8, !tbaa !18
  %39 = call i32 @SUNLinSolSetZeroGuess(ptr noundef %38, i32 noundef 1)
  store i32 %39, ptr %14, align 4, !tbaa !19
  %40 = load i32, ptr %14, align 4, !tbaa !19
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %24
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %222

43:                                               ; preds = %24
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.KINLsMemRec, ptr %44, i32 0, i32 15
  store i32 1, ptr %45, align 8, !tbaa !20
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.KINLsMemRec, ptr %46, i32 0, i32 5
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.KINLsMemRec, ptr %49, i32 0, i32 6
  %51 = load ptr, ptr %50, align 8, !tbaa !21
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load double, ptr %16, align 8, !tbaa !17
  %55 = call i32 @SUNLinSolSolve(ptr noundef %48, ptr noundef %51, ptr noundef %52, ptr noundef %53, double noundef %54)
  store i32 %55, ptr %14, align 4, !tbaa !19
  store double 0.000000e+00, ptr %15, align 8, !tbaa !17
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.KINLsMemRec, ptr %56, i32 0, i32 5
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = getelementptr inbounds %struct._generic_SUNLinearSolver, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  %61 = getelementptr inbounds %struct._generic_SUNLinearSolver_Ops, ptr %60, i32 0, i32 10
  %62 = load ptr, ptr %61, align 8, !tbaa !24
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %69

64:                                               ; preds = %43
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.KINLsMemRec, ptr %65, i32 0, i32 5
  %67 = load ptr, ptr %66, align 8, !tbaa !18
  %68 = call double @SUNLinSolResNorm(ptr noundef %67)
  store double %68, ptr %15, align 8, !tbaa !17
  br label %69

69:                                               ; preds = %64, %43
  store i32 0, ptr %13, align 4, !tbaa !19
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.KINLsMemRec, ptr %70, i32 0, i32 5
  %72 = load ptr, ptr %71, align 8, !tbaa !18
  %73 = getelementptr inbounds %struct._generic_SUNLinearSolver, ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !22
  %75 = getelementptr inbounds %struct._generic_SUNLinearSolver_Ops, ptr %74, i32 0, i32 9
  %76 = load ptr, ptr %75, align 8, !tbaa !26
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %83

78:                                               ; preds = %69
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.KINLsMemRec, ptr %79, i32 0, i32 5
  %81 = load ptr, ptr %80, align 8, !tbaa !18
  %82 = call i32 @SUNLinSolNumIters(ptr noundef %81)
  store i32 %82, ptr %13, align 4, !tbaa !19
  br label %83

83:                                               ; preds = %78, %69
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.KINLsMemRec, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 8, !tbaa !27
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %96

88:                                               ; preds = %83
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.KINMemRec, ptr %89, i32 0, i32 7
  %91 = load i32, ptr %90, align 4, !tbaa !28
  %92 = icmp sgt i32 %91, 2
  br i1 %92, label %93, label %96

93:                                               ; preds = %88
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load i32, ptr %13, align 4, !tbaa !19
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINPrintInfo(ptr noundef %94, i32 noundef 101, ptr noundef @.str, ptr noundef @.str.54, ptr noundef @.str.55, i32 noundef %95)
  br label %96

96:                                               ; preds = %93, %88, %83
  %97 = load i32, ptr %13, align 4, !tbaa !19
  %98 = sext i32 %97 to i64
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.KINLsMemRec, ptr %99, i32 0, i32 11
  %101 = load i64, ptr %100, align 8, !tbaa !29
  %102 = add nsw i64 %101, %98
  store i64 %102, ptr %100, align 8, !tbaa !29
  %103 = load i32, ptr %14, align 4, !tbaa !19
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %110

105:                                              ; preds = %96
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.KINLsMemRec, ptr %106, i32 0, i32 13
  %108 = load i64, ptr %107, align 8, !tbaa !30
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %107, align 8, !tbaa !30
  br label %110

110:                                              ; preds = %105, %96
  %111 = load i32, ptr %14, align 4, !tbaa !19
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.KINLsMemRec, ptr %112, i32 0, i32 16
  store i32 %111, ptr %113, align 4, !tbaa !31
  %114 = load i32, ptr %14, align 4, !tbaa !19
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %133

116:                                              ; preds = %110
  %117 = load i32, ptr %14, align 4, !tbaa !19
  %118 = icmp ne i32 %117, 801
  br i1 %118, label %119, label %133

119:                                              ; preds = %116
  %120 = load i32, ptr %14, align 4, !tbaa !19
  switch i32 %120, label %131 [
    i32 803, label %121
    i32 805, label %121
    i32 -801, label %122
    i32 -802, label %122
    i32 -803, label %122
    i32 -810, label %122
    i32 802, label %122
    i32 807, label %122
    i32 808, label %122
    i32 -811, label %122
    i32 806, label %123
    i32 -809, label %125
    i32 -805, label %127
    i32 -808, label %129
  ]

121:                                              ; preds = %119, %119
  store i32 1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %222

122:                                              ; preds = %119, %119, %119, %119, %119, %119, %119, %119
  br label %131

123:                                              ; preds = %119
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef %124, i32 noundef 806, ptr noundef @.str, ptr noundef @.str.54, ptr noundef @.str.56)
  br label %131

125:                                              ; preds = %119
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef %126, i32 noundef -809, ptr noundef @.str, ptr noundef @.str.54, ptr noundef @.str.56)
  br label %131

127:                                              ; preds = %119
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef %128, i32 noundef -805, ptr noundef @.str, ptr noundef @.str.54, ptr noundef @.str.57)
  br label %131

129:                                              ; preds = %119
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef %130, i32 noundef -808, ptr noundef @.str, ptr noundef @.str.54, ptr noundef @.str.58)
  br label %131

131:                                              ; preds = %129, %127, %125, %123, %122, %119
  %132 = load i32, ptr %14, align 4, !tbaa !19
  store i32 %132, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %222

133:                                              ; preds = %116, %110
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.KINMemRec, ptr %134, i32 0, i32 6
  %136 = load i32, ptr %135, align 8, !tbaa !32
  %137 = icmp ne i32 %136, 3
  br i1 %137, label %138, label %205

138:                                              ; preds = %133
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.KINMemRec, ptr %139, i32 0, i32 78
  %141 = load i32, ptr %140, align 8, !tbaa !33
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %172

143:                                              ; preds = %138
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.KINMemRec, ptr %144, i32 0, i32 12
  %146 = load i32, ptr %145, align 8, !tbaa !34
  %147 = icmp eq i32 %146, 1
  br i1 %147, label %148, label %172

148:                                              ; preds = %143
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = call i32 @kinLsATimes(ptr noundef %149, ptr noundef %150, ptr noundef %151)
  store i32 %152, ptr %14, align 4, !tbaa !19
  %153 = load i32, ptr %14, align 4, !tbaa !19
  %154 = icmp sgt i32 %153, 0
  br i1 %154, label %155, label %158

155:                                              ; preds = %148
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.KINLsMemRec, ptr %156, i32 0, i32 16
  store i32 803, ptr %157, align 4, !tbaa !31
  store i32 1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %222

158:                                              ; preds = %148
  %159 = load i32, ptr %14, align 4, !tbaa !19
  %160 = icmp slt i32 %159, 0
  br i1 %160, label %161, label %164

161:                                              ; preds = %158
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.KINLsMemRec, ptr %162, i32 0, i32 16
  store i32 -805, ptr %163, align 4, !tbaa !31
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %222

164:                                              ; preds = %158
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = load ptr, ptr %7, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.KINMemRec, ptr %167, i32 0, i32 43
  %169 = load ptr, ptr %168, align 8, !tbaa !35
  %170 = call double @N_VWL2Norm(ptr noundef %166, ptr noundef %169)
  %171 = load ptr, ptr %10, align 8, !tbaa !5
  store double %170, ptr %171, align 8, !tbaa !17
  br label %172

172:                                              ; preds = %165, %143, %138
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.KINMemRec, ptr %173, i32 0, i32 78
  %175 = load i32, ptr %174, align 8, !tbaa !33
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %182

177:                                              ; preds = %172
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.KINMemRec, ptr %178, i32 0, i32 12
  %180 = load i32, ptr %179, align 8, !tbaa !34
  %181 = icmp eq i32 %180, 1
  br i1 %181, label %187, label %182

182:                                              ; preds = %177, %172
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.KINMemRec, ptr %183, i32 0, i32 6
  %185 = load i32, ptr %184, align 8, !tbaa !32
  %186 = icmp eq i32 %185, 1
  br i1 %186, label %187, label %204

187:                                              ; preds = %182, %177
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = load ptr, ptr %7, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.KINMemRec, ptr %189, i32 0, i32 43
  %191 = load ptr, ptr %190, align 8, !tbaa !35
  %192 = load ptr, ptr %9, align 8, !tbaa !5
  call void @N_VProd(ptr noundef %188, ptr noundef %191, ptr noundef %192)
  %193 = load ptr, ptr %9, align 8, !tbaa !5
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.KINMemRec, ptr %194, i32 0, i32 43
  %196 = load ptr, ptr %195, align 8, !tbaa !35
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  call void @N_VProd(ptr noundef %193, ptr noundef %196, ptr noundef %197)
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.KINMemRec, ptr %198, i32 0, i32 40
  %200 = load ptr, ptr %199, align 8, !tbaa !36
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = call double @N_VDotProd(ptr noundef %200, ptr noundef %201)
  %203 = load ptr, ptr %11, align 8, !tbaa !5
  store double %202, ptr %203, align 8, !tbaa !17
  br label %204

204:                                              ; preds = %187, %182
  br label %205

205:                                              ; preds = %204, %133
  %206 = load ptr, ptr %7, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.KINMemRec, ptr %206, i32 0, i32 78
  %208 = load i32, ptr %207, align 8, !tbaa !33
  %209 = icmp ne i32 %208, 0
  br i1 %209, label %210, label %221

210:                                              ; preds = %205
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.KINMemRec, ptr %211, i32 0, i32 7
  %213 = load i32, ptr %212, align 4, !tbaa !28
  %214 = icmp sgt i32 %213, 2
  br i1 %214, label %215, label %221

215:                                              ; preds = %210
  %216 = load ptr, ptr %7, align 8, !tbaa !5
  %217 = load double, ptr %15, align 8, !tbaa !17
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.KINMemRec, ptr %218, i32 0, i32 25
  %220 = load double, ptr %219, align 8, !tbaa !14
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINPrintInfo(ptr noundef %216, i32 noundef 102, ptr noundef @.str, ptr noundef @.str.54, ptr noundef @.str.59, double noundef %217, double noundef %220)
  br label %221

221:                                              ; preds = %215, %210, %205
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %222

222:                                              ; preds = %221, %161, %155, %131, %121, %42, %22
  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 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %223 = load i32, ptr %6, align 4
  ret i32 %223
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @kinLsATimes(ptr noundef, ptr noundef, 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 void @N_VProd(ptr noundef, ptr noundef, ptr noundef) #1

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

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

declare double @N_VWL2Norm(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 double @SUNLinSolResNorm(ptr noundef) #1

declare i32 @SUNLinSolNumIters(ptr noundef) #1

declare void @KINPrintInfo(ptr noundef, i32 noundef, ptr noundef, 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 = { 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 584}
!10 = !{!"KINMemRec", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !12, i64 52, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !12, i64 192, !11, i64 200, !13, i64 208, !13, i64 216, !13, i64 224, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !12, i64 352, !12, i64 356, !11, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !11, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !13, i64 448, !13, i64 456, !12, i64 464, !6, i64 472, !6, i64 480, !12, i64 488, !6, i64 496, !6, i64 504, !13, i64 512, !13, i64 520, !13, i64 528, !13, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !12, i64 576, !6, i64 584, !11, i64 592, !11, i64 600, !11, i64 608, !11, i64 616, !11, i64 624, !12, i64 632, !11, i64 640, !11, i64 648, !11, i64 656, !12, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !11, i64 160}
!15 = !{!16, !11, i64 48}
!16 = !{!"KINLsMemRec", !12, i64 0, !12, i64 4, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !12, i64 112, !12, i64 116, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !12, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!17 = !{!11, !11, i64 0}
!18 = !{!16, !6, i64 32}
!19 = !{!12, !12, i64 0}
!20 = !{!16, !12, i64 112}
!21 = !{!16, !6, i64 40}
!22 = !{!23, !6, i64 8}
!23 = !{!"_generic_SUNLinearSolver", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!25, !6, i64 80}
!25 = !{!"_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}
!26 = !{!25, !6, i64 72}
!27 = !{!16, !12, i64 0}
!28 = !{!10, !12, i64 52}
!29 = !{!16, !13, i64 80}
!30 = !{!16, !13, i64 96}
!31 = !{!16, !12, i64 116}
!32 = !{!10, !12, i64 48}
!33 = !{!10, !12, i64 576}
!34 = !{!10, !12, i64 88}
!35 = !{!10, !6, i64 304}
!36 = !{!10, !6, i64 280}


; 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.44 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [39 x i8], align 1

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

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

9:                                                ; preds = %5
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef nonnull %0, i32 noundef -2, ptr noundef nonnull @.str, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.44) #2
  br label %105

10:                                               ; preds = %5
  %11 = getelementptr inbounds i8, ptr %0, i64 160
  %12 = load double, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %7, i64 48
  %14 = load double, ptr %13, align 8, !tbaa !14
  tail call void @N_VConst(double noundef 0.000000e+00, ptr noundef %1) #2
  %15 = getelementptr inbounds i8, ptr %7, i64 32
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = tail call i32 @SUNLinSolSetZeroGuess(ptr noundef %16, i32 noundef 1) #2
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %18, label %105

18:                                               ; preds = %10
  %19 = fmul double %12, %14
  %20 = getelementptr inbounds i8, ptr %7, i64 112
  store i32 1, ptr %20, align 8, !tbaa !17
  %21 = load ptr, ptr %15, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %7, i64 40
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = tail call i32 @SUNLinSolSolve(ptr noundef %21, ptr noundef %23, ptr noundef %1, ptr noundef %2, double noundef %19) #2
  %25 = load ptr, ptr %15, align 8, !tbaa !16
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !19
  %28 = getelementptr inbounds i8, ptr %27, i64 80
  %29 = load ptr, ptr %28, align 8, !tbaa !21
  %.not72 = icmp eq ptr %29, null
  br i1 %.not72, label %32, label %30

30:                                               ; preds = %18
  %31 = tail call double @SUNLinSolResNorm(ptr noundef nonnull %25) #2
  %.pre = load ptr, ptr %15, align 8, !tbaa !16
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 8
  %.pre82 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !19
  br label %32

32:                                               ; preds = %30, %18
  %33 = phi ptr [ %.pre82, %30 ], [ %27, %18 ]
  %34 = phi ptr [ %.pre, %30 ], [ %25, %18 ]
  %.067 = phi double [ %31, %30 ], [ 0.000000e+00, %18 ]
  %35 = getelementptr inbounds i8, ptr %33, i64 72
  %36 = load ptr, ptr %35, align 8, !tbaa !23
  %.not73 = icmp eq ptr %36, null
  br i1 %.not73, label %39, label %37

37:                                               ; preds = %32
  %38 = tail call i32 @SUNLinSolNumIters(ptr noundef nonnull %34) #2
  br label %39

39:                                               ; preds = %37, %32
  %.068 = phi i32 [ %38, %37 ], [ 0, %32 ]
  %40 = load i32, ptr %7, align 8, !tbaa !24
  %.not74 = icmp eq i32 %40, 0
  br i1 %.not74, label %46, label %41

41:                                               ; preds = %39
  %42 = getelementptr inbounds i8, ptr %0, i64 52
  %43 = load i32, ptr %42, align 4, !tbaa !25
  %44 = icmp sgt i32 %43, 2
  br i1 %44, label %45, label %46

45:                                               ; preds = %41
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @KINPrintInfo(ptr noundef nonnull %0, i32 noundef 101, ptr noundef nonnull @.str, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.55, i32 noundef %.068) #2
  br label %46

46:                                               ; preds = %45, %41, %39
  %47 = sext i32 %.068 to i64
  %48 = getelementptr inbounds i8, ptr %7, i64 80
  %49 = load i64, ptr %48, align 8, !tbaa !26
  %50 = add nsw i64 %49, %47
  store i64 %50, ptr %48, align 8, !tbaa !26
  %.not81 = icmp eq i32 %24, 0
  br i1 %.not81, label %.thread, label %52

.thread:                                          ; preds = %46
  %51 = getelementptr inbounds i8, ptr %7, i64 116
  store i32 0, ptr %51, align 4, !tbaa !27
  br label %62

52:                                               ; preds = %46
  %53 = getelementptr inbounds i8, ptr %7, i64 96
  %54 = load i64, ptr %53, align 8, !tbaa !28
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %53, align 8, !tbaa !28
  %56 = getelementptr inbounds i8, ptr %7, i64 116
  store i32 %24, ptr %56, align 4, !tbaa !27
  switch i32 %24, label %61 [
    i32 801, label %62
    i32 806, label %57
    i32 803, label %105
    i32 805, label %105
    i32 -808, label %60
    i32 -805, label %59
    i32 -809, label %58
  ]

57:                                               ; preds = %52
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef nonnull %0, i32 noundef 806, ptr noundef nonnull @.str, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.56) #2
  br label %61

58:                                               ; preds = %52
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef nonnull %0, i32 noundef -809, ptr noundef nonnull @.str, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.56) #2
  br label %61

59:                                               ; preds = %52
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef nonnull %0, i32 noundef -805, ptr noundef nonnull @.str, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.57) #2
  br label %61

60:                                               ; preds = %52
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef nonnull %0, i32 noundef -808, ptr noundef nonnull @.str, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.58) #2
  br label %61

61:                                               ; preds = %52, %60, %59, %58, %57
  br label %105

62:                                               ; preds = %.thread, %52
  %63 = phi ptr [ %51, %.thread ], [ %56, %52 ]
  %64 = getelementptr inbounds i8, ptr %0, i64 48
  %65 = load i32, ptr %64, align 8, !tbaa !29
  %.not75 = icmp eq i32 %65, 3
  br i1 %.not75, label %96, label %66

66:                                               ; preds = %62
  %67 = getelementptr inbounds i8, ptr %0, i64 576
  %68 = load i32, ptr %67, align 8, !tbaa !30
  %.not76 = icmp eq i32 %68, 0
  br i1 %.not76, label %.thread79, label %69

69:                                               ; preds = %66
  %70 = getelementptr inbounds i8, ptr %0, i64 88
  %71 = load i32, ptr %70, align 8, !tbaa !31
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %73, label %.thread79

73:                                               ; preds = %69
  %74 = tail call i32 @kinLsATimes(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %2)
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %73
  store i32 803, ptr %63, align 4, !tbaa !27
  br label %105

77:                                               ; preds = %73
  %78 = icmp slt i32 %74, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %77
  store i32 -805, ptr %63, align 4, !tbaa !27
  br label %105

80:                                               ; preds = %77
  %81 = getelementptr inbounds i8, ptr %0, i64 304
  %82 = load ptr, ptr %81, align 8, !tbaa !32
  %83 = tail call double @N_VWL2Norm(ptr noundef %2, ptr noundef %82) #2
  store double %83, ptr %3, align 8, !tbaa !33
  %.pr.pre = load i32, ptr %67, align 8, !tbaa !30
  %84 = icmp eq i32 %.pr.pre, 0
  br i1 %84, label %.thread79, label %85

85:                                               ; preds = %80
  %.pr = load i32, ptr %70, align 8, !tbaa !31
  %86 = icmp eq i32 %.pr, 1
  br i1 %86, label %89, label %.thread79

.thread79:                                        ; preds = %69, %66, %85, %80
  %87 = load i32, ptr %64, align 8, !tbaa !29
  %88 = icmp eq i32 %87, 1
  br i1 %88, label %89, label %96

89:                                               ; preds = %.thread79, %85
  %90 = getelementptr inbounds i8, ptr %0, i64 304
  %91 = load ptr, ptr %90, align 8, !tbaa !32
  tail call void @N_VProd(ptr noundef %2, ptr noundef %91, ptr noundef %2) #2
  %92 = load ptr, ptr %90, align 8, !tbaa !32
  tail call void @N_VProd(ptr noundef %2, ptr noundef %92, ptr noundef %2) #2
  %93 = getelementptr inbounds i8, ptr %0, i64 280
  %94 = load ptr, ptr %93, align 8, !tbaa !34
  %95 = tail call double @N_VDotProd(ptr noundef %94, ptr noundef %2) #2
  store double %95, ptr %4, align 8, !tbaa !33
  br label %96

96:                                               ; preds = %.thread79, %89, %62
  %97 = getelementptr inbounds i8, ptr %0, i64 576
  %98 = load i32, ptr %97, align 8, !tbaa !30
  %.not78 = icmp eq i32 %98, 0
  br i1 %.not78, label %105, label %99

99:                                               ; preds = %96
  %100 = getelementptr inbounds i8, ptr %0, i64 52
  %101 = load i32, ptr %100, align 4, !tbaa !25
  %102 = icmp sgt i32 %101, 2
  br i1 %102, label %103, label %105

103:                                              ; preds = %99
  %104 = load double, ptr %11, align 8, !tbaa !13
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @KINPrintInfo(ptr noundef nonnull %0, i32 noundef 102, ptr noundef nonnull @.str, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.59, double noundef %.067, double noundef %104) #2
  br label %105

105:                                              ; preds = %96, %99, %103, %52, %52, %10, %79, %76, %61, %9
  %.0 = phi i32 [ -2, %9 ], [ %24, %61 ], [ 1, %76 ], [ -1, %79 ], [ -1, %10 ], [ 1, %52 ], [ 1, %52 ], [ 0, %103 ], [ 0, %99 ], [ 0, %96 ]
  ret i32 %.0
}

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

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

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

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

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

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

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

declare double @SUNLinSolResNorm(ptr noundef) local_unnamed_addr #0

declare i32 @SUNLinSolNumIters(ptr noundef) local_unnamed_addr #0

declare void @KINPrintInfo(ptr noundef, i32 noundef, ptr noundef, 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 = { 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 584}
!6 = !{!"KINMemRec", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !11, i64 48, !11, i64 52, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !11, i64 192, !10, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !11, i64 352, !11, i64 356, !10, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !7, i64 392, !7, i64 400, !10, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !7, i64 440, !12, i64 448, !12, i64 456, !11, i64 464, !7, i64 472, !7, i64 480, !11, i64 488, !7, i64 496, !7, i64 504, !12, i64 512, !12, i64 520, !12, i64 528, !12, i64 536, !7, i64 544, !7, i64 552, !7, i64 560, !7, i64 568, !11, i64 576, !7, i64 584, !10, i64 592, !10, i64 600, !10, i64 608, !10, i64 616, !10, i64 624, !11, i64 632, !10, i64 640, !10, i64 648, !10, i64 656, !11, i64 664, !7, i64 672, !7, i64 680, !7, i64 688, !7, i64 696, !7, i64 704, !7, i64 712, !7, i64 720}
!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, !10, i64 160}
!14 = !{!15, !10, i64 48}
!15 = !{!"KINLsMemRec", !11, i64 0, !11, i64 4, !11, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !11, i64 112, !11, i64 116, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !11, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!16 = !{!15, !7, i64 32}
!17 = !{!15, !11, i64 112}
!18 = !{!15, !7, i64 40}
!19 = !{!20, !7, i64 8}
!20 = !{!"_generic_SUNLinearSolver", !7, i64 0, !7, i64 8, !7, i64 16}
!21 = !{!22, !7, i64 80}
!22 = !{!"_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}
!23 = !{!22, !7, i64 72}
!24 = !{!15, !11, i64 0}
!25 = !{!6, !11, i64 52}
!26 = !{!15, !12, i64 80}
!27 = !{!15, !11, i64 116}
!28 = !{!15, !12, i64 96}
!29 = !{!6, !11, i64 48}
!30 = !{!6, !11, i64 576}
!31 = !{!6, !11, i64 88}
!32 = !{!6, !7, i64 304}
!33 = !{!10, !10, i64 0}
!34 = !{!6, !7, i64 280}


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