; LLVM IR from simbody/simbody :: SimTKmath/Integrators/src/CPodes/sundials/src/cpodes (cpodes_spils)

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

; 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

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

declare double @N_VWrmsNorm(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @cpSpilsDQjtvImpl(double noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #2 {
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, 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 double, align 8
  %31 = alloca i32, align 4
  store double %0, ptr %12, align 8, !tbaa !5
  store double %1, ptr %13, align 8, !tbaa !5
  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 ptr %6, ptr %18, align 8, !tbaa !9
  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 8, ptr %30) #3
  %32 = load ptr, ptr %19, align 8, !tbaa !9
  store ptr %32, ptr %22, align 8, !tbaa !9
  %33 = load ptr, ptr %22, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.CPodeMemRec, ptr %33, i32 0, i32 129
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  store ptr %35, ptr %23, align 8, !tbaa !9
  store double 1.000000e+00, ptr %30, align 8, !tbaa !5
  %36 = load ptr, ptr %23, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.CPSpilsMemRec, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !15
  switch i32 %38, label %61 [
    i32 1, label %39
    i32 2, label %45
    i32 3, label %53
  ]

39:                                               ; preds = %10
  %40 = load ptr, ptr %23, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.CPSpilsMemRec, ptr %40, i32 0, i32 3
  %42 = load double, ptr %41, align 8, !tbaa !17
  %43 = load double, ptr %30, align 8, !tbaa !5
  %44 = fmul double %42, %43
  store double %44, ptr %26, align 8, !tbaa !5
  br label %61

45:                                               ; preds = %10
  %46 = load double, ptr %30, align 8, !tbaa !5
  %47 = load ptr, ptr %17, align 8, !tbaa !9
  %48 = load ptr, ptr %22, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.CPodeMemRec, ptr %48, i32 0, i32 14
  %50 = load ptr, ptr %49, align 8, !tbaa !18
  %51 = call double @N_VWrmsNorm(ptr noundef %47, ptr noundef %50)
  %52 = fdiv double %46, %51
  store double %52, ptr %26, align 8, !tbaa !5
  br label %61

53:                                               ; preds = %10
  %54 = load double, ptr %30, align 8, !tbaa !5
  %55 = load ptr, ptr %17, align 8, !tbaa !9
  %56 = load ptr, ptr %22, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.CPodeMemRec, ptr %56, i32 0, i32 14
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = call double @N_VWrmsNorm(ptr noundef %55, ptr noundef %58)
  %60 = fdiv double %54, %59
  store double %60, ptr %26, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %53, %45, %39, %10
  %62 = load ptr, ptr %20, align 8, !tbaa !9
  store ptr %62, ptr %24, align 8, !tbaa !9
  %63 = load ptr, ptr %21, align 8, !tbaa !9
  store ptr %63, ptr %25, align 8, !tbaa !9
  store i32 0, ptr %28, align 4, !tbaa !19
  br label %64

64:                                               ; preds = %103, %61
  %65 = load i32, ptr %28, align 4, !tbaa !19
  %66 = icmp slt i32 %65, 3
  br i1 %66, label %67, label %106

67:                                               ; preds = %64
  %68 = load double, ptr %13, align 8, !tbaa !5
  %69 = load double, ptr %26, align 8, !tbaa !5
  %70 = fmul double %68, %69
  %71 = load ptr, ptr %17, align 8, !tbaa !9
  %72 = load ptr, ptr %14, align 8, !tbaa !9
  %73 = load ptr, ptr %24, align 8, !tbaa !9
  call void @N_VLinearSum(double noundef %70, ptr noundef %71, double noundef 1.000000e+00, ptr noundef %72, ptr noundef %73)
  %74 = load double, ptr %26, align 8, !tbaa !5
  %75 = load ptr, ptr %17, align 8, !tbaa !9
  %76 = load ptr, ptr %15, align 8, !tbaa !9
  %77 = load ptr, ptr %25, align 8, !tbaa !9
  call void @N_VLinearSum(double noundef %74, ptr noundef %75, double noundef 1.000000e+00, ptr noundef %76, ptr noundef %77)
  %78 = load ptr, ptr %22, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.CPodeMemRec, ptr %78, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !20
  %81 = load double, ptr %12, align 8, !tbaa !5
  %82 = load ptr, ptr %24, align 8, !tbaa !9
  %83 = load ptr, ptr %25, align 8, !tbaa !9
  %84 = load ptr, ptr %18, align 8, !tbaa !9
  %85 = load ptr, ptr %22, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.CPodeMemRec, ptr %85, i32 0, i32 4
  %87 = load ptr, ptr %86, align 8, !tbaa !21
  %88 = call i32 %80(double noundef %81, ptr noundef %82, ptr noundef %83, ptr noundef %84, ptr noundef %87)
  store i32 %88, ptr %29, align 4, !tbaa !19
  %89 = load ptr, ptr %23, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.CPSpilsMemRec, ptr %89, i32 0, i32 14
  %91 = load i64, ptr %90, align 8, !tbaa !22
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %90, align 8, !tbaa !22
  %93 = load i32, ptr %29, align 4, !tbaa !19
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %67
  br label %106

96:                                               ; preds = %67
  %97 = load i32, ptr %29, align 4, !tbaa !19
  %98 = icmp slt i32 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %96
  store i32 -1, ptr %11, align 4
  store i32 1, ptr %31, align 4
  br label %119

100:                                              ; preds = %96
  %101 = load double, ptr %26, align 8, !tbaa !5
  %102 = fmul double %101, 2.500000e-01
  store double %102, ptr %26, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %100
  %104 = load i32, ptr %28, align 4, !tbaa !19
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %28, align 4, !tbaa !19
  br label %64, !llvm.loop !23

106:                                              ; preds = %95, %64
  %107 = load i32, ptr %29, align 4, !tbaa !19
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  store i32 1, ptr %11, align 4
  store i32 1, ptr %31, align 4
  br label %119

110:                                              ; preds = %106
  %111 = load double, ptr %26, align 8, !tbaa !5
  %112 = fdiv double 1.000000e+00, %111
  store double %112, ptr %27, align 8, !tbaa !5
  %113 = load double, ptr %27, align 8, !tbaa !5
  %114 = load ptr, ptr %18, align 8, !tbaa !9
  %115 = load double, ptr %27, align 8, !tbaa !5
  %116 = fneg double %115
  %117 = load ptr, ptr %16, align 8, !tbaa !9
  %118 = load ptr, ptr %18, align 8, !tbaa !9
  call void @N_VLinearSum(double noundef %113, ptr noundef %114, double noundef %116, ptr noundef %117, ptr noundef %118)
  store i32 0, ptr %11, align 4
  store i32 1, ptr %31, align 4
  br label %119

119:                                              ; preds = %110, %109, %99
  call void @llvm.lifetime.end.p0(i64 8, 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
  %120 = load i32, ptr %11, align 4
  ret i32 %120
}

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 = !{!"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, !10, i64 1456}
!12 = !{!"CPodeMemRec", !6, i64 0, !13, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !13, i64 40, !13, i64 44, !13, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !7, i64 96, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !13, i64 248, !13, i64 252, !13, i64 256, !13, i64 260, !13, 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, !7, i64 336, !7, i64 448, !7, i64 496, !7, i64 600, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !13, i64 760, !13, i64 764, !13, i64 768, !13, i64 772, !14, i64 776, !14, i64 784, !13, i64 792, !13, i64 796, !10, i64 800, !10, i64 808, !10, i64 816, !10, i64 824, !6, i64 832, !10, i64 840, !10, i64 848, !10, i64 856, !14, i64 864, !14, i64 872, !6, i64 880, !13, i64 888, !13, i64 892, !13, i64 896, !10, i64 904, !10, i64 912, !10, i64 920, !10, i64 928, !13, i64 936, !14, i64 944, !14, i64 952, !14, i64 960, !14, i64 968, !13, i64 976, !13, i64 980, !10, i64 984, !10, i64 992, !13, i64 1000, !13, i64 1004, !6, i64 1008, !6, i64 1016, !10, i64 1024, !7, i64 1032, !10, i64 1136, !10, i64 1144, !10, i64 1152, !10, i64 1160, !6, i64 1168, !14, i64 1176, !14, i64 1184, !13, i64 1192, !13, i64 1196, !13, i64 1200, !14, i64 1208, !14, i64 1216, !13, i64 1224, !13, i64 1228, !6, i64 1232, !13, i64 1240, !14, i64 1248, !13, i64 1256, !13, i64 1260, !13, i64 1264, !13, i64 1268, !6, i64 1272, !6, i64 1280, !6, i64 1288, !14, i64 1296, !14, i64 1304, !14, i64 1312, !14, i64 1320, !14, i64 1328, !14, i64 1336, !13, i64 1344, !6, i64 1352, !6, i64 1360, !6, i64 1368, !14, i64 1376, !14, i64 1384, !14, i64 1392, !14, i64 1400, !14, i64 1408, !14, i64 1416, !10, i64 1424, !10, i64 1432, !10, i64 1440, !10, i64 1448, !10, i64 1456, !13, i64 1464, !10, i64 1472, !10, i64 1480, !10, i64 1488, !10, i64 1496, !10, i64 1504, !10, i64 1512, !13, i64 1520, !13, i64 1524, !14, i64 1528, !6, i64 1536, !6, i64 1544, !6, i64 1552, !13, i64 1560, !6, i64 1568, !13, i64 1576, !13, i64 1580, !13, i64 1584, !13, i64 1588, !13, i64 1592, !13, i64 1596, !10, i64 1600, !10, i64 1608, !10, i64 1616, !13, i64 1624, !7, i64 1632, !13, i64 1824, !14, i64 1832, !13, i64 1840, !10, i64 1848, !13, i64 1856, !10, i64 1864, !10, i64 1872, !10, i64 1880, !10, i64 1888, !6, i64 1896, !6, i64 1904, !6, i64 1912, !10, i64 1920, !10, i64 1928, !10, i64 1936, !6, i64 1944, !13, i64 1952, !13, i64 1956, !14, i64 1960, !6, i64 1968, !6, i64 1976, !13, i64 1984, !13, i64 1988, !10, i64 1992, !10, i64 2000}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !13, i64 0}
!16 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !13, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, 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, !13, i64 232}
!17 = !{!16, !6, i64 16}
!18 = !{!12, !10, i64 200}
!19 = !{!13, !13, i64 0}
!20 = !{!12, !10, i64 16}
!21 = !{!12, !10, i64 32}
!22 = !{!16, !14, i64 104}
!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"

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

declare double @N_VWrmsNorm(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @cpSpilsDQjtvImpl(double noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr nocapture noundef readonly %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #1 {
  %11 = getelementptr inbounds i8, ptr %7, i64 1456
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = load i32, ptr %12, align 8, !tbaa !13
  switch i32 %13, label %27 [
    i32 1, label %14
    i32 2, label %17
    i32 3, label %22
  ]

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %12, i64 16
  %16 = load double, ptr %15, align 8, !tbaa !15
  br label %27

17:                                               ; preds = %10
  %18 = getelementptr inbounds i8, ptr %7, i64 200
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %20 = tail call double @N_VWrmsNorm(ptr noundef %5, ptr noundef %19) #2
  %21 = fdiv double 1.000000e+00, %20
  br label %27

22:                                               ; preds = %10
  %23 = getelementptr inbounds i8, ptr %7, i64 200
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = tail call double @N_VWrmsNorm(ptr noundef %5, ptr noundef %24) #2
  %26 = fdiv double 1.000000e+00, %25
  br label %27

27:                                               ; preds = %22, %17, %14, %10
  %.043 = phi double [ undef, %10 ], [ %26, %22 ], [ %21, %17 ], [ %16, %14 ]
  %28 = getelementptr inbounds i8, ptr %7, i64 16
  %29 = getelementptr inbounds i8, ptr %7, i64 32
  %30 = getelementptr inbounds i8, ptr %12, i64 104
  %31 = fmul double %.043, %1
  tail call void @N_VLinearSum(double noundef %31, ptr noundef %5, double noundef 1.000000e+00, ptr noundef %2, ptr noundef %8) #2
  tail call void @N_VLinearSum(double noundef %.043, ptr noundef %5, double noundef 1.000000e+00, ptr noundef %3, ptr noundef %9) #2
  %32 = load ptr, ptr %28, align 8, !tbaa !17
  %33 = load ptr, ptr %29, align 8, !tbaa !18
  %34 = tail call i32 %32(double noundef %0, ptr noundef %8, ptr noundef %9, ptr noundef %6, ptr noundef %33) #2
  %35 = load i64, ptr %30, align 8, !tbaa !19
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %30, align 8, !tbaa !19
  %37 = icmp eq i32 %34, 0
  br i1 %37, label %61, label %38

38:                                               ; preds = %27
  %39 = icmp slt i32 %34, 0
  br i1 %39, label %.thread, label %40

40:                                               ; preds = %38
  %41 = fmul double %.043, 2.500000e-01
  %42 = fmul double %41, %1
  tail call void @N_VLinearSum(double noundef %42, ptr noundef %5, double noundef 1.000000e+00, ptr noundef %2, ptr noundef %8) #2
  tail call void @N_VLinearSum(double noundef %41, ptr noundef %5, double noundef 1.000000e+00, ptr noundef %3, ptr noundef %9) #2
  %43 = load ptr, ptr %28, align 8, !tbaa !17
  %44 = load ptr, ptr %29, align 8, !tbaa !18
  %45 = tail call i32 %43(double noundef %0, ptr noundef %8, ptr noundef %9, ptr noundef %6, ptr noundef %44) #2
  %46 = load i64, ptr %30, align 8, !tbaa !19
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %30, align 8, !tbaa !19
  %48 = icmp eq i32 %45, 0
  br i1 %48, label %61, label %49

49:                                               ; preds = %40
  %50 = icmp slt i32 %45, 0
  br i1 %50, label %.thread, label %51

51:                                               ; preds = %49
  %52 = fmul double %41, 2.500000e-01
  %53 = fmul double %52, %1
  tail call void @N_VLinearSum(double noundef %53, ptr noundef %5, double noundef 1.000000e+00, ptr noundef %2, ptr noundef %8) #2
  tail call void @N_VLinearSum(double noundef %52, ptr noundef %5, double noundef 1.000000e+00, ptr noundef %3, ptr noundef %9) #2
  %54 = load ptr, ptr %28, align 8, !tbaa !17
  %55 = load ptr, ptr %29, align 8, !tbaa !18
  %56 = tail call i32 %54(double noundef %0, ptr noundef %8, ptr noundef %9, ptr noundef %6, ptr noundef %55) #2
  %57 = load i64, ptr %30, align 8, !tbaa !19
  %58 = add nsw i64 %57, 1
  store i64 %58, ptr %30, align 8, !tbaa !19
  %59 = icmp eq i32 %56, 0
  br i1 %59, label %61, label %60

60:                                               ; preds = %51
  %.inv = icmp sgt i32 %56, -1
  %spec.select = select i1 %.inv, i32 1, i32 -1
  br label %.thread

61:                                               ; preds = %51, %40, %27
  %.14449.lcssa = phi double [ %.043, %27 ], [ %41, %40 ], [ %52, %51 ]
  %62 = fdiv double 1.000000e+00, %.14449.lcssa
  %63 = fneg double %62
  tail call void @N_VLinearSum(double noundef %62, ptr noundef %6, double noundef %63, ptr noundef %4, ptr noundef %6) #2
  br label %.thread

.thread:                                          ; preds = %60, %38, %49, %61
  %.0 = phi i32 [ 0, %61 ], [ -1, %38 ], [ -1, %49 ], [ %spec.select, %60 ]
  ret i32 %.0
}

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 = { 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, !11, i64 1456}
!6 = !{!"CPodeMemRec", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !7, i64 56, !7, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !8, i64 96, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !10, i64 248, !10, i64 252, !10, i64 256, !10, i64 260, !10, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !8, i64 336, !8, i64 448, !8, i64 496, !8, i64 600, !7, i64 704, !7, i64 712, !7, i64 720, !7, i64 728, !7, i64 736, !7, i64 744, !7, i64 752, !10, i64 760, !10, i64 764, !10, i64 768, !10, i64 772, !12, i64 776, !12, i64 784, !10, i64 792, !10, i64 796, !11, i64 800, !11, i64 808, !11, i64 816, !11, i64 824, !7, i64 832, !11, i64 840, !11, i64 848, !11, i64 856, !12, i64 864, !12, i64 872, !7, i64 880, !10, i64 888, !10, i64 892, !10, i64 896, !11, i64 904, !11, i64 912, !11, i64 920, !11, i64 928, !10, i64 936, !12, i64 944, !12, i64 952, !12, i64 960, !12, i64 968, !10, i64 976, !10, i64 980, !11, i64 984, !11, i64 992, !10, i64 1000, !10, i64 1004, !7, i64 1008, !7, i64 1016, !11, i64 1024, !8, i64 1032, !11, i64 1136, !11, i64 1144, !11, i64 1152, !11, i64 1160, !7, i64 1168, !12, i64 1176, !12, i64 1184, !10, i64 1192, !10, i64 1196, !10, i64 1200, !12, i64 1208, !12, i64 1216, !10, i64 1224, !10, i64 1228, !7, i64 1232, !10, i64 1240, !12, i64 1248, !10, i64 1256, !10, i64 1260, !10, i64 1264, !10, i64 1268, !7, i64 1272, !7, i64 1280, !7, i64 1288, !12, i64 1296, !12, i64 1304, !12, i64 1312, !12, i64 1320, !12, i64 1328, !12, i64 1336, !10, i64 1344, !7, i64 1352, !7, i64 1360, !7, i64 1368, !12, i64 1376, !12, i64 1384, !12, i64 1392, !12, i64 1400, !12, i64 1408, !12, i64 1416, !11, i64 1424, !11, i64 1432, !11, i64 1440, !11, i64 1448, !11, i64 1456, !10, i64 1464, !11, i64 1472, !11, i64 1480, !11, i64 1488, !11, i64 1496, !11, i64 1504, !11, i64 1512, !10, i64 1520, !10, i64 1524, !12, i64 1528, !7, i64 1536, !7, i64 1544, !7, i64 1552, !10, i64 1560, !7, i64 1568, !10, i64 1576, !10, i64 1580, !10, i64 1584, !10, i64 1588, !10, i64 1592, !10, i64 1596, !11, i64 1600, !11, i64 1608, !11, i64 1616, !10, i64 1624, !8, i64 1632, !10, i64 1824, !12, i64 1832, !10, i64 1840, !11, i64 1848, !10, i64 1856, !11, i64 1864, !11, i64 1872, !11, i64 1880, !11, i64 1888, !7, i64 1896, !7, i64 1904, !7, i64 1912, !11, i64 1920, !11, i64 1928, !11, i64 1936, !7, i64 1944, !10, i64 1952, !10, i64 1956, !12, i64 1960, !7, i64 1968, !7, i64 1976, !10, i64 1984, !10, i64 1988, !11, i64 1992, !11, i64 2000}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !10, i64 232}
!15 = !{!14, !7, i64 16}
!16 = !{!6, !11, i64 200}
!17 = !{!6, !11, i64 16}
!18 = !{!6, !11, i64 32}
!19 = !{!14, !12, i64 104}


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