; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/src/cvodes (cvodes_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.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 }
%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.CVLsMemRec = type { i32, i32, i32, ptr, ptr, i32, i32, double, double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32 }
%struct._generic_SUNMatrix = type { ptr, ptr, ptr }
%struct._generic_SUNMatrix_Ops = type { ptr, ptr, ptr, ptr, ptr, ptr, 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.31 = external hidden unnamed_addr constant [21 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 @cvLs_AccessLMem(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @CVodeGetLinWorkSpace(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 @cvLs_AccessLMem(ptr noundef %16, ptr noundef @.str.31, 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 %106

22:                                               ; preds = %3
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  store i64 2, ptr %23, align 8, !tbaa !11
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 30, ptr %24, align 8, !tbaa !11
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.CVodeMemRec, ptr %25, i32 0, i32 55
  %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.CVodeMemRec, ptr %34, i32 0, i32 55
  %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 2, %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 2, %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.CVLsMemRec, ptr %48, i32 0, i32 11
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %79

52:                                               ; preds = %47
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.CVLsMemRec, ptr %53, i32 0, i32 11
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  %56 = getelementptr inbounds %struct._generic_SUNMatrix, ptr %55, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !22
  %58 = getelementptr inbounds %struct._generic_SUNMatrix_Ops, ptr %57, i32 0, i32 9
  %59 = load ptr, ptr %58, align 8, !tbaa !24
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %78

61:                                               ; preds = %52
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.CVLsMemRec, ptr %62, i32 0, i32 11
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  %65 = call i32 @SUNMatSpace(ptr noundef %64, ptr noundef %12, ptr noundef %13)
  store i32 %65, ptr %14, align 4, !tbaa !9
  %66 = load i32, ptr %14, align 4, !tbaa !9
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %77

68:                                               ; preds = %61
  %69 = load i64, ptr %12, align 8, !tbaa !11
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load i64, ptr %70, align 8, !tbaa !11
  %72 = add nsw i64 %71, %69
  store i64 %72, ptr %70, align 8, !tbaa !11
  %73 = load i64, ptr %13, align 8, !tbaa !11
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = load i64, ptr %74, align 8, !tbaa !11
  %76 = add nsw i64 %75, %73
  store i64 %76, ptr %74, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %68, %61
  br label %78

78:                                               ; preds = %77, %52
  br label %79

79:                                               ; preds = %78, %47
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.CVLsMemRec, ptr %80, i32 0, i32 9
  %82 = load ptr, ptr %81, align 8, !tbaa !26
  %83 = getelementptr inbounds %struct._generic_SUNLinearSolver, ptr %82, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !27
  %85 = getelementptr inbounds %struct._generic_SUNLinearSolver_Ops, ptr %84, i32 0, i32 12
  %86 = load ptr, ptr %85, align 8, !tbaa !29
  %87 = icmp ne ptr %86, null
  br i1 %87, label %88, label %105

88:                                               ; preds = %79
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.CVLsMemRec, ptr %89, i32 0, i32 9
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = call i32 @SUNLinSolSpace(ptr noundef %91, ptr noundef %12, ptr noundef %13)
  store i32 %92, ptr %14, align 4, !tbaa !9
  %93 = load i32, ptr %14, align 4, !tbaa !9
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %104

95:                                               ; preds = %88
  %96 = load i64, ptr %12, align 8, !tbaa !11
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load i64, ptr %97, align 8, !tbaa !11
  %99 = add nsw i64 %98, %96
  store i64 %99, ptr %97, align 8, !tbaa !11
  %100 = load i64, ptr %13, align 8, !tbaa !11
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load i64, ptr %101, align 8, !tbaa !11
  %103 = add nsw i64 %102, %100
  store i64 %103, ptr %101, align 8, !tbaa !11
  br label %104

104:                                              ; preds = %95, %88
  br label %105

105:                                              ; preds = %104, %79
  store i32 0, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %106

106:                                              ; preds = %105, %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
  %107 = load i32, ptr %4, align 4
  ret i32 %107
}

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

declare i32 @SUNMatSpace(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 464}
!14 = !{!"CVodeMemRec", !6, i64 0, !15, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !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, !6, i64 96, !10, i64 104, !10, i64 108, !15, i64 112, !15, i64 120, !6, i64 128, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !6, i64 152, !6, i64 160, !6, i64 168, !10, i64 176, !10, i64 180, !6, i64 184, !6, i64 192, !6, i64 200, !10, i64 208, !15, i64 216, !10, i64 224, !10, i64 228, !15, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !10, i64 264, !6, i64 272, !6, i64 280, !10, i64 288, !10, i64 292, !10, i64 296, !15, 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, !10, i64 792, !7, i64 800, !6, i64 904, !6, i64 912, !6, i64 920, !6, i64 928, !6, i64 936, !10, i64 944, !15, i64 952, !10, i64 960, !10, i64 964, !10, i64 968, !10, i64 972, !10, i64 976, !15, i64 984, !15, i64 992, !15, i64 1000, !15, i64 1008, !15, i64 1016, !15, i64 1024, !15, i64 1032, !15, i64 1040, !7, i64 1048, !7, i64 1160, !7, i64 1208, !15, i64 1312, !15, i64 1320, !15, i64 1328, !15, i64 1336, !15, i64 1344, !15, i64 1352, !15, i64 1360, !15, i64 1368, !10, i64 1376, !15, i64 1384, !15, i64 1392, !10, i64 1400, !15, i64 1408, !15, i64 1416, !6, i64 1424, !10, i64 1432, !12, i64 1440, !10, i64 1448, !10, i64 1452, !10, i64 1456, !15, i64 1464, !15, i64 1472, !15, 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, !6, i64 1560, !12, i64 1568, !12, i64 1576, !6, i64 1584, !12, i64 1592, !12, i64 1600, !12, i64 1608, !12, i64 1616, !12, i64 1624, !12, i64 1632, !10, i64 1640, !15, i64 1648, !15, i64 1656, !15, i64 1664, !12, i64 1672, !12, i64 1680, !12, i64 1688, !12, i64 1696, !12, i64 1704, !12, i64 1712, !6, i64 1720, !10, i64 1728, !6, i64 1736, !10, i64 1744, !6, i64 1752, !10, i64 1760, !6, i64 1768, !10, i64 1776, !10, i64 1780, !12, i64 1784, !10, i64 1792, !6, i64 1800, !10, i64 1808, !6, i64 1816, !6, i64 1824, !6, i64 1832, !6, i64 1840, !6, i64 1848, !6, i64 1856, !10, i64 1864, !10, i64 1868, !6, i64 1872, !6, i64 1880, !6, i64 1888, !6, i64 1896, !6, i64 1904, !12, i64 1912, !10, i64 1920, !10, i64 1924, !12, i64 1928, !15, i64 1936, !15, i64 1944, !15, i64 1952, !10, i64 1960, !10, i64 1964, !15, i64 1968, !10, i64 1976, !10, i64 1980, !10, i64 1984, !10, i64 1988, !10, i64 1992, !10, i64 1996, !10, i64 2000, !10, i64 2004, !10, i64 2008, !10, i64 2012, !10, i64 2016, !10, i64 2020, !10, i64 2024, !10, i64 2028, !10, i64 2032, !10, i64 2036, !6, i64 2040, !6, i64 2048, !6, i64 2056, !6, i64 2064, !12, i64 2072, !10, i64 2080, !7, i64 2088, !10, i64 2280, !12, i64 2288, !6, i64 2296, !10, i64 2304, !6, i64 2312, !6, i64 2320, !15, i64 2328, !15, i64 2336, !15, i64 2344, !6, i64 2352, !6, i64 2360, !6, i64 2368, !15, i64 2376, !15, i64 2384, !10, i64 2392, !10, i64 2396, !12, i64 2400, !6, i64 2408, !10, i64 2416, !6, i64 2424, !6, i64 2432, !6, i64 2440, !10, i64 2448, !6, i64 2456, !10, i64 2464}
!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 72}
!21 = !{!"CVLsMemRec", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !15, i64 40, !15, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !12, 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, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !10, i64 264, !6, i64 272, !6, i64 280, !10, i64 288}
!22 = !{!23, !6, i64 8}
!23 = !{!"_generic_SUNMatrix", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!25, !6, i64 72}
!25 = !{!"_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}
!26 = !{!21, !6, i64 56}
!27 = !{!28, !6, i64 8}
!28 = !{!"_generic_SUNLinearSolver", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!30, !6, i64 96}
!30 = !{!"_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.31 = external hidden unnamed_addr constant [21 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 @cvLs_AccessLMem(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @CVodeGetLinWorkSpace(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 @cvLs_AccessLMem(ptr noundef %0, ptr noundef nonnull @.str.31, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %65

11:                                               ; preds = %3
  store i64 2, ptr %1, align 8, !tbaa !5
  store i64 30, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %12, i64 464
  %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
  %.not15 = icmp eq ptr %18, null
  br i1 %.not15, 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 = shl nsw i64 %20, 1
  %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 = shl nsw i64 %24, 1
  %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 72
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %.not16 = icmp eq ptr %31, null
  br i1 %.not16, label %47, label %32

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %31, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  %35 = getelementptr inbounds i8, ptr %34, i64 72
  %36 = load ptr, ptr %35, align 8, !tbaa !23
  %.not17 = icmp eq ptr %36, null
  br i1 %.not17, label %47, label %37

37:                                               ; preds = %32
  %38 = call i32 @SUNMatSpace(ptr noundef nonnull %31, ptr noundef nonnull %8, ptr noundef nonnull %9) #3
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %47

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

47:                                               ; preds = %32, %40, %37, %28
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = getelementptr inbounds i8, ptr %48, i64 56
  %50 = load ptr, ptr %49, align 8, !tbaa !25
  %51 = getelementptr inbounds i8, ptr %50, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !26
  %53 = getelementptr inbounds i8, ptr %52, i64 96
  %54 = load ptr, ptr %53, align 8, !tbaa !28
  %.not18 = icmp eq ptr %54, null
  br i1 %.not18, label %65, label %55

55:                                               ; preds = %47
  %56 = call i32 @SUNLinSolSpace(ptr noundef nonnull %50, ptr noundef nonnull %8, ptr noundef nonnull %9) #3
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %65

58:                                               ; preds = %55
  %59 = load i64, ptr %8, align 8, !tbaa !5
  %60 = load i64, ptr %1, align 8, !tbaa !5
  %61 = add nsw i64 %60, %59
  store i64 %61, ptr %1, align 8, !tbaa !5
  %62 = load i64, ptr %9, align 8, !tbaa !5
  %63 = load i64, ptr %2, align 8, !tbaa !5
  %64 = add nsw i64 %63, %62
  store i64 %64, ptr %2, align 8, !tbaa !5
  br label %65

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