; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #766 (Div. 2)/A. Not Shading.ll (Z5solvev)

; 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" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_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 uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %19 = load i64, ptr %3, align 8, !tbaa !5
  %20 = add nsw i64 %19, -1
  store i64 %20, ptr %3, align 8, !tbaa !5
  %21 = load i64, ptr %4, align 8, !tbaa !5
  %22 = add nsw i64 %21, -1
  store i64 %22, ptr %4, align 8, !tbaa !5
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %5, align 8
  %25 = alloca %"class.std::__cxx11::basic_string", i64 %23, align 16
  store i64 %23, ptr %6, align 8
  %26 = icmp eq i64 %23, 0
  br i1 %26, label %33, label %27

27:                                               ; preds = %0
  %28 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %25, i64 %23
  br label %29

29:                                               ; preds = %29, %27
  %30 = phi ptr [ %25, %27 ], [ %31, %29 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %30) #6
  %31 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %30, i64 1
  %32 = icmp eq ptr %31, %28
  br i1 %32, label %33, label %29

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

34:                                               ; preds = %44, %33
  %35 = load i64, ptr %7, align 8, !tbaa !5
  %36 = load i64, ptr %1, align 8, !tbaa !5
  %37 = icmp slt i64 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %51

39:                                               ; preds = %34
  %40 = load i64, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %25, i64 %40
  %42 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %41)
          to label %43 unwind label %47

43:                                               ; preds = %39
  br label %44

44:                                               ; preds = %43
  %45 = load i64, ptr %7, align 8, !tbaa !5
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %7, align 8, !tbaa !5
  br label %34, !llvm.loop !9

47:                                               ; preds = %39
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %8, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %138

51:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  store i8 0, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 2, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %107, %51
  %53 = load i64, ptr %12, align 8, !tbaa !5
  %54 = load i64, ptr %1, align 8, !tbaa !5
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 5, ptr %13, align 4
  br label %110

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %101, %57
  %59 = load i64, ptr %14, align 8, !tbaa !5
  %60 = load i64, ptr %2, align 8, !tbaa !5
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 8, ptr %13, align 4
  br label %104

63:                                               ; preds = %58
  %64 = load i64, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %25, i64 %64
  %66 = load i64, ptr %14, align 8, !tbaa !5
  %67 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %65, i64 noundef %66)
          to label %68 unwind label %85

68:                                               ; preds = %63
  %69 = load i8, ptr %67, align 1, !tbaa !13
  %70 = sext i8 %69 to i32
  %71 = icmp eq i32 %70, 66
  br i1 %71, label %72, label %100

72:                                               ; preds = %68
  store i8 1, ptr %10, align 1, !tbaa !11
  %73 = load i64, ptr %12, align 8, !tbaa !5
  %74 = load i64, ptr %3, align 8, !tbaa !5
  %75 = icmp eq i64 %73, %74
  br i1 %75, label %76, label %89

76:                                               ; preds = %72
  %77 = load i64, ptr %14, align 8, !tbaa !5
  %78 = load i64, ptr %4, align 8, !tbaa !5
  %79 = icmp eq i64 %77, %78
  br i1 %79, label %80, label %89

80:                                               ; preds = %76
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
          to label %82 unwind label %85

82:                                               ; preds = %80
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef @.str)
          to label %84 unwind label %85

84:                                               ; preds = %82
  store i32 1, ptr %13, align 4
  br label %104

85:                                               ; preds = %82, %80, %63
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %8, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %137

89:                                               ; preds = %76, %72
  %90 = load i64, ptr %12, align 8, !tbaa !5
  %91 = load i64, ptr %3, align 8, !tbaa !5
  %92 = icmp eq i64 %90, %91
  br i1 %92, label %97, label %93

93:                                               ; preds = %89
  %94 = load i64, ptr %14, align 8, !tbaa !5
  %95 = load i64, ptr %4, align 8, !tbaa !5
  %96 = icmp eq i64 %94, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %93, %89
  store i64 1, ptr %11, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %97, %93
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99, %68
  br label %101

101:                                              ; preds = %100
  %102 = load i64, ptr %14, align 8, !tbaa !5
  %103 = add nsw i64 %102, 1
  store i64 %103, ptr %14, align 8, !tbaa !5
  br label %58, !llvm.loop !14

104:                                              ; preds = %84, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %105 = load i32, ptr %13, align 4
  switch i32 %105, label %110 [
    i32 8, label %106
  ]

106:                                              ; preds = %104
  br label %107

107:                                              ; preds = %106
  %108 = load i64, ptr %12, align 8, !tbaa !5
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %12, align 8, !tbaa !5
  br label %52, !llvm.loop !15

110:                                              ; preds = %104, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %111 = load i32, ptr %13, align 4
  switch i32 %111, label %122 [
    i32 5, label %112
  ]

112:                                              ; preds = %110
  %113 = load i8, ptr %10, align 1, !tbaa !11, !range !16, !noundef !17
  %114 = trunc i8 %113 to i1
  br i1 %114, label %116, label %115

115:                                              ; preds = %112
  store i64 -1, ptr %11, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %115, %112
  %117 = load i64, ptr %11, align 8, !tbaa !5
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %117)
          to label %119 unwind label %133

119:                                              ; preds = %116
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef @.str)
          to label %121 unwind label %133

121:                                              ; preds = %119
  store i32 0, ptr %13, align 4
  br label %122

122:                                              ; preds = %121, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  %123 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %25, i64 %23
  %124 = icmp eq ptr %25, %123
  br i1 %124, label %129, label %125

125:                                              ; preds = %125, %122
  %126 = phi ptr [ %123, %122 ], [ %127, %125 ]
  %127 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %126, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %127) #6
  %128 = icmp eq ptr %127, %25
  br i1 %128, label %129, label %125

129:                                              ; preds = %125, %122
  %130 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %130)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  %131 = load i32, ptr %13, align 4
  switch i32 %131, label %151 [
    i32 0, label %132
    i32 1, label %132
  ]

132:                                              ; preds = %129, %129
  ret void

133:                                              ; preds = %119, %116
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %8, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %9, align 4
  br label %137

137:                                              ; preds = %133, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  br label %138

138:                                              ; preds = %137, %47
  %139 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %25, i64 %23
  %140 = icmp eq ptr %25, %139
  br i1 %140, label %145, label %141

141:                                              ; preds = %141, %138
  %142 = phi ptr [ %139, %138 ], [ %143, %141 ]
  %143 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %142, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %143) #6
  %144 = icmp eq ptr %143, %25
  br i1 %144, label %145, label %141

145:                                              ; preds = %141, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  br label %146

146:                                              ; preds = %145
  %147 = load ptr, ptr %8, align 8
  %148 = load i32, ptr %9, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150

151:                                              ; preds = %129
  unreachable
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #4

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

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


; 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" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_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 uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %9 = load i64, ptr %3, align 8, !tbaa !5
  %10 = add nsw i64 %9, -1
  store i64 %10, ptr %3, align 8, !tbaa !5
  %11 = load i64, ptr %4, align 8, !tbaa !5
  %12 = add nsw i64 %11, -1
  store i64 %12, ptr %4, align 8, !tbaa !5
  %13 = load i64, ptr %1, align 8, !tbaa !5
  %14 = call ptr @llvm.stacksave.p0()
  %15 = alloca %"class.std::__cxx11::basic_string", i64 %13, align 16
  %16 = icmp eq i64 %13, 0
  br i1 %16, label %.loopexit55, label %17

17:                                               ; preds = %0
  %18 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %15, i64 %13
  br label %19

19:                                               ; preds = %19, %17
  %20 = phi ptr [ %15, %17 ], [ %21, %19 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  %21 = getelementptr inbounds i8, ptr %20, i64 32
  %22 = icmp eq ptr %21, %18
  br i1 %22, label %.loopexit55, label %19

.loopexit55:                                      ; preds = %19, %0
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph, label %.thread46

.preheader54:                                     ; preds = %29
  %.not3767 = icmp sgt i64 %31, 0
  %25 = load i64, ptr %2, align 8
  %26 = icmp sgt i64 %25, 0
  %or.cond78 = select i1 %.not3767, i1 %26, i1 false
  br i1 %or.cond78, label %.preheader53, label %.thread46

.lr.ph:                                           ; preds = %.loopexit55, %29
  %.03360 = phi i64 [ %30, %29 ], [ 0, %.loopexit55 ]
  %27 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %15, i64 %.03360
  %28 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %27)
          to label %29 unwind label %33

29:                                               ; preds = %.lr.ph
  %30 = add nuw nsw i64 %.03360, 1
  %31 = load i64, ptr %1, align 8, !tbaa !5
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %.lr.ph, label %.preheader54, !llvm.loop !9

33:                                               ; preds = %.lr.ph
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %71

.preheader53:                                     ; preds = %.preheader54, %._crit_edge
  %35 = phi i64 [ %57, %._crit_edge ], [ %31, %.preheader54 ]
  %36 = phi i64 [ %58, %._crit_edge ], [ %25, %.preheader54 ]
  %.02170 = phi i64 [ %59, %._crit_edge ], [ 0, %.preheader54 ]
  %.02269 = phi i64 [ %.123.lcssa, %._crit_edge ], [ 2, %.preheader54 ]
  %.02468 = phi i1 [ %.125.lcssa, %._crit_edge ], [ false, %.preheader54 ]
  %.not61 = icmp sgt i64 %36, 0
  br i1 %.not61, label %.lr.ph65, label %._crit_edge

.lr.ph65:                                         ; preds = %.preheader53
  %37 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %15, i64 %.02170
  br label %38

38:                                               ; preds = %.lr.ph65, %54
  %.064 = phi i64 [ 0, %.lr.ph65 ], [ %55, %54 ]
  %.12363 = phi i64 [ %.02269, %.lr.ph65 ], [ %.2, %54 ]
  %.12562 = phi i1 [ %.02468, %.lr.ph65 ], [ %.226, %54 ]
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %37, i64 noundef %.064)
  %40 = load i8, ptr %39, align 1, !tbaa !11
  %41 = icmp eq i8 %40, 66
  br i1 %41, label %42, label %54

42:                                               ; preds = %38
  %43 = load i64, ptr %3, align 8, !tbaa !5
  %44 = icmp eq i64 %.02170, %43
  %45 = load i64, ptr %4, align 8
  %46 = icmp eq i64 %.064, %45
  %or.cond = select i1 %44, i1 %46, i1 false
  br i1 %or.cond, label %47, label %53

47:                                               ; preds = %42
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
          to label %49 unwind label %51

49:                                               ; preds = %47
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @.str)
          to label %64 unwind label %51

51:                                               ; preds = %49, %47
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %71

53:                                               ; preds = %42
  %or.cond43 = select i1 %44, i1 true, i1 %46
  %spec.select44 = select i1 %or.cond43, i64 1, i64 %.12363
  br label %54

54:                                               ; preds = %53, %38
  %.226 = phi i1 [ %.12562, %38 ], [ true, %53 ]
  %.2 = phi i64 [ %.12363, %38 ], [ %spec.select44, %53 ]
  %55 = add nuw nsw i64 %.064, 1
  %56 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp slt i64 %55, %56
  br i1 %.not, label %38, label %._crit_edge.loopexit, !llvm.loop !12

._crit_edge.loopexit:                             ; preds = %54
  %.pre = load i64, ptr %1, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader53
  %57 = phi i64 [ %35, %.preheader53 ], [ %.pre, %._crit_edge.loopexit ]
  %58 = phi i64 [ %36, %.preheader53 ], [ %56, %._crit_edge.loopexit ]
  %.125.lcssa = phi i1 [ %.02468, %.preheader53 ], [ %.226, %._crit_edge.loopexit ]
  %.123.lcssa = phi i64 [ %.02269, %.preheader53 ], [ %.2, %._crit_edge.loopexit ]
  %59 = add nuw nsw i64 %.02170, 1
  %.not37 = icmp slt i64 %59, %57
  br i1 %.not37, label %.preheader53, label %.thread46.loopexit, !llvm.loop !13

.thread46.loopexit:                               ; preds = %._crit_edge
  %60 = select i1 %.125.lcssa, i64 %.123.lcssa, i64 -1
  br label %.thread46

.thread46:                                        ; preds = %.loopexit55, %.thread46.loopexit, %.preheader54
  %.024.lcssa = phi i64 [ -1, %.preheader54 ], [ %60, %.thread46.loopexit ], [ -1, %.loopexit55 ]
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.024.lcssa)
          to label %62 unwind label %69

62:                                               ; preds = %.thread46
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull @.str)
          to label %64 unwind label %69

64:                                               ; preds = %49, %62
  br i1 %16, label %.loopexit52, label %.preheader51.preheader

.preheader51.preheader:                           ; preds = %64
  %65 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %15, i64 %13
  br label %.preheader51

.preheader51:                                     ; preds = %.preheader51.preheader, %.preheader51
  %66 = phi ptr [ %67, %.preheader51 ], [ %65, %.preheader51.preheader ]
  %67 = getelementptr inbounds i8, ptr %66, i64 -32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %67) #6
  %68 = icmp eq ptr %67, %15
  br i1 %68, label %.loopexit52, label %.preheader51

.loopexit52:                                      ; preds = %.preheader51, %64
  call void @llvm.stackrestore.p0(ptr %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret void

69:                                               ; preds = %62, %.thread46
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %71

71:                                               ; preds = %51, %69, %33
  %.pn39 = phi { ptr, i32 } [ %34, %33 ], [ %70, %69 ], [ %52, %51 ]
  br i1 %16, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %71
  %72 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %15, i64 %13
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %73 = phi ptr [ %74, %.preheader ], [ %72, %.preheader.preheader ]
  %74 = getelementptr inbounds i8, ptr %73, i64 -32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %74) #6
  %75 = icmp eq ptr %74, %15
  br i1 %75, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn39
}

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

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


; Effective O3 passes: AggressiveInstCombinePass,ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass