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

; 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_FixedPoint = type { ptr, ptr, i32, ptr, i32, double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, 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_FixedPoint(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 ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = 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 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %35, label %23

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

26:                                               ; preds = %23
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %35, label %29

29:                                               ; preds = %26
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %35, label %32

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

35:                                               ; preds = %32, %29, %26, %23, %7
  store i32 -901, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %197

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

43:                                               ; preds = %36
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %51

50:                                               ; preds = %43, %36
  store i32 -901, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %197

51:                                               ; preds = %43
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !13
  %55 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = icmp eq ptr %56, null
  br i1 %57, label %65, label %58

58:                                               ; preds = %51
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !13
  %62 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = icmp eq ptr %63, null
  br i1 %64, label %65, label %66

65:                                               ; preds = %58, %51
  store i32 -901, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %197

66:                                               ; preds = %58
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !13
  %70 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %69, i32 0, i32 13
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  store ptr %71, ptr %17, align 8, !tbaa !5
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  %75 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %74, i32 0, i32 14
  %76 = load ptr, ptr %75, align 8, !tbaa !20
  store ptr %76, ptr %18, align 8, !tbaa !5
  %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_FixedPoint, ptr %79, i32 0, i32 17
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  store ptr %81, ptr %19, align 8, !tbaa !5
  %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_FixedPoint, ptr %84, i32 0, i32 20
  store i64 0, ptr %85, align 8, !tbaa !22
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !13
  %89 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %88, i32 0, i32 21
  store i64 0, ptr %89, align 8, !tbaa !23
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !13
  %93 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %92, i32 0, i32 18
  store i32 0, ptr %93, align 8, !tbaa !24
  br label %94

94:                                               ; preds = %183, %66
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !13
  %98 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %97, i32 0, i32 18
  %99 = load i32, ptr %98, align 8, !tbaa !24
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !13
  %103 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %102, i32 0, i32 19
  %104 = load i32, ptr %103, align 4, !tbaa !25
  %105 = icmp slt i32 %99, %104
  br i1 %105, label %106, label %190

106:                                              ; preds = %94
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  call void @N_VScale(double noundef 1.000000e+00, ptr noundef %107, ptr noundef %108)
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !13
  %112 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !15
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = load ptr, ptr %18, align 8, !tbaa !5
  %116 = load ptr, ptr %15, align 8, !tbaa !5
  %117 = call i32 %113(ptr noundef %114, ptr noundef %115, ptr noundef %116)
  store i32 %117, ptr %16, align 4, !tbaa !11
  %118 = load i32, ptr %16, align 4, !tbaa !11
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %106
  br label %190

121:                                              ; preds = %106
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !13
  %125 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %124, i32 0, i32 2
  %126 = load i32, ptr %125, align 8, !tbaa !26
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %131

128:                                              ; preds = %121
  %129 = load ptr, ptr %18, align 8, !tbaa !5
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  call void @N_VScale(double noundef 1.000000e+00, ptr noundef %129, ptr noundef %130)
  br label %142

131:                                              ; preds = %121
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = load ptr, ptr %17, align 8, !tbaa !5
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !13
  %139 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %138, i32 0, i32 18
  %140 = load i32, ptr %139, align 8, !tbaa !24
  %141 = call i32 @AndersonAccelerate(ptr noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef %135, i32 noundef %140)
  store i32 %141, ptr %16, align 4, !tbaa !11
  br label %142

142:                                              ; preds = %131, %128
  %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_FixedPoint, ptr %145, i32 0, i32 20
  %147 = load i64, ptr %146, align 8, !tbaa !22
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %146, align 8, !tbaa !22
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = load ptr, ptr %17, align 8, !tbaa !5
  %151 = load ptr, ptr %19, align 8, !tbaa !5
  call void @N_VLinearSum(double noundef 1.000000e+00, ptr noundef %149, double noundef -1.000000e+00, ptr noundef %150, ptr noundef %151)
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !13
  %155 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !18
  %157 = load ptr, ptr %9, align 8, !tbaa !5
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  %159 = load ptr, ptr %19, align 8, !tbaa !5
  %160 = load double, ptr %13, align 8, !tbaa !9
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  %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_FixedPoint, ptr %164, i32 0, i32 22
  %166 = load ptr, ptr %165, align 8, !tbaa !27
  %167 = call i32 %156(ptr noundef %157, ptr noundef %158, ptr noundef %159, double noundef %160, ptr noundef %161, ptr noundef %166)
  store i32 %167, ptr %16, align 4, !tbaa !11
  %168 = load i32, ptr %16, align 4, !tbaa !11
  %169 = icmp eq i32 %168, 0
  br i1 %169, label %170, label %171

170:                                              ; preds = %142
  store i32 0, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %197

171:                                              ; preds = %142
  %172 = load i32, ptr %16, align 4, !tbaa !11
  %173 = icmp ne i32 %172, 901
  br i1 %173, label %174, label %182

174:                                              ; preds = %171
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %175, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8, !tbaa !13
  %178 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %177, i32 0, i32 21
  %179 = load i64, ptr %178, align 8, !tbaa !23
  %180 = add nsw i64 %179, 1
  store i64 %180, ptr %178, align 8, !tbaa !23
  %181 = load i32, ptr %16, align 4, !tbaa !11
  store i32 %181, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %197

182:                                              ; preds = %171
  br label %183

183:                                              ; preds = %182
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !13
  %187 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %186, i32 0, i32 18
  %188 = load i32, ptr %187, align 8, !tbaa !24
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %187, align 8, !tbaa !24
  br label %94, !llvm.loop !28

190:                                              ; preds = %120, %94
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !13
  %194 = getelementptr inbounds %struct._SUNNonlinearSolverContent_FixedPoint, ptr %193, i32 0, i32 21
  %195 = load i64, ptr %194, align 8, !tbaa !23
  %196 = add nsw i64 %195, 1
  store i64 %196, ptr %194, align 8, !tbaa !23
  store i32 902, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %197

197:                                              ; preds = %190, %174, %170, %65, %50, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  %198 = load i32, ptr %8, align 4
  ret i32 %198
}

; 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

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

declare void @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr 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_FixedPoint", !6, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !12, i64 32, !10, 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, !6, i64 120, !6, i64 128, !6, i64 136, !12, i64 144, !12, i64 148, !17, i64 152, !17, i64 160, !6, i64 168, !12, i64 176, !6, i64 184}
!17 = !{!"long", !7, i64 0}
!18 = !{!16, !6, i64 8}
!19 = !{!16, !6, i64 104}
!20 = !{!16, !6, i64 112}
!21 = !{!16, !6, i64 136}
!22 = !{!16, !17, i64 152}
!23 = !{!16, !17, i64 160}
!24 = !{!16, !12, i64 144}
!25 = !{!16, !12, i64 148}
!26 = !{!16, !12, i64 16}
!27 = !{!16, !6, i64 168}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; 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 noundef i32 @SUNNonlinSolSolve_FixedPoint(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 %.loopexit, 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 %.loopexit, label %20

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

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %17, i64 104
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = getelementptr inbounds i8, ptr %17, i64 112
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  %29 = getelementptr inbounds i8, ptr %17, i64 136
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %17, i64 152
  %32 = getelementptr inbounds i8, ptr %17, i64 144
  store i32 0, ptr %32, align 8, !tbaa !19
  %33 = getelementptr inbounds i8, ptr %17, i64 148
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %31, i8 0, i64 16, i1 false)
  %34 = load i32, ptr %33, align 4, !tbaa !20
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %24, %64
  tail call void @N_VScale(double noundef 1.000000e+00, ptr noundef %2, ptr noundef %26) #3
  %36 = load ptr, ptr %0, align 8, !tbaa !5
  %37 = load ptr, ptr %36, align 8, !tbaa !10
  %38 = tail call i32 %37(ptr noundef %2, ptr noundef %28, ptr noundef %6) #3
  %.not = icmp eq i32 %38, 0
  %.pre.pre = load ptr, ptr %0, align 8, !tbaa !5
  br i1 %.not, label %39, label %._crit_edge.loopexit

39:                                               ; preds = %.lr.ph
  %40 = getelementptr inbounds i8, ptr %.pre.pre, i64 16
  %41 = load i32, ptr %40, align 8, !tbaa !21
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  tail call void @N_VScale(double noundef 1.000000e+00, ptr noundef %28, ptr noundef %2) #3
  br label %48

44:                                               ; preds = %39
  %45 = getelementptr inbounds i8, ptr %.pre.pre, i64 144
  %46 = load i32, ptr %45, align 8, !tbaa !19
  %47 = tail call i32 @AndersonAccelerate(ptr noundef nonnull %0, ptr noundef %28, ptr noundef %2, ptr noundef %26, i32 noundef %46)
  br label %48

48:                                               ; preds = %44, %43
  %49 = load ptr, ptr %0, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 152
  %51 = load i64, ptr %50, align 8, !tbaa !22
  %52 = add nsw i64 %51, 1
  store i64 %52, ptr %50, align 8, !tbaa !22
  tail call void @N_VLinearSum(double noundef 1.000000e+00, ptr noundef %2, double noundef -1.000000e+00, ptr noundef %26, ptr noundef %30) #3
  %53 = load ptr, ptr %0, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load ptr, ptr %54, align 8, !tbaa !15
  %56 = getelementptr inbounds i8, ptr %53, i64 168
  %57 = load ptr, ptr %56, align 8, !tbaa !23
  %58 = tail call i32 %55(ptr noundef nonnull %0, ptr noundef %2, ptr noundef %30, double noundef %4, ptr noundef %3, ptr noundef %57) #3
  switch i32 %58, label %59 [
    i32 0, label %.loopexit
    i32 901, label %64
  ]

59:                                               ; preds = %48
  %60 = load ptr, ptr %0, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 160
  %62 = load i64, ptr %61, align 8, !tbaa !24
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %61, align 8, !tbaa !24
  br label %.loopexit

64:                                               ; preds = %48
  %65 = load ptr, ptr %0, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 144
  %67 = load i32, ptr %66, align 8, !tbaa !19
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %66, align 8, !tbaa !19
  %69 = getelementptr inbounds i8, ptr %65, i64 148
  %70 = load i32, ptr %69, align 4, !tbaa !20
  %71 = icmp slt i32 %68, %70
  br i1 %71, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !25

._crit_edge.loopexit:                             ; preds = %.lr.ph, %64
  %.pre = phi ptr [ %.pre.pre, %.lr.ph ], [ %65, %64 ]
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 160
  %.pre64 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !24
  %72 = add nsw i64 %.pre64, 1
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %24
  %73 = phi i64 [ %72, %._crit_edge.loopexit ], [ 1, %24 ]
  %74 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ %17, %24 ]
  %75 = getelementptr inbounds i8, ptr %74, i64 160
  store i64 %73, ptr %75, align 8, !tbaa !24
  br label %.loopexit

.loopexit:                                        ; preds = %48, %16, %20, %7, %._crit_edge, %59
  %.0 = phi i32 [ 902, %._crit_edge ], [ %58, %59 ], [ -901, %7 ], [ -901, %20 ], [ -901, %16 ], [ %58, %48 ]
  ret i32 %.0
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @AndersonAccelerate(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr 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_FixedPoint", !7, i64 0, !7, i64 8, !12, i64 16, !7, i64 24, !12, i64 32, !13, 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, !7, i64 120, !7, i64 128, !7, i64 136, !12, i64 144, !12, i64 148, !14, i64 152, !14, i64 160, !7, i64 168, !12, i64 176, !7, i64 184}
!12 = !{!"int", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!11, !7, i64 8}
!16 = !{!11, !7, i64 104}
!17 = !{!11, !7, i64 112}
!18 = !{!11, !7, i64 136}
!19 = !{!11, !12, i64 144}
!20 = !{!11, !12, i64 148}
!21 = !{!11, !12, i64 16}
!22 = !{!11, !14, i64 152}
!23 = !{!11, !7, i64 168}
!24 = !{!11, !14, i64 160}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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