; LLVM IR from eyangch/competitive-programming :: Codeforces/1350 (d)

; 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 [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %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) #7
  %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 = %175, %172, %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 %176

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %29 = load i32, ptr %3, align 4, !tbaa !8
  %30 = add nsw i32 %29, 1
  %31 = zext i32 %30 to i64
  %32 = call ptr @llvm.stacksave.p0()
  store ptr %32, ptr %5, align 8
  %33 = alloca i32, i64 %31, align 16
  store i64 %31, ptr %6, align 8
  %34 = load i32, ptr %3, align 4, !tbaa !8
  %35 = add nsw i32 %34, 1
  %36 = zext i32 %35 to i64
  %37 = alloca i32, i64 %36, align 16
  store i64 %36, ptr %7, align 8
  %38 = getelementptr inbounds i32, ptr %33, i64 0
  store i32 0, ptr %38, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  store i8 0, ptr %8, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %39

39:                                               ; preds = %57, %26
  %40 = load i32, ptr %9, align 4, !tbaa !8
  %41 = load i32, ptr %3, align 4, !tbaa !8
  %42 = icmp sle i32 %40, %41
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %39
  %45 = load i32, ptr %9, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %33, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %47)
  %49 = load i32, ptr %9, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %33, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = load i32, ptr %4, align 4, !tbaa !8
  %54 = icmp eq i32 %52, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %44
  store i8 1, ptr %8, align 1, !tbaa !11
  br label %56

56:                                               ; preds = %55, %44
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %9, align 4, !tbaa !8
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %9, align 4, !tbaa !8
  br label %39, !llvm.loop !13

60:                                               ; preds = %43
  %61 = load i8, ptr %8, align 1, !tbaa !11, !range !15, !noundef !16
  %62 = trunc i8 %61 to i1
  br i1 %62, label %66, label %63

63:                                               ; preds = %60
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %172, !llvm.loop !17

66:                                               ; preds = %60
  %67 = load i32, ptr %3, align 4, !tbaa !8
  %68 = icmp eq i32 %67, 1
  br i1 %68, label %69, label %72

69:                                               ; preds = %66
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %172, !llvm.loop !17

72:                                               ; preds = %66
  %73 = getelementptr inbounds i32, ptr %37, i64 0
  store i32 0, ptr %73, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !8
  br label %74

74:                                               ; preds = %110, %72
  %75 = load i32, ptr %11, align 4, !tbaa !8
  %76 = load i32, ptr %3, align 4, !tbaa !8
  %77 = icmp sle i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %113

79:                                               ; preds = %74
  %80 = load i32, ptr %11, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %37, i64 %81
  store i32 0, ptr %82, align 4, !tbaa !8
  %83 = load i32, ptr %11, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %33, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !8
  %87 = load i32, ptr %4, align 4, !tbaa !8
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %89, label %95

89:                                               ; preds = %79
  %90 = load i32, ptr %11, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr %37, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !8
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %92, align 4, !tbaa !8
  br label %109

95:                                               ; preds = %79
  %96 = load i32, ptr %11, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i32, ptr %33, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !8
  %100 = load i32, ptr %4, align 4, !tbaa !8
  %101 = icmp sgt i32 %99, %100
  br i1 %101, label %102, label %108

102:                                              ; preds = %95
  %103 = load i32, ptr %11, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr %37, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !8
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %105, align 4, !tbaa !8
  br label %108

108:                                              ; preds = %102, %95
  br label %109

109:                                              ; preds = %108, %89
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %11, align 4, !tbaa !8
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %11, align 4, !tbaa !8
  br label %74, !llvm.loop !18

113:                                              ; preds = %78
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  store i8 0, ptr %12, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %114

114:                                              ; preds = %156, %113
  %115 = load i32, ptr %13, align 4, !tbaa !8
  %116 = load i32, ptr %3, align 4, !tbaa !8
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 10, ptr %10, align 4
  br label %159

119:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !8
  br label %120

120:                                              ; preds = %150, %119
  %121 = load i32, ptr %14, align 4, !tbaa !8
  %122 = icmp slt i32 %121, 3
  br i1 %122, label %123, label %129

123:                                              ; preds = %120
  %124 = load i32, ptr %13, align 4, !tbaa !8
  %125 = load i32, ptr %14, align 4, !tbaa !8
  %126 = add nsw i32 %124, %125
  %127 = load i32, ptr %3, align 4, !tbaa !8
  %128 = icmp slt i32 %126, %127
  br label %129

129:                                              ; preds = %123, %120
  %130 = phi i1 [ false, %120 ], [ %128, %123 ]
  br i1 %130, label %132, label %131

131:                                              ; preds = %129
  store i32 13, ptr %10, align 4
  br label %153

132:                                              ; preds = %129
  %133 = load i32, ptr %13, align 4, !tbaa !8
  %134 = add nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds i32, ptr %37, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !8
  %138 = icmp sge i32 %137, 0
  br i1 %138, label %139, label %149

139:                                              ; preds = %132
  %140 = load i32, ptr %13, align 4, !tbaa !8
  %141 = load i32, ptr %14, align 4, !tbaa !8
  %142 = add nsw i32 %140, %141
  %143 = add nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %37, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = icmp sge i32 %146, 0
  br i1 %147, label %148, label %149

148:                                              ; preds = %139
  store i8 1, ptr %12, align 1, !tbaa !11
  store i32 16, ptr %10, align 4
  br label %153

149:                                              ; preds = %139, %132
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %14, align 4, !tbaa !8
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %14, align 4, !tbaa !8
  br label %120, !llvm.loop !19

153:                                              ; preds = %148, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  %154 = load i32, ptr %10, align 4
  switch i32 %154, label %159 [
    i32 13, label %155
  ]

155:                                              ; preds = %153
  br label %156

156:                                              ; preds = %155
  %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 %114, !llvm.loop !20

159:                                              ; preds = %153, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %160 = load i32, ptr %10, align 4
  switch i32 %160, label %178 [
    i32 10, label %161
    i32 16, label %162
  ]

161:                                              ; preds = %159
  br label %162

162:                                              ; preds = %161, %159
  %163 = load i8, ptr %12, align 1, !tbaa !11, !range !15, !noundef !16
  %164 = trunc i8 %163 to i1
  br i1 %164, label %165, label %168

165:                                              ; preds = %162
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %166, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %171

168:                                              ; preds = %162
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %169, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %171

171:                                              ; preds = %168, %165
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  store i32 0, ptr %10, align 4
  br label %172

172:                                              ; preds = %171, %69, %63
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  %173 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %173)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %174 = load i32, ptr %10, align 4
  switch i32 %174, label %178 [
    i32 0, label %175
    i32 2, label %22
  ]

175:                                              ; preds = %172
  br label %22, !llvm.loop !17

176:                                              ; preds = %22
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %177 = load i32, ptr %1, align 4
  ret i32 %177

178:                                              ; preds = %172, %159
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 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

; 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 = { 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 #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 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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 [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 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 = alloca i32, align 4
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %11 = load i32, ptr %1, align 4, !tbaa !8
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr %1, align 4, !tbaa !8
  %.not55 = icmp eq i32 %11, 0
  br i1 %.not55, label %._crit_edge58, label %.lr.ph57

.lr.ph57:                                         ; preds = %0, %._crit_edge.thread
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %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)
  %15 = load i32, ptr %2, align 4, !tbaa !8
  %16 = add nsw i32 %15, 1
  %17 = zext i32 %16 to i64
  %18 = call ptr @llvm.stacksave.p0()
  %19 = alloca i32, i64 %17, align 16
  %20 = load i32, ptr %2, align 4, !tbaa !8
  %21 = add nsw i32 %20, 1
  %22 = zext i32 %21 to i64
  %23 = alloca i32, i64 %22, align 16
  store i32 0, ptr %19, align 16, !tbaa !8
  %.not3543 = icmp slt i32 %20, 1
  br i1 %.not3543, label %._crit_edge.thread, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  br i1 %spec.select, label %30, label %._crit_edge.thread, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph57, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph57 ]
  %.02944 = phi i1 [ %spec.select, %.lr.ph ], [ false, %.lr.ph57 ]
  %24 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %26 = load i32, ptr %24, align 4, !tbaa !8
  %27 = load i32, ptr %3, align 4, !tbaa !8
  %28 = icmp eq i32 %26, %27
  %spec.select = select i1 %28, i1 true, i1 %.02944
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.pr = load i32, ptr %2, align 4, !tbaa !8
  %29 = sext i32 %.pr to i64
  %.not35.not = icmp slt i64 %indvars.iv, %29
  br i1 %.not35.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

30:                                               ; preds = %._crit_edge
  %31 = icmp eq i32 %.pr, 1
  br i1 %31, label %._crit_edge.thread, label %32, !llvm.loop !11

32:                                               ; preds = %30
  store i32 0, ptr %23, align 16, !tbaa !8
  %.not3647 = icmp slt i32 %.pr, 1
  br i1 %.not3647, label %._crit_edge.thread, label %.lr.ph50

.lr.ph50:                                         ; preds = %32
  %33 = load i32, ptr %3, align 4, !tbaa !8
  %34 = add nuw i32 %.pr, 1
  %wide.trip.count = zext i32 %34 to i64
  %35 = zext nneg i32 %.pr to i64
  %min.iters.check = icmp ult i32 %.pr, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph50
  %indvars.iv59.ph = phi i64 [ 1, %.lr.ph50 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph50
  %n.vec = and i64 %35, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %33, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %invariant.gep98 = getelementptr i8, ptr %23, i64 32
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue97, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue97 ]
  %offset.idx = or disjoint i64 %index, 1
  %36 = or disjoint i64 %index, 5
  %37 = getelementptr inbounds i32, ptr %23, i64 %offset.idx
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  store <4 x i32> zeroinitializer, ptr %37, align 4, !tbaa !8
  store <4 x i32> zeroinitializer, ptr %38, align 4, !tbaa !8
  %39 = getelementptr inbounds i32, ptr %19, i64 %offset.idx
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %wide.load = load <4 x i32>, ptr %39, align 4, !tbaa !8
  %wide.load82 = load <4 x i32>, ptr %40, align 4, !tbaa !8
  %41 = icmp sgt <4 x i32> %wide.load, %broadcast.splat
  %42 = icmp sgt <4 x i32> %wide.load82, %broadcast.splat
  %43 = icmp ne <4 x i32> %wide.load, %broadcast.splat
  %44 = icmp ne <4 x i32> %wide.load82, %broadcast.splat
  %predphi = select <4 x i1> %41, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
  %predphi83 = select <4 x i1> %42, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
  %45 = extractelement <4 x i1> %43, i64 0
  br i1 %45, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %46 = getelementptr inbounds i32, ptr %23, i64 %offset.idx
  %47 = extractelement <4 x i32> %predphi, i64 0
  store i32 %47, ptr %46, align 4, !tbaa !8
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %48 = extractelement <4 x i1> %43, i64 1
  br i1 %48, label %pred.store.if84, label %pred.store.continue85

pred.store.if84:                                  ; preds = %pred.store.continue
  %49 = or disjoint i64 %index, 2
  %50 = getelementptr inbounds i32, ptr %23, i64 %49
  %51 = extractelement <4 x i32> %predphi, i64 1
  store i32 %51, ptr %50, align 8, !tbaa !8
  br label %pred.store.continue85

pred.store.continue85:                            ; preds = %pred.store.if84, %pred.store.continue
  %52 = extractelement <4 x i1> %43, i64 2
  br i1 %52, label %pred.store.if86, label %pred.store.continue87

pred.store.if86:                                  ; preds = %pred.store.continue85
  %53 = or disjoint i64 %index, 3
  %54 = getelementptr inbounds i32, ptr %23, i64 %53
  %55 = extractelement <4 x i32> %predphi, i64 2
  store i32 %55, ptr %54, align 4, !tbaa !8
  br label %pred.store.continue87

pred.store.continue87:                            ; preds = %pred.store.if86, %pred.store.continue85
  %56 = extractelement <4 x i1> %43, i64 3
  br i1 %56, label %pred.store.if88, label %pred.store.continue89

pred.store.if88:                                  ; preds = %pred.store.continue87
  %57 = or disjoint i64 %index, 4
  %58 = getelementptr inbounds i32, ptr %23, i64 %57
  %59 = extractelement <4 x i32> %predphi, i64 3
  store i32 %59, ptr %58, align 16, !tbaa !8
  br label %pred.store.continue89

pred.store.continue89:                            ; preds = %pred.store.if88, %pred.store.continue87
  %60 = extractelement <4 x i1> %44, i64 0
  br i1 %60, label %pred.store.if90, label %pred.store.continue91

pred.store.if90:                                  ; preds = %pred.store.continue89
  %61 = getelementptr inbounds i32, ptr %23, i64 %36
  %62 = extractelement <4 x i32> %predphi83, i64 0
  store i32 %62, ptr %61, align 4, !tbaa !8
  br label %pred.store.continue91

pred.store.continue91:                            ; preds = %pred.store.if90, %pred.store.continue89
  %63 = extractelement <4 x i1> %44, i64 1
  br i1 %63, label %pred.store.if92, label %pred.store.continue93

pred.store.if92:                                  ; preds = %pred.store.continue91
  %64 = or disjoint i64 %index, 6
  %65 = getelementptr inbounds i32, ptr %23, i64 %64
  %66 = extractelement <4 x i32> %predphi83, i64 1
  store i32 %66, ptr %65, align 8, !tbaa !8
  br label %pred.store.continue93

pred.store.continue93:                            ; preds = %pred.store.if92, %pred.store.continue91
  %67 = extractelement <4 x i1> %44, i64 2
  br i1 %67, label %pred.store.if94, label %pred.store.continue95

pred.store.if94:                                  ; preds = %pred.store.continue93
  %68 = or disjoint i64 %index, 7
  %69 = getelementptr inbounds i32, ptr %23, i64 %68
  %70 = extractelement <4 x i32> %predphi83, i64 2
  store i32 %70, ptr %69, align 4, !tbaa !8
  br label %pred.store.continue95

pred.store.continue95:                            ; preds = %pred.store.if94, %pred.store.continue93
  %71 = extractelement <4 x i1> %44, i64 3
  br i1 %71, label %pred.store.if96, label %pred.store.continue97

pred.store.if96:                                  ; preds = %pred.store.continue95
  %gep99 = getelementptr i32, ptr %invariant.gep98, i64 %index
  %72 = extractelement <4 x i32> %predphi83, i64 3
  store i32 %72, ptr %gep99, align 16, !tbaa !8
  br label %pred.store.continue97

pred.store.continue97:                            ; preds = %pred.store.if96, %pred.store.continue95
  %index.next = add nuw i64 %index, 8
  %73 = icmp eq i64 %index.next, %n.vec
  br i1 %73, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %pred.store.continue97
  %cmp.n = icmp eq i64 %n.vec, %35
  br i1 %cmp.n, label %.preheader.lr.ph, label %scalar.ph.preheader

.preheader.lr.ph:                                 ; preds = %80, %middle.block
  %invariant.gep = getelementptr inbounds i8, ptr %23, i64 4
  %wide.trip.count73 = zext nneg i32 %.pr to i64
  %invariant.gep79 = getelementptr inbounds i8, ptr %23, i64 12
  br label %.preheader

scalar.ph:                                        ; preds = %scalar.ph.preheader, %80
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %80 ], [ %indvars.iv59.ph, %scalar.ph.preheader ]
  %74 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv59
  store i32 0, ptr %74, align 4, !tbaa !8
  %75 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv59
  %76 = load i32, ptr %75, align 4, !tbaa !8
  %77 = icmp slt i32 %76, %33
  br i1 %77, label %.sink.split, label %78

78:                                               ; preds = %scalar.ph
  %79 = icmp sgt i32 %76, %33
  br i1 %79, label %.sink.split, label %80

.sink.split:                                      ; preds = %78, %scalar.ph
  %.sink = phi i32 [ -1, %scalar.ph ], [ 1, %78 ]
  store i32 %.sink, ptr %74, align 4, !tbaa !8
  br label %80

80:                                               ; preds = %.sink.split, %78
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
  br i1 %exitcond.not, label %.preheader.lr.ph, label %scalar.ph, !llvm.loop !17

.preheader:                                       ; preds = %.preheader.lr.ph, %.thread78
  %indvars.iv70 = phi i64 [ 0, %.preheader.lr.ph ], [ %81, %.thread78 ]
  %indvars.iv65 = phi i32 [ %.pr, %.preheader.lr.ph ], [ %indvars.iv.next66, %.thread78 ]
  %81 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond68.not = icmp eq i32 %indvars.iv65, 1
  br i1 %exitcond68.not, label %.thread78, label %82

82:                                               ; preds = %.preheader
  %gep = getelementptr inbounds i32, ptr %invariant.gep, i64 %indvars.iv70
  %83 = load i32, ptr %gep, align 4, !tbaa !8
  %84 = icmp sgt i32 %83, -1
  br i1 %84, label %85, label %.thread78

85:                                               ; preds = %82
  %gep52 = getelementptr inbounds i32, ptr %invariant.gep, i64 %81
  %86 = load i32, ptr %gep52, align 4, !tbaa !8
  %87 = icmp sgt i32 %86, -1
  br i1 %87, label %._crit_edge.thread, label %88

88:                                               ; preds = %85
  %exitcond68.1.not = icmp eq i32 %indvars.iv65, 2
  br i1 %exitcond68.1.not, label %.thread78, label %89

89:                                               ; preds = %88
  %gep80 = getelementptr inbounds i32, ptr %invariant.gep79, i64 %indvars.iv70
  %90 = load i32, ptr %gep80, align 4, !tbaa !8
  %91 = icmp sgt i32 %90, -1
  br i1 %91, label %._crit_edge.thread, label %.thread78

.thread78:                                        ; preds = %82, %89, %88, %.preheader
  %indvars.iv.next66 = add i32 %indvars.iv65, -1
  %exitcond74.not = icmp eq i64 %81, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge.thread, label %.preheader, !llvm.loop !18

._crit_edge.thread:                               ; preds = %.thread78, %85, %89, %32, %30, %._crit_edge, %.lr.ph57
  %.str.1.sink = phi ptr [ @.str, %.lr.ph57 ], [ @.str, %._crit_edge ], [ @.str.1, %30 ], [ @.str, %32 ], [ @.str.1, %89 ], [ @.str.1, %85 ], [ @.str, %.thread78 ]
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.1.sink)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %18)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %94 = load i32, ptr %1, align 4, !tbaa !8
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %94, 0
  br i1 %.not, label %._crit_edge58, label %.lr.ph57

._crit_edge58:                                    ; preds = %._crit_edge.thread, %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

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

; 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 = { 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 #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, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12, !16, !15}
!18 = distinct !{!18, !12}


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