; 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.48 = external hidden unnamed_addr constant [20 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 i32 @rand() #4

declare void @N_VConst(double noundef, 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 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_VConstVectorArray(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 double, 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 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call ptr @N_VCloneVectorArray(i32 noundef %38, ptr noundef %39)
  store ptr %40, ptr %25, align 8, !tbaa !5
  %41 = call i32 @rand() #5
  %42 = sitofp i32 %41 to double
  %43 = fdiv double %42, 0x41DFFFFFFFC00000
  %44 = fadd double %43, 1.000000e+00
  store double %44, ptr %24, align 8, !tbaa !13
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %56, %4
  %46 = load i32, ptr %22, align 4, !tbaa !11
  %47 = load i32, ptr %7, align 4, !tbaa !11
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %49, label %59

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

56:                                               ; preds = %49
  %57 = load i32, ptr %22, align 4, !tbaa !11
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %22, align 4, !tbaa !11
  br label %45, !llvm.loop !15

59:                                               ; preds = %45
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %60

60:                                               ; preds = %92, %59
  %61 = load i32, ptr %21, align 4, !tbaa !11
  %62 = load i32, ptr %8, align 4, !tbaa !11
  %63 = load i32, ptr @nextra, align 4, !tbaa !11
  %64 = add nsw i32 %62, %63
  %65 = icmp slt i32 %61, %64
  br i1 %65, label %66, label %95

66:                                               ; preds = %60
  call void (...) @ClearCache()
  %67 = call double @get_time()
  store double %67, ptr %9, align 8, !tbaa !13
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %68

68:                                               ; preds = %79, %66
  %69 = load i32, ptr %22, align 4, !tbaa !11
  %70 = load i32, ptr %7, align 4, !tbaa !11
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %82

72:                                               ; preds = %68
  %73 = load double, ptr %24, align 8, !tbaa !13
  %74 = load ptr, ptr %25, align 8, !tbaa !5
  %75 = load i32, ptr %22, align 4, !tbaa !11
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds ptr, ptr %74, i64 %76
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  call void @N_VConst(double noundef %73, ptr noundef %78)
  br label %79

79:                                               ; preds = %72
  %80 = load i32, ptr %22, align 4, !tbaa !11
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %22, align 4, !tbaa !11
  br label %68, !llvm.loop !17

82:                                               ; preds = %68
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %83)
  %84 = call double @get_time()
  store double %84, ptr %10, align 8, !tbaa !13
  %85 = load double, ptr %10, align 8, !tbaa !13
  %86 = load double, ptr %9, align 8, !tbaa !13
  %87 = fsub double %85, %86
  %88 = load ptr, ptr %20, align 8, !tbaa !5
  %89 = load i32, ptr %21, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds double, ptr %88, i64 %90
  store double %87, ptr %91, align 8, !tbaa !13
  br label %92

92:                                               ; preds = %82
  %93 = load i32, ptr %21, align 4, !tbaa !11
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %21, align 4, !tbaa !11
  br label %60, !llvm.loop !18

95:                                               ; preds = %60
  %96 = call i32 @rand() #5
  %97 = sitofp i32 %96 to double
  %98 = fdiv double %97, 0x41DFFFFFFFC00000
  %99 = fadd double %98, 1.000000e+00
  store double %99, ptr %24, align 8, !tbaa !13
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %100

100:                                              ; preds = %111, %95
  %101 = load i32, ptr %22, align 4, !tbaa !11
  %102 = load i32, ptr %7, align 4, !tbaa !11
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %104, label %114

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

111:                                              ; preds = %104
  %112 = load i32, ptr %22, align 4, !tbaa !11
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %22, align 4, !tbaa !11
  br label %100, !llvm.loop !19

114:                                              ; preds = %100
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %115

115:                                              ; preds = %136, %114
  %116 = load i32, ptr %21, align 4, !tbaa !11
  %117 = load i32, ptr %8, align 4, !tbaa !11
  %118 = load i32, ptr @nextra, align 4, !tbaa !11
  %119 = add nsw i32 %117, %118
  %120 = icmp slt i32 %116, %119
  br i1 %120, label %121, label %139

121:                                              ; preds = %115
  call void (...) @ClearCache()
  %122 = call double @get_time()
  store double %122, ptr %9, align 8, !tbaa !13
  %123 = load i32, ptr %7, align 4, !tbaa !11
  %124 = load double, ptr %24, align 8, !tbaa !13
  %125 = load ptr, ptr %25, align 8, !tbaa !5
  %126 = call i32 @N_VConstVectorArray(i32 noundef %123, double noundef %124, ptr noundef %125)
  store i32 %126, ptr %23, align 4, !tbaa !11
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %127)
  %128 = call double @get_time()
  store double %128, ptr %10, align 8, !tbaa !13
  %129 = load double, ptr %10, align 8, !tbaa !13
  %130 = load double, ptr %9, align 8, !tbaa !13
  %131 = fsub double %129, %130
  %132 = load ptr, ptr %19, align 8, !tbaa !5
  %133 = load i32, ptr %21, align 4, !tbaa !11
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %132, i64 %134
  store double %131, ptr %135, align 8, !tbaa !13
  br label %136

136:                                              ; preds = %121
  %137 = load i32, ptr %21, align 4, !tbaa !11
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %21, align 4, !tbaa !11
  br label %115, !llvm.loop !20

139:                                              ; preds = %115
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = load ptr, ptr %19, align 8, !tbaa !5
  %142 = load i32, ptr @nextra, align 4, !tbaa !11
  %143 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %140, ptr noundef %141, i32 noundef %142, i32 noundef %143, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = load ptr, ptr %20, align 8, !tbaa !5
  %146 = load i32, ptr @nextra, align 4, !tbaa !11
  %147 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %144, ptr noundef %145, i32 noundef %146, i32 noundef %147, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18)
  %148 = load i32, ptr @print_time, align 4, !tbaa !11
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %160

150:                                              ; preds = %139
  %151 = load double, ptr %11, align 8, !tbaa !13
  %152 = load double, ptr %12, align 8, !tbaa !13
  %153 = load double, ptr %13, align 8, !tbaa !13
  %154 = load double, ptr %14, align 8, !tbaa !13
  %155 = load double, ptr %15, align 8, !tbaa !13
  %156 = load double, ptr %16, align 8, !tbaa !13
  %157 = load double, ptr %17, align 8, !tbaa !13
  %158 = load double, ptr %18, align 8, !tbaa !13
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.38, ptr noundef @.str.48, double noundef %151, double noundef %152, double noundef %153, double noundef %154, double noundef %155, double noundef %156, double noundef %157, double noundef %158)
  br label %160

160:                                              ; preds = %150, %139
  %161 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %161) #5
  %162 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %162) #5
  %163 = load ptr, ptr %25, align 8, !tbaa !5
  %164 = load i32, ptr %7, align 4, !tbaa !11
  call void @N_VDestroyVectorArray(ptr noundef %163, i32 noundef %164)
  %165 = 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 %165
}

declare i32 @N_VConstVectorArray(i32 noundef, double 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 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


; 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.48 = external hidden unnamed_addr constant [20 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: nounwind
declare i32 @rand() local_unnamed_addr #5

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

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

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

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_VConstVectorArray(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) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %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) #8
  %18 = tail call noalias ptr @malloc(i64 noundef %16) #8
  %19 = tail call ptr @N_VCloneVectorArray(i32 noundef %2, ptr noundef %0) #7
  %20 = tail call i32 @rand() #7
  %21 = sitofp i32 %20 to double
  %22 = fdiv double %21, 0x41DFFFFFFFC00000
  %23 = fadd double %22, 1.000000e+00
  %24 = icmp sgt i32 %2, 0
  br i1 %24, label %.lr.ph.preheader, label %.preheader55.thread

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

.preheader55:                                     ; preds = %.lr.ph
  %25 = load i32, ptr @nextra, align 4, !tbaa !5
  %26 = add nsw i32 %25, %3
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph60, label %._crit_edge61

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

.lr.ph60:                                         ; preds = %.preheader55
  br i1 %24, label %.lr.ph58.us.preheader, label %.lr.ph60.split.preheader

.lr.ph60.split.preheader:                         ; preds = %.preheader55.thread, %.lr.ph60
  br label %.lr.ph60.split

.lr.ph58.us.preheader:                            ; preds = %.lr.ph60
  %wide.trip.count77 = zext nneg i32 %2 to i64
  br label %.lr.ph58.us

.lr.ph58.us:                                      ; preds = %.lr.ph58.us.preheader, %._crit_edge.us
  %indvars.iv79 = phi i64 [ 0, %.lr.ph58.us.preheader ], [ %indvars.iv.next80, %._crit_edge.us ]
  tail call void (...) @ClearCache() #7
  %31 = tail call double @get_time()
  br label %32

32:                                               ; preds = %.lr.ph58.us, %32
  %indvars.iv74 = phi i64 [ 0, %.lr.ph58.us ], [ %indvars.iv.next75, %32 ]
  %33 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv74
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  tail call void @N_VConst(double noundef %23, ptr noundef %34) #7
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %._crit_edge.us, label %32, !llvm.loop !11

._crit_edge.us:                                   ; preds = %32
  tail call void @sync_device(ptr noundef %0) #7
  %35 = tail call double @get_time()
  %36 = fsub double %35, %31
  %37 = getelementptr inbounds double, ptr %18, i64 %indvars.iv79
  store double %36, ptr %37, align 8, !tbaa !13
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %38 = load i32, ptr @nextra, align 4, !tbaa !5
  %39 = add nsw i32 %38, %3
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next80, %40
  br i1 %41, label %.lr.ph58.us, label %._crit_edge61, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %42 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  tail call void @N_VRand(ptr noundef %43, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #7
  %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 %.preheader55, label %.lr.ph, !llvm.loop !16

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

._crit_edge61:                                    ; preds = %.lr.ph60.split, %._crit_edge.us, %.preheader55.thread, %.preheader55
  %52 = tail call i32 @rand() #7
  %53 = sitofp i32 %52 to double
  %54 = fdiv double %53, 0x41DFFFFFFFC00000
  %55 = fadd double %54, 1.000000e+00
  br i1 %24, label %.lr.ph63.preheader, label %.preheader

.lr.ph63.preheader:                               ; preds = %._crit_edge61
  %wide.trip.count85 = zext nneg i32 %2 to i64
  br label %.lr.ph63

.preheader:                                       ; preds = %.lr.ph63, %._crit_edge61
  %56 = load i32, ptr @nextra, align 4, !tbaa !5
  %57 = add nsw i32 %56, %3
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph65, label %._crit_edge

.lr.ph63:                                         ; preds = %.lr.ph63.preheader, %.lr.ph63
  %indvars.iv82 = phi i64 [ 0, %.lr.ph63.preheader ], [ %indvars.iv.next83, %.lr.ph63 ]
  %59 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv82
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  tail call void @N_VRand(ptr noundef %60, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #7
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
  br i1 %exitcond86.not, label %.preheader, label %.lr.ph63, !llvm.loop !17

.lr.ph65:                                         ; preds = %.preheader, %.lr.ph65
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %.lr.ph65 ], [ 0, %.preheader ]
  tail call void (...) @ClearCache() #7
  %61 = tail call double @get_time()
  %62 = tail call i32 @N_VConstVectorArray(i32 noundef %2, double noundef %55, ptr noundef %19) #7
  tail call void @sync_device(ptr noundef %0) #7
  %63 = tail call double @get_time()
  %64 = fsub double %63, %61
  %65 = getelementptr inbounds double, ptr %17, i64 %indvars.iv87
  store double %64, ptr %65, align 8, !tbaa !13
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %66 = load i32, ptr @nextra, align 4, !tbaa !5
  %67 = add nsw i32 %66, %3
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next88, %68
  br i1 %69, label %.lr.ph65, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph65, %.preheader
  %.0.lcssa = phi i32 [ undef, %.preheader ], [ %62, %.lr.ph65 ]
  %.lcssa = phi i32 [ %56, %.preheader ], [ %66, %.lr.ph65 ]
  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)
  %70 = load i32, ptr @nextra, align 4, !tbaa !5
  call void @time_stats(ptr noundef %0, ptr noundef %18, i32 noundef %70, i32 noundef %3, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %71 = load i32, ptr @print_time, align 4, !tbaa !5
  %.not = icmp eq i32 %71, 0
  br i1 %.not, label %82, label %72

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

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

declare i32 @N_VConstVectorArray(i32 noundef, double 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 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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