; 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.85 = external hidden unnamed_addr constant [39 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

; 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 i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [5 x double], align 16
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  store i32 %2, ptr %4, align 4, !tbaa !5
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %3
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.85)
  br label %22

22:                                               ; preds = %20, %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
  br label %23

23:                                               ; preds = %131, %22
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 7
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %134

29:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 1070, ptr %8, align 8, !tbaa !15
  %30 = load i64, ptr %8, align 8, !tbaa !15
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %33 = load i32, ptr %32, align 8, !tbaa !16
  %34 = mul nsw i32 %31, %33
  %35 = mul nsw i32 %34, 2
  %36 = mul nsw i32 %35, 5
  %37 = sext i32 %36 to i64
  %38 = call i64 @fast_forward_LCG(i64 noundef %30, i64 noundef %37)
  store i64 %38, ptr %8, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %39 = call double @LCG_random_double(ptr noundef %8)
  store double %39, ptr %9, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %40 = call i32 @pick_mat(ptr noundef %8)
  store i32 %40, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %127, %29
  %42 = load i32, ptr %11, align 4, !tbaa !5
  %43 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 3
  %44 = load i32, ptr %43, align 8, !tbaa !16
  %45 = icmp slt i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %130

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #4
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 40, i1 false)
  %48 = load double, ptr %9, align 8, !tbaa !17
  %49 = load i32, ptr %10, align 4, !tbaa !5
  %50 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 1
  %51 = load i64, ptr %50, align 8, !tbaa !19
  %52 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 2
  %53 = load i64, ptr %52, align 8, !tbaa !20
  %54 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  %56 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !23
  %58 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !24
  %60 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 4
  %61 = load ptr, ptr %60, align 8, !tbaa !25
  %62 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 5
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  %64 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !27
  %66 = getelementptr inbounds [5 x double], ptr %12, i64 0, i64 0
  %67 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 5
  %68 = load i32, ptr %67, align 8, !tbaa !28
  %69 = getelementptr inbounds %struct.Inputs, ptr %0, i32 0, i32 6
  %70 = load i32, ptr %69, align 4, !tbaa !29
  %71 = getelementptr inbounds %struct.SimulationData, ptr %1, i32 0, i32 12
  %72 = load i32, ptr %71, align 8, !tbaa !30
  call void @calculate_macro_xs(double noundef %48, i32 noundef %49, i64 noundef %51, i64 noundef %53, ptr noundef %55, ptr noundef %57, ptr noundef %59, ptr noundef %61, ptr noundef %63, ptr noundef %65, ptr noundef %66, i32 noundef %68, i32 noundef %70, i32 noundef %72)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store double -1.000000e+00, ptr %13, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, 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 %73

73:                                               ; preds = %91, %47
  %74 = load i32, ptr %15, align 4, !tbaa !5
  %75 = icmp slt i32 %74, 5
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %94

77:                                               ; preds = %73
  %78 = load i32, ptr %15, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [5 x double], ptr %12, i64 0, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !17
  %82 = load double, ptr %13, align 8, !tbaa !17
  %83 = fcmp ogt double %81, %82
  br i1 %83, label %84, label %90

84:                                               ; preds = %77
  %85 = load i32, ptr %15, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [5 x double], ptr %12, i64 0, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !17
  store double %88, ptr %13, align 8, !tbaa !17
  %89 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %89, ptr %14, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %84, %77
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %15, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %15, align 4, !tbaa !5
  br label %73, !llvm.loop !31

94:                                               ; preds = %76
  %95 = load i32, ptr %14, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = load i64, ptr %5, align 8, !tbaa !9
  %99 = add i64 %98, %97
  store i64 %99, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i64 0, ptr %16, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %114, %94
  %101 = load i32, ptr %17, align 4, !tbaa !5
  %102 = icmp slt i32 %101, 5
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %117

104:                                              ; preds = %100
  %105 = load i32, ptr %17, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [5 x double], ptr %12, i64 0, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !17
  %109 = fcmp ogt double %108, 1.000000e+00
  br i1 %109, label %110, label %113

110:                                              ; preds = %104
  %111 = load i64, ptr %16, align 8, !tbaa !15
  %112 = add i64 %111, 1
  store i64 %112, ptr %16, align 8, !tbaa !15
  br label %113

113:                                              ; preds = %110, %104
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %17, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %17, align 4, !tbaa !5
  br label %100, !llvm.loop !33

117:                                              ; preds = %103
  %118 = load i64, ptr %16, align 8, !tbaa !15
  %119 = icmp ugt i64 %118, 0
  br i1 %119, label %120, label %124

120:                                              ; preds = %117
  %121 = load i64, ptr %8, align 8, !tbaa !15
  %122 = load i64, ptr %16, align 8, !tbaa !15
  %123 = call i64 @fast_forward_LCG(i64 noundef %121, i64 noundef %122)
  store i64 %123, ptr %8, align 8, !tbaa !15
  br label %124

124:                                              ; preds = %120, %117
  %125 = call double @LCG_random_double(ptr noundef %8)
  store double %125, ptr %9, align 8, !tbaa !17
  %126 = call i32 @pick_mat(ptr noundef %8)
  store i32 %126, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  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 40, ptr %12) #4
  br label %127

127:                                              ; preds = %124
  %128 = load i32, ptr %11, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %11, align 4, !tbaa !5
  br label %41, !llvm.loop !34

130:                                              ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %6, align 4, !tbaa !5
  br label %23, !llvm.loop !35

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

; 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

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


; 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.85 = external hidden unnamed_addr constant [39 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

; 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.85)
  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.ph47, label %._crit_edge48

.lr.ph47:                                         ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load i32, ptr %13, align 8, !tbaa !12
  %.fr50 = freeze i32 %14
  %factor.op.mul = mul i32 %.fr50, 10
  %15 = icmp sgt i32 %.fr50, 0
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load i64, ptr %18, align 8
  %20 = load ptr, ptr %1, align 8
  %21 = getelementptr inbounds i8, ptr %1, i64 8
  %22 = load ptr, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr %1, i64 24
  %24 = load ptr, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr %1, i64 32
  %26 = load ptr, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr %1, i64 40
  %28 = load ptr, 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 72
  %36 = load i32, ptr %35, align 8
  %wide.trip.count65 = zext nneg i32 %11 to i64
  br i1 %15, label %.lr.ph.us.preheader, label %.lr.ph47.split

.lr.ph.us.preheader:                              ; preds = %.lr.ph47
  %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.iv62 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next63, %._crit_edge.us ]
  %.03244.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 !13
  %38 = trunc nuw nsw i64 %indvars.iv62 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 !13
  %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
  %.02843.us = phi i32 [ 0, %.lr.ph.us ], [ %72, %69 ]
  %.02942.us = phi i32 [ %42, %.lr.ph.us ], [ %71, %69 ]
  %.03041.us = phi double [ %41, %.lr.ph.us ], [ %70, %69 ]
  %.13340.us = phi i64 [ %.03244.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 %.03041.us, i32 noundef %.02942.us, i64 noundef %17, i64 noundef %19, ptr noundef %20, ptr noundef %22, ptr noundef %24, ptr noundef %26, ptr noundef %28, ptr noundef %30, ptr noundef nonnull %5, i32 noundef %32, i32 noundef %34, i32 noundef %36)
  %44 = load double, ptr %37, align 16, !tbaa !14
  %45 = load <4 x double>, ptr %5, align 16, !tbaa !14
  %46 = extractelement <4 x double> %45, i64 0
  %47 = fcmp ogt double %46, -1.000000e+00
  %.127.us = select i1 %47, double %46, double -1.000000e+00
  %48 = extractelement <4 x double> %45, i64 1
  %49 = fcmp ogt double %48, %.127.us
  %.127.us.1 = select i1 %49, double %48, double %.127.us
  %50 = extractelement <4 x double> %45, i64 2
  %51 = fcmp ogt double %50, %.127.us.1
  %.127.us.2 = select i1 %51, double %50, double %.127.us.1
  %52 = extractelement <4 x double> %45, i64 3
  %53 = fcmp ogt double %52, %.127.us.2
  %.127.us.3 = select i1 %53, double %52, double %.127.us.2
  %54 = select i1 %49, i64 2, i64 1
  %55 = fcmp ogt double %44, %.127.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 %.13340.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 !13
  %68 = call i64 @fast_forward_LCG(i64 noundef %67, i64 noundef %op.rdx)
  store i64 %68, ptr %4, align 8, !tbaa !13
  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 %.02843.us, 1
  %exitcond61.not = icmp eq i32 %72, %.fr50
  br i1 %exitcond61.not, label %._crit_edge.us, label %43, !llvm.loop !16

._crit_edge.us:                                   ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65
  br i1 %exitcond66.not, label %._crit_edge48, label %.lr.ph.us, !llvm.loop !18

._crit_edge48:                                    ; preds = %.lr.ph47.split, %._crit_edge.us, %9
  %.032.lcssa = phi i64 [ 0, %9 ], [ %65, %._crit_edge.us ], [ 0, %.lr.ph47.split ]
  ret i64 %.032.lcssa

.lr.ph47.split:                                   ; preds = %.lr.ph47, %.lr.ph47.split
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph47.split ], [ 0, %.lr.ph47 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 1070, ptr %4, align 8, !tbaa !13
  %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 !13
  %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.count65
  br i1 %exitcond.not, label %._crit_edge48, label %.lr.ph47.split, !llvm.loop !18
}

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i4 @llvm.ctpop.i4(i4) #4

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 = { 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 = !{!6, !7, i64 24}
!13 = !{!10, !10, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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