; LLVM IR from upupming/algorithm :: acwing/寒假每日一题（提高组）/week1/479. 加分二叉树 (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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

@n = external dso_local global i32, align 4
@w = external dso_local global [35 x i32], align 16
@f = external dso_local global [35 x [35 x i32]], align 16
@g = external dso_local global [35 x [35 x i32]], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) #0

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = 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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %22, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp sle i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %19
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %20)
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

25:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %145, %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %148

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %141, %31
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %33, %34
  %36 = sub nsw i32 %35, 1
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %32
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %144

40:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %41, %42
  %44 = sub nsw i32 %43, 1
  store i32 %44, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %47, label %65

47:                                               ; preds = %40
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %53
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [35 x i32], ptr %54, i64 0, i64 %56
  store i32 %51, ptr %57, align 4, !tbaa !5
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [35 x [35 x i32]], ptr @g, i64 0, i64 %60
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [35 x i32], ptr %61, i64 0, i64 %63
  store i32 %58, ptr %64, align 4, !tbaa !5
  br label %140

65:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %66, ptr %7, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %136, %65
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = icmp sle i32 %68, %69
  br i1 %70, label %72, label %71

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

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = icmp eq i32 %73, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %72
  br label %86

77:                                               ; preds = %72
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %79
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sub nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [35 x i32], ptr %80, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %77, %76
  %87 = phi i32 [ 1, %76 ], [ %85, %77 ]
  store i32 %87, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = icmp eq i32 %88, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %86
  br label %101

92:                                               ; preds = %86
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %95
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [35 x i32], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %92, %91
  %102 = phi i32 [ 1, %91 ], [ %100, %92 ]
  store i32 %102, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = mul nsw i32 %103, %104
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = add nsw i32 %105, %109
  store i32 %110, ptr %10, align 4, !tbaa !5
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %113
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [35 x i32], ptr %114, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = icmp sgt i32 %111, %118
  br i1 %119, label %120, label %135

120:                                              ; preds = %101
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %123
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [35 x i32], ptr %124, i64 0, i64 %126
  store i32 %121, ptr %127, align 4, !tbaa !5
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [35 x [35 x i32]], ptr @g, i64 0, i64 %130
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [35 x i32], ptr %131, i64 0, i64 %133
  store i32 %128, ptr %134, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %120, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %7, align 4, !tbaa !5
  br label %67, !llvm.loop !11

139:                                              ; preds = %71
  br label %140

140:                                              ; preds = %139, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %5, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %5, align 4, !tbaa !5
  br label %32, !llvm.loop !12

144:                                              ; preds = %39
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %3, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !13

148:                                              ; preds = %30
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [35 x i32], ptr getelementptr inbounds ([35 x [35 x i32]], ptr @f, i64 0, i64 1), i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %152)
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %155 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef 1, i32 noundef %155)
  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) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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

attributes #0 = { 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 #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 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = distinct !{!12, !10}
!13 = distinct !{!13, !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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

@n = external dso_local global i32, align 4
@w = external dso_local global [35 x i32], align 16
@f = external dso_local local_unnamed_addr global [35 x [35 x i32]], align 16
@g = external dso_local local_unnamed_addr global [35 x [35 x i32]], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %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 = load i32, ptr @n, align 4, !tbaa !5
  %.not52 = icmp slt i32 %2, 1
  br i1 %.not52, label %._crit_edge, label %.lr.ph

.preheader51:                                     ; preds = %.lr.ph
  %.not4756 = icmp slt i32 %8, 1
  br i1 %.not4756, label %._crit_edge, label %.preheader50.preheader

.preheader50.preheader:                           ; preds = %.preheader51
  %3 = add nuw i32 %8, 1
  %wide.trip.count = zext i32 %3 to i64
  %smax = tail call i32 @llvm.smax.i32(i32 %3, i32 2)
  %4 = add nsw i32 %smax, -1
  %xtraiter = and i32 %4, 1
  %5 = icmp slt i32 %3, 3
  %unroll_iter = and i32 %4, -2
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br label %.preheader50

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %6 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %indvars.iv
  %7 = 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) %6)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %.not.not = icmp slt i64 %indvars.iv, %9
  br i1 %.not.not, label %.lr.ph, label %.preheader51, !llvm.loop !9

.preheader50:                                     ; preds = %.preheader50.preheader, %.split.us
  %indvars.iv71 = phi i64 [ 1, %.preheader50.preheader ], [ %indvars.iv.next72, %.split.us ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %10 = icmp eq i64 %indvars.iv71, 1
  br i1 %10, label %.preheader50.split.us.preheader, label %.preheader.preheader

.preheader50.split.us.preheader:                  ; preds = %.preheader50
  br i1 %5, label %.split.us.loopexit.unr-lcssa, label %.preheader50.split.us

.preheader.preheader:                             ; preds = %.preheader50
  %11 = trunc nuw nsw i64 %indvars.iv71 to i32
  br label %36

.preheader50.split.us:                            ; preds = %.preheader50.split.us.preheader, %.preheader50.split.us
  %indvars.iv68 = phi i64 [ %indvars.iv.next69.1, %.preheader50.split.us ], [ 1, %.preheader50.split.us.preheader ]
  %niter = phi i32 [ %niter.next.1, %.preheader50.split.us ], [ 0, %.preheader50.split.us.preheader ]
  %12 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %indvars.iv68
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %sext = shl i64 %indvars.iv68, 32
  %14 = ashr exact i64 %sext, 32
  %15 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %indvars.iv68, i64 %14
  store i32 %13, ptr %15, align 4, !tbaa !5
  %16 = getelementptr inbounds [35 x [35 x i32]], ptr @g, i64 0, i64 %indvars.iv68, i64 %14
  %17 = trunc nuw nsw i64 %indvars.iv68 to i32
  store i32 %17, ptr %16, align 4, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %18 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %indvars.iv.next69
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %sext.1 = shl i64 %indvars.iv.next69, 32
  %20 = ashr exact i64 %sext.1, 32
  %21 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %indvars.iv.next69, i64 %20
  store i32 %19, ptr %21, align 4, !tbaa !5
  %22 = getelementptr inbounds [35 x [35 x i32]], ptr @g, i64 0, i64 %indvars.iv.next69, i64 %20
  %23 = trunc nuw nsw i64 %indvars.iv.next69 to i32
  store i32 %23, ptr %22, align 4, !tbaa !5
  %indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 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 %.split.us.loopexit.unr-lcssa, label %.preheader50.split.us, !llvm.loop !11

._crit_edge:                                      ; preds = %.split.us, %0, %.preheader51
  %.lcssa77 = phi i32 [ %8, %.preheader51 ], [ %2, %0 ], [ %8, %.split.us ]
  %24 = sext i32 %.lcssa77 to i64
  %25 = getelementptr inbounds [35 x i32], ptr getelementptr inbounds (i8, ptr @f, i64 140), i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %26)
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %29 = load i32, ptr @n, align 4, !tbaa !5
  tail call void @_Z3dfsii(i32 noundef 1, i32 noundef %29)
  ret i32 0

.split.us.loopexit.unr-lcssa:                     ; preds = %.preheader50.split.us, %.preheader50.split.us.preheader
  %indvars.iv68.unr = phi i64 [ 1, %.preheader50.split.us.preheader ], [ %indvars.iv.next69.1, %.preheader50.split.us ]
  br i1 %lcmp.mod.not, label %.split.us, label %.preheader50.split.us.epil

.preheader50.split.us.epil:                       ; preds = %.split.us.loopexit.unr-lcssa
  %30 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %indvars.iv68.unr
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %sext.epil = shl i64 %indvars.iv68.unr, 32
  %32 = ashr exact i64 %sext.epil, 32
  %33 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %indvars.iv68.unr, i64 %32
  store i32 %31, ptr %33, align 4, !tbaa !5
  %34 = getelementptr inbounds [35 x [35 x i32]], ptr @g, i64 0, i64 %indvars.iv68.unr, i64 %32
  %35 = trunc nuw nsw i64 %indvars.iv68.unr to i32
  store i32 %35, ptr %34, align 4, !tbaa !5
  br label %.split.us

.split.us:                                        ; preds = %.loopexit, %.preheader50.split.us.epil, %.split.us.loopexit.unr-lcssa
  %exitcond.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.preheader50, !llvm.loop !12

36:                                               ; preds = %.loopexit, %.preheader.preheader
  %indvars.iv61 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next64.peel, %.loopexit ]
  %37 = phi i32 [ %11, %.preheader.preheader ], [ %81, %.loopexit ]
  %.in = phi i64 [ %indvars.iv.next72, %.preheader.preheader ], [ %79, %.loopexit ]
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %indvars.iv61, i64 %38
  %.promoted = load i32, ptr %39, align 4, !tbaa !5
  %40 = getelementptr inbounds [35 x [35 x i32]], ptr @g, i64 0, i64 %indvars.iv61, i64 %38
  %41 = zext i32 %37 to i64
  %zext = and i64 %.in, 4294967295
  %42 = icmp eq i64 %indvars.iv61, %41
  br i1 %42, label %47, label %43

43:                                               ; preds = %36
  %44 = add nuw nsw i64 %indvars.iv61, 1
  %45 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %44, i64 %38
  %46 = load i32, ptr %45, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %43, %36
  %48 = phi i32 [ %46, %43 ], [ 1, %36 ]
  %49 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %indvars.iv61
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %48, %50
  %52 = icmp sgt i32 %51, %.promoted
  br i1 %52, label %53, label %55

53:                                               ; preds = %47
  store i32 %51, ptr %39, align 4, !tbaa !5
  %54 = trunc nuw nsw i64 %indvars.iv61 to i32
  store i32 %54, ptr %40, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %53, %47
  %56 = phi i32 [ %51, %53 ], [ %.promoted, %47 ]
  %indvars.iv.next64.peel = add nuw nsw i64 %indvars.iv61, 1
  %57 = icmp ult i64 %indvars.iv.next64.peel, %zext
  br i1 %57, label %.peel.next, label %.loopexit

.peel.next:                                       ; preds = %55, %76
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %76 ], [ %indvars.iv.next64.peel, %55 ]
  %58 = phi i32 [ %77, %76 ], [ %56, %55 ]
  %59 = add nsw i64 %indvars.iv63, -1
  %60 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %indvars.iv61, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp eq i64 %indvars.iv63, %41
  br i1 %62, label %67, label %63

63:                                               ; preds = %.peel.next
  %64 = add nuw nsw i64 %indvars.iv63, 1
  %65 = getelementptr inbounds [35 x [35 x i32]], ptr @f, i64 0, i64 %64, i64 %38
  %66 = load i32, ptr %65, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %.peel.next, %63
  %68 = phi i32 [ %66, %63 ], [ 1, %.peel.next ]
  %69 = mul nsw i32 %68, %61
  %70 = getelementptr inbounds [35 x i32], ptr @w, i64 0, i64 %indvars.iv63
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %69, %71
  %73 = icmp sgt i32 %72, %58
  br i1 %73, label %74, label %76

74:                                               ; preds = %67
  store i32 %72, ptr %39, align 4, !tbaa !5
  %75 = trunc nuw nsw i64 %indvars.iv63 to i32
  store i32 %75, ptr %40, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %74, %67
  %77 = phi i32 [ %72, %74 ], [ %58, %67 ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %78 = icmp ult i64 %indvars.iv.next64, %zext
  br i1 %78, label %.peel.next, label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %76, %55
  %79 = add nuw nsw i64 %indvars.iv.next64.peel, %indvars.iv71
  %80 = add nuw nsw i64 %indvars.iv61, %indvars.iv71
  %81 = trunc nuw i64 %80 to i32
  %.not48 = icmp slt i32 %8, %81
  br i1 %.not48, label %.split.us, label %36, !llvm.loop !11
}

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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 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)) #3

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

attributes #0 = { 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 #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 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 #3 = { 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 #4 = { 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.peeled.count", i32 1}


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