; LLVM IR from eyangch/competitive-programming :: Codeforces/961 (b)

; 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 i32, align 4
  %4 = alloca [100000 x i32], align 16
  %5 = alloca [100000 x i8], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 400000, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 100000, ptr %5) #6
  %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)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %25, %0
  %16 = load i32, ptr %6, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %28

20:                                               ; preds = %15
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100000 x i32], ptr %4, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %23)
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %6, align 4, !tbaa !5
  br label %15, !llvm.loop !9

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

29:                                               ; preds = %39, %28
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %42

34:                                               ; preds = %29
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100000 x i8], ptr %5, i64 0, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %37)
  br label %39

39:                                               ; preds = %34
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %7, align 4, !tbaa !5
  br label %29, !llvm.loop !11

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %62, %42
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100000 x i8], ptr %5, i64 0, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !12, !range !14, !noundef !15
  %53 = trunc i8 %52 to i1
  br i1 %53, label %61, label %54

54:                                               ; preds = %48
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100000 x i32], ptr %4, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = add nsw i32 %59, %58
  store i32 %60, ptr %8, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %54, %48
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %9, align 4, !tbaa !5
  br label %43, !llvm.loop !16

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

67:                                               ; preds = %112, %65
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sub nsw i32 %69, %70
  %72 = add nsw i32 %71, 1
  %73 = icmp slt i32 %68, %72
  br i1 %73, label %75, label %74

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

75:                                               ; preds = %67
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100000 x i8], ptr %5, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !12, !range !14, !noundef !15
  %81 = trunc i8 %80 to i1
  br i1 %81, label %90, label %82

82:                                               ; preds = %75
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100000 x i32], ptr %4, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = sub nsw i32 %88, %87
  store i32 %89, ptr %8, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %82, %75
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = add nsw i32 %91, %92
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100000 x i8], ptr %5, i64 0, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !12, !range !14, !noundef !15
  %98 = trunc i8 %97 to i1
  br i1 %98, label %109, label %99

99:                                               ; preds = %90
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = add nsw i32 %100, %101
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100000 x i32], ptr %4, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = add nsw i32 %107, %106
  store i32 %108, ptr %8, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %99, %90
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %111 = load i32, ptr %110, align 4, !tbaa !5
  store i32 %111, ptr %10, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %109
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %11, align 4, !tbaa !5
  br label %67, !llvm.loop !17

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

116:                                              ; preds = %135, %115
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

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

121:                                              ; preds = %116
  %122 = load i32, ptr %12, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100000 x i8], ptr %5, i64 0, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !12, !range !14, !noundef !15
  %126 = trunc i8 %125 to i1
  br i1 %126, label %127, label %134

127:                                              ; preds = %121
  %128 = load i32, ptr %12, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100000 x i32], ptr %4, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = add nsw i32 %132, %131
  store i32 %133, ptr %10, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %127, %121
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %12, align 4, !tbaa !5
  br label %116, !llvm.loop !18

138:                                              ; preds = %120
  %139 = load i32, ptr %10, align 4, !tbaa !5
  %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 @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 100000, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 400000, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #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)) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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" }
attributes #4 = { inlinehint 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 #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 = !{!"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 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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" }

@_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 i32, align 4
  %3 = alloca [100000 x i32], align 16
  %4 = alloca [100000 x i8], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %4) #6
  %7 = 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)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.preheader24:                                     ; preds = %.lr.ph
  %11 = icmp sgt i32 %14, 0
  br i1 %11, label %.lr.ph27, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv
  %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) %12)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp slt i64 %indvars.iv.next, %15
  br i1 %16, label %.lr.ph, label %.preheader24, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph27, %0, %.preheader24
  %17 = phi i32 [ %14, %.preheader24 ], [ %9, %0 ], [ %23, %.lr.ph27 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph31.preheader, label %._crit_edge32

.lr.ph31.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %18 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %20 = icmp ult i32 %18, 4
  br i1 %20, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph31.preheader.new

.lr.ph31.preheader.new:                           ; preds = %.lr.ph31.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph31

.lr.ph27:                                         ; preds = %.preheader24, %.lr.ph27
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph27 ], [ 0, %.preheader24 ]
  %21 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv45
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %21)
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next46, %24
  br i1 %25, label %.lr.ph27, label %._crit_edge, !llvm.loop !11

._crit_edge32.loopexit.unr-lcssa:                 ; preds = %68, %.lr.ph31.preheader
  %.lcssa75.ph = phi i32 [ poison, %.lr.ph31.preheader ], [ %69, %68 ]
  %indvars.iv48.unr = phi i64 [ 0, %.lr.ph31.preheader ], [ %indvars.iv.next49.3, %68 ]
  %.unr = phi i32 [ 0, %.lr.ph31.preheader ], [ %69, %68 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge32, label %.lr.ph31.epil

.lr.ph31.epil:                                    ; preds = %._crit_edge32.loopexit.unr-lcssa, %34
  %indvars.iv48.epil = phi i64 [ %indvars.iv.next49.epil, %34 ], [ %indvars.iv48.unr, %._crit_edge32.loopexit.unr-lcssa ]
  %26 = phi i32 [ %35, %34 ], [ %.unr, %._crit_edge32.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %34 ], [ 0, %._crit_edge32.loopexit.unr-lcssa ]
  %27 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv48.epil
  %28 = load i8, ptr %27, align 1, !tbaa !12, !range !14, !noundef !15
  %29 = trunc nuw i8 %28 to i1
  br i1 %29, label %34, label %30

30:                                               ; preds = %.lr.ph31.epil
  %31 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv48.epil
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %26, %32
  br label %34

34:                                               ; preds = %30, %.lr.ph31.epil
  %35 = phi i32 [ %26, %.lr.ph31.epil ], [ %33, %30 ]
  %indvars.iv.next49.epil = add nuw nsw i64 %indvars.iv48.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge32, label %.lr.ph31.epil, !llvm.loop !16

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit.unr-lcssa, %34, %._crit_edge
  %.lcssa28 = phi i32 [ 0, %._crit_edge ], [ %.lcssa75.ph, %._crit_edge32.loopexit.unr-lcssa ], [ %35, %34 ]
  store i32 %.lcssa28, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 %.lcssa28, ptr %6, align 4, !tbaa !5
  %.not33.not = icmp sgt i32 %17, %18
  br i1 %.not33.not, label %.lr.ph36, label %.preheader

.lr.ph31:                                         ; preds = %68, %.lr.ph31.preheader.new
  %indvars.iv48 = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %indvars.iv.next49.3, %68 ]
  %36 = phi i32 [ 0, %.lr.ph31.preheader.new ], [ %69, %68 ]
  %niter = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %niter.next.3, %68 ]
  %37 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv48
  %38 = load i8, ptr %37, align 4, !tbaa !12, !range !14, !noundef !15
  %39 = trunc nuw i8 %38 to i1
  br i1 %39, label %.lr.ph31.1, label %40

40:                                               ; preds = %.lr.ph31
  %41 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv48
  %42 = load i32, ptr %41, align 16, !tbaa !5
  %43 = add nsw i32 %36, %42
  br label %.lr.ph31.1

.lr.ph31.1:                                       ; preds = %.lr.ph31, %40
  %44 = phi i32 [ %36, %.lr.ph31 ], [ %43, %40 ]
  %indvars.iv.next49 = or disjoint i64 %indvars.iv48, 1
  %45 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv.next49
  %46 = load i8, ptr %45, align 1, !tbaa !12, !range !14, !noundef !15
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %.lr.ph31.2, label %48

48:                                               ; preds = %.lr.ph31.1
  %49 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv.next49
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %44, %50
  br label %.lr.ph31.2

.lr.ph31.2:                                       ; preds = %48, %.lr.ph31.1
  %52 = phi i32 [ %44, %.lr.ph31.1 ], [ %51, %48 ]
  %indvars.iv.next49.1 = or disjoint i64 %indvars.iv48, 2
  %53 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv.next49.1
  %54 = load i8, ptr %53, align 2, !tbaa !12, !range !14, !noundef !15
  %55 = trunc nuw i8 %54 to i1
  br i1 %55, label %.lr.ph31.3, label %56

56:                                               ; preds = %.lr.ph31.2
  %57 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv.next49.1
  %58 = load i32, ptr %57, align 8, !tbaa !5
  %59 = add nsw i32 %52, %58
  br label %.lr.ph31.3

.lr.ph31.3:                                       ; preds = %56, %.lr.ph31.2
  %60 = phi i32 [ %52, %.lr.ph31.2 ], [ %59, %56 ]
  %indvars.iv.next49.2 = or disjoint i64 %indvars.iv48, 3
  %61 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv.next49.2
  %62 = load i8, ptr %61, align 1, !tbaa !12, !range !14, !noundef !15
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %68, label %64

64:                                               ; preds = %.lr.ph31.3
  %65 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv.next49.2
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %60, %66
  br label %68

68:                                               ; preds = %64, %.lr.ph31.3
  %69 = phi i32 [ %60, %.lr.ph31.3 ], [ %67, %64 ]
  %indvars.iv.next49.3 = add nuw nsw i64 %indvars.iv48, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph31, !llvm.loop !18

.preheader:                                       ; preds = %94, %._crit_edge32
  %.promoted38 = phi i32 [ %.lcssa28, %._crit_edge32 ], [ %96, %94 ]
  %.lcssa = phi i32 [ %17, %._crit_edge32 ], [ %97, %94 ]
  %70 = icmp sgt i32 %.lcssa, 0
  br i1 %70, label %.lr.ph40.preheader, label %._crit_edge41

.lr.ph40.preheader:                               ; preds = %.preheader
  %wide.trip.count57 = zext nneg i32 %.lcssa to i64
  %xtraiter79 = and i64 %wide.trip.count57, 1
  %71 = icmp eq i32 %.lcssa, 1
  br i1 %71, label %._crit_edge41.loopexit.unr-lcssa, label %.lr.ph40.preheader.new

.lr.ph40.preheader.new:                           ; preds = %.lr.ph40.preheader
  %unroll_iter84 = and i64 %wide.trip.count57, 2147483646
  br label %.lr.ph40

.lr.ph36:                                         ; preds = %._crit_edge32, %94
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %94 ], [ 1, %._crit_edge32 ]
  %72 = phi i32 [ %98, %94 ], [ %18, %._crit_edge32 ]
  %73 = add nsw i64 %indvars.iv51, -1
  %74 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !12, !range !14, !noundef !15
  %76 = trunc nuw i8 %75 to i1
  br i1 %76, label %82, label %77

77:                                               ; preds = %.lr.ph36
  %78 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %73
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sub nsw i32 %80, %79
  store i32 %81, ptr %5, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %77, %.lr.ph36
  %83 = trunc nuw nsw i64 %73 to i32
  %84 = add i32 %72, %83
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !12, !range !14, !noundef !15
  %88 = trunc nuw i8 %87 to i1
  br i1 %88, label %94, label %89

89:                                               ; preds = %82
  %90 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %85
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = add nsw i32 %92, %91
  store i32 %93, ptr %5, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %89, %82
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %96 = load i32, ptr %95, align 4, !tbaa !5
  store i32 %96, ptr %6, align 4, !tbaa !5
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %97 = load i32, ptr %1, align 4, !tbaa !5
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = sub nsw i32 %97, %98
  %100 = sext i32 %99 to i64
  %.not.not = icmp slt i64 %indvars.iv51, %100
  br i1 %.not.not, label %.lr.ph36, label %.preheader, !llvm.loop !19

._crit_edge41.loopexit.unr-lcssa:                 ; preds = %127, %.lr.ph40.preheader
  %.lcssa72.ph = phi i32 [ poison, %.lr.ph40.preheader ], [ %128, %127 ]
  %indvars.iv54.unr = phi i64 [ 0, %.lr.ph40.preheader ], [ %indvars.iv.next55.1, %127 ]
  %.unr81 = phi i32 [ %.promoted38, %.lr.ph40.preheader ], [ %128, %127 ]
  %lcmp.mod82.not = icmp eq i64 %xtraiter79, 0
  br i1 %lcmp.mod82.not, label %._crit_edge41, label %.lr.ph40.epil

.lr.ph40.epil:                                    ; preds = %._crit_edge41.loopexit.unr-lcssa
  %101 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv54.unr
  %102 = load i8, ptr %101, align 1, !tbaa !12, !range !14, !noundef !15
  %103 = trunc nuw i8 %102 to i1
  br i1 %103, label %104, label %._crit_edge41

104:                                              ; preds = %.lr.ph40.epil
  %105 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv54.unr
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %.unr81, %106
  store i32 %107, ptr %6, align 4, !tbaa !5
  br label %._crit_edge41

._crit_edge41:                                    ; preds = %._crit_edge41.loopexit.unr-lcssa, %104, %.lr.ph40.epil, %.preheader
  %108 = phi i32 [ %.promoted38, %.preheader ], [ %.lcssa72.ph, %._crit_edge41.loopexit.unr-lcssa ], [ %.unr81, %.lr.ph40.epil ], [ %107, %104 ]
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %108)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph40:                                         ; preds = %127, %.lr.ph40.preheader.new
  %indvars.iv54 = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %indvars.iv.next55.1, %127 ]
  %111 = phi i32 [ %.promoted38, %.lr.ph40.preheader.new ], [ %128, %127 ]
  %niter85 = phi i64 [ 0, %.lr.ph40.preheader.new ], [ %niter85.next.1, %127 ]
  %112 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv54
  %113 = load i8, ptr %112, align 2, !tbaa !12, !range !14, !noundef !15
  %114 = trunc nuw i8 %113 to i1
  br i1 %114, label %115, label %.lr.ph40.1

115:                                              ; preds = %.lr.ph40
  %116 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv54
  %117 = load i32, ptr %116, align 8, !tbaa !5
  %118 = add nsw i32 %111, %117
  store i32 %118, ptr %6, align 4, !tbaa !5
  br label %.lr.ph40.1

.lr.ph40.1:                                       ; preds = %.lr.ph40, %115
  %119 = phi i32 [ %111, %.lr.ph40 ], [ %118, %115 ]
  %indvars.iv.next55 = or disjoint i64 %indvars.iv54, 1
  %120 = getelementptr inbounds [100000 x i8], ptr %4, i64 0, i64 %indvars.iv.next55
  %121 = load i8, ptr %120, align 1, !tbaa !12, !range !14, !noundef !15
  %122 = trunc nuw i8 %121 to i1
  br i1 %122, label %123, label %127

123:                                              ; preds = %.lr.ph40.1
  %124 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv.next55
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %119, %125
  store i32 %126, ptr %6, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %123, %.lr.ph40.1
  %128 = phi i32 [ %119, %.lr.ph40.1 ], [ %126, %123 ]
  %indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54, 2
  %niter85.next.1 = add i64 %niter85, 2
  %niter85.ncmp.1 = icmp eq i64 %niter85.next.1, %unroll_iter84
  br i1 %niter85.ncmp.1, label %._crit_edge41.loopexit.unr-lcssa, label %.lr.ph40, !llvm.loop !20
}

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERb(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) 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 #2

; 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)) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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" }
attributes #4 = { inlinehint 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 #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 = !{!"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 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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