; LLVM IR from seikhchilli/codeforces-solution :: 1579B (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" }

@_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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %21

21:                                               ; preds = %159, %0
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %2, align 4, !tbaa !8
  %24 = icmp ne i32 %22, 0
  br i1 %24, label %25, label %161

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %27 = load i32, ptr %3, align 4, !tbaa !8
  %28 = zext i32 %27 to i64
  %29 = call ptr @llvm.stacksave.p0()
  store ptr %29, ptr %4, align 8
  %30 = alloca i32, i64 %28, align 16
  store i64 %28, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %31

31:                                               ; preds = %41, %25
  %32 = load i32, ptr %6, align 4, !tbaa !8
  %33 = load i32, ptr %3, align 4, !tbaa !8
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %44

36:                                               ; preds = %31
  %37 = load i32, ptr %6, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr %30, i64 %38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %39)
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %6, align 4, !tbaa !8
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %6, align 4, !tbaa !8
  br label %31, !llvm.loop !11

44:                                               ; preds = %35
  %45 = load i32, ptr %3, align 4, !tbaa !8
  %46 = zext i32 %45 to i64
  %47 = alloca [3 x i32], i64 %46, align 16
  store i64 %46, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %48

48:                                               ; preds = %122, %44
  %49 = load i32, ptr %9, align 4, !tbaa !8
  %50 = load i32, ptr %3, align 4, !tbaa !8
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

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

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %54 = load i32, ptr %9, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %30, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !8
  store i32 %57, ptr %10, align 4, !tbaa !8
  %58 = load i32, ptr %9, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %30, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !8
  %62 = load i32, ptr %9, align 4, !tbaa !8
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr %30, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !8
  %67 = icmp slt i32 %61, %66
  br i1 %67, label %68, label %121

68:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %69 = load i32, ptr %9, align 4, !tbaa !8
  %70 = sub nsw i32 %69, 1
  store i32 %70, ptr %11, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %71

71:                                               ; preds = %83, %68
  %72 = load i32, ptr %11, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %30, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %76 = load i32, ptr %10, align 4, !tbaa !8
  %77 = icmp sgt i32 %75, %76
  br i1 %77, label %78, label %81

78:                                               ; preds = %71
  %79 = load i32, ptr %11, align 4, !tbaa !8
  %80 = icmp sge i32 %79, 0
  br label %81

81:                                               ; preds = %78, %71
  %82 = phi i1 [ false, %71 ], [ %80, %78 ]
  br i1 %82, label %83, label %96

83:                                               ; preds = %81
  %84 = load i32, ptr %12, align 4, !tbaa !8
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %12, align 4, !tbaa !8
  %86 = load i32, ptr %11, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %30, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = load i32, ptr %11, align 4, !tbaa !8
  %91 = add nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr %30, i64 %92
  store i32 %89, ptr %93, align 4, !tbaa !8
  %94 = load i32, ptr %11, align 4, !tbaa !8
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %11, align 4, !tbaa !8
  br label %71, !llvm.loop !13

96:                                               ; preds = %81
  %97 = load i32, ptr %10, align 4, !tbaa !8
  %98 = load i32, ptr %11, align 4, !tbaa !8
  %99 = add nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %30, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !8
  %102 = load i32, ptr %9, align 4, !tbaa !8
  %103 = add nsw i32 %102, 1
  %104 = load i32, ptr %8, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [3 x i32], ptr %47, i64 %105
  %107 = getelementptr inbounds [3 x i32], ptr %106, i64 0, i64 0
  store i32 %103, ptr %107, align 4, !tbaa !8
  %108 = load i32, ptr %11, align 4, !tbaa !8
  %109 = add nsw i32 %108, 2
  %110 = load i32, ptr %8, align 4, !tbaa !8
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [3 x i32], ptr %47, i64 %111
  %113 = getelementptr inbounds [3 x i32], ptr %112, i64 0, i64 1
  store i32 %109, ptr %113, align 4, !tbaa !8
  %114 = load i32, ptr %12, align 4, !tbaa !8
  %115 = load i32, ptr %8, align 4, !tbaa !8
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [3 x i32], ptr %47, i64 %116
  %118 = getelementptr inbounds [3 x i32], ptr %117, i64 0, i64 2
  store i32 %114, ptr %118, align 4, !tbaa !8
  %119 = load i32, ptr %8, align 4, !tbaa !8
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %121

121:                                              ; preds = %96, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %9, align 4, !tbaa !8
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %9, align 4, !tbaa !8
  br label %48, !llvm.loop !14

125:                                              ; preds = %52
  %126 = load i32, ptr %8, align 4, !tbaa !8
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %126)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %127, i8 noundef signext 10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %129

129:                                              ; preds = %156, %125
  %130 = load i32, ptr %13, align 4, !tbaa !8
  %131 = load i32, ptr %8, align 4, !tbaa !8
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %159

134:                                              ; preds = %129
  %135 = load i32, ptr %13, align 4, !tbaa !8
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [3 x i32], ptr %47, i64 %136
  %138 = getelementptr inbounds [3 x i32], ptr %137, i64 0, i64 1
  %139 = load i32, ptr %138, align 4, !tbaa !8
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %139)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @.str)
  %142 = load i32, ptr %13, align 4, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [3 x i32], ptr %47, i64 %143
  %145 = getelementptr inbounds [3 x i32], ptr %144, i64 0, i64 0
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %141, i32 noundef %146)
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef @.str)
  %149 = load i32, ptr %13, align 4, !tbaa !8
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [3 x i32], ptr %47, i64 %150
  %152 = getelementptr inbounds [3 x i32], ptr %151, i64 0, i64 2
  %153 = load i32, ptr %152, align 4, !tbaa !8
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %148, i32 noundef %153)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %154, i8 noundef signext 10)
  br label %156

156:                                              ; preds = %134
  %157 = load i32, ptr %13, align 4, !tbaa !8
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %13, align 4, !tbaa !8
  br label %129, !llvm.loop !15

159:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %160 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %160)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %21, !llvm.loop !16

161:                                              ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %162 = load i32, ptr %1, align 4
  ret i32 %162
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #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) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 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 willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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

@_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 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %10 = load i32, ptr %1, align 4, !tbaa !8
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr %1, align 4, !tbaa !8
  %.not63 = icmp eq i32 %10, 0
  br i1 %.not63, label %._crit_edge66, label %.lr.ph65

.lr.ph65:                                         ; preds = %0, %._crit_edge62
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load i32, ptr %2, align 4, !tbaa !8
  %14 = zext i32 %13 to i64
  %15 = call ptr @llvm.stacksave.p0()
  %16 = alloca i32, i64 %14, align 16
  %17 = load i32, ptr %2, align 4, !tbaa !8
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph65
  %19 = zext i32 %17 to i64
  %20 = alloca [3 x i32], i64 %19, align 16
  br label %._crit_edge57

._crit_edge:                                      ; preds = %.lr.ph
  %21 = zext i32 %27 to i64
  %22 = alloca [3 x i32], i64 %21, align 16
  %invariant.gep51 = getelementptr i8, ptr %16, i64 4
  %23 = icmp sgt i32 %27, 1
  br i1 %23, label %.lr.ph56, label %._crit_edge57

.lr.ph56:                                         ; preds = %._crit_edge
  %24 = add nsw i32 %27, -1
  %wide.trip.count = zext nneg i32 %24 to i64
  %invariant.gep = getelementptr i8, ptr %16, i64 -4
  br label %34

.lr.ph:                                           ; preds = %.lr.ph65, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph65 ]
  %25 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge57:                                    ; preds = %55, %._crit_edge.thread, %._crit_edge
  %30 = phi ptr [ %22, %._crit_edge ], [ %20, %._crit_edge.thread ], [ %22, %55 ]
  %.037.lcssa = phi i32 [ 0, %._crit_edge ], [ 0, %._crit_edge.thread ], [ %.1, %55 ]
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.037.lcssa)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %31, i8 noundef signext 10)
  %33 = icmp sgt i32 %.037.lcssa, 0
  br i1 %33, label %.lr.ph61.preheader, label %._crit_edge62

.lr.ph61.preheader:                               ; preds = %._crit_edge57
  %wide.trip.count83 = zext nneg i32 %.037.lcssa to i64
  br label %.lr.ph61

34:                                               ; preds = %.lr.ph56, %55
  %indvars.iv77 = phi i64 [ 1, %.lr.ph56 ], [ %indvars.iv.next78.pre-phi, %55 ]
  %indvars.iv72 = phi i64 [ 0, %.lr.ph56 ], [ %indvars.iv.next73, %55 ]
  %.03753 = phi i32 [ 0, %.lr.ph56 ], [ %.1, %55 ]
  %35 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv77
  %36 = load i32, ptr %35, align 4, !tbaa !8
  %gep89 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv77
  %37 = load i32, ptr %gep89, align 4, !tbaa !8
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph46, label %._crit_edge85

._crit_edge85:                                    ; preds = %34
  %.pre = add nuw nsw i64 %indvars.iv77, 1
  br label %55

.lr.ph46:                                         ; preds = %34, %.lr.ph46
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph46 ], [ %indvars.iv72, %34 ]
  %39 = phi i32 [ %42, %.lr.ph46 ], [ %37, %34 ]
  %.03345 = phi i32 [ %40, %.lr.ph46 ], [ 0, %34 ]
  %40 = add nuw nsw i32 %.03345, 1
  %gep = getelementptr inbounds i32, ptr %invariant.gep51, i64 %indvars.iv74
  store i32 %39, ptr %gep, align 4, !tbaa !8
  %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1
  %41 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.next75
  %42 = load i32, ptr %41, align 4, !tbaa !8
  %43 = icmp sgt i32 %42, %36
  %44 = icmp sgt i64 %indvars.iv74, 0
  %45 = and i1 %44, %43
  br i1 %45, label %.lr.ph46, label %._crit_edge47, !llvm.loop !13

._crit_edge47:                                    ; preds = %.lr.ph46
  %46 = trunc nsw i64 %indvars.iv.next75 to i32
  %gep52 = getelementptr i32, ptr %16, i64 %indvars.iv74
  store i32 %36, ptr %gep52, align 4, !tbaa !8
  %47 = add nuw nsw i64 %indvars.iv77, 1
  %48 = sext i32 %.03753 to i64
  %49 = getelementptr inbounds [3 x i32], ptr %22, i64 %48
  %50 = trunc nuw nsw i64 %47 to i32
  store i32 %50, ptr %49, align 4, !tbaa !8
  %51 = add nsw i32 %46, 2
  %52 = getelementptr inbounds i8, ptr %49, i64 4
  store i32 %51, ptr %52, align 4, !tbaa !8
  %53 = getelementptr inbounds i8, ptr %49, i64 8
  store i32 %40, ptr %53, align 4, !tbaa !8
  %54 = add nsw i32 %.03753, 1
  br label %55

55:                                               ; preds = %._crit_edge85, %._crit_edge47
  %indvars.iv.next78.pre-phi = phi i64 [ %.pre, %._crit_edge85 ], [ %47, %._crit_edge47 ]
  %.1 = phi i32 [ %.03753, %._crit_edge85 ], [ %54, %._crit_edge47 ]
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge57, label %34, !llvm.loop !14

._crit_edge62:                                    ; preds = %.lr.ph61, %._crit_edge57
  call void @llvm.stackrestore.p0(ptr %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %56 = load i32, ptr %1, align 4, !tbaa !8
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %56, 0
  br i1 %.not, label %._crit_edge66, label %.lr.ph65, !llvm.loop !15

.lr.ph61:                                         ; preds = %.lr.ph61.preheader, %.lr.ph61
  %indvars.iv80 = phi i64 [ 0, %.lr.ph61.preheader ], [ %indvars.iv.next81, %.lr.ph61 ]
  %58 = getelementptr inbounds [3 x i32], ptr %30, i64 %indvars.iv80
  %59 = getelementptr inbounds i8, ptr %58, i64 4
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %60)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull @.str)
  %63 = load i32, ptr %58, align 4, !tbaa !8
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %62, i32 noundef %63)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @.str)
  %66 = getelementptr inbounds i8, ptr %58, i64 8
  %67 = load i32, ptr %66, align 4, !tbaa !8
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %65, i32 noundef %67)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %68, i8 noundef signext 10)
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge62, label %.lr.ph61, !llvm.loop !16

._crit_edge66:                                    ; preds = %._crit_edge62, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

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 nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) 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 #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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