; LLVM IR from seikhchilli/codeforces-solution :: 1272A (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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [3 x i32], align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %7 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %13 = 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 %14

14:                                               ; preds = %171, %0
  %15 = load i32, ptr %2, align 4, !tbaa !8
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr %2, align 4, !tbaa !8
  %17 = icmp ne i32 %15, 0
  br i1 %17, label %18, label %180

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 12, ptr %3) #5
  %19 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %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) %19)
  %21 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %23 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %25 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %26 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %27 = getelementptr inbounds i32, ptr %26, i64 3
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %25, ptr noundef %27)
  %28 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %29 = load i32, ptr %28, align 4, !tbaa !8
  %30 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %31 = load i32, ptr %30, align 4, !tbaa !8
  %32 = icmp eq i32 %29, %31
  br i1 %32, label %33, label %59

33:                                               ; preds = %18
  %34 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %35 = load i32, ptr %34, align 4, !tbaa !8
  %36 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %37 = load i32, ptr %36, align 4, !tbaa !8
  %38 = icmp ne i32 %35, %37
  br i1 %38, label %39, label %59

39:                                               ; preds = %33
  %40 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %41 = load i32, ptr %40, align 4, !tbaa !8
  %42 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %43 = load i32, ptr %42, align 4, !tbaa !8
  %44 = sub nsw i32 %41, %43
  %45 = icmp sgt i32 %44, 1
  br i1 %45, label %46, label %50

46:                                               ; preds = %39
  %47 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %48 = load i32, ptr %47, align 4, !tbaa !8
  %49 = sub nsw i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !8
  br label %50

50:                                               ; preds = %46, %39
  %51 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = add nsw i32 %52, 1
  %54 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  store i32 %53, ptr %54, align 4, !tbaa !8
  %55 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = add nsw i32 %56, 1
  %58 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  store i32 %57, ptr %58, align 4, !tbaa !8
  br label %112

59:                                               ; preds = %33, %18
  %60 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %61 = load i32, ptr %60, align 4, !tbaa !8
  %62 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = icmp eq i32 %61, %63
  br i1 %64, label %65, label %91

65:                                               ; preds = %59
  %66 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %67 = load i32, ptr %66, align 4, !tbaa !8
  %68 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %69 = load i32, ptr %68, align 4, !tbaa !8
  %70 = icmp ne i32 %67, %69
  br i1 %70, label %71, label %91

71:                                               ; preds = %65
  %72 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %73 = load i32, ptr %72, align 4, !tbaa !8
  %74 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %76 = sub nsw i32 %73, %75
  %77 = icmp sgt i32 %76, 1
  br i1 %77, label %78, label %82

78:                                               ; preds = %71
  %79 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %80 = load i32, ptr %79, align 4, !tbaa !8
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %79, align 4, !tbaa !8
  br label %82

82:                                               ; preds = %78, %71
  %83 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %84 = load i32, ptr %83, align 4, !tbaa !8
  %85 = sub nsw i32 %84, 1
  %86 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  store i32 %85, ptr %86, align 4, !tbaa !8
  %87 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %88 = load i32, ptr %87, align 4, !tbaa !8
  %89 = sub nsw i32 %88, 1
  %90 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  store i32 %89, ptr %90, align 4, !tbaa !8
  br label %111

91:                                               ; preds = %65, %59
  %92 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %93 = load i32, ptr %92, align 4, !tbaa !8
  %94 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %95 = load i32, ptr %94, align 4, !tbaa !8
  %96 = icmp ne i32 %93, %95
  br i1 %96, label %97, label %110

97:                                               ; preds = %91
  %98 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %99 = load i32, ptr %98, align 4, !tbaa !8
  %100 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %101 = load i32, ptr %100, align 4, !tbaa !8
  %102 = icmp ne i32 %99, %101
  br i1 %102, label %103, label %110

103:                                              ; preds = %97
  %104 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %105 = load i32, ptr %104, align 4, !tbaa !8
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %104, align 4, !tbaa !8
  %107 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %108 = load i32, ptr %107, align 4, !tbaa !8
  %109 = sub nsw i32 %108, 1
  store i32 %109, ptr %107, align 4, !tbaa !8
  br label %110

110:                                              ; preds = %103, %97, %91
  br label %111

111:                                              ; preds = %110, %82
  br label %112

112:                                              ; preds = %111, %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %113 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %114 = load i32, ptr %113, align 4, !tbaa !8
  %115 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %116 = load i32, ptr %115, align 4, !tbaa !8
  %117 = sub nsw i32 %114, %116
  %118 = icmp sge i32 %117, 0
  br i1 %118, label %119, label %125

119:                                              ; preds = %112
  %120 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %121 = load i32, ptr %120, align 4, !tbaa !8
  %122 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %123 = load i32, ptr %122, align 4, !tbaa !8
  %124 = sub nsw i32 %121, %123
  br label %131

125:                                              ; preds = %112
  %126 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %127 = load i32, ptr %126, align 4, !tbaa !8
  %128 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %129 = load i32, ptr %128, align 4, !tbaa !8
  %130 = sub nsw i32 %127, %129
  br label %131

131:                                              ; preds = %125, %119
  %132 = phi i32 [ %124, %119 ], [ %130, %125 ]
  store i32 %132, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %133 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %134 = load i32, ptr %133, align 4, !tbaa !8
  %135 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %136 = load i32, ptr %135, align 4, !tbaa !8
  %137 = sub nsw i32 %134, %136
  %138 = icmp sge i32 %137, 0
  br i1 %138, label %139, label %145

139:                                              ; preds = %131
  %140 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %141 = load i32, ptr %140, align 4, !tbaa !8
  %142 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %143 = load i32, ptr %142, align 4, !tbaa !8
  %144 = sub nsw i32 %141, %143
  br label %151

145:                                              ; preds = %131
  %146 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %147 = load i32, ptr %146, align 4, !tbaa !8
  %148 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 1
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = sub nsw i32 %147, %149
  br label %151

151:                                              ; preds = %145, %139
  %152 = phi i32 [ %144, %139 ], [ %150, %145 ]
  store i32 %152, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %153 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %154 = load i32, ptr %153, align 4, !tbaa !8
  %155 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %156 = load i32, ptr %155, align 4, !tbaa !8
  %157 = sub nsw i32 %154, %156
  %158 = icmp sge i32 %157, 0
  br i1 %158, label %159, label %165

159:                                              ; preds = %151
  %160 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %161 = load i32, ptr %160, align 4, !tbaa !8
  %162 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %163 = load i32, ptr %162, align 4, !tbaa !8
  %164 = sub nsw i32 %161, %163
  br label %171

165:                                              ; preds = %151
  %166 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 2
  %167 = load i32, ptr %166, align 4, !tbaa !8
  %168 = getelementptr inbounds [3 x i32], ptr %3, i64 0, i64 0
  %169 = load i32, ptr %168, align 4, !tbaa !8
  %170 = sub nsw i32 %167, %169
  br label %171

171:                                              ; preds = %165, %159
  %172 = phi i32 [ %164, %159 ], [ %170, %165 ]
  store i32 %172, ptr %6, align 4, !tbaa !8
  %173 = load i32, ptr %4, align 4, !tbaa !8
  %174 = load i32, ptr %5, align 4, !tbaa !8
  %175 = add nsw i32 %173, %174
  %176 = load i32, ptr %6, align 4, !tbaa !8
  %177 = add nsw i32 %175, %176
  %178 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %177)
  %179 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %178, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  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 12, ptr %3) #5
  br label %14, !llvm.loop !11

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

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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #4

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = { 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 = !{!"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"}


; 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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca [3 x 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
  %.not19 = icmp eq i32 %10, 0
  br i1 %.not19, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %12 = getelementptr inbounds i8, ptr %2, i64 4
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %14 = getelementptr inbounds i8, ptr %2, i64 12
  br label %15

15:                                               ; preds = %.lr.ph, %43
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #6
  %16 = 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)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %2, ptr noundef nonnull %14)
  %19 = load i32, ptr %2, align 4, !tbaa !8
  %20 = load i32, ptr %12, align 4, !tbaa !8
  %21 = icmp eq i32 %19, %20
  %22 = load i32, ptr %13, align 4, !tbaa !8
  br i1 %21, label %23, label %.thread

23:                                               ; preds = %15
  %.not12 = icmp eq i32 %22, %19
  br i1 %.not12, label %43, label %24

24:                                               ; preds = %23
  %25 = sub nsw i32 %22, %19
  %26 = icmp sgt i32 %25, 1
  br i1 %26, label %27, label %29

27:                                               ; preds = %24
  %28 = add nsw i32 %22, -1
  store i32 %28, ptr %13, align 4, !tbaa !8
  br label %29

29:                                               ; preds = %27, %24
  %30 = phi i32 [ %28, %27 ], [ %22, %24 ]
  %31 = add nsw i32 %19, 1
  store i32 %31, ptr %2, align 4, !tbaa !8
  store i32 %31, ptr %12, align 4, !tbaa !8
  br label %43

.thread:                                          ; preds = %15
  %32 = icmp eq i32 %22, %20
  br i1 %32, label %33, label %.thread18

33:                                               ; preds = %.thread
  %34 = sub nsw i32 %20, %19
  %35 = icmp sgt i32 %34, 1
  br i1 %35, label %36, label %38

36:                                               ; preds = %33
  %37 = add nsw i32 %19, 1
  store i32 %37, ptr %2, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %36, %33
  %39 = phi i32 [ %37, %36 ], [ %19, %33 ]
  %40 = add nsw i32 %20, -1
  store i32 %40, ptr %13, align 4, !tbaa !8
  store i32 %40, ptr %12, align 4, !tbaa !8
  br label %43

.thread18:                                        ; preds = %.thread
  %41 = add nsw i32 %19, 1
  store i32 %41, ptr %2, align 4, !tbaa !8
  %42 = add nsw i32 %22, -1
  store i32 %42, ptr %13, align 4, !tbaa !8
  br label %43

43:                                               ; preds = %23, %38, %.thread18, %29
  %44 = phi i32 [ %19, %23 ], [ %40, %38 ], [ %42, %.thread18 ], [ %30, %29 ]
  %45 = phi i32 [ %19, %23 ], [ %40, %38 ], [ %20, %.thread18 ], [ %31, %29 ]
  %46 = phi i32 [ %19, %23 ], [ %39, %38 ], [ %41, %.thread18 ], [ %31, %29 ]
  %47 = sub nsw i32 %46, %45
  %48 = call i32 @llvm.abs.i32(i32 %47, i1 false)
  %49 = sub nsw i32 %45, %44
  %50 = call i32 @llvm.abs.i32(i32 %49, i1 false)
  %51 = sub nsw i32 %46, %44
  %52 = call i32 @llvm.abs.i32(i32 %51, i1 false)
  %53 = add nsw i32 %50, %48
  %54 = add nsw i32 %53, %52
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %54)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %55, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #6
  %57 = load i32, ptr %1, align 4, !tbaa !8
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %57, 0
  br i1 %.not, label %._crit_edge, label %15, !llvm.loop !11

._crit_edge:                                      ; preds = %43, %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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

; 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 #4

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #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 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 = { 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) }
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"}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass