; 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.46 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [22 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

; 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 void @N_VScale(double noundef, 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_VScaleVectorArray(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
  %26 = 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
  %27 = load i32, ptr %8, align 4, !tbaa !11
  %28 = load i32, ptr @nextra, align 4, !tbaa !11
  %29 = add nsw i32 %27, %28
  %30 = sext i32 %29 to i64
  %31 = mul i64 %30, 8
  %32 = call noalias ptr @malloc(i64 noundef %31) #6
  store ptr %32, ptr %19, align 8, !tbaa !5
  %33 = load i32, ptr %8, align 4, !tbaa !11
  %34 = load i32, ptr @nextra, align 4, !tbaa !11
  %35 = add nsw i32 %33, %34
  %36 = sext i32 %35 to i64
  %37 = mul i64 %36, 8
  %38 = call noalias ptr @malloc(i64 noundef %37) #6
  store ptr %38, ptr %20, align 8, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = mul i64 %40, 8
  %42 = call noalias ptr @malloc(i64 noundef %41) #6
  store ptr %42, ptr %24, align 8, !tbaa !5
  %43 = load i32, ptr %7, align 4, !tbaa !11
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call ptr @N_VCloneVectorArray(i32 noundef %43, ptr noundef %44)
  store ptr %45, ptr %25, align 8, !tbaa !5
  %46 = load i32, ptr %7, align 4, !tbaa !11
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call ptr @N_VCloneVectorArray(i32 noundef %46, ptr noundef %47)
  store ptr %48, ptr %26, align 8, !tbaa !5
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %49

49:                                               ; preds = %68, %4
  %50 = load i32, ptr %22, align 4, !tbaa !11
  %51 = load i32, ptr %7, align 4, !tbaa !11
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %53, label %71

53:                                               ; preds = %49
  %54 = call i32 @rand() #5
  %55 = sitofp i32 %54 to double
  %56 = fdiv double %55, 0x41DFFFFFFFC00000
  %57 = fadd double %56, 1.000000e+00
  %58 = load ptr, ptr %24, align 8, !tbaa !5
  %59 = load i32, ptr %22, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %58, i64 %60
  store double %57, ptr %61, align 8, !tbaa !13
  %62 = load ptr, ptr %25, align 8, !tbaa !5
  %63 = load i32, ptr %22, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %62, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %66, i64 noundef %67, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %68

68:                                               ; preds = %53
  %69 = load i32, ptr %22, align 4, !tbaa !11
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %22, align 4, !tbaa !11
  br label %49, !llvm.loop !15

71:                                               ; preds = %49
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %72

72:                                               ; preds = %113, %71
  %73 = load i32, ptr %21, align 4, !tbaa !11
  %74 = load i32, ptr %8, align 4, !tbaa !11
  %75 = load i32, ptr @nextra, align 4, !tbaa !11
  %76 = add nsw i32 %74, %75
  %77 = icmp slt i32 %73, %76
  br i1 %77, label %78, label %116

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

80:                                               ; preds = %100, %78
  %81 = load i32, ptr %22, align 4, !tbaa !11
  %82 = load i32, ptr %7, align 4, !tbaa !11
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %84, label %103

84:                                               ; preds = %80
  %85 = load ptr, ptr %24, align 8, !tbaa !5
  %86 = load i32, ptr %22, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %85, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !13
  %90 = load ptr, ptr %25, align 8, !tbaa !5
  %91 = load i32, ptr %22, align 4, !tbaa !11
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %90, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = load ptr, ptr %25, align 8, !tbaa !5
  %96 = load i32, ptr %22, align 4, !tbaa !11
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %95, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  call void @N_VScale(double noundef %89, ptr noundef %94, ptr noundef %99)
  br label %100

100:                                              ; preds = %84
  %101 = load i32, ptr %22, align 4, !tbaa !11
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %22, align 4, !tbaa !11
  br label %80, !llvm.loop !17

103:                                              ; preds = %80
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %104)
  %105 = call double @get_time()
  store double %105, ptr %10, align 8, !tbaa !13
  %106 = load double, ptr %10, align 8, !tbaa !13
  %107 = load double, ptr %9, align 8, !tbaa !13
  %108 = fsub double %106, %107
  %109 = load ptr, ptr %20, align 8, !tbaa !5
  %110 = load i32, ptr %21, align 4, !tbaa !11
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds double, ptr %109, i64 %111
  store double %108, ptr %112, align 8, !tbaa !13
  br label %113

113:                                              ; preds = %103
  %114 = load i32, ptr %21, align 4, !tbaa !11
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %21, align 4, !tbaa !11
  br label %72, !llvm.loop !18

116:                                              ; preds = %72
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %117

117:                                              ; preds = %136, %116
  %118 = load i32, ptr %22, align 4, !tbaa !11
  %119 = load i32, ptr %7, align 4, !tbaa !11
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %121, label %139

121:                                              ; preds = %117
  %122 = call i32 @rand() #5
  %123 = sitofp i32 %122 to double
  %124 = fdiv double %123, 0x41DFFFFFFFC00000
  %125 = fadd double %124, 1.000000e+00
  %126 = load ptr, ptr %24, align 8, !tbaa !5
  %127 = load i32, ptr %22, align 4, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %126, i64 %128
  store double %125, ptr %129, align 8, !tbaa !13
  %130 = load ptr, ptr %25, align 8, !tbaa !5
  %131 = load i32, ptr %22, align 4, !tbaa !11
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds ptr, ptr %130, i64 %132
  %134 = load ptr, ptr %133, align 8, !tbaa !5
  %135 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %134, i64 noundef %135, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %136

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

139:                                              ; preds = %117
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %140

140:                                              ; preds = %162, %139
  %141 = load i32, ptr %21, align 4, !tbaa !11
  %142 = load i32, ptr %8, align 4, !tbaa !11
  %143 = load i32, ptr @nextra, align 4, !tbaa !11
  %144 = add nsw i32 %142, %143
  %145 = icmp slt i32 %141, %144
  br i1 %145, label %146, label %165

146:                                              ; preds = %140
  call void (...) @ClearCache()
  %147 = call double @get_time()
  store double %147, ptr %9, align 8, !tbaa !13
  %148 = load i32, ptr %7, align 4, !tbaa !11
  %149 = load ptr, ptr %24, align 8, !tbaa !5
  %150 = load ptr, ptr %25, align 8, !tbaa !5
  %151 = load ptr, ptr %25, align 8, !tbaa !5
  %152 = call i32 @N_VScaleVectorArray(i32 noundef %148, ptr noundef %149, ptr noundef %150, ptr noundef %151)
  store i32 %152, ptr %23, align 4, !tbaa !11
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %153)
  %154 = call double @get_time()
  store double %154, ptr %10, align 8, !tbaa !13
  %155 = load double, ptr %10, align 8, !tbaa !13
  %156 = load double, ptr %9, align 8, !tbaa !13
  %157 = fsub double %155, %156
  %158 = load ptr, ptr %19, align 8, !tbaa !5
  %159 = load i32, ptr %21, align 4, !tbaa !11
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds double, ptr %158, i64 %160
  store double %157, ptr %161, align 8, !tbaa !13
  br label %162

162:                                              ; preds = %146
  %163 = load i32, ptr %21, align 4, !tbaa !11
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %21, align 4, !tbaa !11
  br label %140, !llvm.loop !20

165:                                              ; preds = %140
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load ptr, ptr %19, align 8, !tbaa !5
  %168 = load i32, ptr @nextra, align 4, !tbaa !11
  %169 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %166, ptr noundef %167, i32 noundef %168, i32 noundef %169, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = load ptr, ptr %20, align 8, !tbaa !5
  %172 = load i32, ptr @nextra, align 4, !tbaa !11
  %173 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %170, ptr noundef %171, i32 noundef %172, i32 noundef %173, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18)
  %174 = load i32, ptr @print_time, align 4, !tbaa !11
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %186

176:                                              ; preds = %165
  %177 = load double, ptr %11, align 8, !tbaa !13
  %178 = load double, ptr %12, align 8, !tbaa !13
  %179 = load double, ptr %13, align 8, !tbaa !13
  %180 = load double, ptr %14, align 8, !tbaa !13
  %181 = load double, ptr %15, align 8, !tbaa !13
  %182 = load double, ptr %16, align 8, !tbaa !13
  %183 = load double, ptr %17, align 8, !tbaa !13
  %184 = load double, ptr %18, align 8, !tbaa !13
  %185 = call i32 (ptr, ...) @printf(ptr noundef @.str.38, ptr noundef @.str.46, double noundef %177, double noundef %178, double noundef %179, double noundef %180, double noundef %181, double noundef %182, double noundef %183, double noundef %184)
  br label %186

186:                                              ; preds = %176, %165
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %187

187:                                              ; preds = %206, %186
  %188 = load i32, ptr %22, align 4, !tbaa !11
  %189 = load i32, ptr %7, align 4, !tbaa !11
  %190 = icmp slt i32 %188, %189
  br i1 %190, label %191, label %209

191:                                              ; preds = %187
  %192 = call i32 @rand() #5
  %193 = sitofp i32 %192 to double
  %194 = fdiv double %193, 0x41DFFFFFFFC00000
  %195 = fadd double %194, 1.000000e+00
  %196 = load ptr, ptr %24, align 8, !tbaa !5
  %197 = load i32, ptr %22, align 4, !tbaa !11
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds double, ptr %196, i64 %198
  store double %195, ptr %199, align 8, !tbaa !13
  %200 = load ptr, ptr %25, align 8, !tbaa !5
  %201 = load i32, ptr %22, align 4, !tbaa !11
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds ptr, ptr %200, i64 %202
  %204 = load ptr, ptr %203, align 8, !tbaa !5
  %205 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %204, i64 noundef %205, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %206

206:                                              ; preds = %191
  %207 = load i32, ptr %22, align 4, !tbaa !11
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %22, align 4, !tbaa !11
  br label %187, !llvm.loop !21

209:                                              ; preds = %187
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %210

210:                                              ; preds = %251, %209
  %211 = load i32, ptr %21, align 4, !tbaa !11
  %212 = load i32, ptr %8, align 4, !tbaa !11
  %213 = load i32, ptr @nextra, align 4, !tbaa !11
  %214 = add nsw i32 %212, %213
  %215 = icmp slt i32 %211, %214
  br i1 %215, label %216, label %254

216:                                              ; preds = %210
  call void (...) @ClearCache()
  %217 = call double @get_time()
  store double %217, ptr %9, align 8, !tbaa !13
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %218

218:                                              ; preds = %238, %216
  %219 = load i32, ptr %22, align 4, !tbaa !11
  %220 = load i32, ptr %7, align 4, !tbaa !11
  %221 = icmp slt i32 %219, %220
  br i1 %221, label %222, label %241

222:                                              ; preds = %218
  %223 = load ptr, ptr %24, align 8, !tbaa !5
  %224 = load i32, ptr %22, align 4, !tbaa !11
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds double, ptr %223, i64 %225
  %227 = load double, ptr %226, align 8, !tbaa !13
  %228 = load ptr, ptr %25, align 8, !tbaa !5
  %229 = load i32, ptr %22, align 4, !tbaa !11
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds ptr, ptr %228, i64 %230
  %232 = load ptr, ptr %231, align 8, !tbaa !5
  %233 = load ptr, ptr %26, align 8, !tbaa !5
  %234 = load i32, ptr %22, align 4, !tbaa !11
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds ptr, ptr %233, i64 %235
  %237 = load ptr, ptr %236, align 8, !tbaa !5
  call void @N_VScale(double noundef %227, ptr noundef %232, ptr noundef %237)
  br label %238

238:                                              ; preds = %222
  %239 = load i32, ptr %22, align 4, !tbaa !11
  %240 = add nsw i32 %239, 1
  store i32 %240, ptr %22, align 4, !tbaa !11
  br label %218, !llvm.loop !22

241:                                              ; preds = %218
  %242 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %242)
  %243 = call double @get_time()
  store double %243, ptr %10, align 8, !tbaa !13
  %244 = load double, ptr %10, align 8, !tbaa !13
  %245 = load double, ptr %9, align 8, !tbaa !13
  %246 = fsub double %244, %245
  %247 = load ptr, ptr %20, align 8, !tbaa !5
  %248 = load i32, ptr %21, align 4, !tbaa !11
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds double, ptr %247, i64 %249
  store double %246, ptr %250, align 8, !tbaa !13
  br label %251

251:                                              ; preds = %241
  %252 = load i32, ptr %21, align 4, !tbaa !11
  %253 = add nsw i32 %252, 1
  store i32 %253, ptr %21, align 4, !tbaa !11
  br label %210, !llvm.loop !23

254:                                              ; preds = %210
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %255

255:                                              ; preds = %274, %254
  %256 = load i32, ptr %22, align 4, !tbaa !11
  %257 = load i32, ptr %7, align 4, !tbaa !11
  %258 = icmp slt i32 %256, %257
  br i1 %258, label %259, label %277

259:                                              ; preds = %255
  %260 = call i32 @rand() #5
  %261 = sitofp i32 %260 to double
  %262 = fdiv double %261, 0x41DFFFFFFFC00000
  %263 = fadd double %262, 1.000000e+00
  %264 = load ptr, ptr %24, align 8, !tbaa !5
  %265 = load i32, ptr %22, align 4, !tbaa !11
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds double, ptr %264, i64 %266
  store double %263, ptr %267, align 8, !tbaa !13
  %268 = load ptr, ptr %25, align 8, !tbaa !5
  %269 = load i32, ptr %22, align 4, !tbaa !11
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds ptr, ptr %268, i64 %270
  %272 = load ptr, ptr %271, align 8, !tbaa !5
  %273 = load i64, ptr %6, align 8, !tbaa !9
  call void @N_VRand(ptr noundef %272, i64 noundef %273, double noundef -1.000000e+00, double noundef 1.000000e+00)
  br label %274

274:                                              ; preds = %259
  %275 = load i32, ptr %22, align 4, !tbaa !11
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %22, align 4, !tbaa !11
  br label %255, !llvm.loop !24

277:                                              ; preds = %255
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %278

278:                                              ; preds = %300, %277
  %279 = load i32, ptr %21, align 4, !tbaa !11
  %280 = load i32, ptr %8, align 4, !tbaa !11
  %281 = load i32, ptr @nextra, align 4, !tbaa !11
  %282 = add nsw i32 %280, %281
  %283 = icmp slt i32 %279, %282
  br i1 %283, label %284, label %303

284:                                              ; preds = %278
  call void (...) @ClearCache()
  %285 = call double @get_time()
  store double %285, ptr %9, align 8, !tbaa !13
  %286 = load i32, ptr %7, align 4, !tbaa !11
  %287 = load ptr, ptr %24, align 8, !tbaa !5
  %288 = load ptr, ptr %25, align 8, !tbaa !5
  %289 = load ptr, ptr %26, align 8, !tbaa !5
  %290 = call i32 @N_VScaleVectorArray(i32 noundef %286, ptr noundef %287, ptr noundef %288, ptr noundef %289)
  store i32 %290, ptr %23, align 4, !tbaa !11
  %291 = load ptr, ptr %5, align 8, !tbaa !5
  call void @sync_device(ptr noundef %291)
  %292 = call double @get_time()
  store double %292, ptr %10, align 8, !tbaa !13
  %293 = load double, ptr %10, align 8, !tbaa !13
  %294 = load double, ptr %9, align 8, !tbaa !13
  %295 = fsub double %293, %294
  %296 = load ptr, ptr %19, align 8, !tbaa !5
  %297 = load i32, ptr %21, align 4, !tbaa !11
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds double, ptr %296, i64 %298
  store double %295, ptr %299, align 8, !tbaa !13
  br label %300

300:                                              ; preds = %284
  %301 = load i32, ptr %21, align 4, !tbaa !11
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %21, align 4, !tbaa !11
  br label %278, !llvm.loop !25

303:                                              ; preds = %278
  %304 = load ptr, ptr %5, align 8, !tbaa !5
  %305 = load ptr, ptr %19, align 8, !tbaa !5
  %306 = load i32, ptr @nextra, align 4, !tbaa !11
  %307 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %304, ptr noundef %305, i32 noundef %306, i32 noundef %307, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  %308 = load ptr, ptr %5, align 8, !tbaa !5
  %309 = load ptr, ptr %20, align 8, !tbaa !5
  %310 = load i32, ptr @nextra, align 4, !tbaa !11
  %311 = load i32, ptr %8, align 4, !tbaa !11
  call void @time_stats(ptr noundef %308, ptr noundef %309, i32 noundef %310, i32 noundef %311, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18)
  %312 = load i32, ptr @print_time, align 4, !tbaa !11
  %313 = icmp ne i32 %312, 0
  br i1 %313, label %314, label %324

314:                                              ; preds = %303
  %315 = load double, ptr %11, align 8, !tbaa !13
  %316 = load double, ptr %12, align 8, !tbaa !13
  %317 = load double, ptr %13, align 8, !tbaa !13
  %318 = load double, ptr %14, align 8, !tbaa !13
  %319 = load double, ptr %15, align 8, !tbaa !13
  %320 = load double, ptr %16, align 8, !tbaa !13
  %321 = load double, ptr %17, align 8, !tbaa !13
  %322 = load double, ptr %18, align 8, !tbaa !13
  %323 = call i32 (ptr, ...) @printf(ptr noundef @.str.38, ptr noundef @.str.47, double noundef %315, double noundef %316, double noundef %317, double noundef %318, double noundef %319, double noundef %320, double noundef %321, double noundef %322)
  br label %324

324:                                              ; preds = %314, %303
  %325 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %325) #5
  %326 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %326) #5
  %327 = load ptr, ptr %24, align 8, !tbaa !5
  call void @free(ptr noundef %327) #5
  %328 = load ptr, ptr %25, align 8, !tbaa !5
  %329 = load i32, ptr %7, align 4, !tbaa !11
  call void @N_VDestroyVectorArray(ptr noundef %328, i32 noundef %329)
  %330 = load ptr, ptr %26, align 8, !tbaa !5
  %331 = load i32, ptr %7, align 4, !tbaa !11
  call void @N_VDestroyVectorArray(ptr noundef %330, i32 noundef %331)
  %332 = load i32, ptr %23, align 4, !tbaa !11
  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 %332
}

declare i32 @N_VScaleVectorArray(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 = !{!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}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !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.46 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [22 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

; 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 void @N_VScale(double noundef, 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_VScaleVectorArray(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 = sext i32 %2 to i64
  %20 = shl nsw i64 %19, 3
  %21 = tail call noalias ptr @malloc(i64 noundef %20) #8
  %22 = tail call ptr @N_VCloneVectorArray(i32 noundef %2, ptr noundef %0) #7
  %23 = tail call ptr @N_VCloneVectorArray(i32 noundef %2, ptr noundef %0) #7
  %24 = icmp sgt i32 %2, 0
  br i1 %24, label %.lr.ph.preheader, label %.preheader128

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

.preheader128:                                    ; preds = %.lr.ph, %4
  %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.ph134, label %.preheader127

.lr.ph134:                                        ; preds = %.preheader128
  %wide.trip.count165 = zext nneg i32 %2 to i64
  br label %36

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %28 = tail call i32 @rand() #7
  %29 = sitofp i32 %28 to double
  %30 = fdiv double %29, 0x41DFFFFFFFC00000
  %31 = fadd double %30, 1.000000e+00
  %32 = getelementptr inbounds double, ptr %21, i64 %indvars.iv
  store double %31, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  tail call void @N_VRand(ptr noundef %34, 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 %.preheader128, label %.lr.ph, !llvm.loop !13

.preheader127:                                    ; preds = %._crit_edge, %.preheader128
  %35 = phi i32 [ %25, %.preheader128 ], [ %45, %._crit_edge ]
  br i1 %24, label %.lr.ph136.preheader, label %.preheader126

.lr.ph136.preheader:                              ; preds = %.preheader127
  %wide.trip.count173 = zext nneg i32 %2 to i64
  br label %.lr.ph136

36:                                               ; preds = %.lr.ph134, %._crit_edge
  %indvars.iv167 = phi i64 [ 0, %.lr.ph134 ], [ %indvars.iv.next168, %._crit_edge ]
  tail call void (...) @ClearCache() #7
  %37 = tail call double @get_time()
  br i1 %24, label %.lr.ph132, label %._crit_edge

.lr.ph132:                                        ; preds = %36, %.lr.ph132
  %indvars.iv162 = phi i64 [ %indvars.iv.next163, %.lr.ph132 ], [ 0, %36 ]
  %38 = getelementptr inbounds double, ptr %21, i64 %indvars.iv162
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv162
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  tail call void @N_VScale(double noundef %39, ptr noundef %41, ptr noundef %41) #7
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %exitcond166.not = icmp eq i64 %indvars.iv.next163, %wide.trip.count165
  br i1 %exitcond166.not, label %._crit_edge, label %.lr.ph132, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph132, %36
  tail call void @sync_device(ptr noundef %0) #7
  %42 = tail call double @get_time()
  %43 = fsub double %42, %37
  %44 = getelementptr inbounds double, ptr %18, i64 %indvars.iv167
  store double %43, ptr %44, align 8, !tbaa !9
  %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
  %45 = load i32, ptr @nextra, align 4, !tbaa !5
  %46 = add nsw i32 %45, %3
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next168, %47
  br i1 %48, label %36, label %.preheader127, !llvm.loop !16

.preheader126.loopexit:                           ; preds = %.lr.ph136
  %.pre = load i32, ptr @nextra, align 4, !tbaa !5
  br label %.preheader126

.preheader126:                                    ; preds = %.preheader126.loopexit, %.preheader127
  %49 = phi i32 [ %.pre, %.preheader126.loopexit ], [ %35, %.preheader127 ]
  %50 = add nsw i32 %49, %3
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph138, label %._crit_edge139

.lr.ph136:                                        ; preds = %.lr.ph136.preheader, %.lr.ph136
  %indvars.iv170 = phi i64 [ 0, %.lr.ph136.preheader ], [ %indvars.iv.next171, %.lr.ph136 ]
  %52 = tail call i32 @rand() #7
  %53 = sitofp i32 %52 to double
  %54 = fdiv double %53, 0x41DFFFFFFFC00000
  %55 = fadd double %54, 1.000000e+00
  %56 = getelementptr inbounds double, ptr %21, i64 %indvars.iv170
  store double %55, ptr %56, align 8, !tbaa !9
  %57 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv170
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  tail call void @N_VRand(ptr noundef %58, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #7
  %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
  %exitcond174.not = icmp eq i64 %indvars.iv.next171, %wide.trip.count173
  br i1 %exitcond174.not, label %.preheader126.loopexit, label %.lr.ph136, !llvm.loop !17

.lr.ph138:                                        ; preds = %.preheader126, %.lr.ph138
  %indvars.iv175 = phi i64 [ %indvars.iv.next176, %.lr.ph138 ], [ 0, %.preheader126 ]
  tail call void (...) @ClearCache() #7
  %59 = tail call double @get_time()
  %60 = tail call i32 @N_VScaleVectorArray(i32 noundef %2, ptr noundef %21, ptr noundef %22, ptr noundef %22) #7
  tail call void @sync_device(ptr noundef %0) #7
  %61 = tail call double @get_time()
  %62 = fsub double %61, %59
  %63 = getelementptr inbounds double, ptr %17, i64 %indvars.iv175
  store double %62, ptr %63, align 8, !tbaa !9
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %64 = load i32, ptr @nextra, align 4, !tbaa !5
  %65 = add nsw i32 %64, %3
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next176, %66
  br i1 %67, label %.lr.ph138, label %._crit_edge139, !llvm.loop !18

._crit_edge139:                                   ; preds = %.lr.ph138, %.preheader126
  %.0116.lcssa = phi i32 [ undef, %.preheader126 ], [ %60, %.lr.ph138 ]
  %.lcssa129 = phi i32 [ %49, %.preheader126 ], [ %64, %.lr.ph138 ]
  call void @time_stats(ptr noundef %0, ptr noundef %17, i32 noundef %.lcssa129, i32 noundef %3, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %68 = load i32, ptr @nextra, align 4, !tbaa !5
  call void @time_stats(ptr noundef %0, ptr noundef %18, i32 noundef %68, i32 noundef %3, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %69 = load i32, ptr @print_time, align 4, !tbaa !5
  %.not = icmp eq i32 %69, 0
  br i1 %.not, label %80, label %70

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

80:                                               ; preds = %70, %._crit_edge139
  br i1 %24, label %.lr.ph143.preheader, label %.preheader125

.lr.ph143.preheader:                              ; preds = %80
  %wide.trip.count181 = zext nneg i32 %2 to i64
  br label %.lr.ph143

.preheader125:                                    ; preds = %.lr.ph143, %80
  %81 = load i32, ptr @nextra, align 4, !tbaa !5
  %82 = add nsw i32 %81, %3
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph149, label %.preheader124

.lr.ph149:                                        ; preds = %.preheader125
  %wide.trip.count186 = zext nneg i32 %2 to i64
  br label %92

.lr.ph143:                                        ; preds = %.lr.ph143.preheader, %.lr.ph143
  %indvars.iv178 = phi i64 [ 0, %.lr.ph143.preheader ], [ %indvars.iv.next179, %.lr.ph143 ]
  %84 = call i32 @rand() #7
  %85 = sitofp i32 %84 to double
  %86 = fdiv double %85, 0x41DFFFFFFFC00000
  %87 = fadd double %86, 1.000000e+00
  %88 = getelementptr inbounds double, ptr %21, i64 %indvars.iv178
  store double %87, ptr %88, align 8, !tbaa !9
  %89 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv178
  %90 = load ptr, ptr %89, align 8, !tbaa !11
  call void @N_VRand(ptr noundef %90, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #7
  %indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
  %exitcond182.not = icmp eq i64 %indvars.iv.next179, %wide.trip.count181
  br i1 %exitcond182.not, label %.preheader125, label %.lr.ph143, !llvm.loop !19

.preheader124:                                    ; preds = %._crit_edge147, %.preheader125
  %91 = phi i32 [ %81, %.preheader125 ], [ %103, %._crit_edge147 ]
  br i1 %24, label %.lr.ph151.preheader, label %.preheader

.lr.ph151.preheader:                              ; preds = %.preheader124
  %wide.trip.count194 = zext nneg i32 %2 to i64
  br label %.lr.ph151

92:                                               ; preds = %.lr.ph149, %._crit_edge147
  %indvars.iv188 = phi i64 [ 0, %.lr.ph149 ], [ %indvars.iv.next189, %._crit_edge147 ]
  call void (...) @ClearCache() #7
  %93 = call double @get_time()
  br i1 %24, label %.lr.ph146, label %._crit_edge147

.lr.ph146:                                        ; preds = %92, %.lr.ph146
  %indvars.iv183 = phi i64 [ %indvars.iv.next184, %.lr.ph146 ], [ 0, %92 ]
  %94 = getelementptr inbounds double, ptr %21, i64 %indvars.iv183
  %95 = load double, ptr %94, align 8, !tbaa !9
  %96 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv183
  %97 = load ptr, ptr %96, align 8, !tbaa !11
  %98 = getelementptr inbounds ptr, ptr %23, i64 %indvars.iv183
  %99 = load ptr, ptr %98, align 8, !tbaa !11
  call void @N_VScale(double noundef %95, ptr noundef %97, ptr noundef %99) #7
  %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
  %exitcond187.not = icmp eq i64 %indvars.iv.next184, %wide.trip.count186
  br i1 %exitcond187.not, label %._crit_edge147, label %.lr.ph146, !llvm.loop !20

._crit_edge147:                                   ; preds = %.lr.ph146, %92
  call void @sync_device(ptr noundef %0) #7
  %100 = call double @get_time()
  %101 = fsub double %100, %93
  %102 = getelementptr inbounds double, ptr %18, i64 %indvars.iv188
  store double %101, ptr %102, align 8, !tbaa !9
  %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
  %103 = load i32, ptr @nextra, align 4, !tbaa !5
  %104 = add nsw i32 %103, %3
  %105 = sext i32 %104 to i64
  %106 = icmp slt i64 %indvars.iv.next189, %105
  br i1 %106, label %92, label %.preheader124, !llvm.loop !21

.preheader.loopexit:                              ; preds = %.lr.ph151
  %.pre199 = load i32, ptr @nextra, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader124
  %107 = phi i32 [ %.pre199, %.preheader.loopexit ], [ %91, %.preheader124 ]
  %108 = add nsw i32 %107, %3
  %109 = icmp sgt i32 %108, 0
  br i1 %109, label %.lr.ph153, label %._crit_edge154

.lr.ph151:                                        ; preds = %.lr.ph151.preheader, %.lr.ph151
  %indvars.iv191 = phi i64 [ 0, %.lr.ph151.preheader ], [ %indvars.iv.next192, %.lr.ph151 ]
  %110 = call i32 @rand() #7
  %111 = sitofp i32 %110 to double
  %112 = fdiv double %111, 0x41DFFFFFFFC00000
  %113 = fadd double %112, 1.000000e+00
  %114 = getelementptr inbounds double, ptr %21, i64 %indvars.iv191
  store double %113, ptr %114, align 8, !tbaa !9
  %115 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv191
  %116 = load ptr, ptr %115, align 8, !tbaa !11
  call void @N_VRand(ptr noundef %116, i64 noundef %1, double noundef -1.000000e+00, double noundef 1.000000e+00) #7
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %exitcond195.not = icmp eq i64 %indvars.iv.next192, %wide.trip.count194
  br i1 %exitcond195.not, label %.preheader.loopexit, label %.lr.ph151, !llvm.loop !22

.lr.ph153:                                        ; preds = %.preheader, %.lr.ph153
  %indvars.iv196 = phi i64 [ %indvars.iv.next197, %.lr.ph153 ], [ 0, %.preheader ]
  call void (...) @ClearCache() #7
  %117 = call double @get_time()
  %118 = call i32 @N_VScaleVectorArray(i32 noundef %2, ptr noundef %21, ptr noundef %22, ptr noundef %23) #7
  call void @sync_device(ptr noundef %0) #7
  %119 = call double @get_time()
  %120 = fsub double %119, %117
  %121 = getelementptr inbounds double, ptr %17, i64 %indvars.iv196
  store double %120, ptr %121, align 8, !tbaa !9
  %indvars.iv.next197 = add nuw nsw i64 %indvars.iv196, 1
  %122 = load i32, ptr @nextra, align 4, !tbaa !5
  %123 = add nsw i32 %122, %3
  %124 = sext i32 %123 to i64
  %125 = icmp slt i64 %indvars.iv.next197, %124
  br i1 %125, label %.lr.ph153, label %._crit_edge154, !llvm.loop !23

._crit_edge154:                                   ; preds = %.lr.ph153, %.preheader
  %.1117.lcssa = phi i32 [ %.0116.lcssa, %.preheader ], [ %118, %.lr.ph153 ]
  %.lcssa = phi i32 [ %107, %.preheader ], [ %122, %.lr.ph153 ]
  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)
  %126 = load i32, ptr @nextra, align 4, !tbaa !5
  call void @time_stats(ptr noundef %0, ptr noundef %18, i32 noundef %126, i32 noundef %3, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %127 = load i32, ptr @print_time, align 4, !tbaa !5
  %.not123 = icmp eq i32 %127, 0
  br i1 %.not123, label %138, label %128

128:                                              ; preds = %._crit_edge154
  %129 = load double, ptr %5, align 8, !tbaa !9
  %130 = load double, ptr %6, align 8, !tbaa !9
  %131 = load double, ptr %7, align 8, !tbaa !9
  %132 = load double, ptr %8, align 8, !tbaa !9
  %133 = load double, ptr %9, align 8, !tbaa !9
  %134 = load double, ptr %10, align 8, !tbaa !9
  %135 = load double, ptr %11, align 8, !tbaa !9
  %136 = load double, ptr %12, align 8, !tbaa !9
  %137 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38, ptr noundef nonnull @.str.47, double noundef %129, double noundef %130, double noundef %131, double noundef %132, double noundef %133, double noundef %134, double noundef %135, double noundef %136)
  br label %138

138:                                              ; preds = %128, %._crit_edge154
  call void @free(ptr noundef %17) #7
  call void @free(ptr noundef %18) #7
  call void @free(ptr noundef %21) #7
  call void @N_VDestroyVectorArray(ptr noundef %22, i32 noundef %2) #7
  call void @N_VDestroyVectorArray(ptr noundef %23, 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 %.1117.lcssa
}

declare i32 @N_VScaleVectorArray(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 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !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}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}


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