; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/benchmarks/nvector (test_nvector_performance)

; 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"

@print_time = external dso_local global i32, align 4
@nextra = external dso_local global i32, align 4
@.str.38 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [16 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

declare void @N_VRand(ptr noundef, i64 noundef, double noundef, double noundef) #2

declare void @ClearCache(...) #2

declare void @sync_device(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @time_stats(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

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

declare double @N_VDotProd(ptr noundef, ptr noundef) #2

declare ptr @N_VCloneVectorArray(i32 noundef, ptr noundef) #2

declare void @N_VDestroyVectorArray(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @Test_N_VDotProdMulti(ptr noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  store i32 %3, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %26 = load i32, ptr %8, align 4, !tbaa !11
  %27 = load i32, ptr @nextra, align 4, !tbaa !11
  %28 = add nsw i32 %26, %27
  %29 = sext i32 %28 to i64
  %30 = mul i64 %29, 8
  %31 = call noalias ptr @malloc(i64 noundef %30) #6
  store ptr %31, ptr %19, align 8, !tbaa !5
  %32 = load i32, ptr %8, align 4, !tbaa !11
  %33 = load i32, ptr @nextra, align 4, !tbaa !11
  %34 = add nsw i32 %32, %33
  %35 = sext i32 %34 to i64
  %36 = mul i64 %35, 8
  %37 = call noalias ptr @malloc(i64 noundef %36) #6
  store ptr %37, ptr %20, align 8, !tbaa !5
  %38 = load i32, ptr %7, align 4, !tbaa !11
  %39 = sext i32 %38 to i64
  %40 = mul i64 %39, 8
  %41 = call noalias ptr @malloc(i64 noundef %40) #6
  store ptr %41, ptr %24, align 8, !tbaa !5
  %42 = load i32, ptr %7, align 4, !tbaa !11
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call ptr @N_VCloneVectorArray(i32 noundef %42, ptr noundef %43)
  store ptr %44, ptr %25, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %45, i64 noundef %46, double noundef -1.000000e+00, double noundef 1.000000e+00)
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %47

47:                                               ; preds = %58, %4
  %48 = load i32, ptr %22, align 4, !tbaa !11
  %49 = load i32, ptr %7, align 4, !tbaa !11
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %61

51:                                               ; preds = %47
  %52 = load ptr, ptr %25, align 8, !tbaa !5
  %53 = load i32, ptr %22, align 4, !tbaa !11
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %52, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %56, i64 noundef %57, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %58

58:                                               ; preds = %51
  %59 = load i32, ptr %22, align 4, !tbaa !11
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %22, align 4, !tbaa !11
  br label %47, !llvm.loop !13

61:                                               ; preds = %47
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %62

62:                                               ; preds = %99, %61
  %63 = load i32, ptr %21, align 4, !tbaa !11
  %64 = load i32, ptr %8, align 4, !tbaa !11
  %65 = load i32, ptr @nextra, align 4, !tbaa !11
  %66 = add nsw i32 %64, %65
  %67 = icmp slt i32 %63, %66
  br i1 %67, label %68, label %102

68:                                               ; preds = %62
  call void (...) @ClearCache()
  %69 = call double @get_time()
  store double %69, ptr %9, align 8, !tbaa !15
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %70

70:                                               ; preds = %86, %68
  %71 = load i32, ptr %22, align 4, !tbaa !11
  %72 = load i32, ptr %7, align 4, !tbaa !11
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %89

74:                                               ; preds = %70
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load ptr, ptr %25, align 8, !tbaa !5
  %77 = load i32, ptr %22, align 4, !tbaa !11
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %76, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = call double @N_VDotProd(ptr noundef %75, ptr noundef %80)
  %82 = load ptr, ptr %24, align 8, !tbaa !5
  %83 = load i32, ptr %22, align 4, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %82, i64 %84
  store double %81, ptr %85, align 8, !tbaa !15
  br label %86

86:                                               ; preds = %74
  %87 = load i32, ptr %22, align 4, !tbaa !11
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %22, align 4, !tbaa !11
  br label %70, !llvm.loop !17

89:                                               ; preds = %70
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %90)
  %91 = call double @get_time()
  store double %91, ptr %10, align 8, !tbaa !15
  %92 = load double, ptr %10, align 8, !tbaa !15
  %93 = load double, ptr %9, align 8, !tbaa !15
  %94 = fsub double %92, %93
  %95 = load ptr, ptr %20, align 8, !tbaa !5
  %96 = load i32, ptr %21, align 4, !tbaa !11
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %95, i64 %97
  store double %94, ptr %98, align 8, !tbaa !15
  br label %99

99:                                               ; preds = %89
  %100 = load i32, ptr %21, align 4, !tbaa !11
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %21, align 4, !tbaa !11
  br label %62, !llvm.loop !18

102:                                              ; preds = %62
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %103, i64 noundef %104, double noundef -1.000000e+00, double noundef 1.000000e+00)
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %116, %102
  %106 = load i32, ptr %22, align 4, !tbaa !11
  %107 = load i32, ptr %7, align 4, !tbaa !11
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %119

109:                                              ; preds = %105
  %110 = load ptr, ptr %25, align 8, !tbaa !5
  %111 = load i32, ptr %22, align 4, !tbaa !11
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %110, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %114, i64 noundef %115, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %116

116:                                              ; preds = %109
  %117 = load i32, ptr %22, align 4, !tbaa !11
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %22, align 4, !tbaa !11
  br label %105, !llvm.loop !19

119:                                              ; preds = %105
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %120

120:                                              ; preds = %142, %119
  %121 = load i32, ptr %21, align 4, !tbaa !11
  %122 = load i32, ptr %8, align 4, !tbaa !11
  %123 = load i32, ptr @nextra, align 4, !tbaa !11
  %124 = add nsw i32 %122, %123
  %125 = icmp slt i32 %121, %124
  br i1 %125, label %126, label %145

126:                                              ; preds = %120
  call void (...) @ClearCache()
  %127 = call double @get_time()
  store double %127, ptr %9, align 8, !tbaa !15
  %128 = load i32, ptr %7, align 4, !tbaa !11
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = load ptr, ptr %25, align 8, !tbaa !5
  %131 = load ptr, ptr %24, align 8, !tbaa !5
  %132 = call i32 @N_VDotProdMulti(i32 noundef %128, ptr noundef %129, ptr noundef %130, ptr noundef %131)
  store i32 %132, ptr %23, align 4, !tbaa !11
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %133)
  %134 = call double @get_time()
  store double %134, ptr %10, align 8, !tbaa !15
  %135 = load double, ptr %10, align 8, !tbaa !15
  %136 = load double, ptr %9, align 8, !tbaa !15
  %137 = fsub double %135, %136
  %138 = load ptr, ptr %19, align 8, !tbaa !5
  %139 = load i32, ptr %21, align 4, !tbaa !11
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds double, ptr %138, i64 %140
  store double %137, ptr %141, align 8, !tbaa !15
  br label %142

142:                                              ; preds = %126
  %143 = load i32, ptr %21, align 4, !tbaa !11
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %21, align 4, !tbaa !11
  br label %120, !llvm.loop !20

145:                                              ; preds = %120
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = load ptr, ptr %19, align 8, !tbaa !5
  %148 = load i32, ptr @nextra, align 4, !tbaa !11
  %149 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %146, ptr noundef %147, i32 noundef %148, i32 noundef %149, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = load ptr, ptr %20, align 8, !tbaa !5
  %152 = load i32, ptr @nextra, align 4, !tbaa !11
  %153 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %150, ptr noundef %151, i32 noundef %152, i32 noundef %153, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18)
  %154 = load i32, ptr @print_time, align 4, !tbaa !11
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %166

156:                                              ; preds = %145
  %157 = load double, ptr %11, align 8, !tbaa !15
  %158 = load double, ptr %12, align 8, !tbaa !15
  %159 = load double, ptr %13, align 8, !tbaa !15
  %160 = load double, ptr %14, align 8, !tbaa !15
  %161 = load double, ptr %15, align 8, !tbaa !15
  %162 = load double, ptr %16, align 8, !tbaa !15
  %163 = load double, ptr %17, align 8, !tbaa !15
  %164 = load double, ptr %18, align 8, !tbaa !15
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.38, ptr noundef @.str.44, double noundef %157, double noundef %158, double noundef %159, double noundef %160, double noundef %161, double noundef %162, double noundef %163, double noundef %164)
  br label %166

166:                                              ; preds = %156, %145
  %167 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %167) #5
  %168 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %168) #5
  %169 = load ptr, ptr %24, align 8, !tbaa !5
  call void @free(ptr noundef %169) #5
  %170 = load ptr, ptr %25, align 8, !tbaa !5
  %171 = load i32, ptr %7, align 4, !tbaa !11
  call void @N_VDestroyVectorArray(ptr noundef %170, i32 noundef %171)
  %172 = load i32, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret i32 %172
}

declare i32 @N_VDotProdMulti(i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden double @get_time() #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 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 #4 = { nounwind "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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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"

@print_time = external dso_local local_unnamed_addr global i32, align 4
@nextra = external dso_local local_unnamed_addr global i32, align 4
@.str.38 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [16 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

declare void @ClearCache(...) local_unnamed_addr #2

declare void @sync_device(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @time_stats(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

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

declare double @N_VDotProd(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @N_VDestroyVectorArray(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @Test_N_VDotProdMulti(ptr noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %13 = load i32, ptr @nextra, align 4, !tbaa !5
  %14 = add nsw i32 %13, %3
  %15 = sext i32 %14 to i64
  %16 = shl nsw i64 %15, 3
  %17 = tail call noalias ptr @malloc(i64 noundef %16) #7
  %18 = tail call noalias ptr @malloc(i64 noundef %16) #7
  %19 = sext i32 %2 to i64
  %20 = shl nsw i64 %19, 3
  %21 = tail call noalias ptr @malloc(i64 noundef %20) #7
  %22 = tail call ptr @N_VCloneVectorArray(i32 noundef %2, ptr noundef %0) #6
  tail call void @N_VRand(ptr noundef %0, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #6
  %23 = icmp sgt i32 %2, 0
  br i1 %23, label %.lr.ph.preheader, label %.preheader64.thread

.lr.ph.preheader:                                 ; preds = %4
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.lr.ph

.preheader64:                                     ; preds = %.lr.ph
  %24 = load i32, ptr @nextra, align 4, !tbaa !5
  %25 = add nsw i32 %24, %3
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph69, label %._crit_edge70

.preheader64.thread:                              ; preds = %4
  %27 = load i32, ptr @nextra, align 4, !tbaa !5
  %28 = add nsw i32 %27, %3
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph69.split.preheader, label %._crit_edge70.thread

._crit_edge70.thread:                             ; preds = %.preheader64.thread
  tail call void @N_VRand(ptr noundef %0, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #6
  br label %.preheader

.lr.ph69:                                         ; preds = %.preheader64
  br i1 %23, label %.lr.ph67.us.preheader, label %.lr.ph69.split.preheader

.lr.ph69.split.preheader:                         ; preds = %.preheader64.thread, %.lr.ph69
  br label %.lr.ph69.split

.lr.ph67.us.preheader:                            ; preds = %.lr.ph69
  %wide.trip.count86 = zext nneg i32 %2 to i64
  br label %.lr.ph67.us

.lr.ph67.us:                                      ; preds = %.lr.ph67.us.preheader, %._crit_edge.us
  %indvars.iv88 = phi i64 [ 0, %.lr.ph67.us.preheader ], [ %indvars.iv.next89, %._crit_edge.us ]
  tail call void (...) @ClearCache() #6
  %30 = tail call double @get_time()
  br label %31

31:                                               ; preds = %.lr.ph67.us, %31
  %indvars.iv83 = phi i64 [ 0, %.lr.ph67.us ], [ %indvars.iv.next84, %31 ]
  %32 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv83
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = tail call double @N_VDotProd(ptr noundef %0, ptr noundef %33) #6
  %35 = getelementptr inbounds double, ptr %21, i64 %indvars.iv83
  store double %34, ptr %35, align 8, !tbaa !11
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
  br i1 %exitcond87.not, label %._crit_edge.us, label %31, !llvm.loop !13

._crit_edge.us:                                   ; preds = %31
  tail call void @sync_device(ptr noundef %0) #6
  %36 = tail call double @get_time()
  %37 = fsub double %36, %30
  %38 = getelementptr inbounds double, ptr %18, i64 %indvars.iv88
  store double %37, ptr %38, align 8, !tbaa !11
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %39 = load i32, ptr @nextra, align 4, !tbaa !5
  %40 = add nsw i32 %39, %3
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next89, %41
  br i1 %42, label %.lr.ph67.us, label %._crit_edge70, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %43 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  tail call void @N_VRand(ptr noundef %44, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader64, label %.lr.ph, !llvm.loop !16

.lr.ph69.split:                                   ; preds = %.lr.ph69.split.preheader, %.lr.ph69.split
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %.lr.ph69.split ], [ 0, %.lr.ph69.split.preheader ]
  tail call void (...) @ClearCache() #6
  %45 = tail call double @get_time()
  tail call void @sync_device(ptr noundef %0) #6
  %46 = tail call double @get_time()
  %47 = fsub double %46, %45
  %48 = getelementptr inbounds double, ptr %18, i64 %indvars.iv80
  store double %47, ptr %48, align 8, !tbaa !11
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %49 = load i32, ptr @nextra, align 4, !tbaa !5
  %50 = add nsw i32 %49, %3
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv.next81, %51
  br i1 %52, label %.lr.ph69.split, label %._crit_edge70, !llvm.loop !15

._crit_edge70:                                    ; preds = %.lr.ph69.split, %._crit_edge.us, %.preheader64
  tail call void @N_VRand(ptr noundef %0, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #6
  br i1 %23, label %.lr.ph72.preheader, label %.preheader

.lr.ph72.preheader:                               ; preds = %._crit_edge70
  %wide.trip.count94 = zext nneg i32 %2 to i64
  br label %.lr.ph72

.preheader:                                       ; preds = %.lr.ph72, %._crit_edge70.thread, %._crit_edge70
  %53 = load i32, ptr @nextra, align 4, !tbaa !5
  %54 = add nsw i32 %53, %3
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.lr.ph74, label %._crit_edge

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %.lr.ph72
  %indvars.iv91 = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next92, %.lr.ph72 ]
  %56 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv91
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  tail call void @N_VRand(ptr noundef %57, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #6
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count94
  br i1 %exitcond95.not, label %.preheader, label %.lr.ph72, !llvm.loop !17

.lr.ph74:                                         ; preds = %.preheader, %.lr.ph74
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %.lr.ph74 ], [ 0, %.preheader ]
  tail call void (...) @ClearCache() #6
  %58 = tail call double @get_time()
  %59 = tail call i32 @N_VDotProdMulti(i32 noundef %2, ptr noundef %0, ptr noundef %22, ptr noundef %21) #6
  tail call void @sync_device(ptr noundef %0) #6
  %60 = tail call double @get_time()
  %61 = fsub double %60, %58
  %62 = getelementptr inbounds double, ptr %17, i64 %indvars.iv96
  store double %61, ptr %62, align 8, !tbaa !11
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %63 = load i32, ptr @nextra, align 4, !tbaa !5
  %64 = add nsw i32 %63, %3
  %65 = sext i32 %64 to i64
  %66 = icmp slt i64 %indvars.iv.next97, %65
  br i1 %66, label %.lr.ph74, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph74, %.preheader
  %.0.lcssa = phi i32 [ undef, %.preheader ], [ %59, %.lr.ph74 ]
  %.lcssa = phi i32 [ %53, %.preheader ], [ %63, %.lr.ph74 ]
  call void @time_stats(ptr noundef %0, ptr noundef %17, i32 noundef %.lcssa, i32 noundef %3, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %67 = load i32, ptr @nextra, align 4, !tbaa !5
  call void @time_stats(ptr noundef %0, ptr noundef %18, i32 noundef %67, i32 noundef %3, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %68 = load i32, ptr @print_time, align 4, !tbaa !5
  %.not = icmp eq i32 %68, 0
  br i1 %.not, label %79, label %69

69:                                               ; preds = %._crit_edge
  %70 = load double, ptr %5, align 8, !tbaa !11
  %71 = load double, ptr %6, align 8, !tbaa !11
  %72 = load double, ptr %7, align 8, !tbaa !11
  %73 = load double, ptr %8, align 8, !tbaa !11
  %74 = load double, ptr %9, align 8, !tbaa !11
  %75 = load double, ptr %10, align 8, !tbaa !11
  %76 = load double, ptr %11, align 8, !tbaa !11
  %77 = load double, ptr %12, align 8, !tbaa !11
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38, ptr noundef nonnull @.str.44, double noundef %70, double noundef %71, double noundef %72, double noundef %73, double noundef %74, double noundef %75, double noundef %76, double noundef %77)
  br label %79

79:                                               ; preds = %69, %._crit_edge
  call void @free(ptr noundef %17) #6
  call void @free(ptr noundef %18) #6
  call void @free(ptr noundef %21) #6
  call void @N_VDestroyVectorArray(ptr noundef %22, i32 noundef %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  ret i32 %.0.lcssa
}

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

; Function Attrs: nounwind uwtable
declare hidden double @get_time() local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 #4 = { nofree nounwind "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 #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 = !{!"int", !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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass