; 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._generic_N_Vector = type { ptr, ptr, ptr }
%struct._generic_N_Vector_Ops = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%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_SUNLinearSolver = type { ptr, ptr, ptr }
%struct._generic_SUNLinearSolver_Ops = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.29 = external hidden unnamed_addr constant [19 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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @IDAGetLinWorkSpace(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call i32 @idaLs_AccessLMem(ptr noundef %16, ptr noundef @.str.29, ptr noundef %8, ptr noundef %9)
  store i32 %17, ptr %14, align 4, !tbaa !9
  %18 = load i32, ptr %14, align 4, !tbaa !9
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %3
  %21 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %21, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %74

22:                                               ; preds = %3
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  store i64 3, ptr %23, align 8, !tbaa !11
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 34, ptr %24, align 8, !tbaa !11
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.IDAMemRec, ptr %25, i32 0, i32 66
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds %struct._generic_N_Vector, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = getelementptr inbounds %struct._generic_N_Vector_Ops, ptr %29, i32 0, i32 4
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %47

33:                                               ; preds = %22
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.IDAMemRec, ptr %34, i32 0, i32 66
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  call void @N_VSpace(ptr noundef %36, ptr noundef %10, ptr noundef %11)
  %37 = load i64, ptr %10, align 8, !tbaa !11
  %38 = mul nsw i64 3, %37
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load i64, ptr %39, align 8, !tbaa !11
  %41 = add nsw i64 %40, %38
  store i64 %41, ptr %39, align 8, !tbaa !11
  %42 = load i64, ptr %11, align 8, !tbaa !11
  %43 = mul nsw i64 3, %42
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = load i64, ptr %44, align 8, !tbaa !11
  %46 = add nsw i64 %45, %43
  store i64 %46, ptr %44, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %33, %22
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.IDALsMemRec, ptr %48, i32 0, i32 5
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = getelementptr inbounds %struct._generic_SUNLinearSolver, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !22
  %53 = getelementptr inbounds %struct._generic_SUNLinearSolver_Ops, ptr %52, i32 0, i32 12
  %54 = load ptr, ptr %53, align 8, !tbaa !24
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %73

56:                                               ; preds = %47
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.IDALsMemRec, ptr %57, i32 0, i32 5
  %59 = load ptr, ptr %58, align 8, !tbaa !20
  %60 = call i32 @SUNLinSolSpace(ptr noundef %59, ptr noundef %12, ptr noundef %13)
  store i32 %60, ptr %14, align 4, !tbaa !9
  %61 = load i32, ptr %14, align 4, !tbaa !9
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %72

63:                                               ; preds = %56
  %64 = load i64, ptr %12, align 8, !tbaa !11
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %67 = add nsw i64 %66, %64
  store i64 %67, ptr %65, align 8, !tbaa !11
  %68 = load i64, ptr %13, align 8, !tbaa !11
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load i64, ptr %69, align 8, !tbaa !11
  %71 = add nsw i64 %70, %68
  store i64 %71, ptr %69, align 8, !tbaa !11
  br label %72

72:                                               ; preds = %63, %56
  br label %73

73:                                               ; preds = %72, %47
  store i32 0, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %74

74:                                               ; preds = %73, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %75 = load i32, ptr %4, align 4
  ret i32 %75
}

declare void @N_VSpace(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @SUNLinSolSpace(ptr 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 712}
!14 = !{!"IDAMemRec", !6, i64 0, !15, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !15, i64 40, !15, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !6, i64 104, !6, i64 112, !10, i64 120, !10, i64 124, !15, i64 128, !15, i64 136, !6, i64 144, !10, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !6, i64 168, !6, i64 176, !10, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !10, i64 216, !15, i64 224, !10, i64 232, !10, i64 236, !15, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !10, i64 272, !6, i64 280, !6, i64 288, !10, i64 296, !10, i64 300, !10, i64 304, !15, 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, !15, i64 1112, !6, i64 1120, !6, i64 1128, !10, i64 1136, !10, i64 1140, !10, i64 1144, !10, i64 1148, !10, i64 1152, !10, i64 1156, !10, i64 1160, !10, i64 1164, !15, i64 1168, !15, i64 1176, !15, i64 1184, !10, i64 1192, !15, i64 1200, !10, i64 1208, !10, i64 1212, !10, i64 1216, !10, i64 1220, !10, i64 1224, !15, i64 1232, !15, i64 1240, !15, i64 1248, !15, i64 1256, !15, i64 1264, !15, i64 1272, !15, i64 1280, !15, i64 1288, !15, i64 1296, !15, i64 1304, !15, i64 1312, !15, i64 1320, !15, i64 1328, !15, i64 1336, !15, i64 1344, !15, i64 1352, !15, i64 1360, !10, i64 1368, !10, i64 1372, !10, i64 1376, !10, i64 1380, !12, i64 1384, !15, 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, !15, i64 1592, !6, i64 1600, !6, i64 1608, !6, i64 1616, !10, i64 1624, !10, i64 1628, !10, i64 1632, !10, i64 1636, !10, i64 1640, !10, i64 1644, !10, i64 1648, !10, i64 1652, !10, i64 1656, !10, i64 1660, !10, i64 1664, !10, i64 1668, !10, i64 1672, !6, i64 1680, !10, i64 1688, !6, i64 1696, !10, i64 1704, !6, i64 1712, !10, i64 1720, !6, i64 1728, !6, i64 1736, !6, i64 1744, !6, i64 1752, !6, i64 1760, !6, i64 1768, !10, i64 1776, !10, i64 1780, !6, i64 1784, !6, i64 1792, !6, i64 1800, !6, i64 1808, !6, i64 1816, !6, i64 1824, !6, i64 1832, !10, i64 1840, !10, i64 1844, !6, i64 1848, !10, i64 1856, !6, i64 1864, !6, i64 1872, !15, i64 1880, !15, i64 1888, !15, i64 1896, !6, i64 1904, !6, i64 1912, !6, i64 1920, !15, i64 1928, !15, i64 1936, !10, i64 1944, !10, i64 1948, !12, i64 1952, !6, i64 1960, !10, i64 1968, !6, i64 1976, !7, i64 1984, !6, i64 2024, !6, i64 2032, !10, i64 2040, !6, i64 2048, !10, i64 2056}
!15 = !{!"double", !7, i64 0}
!16 = !{!17, !6, i64 8}
!17 = !{!"_generic_N_Vector", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!19, !6, i64 32}
!19 = !{!"_generic_N_Vector_Ops", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432}
!20 = !{!21, !6, i64 32}
!21 = !{!"IDALsMemRec", !10, i64 0, !10, i64 4, !10, 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, !10, i64 96, !15, i64 104, !15, i64 112, !15, 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, !10, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !10, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304}
!22 = !{!23, !6, i64 8}
!23 = !{!"_generic_SUNLinearSolver", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!25, !6, i64 96}
!25 = !{!"_generic_SUNLinearSolver_Ops", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112}


; 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.29 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @IDAGetLinWorkSpace(ptr noundef %0, ptr nocapture noundef %1, ptr nocapture noundef %2) local_unnamed_addr #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %10 = call i32 @idaLs_AccessLMem(ptr noundef %0, ptr noundef nonnull @.str.29, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %46

11:                                               ; preds = %3
  store i64 3, ptr %1, align 8, !tbaa !5
  store i64 34, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %12, i64 712
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %16, i64 32
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %.not11 = icmp eq ptr %18, null
  br i1 %.not11, label %28, label %19

19:                                               ; preds = %11
  call void @N_VSpace(ptr noundef nonnull %14, ptr noundef nonnull %6, ptr noundef nonnull %7) #3
  %20 = load i64, ptr %6, align 8, !tbaa !5
  %21 = mul nsw i64 %20, 3
  %22 = load i64, ptr %1, align 8, !tbaa !5
  %23 = add nsw i64 %22, %21
  store i64 %23, ptr %1, align 8, !tbaa !5
  %24 = load i64, ptr %7, align 8, !tbaa !5
  %25 = mul nsw i64 %24, 3
  %26 = load i64, ptr %2, align 8, !tbaa !5
  %27 = add nsw i64 %26, %25
  store i64 %27, ptr %2, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %19, %11
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = getelementptr inbounds i8, ptr %29, i64 32
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %33, i64 96
  %35 = load ptr, ptr %34, align 8, !tbaa !23
  %.not12 = icmp eq ptr %35, null
  br i1 %.not12, label %46, label %36

36:                                               ; preds = %28
  %37 = call i32 @SUNLinSolSpace(ptr noundef nonnull %31, ptr noundef nonnull %8, ptr noundef nonnull %9) #3
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %46

39:                                               ; preds = %36
  %40 = load i64, ptr %8, align 8, !tbaa !5
  %41 = load i64, ptr %1, align 8, !tbaa !5
  %42 = add nsw i64 %41, %40
  store i64 %42, ptr %1, align 8, !tbaa !5
  %43 = load i64, ptr %9, align 8, !tbaa !5
  %44 = load i64, ptr %2, align 8, !tbaa !5
  %45 = add nsw i64 %44, %43
  store i64 %45, ptr %2, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %28, %39, %36, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i32 %10
}

declare void @N_VSpace(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @SUNLinSolSpace(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass