; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2020-21/Dec/Plat/space.ll (Z8genWays1St4pairIiiE)

; 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.mint = type { i32 }
%"struct.std::pair" = type { i32, i32 }

@dp = external dso_local global [100 x [100 x [100 x %struct.mint]]], align 16
@ways = external dso_local global [2 x [100 x [100 x %struct.mint]]], align 16
@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4

; 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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Zml4mintILi1000000007ELi5EERKS0_(i32, ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8genWays1St4pairIiiE(i64 %0) #2 {
  %2 = alloca %"struct.std::pair", align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.mint, align 4
  %8 = alloca %struct.mint, align 4
  store i64 %0, ptr %2, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %9 = getelementptr inbounds %"struct.std::pair", ptr %2, i32 0, i32 0
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = add nsw i32 %10, 1
  store i32 %11, ptr %3, align 4, !tbaa !10
  br label %12

12:                                               ; preds = %104, %1
  %13 = load i32, ptr %3, align 4, !tbaa !10
  %14 = load i32, ptr @K, align 4, !tbaa !10
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %107

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

18:                                               ; preds = %100, %17
  %19 = load i32, ptr %5, align 4, !tbaa !10
  %20 = load i32, ptr @N, align 4, !tbaa !10
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %103

23:                                               ; preds = %18
  %24 = load i32, ptr %3, align 4, !tbaa !10
  %25 = getelementptr inbounds %"struct.std::pair", ptr %2, i32 0, i32 0
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  %28 = icmp eq i32 %24, %27
  br i1 %28, label %29, label %47

29:                                               ; preds = %23
  %30 = load i32, ptr %3, align 4, !tbaa !10
  %31 = sub nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %32
  %34 = load i32, ptr %5, align 4, !tbaa !10
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr %33, i64 0, i64 %35
  %37 = getelementptr inbounds %"struct.std::pair", ptr %2, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100 x %struct.mint], ptr %36, i64 0, i64 %39
  %41 = load i32, ptr %3, align 4, !tbaa !10
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds ([2 x [100 x [100 x %struct.mint]]], ptr @ways, i64 0, i64 1), i64 0, i64 %42
  %44 = load i32, ptr %5, align 4, !tbaa !10
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100 x %struct.mint], ptr %43, i64 0, i64 %45
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 4 %40, i64 4, i1 false), !tbaa.struct !12
  br label %99

47:                                               ; preds = %23
  %48 = load i32, ptr %3, align 4, !tbaa !10
  %49 = sub nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds ([2 x [100 x [100 x %struct.mint]]], ptr @ways, i64 0, i64 1), i64 0, i64 %50
  %52 = load i32, ptr %5, align 4, !tbaa !10
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100 x %struct.mint], ptr %51, i64 0, i64 %53
  %55 = load i32, ptr %3, align 4, !tbaa !10
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds ([2 x [100 x [100 x %struct.mint]]], ptr @ways, i64 0, i64 1), i64 0, i64 %56
  %58 = load i32, ptr %5, align 4, !tbaa !10
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100 x %struct.mint], ptr %57, i64 0, i64 %59
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %60, ptr align 4 %54, i64 4, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !10
  br label %61

61:                                               ; preds = %95, %47
  %62 = load i32, ptr %6, align 4, !tbaa !10
  %63 = load i32, ptr @N, align 4, !tbaa !10
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %98

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %67 = load i32, ptr %3, align 4, !tbaa !10
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %69
  %71 = load i32, ptr %5, align 4, !tbaa !10
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %6, align 4, !tbaa !10
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100 x %struct.mint], ptr %73, i64 0, i64 %75
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %76, i64 4, i1 false), !tbaa.struct !12
  %77 = load i32, ptr %3, align 4, !tbaa !10
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds ([2 x [100 x [100 x %struct.mint]]], ptr @ways, i64 0, i64 1), i64 0, i64 %79
  %81 = load i32, ptr %6, align 4, !tbaa !10
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100 x %struct.mint], ptr %80, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.mint, ptr %8, i32 0, i32 0
  %85 = load i32, ptr %84, align 4
  %86 = call i32 @_Zml4mintILi1000000007ELi5EERKS0_(i32 %85, ptr noundef nonnull align 4 dereferenceable(4) %83)
  %87 = getelementptr inbounds %struct.mint, ptr %7, i32 0, i32 0
  store i32 %86, ptr %87, align 4
  %88 = load i32, ptr %3, align 4, !tbaa !10
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds ([2 x [100 x [100 x %struct.mint]]], ptr @ways, i64 0, i64 1), i64 0, i64 %89
  %91 = load i32, ptr %5, align 4, !tbaa !10
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100 x %struct.mint], ptr %90, i64 0, i64 %92
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %93, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %95

95:                                               ; preds = %66
  %96 = load i32, ptr %6, align 4, !tbaa !10
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %6, align 4, !tbaa !10
  br label %61, !llvm.loop !13

98:                                               ; preds = %65
  br label %99

99:                                               ; preds = %98, %29
  br label %100

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

103:                                              ; preds = %22
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %3, align 4, !tbaa !10
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %3, align 4, !tbaa !10
  br label %12, !llvm.loop !16

107:                                              ; preds = %16
  ret void
}

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

!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 0}
!6 = !{!"_ZTSSt4pairIiiE", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{i64 0, i64 4, !10}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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.mint = type { i32 }

@dp = external dso_local local_unnamed_addr global [100 x [100 x [100 x %struct.mint]]], align 16
@ways = external dso_local global [2 x [100 x [100 x %struct.mint]]], align 16
@N = external dso_local local_unnamed_addr global i32, align 4
@K = external dso_local local_unnamed_addr global i32, align 4

; 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: mustprogress uwtable
declare dso_local i32 @_Zml4mintILi1000000007ELi5EERKS0_(i32, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8genWays1St4pairIiiE(i64 %0) local_unnamed_addr #1 {
  %2 = alloca %struct.mint, align 4
  %.sroa.022.0.extract.trunc = trunc i64 %0 to i32
  %3 = add nsw i32 %.sroa.022.0.extract.trunc, 1
  %4 = load i32, ptr @K, align 4, !tbaa !5
  %5 = icmp slt i32 %3, %4
  br i1 %5, label %.preheader.lr.ph, label %._crit_edge31

.preheader.lr.ph:                                 ; preds = %1
  %6 = ashr i64 %0, 32
  %7 = load i32, ptr @N, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader.preheader, label %._crit_edge31

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %sext53 = shl i64 %0, 32
  %9 = ashr exact i64 %sext53, 32
  %10 = add nsw i64 %9, 1
  %sext = sext i32 %3 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %11 = phi i32 [ %4, %.preheader.preheader ], [ %56, %._crit_edge ]
  %12 = phi i32 [ %7, %.preheader.preheader ], [ %57, %._crit_edge ]
  %13 = phi i32 [ %7, %.preheader.preheader ], [ %58, %._crit_edge ]
  %14 = phi i32 [ %7, %.preheader.preheader ], [ %59, %._crit_edge ]
  %15 = phi i32 [ %7, %.preheader.preheader ], [ %60, %._crit_edge ]
  %indvars.iv49 = phi i64 [ %10, %.preheader.preheader ], [ %indvars.iv.next50, %._crit_edge ]
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph28, label %._crit_edge

.lr.ph28:                                         ; preds = %.preheader
  %17 = icmp eq i64 %indvars.iv49, %sext
  %18 = add nsw i64 %indvars.iv49, -1
  br i1 %17, label %.lr.ph28.split.us, label %.lr.ph28.split.split

.lr.ph28.split.us:                                ; preds = %.lr.ph28
  %smax46 = call i32 @llvm.smax.i32(i32 %12, i32 1)
  %wide.trip.count47 = zext nneg i32 %smax46 to i64
  %min.iters.check = icmp slt i32 %12, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph28.split.us
  %n.vec = and i64 %wide.trip.count47, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %19 = or disjoint i64 %index, 1
  %20 = or disjoint i64 %index, 2
  %21 = or disjoint i64 %index, 3
  %22 = or disjoint i64 %index, 4
  %23 = or disjoint i64 %index, 5
  %24 = or disjoint i64 %index, 6
  %25 = or disjoint i64 %index, 7
  %26 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %index, i64 %6
  %27 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %19, i64 %6
  %28 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %20, i64 %6
  %29 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %21, i64 %6
  %30 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %22, i64 %6
  %31 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %23, i64 %6
  %32 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %24, i64 %6
  %33 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %25, i64 %6
  %34 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds (i8, ptr @ways, i64 40000), i64 0, i64 %sext, i64 %index
  %35 = load i32, ptr %26, align 4, !tbaa !5
  %36 = load i32, ptr %27, align 4, !tbaa !5
  %37 = load i32, ptr %28, align 4, !tbaa !5
  %38 = load i32, ptr %29, align 4, !tbaa !5
  %39 = insertelement <4 x i32> poison, i32 %35, i64 0
  %40 = insertelement <4 x i32> %39, i32 %36, i64 1
  %41 = insertelement <4 x i32> %40, i32 %37, i64 2
  %42 = insertelement <4 x i32> %41, i32 %38, i64 3
  %43 = load i32, ptr %30, align 4, !tbaa !5
  %44 = load i32, ptr %31, align 4, !tbaa !5
  %45 = load i32, ptr %32, align 4, !tbaa !5
  %46 = load i32, ptr %33, align 4, !tbaa !5
  %47 = insertelement <4 x i32> poison, i32 %43, i64 0
  %48 = insertelement <4 x i32> %47, i32 %44, i64 1
  %49 = insertelement <4 x i32> %48, i32 %45, i64 2
  %50 = insertelement <4 x i32> %49, i32 %46, i64 3
  %51 = getelementptr inbounds i8, ptr %34, i64 16
  store <4 x i32> %42, ptr %34, align 16, !tbaa !5
  store <4 x i32> %50, ptr %51, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %52 = icmp eq i64 %index.next, %n.vec
  br i1 %52, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count47
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph28.split.us
  %indvars.iv43.ph = phi i64 [ 0, %.lr.ph28.split.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %scalar.ph ], [ %indvars.iv43.ph, %scalar.ph.preheader ]
  %53 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %indvars.iv43, i64 %6
  %54 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds (i8, ptr @ways, i64 40000), i64 0, i64 %sext, i64 %indvars.iv43
  %55 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %55, ptr %54, align 4, !tbaa !5
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond48.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count47
  br i1 %exitcond48.not, label %._crit_edge, label %scalar.ph, !llvm.loop !13

._crit_edge31:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %1
  ret void

._crit_edge.loopexit32:                           ; preds = %.loopexit
  %.pre = load i32, ptr @K, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %._crit_edge.loopexit32, %.preheader
  %56 = phi i32 [ %.pre, %._crit_edge.loopexit32 ], [ %11, %.preheader ], [ %11, %middle.block ], [ %11, %scalar.ph ]
  %57 = phi i32 [ %77, %._crit_edge.loopexit32 ], [ %12, %.preheader ], [ %12, %middle.block ], [ %12, %scalar.ph ]
  %58 = phi i32 [ %78, %._crit_edge.loopexit32 ], [ %13, %.preheader ], [ %12, %middle.block ], [ %12, %scalar.ph ]
  %59 = phi i32 [ %78, %._crit_edge.loopexit32 ], [ %14, %.preheader ], [ %12, %middle.block ], [ %12, %scalar.ph ]
  %60 = phi i32 [ %78, %._crit_edge.loopexit32 ], [ %15, %.preheader ], [ %12, %middle.block ], [ %12, %scalar.ph ]
  %indvars.iv.next50 = add nsw i64 %indvars.iv49, 1
  %61 = sext i32 %56 to i64
  %62 = icmp slt i64 %indvars.iv.next50, %61
  br i1 %62, label %.preheader, label %._crit_edge31, !llvm.loop !14

.lr.ph28.split.split:                             ; preds = %.lr.ph28, %.loopexit
  %63 = phi i32 [ %77, %.loopexit ], [ %12, %.lr.ph28 ]
  %64 = phi i32 [ %78, %.loopexit ], [ %13, %.lr.ph28 ]
  %65 = phi i32 [ %78, %.loopexit ], [ %14, %.lr.ph28 ]
  %indvars.iv40 = phi i64 [ %indvars.iv.next41, %.loopexit ], [ 0, %.lr.ph28 ]
  %66 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds (i8, ptr @ways, i64 40000), i64 0, i64 %18, i64 %indvars.iv40
  %67 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds (i8, ptr @ways, i64 40000), i64 0, i64 %indvars.iv49, i64 %indvars.iv40
  %68 = load i32, ptr %66, align 4, !tbaa !5
  store i32 %68, ptr %67, align 4, !tbaa !5
  %69 = icmp sgt i32 %65, 0
  br i1 %69, label %.lr.ph, label %.lr.ph28.split.split..loopexit_crit_edge

.lr.ph28.split.split..loopexit_crit_edge:         ; preds = %.lr.ph28.split.split
  %.pre52 = sext i32 %64 to i64
  br label %.loopexit

.lr.ph:                                           ; preds = %.lr.ph28.split.split, %.lr.ph
  %indvars.iv37 = phi i64 [ %indvars.iv.next38, %.lr.ph ], [ 0, %.lr.ph28.split.split ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %70 = getelementptr inbounds [100 x [100 x [100 x %struct.mint]]], ptr @dp, i64 0, i64 %18, i64 %indvars.iv40, i64 %indvars.iv37
  %.sroa.0.0.copyload = load i32, ptr %70, align 4, !tbaa !5
  %71 = getelementptr inbounds [100 x [100 x %struct.mint]], ptr getelementptr inbounds (i8, ptr @ways, i64 40000), i64 0, i64 %18, i64 %indvars.iv37
  %72 = call i32 @_Zml4mintILi1000000007ELi5EERKS0_(i32 %.sroa.0.0.copyload, ptr noundef nonnull align 4 dereferenceable(4) %71)
  store i32 %72, ptr %2, align 4
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4mintILi1000000007ELi5EEpLERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %67, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %74 = load i32, ptr @N, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next38, %75
  br i1 %76, label %.lr.ph, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph28.split.split..loopexit_crit_edge
  %.pre-phi = phi i64 [ %.pre52, %.lr.ph28.split.split..loopexit_crit_edge ], [ %75, %.lr.ph ]
  %77 = phi i32 [ %63, %.lr.ph28.split.split..loopexit_crit_edge ], [ %74, %.lr.ph ]
  %78 = phi i32 [ %64, %.lr.ph28.split.split..loopexit_crit_edge ], [ %74, %.lr.ph ]
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %79 = icmp slt i64 %indvars.iv.next41, %.pre-phi
  br i1 %79, label %.lr.ph28.split.split, label %._crit_edge.loopexit32, !llvm.loop !17
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 #2 = { mustprogress 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 nosync nounwind speculatable willreturn memory(none) }
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++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass