; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/src/sunnonlinsol/newton (sunnonlinsol_newton)

; 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._generic_SUNNonlinearSolver = type { ptr, ptr, ptr }
%struct._SUNNonlinearSolverContent_Newton = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i64, i64, ptr, i32, ptr }

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

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

22:                                               ; preds = %7
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %34, label %25

25:                                               ; preds = %22
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %34, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %34, label %31

31:                                               ; preds = %28
  %32 = load ptr, ptr %15, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %35

34:                                               ; preds = %31, %28, %25, %22, %7
  store i32 -901, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %237

35:                                               ; preds = %31
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = icmp eq ptr %40, null
  br i1 %41, label %66, label %42

42:                                               ; preds = %35
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = icmp eq ptr %47, null
  br i1 %48, label %66, label %49

49:                                               ; preds = %42
  %50 = load i32, ptr %14, align 4, !tbaa !11
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %59

52:                                               ; preds = %49
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !13
  %56 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %55, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = icmp eq ptr %57, null
  br i1 %58, label %66, label %59

59:                                               ; preds = %52, %49
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %62, i32 0, i32 3
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  %65 = icmp eq ptr %64, null
  br i1 %65, label %66, label %67

66:                                               ; preds = %59, %52, %42, %35
  store i32 -901, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %237

67:                                               ; preds = %59
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %70, i32 0, i32 4
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  store ptr %72, ptr %18, align 8, !tbaa !5
  store i32 0, ptr %17, align 4, !tbaa !11
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !13
  %76 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %75, i32 0, i32 8
  store i64 0, ptr %76, align 8, !tbaa !22
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !13
  %80 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %79, i32 0, i32 9
  store i64 0, ptr %80, align 8, !tbaa !23
  br label %81

81:                                               ; preds = %220, %67
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !13
  %85 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !15
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = load ptr, ptr %18, align 8, !tbaa !5
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = call i32 %86(ptr noundef %87, ptr noundef %88, ptr noundef %89)
  store i32 %90, ptr %16, align 4, !tbaa !11
  %91 = load i32, ptr %16, align 4, !tbaa !11
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %81
  br label %229

94:                                               ; preds = %81
  %95 = load i32, ptr %14, align 4, !tbaa !11
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %114

97:                                               ; preds = %94
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !13
  %101 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !19
  %103 = load i32, ptr %17, align 4, !tbaa !11
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !13
  %107 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %106, i32 0, i32 5
  %108 = load ptr, ptr %15, align 8, !tbaa !5
  %109 = call i32 %102(i32 noundef %103, ptr noundef %107, ptr noundef %108)
  store i32 %109, ptr %16, align 4, !tbaa !11
  %110 = load i32, ptr %16, align 4, !tbaa !11
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %97
  br label %229

113:                                              ; preds = %97
  br label %114

114:                                              ; preds = %113, %94
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !13
  %118 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %117, i32 0, i32 6
  store i32 0, ptr %118, align 4, !tbaa !24
  br label %119

119:                                              ; preds = %202, %114
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !13
  %123 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %122, i32 0, i32 8
  %124 = load i64, ptr %123, align 8, !tbaa !22
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %123, align 8, !tbaa !22
  %126 = load ptr, ptr %18, align 8, !tbaa !5
  %127 = load ptr, ptr %18, align 8, !tbaa !5
  call void @N_VScale(double noundef -1.000000e+00, ptr noundef %126, ptr noundef %127)
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !13
  %131 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %130, i32 0, i32 2
  %132 = load ptr, ptr %131, align 8, !tbaa !18
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = load ptr, ptr %15, align 8, !tbaa !5
  %135 = call i32 %132(ptr noundef %133, ptr noundef %134)
  store i32 %135, ptr %16, align 4, !tbaa !11
  %136 = load i32, ptr %16, align 4, !tbaa !11
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %119
  br label %203

139:                                              ; preds = %119
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = load ptr, ptr %18, align 8, !tbaa !5
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  call void @N_VLinearSum(double noundef 1.000000e+00, ptr noundef %140, double noundef 1.000000e+00, ptr noundef %141, ptr noundef %142)
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !13
  %146 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %145, i32 0, i32 3
  %147 = load ptr, ptr %146, align 8, !tbaa !20
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = load ptr, ptr %18, align 8, !tbaa !5
  %151 = load double, ptr %13, align 8, !tbaa !9
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !13
  %156 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %155, i32 0, i32 10
  %157 = load ptr, ptr %156, align 8, !tbaa !25
  %158 = call i32 %147(ptr noundef %148, ptr noundef %149, ptr noundef %150, double noundef %151, ptr noundef %152, ptr noundef %157)
  store i32 %158, ptr %16, align 4, !tbaa !11
  %159 = load i32, ptr %16, align 4, !tbaa !11
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %161, label %166

161:                                              ; preds = %139
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %162, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !13
  %165 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %164, i32 0, i32 5
  store i32 0, ptr %165, align 8, !tbaa !26
  store i32 0, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %237

166:                                              ; preds = %139
  %167 = load i32, ptr %16, align 4, !tbaa !11
  %168 = icmp ne i32 %167, 901
  br i1 %168, label %169, label %170

169:                                              ; preds = %166
  br label %203

170:                                              ; preds = %166
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !13
  %174 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %173, i32 0, i32 6
  %175 = load i32, ptr %174, align 4, !tbaa !24
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %174, align 4, !tbaa !24
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !13
  %180 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %179, i32 0, i32 6
  %181 = load i32, ptr %180, align 4, !tbaa !24
  %182 = load ptr, ptr %9, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !13
  %185 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %184, i32 0, i32 7
  %186 = load i32, ptr %185, align 8, !tbaa !27
  %187 = icmp sge i32 %181, %186
  br i1 %187, label %188, label %189

188:                                              ; preds = %170
  store i32 902, ptr %16, align 4, !tbaa !11
  br label %203

189:                                              ; preds = %170
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %190, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8, !tbaa !13
  %193 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %192, i32 0, i32 0
  %194 = load ptr, ptr %193, align 8, !tbaa !15
  %195 = load ptr, ptr %11, align 8, !tbaa !5
  %196 = load ptr, ptr %18, align 8, !tbaa !5
  %197 = load ptr, ptr %15, align 8, !tbaa !5
  %198 = call i32 %194(ptr noundef %195, ptr noundef %196, ptr noundef %197)
  store i32 %198, ptr %16, align 4, !tbaa !11
  %199 = load i32, ptr %16, align 4, !tbaa !11
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %201, label %202

201:                                              ; preds = %189
  br label %203

202:                                              ; preds = %189
  br label %119

203:                                              ; preds = %201, %188, %169, %138
  %204 = load i32, ptr %16, align 4, !tbaa !11
  %205 = icmp sgt i32 %204, 0
  br i1 %205, label %206, label %228

206:                                              ; preds = %203
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %207, i32 0, i32 0
  %209 = load ptr, ptr %208, align 8, !tbaa !13
  %210 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %209, i32 0, i32 5
  %211 = load i32, ptr %210, align 8, !tbaa !26
  %212 = icmp ne i32 %211, 0
  br i1 %212, label %228, label %213

213:                                              ; preds = %206
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !13
  %217 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %216, i32 0, i32 1
  %218 = load ptr, ptr %217, align 8, !tbaa !19
  %219 = icmp ne ptr %218, null
  br i1 %219, label %220, label %228

220:                                              ; preds = %213
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %221, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8, !tbaa !13
  %224 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %223, i32 0, i32 9
  %225 = load i64, ptr %224, align 8, !tbaa !23
  %226 = add nsw i64 %225, 1
  store i64 %226, ptr %224, align 8, !tbaa !23
  store i32 1, ptr %14, align 4, !tbaa !11
  store i32 1, ptr %17, align 4, !tbaa !11
  %227 = load ptr, ptr %11, align 8, !tbaa !5
  call void @N_VConst(double noundef 0.000000e+00, ptr noundef %227)
  br label %81

228:                                              ; preds = %213, %206, %203
  br label %229

229:                                              ; preds = %228, %112, %93
  %230 = load ptr, ptr %9, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %230, i32 0, i32 0
  %232 = load ptr, ptr %231, align 8, !tbaa !13
  %233 = getelementptr inbounds %struct._SUNNonlinearSolverContent_Newton, ptr %232, i32 0, i32 9
  %234 = load i64, ptr %233, align 8, !tbaa !23
  %235 = add nsw i64 %234, 1
  store i64 %235, ptr %233, align 8, !tbaa !23
  %236 = load i32, ptr %16, align 4, !tbaa !11
  store i32 %236, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %237

237:                                              ; preds = %229, %161, %66, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  %238 = load i32, ptr %8, align 4
  ret i32 %238
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_generic_SUNNonlinearSolver", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!16, !6, i64 0}
!16 = !{!"_SUNNonlinearSolverContent_Newton", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !17, i64 56, !17, i64 64, !6, i64 72, !12, i64 80, !6, i64 88}
!17 = !{!"long", !7, i64 0}
!18 = !{!16, !6, i64 16}
!19 = !{!16, !6, i64 8}
!20 = !{!16, !6, i64 24}
!21 = !{!16, !6, i64 32}
!22 = !{!16, !17, i64 56}
!23 = !{!16, !17, i64 64}
!24 = !{!16, !12, i64 44}
!25 = !{!16, !6, i64 72}
!26 = !{!16, !12, i64 40}
!27 = !{!16, !12, i64 48}


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

; Function Attrs: nounwind uwtable
define dso_local i32 @SUNNonlinSolSolve_Newton(ptr noundef %0, ptr noundef readnone %1, ptr noundef %2, ptr noundef %3, double noundef %4, i32 noundef %5, ptr noundef %6) local_unnamed_addr #0 {
  %8 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %9 = insertelement <4 x ptr> %8, ptr %1, i64 1
  %10 = insertelement <4 x ptr> %9, ptr %2, i64 2
  %11 = insertelement <4 x ptr> %10, ptr %3, i64 3
  %12 = icmp eq <4 x ptr> %11, zeroinitializer
  %13 = icmp eq ptr %6, null
  %14 = bitcast <4 x i1> %12 to i4
  %15 = icmp ne i4 %14, 0
  %op.rdx = or i1 %15, %13
  br i1 %op.rdx, label %95, label %16

16:                                               ; preds = %7
  %17 = load ptr, ptr %0, align 8, !tbaa !5
  %18 = load ptr, ptr %17, align 8, !tbaa !10
  %19 = icmp eq ptr %18, null
  br i1 %19, label %95, label %20

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

24:                                               ; preds = %20
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %29, label %25

25:                                               ; preds = %24
  %26 = getelementptr inbounds i8, ptr %17, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %28 = icmp eq ptr %27, null
  br i1 %28, label %95, label %29

29:                                               ; preds = %25, %24
  %30 = getelementptr inbounds i8, ptr %17, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %32 = icmp eq ptr %31, null
  br i1 %32, label %95, label %33

33:                                               ; preds = %29
  %34 = getelementptr inbounds i8, ptr %17, i64 32
  %35 = load ptr, ptr %34, align 8, !tbaa !17
  %36 = getelementptr inbounds i8, ptr %17, i64 56
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %36, i8 0, i64 16, i1 false)
  %37 = tail call i32 %18(ptr noundef nonnull %2, ptr noundef %35, ptr noundef nonnull %6) #3
  %.not7889 = icmp eq i32 %37, 0
  br i1 %.not7889, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %33, %84
  %.06791 = phi i32 [ 1, %84 ], [ 0, %33 ]
  %.06990 = phi i1 [ false, %84 ], [ %.not, %33 ]
  br i1 %.06990, label %44, label %38

38:                                               ; preds = %.lr.ph
  %39 = load ptr, ptr %0, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = getelementptr inbounds i8, ptr %39, i64 40
  %43 = tail call i32 %41(i32 noundef %.06791, ptr noundef nonnull %42, ptr noundef %6) #3
  %.not80 = icmp eq i32 %43, 0
  br i1 %.not80, label %44, label %._crit_edge

44:                                               ; preds = %38, %.lr.ph
  %45 = load ptr, ptr %0, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 44
  store i32 0, ptr %46, align 4, !tbaa !18
  br label %47

47:                                               ; preds = %73, %44
  %48 = load ptr, ptr %0, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 56
  %50 = load i64, ptr %49, align 8, !tbaa !19
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %49, align 8, !tbaa !19
  tail call void @N_VScale(double noundef -1.000000e+00, ptr noundef %35, ptr noundef %35) #3
  %52 = load ptr, ptr %0, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = tail call i32 %54(ptr noundef %35, ptr noundef %6) #3
  %.not81 = icmp eq i32 %55, 0
  br i1 %.not81, label %56, label %76

56:                                               ; preds = %47
  tail call void @N_VLinearSum(double noundef 1.000000e+00, ptr noundef %2, double noundef 1.000000e+00, ptr noundef %35, ptr noundef %2) #3
  %57 = load ptr, ptr %0, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 24
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = getelementptr inbounds i8, ptr %57, i64 72
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  %62 = tail call i32 %59(ptr noundef nonnull %0, ptr noundef %2, ptr noundef %35, double noundef %4, ptr noundef %3, ptr noundef %61) #3
  switch i32 %62, label %76 [
    i32 0, label %63
    i32 901, label %66
  ]

63:                                               ; preds = %56
  %64 = load ptr, ptr %0, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 40
  store i32 0, ptr %65, align 8, !tbaa !21
  br label %95

66:                                               ; preds = %56
  %67 = load ptr, ptr %0, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 44
  %69 = load i32, ptr %68, align 4, !tbaa !18
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %68, align 4, !tbaa !18
  %71 = getelementptr inbounds i8, ptr %67, i64 48
  %72 = load i32, ptr %71, align 8, !tbaa !22
  %.not83 = icmp slt i32 %70, %72
  br i1 %.not83, label %73, label %.thread

73:                                               ; preds = %66
  %74 = load ptr, ptr %67, align 8, !tbaa !10
  %75 = tail call i32 %74(ptr noundef %2, ptr noundef %35, ptr noundef %6) #3
  %.not84 = icmp eq i32 %75, 0
  br i1 %.not84, label %47, label %76

76:                                               ; preds = %56, %73, %47
  %.068 = phi i32 [ %55, %47 ], [ %75, %73 ], [ %62, %56 ]
  %77 = icmp sgt i32 %.068, 0
  br i1 %77, label %..thread_crit_edge, label %._crit_edge

..thread_crit_edge:                               ; preds = %76
  %.pre = load ptr, ptr %0, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %66, %..thread_crit_edge
  %78 = phi ptr [ %.pre, %..thread_crit_edge ], [ %67, %66 ]
  %.06888 = phi i32 [ %.068, %..thread_crit_edge ], [ 902, %66 ]
  %79 = getelementptr inbounds i8, ptr %78, i64 40
  %80 = load i32, ptr %79, align 8, !tbaa !21
  %.not85 = icmp eq i32 %80, 0
  br i1 %.not85, label %81, label %._crit_edge

81:                                               ; preds = %.thread
  %82 = getelementptr inbounds i8, ptr %78, i64 8
  %83 = load ptr, ptr %82, align 8, !tbaa !15
  %.not86 = icmp eq ptr %83, null
  br i1 %.not86, label %._crit_edge, label %84

84:                                               ; preds = %81
  %85 = getelementptr inbounds i8, ptr %78, i64 64
  %86 = load i64, ptr %85, align 8, !tbaa !23
  %87 = add nsw i64 %86, 1
  store i64 %87, ptr %85, align 8, !tbaa !23
  tail call void @N_VConst(double noundef 0.000000e+00, ptr noundef %2) #3
  %88 = load ptr, ptr %0, align 8, !tbaa !5
  %89 = load ptr, ptr %88, align 8, !tbaa !10
  %90 = tail call i32 %89(ptr noundef %2, ptr noundef %35, ptr noundef %6) #3
  %.not78 = icmp eq i32 %90, 0
  br i1 %.not78, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %84, %38, %81, %.thread, %76, %33
  %.1 = phi i32 [ %37, %33 ], [ %.068, %76 ], [ %.06888, %.thread ], [ %.06888, %81 ], [ %43, %38 ], [ %90, %84 ]
  %91 = load ptr, ptr %0, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 64
  %93 = load i64, ptr %92, align 8, !tbaa !23
  %94 = add nsw i64 %93, 1
  store i64 %94, ptr %92, align 8, !tbaa !23
  br label %95

95:                                               ; preds = %16, %20, %25, %29, %7, %._crit_edge, %63
  %.0 = phi i32 [ %.1, %._crit_edge ], [ 0, %63 ], [ -901, %7 ], [ -901, %29 ], [ -901, %25 ], [ -901, %20 ], [ -901, %16 ]
  ret i32 %.0
}

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

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

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

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

attributes #0 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_generic_SUNNonlinearSolver", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"_SUNNonlinearSolverContent_Newton", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !13, i64 56, !13, i64 64, !7, i64 72, !12, i64 80, !7, i64 88}
!12 = !{!"int", !8, i64 0}
!13 = !{!"long", !8, i64 0}
!14 = !{!11, !7, i64 16}
!15 = !{!11, !7, i64 8}
!16 = !{!11, !7, i64 24}
!17 = !{!11, !7, i64 32}
!18 = !{!11, !12, i64 44}
!19 = !{!11, !13, i64 56}
!20 = !{!11, !7, i64 72}
!21 = !{!11, !12, i64 40}
!22 = !{!11, !12, i64 48}
!23 = !{!11, !13, i64 64}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass