; 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.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.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 }

@.str.56 = external hidden unnamed_addr constant [14 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: nounwind uwtable
define dso_local i32 @idaLsDQJtimes(double noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, double noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #1 {
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca double, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  store double %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !9
  store ptr %2, ptr %14, align 8, !tbaa !9
  store ptr %3, ptr %15, align 8, !tbaa !9
  store ptr %4, ptr %16, align 8, !tbaa !9
  store ptr %5, ptr %17, align 8, !tbaa !9
  store double %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !9
  store ptr %8, ptr %20, align 8, !tbaa !9
  store ptr %9, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #3
  %32 = load ptr, ptr %19, align 8, !tbaa !9
  %33 = call i32 @idaLs_AccessLMem(ptr noundef %32, ptr noundef @.str.56, ptr noundef %22, ptr noundef %23)
  store i32 %33, ptr %29, align 4, !tbaa !11
  %34 = load i32, ptr %29, align 4, !tbaa !11
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %10
  %37 = load i32, ptr %29, align 4, !tbaa !11
  store i32 %37, ptr %11, align 4
  store i32 1, ptr %31, align 4
  br label %124

38:                                               ; preds = %10
  %39 = load ptr, ptr %23, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.IDALsMemRec, ptr %39, i32 0, i32 5
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = call i32 @SUNLinSolGetID(ptr noundef %41)
  store i32 %42, ptr %30, align 4, !tbaa !11
  %43 = load i32, ptr %30, align 4, !tbaa !11
  %44 = icmp eq i32 %43, 8
  br i1 %44, label %48, label %45

45:                                               ; preds = %38
  %46 = load i32, ptr %30, align 4, !tbaa !11
  %47 = icmp eq i32 %46, 7
  br i1 %47, label %48, label %56

48:                                               ; preds = %45, %38
  %49 = load ptr, ptr %23, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.IDALsMemRec, ptr %49, i32 0, i32 15
  %51 = load double, ptr %50, align 8, !tbaa !16
  %52 = load ptr, ptr %23, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.IDALsMemRec, ptr %52, i32 0, i32 16
  %54 = load double, ptr %53, align 8, !tbaa !17
  %55 = fmul double %51, %54
  store double %55, ptr %26, align 8, !tbaa !5
  br label %66

56:                                               ; preds = %45
  %57 = load ptr, ptr %23, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.IDALsMemRec, ptr %57, i32 0, i32 16
  %59 = load double, ptr %58, align 8, !tbaa !17
  %60 = load ptr, ptr %16, align 8, !tbaa !9
  %61 = load ptr, ptr %22, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.IDAMemRec, ptr %61, i32 0, i32 56
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = call double @N_VWrmsNorm(ptr noundef %60, ptr noundef %63)
  %65 = fdiv double %59, %64
  store double %65, ptr %26, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %56, %48
  %67 = load ptr, ptr %20, align 8, !tbaa !9
  store ptr %67, ptr %24, align 8, !tbaa !9
  %68 = load ptr, ptr %21, align 8, !tbaa !9
  store ptr %68, ptr %25, align 8, !tbaa !9
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %108, %66
  %70 = load i32, ptr %28, align 4, !tbaa !11
  %71 = icmp slt i32 %70, 3
  br i1 %71, label %72, label %111

72:                                               ; preds = %69
  %73 = load double, ptr %26, align 8, !tbaa !5
  %74 = load ptr, ptr %16, align 8, !tbaa !9
  %75 = load ptr, ptr %13, align 8, !tbaa !9
  %76 = load ptr, ptr %24, align 8, !tbaa !9
  call void @N_VLinearSum(double noundef %73, ptr noundef %74, double noundef 1.000000e+00, ptr noundef %75, ptr noundef %76)
  %77 = load double, ptr %18, align 8, !tbaa !5
  %78 = load double, ptr %26, align 8, !tbaa !5
  %79 = fmul double %77, %78
  %80 = load ptr, ptr %16, align 8, !tbaa !9
  %81 = load ptr, ptr %14, align 8, !tbaa !9
  %82 = load ptr, ptr %25, align 8, !tbaa !9
  call void @N_VLinearSum(double noundef %79, ptr noundef %80, double noundef 1.000000e+00, ptr noundef %81, ptr noundef %82)
  %83 = load ptr, ptr %23, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.IDALsMemRec, ptr %83, i32 0, i32 38
  %85 = load ptr, ptr %84, align 8, !tbaa !20
  %86 = load double, ptr %12, align 8, !tbaa !5
  %87 = load ptr, ptr %24, align 8, !tbaa !9
  %88 = load ptr, ptr %25, align 8, !tbaa !9
  %89 = load ptr, ptr %17, align 8, !tbaa !9
  %90 = load ptr, ptr %22, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.IDAMemRec, ptr %90, i32 0, i32 3
  %92 = load ptr, ptr %91, align 8, !tbaa !21
  %93 = call i32 %85(double noundef %86, ptr noundef %87, ptr noundef %88, ptr noundef %89, ptr noundef %92)
  store i32 %93, ptr %29, align 4, !tbaa !11
  %94 = load ptr, ptr %23, align 8, !tbaa !9
  %95 = getelementptr inbounds %struct.IDALsMemRec, ptr %94, i32 0, i32 22
  %96 = load i64, ptr %95, align 8, !tbaa !22
  %97 = add nsw i64 %96, 1
  store i64 %97, ptr %95, align 8, !tbaa !22
  %98 = load i32, ptr %29, align 4, !tbaa !11
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %72
  br label %111

101:                                              ; preds = %72
  %102 = load i32, ptr %29, align 4, !tbaa !11
  %103 = icmp slt i32 %102, 0
  br i1 %103, label %104, label %105

104:                                              ; preds = %101
  store i32 -1, ptr %11, align 4
  store i32 1, ptr %31, align 4
  br label %124

105:                                              ; preds = %101
  %106 = load double, ptr %26, align 8, !tbaa !5
  %107 = fmul double %106, 2.500000e-01
  store double %107, ptr %26, align 8, !tbaa !5
  br label %108

108:                                              ; preds = %105
  %109 = load i32, ptr %28, align 4, !tbaa !11
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %28, align 4, !tbaa !11
  br label %69, !llvm.loop !23

111:                                              ; preds = %100, %69
  %112 = load i32, ptr %29, align 4, !tbaa !11
  %113 = icmp sgt i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %111
  store i32 1, ptr %11, align 4
  store i32 1, ptr %31, align 4
  br label %124

115:                                              ; preds = %111
  %116 = load double, ptr %26, align 8, !tbaa !5
  %117 = fdiv double 1.000000e+00, %116
  store double %117, ptr %27, align 8, !tbaa !5
  %118 = load double, ptr %27, align 8, !tbaa !5
  %119 = load ptr, ptr %17, align 8, !tbaa !9
  %120 = load double, ptr %27, align 8, !tbaa !5
  %121 = fneg double %120
  %122 = load ptr, ptr %15, align 8, !tbaa !9
  %123 = load ptr, ptr %17, align 8, !tbaa !9
  call void @N_VLinearSum(double noundef %118, ptr noundef %119, double noundef %121, ptr noundef %122, ptr noundef %123)
  store i32 0, ptr %11, align 4
  store i32 1, ptr %31, align 4
  br label %124

124:                                              ; preds = %115, %114, %104, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  %125 = load i32, ptr %11, align 4
  ret i32 %125
}

; 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

declare void @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) #2

declare i32 @SUNLinSolGetID(ptr noundef) #2

declare double @N_VWrmsNorm(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 = !{!"double", !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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 32}
!14 = !{!"IDALsMemRec", !12, i64 0, !12, i64 4, !12, 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, !12, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !15, i64 128, !15, i64 136, !15, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !15, i64 184, !15, i64 192, !15, i64 200, !15, i64 208, !15, i64 216, !15, i64 224, !12, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !12, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !6, i64 112}
!17 = !{!14, !6, i64 120}
!18 = !{!19, !10, i64 632}
!19 = !{!"IDAMemRec", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !12, i64 64, !12, i64 68, !10, i64 72, !10, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !10, i64 104, !10, i64 112, !12, i64 120, !12, i64 124, !6, i64 128, !6, i64 136, !10, i64 144, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !10, i64 168, !10, i64 176, !12, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !12, i64 216, !6, i64 224, !12, i64 232, !12, i64 236, !6, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !12, i64 272, !10, i64 280, !10, i64 288, !12, i64 296, !12, i64 300, !12, i64 304, !6, 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, !6, i64 1112, !10, i64 1120, !10, 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, !6, i64 1168, !6, i64 1176, !6, i64 1184, !12, i64 1192, !6, i64 1200, !12, i64 1208, !12, i64 1212, !12, i64 1216, !12, i64 1220, !12, i64 1224, !6, i64 1232, !6, i64 1240, !6, i64 1248, !6, i64 1256, !6, i64 1264, !6, i64 1272, !6, i64 1280, !6, i64 1288, !6, i64 1296, !6, i64 1304, !6, i64 1312, !6, i64 1320, !6, i64 1328, !6, i64 1336, !6, i64 1344, !6, i64 1352, !6, i64 1360, !12, i64 1368, !12, i64 1372, !12, i64 1376, !12, i64 1380, !15, i64 1384, !6, i64 1392, !15, i64 1400, !15, i64 1408, !15, i64 1416, !15, i64 1424, !15, i64 1432, !15, i64 1440, !15, i64 1448, !15, i64 1456, !15, i64 1464, !15, i64 1472, !15, i64 1480, !15, i64 1488, !15, i64 1496, !15, i64 1504, !15, i64 1512, !15, i64 1520, !15, i64 1528, !15, i64 1536, !15, i64 1544, !15, i64 1552, !15, i64 1560, !15, i64 1568, !15, i64 1576, !15, i64 1584, !6, i64 1592, !10, i64 1600, !10, i64 1608, !10, 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, !10, i64 1680, !12, i64 1688, !10, i64 1696, !12, i64 1704, !10, i64 1712, !12, i64 1720, !10, i64 1728, !10, i64 1736, !10, i64 1744, !10, i64 1752, !10, i64 1760, !10, i64 1768, !12, i64 1776, !12, i64 1780, !10, i64 1784, !10, i64 1792, !10, i64 1800, !10, i64 1808, !10, i64 1816, !10, i64 1824, !10, i64 1832, !12, i64 1840, !12, i64 1844, !10, i64 1848, !12, i64 1856, !10, i64 1864, !10, i64 1872, !6, i64 1880, !6, i64 1888, !6, i64 1896, !10, i64 1904, !10, i64 1912, !10, i64 1920, !6, i64 1928, !6, i64 1936, !12, i64 1944, !12, i64 1948, !15, i64 1952, !10, i64 1960, !12, i64 1968, !10, i64 1976, !7, i64 1984, !10, i64 2024, !10, i64 2032, !12, i64 2040, !10, i64 2048, !12, i64 2056}
!20 = !{!14, !10, i64 296}
!21 = !{!19, !10, i64 24}
!22 = !{!14, !15, i64 168}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.56 = external hidden unnamed_addr constant [14 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: nounwind uwtable
define dso_local i32 @idaLsDQJtimes(double noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, double noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #1 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  %13 = call i32 @idaLs_AccessLMem(ptr noundef %7, ptr noundef nonnull @.str.56, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %.loopexit

14:                                               ; preds = %10
  %15 = load ptr, ptr %12, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 32
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = call i32 @SUNLinSolGetID(ptr noundef %17) #3
  %19 = add i32 %18, -7
  %or.cond = icmp ult i32 %19, 2
  %20 = load ptr, ptr %12, align 8, !tbaa !5
  br i1 %or.cond, label %21, label %27

21:                                               ; preds = %14
  %22 = getelementptr inbounds i8, ptr %20, i64 112
  %23 = load double, ptr %22, align 8, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %20, i64 120
  %25 = load double, ptr %24, align 8, !tbaa !15
  %26 = fmul double %23, %25
  br label %35

27:                                               ; preds = %14
  %28 = getelementptr inbounds i8, ptr %20, i64 120
  %29 = load double, ptr %28, align 8, !tbaa !15
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 632
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = call double @N_VWrmsNorm(ptr noundef %4, ptr noundef %32) #3
  %34 = fdiv double %29, %33
  br label %35

35:                                               ; preds = %27, %21
  %.036 = phi double [ %26, %21 ], [ %34, %27 ]
  call void @N_VLinearSum(double noundef %.036, ptr noundef %4, double noundef 1.000000e+00, ptr noundef %1, ptr noundef %8) #3
  %36 = fmul double %.036, %6
  call void @N_VLinearSum(double noundef %36, ptr noundef %4, double noundef 1.000000e+00, ptr noundef %2, ptr noundef %9) #3
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 296
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = call i32 %39(double noundef %0, ptr noundef %8, ptr noundef %9, ptr noundef %5, ptr noundef %42) #3
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 168
  %46 = load i64, ptr %45, align 8, !tbaa !20
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %45, align 8, !tbaa !20
  %48 = icmp eq i32 %43, 0
  br i1 %48, label %.thread, label %49

49:                                               ; preds = %35
  %50 = icmp slt i32 %43, 0
  br i1 %50, label %.loopexit, label %51

51:                                               ; preds = %49
  %52 = fmul double %.036, 2.500000e-01
  call void @N_VLinearSum(double noundef %52, ptr noundef %4, double noundef 1.000000e+00, ptr noundef %1, ptr noundef %8) #3
  %53 = fmul double %52, %6
  call void @N_VLinearSum(double noundef %53, ptr noundef %4, double noundef 1.000000e+00, ptr noundef %2, ptr noundef %9) #3
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 296
  %56 = load ptr, ptr %55, align 8, !tbaa !18
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 24
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = call i32 %56(double noundef %0, ptr noundef %8, ptr noundef %9, ptr noundef %5, ptr noundef %59) #3
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 168
  %63 = load i64, ptr %62, align 8, !tbaa !20
  %64 = add nsw i64 %63, 1
  store i64 %64, ptr %62, align 8, !tbaa !20
  %65 = icmp eq i32 %60, 0
  br i1 %65, label %.thread, label %66

66:                                               ; preds = %51
  %67 = icmp slt i32 %60, 0
  br i1 %67, label %.loopexit, label %68

68:                                               ; preds = %66
  %69 = fmul double %52, 2.500000e-01
  call void @N_VLinearSum(double noundef %69, ptr noundef %4, double noundef 1.000000e+00, ptr noundef %1, ptr noundef %8) #3
  %70 = fmul double %69, %6
  call void @N_VLinearSum(double noundef %70, ptr noundef %4, double noundef 1.000000e+00, ptr noundef %2, ptr noundef %9) #3
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 296
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 24
  %76 = load ptr, ptr %75, align 8, !tbaa !19
  %77 = call i32 %73(double noundef %0, ptr noundef %8, ptr noundef %9, ptr noundef %5, ptr noundef %76) #3
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i64 168
  %80 = load i64, ptr %79, align 8, !tbaa !20
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %79, align 8, !tbaa !20
  %82 = icmp eq i32 %77, 0
  br i1 %82, label %.thread, label %83

83:                                               ; preds = %68
  %.inv = icmp sgt i32 %77, -1
  %spec.select = select i1 %.inv, i32 1, i32 -1
  br label %.loopexit

.thread:                                          ; preds = %68, %51, %35
  %.13749.lcssa = phi double [ %.036, %35 ], [ %52, %51 ], [ %69, %68 ]
  %84 = fdiv double 1.000000e+00, %.13749.lcssa
  %85 = fneg double %84
  call void @N_VLinearSum(double noundef %84, ptr noundef %5, double noundef %85, ptr noundef %3, ptr noundef %5) #3
  br label %.loopexit

.loopexit:                                        ; preds = %83, %49, %66, %10, %.thread
  %.0 = phi i32 [ 0, %.thread ], [ %13, %10 ], [ -1, %49 ], [ -1, %66 ], [ %spec.select, %83 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  ret i32 %.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

declare void @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @SUNLinSolGetID(ptr noundef) local_unnamed_addr #2

declare double @N_VWrmsNorm(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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"IDALsMemRec", !11, i64 0, !11, i64 4, !11, 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, !11, i64 96, !12, i64 104, !12, i64 112, !12, 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, !11, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !11, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !12, i64 112}
!15 = !{!10, !12, i64 120}
!16 = !{!17, !6, i64 632}
!17 = !{!"IDAMemRec", !6, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !12, i64 40, !12, i64 48, !6, i64 56, !11, i64 64, !11, i64 68, !6, i64 72, !6, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !6, i64 104, !6, i64 112, !11, i64 120, !11, i64 124, !12, i64 128, !12, i64 136, !6, i64 144, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !6, i64 168, !6, i64 176, !11, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !11, i64 216, !12, i64 224, !11, i64 232, !11, i64 236, !12, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !11, i64 272, !6, i64 280, !6, i64 288, !11, i64 296, !11, i64 300, !11, i64 304, !12, 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, !12, i64 1112, !6, i64 1120, !6, 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, !12, i64 1168, !12, i64 1176, !12, i64 1184, !11, i64 1192, !12, i64 1200, !11, i64 1208, !11, i64 1212, !11, i64 1216, !11, i64 1220, !11, i64 1224, !12, i64 1232, !12, i64 1240, !12, i64 1248, !12, i64 1256, !12, i64 1264, !12, i64 1272, !12, i64 1280, !12, i64 1288, !12, i64 1296, !12, i64 1304, !12, i64 1312, !12, i64 1320, !12, i64 1328, !12, i64 1336, !12, i64 1344, !12, i64 1352, !12, i64 1360, !11, i64 1368, !11, i64 1372, !11, i64 1376, !11, i64 1380, !13, i64 1384, !12, 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, !12, i64 1592, !6, i64 1600, !6, i64 1608, !6, 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, !6, i64 1680, !11, i64 1688, !6, i64 1696, !11, i64 1704, !6, i64 1712, !11, i64 1720, !6, i64 1728, !6, i64 1736, !6, i64 1744, !6, i64 1752, !6, i64 1760, !6, i64 1768, !11, i64 1776, !11, i64 1780, !6, i64 1784, !6, i64 1792, !6, i64 1800, !6, i64 1808, !6, i64 1816, !6, i64 1824, !6, i64 1832, !11, i64 1840, !11, i64 1844, !6, i64 1848, !11, i64 1856, !6, i64 1864, !6, i64 1872, !12, i64 1880, !12, i64 1888, !12, i64 1896, !6, i64 1904, !6, i64 1912, !6, i64 1920, !12, i64 1928, !12, i64 1936, !11, i64 1944, !11, i64 1948, !13, i64 1952, !6, i64 1960, !11, i64 1968, !6, i64 1976, !7, i64 1984, !6, i64 2024, !6, i64 2032, !11, i64 2040, !6, i64 2048, !11, i64 2056}
!18 = !{!10, !6, i64 296}
!19 = !{!17, !6, i64 24}
!20 = !{!10, !13, i64 168}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass