; 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.1 = external hidden unnamed_addr constant [39 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
define dso_local i64 @run_history_based_simulation(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 i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca [5 x double], align 16
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  store i32 %2, ptr %4, align 4, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %3
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %27

27:                                               ; preds = %25, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %140, %27
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 7
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = icmp slt i32 %29, %31
  br i1 %32, label %33, label %143

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %34 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  store ptr %35, ptr %7, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %36 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !18
  store ptr %37, ptr %8, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %38 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !19
  store ptr %39, ptr %9, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %40 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 4
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  store ptr %41, ptr %10, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %42 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 5
  %43 = load ptr, ptr %42, align 8, !tbaa !21
  store ptr %43, ptr %11, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 1070, ptr %12, align 8, !tbaa !22
  %44 = load i64, ptr %12, align 8, !tbaa !22
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %47 = load i32, ptr %46, align 8, !tbaa !23
  %48 = mul nsw i32 %45, %47
  %49 = mul nsw i32 %48, 2
  %50 = mul nsw i32 %49, 5
  %51 = sext i32 %50 to i64
  %52 = call i64 @fast_forward_LCG(i64 noundef %44, i64 noundef %51)
  store i64 %52, ptr %12, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %53 = call double @LCG_random_double(ptr noundef %12)
  store double %53, ptr %13, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %54 = call i32 @pick_mat(ptr noundef %12)
  store i32 %54, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %136, %33
  %56 = load i32, ptr %15, align 4, !tbaa !5
  %57 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %58 = load i32, ptr %57, align 8, !tbaa !23
  %59 = icmp slt i32 %56, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %139

61:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 40, ptr %17) #4
  call void @llvm.memset.p0.i64(ptr align 16 %17, i8 0, i64 40, i1 false)
  %62 = load double, ptr %13, align 8, !tbaa !24
  %63 = load i32, ptr %14, align 4, !tbaa !5
  %64 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 1
  %65 = load i64, ptr %64, align 8, !tbaa !26
  %66 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 2
  %67 = load i64, ptr %66, align 8, !tbaa !27
  %68 = load ptr, ptr %7, align 8, !tbaa !17
  %69 = load ptr, ptr %8, align 8, !tbaa !17
  %70 = load ptr, ptr %9, align 8, !tbaa !17
  %71 = load ptr, ptr %10, align 8, !tbaa !17
  %72 = load ptr, ptr %11, align 8, !tbaa !17
  %73 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !28
  %75 = getelementptr inbounds [5 x double], ptr %17, i64 0, i64 0
  %76 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 5
  %77 = load i32, ptr %76, align 8, !tbaa !29
  %78 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 6
  %79 = load i32, ptr %78, align 4, !tbaa !30
  %80 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 12
  %81 = load i32, ptr %80, align 4, !tbaa !31
  call void @calculate_macro_xs(double noundef %62, i32 noundef %63, i64 noundef %65, i64 noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef %70, ptr noundef %71, ptr noundef %72, ptr noundef %74, ptr noundef %75, i32 noundef %77, i32 noundef %79, i32 noundef %81)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store double -1.000000e+00, ptr %18, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %100, %61
  %83 = load i32, ptr %20, align 4, !tbaa !5
  %84 = icmp slt i32 %83, 5
  br i1 %84, label %86, label %85

85:                                               ; preds = %82
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %103

86:                                               ; preds = %82
  %87 = load i32, ptr %20, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [5 x double], ptr %17, i64 0, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !24
  %91 = load double, ptr %18, align 8, !tbaa !24
  %92 = fcmp ogt double %90, %91
  br i1 %92, label %93, label %99

93:                                               ; preds = %86
  %94 = load i32, ptr %20, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [5 x double], ptr %17, i64 0, i64 %95
  %97 = load double, ptr %96, align 8, !tbaa !24
  store double %97, ptr %18, align 8, !tbaa !24
  %98 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %98, ptr %19, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %93, %86
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %20, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %20, align 4, !tbaa !5
  br label %82, !llvm.loop !32

103:                                              ; preds = %85
  %104 = load i32, ptr %19, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = load i64, ptr %5, align 8, !tbaa !9
  %108 = add i64 %107, %106
  store i64 %108, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store i64 0, ptr %21, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %123, %103
  %110 = load i32, ptr %22, align 4, !tbaa !5
  %111 = icmp slt i32 %110, 5
  br i1 %111, label %113, label %112

112:                                              ; preds = %109
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %126

113:                                              ; preds = %109
  %114 = load i32, ptr %22, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [5 x double], ptr %17, i64 0, i64 %115
  %117 = load double, ptr %116, align 8, !tbaa !24
  %118 = fcmp ogt double %117, 1.000000e+00
  br i1 %118, label %119, label %122

119:                                              ; preds = %113
  %120 = load i64, ptr %21, align 8, !tbaa !22
  %121 = add i64 %120, 1
  store i64 %121, ptr %21, align 8, !tbaa !22
  br label %122

122:                                              ; preds = %119, %113
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %22, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %22, align 4, !tbaa !5
  br label %109, !llvm.loop !34

126:                                              ; preds = %112
  %127 = load i64, ptr %21, align 8, !tbaa !22
  %128 = icmp ugt i64 %127, 0
  br i1 %128, label %129, label %133

129:                                              ; preds = %126
  %130 = load i64, ptr %12, align 8, !tbaa !22
  %131 = load i64, ptr %21, align 8, !tbaa !22
  %132 = call i64 @fast_forward_LCG(i64 noundef %130, i64 noundef %131)
  store i64 %132, ptr %12, align 8, !tbaa !22
  br label %133

133:                                              ; preds = %129, %126
  %134 = call double @LCG_random_double(ptr noundef %12)
  store double %134, ptr %13, align 8, !tbaa !24
  %135 = call i32 @pick_mat(ptr noundef %12)
  store i32 %135, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #4
  br label %136

136:                                              ; preds = %133
  %137 = load i32, ptr %15, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %15, align 4, !tbaa !5
  br label %55, !llvm.loop !35

139:                                              ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %6, align 4, !tbaa !5
  br label %28, !llvm.loop !36

143:                                              ; preds = %28
  %144 = load i64, ptr %5, align 8, !tbaa !9
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret i64 %144
}

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 }

!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 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 48}
!12 = !{!"", !6, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !14, i64 32, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60}
!13 = !{!"long", !7, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !14, i64 0}
!16 = !{!"", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !13, i64 64, !6, i64 72, !6, i64 76, !14, i64 80, !6, i64 88, !14, i64 96, !6, i64 104}
!17 = !{!14, !14, i64 0}
!18 = !{!16, !14, i64 8}
!19 = !{!16, !14, i64 24}
!20 = !{!16, !14, i64 32}
!21 = !{!16, !14, i64 40}
!22 = !{!13, !13, i64 0}
!23 = !{!12, !6, i64 24}
!24 = !{!25, !25, i64 0}
!25 = !{!"double", !7, i64 0}
!26 = !{!12, !13, i64 8}
!27 = !{!12, !13, i64 16}
!28 = !{!16, !14, i64 16}
!29 = !{!12, !6, i64 40}
!30 = !{!12, !6, i64 44}
!31 = !{!16, !6, i64 76}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}
!35 = distinct !{!35, !33}
!36 = distinct !{!36, !33}


; 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.1 = external hidden unnamed_addr constant [39 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
define dso_local i64 @run_history_based_simulation(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 [5 x double], align 16
  %6 = icmp eq i32 %2, 0
  br i1 %6, label %7, label %9

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

9:                                                ; preds = %7, %3
  %10 = getelementptr inbounds i8, ptr %0, i64 48
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph52, label %._crit_edge53

.lr.ph52:                                         ; preds = %9
  %13 = load ptr, ptr %1, align 8, !tbaa !12
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %1, i64 24
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %1, i64 32
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds i8, ptr %1, i64 40
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %0, i64 24
  %23 = load i32, ptr %22, align 8, !tbaa !18
  %.fr55 = freeze i32 %23
  %factor.op.mul = mul i32 %.fr55, 10
  %24 = icmp sgt i32 %.fr55, 0
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = load i64, ptr %27, align 8
  %29 = getelementptr inbounds i8, ptr %1, i64 16
  %30 = load ptr, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr %0, i64 40
  %32 = load i32, ptr %31, align 8
  %33 = getelementptr inbounds i8, ptr %0, i64 44
  %34 = load i32, ptr %33, align 4
  %35 = getelementptr inbounds i8, ptr %1, i64 76
  %36 = load i32, ptr %35, align 4
  %wide.trip.count70 = zext nneg i32 %11 to i64
  br i1 %24, label %.lr.ph.us.preheader, label %.lr.ph52.split

.lr.ph.us.preheader:                              ; preds = %.lr.ph52
  %37 = getelementptr inbounds i8, ptr %5, i64 32
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %indvars.iv67 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next68, %._crit_edge.us ]
  %.03650.us = phi i64 [ 0, %.lr.ph.us.preheader ], [ %65, %._crit_edge.us ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 1070, ptr %4, align 8, !tbaa !19
  %38 = trunc nuw nsw i64 %indvars.iv67 to i32
  %.reass.us = mul i32 %factor.op.mul, %38
  %39 = sext i32 %.reass.us to i64
  %40 = call i64 @fast_forward_LCG(i64 noundef 1070, i64 noundef %39)
  store i64 %40, ptr %4, align 8, !tbaa !19
  %41 = call double @LCG_random_double(ptr noundef nonnull %4)
  %42 = call i32 @pick_mat(ptr noundef nonnull %4)
  br label %43

43:                                               ; preds = %.lr.ph.us, %69
  %.03348.us = phi i32 [ 0, %.lr.ph.us ], [ %72, %69 ]
  %.03447.us = phi i32 [ %42, %.lr.ph.us ], [ %71, %69 ]
  %.03546.us = phi double [ %41, %.lr.ph.us ], [ %70, %69 ]
  %.13745.us = phi i64 [ %.03650.us, %.lr.ph.us ], [ %65, %69 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %5, i8 0, i64 40, i1 false)
  call void @calculate_macro_xs(double noundef %.03546.us, i32 noundef %.03447.us, i64 noundef %26, i64 noundef %28, ptr noundef %13, ptr noundef %15, ptr noundef %17, ptr noundef %19, ptr noundef %21, ptr noundef %30, ptr noundef nonnull %5, i32 noundef %32, i32 noundef %34, i32 noundef %36)
  %44 = load double, ptr %37, align 16, !tbaa !20
  %45 = load <4 x double>, ptr %5, align 16, !tbaa !20
  %46 = extractelement <4 x double> %45, i64 0
  %47 = fcmp ogt double %46, -1.000000e+00
  %.132.us = select i1 %47, double %46, double -1.000000e+00
  %48 = extractelement <4 x double> %45, i64 1
  %49 = fcmp ogt double %48, %.132.us
  %.132.us.1 = select i1 %49, double %48, double %.132.us
  %50 = extractelement <4 x double> %45, i64 2
  %51 = fcmp ogt double %50, %.132.us.1
  %.132.us.2 = select i1 %51, double %50, double %.132.us.1
  %52 = extractelement <4 x double> %45, i64 3
  %53 = fcmp ogt double %52, %.132.us.2
  %.132.us.3 = select i1 %53, double %52, double %.132.us.2
  %54 = select i1 %49, i64 2, i64 1
  %55 = fcmp ogt double %44, %.132.us.3
  %56 = select i1 %51, i64 3, i64 %54
  %57 = select i1 %53, i64 4, i64 %56
  %58 = select i1 %55, i64 5, i64 %57
  %59 = fcmp ogt <4 x double> %45, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
  %60 = fcmp ogt double %44, 1.000000e+00
  %61 = zext i1 %60 to i64
  %62 = bitcast <4 x i1> %59 to i4
  %63 = call range(i4 0, 5) i4 @llvm.ctpop.i4(i4 %62)
  %64 = zext nneg i4 %63 to i64
  %op.rdx = add nuw nsw i64 %64, %61
  %65 = add i64 %.13745.us, %58
  %.not.us = icmp eq i64 %op.rdx, 0
  br i1 %.not.us, label %69, label %66

66:                                               ; preds = %43
  %67 = load i64, ptr %4, align 8, !tbaa !19
  %68 = call i64 @fast_forward_LCG(i64 noundef %67, i64 noundef %op.rdx)
  store i64 %68, ptr %4, align 8, !tbaa !19
  br label %69

69:                                               ; preds = %66, %43
  %70 = call double @LCG_random_double(ptr noundef nonnull %4)
  %71 = call i32 @pick_mat(ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #5
  %72 = add nuw nsw i32 %.03348.us, 1
  %exitcond66.not = icmp eq i32 %72, %.fr55
  br i1 %exitcond66.not, label %._crit_edge.us, label %43, !llvm.loop !22

._crit_edge.us:                                   ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70
  br i1 %exitcond71.not, label %._crit_edge53, label %.lr.ph.us, !llvm.loop !24

.lr.ph52.split:                                   ; preds = %.lr.ph52, %.lr.ph52.split
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph52.split ], [ 0, %.lr.ph52 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 1070, ptr %4, align 8, !tbaa !19
  %73 = trunc nuw nsw i64 %indvars.iv to i32
  %.reass = mul i32 %factor.op.mul, %73
  %74 = sext i32 %.reass to i64
  %75 = call i64 @fast_forward_LCG(i64 noundef 1070, i64 noundef %74)
  store i64 %75, ptr %4, align 8, !tbaa !19
  %76 = call double @LCG_random_double(ptr noundef nonnull %4)
  %77 = call i32 @pick_mat(ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count70
  br i1 %exitcond.not, label %._crit_edge53, label %.lr.ph52.split, !llvm.loop !24

._crit_edge53:                                    ; preds = %.lr.ph52.split, %._crit_edge.us, %9
  %.036.lcssa = phi i64 [ 0, %9 ], [ %65, %._crit_edge.us ], [ 0, %.lr.ph52.split ]
  ret i64 %.036.lcssa
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i4 @llvm.ctpop.i4(i4) #4

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 48}
!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 = !{!13, !11, i64 0}
!13 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !10, i64 64, !7, i64 72, !7, i64 76, !11, i64 80, !7, i64 88, !11, i64 96, !7, i64 104}
!14 = !{!13, !11, i64 8}
!15 = !{!13, !11, i64 24}
!16 = !{!13, !11, i64 32}
!17 = !{!13, !11, i64 40}
!18 = !{!6, !7, i64 24}
!19 = !{!10, !10, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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