; 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.45 = external hidden unnamed_addr constant [24 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 @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) #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

; 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_VLinearSumVectorArray(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 double, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %29 = load i32, ptr %8, align 4, !tbaa !11
  %30 = load i32, ptr @nextra, align 4, !tbaa !11
  %31 = add nsw i32 %29, %30
  %32 = sext i32 %31 to i64
  %33 = mul i64 %32, 8
  %34 = call noalias ptr @malloc(i64 noundef %33) #6
  store ptr %34, ptr %19, align 8, !tbaa !5
  %35 = load i32, ptr %8, align 4, !tbaa !11
  %36 = load i32, ptr @nextra, align 4, !tbaa !11
  %37 = add nsw i32 %35, %36
  %38 = sext i32 %37 to i64
  %39 = mul i64 %38, 8
  %40 = call noalias ptr @malloc(i64 noundef %39) #6
  store ptr %40, ptr %20, align 8, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !11
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = call ptr @N_VCloneVectorArray(i32 noundef %41, ptr noundef %42)
  store ptr %43, ptr %26, align 8, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !11
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call ptr @N_VCloneVectorArray(i32 noundef %44, ptr noundef %45)
  store ptr %46, ptr %27, align 8, !tbaa !5
  %47 = load i32, ptr %7, align 4, !tbaa !11
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = call ptr @N_VCloneVectorArray(i32 noundef %47, ptr noundef %48)
  store ptr %49, ptr %28, align 8, !tbaa !5
  %50 = call i32 @rand() #5
  %51 = sitofp i32 %50 to double
  %52 = fdiv double %51, 0x41DFFFFFFFC00000
  %53 = fadd double %52, 1.000000e+00
  store double %53, ptr %24, align 8, !tbaa !13
  %54 = call i32 @rand() #5
  %55 = sitofp i32 %54 to double
  %56 = fdiv double %55, 0x41DFFFFFFFC00000
  %57 = fadd double %56, 1.000000e+00
  store double %57, ptr %25, align 8, !tbaa !13
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %58

58:                                               ; preds = %75, %4
  %59 = load i32, ptr %22, align 4, !tbaa !11
  %60 = load i32, ptr %7, align 4, !tbaa !11
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %62, label %78

62:                                               ; preds = %58
  %63 = load ptr, ptr %26, align 8, !tbaa !5
  %64 = load i32, ptr %22, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds ptr, ptr %63, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %67, i64 noundef %68, double noundef -1.000000e+00, double noundef 1.000000e+00)
  %69 = load ptr, ptr %27, align 8, !tbaa !5
  %70 = load i32, ptr %22, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds ptr, ptr %69, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %73, i64 noundef %74, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %75

75:                                               ; preds = %62
  %76 = load i32, ptr %22, align 4, !tbaa !11
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %22, align 4, !tbaa !11
  br label %58, !llvm.loop !15

78:                                               ; preds = %58
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %79

79:                                               ; preds = %122, %78
  %80 = load i32, ptr %21, align 4, !tbaa !11
  %81 = load i32, ptr %8, align 4, !tbaa !11
  %82 = load i32, ptr @nextra, align 4, !tbaa !11
  %83 = add nsw i32 %81, %82
  %84 = icmp slt i32 %80, %83
  br i1 %84, label %85, label %125

85:                                               ; preds = %79
  call void (...) @ClearCache()
  %86 = call double @get_time()
  store double %86, ptr %9, align 8, !tbaa !13
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %87

87:                                               ; preds = %109, %85
  %88 = load i32, ptr %22, align 4, !tbaa !11
  %89 = load i32, ptr %7, align 4, !tbaa !11
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %91, label %112

91:                                               ; preds = %87
  %92 = load double, ptr %24, align 8, !tbaa !13
  %93 = load ptr, ptr %26, align 8, !tbaa !5
  %94 = load i32, ptr %22, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds ptr, ptr %93, i64 %95
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %98 = load double, ptr %25, align 8, !tbaa !13
  %99 = load ptr, ptr %27, align 8, !tbaa !5
  %100 = load i32, ptr %22, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds ptr, ptr %99, i64 %101
  %103 = load ptr, ptr %102, align 8, !tbaa !5
  %104 = load ptr, ptr %28, align 8, !tbaa !5
  %105 = load i32, ptr %22, align 4, !tbaa !11
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds ptr, ptr %104, i64 %106
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  call void @N_VLinearSum(double noundef %92, ptr noundef %97, double noundef %98, ptr noundef %103, ptr noundef %108)
  br label %109

109:                                              ; preds = %91
  %110 = load i32, ptr %22, align 4, !tbaa !11
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %22, align 4, !tbaa !11
  br label %87, !llvm.loop !17

112:                                              ; preds = %87
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %113)
  %114 = call double @get_time()
  store double %114, ptr %10, align 8, !tbaa !13
  %115 = load double, ptr %10, align 8, !tbaa !13
  %116 = load double, ptr %9, align 8, !tbaa !13
  %117 = fsub double %115, %116
  %118 = load ptr, ptr %20, align 8, !tbaa !5
  %119 = load i32, ptr %21, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %118, i64 %120
  store double %117, ptr %121, align 8, !tbaa !13
  br label %122

122:                                              ; preds = %112
  %123 = load i32, ptr %21, align 4, !tbaa !11
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %21, align 4, !tbaa !11
  br label %79, !llvm.loop !18

125:                                              ; preds = %79
  %126 = call i32 @rand() #5
  %127 = sitofp i32 %126 to double
  %128 = fdiv double %127, 0x41DFFFFFFFC00000
  %129 = fadd double %128, 1.000000e+00
  store double %129, ptr %24, align 8, !tbaa !13
  %130 = call i32 @rand() #5
  %131 = sitofp i32 %130 to double
  %132 = fdiv double %131, 0x41DFFFFFFFC00000
  %133 = fadd double %132, 1.000000e+00
  store double %133, ptr %25, align 8, !tbaa !13
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %134

134:                                              ; preds = %151, %125
  %135 = load i32, ptr %22, align 4, !tbaa !11
  %136 = load i32, ptr %7, align 4, !tbaa !11
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %138, label %154

138:                                              ; preds = %134
  %139 = load ptr, ptr %26, align 8, !tbaa !5
  %140 = load i32, ptr %22, align 4, !tbaa !11
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds ptr, ptr %139, i64 %141
  %143 = load ptr, ptr %142, align 8, !tbaa !5
  %144 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %143, i64 noundef %144, double noundef -1.000000e+00, double noundef 1.000000e+00)
  %145 = load ptr, ptr %27, align 8, !tbaa !5
  %146 = load i32, ptr %22, align 4, !tbaa !11
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds ptr, ptr %145, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  %150 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %149, i64 noundef %150, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %151

151:                                              ; preds = %138
  %152 = load i32, ptr %22, align 4, !tbaa !11
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %22, align 4, !tbaa !11
  br label %134, !llvm.loop !19

154:                                              ; preds = %134
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %155

155:                                              ; preds = %179, %154
  %156 = load i32, ptr %21, align 4, !tbaa !11
  %157 = load i32, ptr %8, align 4, !tbaa !11
  %158 = load i32, ptr @nextra, align 4, !tbaa !11
  %159 = add nsw i32 %157, %158
  %160 = icmp slt i32 %156, %159
  br i1 %160, label %161, label %182

161:                                              ; preds = %155
  call void (...) @ClearCache()
  %162 = call double @get_time()
  store double %162, ptr %9, align 8, !tbaa !13
  %163 = load i32, ptr %7, align 4, !tbaa !11
  %164 = load double, ptr %24, align 8, !tbaa !13
  %165 = load ptr, ptr %26, align 8, !tbaa !5
  %166 = load double, ptr %25, align 8, !tbaa !13
  %167 = load ptr, ptr %27, align 8, !tbaa !5
  %168 = load ptr, ptr %28, align 8, !tbaa !5
  %169 = call i32 @N_VLinearSumVectorArray(i32 noundef %163, double noundef %164, ptr noundef %165, double noundef %166, ptr noundef %167, ptr noundef %168)
  store i32 %169, ptr %23, align 4, !tbaa !11
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %170)
  %171 = call double @get_time()
  store double %171, ptr %10, align 8, !tbaa !13
  %172 = load double, ptr %10, align 8, !tbaa !13
  %173 = load double, ptr %9, align 8, !tbaa !13
  %174 = fsub double %172, %173
  %175 = load ptr, ptr %19, align 8, !tbaa !5
  %176 = load i32, ptr %21, align 4, !tbaa !11
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds double, ptr %175, i64 %177
  store double %174, ptr %178, align 8, !tbaa !13
  br label %179

179:                                              ; preds = %161
  %180 = load i32, ptr %21, align 4, !tbaa !11
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %21, align 4, !tbaa !11
  br label %155, !llvm.loop !20

182:                                              ; preds = %155
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = load ptr, ptr %19, align 8, !tbaa !5
  %185 = load i32, ptr @nextra, align 4, !tbaa !11
  %186 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %183, ptr noundef %184, i32 noundef %185, i32 noundef %186, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = load ptr, ptr %20, align 8, !tbaa !5
  %189 = load i32, ptr @nextra, align 4, !tbaa !11
  %190 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %187, ptr noundef %188, i32 noundef %189, i32 noundef %190, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18)
  %191 = load i32, ptr @print_time, align 4, !tbaa !11
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %203

193:                                              ; preds = %182
  %194 = load double, ptr %11, align 8, !tbaa !13
  %195 = load double, ptr %12, align 8, !tbaa !13
  %196 = load double, ptr %13, align 8, !tbaa !13
  %197 = load double, ptr %14, align 8, !tbaa !13
  %198 = load double, ptr %15, align 8, !tbaa !13
  %199 = load double, ptr %16, align 8, !tbaa !13
  %200 = load double, ptr %17, align 8, !tbaa !13
  %201 = load double, ptr %18, align 8, !tbaa !13
  %202 = call i32 (ptr, ...) @printf(ptr noundef @.str.38, ptr noundef @.str.45, double noundef %194, double noundef %195, double noundef %196, double noundef %197, double noundef %198, double noundef %199, double noundef %200, double noundef %201)
  br label %203

203:                                              ; preds = %193, %182
  %204 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %204) #5
  %205 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %205) #5
  %206 = load ptr, ptr %26, align 8, !tbaa !5
  %207 = load i32, ptr %7, align 4, !tbaa !11
  call void @N_VDestroyVectorArray(ptr noundef %206, i32 noundef %207)
  %208 = load ptr, ptr %27, align 8, !tbaa !5
  %209 = load i32, ptr %7, align 4, !tbaa !11
  call void @N_VDestroyVectorArray(ptr noundef %208, i32 noundef %209)
  %210 = load ptr, ptr %28, align 8, !tbaa !5
  %211 = load i32, ptr %7, align 4, !tbaa !11
  call void @N_VDestroyVectorArray(ptr noundef %210, i32 noundef %211)
  %212 = load i32, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  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 %212
}

declare i32 @N_VLinearSumVectorArray(i32 noundef, double noundef, ptr noundef, double 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 = !{!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.45 = external hidden unnamed_addr constant [24 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 @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) 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

; 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_VLinearSumVectorArray(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 ptr @N_VCloneVectorArray(i32 noundef %2, ptr noundef %0) #7
  %21 = tail call ptr @N_VCloneVectorArray(i32 noundef %2, ptr noundef %0) #7
  %22 = tail call i32 @rand() #7
  %23 = sitofp i32 %22 to double
  %24 = fdiv double %23, 0x41DFFFFFFFC00000
  %25 = fadd double %24, 1.000000e+00
  %26 = tail call i32 @rand() #7
  %27 = sitofp i32 %26 to double
  %28 = fdiv double %27, 0x41DFFFFFFFC00000
  %29 = fadd double %28, 1.000000e+00
  %30 = icmp sgt i32 %2, 0
  br i1 %30, label %.lr.ph.preheader, label %.preheader77.thread

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

.preheader77:                                     ; preds = %.lr.ph
  %31 = load i32, ptr @nextra, align 4, !tbaa !5
  %32 = add nsw i32 %31, %3
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph82, label %._crit_edge83

.preheader77.thread:                              ; preds = %4
  %34 = load i32, ptr @nextra, align 4, !tbaa !5
  %35 = add nsw i32 %34, %3
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph82.split.preheader, label %._crit_edge83

.lr.ph82:                                         ; preds = %.preheader77
  br i1 %30, label %.lr.ph80.us.preheader, label %.lr.ph82.split.preheader

.lr.ph82.split.preheader:                         ; preds = %.preheader77.thread, %.lr.ph82
  br label %.lr.ph82.split

.lr.ph80.us.preheader:                            ; preds = %.lr.ph82
  %wide.trip.count99 = zext nneg i32 %2 to i64
  br label %.lr.ph80.us

.lr.ph80.us:                                      ; preds = %.lr.ph80.us.preheader, %._crit_edge.us
  %indvars.iv101 = phi i64 [ 0, %.lr.ph80.us.preheader ], [ %indvars.iv.next102, %._crit_edge.us ]
  tail call void (...) @ClearCache() #7
  %37 = tail call double @get_time()
  br label %38

38:                                               ; preds = %.lr.ph80.us, %38
  %indvars.iv96 = phi i64 [ 0, %.lr.ph80.us ], [ %indvars.iv.next97, %38 ]
  %39 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv96
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv96
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = getelementptr inbounds ptr, ptr %21, i64 %indvars.iv96
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  tail call void @N_VLinearSum(double noundef %25, ptr noundef %40, double noundef %29, ptr noundef %42, ptr noundef %44) #7
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
  br i1 %exitcond100.not, label %._crit_edge.us, label %38, !llvm.loop !11

._crit_edge.us:                                   ; preds = %38
  tail call void @sync_device(ptr noundef %0) #7
  %45 = tail call double @get_time()
  %46 = fsub double %45, %37
  %47 = getelementptr inbounds double, ptr %18, i64 %indvars.iv101
  store double %46, ptr %47, align 8, !tbaa !13
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 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.next102, %50
  br i1 %51, label %.lr.ph80.us, label %._crit_edge83, !llvm.loop !15

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

.lr.ph82.split:                                   ; preds = %.lr.ph82.split.preheader, %.lr.ph82.split
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %.lr.ph82.split ], [ 0, %.lr.ph82.split.preheader ]
  tail call void (...) @ClearCache() #7
  %56 = tail call double @get_time()
  tail call void @sync_device(ptr noundef %0) #7
  %57 = tail call double @get_time()
  %58 = fsub double %57, %56
  %59 = getelementptr inbounds double, ptr %18, i64 %indvars.iv93
  store double %58, ptr %59, align 8, !tbaa !13
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %60 = load i32, ptr @nextra, align 4, !tbaa !5
  %61 = add nsw i32 %60, %3
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next94, %62
  br i1 %63, label %.lr.ph82.split, label %._crit_edge83, !llvm.loop !15

._crit_edge83:                                    ; preds = %.lr.ph82.split, %._crit_edge.us, %.preheader77.thread, %.preheader77
  %64 = tail call i32 @rand() #7
  %65 = sitofp i32 %64 to double
  %66 = fdiv double %65, 0x41DFFFFFFFC00000
  %67 = fadd double %66, 1.000000e+00
  %68 = tail call i32 @rand() #7
  %69 = sitofp i32 %68 to double
  %70 = fdiv double %69, 0x41DFFFFFFFC00000
  %71 = fadd double %70, 1.000000e+00
  br i1 %30, label %.lr.ph85.preheader, label %.preheader

.lr.ph85.preheader:                               ; preds = %._crit_edge83
  %wide.trip.count107 = zext nneg i32 %2 to i64
  br label %.lr.ph85

.preheader:                                       ; preds = %.lr.ph85, %._crit_edge83
  %72 = load i32, ptr @nextra, align 4, !tbaa !5
  %73 = add nsw i32 %72, %3
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %.lr.ph87, label %._crit_edge

.lr.ph85:                                         ; preds = %.lr.ph85.preheader, %.lr.ph85
  %indvars.iv104 = phi i64 [ 0, %.lr.ph85.preheader ], [ %indvars.iv.next105, %.lr.ph85 ]
  %75 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv104
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  tail call void @N_VRand(ptr noundef %76, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #7
  %77 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv104
  %78 = load ptr, ptr %77, align 8, !tbaa !9
  tail call void @N_VRand(ptr noundef %78, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #7
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count107
  br i1 %exitcond108.not, label %.preheader, label %.lr.ph85, !llvm.loop !17

.lr.ph87:                                         ; preds = %.preheader, %.lr.ph87
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %.lr.ph87 ], [ 0, %.preheader ]
  tail call void (...) @ClearCache() #7
  %79 = tail call double @get_time()
  %80 = tail call i32 @N_VLinearSumVectorArray(i32 noundef %2, double noundef %67, ptr noundef %19, double noundef %71, ptr noundef %20, ptr noundef %21) #7
  tail call void @sync_device(ptr noundef %0) #7
  %81 = tail call double @get_time()
  %82 = fsub double %81, %79
  %83 = getelementptr inbounds double, ptr %17, i64 %indvars.iv109
  store double %82, ptr %83, align 8, !tbaa !13
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %84 = load i32, ptr @nextra, align 4, !tbaa !5
  %85 = add nsw i32 %84, %3
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next110, %86
  br i1 %87, label %.lr.ph87, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph87, %.preheader
  %.073.lcssa = phi i32 [ undef, %.preheader ], [ %80, %.lr.ph87 ]
  %.lcssa = phi i32 [ %72, %.preheader ], [ %84, %.lr.ph87 ]
  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)
  %88 = load i32, ptr @nextra, align 4, !tbaa !5
  call void @time_stats(ptr noundef %0, ptr noundef %18, i32 noundef %88, i32 noundef %3, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %89 = load i32, ptr @print_time, align 4, !tbaa !5
  %.not = icmp eq i32 %89, 0
  br i1 %.not, label %100, label %90

90:                                               ; preds = %._crit_edge
  %91 = load double, ptr %5, align 8, !tbaa !13
  %92 = load double, ptr %6, align 8, !tbaa !13
  %93 = load double, ptr %7, align 8, !tbaa !13
  %94 = load double, ptr %8, align 8, !tbaa !13
  %95 = load double, ptr %9, align 8, !tbaa !13
  %96 = load double, ptr %10, align 8, !tbaa !13
  %97 = load double, ptr %11, align 8, !tbaa !13
  %98 = load double, ptr %12, align 8, !tbaa !13
  %99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38, ptr noundef nonnull @.str.45, double noundef %91, double noundef %92, double noundef %93, double noundef %94, double noundef %95, double noundef %96, double noundef %97, double noundef %98)
  br label %100

100:                                              ; preds = %90, %._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 @N_VDestroyVectorArray(ptr noundef %20, i32 noundef %2) #7
  call void @N_VDestroyVectorArray(ptr noundef %21, 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 %.073.lcssa
}

declare i32 @N_VLinearSumVectorArray(i32 noundef, double noundef, ptr noundef, double 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 = { 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