; LLVM IR from ytopt-team/ytopt :: ytopt-libe/xsbench/ytopt/xsbench (Main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Inputs = type { i32, i64, i64, i32, ptr, i32, i32, i32, i32, i32, i32 }
%struct.SimulationData = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32 }

@.str.86 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [31 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare double @get_time() #1

; Function Attrs: nounwind uwtable
define dso_local i64 @run_event_based_simulation_optimization_1(ptr noundef byval(%struct.Inputs) align 8 %0, ptr noundef byval(%struct.SimulationData) align 8 %1, i32 noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca [12 x i32], align 16
  %15 = alloca i32, align 4
  %16 = alloca [12 x i32], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  %25 = alloca i32, align 4
  %26 = alloca [5 x double], align 16
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  store i32 %2, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store ptr @.str.86, ptr %5, align 8, !tbaa !9
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %35

32:                                               ; preds = %3
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.87, ptr noundef %33)
  br label %35

35:                                               ; preds = %32, %3
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %35
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.88)
  br label %40

40:                                               ; preds = %38, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %41 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %42 = load i32, ptr %41, align 8, !tbaa !13
  %43 = sext i32 %42 to i64
  %44 = mul i64 %43, 8
  store i64 %44, ptr %6, align 8, !tbaa !11
  %45 = load i64, ptr %6, align 8, !tbaa !11
  %46 = call noalias ptr @malloc(i64 noundef %45) #6
  %47 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 13
  store ptr %46, ptr %47, align 8, !tbaa !15
  %48 = load i64, ptr %6, align 8, !tbaa !11
  %49 = load i64, ptr %7, align 8, !tbaa !11
  %50 = add i64 %49, %48
  store i64 %50, ptr %7, align 8, !tbaa !11
  %51 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %52 = load i32, ptr %51, align 8, !tbaa !13
  %53 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 14
  store i32 %52, ptr %53, align 8, !tbaa !17
  %54 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %55 = load i32, ptr %54, align 8, !tbaa !13
  %56 = sext i32 %55 to i64
  %57 = mul i64 %56, 4
  store i64 %57, ptr %6, align 8, !tbaa !11
  %58 = load i64, ptr %6, align 8, !tbaa !11
  %59 = call noalias ptr @malloc(i64 noundef %58) #6
  %60 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 15
  store ptr %59, ptr %60, align 8, !tbaa !18
  %61 = load i64, ptr %6, align 8, !tbaa !11
  %62 = load i64, ptr %7, align 8, !tbaa !11
  %63 = add i64 %62, %61
  store i64 %63, ptr %7, align 8, !tbaa !11
  %64 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %65 = load i32, ptr %64, align 8, !tbaa !13
  %66 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 16
  store i32 %65, ptr %66, align 8, !tbaa !19
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %75

69:                                               ; preds = %40
  %70 = load i64, ptr %7, align 8, !tbaa !11
  %71 = uitofp i64 %70 to double
  %72 = fdiv double %71, 1.024000e+03
  %73 = fdiv double %72, 1.024000e+03
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.89, double noundef %73)
  br label %75

75:                                               ; preds = %69, %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %102, %75
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %79 = load i32, ptr %78, align 8, !tbaa !13
  %80 = icmp slt i32 %77, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %105

82:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 1070, ptr %11, align 8, !tbaa !11
  %83 = load i64, ptr %11, align 8, !tbaa !11
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = mul nsw i32 2, %84
  %86 = sext i32 %85 to i64
  %87 = call i64 @fast_forward_LCG(i64 noundef %83, i64 noundef %86)
  store i64 %87, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %88 = call double @LCG_random_double(ptr noundef %11)
  store double %88, ptr %12, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %89 = call i32 @pick_mat(ptr noundef %11)
  store i32 %89, ptr %13, align 4, !tbaa !5
  %90 = load double, ptr %12, align 8, !tbaa !20
  %91 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 13
  %92 = load ptr, ptr %91, align 8, !tbaa !15
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  store double %90, ptr %95, align 8, !tbaa !20
  %96 = load i32, ptr %13, align 4, !tbaa !5
  %97 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 15
  %98 = load ptr, ptr %97, align 8, !tbaa !18
  %99 = load i32, ptr %10, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %98, i64 %100
  store i32 %96, ptr %101, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %102

102:                                              ; preds = %82
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %10, align 4, !tbaa !5
  br label %76, !llvm.loop !22

105:                                              ; preds = %81
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %105
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.90)
  br label %110

110:                                              ; preds = %108, %105
  %111 = call double @get_time()
  store double %111, ptr %8, align 8, !tbaa !20
  %112 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 15
  %113 = load ptr, ptr %112, align 8, !tbaa !18
  %114 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 13
  %115 = load ptr, ptr %114, align 8, !tbaa !15
  %116 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %117 = load i32, ptr %116, align 8, !tbaa !13
  %118 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !24
  call void @quickSort_parallel_i_d(ptr noundef %113, ptr noundef %115, i32 noundef %117, i32 noundef %119)
  %120 = call double @get_time()
  store double %120, ptr %9, align 8, !tbaa !20
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %128

123:                                              ; preds = %110
  %124 = load double, ptr %9, align 8, !tbaa !20
  %125 = load double, ptr %8, align 8, !tbaa !20
  %126 = fsub double %124, %125
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.91, double noundef %126)
  br label %128

128:                                              ; preds = %123, %110
  %129 = call double @get_time()
  store double %129, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 48, ptr %14) #5
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %147, %128
  %131 = load i32, ptr %15, align 4, !tbaa !5
  %132 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %133 = load i32, ptr %132, align 8, !tbaa !13
  %134 = icmp slt i32 %131, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %150

136:                                              ; preds = %130
  %137 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 15
  %138 = load ptr, ptr %137, align 8, !tbaa !18
  %139 = load i32, ptr %15, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds i32, ptr %138, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [12 x i32], ptr %14, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %144, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %136
  %148 = load i32, ptr %15, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %15, align 4, !tbaa !5
  br label %130, !llvm.loop !25

150:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 48, ptr %16) #5
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %170, %150
  %152 = load i32, ptr %17, align 4, !tbaa !5
  %153 = icmp slt i32 %152, 12
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %173

155:                                              ; preds = %151
  %156 = load i32, ptr %17, align 4, !tbaa !5
  %157 = sub nsw i32 %156, 1
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [12 x i32], ptr %16, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr %17, align 4, !tbaa !5
  %162 = sub nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [12 x i32], ptr %14, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = add nsw i32 %160, %165
  %167 = load i32, ptr %17, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [12 x i32], ptr %16, i64 0, i64 %168
  store i32 %166, ptr %169, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %155
  %171 = load i32, ptr %17, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %17, align 4, !tbaa !5
  br label %151, !llvm.loop !26

173:                                              ; preds = %154
  %174 = call double @get_time()
  store double %174, ptr %9, align 8, !tbaa !20
  %175 = load i32, ptr %4, align 4, !tbaa !5
  %176 = icmp eq i32 %175, 0
  br i1 %176, label %177, label %182

177:                                              ; preds = %173
  %178 = load double, ptr %9, align 8, !tbaa !20
  %179 = load double, ptr %8, align 8, !tbaa !20
  %180 = fsub double %178, %179
  %181 = call i32 (ptr, ...) @printf(ptr noundef @.str.92, double noundef %180)
  br label %182

182:                                              ; preds = %177, %173
  %183 = load double, ptr %9, align 8, !tbaa !20
  store double %183, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %211, %182
  %185 = load i32, ptr %19, align 4, !tbaa !5
  %186 = icmp slt i32 %185, 12
  br i1 %186, label %188, label %187

187:                                              ; preds = %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %214

188:                                              ; preds = %184
  %189 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 13
  %190 = load ptr, ptr %189, align 8, !tbaa !15
  %191 = load i32, ptr %19, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [12 x i32], ptr %16, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds double, ptr %190, i64 %195
  %197 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 15
  %198 = load ptr, ptr %197, align 8, !tbaa !18
  %199 = load i32, ptr %19, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [12 x i32], ptr %16, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds i32, ptr %198, i64 %203
  %205 = load i32, ptr %19, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [12 x i32], ptr %14, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 0
  %210 = load i32, ptr %209, align 8, !tbaa !24
  call void @quickSort_parallel_d_i(ptr noundef %196, ptr noundef %204, i32 noundef %208, i32 noundef %210)
  br label %211

211:                                              ; preds = %188
  %212 = load i32, ptr %19, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %19, align 4, !tbaa !5
  br label %184, !llvm.loop !27

214:                                              ; preds = %187
  %215 = call double @get_time()
  store double %215, ptr %9, align 8, !tbaa !20
  %216 = load i32, ptr %4, align 4, !tbaa !5
  %217 = icmp eq i32 %216, 0
  br i1 %217, label %218, label %223

218:                                              ; preds = %214
  %219 = load double, ptr %9, align 8, !tbaa !20
  %220 = load double, ptr %8, align 8, !tbaa !20
  %221 = fsub double %219, %220
  %222 = call i32 (ptr, ...) @printf(ptr noundef @.str.93, double noundef %221)
  br label %223

223:                                              ; preds = %218, %214
  %224 = call double @get_time()
  store double %224, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store i64 0, ptr %20, align 8, !tbaa !28
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %316, %223
  %226 = load i32, ptr %21, align 4, !tbaa !5
  %227 = icmp slt i32 %226, 12
  br i1 %227, label %229, label %228

228:                                              ; preds = %225
  store i32 14, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %319

229:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %230 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %230, ptr %23, align 4, !tbaa !5
  br label %231

231:                                              ; preds = %306, %229
  %232 = load i32, ptr %23, align 4, !tbaa !5
  %233 = load i32, ptr %18, align 4, !tbaa !5
  %234 = load i32, ptr %21, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [12 x i32], ptr %14, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = add nsw i32 %233, %237
  %239 = icmp slt i32 %232, %238
  br i1 %239, label %241, label %240

240:                                              ; preds = %231
  store i32 17, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %309

241:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %242 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 13
  %243 = load ptr, ptr %242, align 8, !tbaa !15
  %244 = load i32, ptr %23, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds double, ptr %243, i64 %245
  %247 = load double, ptr %246, align 8, !tbaa !20
  store double %247, ptr %24, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %248 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 15
  %249 = load ptr, ptr %248, align 8, !tbaa !18
  %250 = load i32, ptr %23, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds i32, ptr %249, i64 %251
  %253 = load i32, ptr %252, align 4, !tbaa !5
  store i32 %253, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %26) #5
  call void @llvm.memset.p0.i64(ptr align 16 %26, i8 0, i64 40, i1 false)
  %254 = load double, ptr %24, align 8, !tbaa !20
  %255 = load i32, ptr %25, align 4, !tbaa !5
  %256 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 1
  %257 = load i64, ptr %256, align 8, !tbaa !30
  %258 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 2
  %259 = load i64, ptr %258, align 8, !tbaa !31
  %260 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 0
  %261 = load ptr, ptr %260, align 8, !tbaa !32
  %262 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 1
  %263 = load ptr, ptr %262, align 8, !tbaa !33
  %264 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 3
  %265 = load ptr, ptr %264, align 8, !tbaa !34
  %266 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 4
  %267 = load ptr, ptr %266, align 8, !tbaa !35
  %268 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 5
  %269 = load ptr, ptr %268, align 8, !tbaa !36
  %270 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 2
  %271 = load ptr, ptr %270, align 8, !tbaa !37
  %272 = getelementptr inbounds [5 x double], ptr %26, i64 0, i64 0
  %273 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 5
  %274 = load i32, ptr %273, align 8, !tbaa !38
  %275 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 6
  %276 = load i32, ptr %275, align 4, !tbaa !39
  %277 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 12
  %278 = load i32, ptr %277, align 8, !tbaa !40
  call void @calculate_macro_xs(double noundef %254, i32 noundef %255, i64 noundef %257, i64 noundef %259, ptr noundef %261, ptr noundef %263, ptr noundef %265, ptr noundef %267, ptr noundef %269, ptr noundef %271, ptr noundef %272, i32 noundef %274, i32 noundef %276, i32 noundef %278)
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  store double -1.000000e+00, ptr %27, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %279

279:                                              ; preds = %297, %241
  %280 = load i32, ptr %29, align 4, !tbaa !5
  %281 = icmp slt i32 %280, 5
  br i1 %281, label %283, label %282

282:                                              ; preds = %279
  store i32 20, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %300

283:                                              ; preds = %279
  %284 = load i32, ptr %29, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [5 x double], ptr %26, i64 0, i64 %285
  %287 = load double, ptr %286, align 8, !tbaa !20
  %288 = load double, ptr %27, align 8, !tbaa !20
  %289 = fcmp ogt double %287, %288
  br i1 %289, label %290, label %296

290:                                              ; preds = %283
  %291 = load i32, ptr %29, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [5 x double], ptr %26, i64 0, i64 %292
  %294 = load double, ptr %293, align 8, !tbaa !20
  store double %294, ptr %27, align 8, !tbaa !20
  %295 = load i32, ptr %29, align 4, !tbaa !5
  store i32 %295, ptr %28, align 4, !tbaa !5
  br label %296

296:                                              ; preds = %290, %283
  br label %297

297:                                              ; preds = %296
  %298 = load i32, ptr %29, align 4, !tbaa !5
  %299 = add nsw i32 %298, 1
  store i32 %299, ptr %29, align 4, !tbaa !5
  br label %279, !llvm.loop !41

300:                                              ; preds = %282
  %301 = load i32, ptr %28, align 4, !tbaa !5
  %302 = add nsw i32 %301, 1
  %303 = sext i32 %302 to i64
  %304 = load i64, ptr %20, align 8, !tbaa !28
  %305 = add i64 %304, %303
  store i64 %305, ptr %20, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %306

306:                                              ; preds = %300
  %307 = load i32, ptr %23, align 4, !tbaa !5
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %23, align 4, !tbaa !5
  br label %231, !llvm.loop !42

309:                                              ; preds = %240
  %310 = load i32, ptr %21, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [12 x i32], ptr %14, i64 0, i64 %311
  %313 = load i32, ptr %312, align 4, !tbaa !5
  %314 = load i32, ptr %18, align 4, !tbaa !5
  %315 = add nsw i32 %314, %313
  store i32 %315, ptr %18, align 4, !tbaa !5
  br label %316

316:                                              ; preds = %309
  %317 = load i32, ptr %21, align 4, !tbaa !5
  %318 = add nsw i32 %317, 1
  store i32 %318, ptr %21, align 4, !tbaa !5
  br label %225, !llvm.loop !43

319:                                              ; preds = %228
  %320 = call double @get_time()
  store double %320, ptr %9, align 8, !tbaa !20
  %321 = load i32, ptr %4, align 4, !tbaa !5
  %322 = icmp eq i32 %321, 0
  br i1 %322, label %323, label %328

323:                                              ; preds = %319
  %324 = load double, ptr %9, align 8, !tbaa !20
  %325 = load double, ptr %8, align 8, !tbaa !20
  %326 = fsub double %324, %325
  %327 = call i32 (ptr, ...) @printf(ptr noundef @.str.94, double noundef %326)
  br label %328

328:                                              ; preds = %323, %319
  %329 = load i64, ptr %20, align 8, !tbaa !28
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i64 %329
}

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i64 @fast_forward_LCG(i64 noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local double @LCG_random_double(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @pick_mat(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
declare dso_local void @calculate_macro_xs(double noundef, i32 noundef, i64 noundef, i64 noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @quickSort_parallel_i_d(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @quickSort_parallel_d_i(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 24}
!14 = !{!"", !6, i64 0, !12, i64 8, !12, i64 16, !6, i64 24, !10, i64 32, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60}
!15 = !{!16, !10, i64 80}
!16 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !10, i64 80, !6, i64 88, !10, i64 96, !6, i64 104}
!17 = !{!16, !6, i64 88}
!18 = !{!16, !10, i64 96}
!19 = !{!16, !6, i64 104}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!14, !6, i64 0}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !23}
!27 = distinct !{!27, !23}
!28 = !{!29, !29, i64 0}
!29 = !{!"long long", !7, i64 0}
!30 = !{!14, !12, i64 8}
!31 = !{!14, !12, i64 16}
!32 = !{!16, !10, i64 0}
!33 = !{!16, !10, i64 8}
!34 = !{!16, !10, i64 24}
!35 = !{!16, !10, i64 32}
!36 = !{!16, !10, i64 40}
!37 = !{!16, !10, i64 16}
!38 = !{!14, !6, i64 40}
!39 = !{!14, !6, i64 44}
!40 = !{!16, !6, i64 72}
!41 = distinct !{!41, !23}
!42 = distinct !{!42, !23}
!43 = distinct !{!43, !23}


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

%struct.Inputs = type { i32, i64, i64, i32, ptr, i32, i32, i32, i32, i32, i32 }
%struct.SimulationData = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32 }

@.str.86 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [31 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare double @get_time() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @run_event_based_simulation_optimization_1(ptr nocapture noundef readonly byval(%struct.Inputs) align 8 %0, ptr nocapture noundef readonly byval(%struct.SimulationData) align 8 %1, i32 noundef %2) local_unnamed_addr #3 {
  %4 = alloca i64, align 8
  %5 = alloca [12 x i32], align 16
  %6 = alloca [5 x double], align 16
  %7 = icmp eq i32 %2, 0
  br i1 %7, label %8, label %.critedge

8:                                                ; preds = %3
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.87, ptr noundef nonnull @.str.86)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.88)
  br label %.critedge

.critedge:                                        ; preds = %3, %8
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = shl nsw i64 %13, 3
  %15 = tail call noalias ptr @malloc(i64 noundef %14) #6
  %16 = shl nsw i64 %13, 2
  %17 = tail call noalias ptr @malloc(i64 noundef %16) #6
  br i1 %7, label %18, label %24

18:                                               ; preds = %.critedge
  %19 = mul nsw i64 %13, 12
  %20 = uitofp i64 %19 to double
  %21 = fmul double %20, 0x3F50000000000000
  %22 = fmul double %21, 0x3F50000000000000
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.89, double noundef %22)
  br label %24

24:                                               ; preds = %18, %.critedge
  %25 = icmp sgt i32 %12, 0
  br i1 %25, label %.lr.ph.preheader, label %._crit_edge

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

._crit_edge:                                      ; preds = %.lr.ph, %24
  br i1 %7, label %32, label %34

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 1070, ptr %4, align 8, !tbaa !12
  %26 = shl nuw nsw i64 %indvars.iv, 1
  %27 = call i64 @fast_forward_LCG(i64 noundef 1070, i64 noundef %26)
  store i64 %27, ptr %4, align 8, !tbaa !12
  %28 = call double @LCG_random_double(ptr noundef nonnull %4)
  %29 = call i32 @pick_mat(ptr noundef nonnull %4)
  %30 = getelementptr inbounds double, ptr %15, i64 %indvars.iv
  store double %28, ptr %30, align 8, !tbaa !13
  %31 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv
  store i32 %29, ptr %31, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #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 %._crit_edge, label %.lr.ph, !llvm.loop !16

32:                                               ; preds = %._crit_edge
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.90)
  br label %34

34:                                               ; preds = %32, %._crit_edge
  %35 = call double @get_time() #7
  %36 = load i32, ptr %0, align 8, !tbaa !18
  call void @quickSort_parallel_i_d(ptr noundef %17, ptr noundef %15, i32 noundef %12, i32 noundef %36)
  %37 = call double @get_time() #7
  br i1 %7, label %38, label %41

38:                                               ; preds = %34
  %39 = fsub double %37, %35
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.91, double noundef %39)
  br label %41

41:                                               ; preds = %38, %34
  %42 = call double @get_time() #7
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %5, i8 0, i64 48, i1 false)
  br i1 %25, label %.lr.ph83.preheader, label %._crit_edge84

.lr.ph83.preheader:                               ; preds = %41
  %wide.trip.count102 = zext nneg i32 %12 to i64
  %xtraiter = and i64 %wide.trip.count102, 3
  %43 = icmp ult i32 %12, 4
  br i1 %43, label %._crit_edge84.loopexit.unr-lcssa, label %.lr.ph83.preheader.new

.lr.ph83.preheader.new:                           ; preds = %.lr.ph83.preheader
  %unroll_iter = and i64 %wide.trip.count102, 2147483644
  br label %.lr.ph83

._crit_edge84.loopexit.unr-lcssa:                 ; preds = %.lr.ph83, %.lr.ph83.preheader
  %indvars.iv99.unr = phi i64 [ 0, %.lr.ph83.preheader ], [ %indvars.iv.next100.3, %.lr.ph83 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge84.loopexit, label %.lr.ph83.epil

.lr.ph83.epil:                                    ; preds = %._crit_edge84.loopexit.unr-lcssa, %.lr.ph83.epil
  %indvars.iv99.epil = phi i64 [ %indvars.iv.next100.epil, %.lr.ph83.epil ], [ %indvars.iv99.unr, %._crit_edge84.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph83.epil ], [ 0, %._crit_edge84.loopexit.unr-lcssa ]
  %44 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv99.epil
  %45 = load i32, ptr %44, align 4, !tbaa !15
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !15
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !15
  %indvars.iv.next100.epil = add nuw nsw i64 %indvars.iv99.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge84.loopexit, label %.lr.ph83.epil, !llvm.loop !19

._crit_edge84.loopexit:                           ; preds = %.lr.ph83.epil, %._crit_edge84.loopexit.unr-lcssa
  %.pre = load i32, ptr %5, align 16, !tbaa !15
  %.phi.trans.insert = getelementptr inbounds i8, ptr %5, i64 4
  %.pre145 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !15
  %.phi.trans.insert146 = getelementptr inbounds i8, ptr %5, i64 8
  %.pre147 = load i32, ptr %.phi.trans.insert146, align 8, !tbaa !15
  %.phi.trans.insert148 = getelementptr inbounds i8, ptr %5, i64 12
  %.pre149 = load i32, ptr %.phi.trans.insert148, align 4, !tbaa !15
  %.phi.trans.insert150 = getelementptr inbounds i8, ptr %5, i64 16
  %.pre151 = load i32, ptr %.phi.trans.insert150, align 16, !tbaa !15
  %.phi.trans.insert152 = getelementptr inbounds i8, ptr %5, i64 20
  %.pre153 = load i32, ptr %.phi.trans.insert152, align 4, !tbaa !15
  %.phi.trans.insert154 = getelementptr inbounds i8, ptr %5, i64 24
  %.pre155 = load i32, ptr %.phi.trans.insert154, align 8, !tbaa !15
  %.phi.trans.insert156 = getelementptr inbounds i8, ptr %5, i64 28
  %.pre157 = load i32, ptr %.phi.trans.insert156, align 4, !tbaa !15
  %.phi.trans.insert158 = getelementptr inbounds i8, ptr %5, i64 32
  %.pre159 = load i32, ptr %.phi.trans.insert158, align 16, !tbaa !15
  %.phi.trans.insert160 = getelementptr inbounds i8, ptr %5, i64 36
  %.pre161 = load i32, ptr %.phi.trans.insert160, align 4, !tbaa !15
  %.phi.trans.insert162 = getelementptr inbounds i8, ptr %5, i64 40
  %.pre163 = load i32, ptr %.phi.trans.insert162, align 8, !tbaa !15
  br label %._crit_edge84

._crit_edge84:                                    ; preds = %._crit_edge84.loopexit, %41
  %50 = phi i32 [ %.pre163, %._crit_edge84.loopexit ], [ 0, %41 ]
  %51 = phi i32 [ %.pre161, %._crit_edge84.loopexit ], [ 0, %41 ]
  %52 = phi i32 [ %.pre159, %._crit_edge84.loopexit ], [ 0, %41 ]
  %53 = phi i32 [ %.pre157, %._crit_edge84.loopexit ], [ 0, %41 ]
  %54 = phi i32 [ %.pre155, %._crit_edge84.loopexit ], [ 0, %41 ]
  %55 = phi i32 [ %.pre153, %._crit_edge84.loopexit ], [ 0, %41 ]
  %56 = phi i32 [ %.pre151, %._crit_edge84.loopexit ], [ 0, %41 ]
  %57 = phi i32 [ %.pre149, %._crit_edge84.loopexit ], [ 0, %41 ]
  %58 = phi i32 [ %.pre147, %._crit_edge84.loopexit ], [ 0, %41 ]
  %59 = phi i32 [ %.pre145, %._crit_edge84.loopexit ], [ 0, %41 ]
  %60 = phi i32 [ %.pre, %._crit_edge84.loopexit ], [ 0, %41 ]
  %61 = add nsw i32 %59, %60
  %62 = add nsw i32 %58, %61
  %63 = add nsw i32 %57, %62
  %64 = add nsw i32 %56, %63
  %65 = add nsw i32 %55, %64
  %66 = add nsw i32 %54, %65
  %67 = add nsw i32 %53, %66
  %68 = add nsw i32 %52, %67
  %69 = add nsw i32 %51, %68
  %70 = add nsw i32 %50, %69
  %71 = call double @get_time() #7
  br i1 %7, label %96, label %99

.lr.ph83:                                         ; preds = %.lr.ph83, %.lr.ph83.preheader.new
  %indvars.iv99 = phi i64 [ 0, %.lr.ph83.preheader.new ], [ %indvars.iv.next100.3, %.lr.ph83 ]
  %niter = phi i64 [ 0, %.lr.ph83.preheader.new ], [ %niter.next.3, %.lr.ph83 ]
  %72 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv99
  %73 = load i32, ptr %72, align 4, !tbaa !15
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !15
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %75, align 4, !tbaa !15
  %indvars.iv.next100 = or disjoint i64 %indvars.iv99, 1
  %78 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next100
  %79 = load i32, ptr %78, align 4, !tbaa !15
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !15
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %81, align 4, !tbaa !15
  %indvars.iv.next100.1 = or disjoint i64 %indvars.iv99, 2
  %84 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next100.1
  %85 = load i32, ptr %84, align 4, !tbaa !15
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !15
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %87, align 4, !tbaa !15
  %indvars.iv.next100.2 = or disjoint i64 %indvars.iv99, 3
  %90 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next100.2
  %91 = load i32, ptr %90, align 4, !tbaa !15
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !15
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %93, align 4, !tbaa !15
  %indvars.iv.next100.3 = add nuw nsw i64 %indvars.iv99, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge84.loopexit.unr-lcssa, label %.lr.ph83, !llvm.loop !21

96:                                               ; preds = %._crit_edge84
  %97 = fsub double %71, %42
  %98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.92, double noundef %97)
  br label %99

99:                                               ; preds = %96, %._crit_edge84
  call void @quickSort_parallel_d_i(ptr noundef %15, ptr noundef %17, i32 noundef %60, i32 noundef %36)
  %100 = sext i32 %60 to i64
  %101 = getelementptr inbounds double, ptr %15, i64 %100
  %102 = getelementptr inbounds i32, ptr %17, i64 %100
  call void @quickSort_parallel_d_i(ptr noundef %101, ptr noundef %102, i32 noundef %59, i32 noundef %36)
  %103 = sext i32 %61 to i64
  %104 = getelementptr inbounds double, ptr %15, i64 %103
  %105 = getelementptr inbounds i32, ptr %17, i64 %103
  call void @quickSort_parallel_d_i(ptr noundef %104, ptr noundef %105, i32 noundef %58, i32 noundef %36)
  %106 = sext i32 %62 to i64
  %107 = getelementptr inbounds double, ptr %15, i64 %106
  %108 = getelementptr inbounds i32, ptr %17, i64 %106
  call void @quickSort_parallel_d_i(ptr noundef %107, ptr noundef %108, i32 noundef %57, i32 noundef %36)
  %109 = sext i32 %63 to i64
  %110 = getelementptr inbounds double, ptr %15, i64 %109
  %111 = getelementptr inbounds i32, ptr %17, i64 %109
  call void @quickSort_parallel_d_i(ptr noundef %110, ptr noundef %111, i32 noundef %56, i32 noundef %36)
  %112 = sext i32 %64 to i64
  %113 = getelementptr inbounds double, ptr %15, i64 %112
  %114 = getelementptr inbounds i32, ptr %17, i64 %112
  call void @quickSort_parallel_d_i(ptr noundef %113, ptr noundef %114, i32 noundef %55, i32 noundef %36)
  %115 = sext i32 %65 to i64
  %116 = getelementptr inbounds double, ptr %15, i64 %115
  %117 = getelementptr inbounds i32, ptr %17, i64 %115
  call void @quickSort_parallel_d_i(ptr noundef %116, ptr noundef %117, i32 noundef %54, i32 noundef %36)
  %118 = sext i32 %66 to i64
  %119 = getelementptr inbounds double, ptr %15, i64 %118
  %120 = getelementptr inbounds i32, ptr %17, i64 %118
  call void @quickSort_parallel_d_i(ptr noundef %119, ptr noundef %120, i32 noundef %53, i32 noundef %36)
  %121 = sext i32 %67 to i64
  %122 = getelementptr inbounds double, ptr %15, i64 %121
  %123 = getelementptr inbounds i32, ptr %17, i64 %121
  call void @quickSort_parallel_d_i(ptr noundef %122, ptr noundef %123, i32 noundef %52, i32 noundef %36)
  %124 = sext i32 %68 to i64
  %125 = getelementptr inbounds double, ptr %15, i64 %124
  %126 = getelementptr inbounds i32, ptr %17, i64 %124
  call void @quickSort_parallel_d_i(ptr noundef %125, ptr noundef %126, i32 noundef %51, i32 noundef %36)
  %127 = sext i32 %69 to i64
  %128 = getelementptr inbounds double, ptr %15, i64 %127
  %129 = getelementptr inbounds i32, ptr %17, i64 %127
  call void @quickSort_parallel_d_i(ptr noundef %128, ptr noundef %129, i32 noundef %50, i32 noundef %36)
  %130 = sext i32 %70 to i64
  %131 = getelementptr inbounds double, ptr %15, i64 %130
  %132 = getelementptr inbounds i32, ptr %17, i64 %130
  %133 = getelementptr inbounds i8, ptr %5, i64 44
  %134 = load i32, ptr %133, align 4, !tbaa !15
  call void @quickSort_parallel_d_i(ptr noundef %131, ptr noundef %132, i32 noundef %134, i32 noundef %36)
  %135 = call double @get_time() #7
  br i1 %7, label %136, label %139

136:                                              ; preds = %99
  %137 = fsub double %135, %71
  %138 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.93, double noundef %137)
  br label %139

139:                                              ; preds = %136, %99
  %140 = call double @get_time() #7
  %141 = getelementptr inbounds i8, ptr %0, i64 8
  %142 = load i64, ptr %141, align 8
  %143 = getelementptr inbounds i8, ptr %0, i64 16
  %144 = load i64, ptr %143, align 8
  %145 = load ptr, ptr %1, align 8
  %146 = getelementptr inbounds i8, ptr %1, i64 8
  %147 = load ptr, ptr %146, align 8
  %148 = getelementptr inbounds i8, ptr %1, i64 24
  %149 = load ptr, ptr %148, align 8
  %150 = getelementptr inbounds i8, ptr %1, i64 32
  %151 = load ptr, ptr %150, align 8
  %152 = getelementptr inbounds i8, ptr %1, i64 40
  %153 = load ptr, ptr %152, align 8
  %154 = getelementptr inbounds i8, ptr %1, i64 16
  %155 = load ptr, ptr %154, align 8
  %156 = getelementptr inbounds i8, ptr %0, i64 40
  %157 = load i32, ptr %156, align 8
  %158 = getelementptr inbounds i8, ptr %0, i64 44
  %159 = load i32, ptr %158, align 4
  %160 = getelementptr inbounds i8, ptr %1, i64 72
  %161 = load i32, ptr %160, align 8
  %162 = getelementptr inbounds i8, ptr %6, i64 8
  %163 = getelementptr inbounds i8, ptr %6, i64 16
  %164 = getelementptr inbounds i8, ptr %6, i64 24
  %165 = getelementptr inbounds i8, ptr %6, i64 32
  br label %.preheader

.preheader:                                       ; preds = %139, %._crit_edge93
  %indvars.iv119 = phi i64 [ 0, %139 ], [ %indvars.iv.next120, %._crit_edge93 ]
  %.07196 = phi i64 [ 0, %139 ], [ %.172.lcssa, %._crit_edge93 ]
  %.07495 = phi i32 [ 0, %139 ], [ %168, %._crit_edge93 ]
  %166 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %indvars.iv119
  %167 = load i32, ptr %166, align 4, !tbaa !15
  %168 = add nsw i32 %167, %.07495
  %169 = icmp sgt i32 %167, 0
  br i1 %169, label %.lr.ph92.preheader, label %._crit_edge93

.lr.ph92.preheader:                               ; preds = %.preheader
  %170 = sext i32 %.07495 to i64
  %171 = sext i32 %168 to i64
  br label %.lr.ph92

172:                                              ; preds = %._crit_edge93
  %173 = call double @get_time() #7
  br i1 %7, label %194, label %197

._crit_edge93:                                    ; preds = %.lr.ph92, %.preheader
  %.172.lcssa = phi i64 [ %.07196, %.preheader ], [ %192, %.lr.ph92 ]
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next120, 12
  br i1 %exitcond122.not, label %172, label %.preheader, !llvm.loop !22

.lr.ph92:                                         ; preds = %.lr.ph92.preheader, %.lr.ph92
  %indvars.iv116 = phi i64 [ %170, %.lr.ph92.preheader ], [ %indvars.iv.next117, %.lr.ph92 ]
  %.17290 = phi i64 [ %.07196, %.lr.ph92.preheader ], [ %192, %.lr.ph92 ]
  %174 = getelementptr inbounds double, ptr %15, i64 %indvars.iv116
  %175 = load double, ptr %174, align 8, !tbaa !13
  %176 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv116
  %177 = load i32, ptr %176, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %6, i8 0, i64 40, i1 false)
  call void @calculate_macro_xs(double noundef %175, i32 noundef %177, i64 noundef %142, i64 noundef %144, ptr noundef %145, ptr noundef %147, ptr noundef %149, ptr noundef %151, ptr noundef %153, ptr noundef %155, ptr noundef nonnull %6, i32 noundef %157, i32 noundef %159, i32 noundef %161)
  %178 = load double, ptr %6, align 16, !tbaa !13
  %179 = fcmp ogt double %178, -1.000000e+00
  %.168 = select i1 %179, double %178, double -1.000000e+00
  %180 = load double, ptr %162, align 8, !tbaa !13
  %181 = fcmp ogt double %180, %.168
  %.168.1 = select i1 %181, double %180, double %.168
  %182 = load double, ptr %163, align 16, !tbaa !13
  %183 = fcmp ogt double %182, %.168.1
  %.168.2 = select i1 %183, double %182, double %.168.1
  %184 = load double, ptr %164, align 8, !tbaa !13
  %185 = fcmp ogt double %184, %.168.2
  %.168.3 = select i1 %185, double %184, double %.168.2
  %186 = select i1 %181, i64 2, i64 1
  %187 = load double, ptr %165, align 16, !tbaa !13
  %188 = fcmp ogt double %187, %.168.3
  %189 = select i1 %183, i64 3, i64 %186
  %190 = select i1 %185, i64 4, i64 %189
  %191 = select i1 %188, i64 5, i64 %190
  %192 = add i64 %.17290, %191
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  %indvars.iv.next117 = add nsw i64 %indvars.iv116, 1
  %193 = icmp slt i64 %indvars.iv.next117, %171
  br i1 %193, label %.lr.ph92, label %._crit_edge93, !llvm.loop !23

194:                                              ; preds = %172
  %195 = fsub double %173, %140
  %196 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, double noundef %195)
  br label %197

197:                                              ; preds = %194, %172
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #7
  ret i64 %.172.lcssa
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i64 @fast_forward_LCG(i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local double @LCG_random_double(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @pick_mat(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nounwind uwtable
declare dso_local void @calculate_macro_xs(double noundef, i32 noundef, i64 noundef, i64 noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 24}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!6, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass