; LLVM IR from seikhchilli/codeforces-solution :: 1788A (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 i64, align 8
  %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
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %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) %2)
  br label %22

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

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %27 = 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)
  %28 = load i32, ptr %3, align 4, !tbaa !8
  %29 = zext i32 %28 to i64
  %30 = call ptr @llvm.stacksave.p0()
  store ptr %30, ptr %4, align 8
  %31 = alloca i32, i64 %29, align 16
  store i64 %29, 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 %32

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

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %45

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

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

45:                                               ; preds = %36
  %46 = load i32, ptr %3, align 4, !tbaa !8
  %47 = zext i32 %46 to i64
  %48 = alloca i32, i64 %47, align 16
  store i64 %47, ptr %7, align 8
  %49 = load i32, ptr %3, align 4, !tbaa !8
  %50 = zext i32 %49 to i64
  %51 = alloca i32, i64 %50, align 16
  store i64 %50, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !8
  br label %52

52:                                               ; preds = %71, %45
  %53 = load i32, ptr %10, align 4, !tbaa !8
  %54 = load i32, ptr %3, align 4, !tbaa !8
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load i32, ptr %10, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %31, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !8
  %62 = icmp eq i32 %61, 2
  br i1 %62, label %63, label %66

63:                                               ; preds = %57
  %64 = load i32, ptr %9, align 4, !tbaa !8
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %9, align 4, !tbaa !8
  br label %66

66:                                               ; preds = %63, %57
  %67 = load i32, ptr %9, align 4, !tbaa !8
  %68 = load i32, ptr %10, align 4, !tbaa !8
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %48, i64 %69
  store i32 %67, ptr %70, align 4, !tbaa !8
  br label %71

71:                                               ; preds = %66
  %72 = load i32, ptr %10, align 4, !tbaa !8
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %10, align 4, !tbaa !8
  br label %52, !llvm.loop !13

74:                                               ; preds = %56
  store i32 0, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %75 = load i32, ptr %3, align 4, !tbaa !8
  %76 = sub nsw i32 %75, 1
  store i32 %76, ptr %11, align 4, !tbaa !8
  br label %77

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

80:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %98

81:                                               ; preds = %77
  %82 = load i32, ptr %11, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %31, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %86 = icmp eq i32 %85, 2
  br i1 %86, label %87, label %90

87:                                               ; preds = %81
  %88 = load i32, ptr %9, align 4, !tbaa !8
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %9, align 4, !tbaa !8
  br label %90

90:                                               ; preds = %87, %81
  %91 = load i32, ptr %9, align 4, !tbaa !8
  %92 = load i32, ptr %11, align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i32, ptr %51, i64 %93
  store i32 %91, ptr %94, align 4, !tbaa !8
  br label %95

95:                                               ; preds = %90
  %96 = load i32, ptr %11, align 4, !tbaa !8
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr %11, align 4, !tbaa !8
  br label %77, !llvm.loop !14

98:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 -1, ptr %12, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %99

99:                                               ; preds = %120, %98
  %100 = load i32, ptr %13, align 4, !tbaa !8
  %101 = load i32, ptr %3, align 4, !tbaa !8
  %102 = sub nsw i32 %101, 1
  %103 = icmp slt i32 %100, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %99
  store i32 13, ptr %14, align 4
  br label %123

105:                                              ; preds = %99
  %106 = load i32, ptr %13, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %48, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !8
  %110 = load i32, ptr %13, align 4, !tbaa !8
  %111 = add nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %51, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !8
  %115 = icmp eq i32 %109, %114
  br i1 %115, label %116, label %119

116:                                              ; preds = %105
  %117 = load i32, ptr %13, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %12, align 4, !tbaa !8
  store i32 13, ptr %14, align 4
  br label %123

119:                                              ; preds = %105
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %13, align 4, !tbaa !8
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %13, align 4, !tbaa !8
  br label %99, !llvm.loop !15

123:                                              ; preds = %116, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %12, align 4, !tbaa !8
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %125)
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %128 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %128)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %22, !llvm.loop !16

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

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_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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
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) #7
  %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
  %.not39 = icmp eq i32 %10, 0
  br i1 %.not39, label %._crit_edge42, label %.lr.ph41

.lr.ph41:                                         ; preds = %0, %.split.loop.exit63
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %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.ph41
  %19 = zext i32 %17 to i64
  %20 = alloca i32, i64 %19, align 16
  %21 = alloca i32, i64 %19, align 16
  br label %.preheader

._crit_edge:                                      ; preds = %.lr.ph
  %22 = zext i32 %30 to i64
  %23 = alloca i32, i64 %22, align 16
  %24 = alloca i32, i64 %22, align 16
  %25 = icmp sgt i32 %30, 0
  br i1 %25, label %.lr.ph35.preheader, label %.preheader

.lr.ph35.preheader:                               ; preds = %._crit_edge
  %26 = add nsw i64 %22, -1
  %xtraiter = and i64 %22, 1
  %27 = icmp eq i64 %26, 0
  br i1 %27, label %.preheader30.unr-lcssa, label %.lr.ph35.preheader.new

.lr.ph35.preheader.new:                           ; preds = %.lr.ph35.preheader
  %unroll_iter = and i64 %22, 2147483646
  br label %.lr.ph35

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

.preheader30.unr-lcssa:                           ; preds = %.lr.ph35, %.lr.ph35.preheader
  %indvars.iv45.unr = phi i64 [ 0, %.lr.ph35.preheader ], [ %indvars.iv.next46.1, %.lr.ph35 ]
  %.02532.unr = phi i32 [ 0, %.lr.ph35.preheader ], [ %spec.select.1, %.lr.ph35 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader30, label %.lr.ph35.epil

.lr.ph35.epil:                                    ; preds = %.preheader30.unr-lcssa
  %33 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv45.unr
  %34 = load i32, ptr %33, align 4, !tbaa !8
  %35 = icmp eq i32 %34, 2
  %36 = zext i1 %35 to i32
  %spec.select.epil = add nuw nsw i32 %.02532.unr, %36
  %37 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv45.unr
  store i32 %spec.select.epil, ptr %37, align 4, !tbaa !8
  br label %.preheader30

.preheader30:                                     ; preds = %.preheader30.unr-lcssa, %.lr.ph35.epil
  br i1 %25, label %.lr.ph38.preheader, label %.preheader

.lr.ph38.preheader:                               ; preds = %.preheader30
  %xtraiter65 = and i64 %22, 1
  %38 = icmp eq i64 %26, 0
  br i1 %38, label %.preheader.loopexit.unr-lcssa, label %.lr.ph38.preheader.new

.lr.ph38.preheader.new:                           ; preds = %.lr.ph38.preheader
  %unroll_iter67 = and i64 %22, 2147483646
  br label %.lr.ph38

.lr.ph35:                                         ; preds = %.lr.ph35, %.lr.ph35.preheader.new
  %indvars.iv45 = phi i64 [ 0, %.lr.ph35.preheader.new ], [ %indvars.iv.next46.1, %.lr.ph35 ]
  %.02532 = phi i32 [ 0, %.lr.ph35.preheader.new ], [ %spec.select.1, %.lr.ph35 ]
  %niter = phi i64 [ 0, %.lr.ph35.preheader.new ], [ %niter.next.1, %.lr.ph35 ]
  %39 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv45
  %40 = load i32, ptr %39, align 8, !tbaa !8
  %41 = icmp eq i32 %40, 2
  %42 = zext i1 %41 to i32
  %spec.select = add nuw nsw i32 %.02532, %42
  %43 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv45
  store i32 %spec.select, ptr %43, align 8, !tbaa !8
  %indvars.iv.next46 = or disjoint i64 %indvars.iv45, 1
  %44 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.next46
  %45 = load i32, ptr %44, align 4, !tbaa !8
  %46 = icmp eq i32 %45, 2
  %47 = zext i1 %46 to i32
  %spec.select.1 = add nuw nsw i32 %spec.select, %47
  %48 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv.next46
  store i32 %spec.select.1, ptr %48, align 4, !tbaa !8
  %indvars.iv.next46.1 = add nuw nsw i64 %indvars.iv45, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader30.unr-lcssa, label %.lr.ph35, !llvm.loop !13

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph38, %.lr.ph38.preheader
  %indvars.iv48.unr = phi i64 [ %22, %.lr.ph38.preheader ], [ %indvars.iv.next49.1, %.lr.ph38 ]
  %.236.unr = phi i32 [ 0, %.lr.ph38.preheader ], [ %spec.select29.1, %.lr.ph38 ]
  %lcmp.mod66.not = icmp eq i64 %xtraiter65, 0
  br i1 %lcmp.mod66.not, label %.preheader, label %.lr.ph38.epil

.lr.ph38.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %indvars.iv.next49.epil = add nsw i64 %indvars.iv48.unr, -1
  %49 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.next49.epil
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = icmp eq i32 %50, 2
  %52 = zext i1 %51 to i32
  %spec.select29.epil = add nuw nsw i32 %.236.unr, %52
  %53 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv.next49.epil
  store i32 %spec.select29.epil, ptr %53, align 4, !tbaa !8
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph38.epil, %.preheader.loopexit.unr-lcssa, %._crit_edge, %._crit_edge.thread, %.preheader30
  %.lcssa5762 = phi i32 [ %30, %.preheader30 ], [ %30, %._crit_edge ], [ %17, %._crit_edge.thread ], [ %30, %.preheader.loopexit.unr-lcssa ], [ %30, %.lr.ph38.epil ]
  %54 = phi ptr [ %23, %.preheader30 ], [ %23, %._crit_edge ], [ %20, %._crit_edge.thread ], [ %23, %.preheader.loopexit.unr-lcssa ], [ %23, %.lr.ph38.epil ]
  %55 = phi ptr [ %24, %.preheader30 ], [ %24, %._crit_edge ], [ %21, %._crit_edge.thread ], [ %24, %.preheader.loopexit.unr-lcssa ], [ %24, %.lr.ph38.epil ]
  %56 = call i32 @llvm.smax.i32(i32 %.lcssa5762, i32 1)
  %smax = add nsw i32 %56, -1
  %wide.trip.count54 = zext nneg i32 %smax to i64
  br label %67

.lr.ph38:                                         ; preds = %.lr.ph38, %.lr.ph38.preheader.new
  %indvars.iv48 = phi i64 [ %22, %.lr.ph38.preheader.new ], [ %indvars.iv.next49.1, %.lr.ph38 ]
  %.236 = phi i32 [ 0, %.lr.ph38.preheader.new ], [ %spec.select29.1, %.lr.ph38 ]
  %niter68 = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %niter68.next.1, %.lr.ph38 ]
  %indvars.iv.next49 = add nsw i64 %indvars.iv48, -1
  %57 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.next49
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %59 = icmp eq i32 %58, 2
  %60 = zext i1 %59 to i32
  %spec.select29 = add nuw nsw i32 %.236, %60
  %61 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv.next49
  store i32 %spec.select29, ptr %61, align 4, !tbaa !8
  %indvars.iv.next49.1 = add nsw i64 %indvars.iv48, -2
  %62 = getelementptr inbounds i32, ptr %16, i64 %indvars.iv.next49.1
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = icmp eq i32 %63, 2
  %65 = zext i1 %64 to i32
  %spec.select29.1 = add nuw nsw i32 %spec.select29, %65
  %66 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv.next49.1
  store i32 %spec.select29.1, ptr %66, align 4, !tbaa !8
  %niter68.next.1 = add i64 %niter68, 2
  %niter68.ncmp.1.not = icmp eq i64 %niter68.next.1, %unroll_iter67
  br i1 %niter68.ncmp.1.not, label %.preheader.loopexit.unr-lcssa, label %.lr.ph38, !llvm.loop !14

67:                                               ; preds = %.preheader, %68
  %indvars.iv51 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next52, %68 ]
  %exitcond55.not = icmp eq i64 %indvars.iv51, %wide.trip.count54
  br i1 %exitcond55.not, label %.split.loop.exit63, label %68

68:                                               ; preds = %67
  %69 = getelementptr inbounds i32, ptr %54, i64 %indvars.iv51
  %70 = load i32, ptr %69, align 4, !tbaa !8
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %71 = getelementptr inbounds i32, ptr %55, i64 %indvars.iv.next52
  %72 = load i32, ptr %71, align 4, !tbaa !8
  %73 = icmp eq i32 %70, %72
  br i1 %73, label %.split.loop.exit, label %67, !llvm.loop !15

.split.loop.exit:                                 ; preds = %68
  %74 = trunc nuw i64 %indvars.iv.next52 to i32
  br label %.split.loop.exit63

.split.loop.exit63:                               ; preds = %67, %.split.loop.exit
  %.022 = phi i32 [ %74, %.split.loop.exit ], [ -1, %67 ]
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.022)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @.str)
  call void @llvm.stackrestore.p0(ptr %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %77 = load i32, ptr %1, align 4, !tbaa !8
  %78 = add nsw i32 %77, -1
  store i32 %78, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %77, 0
  br i1 %.not, label %._crit_edge42, label %.lr.ph41, !llvm.loop !16

._crit_edge42:                                    ; preds = %.split.loop.exit63, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  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_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) 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: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass