; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/src/idas (idas_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.IDAMemRec = type { ptr, double, ptr, ptr, i32, double, double, ptr, i32, i32, ptr, ptr, i32, i32, i32, ptr, ptr, i32, i32, double, double, ptr, i32, i32, i32, i32, ptr, ptr, i32, ptr, ptr, ptr, i32, double, i32, i32, double, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, double, ptr, ptr, ptr, [6 x ptr], [6 x double], [6 x double], [6 x double], [6 x double], [6 x double], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [6 x ptr], ptr, ptr, ptr, ptr, [6 x ptr], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [6 x ptr], ptr, ptr, ptr, ptr, ptr, double, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, i32, double, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32, i64, double, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, double, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, ptr, ptr, double, double, double, ptr, ptr, ptr, double, double, i32, i32, i64, ptr, i32, ptr, [5 x double], ptr, ptr, i32, ptr, i32 }
%struct.IDALsMemRec = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, double, double, double, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr }
%struct._generic_SUNMatrix = type { ptr, ptr, ptr }
%struct._generic_SUNMatrix_Ops = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [53 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 @IDAProcessError(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ...) #1

declare i32 @SUNLinSolGetType(ptr noundef) #1

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

11:                                               ; preds = %1
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @IDAProcessError(ptr noundef %12, i32 noundef -2, ptr noundef @.str, ptr noundef @.str.57, ptr noundef @.str.54)
  store i32 -2, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %137

13:                                               ; preds = %1
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.IDAMemRec, ptr %14, i32 0, i32 206
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.IDALsMemRec, ptr %17, i32 0, i32 6
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %28

21:                                               ; preds = %13
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.IDALsMemRec, ptr %22, i32 0, i32 2
  store i32 0, ptr %23, align 8, !tbaa !16
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.IDALsMemRec, ptr %24, i32 0, i32 3
  store ptr null, ptr %25, align 8, !tbaa !17
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.IDALsMemRec, ptr %26, i32 0, i32 4
  store ptr null, ptr %27, align 8, !tbaa !18
  br label %82

28:                                               ; preds = %13
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.IDALsMemRec, ptr %29, i32 0, i32 2
  %31 = load i32, ptr %30, align 8, !tbaa !16
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %75

33:                                               ; preds = %28
  store i32 0, ptr %5, align 4, !tbaa !19
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.IDALsMemRec, ptr %34, i32 0, i32 6
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = getelementptr inbounds %struct._generic_SUNMatrix, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !20
  %39 = getelementptr inbounds %struct._generic_SUNMatrix_Ops, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %64

42:                                               ; preds = %33
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.IDALsMemRec, ptr %43, i32 0, i32 6
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  %46 = call i32 @SUNMatGetID(ptr noundef %45)
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %54, label %48

48:                                               ; preds = %42
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.IDALsMemRec, ptr %49, i32 0, i32 6
  %51 = load ptr, ptr %50, align 8, !tbaa !14
  %52 = call i32 @SUNMatGetID(ptr noundef %51)
  %53 = icmp eq i32 %52, 3
  br i1 %53, label %54, label %60

54:                                               ; preds = %48, %42
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.IDALsMemRec, ptr %55, i32 0, i32 3
  store ptr @idaLsDQJac, ptr %56, align 8, !tbaa !17
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.IDALsMemRec, ptr %58, i32 0, i32 4
  store ptr %57, ptr %59, align 8, !tbaa !18
  br label %63

60:                                               ; preds = %48
  %61 = load i32, ptr %5, align 4, !tbaa !19
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %5, align 4, !tbaa !19
  br label %63

63:                                               ; preds = %60, %54
  br label %67

64:                                               ; preds = %33
  %65 = load i32, ptr %5, align 4, !tbaa !19
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %5, align 4, !tbaa !19
  br label %67

67:                                               ; preds = %64, %63
  %68 = load i32, ptr %5, align 4, !tbaa !19
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %74

70:                                               ; preds = %67
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @IDAProcessError(ptr noundef %71, i32 noundef -3, ptr noundef @.str, ptr noundef @.str.57, ptr noundef @.str.58)
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.IDALsMemRec, ptr %72, i32 0, i32 30
  store i32 -3, ptr %73, align 8, !tbaa !24
  store i32 -3, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %137

74:                                               ; preds = %67
  br label %81

75:                                               ; preds = %28
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.IDAMemRec, ptr %76, i32 0, i32 3
  %78 = load ptr, ptr %77, align 8, !tbaa !25
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.IDALsMemRec, ptr %79, i32 0, i32 4
  store ptr %78, ptr %80, align 8, !tbaa !18
  br label %81

81:                                               ; preds = %75, %74
  br label %82

82:                                               ; preds = %81, %21
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = call i32 @idaLsInitializeCounters(ptr noundef %83)
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.IDALsMemRec, ptr %85, i32 0, i32 35
  %87 = load i32, ptr %86, align 8, !tbaa !26
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %97

89:                                               ; preds = %82
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.IDALsMemRec, ptr %90, i32 0, i32 36
  store ptr null, ptr %91, align 8, !tbaa !27
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.IDALsMemRec, ptr %92, i32 0, i32 37
  store ptr @idaLsDQJtimes, ptr %93, align 8, !tbaa !28
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.IDALsMemRec, ptr %95, i32 0, i32 39
  store ptr %94, ptr %96, align 8, !tbaa !29
  br label %103

97:                                               ; preds = %82
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.IDAMemRec, ptr %98, i32 0, i32 3
  %100 = load ptr, ptr %99, align 8, !tbaa !25
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.IDALsMemRec, ptr %101, i32 0, i32 39
  store ptr %100, ptr %102, align 8, !tbaa !29
  br label %103

103:                                              ; preds = %97, %89
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.IDALsMemRec, ptr %104, i32 0, i32 6
  %106 = load ptr, ptr %105, align 8, !tbaa !14
  %107 = icmp eq ptr %106, null
  br i1 %107, label %108, label %116

108:                                              ; preds = %103
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.IDALsMemRec, ptr %109, i32 0, i32 31
  %111 = load ptr, ptr %110, align 8, !tbaa !30
  %112 = icmp eq ptr %111, null
  br i1 %112, label %113, label %116

113:                                              ; preds = %108
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.IDAMemRec, ptr %114, i32 0, i32 202
  store ptr null, ptr %115, align 8, !tbaa !31
  br label %116

116:                                              ; preds = %113, %108, %103
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.IDALsMemRec, ptr %117, i32 0, i32 5
  %119 = load ptr, ptr %118, align 8, !tbaa !32
  %120 = call i32 @SUNLinSolGetType(ptr noundef %119)
  %121 = icmp eq i32 %120, 3
  br i1 %121, label %122, label %127

122:                                              ; preds = %116
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.IDAMemRec, ptr %123, i32 0, i32 202
  store ptr null, ptr %124, align 8, !tbaa !31
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.IDALsMemRec, ptr %125, i32 0, i32 13
  store i32 0, ptr %126, align 8, !tbaa !33
  br label %127

127:                                              ; preds = %122, %116
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.IDALsMemRec, ptr %128, i32 0, i32 5
  %130 = load ptr, ptr %129, align 8, !tbaa !32
  %131 = call i32 @SUNLinSolInitialize(ptr noundef %130)
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.IDALsMemRec, ptr %132, i32 0, i32 30
  store i32 %131, ptr %133, align 8, !tbaa !24
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.IDALsMemRec, ptr %134, i32 0, i32 30
  %136 = load i32, ptr %135, align 8, !tbaa !24
  store i32 %136, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %137

137:                                              ; preds = %127, %70, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %138 = load i32, ptr %2, align 4
  ret i32 %138
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @idaLsDQJac(double noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @idaLsDQJtimes(double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

declare i32 @SUNLinSolInitialize(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 1832}
!10 = !{!"IDAMemRec", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !11, i64 40, !11, i64 48, !6, i64 56, !12, i64 64, !12, i64 68, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !12, i64 124, !11, i64 128, !11, i64 136, !6, i64 144, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !6, i64 168, !6, i64 176, !12, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !12, i64 216, !11, i64 224, !12, i64 232, !12, i64 236, !11, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !12, i64 272, !6, i64 280, !6, i64 288, !12, i64 296, !12, i64 300, !12, i64 304, !11, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !7, i64 344, !7, i64 392, !7, i64 440, !7, i64 488, !7, i64 536, !7, i64 584, !6, i64 632, !6, i64 640, !6, i64 648, !6, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !6, i64 760, !7, i64 768, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !7, i64 848, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !6, i64 984, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !7, i64 1024, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !6, i64 1104, !11, i64 1112, !6, i64 1120, !6, i64 1128, !12, i64 1136, !12, i64 1140, !12, i64 1144, !12, i64 1148, !12, i64 1152, !12, i64 1156, !12, i64 1160, !12, i64 1164, !11, i64 1168, !11, i64 1176, !11, i64 1184, !12, i64 1192, !11, i64 1200, !12, i64 1208, !12, i64 1212, !12, i64 1216, !12, i64 1220, !12, i64 1224, !11, i64 1232, !11, i64 1240, !11, i64 1248, !11, i64 1256, !11, i64 1264, !11, i64 1272, !11, i64 1280, !11, i64 1288, !11, i64 1296, !11, i64 1304, !11, i64 1312, !11, i64 1320, !11, i64 1328, !11, i64 1336, !11, i64 1344, !11, i64 1352, !11, i64 1360, !12, i64 1368, !12, i64 1372, !12, i64 1376, !12, i64 1380, !13, i64 1384, !11, i64 1392, !13, i64 1400, !13, i64 1408, !13, i64 1416, !13, i64 1424, !13, i64 1432, !13, i64 1440, !13, i64 1448, !13, i64 1456, !13, i64 1464, !13, i64 1472, !13, i64 1480, !13, i64 1488, !13, i64 1496, !13, i64 1504, !13, i64 1512, !13, i64 1520, !13, i64 1528, !13, i64 1536, !13, i64 1544, !13, i64 1552, !13, i64 1560, !13, i64 1568, !13, i64 1576, !13, i64 1584, !11, i64 1592, !6, i64 1600, !6, i64 1608, !6, i64 1616, !12, i64 1624, !12, i64 1628, !12, i64 1632, !12, i64 1636, !12, i64 1640, !12, i64 1644, !12, i64 1648, !12, i64 1652, !12, i64 1656, !12, i64 1660, !12, i64 1664, !12, i64 1668, !12, i64 1672, !6, i64 1680, !12, i64 1688, !6, i64 1696, !12, i64 1704, !6, i64 1712, !12, i64 1720, !6, i64 1728, !6, i64 1736, !6, i64 1744, !6, i64 1752, !6, i64 1760, !6, i64 1768, !12, i64 1776, !12, i64 1780, !6, i64 1784, !6, i64 1792, !6, i64 1800, !6, i64 1808, !6, i64 1816, !6, i64 1824, !6, i64 1832, !12, i64 1840, !12, i64 1844, !6, i64 1848, !12, i64 1856, !6, i64 1864, !6, i64 1872, !11, i64 1880, !11, i64 1888, !11, i64 1896, !6, i64 1904, !6, i64 1912, !6, i64 1920, !11, i64 1928, !11, i64 1936, !12, i64 1944, !12, i64 1948, !13, i64 1952, !6, i64 1960, !12, i64 1968, !6, i64 1976, !7, i64 1984, !6, i64 2024, !6, i64 2032, !12, i64 2040, !6, i64 2048, !12, i64 2056}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 40}
!15 = !{!"IDALsMemRec", !12, i64 0, !12, i64 4, !12, 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, !12, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !13, i64 224, !12, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !12, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304}
!16 = !{!15, !12, i64 8}
!17 = !{!15, !6, i64 16}
!18 = !{!15, !6, i64 24}
!19 = !{!12, !12, i64 0}
!20 = !{!21, !6, i64 8}
!21 = !{!"_generic_SUNMatrix", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!23, !6, i64 0}
!23 = !{!"_generic_SUNMatrix_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}
!24 = !{!15, !12, i64 232}
!25 = !{!10, !6, i64 24}
!26 = !{!15, !12, i64 272}
!27 = !{!15, !6, i64 280}
!28 = !{!15, !6, i64 288}
!29 = !{!15, !6, i64 304}
!30 = !{!15, !6, i64 240}
!31 = !{!10, !6, i64 1800}
!32 = !{!15, !6, i64 32}
!33 = !{!15, !12, i64 96}


; 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.54 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [53 x i8], align 1

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

declare i32 @SUNLinSolGetType(ptr noundef) local_unnamed_addr #0

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

5:                                                ; preds = %1
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @IDAProcessError(ptr noundef nonnull %0, i32 noundef -2, ptr noundef nonnull @.str, ptr noundef nonnull @.str.57, ptr noundef nonnull @.str.54) #3
  br label %66

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %3, i64 40
  %8 = load ptr, ptr %7, align 8, !tbaa !13
  %9 = icmp eq ptr %8, null
  %10 = getelementptr inbounds i8, ptr %3, i64 8
  br i1 %9, label %11, label %13

11:                                               ; preds = %6
  store i32 0, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %3, i64 16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %12, i8 0, i64 16, i1 false)
  br label %34

13:                                               ; preds = %6
  %14 = load i32, ptr %10, align 8, !tbaa !15
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %30, label %15

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %8, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = load ptr, ptr %17, align 8, !tbaa !18
  %.not41 = icmp eq ptr %18, null
  br i1 %.not41, label %28, label %19

19:                                               ; preds = %15
  %20 = tail call i32 @SUNMatGetID(ptr noundef nonnull %8) #3
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %.critedge, label %22

22:                                               ; preds = %19
  %23 = load ptr, ptr %7, align 8, !tbaa !13
  %24 = tail call i32 @SUNMatGetID(ptr noundef %23) #3
  %25 = icmp eq i32 %24, 3
  br i1 %25, label %.critedge, label %28

.critedge:                                        ; preds = %22, %19
  %26 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr @idaLsDQJac, ptr %26, align 8, !tbaa !20
  %27 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %0, ptr %27, align 8, !tbaa !21
  br label %34

28:                                               ; preds = %22, %15
  tail call void (ptr, i32, ptr, ptr, ptr, ...) @IDAProcessError(ptr noundef nonnull %0, i32 noundef -3, ptr noundef nonnull @.str, ptr noundef nonnull @.str.57, ptr noundef nonnull @.str.58) #3
  %29 = getelementptr inbounds i8, ptr %3, i64 232
  store i32 -3, ptr %29, align 8, !tbaa !22
  br label %66

30:                                               ; preds = %13
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %32, ptr %33, align 8, !tbaa !21
  br label %34

34:                                               ; preds = %.critedge, %30, %11
  %35 = tail call i32 @idaLsInitializeCounters(ptr noundef nonnull %3)
  %36 = getelementptr inbounds i8, ptr %3, i64 272
  %37 = load i32, ptr %36, align 8, !tbaa !24
  %.not43 = icmp eq i32 %37, 0
  br i1 %.not43, label %41, label %38

38:                                               ; preds = %34
  %39 = getelementptr inbounds i8, ptr %3, i64 280
  store ptr null, ptr %39, align 8, !tbaa !25
  %40 = getelementptr inbounds i8, ptr %3, i64 288
  store ptr @idaLsDQJtimes, ptr %40, align 8, !tbaa !26
  br label %44

41:                                               ; preds = %34
  %42 = getelementptr inbounds i8, ptr %0, i64 24
  %43 = load ptr, ptr %42, align 8, !tbaa !23
  br label %44

44:                                               ; preds = %41, %38
  %.sink = phi ptr [ %43, %41 ], [ %0, %38 ]
  %45 = getelementptr inbounds i8, ptr %3, i64 304
  store ptr %.sink, ptr %45, align 8
  %46 = load ptr, ptr %7, align 8, !tbaa !13
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %54

48:                                               ; preds = %44
  %49 = getelementptr inbounds i8, ptr %3, i64 240
  %50 = load ptr, ptr %49, align 8, !tbaa !27
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %54

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %0, i64 1800
  store ptr null, ptr %53, align 8, !tbaa !28
  br label %54

54:                                               ; preds = %52, %48, %44
  %55 = getelementptr inbounds i8, ptr %3, i64 32
  %56 = load ptr, ptr %55, align 8, !tbaa !29
  %57 = tail call i32 @SUNLinSolGetType(ptr noundef %56) #3
  %58 = icmp eq i32 %57, 3
  br i1 %58, label %59, label %62

59:                                               ; preds = %54
  %60 = getelementptr inbounds i8, ptr %0, i64 1800
  store ptr null, ptr %60, align 8, !tbaa !28
  %61 = getelementptr inbounds i8, ptr %3, i64 96
  store i32 0, ptr %61, align 8, !tbaa !30
  br label %62

62:                                               ; preds = %59, %54
  %63 = load ptr, ptr %55, align 8, !tbaa !29
  %64 = tail call i32 @SUNLinSolInitialize(ptr noundef %63) #3
  %65 = getelementptr inbounds i8, ptr %3, i64 232
  store i32 %64, ptr %65, align 8, !tbaa !22
  br label %66

66:                                               ; preds = %62, %28, %5
  %.038 = phi i32 [ -2, %5 ], [ %64, %62 ], [ -3, %28 ]
  ret i32 %.038
}

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

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

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

declare i32 @SUNMatGetID(ptr noundef) local_unnamed_addr #0

declare i32 @SUNLinSolInitialize(ptr noundef) local_unnamed_addr #0

; 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 = { "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 = { 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 1832}
!6 = !{!"IDAMemRec", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !10, i64 40, !10, i64 48, !7, i64 56, !11, i64 64, !11, i64 68, !7, i64 72, !7, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !7, i64 104, !7, i64 112, !11, i64 120, !11, i64 124, !10, i64 128, !10, i64 136, !7, i64 144, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !7, i64 168, !7, i64 176, !11, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !11, i64 216, !10, i64 224, !11, i64 232, !11, i64 236, !10, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !11, i64 272, !7, i64 280, !7, i64 288, !11, i64 296, !11, i64 300, !11, i64 304, !10, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !8, i64 344, !8, i64 392, !8, i64 440, !8, i64 488, !8, i64 536, !8, i64 584, !7, i64 632, !7, i64 640, !7, i64 648, !7, i64 656, !7, i64 664, !7, i64 672, !7, i64 680, !7, i64 688, !7, i64 696, !7, i64 704, !7, i64 712, !7, i64 720, !7, i64 728, !7, i64 736, !7, i64 744, !7, i64 752, !7, i64 760, !8, i64 768, !7, i64 816, !7, i64 824, !7, i64 832, !7, i64 840, !8, i64 848, !7, i64 896, !7, i64 904, !7, i64 912, !7, i64 920, !7, i64 928, !7, i64 936, !7, i64 944, !7, i64 952, !7, i64 960, !7, i64 968, !7, i64 976, !7, i64 984, !7, i64 992, !7, i64 1000, !7, i64 1008, !7, i64 1016, !8, i64 1024, !7, i64 1072, !7, i64 1080, !7, i64 1088, !7, i64 1096, !7, i64 1104, !10, i64 1112, !7, i64 1120, !7, i64 1128, !11, i64 1136, !11, i64 1140, !11, i64 1144, !11, i64 1148, !11, i64 1152, !11, i64 1156, !11, i64 1160, !11, i64 1164, !10, i64 1168, !10, i64 1176, !10, i64 1184, !11, i64 1192, !10, i64 1200, !11, i64 1208, !11, i64 1212, !11, i64 1216, !11, i64 1220, !11, i64 1224, !10, i64 1232, !10, i64 1240, !10, i64 1248, !10, i64 1256, !10, i64 1264, !10, i64 1272, !10, i64 1280, !10, i64 1288, !10, i64 1296, !10, i64 1304, !10, i64 1312, !10, i64 1320, !10, i64 1328, !10, i64 1336, !10, i64 1344, !10, i64 1352, !10, i64 1360, !11, i64 1368, !11, i64 1372, !11, i64 1376, !11, i64 1380, !12, i64 1384, !10, i64 1392, !12, i64 1400, !12, i64 1408, !12, i64 1416, !12, i64 1424, !12, i64 1432, !12, i64 1440, !12, i64 1448, !12, i64 1456, !12, i64 1464, !12, i64 1472, !12, i64 1480, !12, i64 1488, !12, i64 1496, !12, i64 1504, !12, i64 1512, !12, i64 1520, !12, i64 1528, !12, i64 1536, !12, i64 1544, !12, i64 1552, !12, i64 1560, !12, i64 1568, !12, i64 1576, !12, i64 1584, !10, i64 1592, !7, i64 1600, !7, i64 1608, !7, i64 1616, !11, i64 1624, !11, i64 1628, !11, i64 1632, !11, i64 1636, !11, i64 1640, !11, i64 1644, !11, i64 1648, !11, i64 1652, !11, i64 1656, !11, i64 1660, !11, i64 1664, !11, i64 1668, !11, i64 1672, !7, i64 1680, !11, i64 1688, !7, i64 1696, !11, i64 1704, !7, i64 1712, !11, i64 1720, !7, i64 1728, !7, i64 1736, !7, i64 1744, !7, i64 1752, !7, i64 1760, !7, i64 1768, !11, i64 1776, !11, i64 1780, !7, i64 1784, !7, i64 1792, !7, i64 1800, !7, i64 1808, !7, i64 1816, !7, i64 1824, !7, i64 1832, !11, i64 1840, !11, i64 1844, !7, i64 1848, !11, i64 1856, !7, i64 1864, !7, i64 1872, !10, i64 1880, !10, i64 1888, !10, i64 1896, !7, i64 1904, !7, i64 1912, !7, i64 1920, !10, i64 1928, !10, i64 1936, !11, i64 1944, !11, i64 1948, !12, i64 1952, !7, i64 1960, !11, i64 1968, !7, i64 1976, !8, i64 1984, !7, i64 2024, !7, i64 2032, !11, i64 2040, !7, i64 2048, !11, i64 2056}
!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 = !{!14, !7, i64 40}
!14 = !{!"IDALsMemRec", !11, i64 0, !11, i64 4, !11, 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, !11, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !11, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !11, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304}
!15 = !{!14, !11, i64 8}
!16 = !{!17, !7, i64 8}
!17 = !{!"_generic_SUNMatrix", !7, i64 0, !7, i64 8, !7, i64 16}
!18 = !{!19, !7, i64 0}
!19 = !{!"_generic_SUNMatrix_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}
!20 = !{!14, !7, i64 16}
!21 = !{!14, !7, i64 24}
!22 = !{!14, !11, i64 232}
!23 = !{!6, !7, i64 24}
!24 = !{!14, !11, i64 272}
!25 = !{!14, !7, i64 280}
!26 = !{!14, !7, i64 288}
!27 = !{!14, !7, i64 240}
!28 = !{!6, !7, i64 1800}
!29 = !{!14, !7, i64 32}
!30 = !{!14, !11, i64 96}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass,TailCallElimPass