; LLVM IR from ANL-CESAR/XSBench :: openmp-threading (Simulation)

; 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, i64, i32, i32, ptr, i32, ptr, i32 }

@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [31 x i8], align 1

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

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

; 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) #3

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; 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

; 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 i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca [12 x i32], align 16
  %16 = alloca i32, align 4
  %17 = alloca [12 x i32], align 16
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca [5 x double], align 16
  %30 = alloca double, align 8
  %31 = alloca i32, align 4
  %32 = 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.2, ptr %5, align 8, !tbaa !9
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %38

35:                                               ; preds = %3
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %36)
  br label %38

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

41:                                               ; preds = %38
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %43

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

72:                                               ; preds = %43
  %73 = load i64, ptr %7, align 8, !tbaa !11
  %74 = uitofp i64 %73 to double
  %75 = fdiv double %74, 1.024000e+03
  %76 = fdiv double %75, 1.024000e+03
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, double noundef %76)
  br label %78

78:                                               ; preds = %72, %43
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %79

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

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

104:                                              ; preds = %84
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %10, align 4, !tbaa !5
  br label %79, !llvm.loop !22

107:                                              ; preds = %79
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %112

110:                                              ; preds = %107
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %112

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

125:                                              ; preds = %112
  %126 = load double, ptr %9, align 8, !tbaa !20
  %127 = load double, ptr %8, align 8, !tbaa !20
  %128 = fsub double %126, %127
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %128)
  br label %130

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

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

137:                                              ; preds = %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %152

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

149:                                              ; preds = %138
  %150 = load i32, ptr %16, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %16, align 4, !tbaa !5
  br label %132, !llvm.loop !25

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

153:                                              ; preds = %172, %152
  %154 = load i32, ptr %18, align 4, !tbaa !5
  %155 = icmp slt i32 %154, 12
  br i1 %155, label %157, label %156

156:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %175

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

172:                                              ; preds = %157
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %18, align 4, !tbaa !5
  br label %153, !llvm.loop !26

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

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

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

186:                                              ; preds = %213, %184
  %187 = load i32, ptr %20, align 4, !tbaa !5
  %188 = icmp slt i32 %187, 12
  br i1 %188, label %190, label %189

189:                                              ; preds = %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %216

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

213:                                              ; preds = %190
  %214 = load i32, ptr %20, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %20, align 4, !tbaa !5
  br label %186, !llvm.loop !27

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

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

225:                                              ; preds = %220, %216
  %226 = call double @get_time()
  store double %226, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  store i64 0, ptr %21, align 8, !tbaa !28
  store i32 0, ptr %19, align 4, !tbaa !5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %227

227:                                              ; preds = %321, %225
  %228 = load i32, ptr %11, align 4, !tbaa !5
  %229 = icmp slt i32 %228, 12
  br i1 %229, label %230, label %324

230:                                              ; preds = %227
  %231 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %231, ptr %10, align 4, !tbaa !5
  br label %232

232:                                              ; preds = %311, %230
  %233 = load i32, ptr %10, align 4, !tbaa !5
  %234 = load i32, ptr %19, align 4, !tbaa !5
  %235 = load i32, ptr %11, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [12 x i32], ptr %15, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = add nsw i32 %234, %238
  %240 = icmp slt i32 %233, %239
  br i1 %240, label %241, label %314

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

284:                                              ; preds = %302, %241
  %285 = load i32, ptr %32, align 4, !tbaa !5
  %286 = icmp slt i32 %285, 5
  br i1 %286, label %288, label %287

287:                                              ; preds = %284
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %305

288:                                              ; preds = %284
  %289 = load i32, ptr %32, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [5 x double], ptr %29, i64 0, i64 %290
  %292 = load double, ptr %291, align 8, !tbaa !20
  %293 = load double, ptr %30, align 8, !tbaa !20
  %294 = fcmp ogt double %292, %293
  br i1 %294, label %295, label %301

295:                                              ; preds = %288
  %296 = load i32, ptr %32, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [5 x double], ptr %29, i64 0, i64 %297
  %299 = load double, ptr %298, align 8, !tbaa !20
  store double %299, ptr %30, align 8, !tbaa !20
  %300 = load i32, ptr %32, align 4, !tbaa !5
  store i32 %300, ptr %31, align 4, !tbaa !5
  br label %301

301:                                              ; preds = %295, %288
  br label %302

302:                                              ; preds = %301
  %303 = load i32, ptr %32, align 4, !tbaa !5
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %32, align 4, !tbaa !5
  br label %284, !llvm.loop !41

305:                                              ; preds = %287
  %306 = load i32, ptr %31, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  %308 = sext i32 %307 to i64
  %309 = load i64, ptr %21, align 8, !tbaa !28
  %310 = add i64 %309, %308
  store i64 %310, ptr %21, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %29) #5
  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 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 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %311

311:                                              ; preds = %305
  %312 = load i32, ptr %10, align 4, !tbaa !5
  %313 = add nsw i32 %312, 1
  store i32 %313, ptr %10, align 4, !tbaa !5
  br label %232, !llvm.loop !42

314:                                              ; preds = %232
  %315 = load i32, ptr %11, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [12 x i32], ptr %15, i64 0, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = load i32, ptr %19, align 4, !tbaa !5
  %320 = add nsw i32 %319, %318
  store i32 %320, ptr %19, align 4, !tbaa !5
  br label %321

321:                                              ; preds = %314
  %322 = load i32, ptr %11, align 4, !tbaa !5
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %11, align 4, !tbaa !5
  br label %227, !llvm.loop !43

324:                                              ; preds = %227
  %325 = call double @get_time()
  store double %325, ptr %9, align 8, !tbaa !20
  %326 = load i32, ptr %4, align 4, !tbaa !5
  %327 = icmp eq i32 %326, 0
  br i1 %327, label %328, label %333

328:                                              ; preds = %324
  %329 = load double, ptr %9, align 8, !tbaa !20
  %330 = load double, ptr %8, align 8, !tbaa !20
  %331 = fsub double %329, %330
  %332 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, double noundef %331)
  br label %333

333:                                              ; preds = %328, %324
  %334 = load i64, ptr %21, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #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 %334
}

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

declare double @get_time() #0

attributes #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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #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, !12, i64 64, !6, i64 72, !6, i64 76, !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 = !{!16, !10, i64 0}
!31 = !{!16, !10, i64 8}
!32 = !{!16, !10, i64 24}
!33 = !{!16, !10, i64 32}
!34 = !{!16, !10, i64 40}
!35 = !{!14, !12, i64 8}
!36 = !{!14, !12, i64 16}
!37 = !{!16, !10, i64 16}
!38 = !{!14, !6, i64 40}
!39 = !{!14, !6, i64 44}
!40 = !{!16, !6, i64 76}
!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, i64, i32, i32, ptr, i32, ptr, i32 }

@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [31 x i8], align 1

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

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

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

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

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

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

; 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 #2

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @quickSort_parallel_d_i(ptr noundef, ptr noundef, i32 noundef, i32 noundef) 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 #2 {
  %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.3, ptr noundef nonnull @.str.2)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  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.5, 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

.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

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

32:                                               ; preds = %._crit_edge
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  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.7, 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.ph88.preheader, label %._crit_edge89

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

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

._crit_edge89.loopexit.unr-lcssa:                 ; preds = %.lr.ph88, %.lr.ph88.preheader
  %indvars.iv104.unr = phi i64 [ 0, %.lr.ph88.preheader ], [ %indvars.iv.next105.3, %.lr.ph88 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge89.loopexit, label %.lr.ph88.epil

.lr.ph88.epil:                                    ; preds = %._crit_edge89.loopexit.unr-lcssa, %.lr.ph88.epil
  %indvars.iv104.epil = phi i64 [ %indvars.iv.next105.epil, %.lr.ph88.epil ], [ %indvars.iv104.unr, %._crit_edge89.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph88.epil ], [ 0, %._crit_edge89.loopexit.unr-lcssa ]
  %44 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv104.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.next105.epil = add nuw nsw i64 %indvars.iv104.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_edge89.loopexit, label %.lr.ph88.epil, !llvm.loop !19

._crit_edge89.loopexit:                           ; preds = %.lr.ph88.epil, %._crit_edge89.loopexit.unr-lcssa
  %.pre = load i32, ptr %5, align 16, !tbaa !15
  %.phi.trans.insert = getelementptr inbounds i8, ptr %5, i64 4
  %.pre150 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !15
  %.phi.trans.insert151 = getelementptr inbounds i8, ptr %5, i64 8
  %.pre152 = load i32, ptr %.phi.trans.insert151, align 8, !tbaa !15
  %.phi.trans.insert153 = getelementptr inbounds i8, ptr %5, i64 12
  %.pre154 = load i32, ptr %.phi.trans.insert153, align 4, !tbaa !15
  %.phi.trans.insert155 = getelementptr inbounds i8, ptr %5, i64 16
  %.pre156 = load i32, ptr %.phi.trans.insert155, align 16, !tbaa !15
  %.phi.trans.insert157 = getelementptr inbounds i8, ptr %5, i64 20
  %.pre158 = load i32, ptr %.phi.trans.insert157, align 4, !tbaa !15
  %.phi.trans.insert159 = getelementptr inbounds i8, ptr %5, i64 24
  %.pre160 = load i32, ptr %.phi.trans.insert159, align 8, !tbaa !15
  %.phi.trans.insert161 = getelementptr inbounds i8, ptr %5, i64 28
  %.pre162 = load i32, ptr %.phi.trans.insert161, align 4, !tbaa !15
  %.phi.trans.insert163 = getelementptr inbounds i8, ptr %5, i64 32
  %.pre164 = load i32, ptr %.phi.trans.insert163, align 16, !tbaa !15
  %.phi.trans.insert165 = getelementptr inbounds i8, ptr %5, i64 36
  %.pre166 = load i32, ptr %.phi.trans.insert165, align 4, !tbaa !15
  %.phi.trans.insert167 = getelementptr inbounds i8, ptr %5, i64 40
  %.pre168 = load i32, ptr %.phi.trans.insert167, align 8, !tbaa !15
  br label %._crit_edge89

._crit_edge89:                                    ; preds = %._crit_edge89.loopexit, %41
  %50 = phi i32 [ %.pre168, %._crit_edge89.loopexit ], [ 0, %41 ]
  %51 = phi i32 [ %.pre166, %._crit_edge89.loopexit ], [ 0, %41 ]
  %52 = phi i32 [ %.pre164, %._crit_edge89.loopexit ], [ 0, %41 ]
  %53 = phi i32 [ %.pre162, %._crit_edge89.loopexit ], [ 0, %41 ]
  %54 = phi i32 [ %.pre160, %._crit_edge89.loopexit ], [ 0, %41 ]
  %55 = phi i32 [ %.pre158, %._crit_edge89.loopexit ], [ 0, %41 ]
  %56 = phi i32 [ %.pre156, %._crit_edge89.loopexit ], [ 0, %41 ]
  %57 = phi i32 [ %.pre154, %._crit_edge89.loopexit ], [ 0, %41 ]
  %58 = phi i32 [ %.pre152, %._crit_edge89.loopexit ], [ 0, %41 ]
  %59 = phi i32 [ %.pre150, %._crit_edge89.loopexit ], [ 0, %41 ]
  %60 = phi i32 [ %.pre, %._crit_edge89.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.ph88:                                         ; preds = %.lr.ph88, %.lr.ph88.preheader.new
  %indvars.iv104 = phi i64 [ 0, %.lr.ph88.preheader.new ], [ %indvars.iv.next105.3, %.lr.ph88 ]
  %niter = phi i64 [ 0, %.lr.ph88.preheader.new ], [ %niter.next.3, %.lr.ph88 ]
  %72 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv104
  %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.next105 = or disjoint i64 %indvars.iv104, 1
  %78 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next105
  %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.next105.1 = or disjoint i64 %indvars.iv104, 2
  %84 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next105.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.next105.2 = or disjoint i64 %indvars.iv104, 3
  %90 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next105.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.next105.3 = add nuw nsw i64 %indvars.iv104, 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_edge89.loopexit.unr-lcssa, label %.lr.ph88, !llvm.loop !21

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

99:                                               ; preds = %96, %._crit_edge89
  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.9, double noundef %137)
  br label %139

139:                                              ; preds = %136, %99
  %140 = call double @get_time() #7
  %141 = load ptr, ptr %1, align 8
  %142 = getelementptr inbounds i8, ptr %1, i64 8
  %143 = load ptr, ptr %142, align 8
  %144 = getelementptr inbounds i8, ptr %1, i64 24
  %145 = load ptr, ptr %144, align 8
  %146 = getelementptr inbounds i8, ptr %1, i64 32
  %147 = load ptr, ptr %146, align 8
  %148 = getelementptr inbounds i8, ptr %1, i64 40
  %149 = load ptr, ptr %148, align 8
  %150 = getelementptr inbounds i8, ptr %0, i64 8
  %151 = load i64, ptr %150, align 8
  %152 = getelementptr inbounds i8, ptr %0, i64 16
  %153 = load i64, 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 76
  %161 = load i32, ptr %160, align 4
  %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_edge98
  %indvars.iv124 = phi i64 [ 0, %139 ], [ %indvars.iv.next125, %._crit_edge98 ]
  %.079101 = phi i64 [ 0, %139 ], [ %.180.lcssa, %._crit_edge98 ]
  %.082100 = phi i32 [ 0, %139 ], [ %168, %._crit_edge98 ]
  %166 = getelementptr inbounds [12 x i32], ptr %5, i64 0, i64 %indvars.iv124
  %167 = load i32, ptr %166, align 4, !tbaa !15
  %168 = add nsw i32 %167, %.082100
  %169 = icmp sgt i32 %167, 0
  br i1 %169, label %.lr.ph97.preheader, label %._crit_edge98

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

.lr.ph97:                                         ; preds = %.lr.ph97.preheader, %.lr.ph97
  %indvars.iv121 = phi i64 [ %170, %.lr.ph97.preheader ], [ %indvars.iv.next122, %.lr.ph97 ]
  %.18095 = phi i64 [ %.079101, %.lr.ph97.preheader ], [ %190, %.lr.ph97 ]
  %172 = getelementptr inbounds double, ptr %15, i64 %indvars.iv121
  %173 = load double, ptr %172, align 8, !tbaa !13
  %174 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv121
  %175 = load i32, ptr %174, 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 %173, i32 noundef %175, i64 noundef %151, i64 noundef %153, ptr noundef %141, ptr noundef %143, ptr noundef %145, ptr noundef %147, ptr noundef %149, ptr noundef %155, ptr noundef nonnull %6, i32 noundef %157, i32 noundef %159, i32 noundef %161)
  %176 = load double, ptr %6, align 16, !tbaa !13
  %177 = fcmp ogt double %176, -1.000000e+00
  %.173 = select i1 %177, double %176, double -1.000000e+00
  %178 = load double, ptr %162, align 8, !tbaa !13
  %179 = fcmp ogt double %178, %.173
  %.173.1 = select i1 %179, double %178, double %.173
  %180 = load double, ptr %163, align 16, !tbaa !13
  %181 = fcmp ogt double %180, %.173.1
  %.173.2 = select i1 %181, double %180, double %.173.1
  %182 = load double, ptr %164, align 8, !tbaa !13
  %183 = fcmp ogt double %182, %.173.2
  %.173.3 = select i1 %183, double %182, double %.173.2
  %184 = select i1 %179, i64 2, i64 1
  %185 = load double, ptr %165, align 16, !tbaa !13
  %186 = fcmp ogt double %185, %.173.3
  %187 = select i1 %181, i64 3, i64 %184
  %188 = select i1 %183, i64 4, i64 %187
  %189 = select i1 %186, i64 5, i64 %188
  %190 = add i64 %.18095, %189
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  %indvars.iv.next122 = add nsw i64 %indvars.iv121, 1
  %191 = icmp slt i64 %indvars.iv.next122, %171
  br i1 %191, label %.lr.ph97, label %._crit_edge98, !llvm.loop !22

._crit_edge98:                                    ; preds = %.lr.ph97, %.preheader
  %.180.lcssa = phi i64 [ %.079101, %.preheader ], [ %190, %.lr.ph97 ]
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next125, 12
  br i1 %exitcond127.not, label %192, label %.preheader, !llvm.loop !23

192:                                              ; preds = %._crit_edge98
  %193 = call double @get_time() #7
  br i1 %7, label %194, label %197

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

197:                                              ; preds = %194, %192
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #7
  ret i64 %.180.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

declare double @get_time() local_unnamed_addr #5

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind 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