; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/src/cvodes (cvodes_nls)

; 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._generic_SUNNonlinearSolver_Ops = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.CVodeMemRec = type { ptr, double, ptr, ptr, i32, i32, double, double, ptr, i32, i32, ptr, ptr, i32, i32, ptr, i32, i32, double, double, ptr, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, i32, double, i32, i32, double, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, double, ptr, ptr, ptr, [13 x ptr], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [13 x ptr], ptr, ptr, ptr, ptr, [13 x ptr], ptr, ptr, ptr, ptr, ptr, i32, [13 x ptr], ptr, ptr, ptr, ptr, ptr, i32, double, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, double, [14 x double], [6 x double], [13 x double], double, double, double, double, double, double, double, double, i32, double, double, i32, double, double, ptr, i32, i64, i32, i32, i32, double, double, double, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr, i64, i64, ptr, i64, i64, i64, i64, i64, i64, i32, double, double, double, i64, i64, i64, i64, i64, i64, ptr, i32, ptr, i32, ptr, i32, ptr, i32, i32, i64, i32, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i64, i32, i32, i64, double, double, double, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i64, i32, [6 x [4 x double]], i32, i64, ptr, i32, ptr, ptr, double, double, double, ptr, ptr, ptr, double, double, i32, i32, i64, ptr, i32, ptr, ptr, ptr, i32, ptr, i32 }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1

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

11:                                               ; preds = %2
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef null, i32 noundef -21, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.2)
  store i32 -21, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

12:                                               ; preds = %2
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %13, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %12
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef null, i32 noundef -22, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.3)
  store i32 -22, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

17:                                               ; preds = %12
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %18, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct._generic_SUNNonlinearSolver_Ops, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = icmp eq ptr %22, null
  br i1 %23, label %38, label %24

24:                                               ; preds = %17
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %25, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct._generic_SUNNonlinearSolver_Ops, ptr %27, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = icmp eq ptr %29, null
  br i1 %30, label %38, label %31

31:                                               ; preds = %24
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._generic_SUNNonlinearSolver, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct._generic_SUNNonlinearSolver_Ops, ptr %34, i32 0, i32 5
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %40

38:                                               ; preds = %31, %24, %17
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %39, i32 noundef -22, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.4)
  store i32 -22, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

40:                                               ; preds = %31
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.CVodeMemRec, ptr %41, i32 0, i32 149
  %43 = load ptr, ptr %42, align 8, !tbaa !15
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %55

45:                                               ; preds = %40
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.CVodeMemRec, ptr %46, i32 0, i32 150
  %48 = load i32, ptr %47, align 8, !tbaa !20
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %55

50:                                               ; preds = %45
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.CVodeMemRec, ptr %51, i32 0, i32 149
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = call i32 @SUNNonlinSolFree(ptr noundef %53)
  store i32 %54, ptr %7, align 4, !tbaa !21
  br label %55

55:                                               ; preds = %50, %45, %40
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.CVodeMemRec, ptr %57, i32 0, i32 149
  store ptr %56, ptr %58, align 8, !tbaa !15
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.CVodeMemRec, ptr %59, i32 0, i32 150
  store i32 0, ptr %60, align 8, !tbaa !20
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call i32 @SUNNonlinSolGetType(ptr noundef %61)
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %69

64:                                               ; preds = %55
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.CVodeMemRec, ptr %65, i32 0, i32 149
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = call i32 @SUNNonlinSolSetSysFn(ptr noundef %67, ptr noundef @cvNlsResidual)
  store i32 %68, ptr %7, align 4, !tbaa !21
  br label %81

69:                                               ; preds = %55
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = call i32 @SUNNonlinSolGetType(ptr noundef %70)
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %73, label %78

73:                                               ; preds = %69
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.CVodeMemRec, ptr %74, i32 0, i32 149
  %76 = load ptr, ptr %75, align 8, !tbaa !15
  %77 = call i32 @SUNNonlinSolSetSysFn(ptr noundef %76, ptr noundef @cvNlsFPFunction)
  store i32 %77, ptr %7, align 4, !tbaa !21
  br label %80

78:                                               ; preds = %69
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %79, i32 noundef -22, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.5)
  store i32 -22, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

80:                                               ; preds = %73
  br label %81

81:                                               ; preds = %80, %64
  %82 = load i32, ptr %7, align 4, !tbaa !21
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %81
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %85, i32 noundef -22, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.6)
  store i32 -22, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

86:                                               ; preds = %81
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.CVodeMemRec, ptr %87, i32 0, i32 149
  %89 = load ptr, ptr %88, align 8, !tbaa !15
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = call i32 @SUNNonlinSolSetConvTestFn(ptr noundef %89, ptr noundef @cvNlsConvTest, ptr noundef %90)
  store i32 %91, ptr %7, align 4, !tbaa !21
  %92 = load i32, ptr %7, align 4, !tbaa !21
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %96

94:                                               ; preds = %86
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %95, i32 noundef -22, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.7)
  store i32 -22, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

96:                                               ; preds = %86
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.CVodeMemRec, ptr %97, i32 0, i32 149
  %99 = load ptr, ptr %98, align 8, !tbaa !15
  %100 = call i32 @SUNNonlinSolSetMaxIters(ptr noundef %99, i32 noundef 3)
  store i32 %100, ptr %7, align 4, !tbaa !21
  %101 = load i32, ptr %7, align 4, !tbaa !21
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %105

103:                                              ; preds = %96
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %104, i32 noundef -22, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.8)
  store i32 -22, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

105:                                              ; preds = %96
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.CVodeMemRec, ptr %106, i32 0, i32 105
  store i32 0, ptr %107, align 8, !tbaa !22
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.CVodeMemRec, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !23
  %111 = icmp ne ptr %110, null
  br i1 %111, label %114, label %112

112:                                              ; preds = %105
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef %113, i32 noundef -22, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.9)
  store i32 -22, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

114:                                              ; preds = %105
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.CVodeMemRec, ptr %115, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !23
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.CVodeMemRec, ptr %118, i32 0, i32 160
  store ptr %117, ptr %119, align 8, !tbaa !24
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %120

120:                                              ; preds = %114, %112, %103, %94, %84, %78, %38, %16, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %121 = load i32, ptr %3, align 4
  ret i32 %121
}

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

declare void @cvProcessError(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ...) #2

declare i32 @SUNNonlinSolFree(ptr noundef) #2

declare i32 @SUNNonlinSolGetType(ptr noundef) #2

declare i32 @SUNNonlinSolSetSysFn(ptr noundef, ptr noundef) #2

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

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

declare i32 @SUNNonlinSolSetConvTestFn(ptr noundef, ptr noundef, ptr noundef) #2

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

declare i32 @SUNNonlinSolSetMaxIters(ptr noundef, i32 noundef) #2

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 8}
!10 = !{!"_generic_SUNNonlinearSolver", !6, i64 0, !6, i64 8, !6, i64 16}
!11 = !{!12, !6, i64 0}
!12 = !{!"_generic_SUNNonlinearSolver_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}
!13 = !{!12, !6, i64 24}
!14 = !{!12, !6, i64 40}
!15 = !{!16, !6, i64 1720}
!16 = !{!"CVodeMemRec", !6, i64 0, !17, i64 8, !6, i64 16, !6, i64 24, !18, i64 32, !18, i64 36, !17, i64 40, !17, i64 48, !6, i64 56, !18, i64 64, !18, i64 68, !6, i64 72, !6, i64 80, !18, i64 88, !18, i64 92, !6, i64 96, !18, i64 104, !18, i64 108, !17, i64 112, !17, i64 120, !6, i64 128, !18, i64 136, !18, i64 140, !18, i64 144, !18, i64 148, !6, i64 152, !6, i64 160, !6, i64 168, !18, i64 176, !18, i64 180, !6, i64 184, !6, i64 192, !6, i64 200, !18, i64 208, !17, i64 216, !18, i64 224, !18, i64 228, !17, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !18, i64 264, !6, i64 272, !6, i64 280, !18, i64 288, !18, i64 292, !18, i64 296, !17, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !7, i64 336, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !7, i64 512, !6, i64 616, !6, i64 624, !6, i64 632, !6, i64 640, !7, i64 648, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !18, i64 792, !7, i64 800, !6, i64 904, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !18, i64 944, !17, i64 952, !18, i64 960, !18, i64 964, !18, i64 968, !18, i64 972, !18, i64 976, !17, i64 984, !17, i64 992, !17, i64 1000, !17, i64 1008, !17, i64 1016, !17, i64 1024, !17, i64 1032, !17, i64 1040, !7, i64 1048, !7, i64 1160, !7, i64 1208, !17, i64 1312, !17, i64 1320, !17, i64 1328, !17, i64 1336, !17, i64 1344, !17, i64 1352, !17, i64 1360, !17, i64 1368, !18, i64 1376, !17, i64 1384, !17, i64 1392, !18, i64 1400, !17, i64 1408, !17, i64 1416, !6, i64 1424, !18, i64 1432, !19, i64 1440, !18, i64 1448, !18, i64 1452, !18, i64 1456, !17, i64 1464, !17, i64 1472, !17, i64 1480, !19, i64 1488, !19, i64 1496, !19, i64 1504, !19, i64 1512, !19, i64 1520, !19, i64 1528, !19, i64 1536, !19, i64 1544, !19, i64 1552, !6, i64 1560, !19, i64 1568, !19, i64 1576, !6, i64 1584, !19, i64 1592, !19, i64 1600, !19, i64 1608, !19, i64 1616, !19, i64 1624, !19, i64 1632, !18, i64 1640, !17, i64 1648, !17, i64 1656, !17, i64 1664, !19, i64 1672, !19, i64 1680, !19, i64 1688, !19, i64 1696, !19, i64 1704, !19, i64 1712, !6, i64 1720, !18, i64 1728, !6, i64 1736, !18, i64 1744, !6, i64 1752, !18, i64 1760, !6, i64 1768, !18, i64 1776, !18, i64 1780, !19, i64 1784, !18, i64 1792, !6, i64 1800, !18, i64 1808, !6, i64 1816, !6, i64 1824, !6, i64 1832, !6, i64 1840, !6, i64 1848, !6, i64 1856, !18, i64 1864, !18, i64 1868, !6, i64 1872, !6, i64 1880, !6, i64 1888, !6, i64 1896, !6, i64 1904, !19, i64 1912, !18, i64 1920, !18, i64 1924, !19, i64 1928, !17, i64 1936, !17, i64 1944, !17, i64 1952, !18, i64 1960, !18, i64 1964, !17, i64 1968, !18, i64 1976, !18, i64 1980, !18, i64 1984, !18, i64 1988, !18, i64 1992, !18, i64 1996, !18, i64 2000, !18, i64 2004, !18, i64 2008, !18, i64 2012, !18, i64 2016, !18, i64 2020, !18, i64 2024, !18, i64 2028, !18, i64 2032, !18, i64 2036, !6, i64 2040, !6, i64 2048, !6, i64 2056, !6, i64 2064, !19, i64 2072, !18, i64 2080, !7, i64 2088, !18, i64 2280, !19, i64 2288, !6, i64 2296, !18, i64 2304, !6, i64 2312, !6, i64 2320, !17, i64 2328, !17, i64 2336, !17, i64 2344, !6, i64 2352, !6, i64 2360, !6, i64 2368, !17, i64 2376, !17, i64 2384, !18, i64 2392, !18, i64 2396, !19, i64 2400, !6, i64 2408, !18, i64 2416, !6, i64 2424, !6, i64 2432, !6, i64 2440, !18, i64 2448, !6, i64 2456, !18, i64 2464}
!17 = !{!"double", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!16, !18, i64 1728}
!21 = !{!18, !18, i64 0}
!22 = !{!16, !18, i64 1376}
!23 = !{!16, !6, i64 16}
!24 = !{!16, !6, i64 1800}


; 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 [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -22, 1) i32 @CVodeSetNonlinearSolver(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = icmp eq ptr %0, null
  br i1 %3, label %4, label %5

4:                                                ; preds = %2
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef null, i32 noundef -21, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2) #2
  br label %57

5:                                                ; preds = %2
  %6 = icmp eq ptr %1, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %5
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef null, i32 noundef -22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.3) #2
  br label %57

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = load ptr, ptr %10, align 8, !tbaa !10
  %12 = icmp eq ptr %11, null
  br i1 %12, label %21, label %13

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %10, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !12
  %16 = icmp eq ptr %15, null
  br i1 %16, label %21, label %17

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %10, i64 40
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %17, %13, %8
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.4) #2
  br label %57

22:                                               ; preds = %17
  %23 = getelementptr inbounds i8, ptr %0, i64 1720
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %.not = icmp eq ptr %24, null
  br i1 %.not, label %30, label %25

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %0, i64 1728
  %27 = load i32, ptr %26, align 8, !tbaa !19
  %.not37 = icmp eq i32 %27, 0
  br i1 %.not37, label %30, label %28

28:                                               ; preds = %25
  %29 = tail call i32 @SUNNonlinSolFree(ptr noundef nonnull %24) #2
  br label %30

30:                                               ; preds = %28, %25, %22
  store ptr %1, ptr %23, align 8, !tbaa !14
  %31 = getelementptr inbounds i8, ptr %0, i64 1728
  store i32 0, ptr %31, align 8, !tbaa !19
  %32 = tail call i32 @SUNNonlinSolGetType(ptr noundef nonnull %1) #2
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %38, label %34

34:                                               ; preds = %30
  %35 = tail call i32 @SUNNonlinSolGetType(ptr noundef nonnull %1) #2
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.5) #2
  br label %57

38:                                               ; preds = %34, %30
  %cvNlsFPFunction.sink = phi ptr [ @cvNlsResidual, %30 ], [ @cvNlsFPFunction, %34 ]
  %39 = load ptr, ptr %23, align 8, !tbaa !14
  %40 = tail call i32 @SUNNonlinSolSetSysFn(ptr noundef %39, ptr noundef nonnull %cvNlsFPFunction.sink) #2
  %.not38 = icmp eq i32 %40, 0
  br i1 %.not38, label %42, label %41

41:                                               ; preds = %38
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.6) #2
  br label %57

42:                                               ; preds = %38
  %43 = load ptr, ptr %23, align 8, !tbaa !14
  %44 = tail call i32 @SUNNonlinSolSetConvTestFn(ptr noundef %43, ptr noundef nonnull @cvNlsConvTest, ptr noundef nonnull %0) #2
  %.not39 = icmp eq i32 %44, 0
  br i1 %.not39, label %46, label %45

45:                                               ; preds = %42
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.7) #2
  br label %57

46:                                               ; preds = %42
  %47 = load ptr, ptr %23, align 8, !tbaa !14
  %48 = tail call i32 @SUNNonlinSolSetMaxIters(ptr noundef %47, i32 noundef 3) #2
  %.not40 = icmp eq i32 %48, 0
  br i1 %.not40, label %50, label %49

49:                                               ; preds = %46
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.8) #2
  br label %57

50:                                               ; preds = %46
  %51 = getelementptr inbounds i8, ptr %0, i64 1376
  store i32 0, ptr %51, align 8, !tbaa !20
  %52 = getelementptr inbounds i8, ptr %0, i64 16
  %53 = load ptr, ptr %52, align 8, !tbaa !21
  %.not41 = icmp eq ptr %53, null
  br i1 %.not41, label %54, label %55

54:                                               ; preds = %50
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @cvProcessError(ptr noundef nonnull %0, i32 noundef -22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.9) #2
  br label %57

55:                                               ; preds = %50
  %56 = getelementptr inbounds i8, ptr %0, i64 1800
  store ptr %53, ptr %56, align 8, !tbaa !22
  br label %57

57:                                               ; preds = %55, %54, %49, %45, %41, %37, %21, %7, %4
  %.032 = phi i32 [ -21, %4 ], [ -22, %7 ], [ -22, %21 ], [ -22, %41 ], [ -22, %45 ], [ -22, %49 ], [ 0, %55 ], [ -22, %54 ], [ -22, %37 ]
  ret i32 %.032
}

declare void @cvProcessError(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare i32 @SUNNonlinSolFree(ptr noundef) local_unnamed_addr #1

declare i32 @SUNNonlinSolGetType(ptr noundef) local_unnamed_addr #1

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

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass