; LLVM IR from upupming/algorithm :: acwing/寒假每日一题（入门组）/week2/756. 蛇形矩阵 (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" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [110 x [110 x i32]], align 16
@d = external dso_local global [4 x [2 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %113, %0
  %13 = load i32, ptr %6, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = mul nsw i32 %14, %15
  %17 = icmp sle i32 %13, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %12
  %20 = load i32, ptr %6, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %22
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [110 x i32], ptr %23, i64 0, i64 %25
  store i32 %20, ptr %26, align 4, !tbaa !5
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = icmp eq i32 %27, 1
  br i1 %28, label %29, label %47

29:                                               ; preds = %19
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %32 = sub nsw i32 %31, 1
  %33 = icmp eq i32 %30, %32
  br i1 %33, label %44, label %34

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %36
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [110 x i32], ptr %37, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %34, %29
  %45 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @d, i64 0, i64 1), align 8, !tbaa !5
  store i32 %45, ptr %4, align 4, !tbaa !5
  %46 = load i32, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([4 x [2 x i32]], ptr @d, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 %46, ptr %5, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %44, %34, %19
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = icmp eq i32 %48, 1
  br i1 %49, label %50, label %68

50:                                               ; preds = %47
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = icmp eq i32 %51, %53
  br i1 %54, label %65, label %55

55:                                               ; preds = %50
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %58
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [110 x i32], ptr %59, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %68

65:                                               ; preds = %55, %50
  %66 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @d, i64 0, i64 2), align 16, !tbaa !5
  store i32 %66, ptr %4, align 4, !tbaa !5
  %67 = load i32, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([4 x [2 x i32]], ptr @d, i64 0, i64 2), i64 0, i64 1), align 4, !tbaa !5
  store i32 %67, ptr %5, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %65, %55, %47
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = icmp eq i32 %69, -1
  br i1 %70, label %71, label %87

71:                                               ; preds = %68
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %84, label %74

74:                                               ; preds = %71
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %76
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = sub nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [110 x i32], ptr %77, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %87

84:                                               ; preds = %74, %71
  %85 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @d, i64 0, i64 3), align 8, !tbaa !5
  store i32 %85, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([4 x [2 x i32]], ptr @d, i64 0, i64 3), i64 0, i64 1), align 4, !tbaa !5
  store i32 %86, ptr %5, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %84, %74, %68
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = icmp eq i32 %88, -1
  br i1 %89, label %90, label %106

90:                                               ; preds = %87
  %91 = load i32, ptr %2, align 4, !tbaa !5
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %103, label %93

93:                                               ; preds = %90
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %96
  %98 = load i32, ptr %3, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [110 x i32], ptr %97, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %106

103:                                              ; preds = %93, %90
  %104 = load i32, ptr @d, align 16, !tbaa !5
  store i32 %104, ptr %4, align 4, !tbaa !5
  %105 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @d, i64 0, i64 1), align 4, !tbaa !5
  store i32 %105, ptr %5, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %103, %93, %87
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = add nsw i32 %108, %107
  store i32 %109, ptr %2, align 4, !tbaa !5
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = add nsw i32 %111, %110
  store i32 %112, ptr %3, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %106
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %6, align 4, !tbaa !5
  br label %12, !llvm.loop !9

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

117:                                              ; preds = %143, %116
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %146

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

123:                                              ; preds = %138, %122
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = load i32, ptr @m, align 4, !tbaa !5
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %141

128:                                              ; preds = %123
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %130
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [110 x i32], ptr %131, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %135)
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %136, ptr noundef @.str)
  br label %138

138:                                              ; preds = %128
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %9, align 4, !tbaa !5
  br label %123, !llvm.loop !11

141:                                              ; preds = %127
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %143

143:                                              ; preds = %141
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %7, align 4, !tbaa !5
  br label %117, !llvm.loop !12

146:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %147 = load i32, ptr %1, align 4
  ret i32 %147
}

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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

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

; 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)) #3

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 = { 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 = { 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}


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [110 x [110 x i32]], align 16
@d = external dso_local local_unnamed_addr global [4 x [2 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 @n, align 4, !tbaa !5
  %4 = load i32, ptr @m, align 4, !tbaa !5
  %5 = mul nsw i32 %4, %3
  %.not47 = icmp slt i32 %5, 1
  br i1 %.not47, label %.preheader46, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %6 = add nsw i32 %4, -1
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @d, i64 8), align 8
  %8 = load i32, ptr getelementptr inbounds (i8, ptr @d, i64 12), align 4
  %9 = add nsw i32 %3, -1
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @d, i64 16), align 16
  %11 = load i32, ptr getelementptr inbounds (i8, ptr @d, i64 20), align 4
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @d, i64 24), align 8
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @d, i64 28), align 4
  %14 = load i32, ptr @d, align 16
  %15 = load i32, ptr getelementptr inbounds (i8, ptr @d, i64 4), align 4
  br label %17

.preheader46:                                     ; preds = %60, %0
  %16 = icmp sgt i32 %3, 0
  br i1 %16, label %.preheader, label %._crit_edge56

17:                                               ; preds = %.lr.ph, %60
  %.03352 = phi i32 [ 1, %.lr.ph ], [ %63, %60 ]
  %.03451 = phi i32 [ 1, %.lr.ph ], [ %.4, %60 ]
  %.03550 = phi i32 [ 0, %.lr.ph ], [ %.439, %60 ]
  %.04049 = phi i32 [ 0, %.lr.ph ], [ %62, %60 ]
  %.04148 = phi i32 [ 0, %.lr.ph ], [ %61, %60 ]
  %18 = sext i32 %.04148 to i64
  %19 = sext i32 %.04049 to i64
  %20 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %18, i64 %19
  store i32 %.03352, ptr %20, align 4, !tbaa !5
  %21 = icmp eq i32 %.03451, 1
  br i1 %21, label %22, label %30

22:                                               ; preds = %17
  %23 = icmp eq i32 %.04049, %6
  br i1 %23, label %29, label %24

24:                                               ; preds = %22
  %25 = add nsw i32 %.04049, 1
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %18, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %.not42 = icmp eq i32 %28, 0
  br i1 %.not42, label %30, label %29

29:                                               ; preds = %24, %22
  br label %30

30:                                               ; preds = %29, %24, %17
  %.136 = phi i32 [ %7, %29 ], [ %.03550, %24 ], [ %.03550, %17 ]
  %.1 = phi i32 [ %8, %29 ], [ 1, %24 ], [ %.03451, %17 ]
  %31 = icmp eq i32 %.136, 1
  br i1 %31, label %32, label %40

32:                                               ; preds = %30
  %33 = icmp eq i32 %.04148, %9
  br i1 %33, label %39, label %34

34:                                               ; preds = %32
  %35 = add nsw i32 %.04148, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %36, i64 %19
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %.not43 = icmp eq i32 %38, 0
  br i1 %.not43, label %40, label %39

39:                                               ; preds = %34, %32
  br label %40

40:                                               ; preds = %39, %34, %30
  %.237 = phi i32 [ %10, %39 ], [ 1, %34 ], [ %.136, %30 ]
  %.2 = phi i32 [ %11, %39 ], [ %.1, %34 ], [ %.1, %30 ]
  %41 = icmp eq i32 %.2, -1
  br i1 %41, label %42, label %50

42:                                               ; preds = %40
  %43 = icmp eq i32 %.04049, 0
  br i1 %43, label %49, label %44

44:                                               ; preds = %42
  %45 = add nsw i32 %.04049, -1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %18, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %.not44 = icmp eq i32 %48, 0
  br i1 %.not44, label %50, label %49

49:                                               ; preds = %44, %42
  br label %50

50:                                               ; preds = %49, %44, %40
  %.338 = phi i32 [ %12, %49 ], [ %.237, %44 ], [ %.237, %40 ]
  %.3 = phi i32 [ %13, %49 ], [ -1, %44 ], [ %.2, %40 ]
  %51 = icmp eq i32 %.338, -1
  br i1 %51, label %52, label %60

52:                                               ; preds = %50
  %53 = icmp eq i32 %.04148, 0
  br i1 %53, label %59, label %54

54:                                               ; preds = %52
  %55 = add nsw i32 %.04148, -1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %56, i64 %19
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %.not45 = icmp eq i32 %58, 0
  br i1 %.not45, label %60, label %59

59:                                               ; preds = %54, %52
  br label %60

60:                                               ; preds = %59, %54, %50
  %.439 = phi i32 [ %14, %59 ], [ -1, %54 ], [ %.338, %50 ]
  %.4 = phi i32 [ %15, %59 ], [ %.3, %54 ], [ %.3, %50 ]
  %61 = add nsw i32 %.439, %.04148
  %62 = add nsw i32 %.4, %.04049
  %63 = add nuw i32 %.03352, 1
  %exitcond.not = icmp eq i32 %.03352, %5
  br i1 %exitcond.not, label %.preheader46, label %17, !llvm.loop !9

.preheader:                                       ; preds = %.preheader46, %._crit_edge
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %._crit_edge ], [ 0, %.preheader46 ]
  %64 = load i32, ptr @m, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %.lr.ph54, label %._crit_edge

._crit_edge56:                                    ; preds = %._crit_edge, %.preheader46
  ret i32 0

._crit_edge:                                      ; preds = %.lr.ph54, %.preheader
  %66 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next59, %68
  br i1 %69, label %.preheader, label %._crit_edge56, !llvm.loop !11

.lr.ph54:                                         ; preds = %.preheader, %.lr.ph54
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph54 ], [ 0, %.preheader ]
  %70 = getelementptr inbounds [110 x [110 x i32]], ptr @a, i64 0, i64 %indvars.iv58, i64 %indvars.iv
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %71)
  %73 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @.str)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %74 = load i32, ptr @m, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next, %75
  br i1 %76, label %.lr.ph54, label %._crit_edge, !llvm.loop !12
}

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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

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 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)) #2

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 = { 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 #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" }

!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}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass