; LLVM IR from upupming/algorithm :: acwing/算法基础课/第五讲 动态规划/状态压缩DP/291. 蒙德里安的梦想 (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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@st = external dso_local global [4096 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@f = external dso_local global [12 x [4096 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %9

9:                                                ; preds = %126, %0
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %134

14:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %61, %14
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = shl i32 1, %17
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %64

21:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [4096 x i32], ptr @st, i64 0, i64 %23
  store i32 1, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %49, %21
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %52

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = ashr i32 %31, %32
  %34 = and i32 %33, 1
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %45

36:                                               ; preds = %30
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = and i32 %37, 1
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %44

40:                                               ; preds = %36
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [4096 x i32], ptr @st, i64 0, i64 %42
  store i32 0, ptr %43, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %40, %36
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %48

45:                                               ; preds = %30
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %4, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %45, %44
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %5, align 4, !tbaa !5
  br label %25, !llvm.loop !9

52:                                               ; preds = %29
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = and i32 %53, 1
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %60

56:                                               ; preds = %52
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [4096 x i32], ptr @st, i64 0, i64 %58
  store i32 0, ptr %59, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %56, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !11

64:                                               ; preds = %20
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 393216, i1 false)
  store i64 1, ptr @f, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %123, %64
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %126

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %119, %70
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = load i32, ptr @n, align 4, !tbaa !5
  %74 = shl i32 1, %73
  %75 = icmp slt i32 %72, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %71
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %122

77:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %115, %77
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = shl i32 1, %80
  %82 = icmp slt i32 %79, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %78
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %118

84:                                               ; preds = %78
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = and i32 %85, %86
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %114

89:                                               ; preds = %84
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = or i32 %90, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [4096 x i32], ptr @st, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %114

97:                                               ; preds = %89
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = sub nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [12 x [4096 x i64]], ptr @f, i64 0, i64 %100
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [4096 x i64], ptr %101, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !12
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [12 x [4096 x i64]], ptr @f, i64 0, i64 %107
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [4096 x i64], ptr %108, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !12
  %113 = add nsw i64 %112, %105
  store i64 %113, ptr %111, align 8, !tbaa !12
  br label %114

114:                                              ; preds = %97, %89, %84
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %8, align 4, !tbaa !5
  br label %78, !llvm.loop !14

118:                                              ; preds = %83
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %7, align 4, !tbaa !5
  br label %71, !llvm.loop !15

122:                                              ; preds = %76
  br label %123

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

126:                                              ; preds = %69
  %127 = load i32, ptr @m, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [12 x [4096 x i64]], ptr @f, i64 0, i64 %128
  %130 = getelementptr inbounds [4096 x i64], ptr %129, i64 0, i64 0
  %131 = load i64, ptr %130, align 16, !tbaa !12
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %131)
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %132, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %9, !llvm.loop !17

134:                                              ; preds = %9
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { mustprogress norecurse 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { inlinehint 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 #6 = { 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@st = external dso_local local_unnamed_addr global [4096 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [12 x [4096 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %3 = load i32, ptr @m, align 4, !tbaa !5
  %.not52 = icmp eq i32 %3, 0
  br i1 %.not52, label %._crit_edge53, label %.preheader38

.preheader38:                                     ; preds = %0, %._crit_edge
  %4 = phi i32 [ %66, %._crit_edge ], [ %3, %0 ]
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = shl nuw i32 1, %5
  %.not54 = icmp eq i32 %5, 31
  br i1 %.not54, label %._crit_edge43.thread, label %.lr.ph42

.lr.ph42:                                         ; preds = %.preheader38
  %7 = icmp sgt i32 %5, 0
  %smax63 = tail call i32 @llvm.smax.i32(i32 %6, i32 1)
  %wide.trip.count64 = zext nneg i32 %smax63 to i64
  br i1 %7, label %.lr.ph.us.preheader, label %.lr.ph42.split.preheader

.lr.ph.us.preheader:                              ; preds = %.lr.ph42
  %xtraiter = and i32 %5, 1
  %8 = icmp eq i32 %5, 1
  %unroll_iter = and i32 %5, 2147483646
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br label %.lr.ph.us

.lr.ph42.split.preheader:                         ; preds = %.lr.ph42
  %min.iters.check = icmp slt i32 %6, 8
  br i1 %min.iters.check, label %.lr.ph42.split, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph42.split.preheader
  %n.vec = and i64 %wide.trip.count64, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %9 = getelementptr inbounds [4096 x i32], ptr @st, i64 0, i64 %index
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %9, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %10, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %11 = icmp eq i64 %index.next, %n.vec
  br i1 %11, label %._crit_edge43, label %vector.body, !llvm.loop !9

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %15
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %15 ], [ 0, %.lr.ph.us.preheader ]
  %12 = getelementptr inbounds [4096 x i32], ptr @st, i64 0, i64 %indvars.iv60
  store i32 1, ptr %12, align 4, !tbaa !5
  %13 = trunc nuw nsw i64 %indvars.iv60 to i32
  br i1 %8, label %._crit_edge.us.unr-lcssa, label %.lr.ph.us.new

14:                                               ; preds = %._crit_edge.us
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %14, %._crit_edge.us
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count64
  br i1 %exitcond65.not, label %._crit_edge43, label %.lr.ph.us, !llvm.loop !13

.lr.ph.us.new:                                    ; preds = %.lr.ph.us, %31
  %.02840.us = phi i32 [ %32, %31 ], [ 0, %.lr.ph.us ]
  %.02939.us = phi i32 [ %.1.us.1, %31 ], [ 0, %.lr.ph.us ]
  %niter = phi i32 [ %niter.next.1, %31 ], [ 0, %.lr.ph.us ]
  %16 = shl nuw i32 1, %.02840.us
  %17 = and i32 %16, %13
  %.not35.us = icmp eq i32 %17, 0
  br i1 %.not35.us, label %21, label %18

18:                                               ; preds = %.lr.ph.us.new
  %19 = and i32 %.02939.us, 1
  %.not36.us = icmp eq i32 %19, 0
  br i1 %.not36.us, label %23, label %20

20:                                               ; preds = %18
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %23

21:                                               ; preds = %.lr.ph.us.new
  %22 = add nsw i32 %.02939.us, 1
  br label %23

23:                                               ; preds = %21, %20, %18
  %.1.us = phi i32 [ %22, %21 ], [ 0, %20 ], [ 0, %18 ]
  %24 = shl nuw i32 2, %.02840.us
  %25 = and i32 %24, %13
  %.not35.us.1 = icmp eq i32 %25, 0
  br i1 %.not35.us.1, label %29, label %26

26:                                               ; preds = %23
  %27 = and i32 %.1.us, 1
  %.not36.us.1 = icmp eq i32 %27, 0
  br i1 %.not36.us.1, label %31, label %28

28:                                               ; preds = %26
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %31

29:                                               ; preds = %23
  %30 = add nsw i32 %.1.us, 1
  br label %31

31:                                               ; preds = %29, %28, %26
  %.1.us.1 = phi i32 [ %30, %29 ], [ 0, %28 ], [ 0, %26 ]
  %32 = add nuw nsw i32 %.02840.us, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us.unr-lcssa, label %.lr.ph.us.new, !llvm.loop !14

._crit_edge.us.unr-lcssa:                         ; preds = %31, %.lr.ph.us
  %.1.us.lcssa.ph = phi i32 [ poison, %.lr.ph.us ], [ %.1.us.1, %31 ]
  %.02840.us.unr = phi i32 [ 0, %.lr.ph.us ], [ %32, %31 ]
  %.02939.us.unr = phi i32 [ 0, %.lr.ph.us ], [ %.1.us.1, %31 ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa
  %33 = shl nuw i32 1, %.02840.us.unr
  %34 = and i32 %33, %13
  %.not35.us.epil = icmp eq i32 %34, 0
  br i1 %.not35.us.epil, label %38, label %35

35:                                               ; preds = %.epil.preheader
  %36 = and i32 %.02939.us.unr, 1
  %.not36.us.epil = icmp eq i32 %36, 0
  br i1 %.not36.us.epil, label %._crit_edge.us, label %37

37:                                               ; preds = %35
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %._crit_edge.us

38:                                               ; preds = %.epil.preheader
  %39 = add nsw i32 %.02939.us.unr, 1
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %35, %37, %38, %._crit_edge.us.unr-lcssa
  %.1.us.lcssa = phi i32 [ %.1.us.lcssa.ph, %._crit_edge.us.unr-lcssa ], [ %39, %38 ], [ 0, %37 ], [ 0, %35 ]
  %40 = and i32 %.1.us.lcssa, 1
  %.not34.us = icmp eq i32 %40, 0
  br i1 %.not34.us, label %15, label %14

._crit_edge43:                                    ; preds = %vector.body, %.lr.ph42.split, %.lr.ph42.split.1, %15
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(393216) @f, i8 0, i64 393216, i1 false)
  store i64 1, ptr @f, align 16, !tbaa !15
  %.not3250 = icmp slt i32 %4, 1
  %brmerge = or i1 %.not3250, %.not54
  br i1 %brmerge, label %._crit_edge, label %.preheader37.us.preheader

._crit_edge43.thread:                             ; preds = %.preheader38
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(393216) @f, i8 0, i64 393216, i1 false)
  store i64 1, ptr @f, align 16, !tbaa !15
  br label %._crit_edge

.preheader37.us.preheader:                        ; preds = %._crit_edge43
  %smax69 = tail call i32 @llvm.smax.i32(i32 %6, i32 1)
  %41 = add nuw i32 %4, 1
  %wide.trip.count80 = zext i32 %41 to i64
  %wide.trip.count75 = zext nneg i32 %smax69 to i64
  br label %.preheader37.us

.preheader37.us:                                  ; preds = %.preheader37.us.preheader, %._crit_edge47.split.us.us
  %indvars.iv77 = phi i64 [ 1, %.preheader37.us.preheader ], [ %indvars.iv.next78, %._crit_edge47.split.us.us ]
  %42 = add nsw i64 %indvars.iv77, -1
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %._crit_edge.us49.us, %.preheader37.us
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %._crit_edge.us49.us ], [ 0, %.preheader37.us ]
  %43 = getelementptr inbounds [12 x [4096 x i64]], ptr @f, i64 0, i64 %indvars.iv77, i64 %indvars.iv72
  br label %44

44:                                               ; preds = %58, %.preheader.us.us
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %58 ], [ 0, %.preheader.us.us ]
  %45 = and i64 %indvars.iv66, %indvars.iv72
  %46 = and i64 %45, 4294967295
  %47 = icmp eq i64 %46, 0
  br i1 %47, label %48, label %58

48:                                               ; preds = %44
  %49 = or i64 %indvars.iv66, %indvars.iv72
  %50 = and i64 %49, 4294967295
  %51 = getelementptr inbounds [4096 x i32], ptr @st, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %.not33.us.us = icmp eq i32 %52, 0
  br i1 %.not33.us.us, label %58, label %53

53:                                               ; preds = %48
  %54 = getelementptr inbounds [12 x [4096 x i64]], ptr @f, i64 0, i64 %42, i64 %indvars.iv66
  %55 = load i64, ptr %54, align 8, !tbaa !15
  %56 = load i64, ptr %43, align 8, !tbaa !15
  %57 = add nsw i64 %56, %55
  store i64 %57, ptr %43, align 8, !tbaa !15
  br label %58

58:                                               ; preds = %53, %48, %44
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count75
  br i1 %exitcond71.not, label %._crit_edge.us49.us, label %44, !llvm.loop !17

._crit_edge.us49.us:                              ; preds = %58
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75
  br i1 %exitcond76.not, label %._crit_edge47.split.us.us, label %.preheader.us.us, !llvm.loop !18

._crit_edge47.split.us.us:                        ; preds = %._crit_edge.us49.us
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count80
  br i1 %exitcond81.not, label %._crit_edge, label %.preheader37.us, !llvm.loop !19

.lr.ph42.split:                                   ; preds = %.lr.ph42.split.preheader
  store i32 1, ptr @st, align 16, !tbaa !5
  %exitcond.not = icmp slt i32 %6, 2
  br i1 %exitcond.not, label %._crit_edge43, label %.lr.ph42.split.1, !llvm.loop !20

.lr.ph42.split.1:                                 ; preds = %.lr.ph42.split
  store i32 1, ptr getelementptr inbounds (i8, ptr @st, i64 4), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @st, i64 8), align 8, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @st, i64 12), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @st, i64 16), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @st, i64 20), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @st, i64 24), align 8, !tbaa !5
  br label %._crit_edge43

._crit_edge:                                      ; preds = %._crit_edge47.split.us.us, %._crit_edge43, %._crit_edge43.thread
  %59 = sext i32 %4 to i64
  %60 = getelementptr inbounds [12 x [4096 x i64]], ptr @f, i64 0, i64 %59
  %61 = load i64, ptr %60, align 16, !tbaa !15
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %61)
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %64 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %65 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %64, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %66 = load i32, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %66, 0
  br i1 %.not, label %._crit_edge53, label %.preheader38, !llvm.loop !21

._crit_edge53:                                    ; preds = %._crit_edge, %0
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

attributes #0 = { mustprogress norecurse 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { inlinehint 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !12, !11}
!21 = distinct !{!21, !10}


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