; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #827 (Div. 4)/G. Orray.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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  %17 = 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)
  %18 = load i64, ptr %1, align 8, !tbaa !5
  %19 = call ptr @llvm.stacksave.p0()
  store ptr %19, ptr %2, align 8
  %20 = alloca i64, i64 %18, align 16
  store i64 %18, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %30, %0
  %22 = load i64, ptr %4, align 8, !tbaa !5
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %24 = icmp slt i64 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %33

26:                                               ; preds = %21
  %27 = load i64, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds i64, ptr %20, i64 %27
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %28)
  br label %30

30:                                               ; preds = %26
  %31 = load i64, ptr %4, align 8, !tbaa !5
  %32 = add nsw i64 %31, 1
  store i64 %32, ptr %4, align 8, !tbaa !5
  br label %21, !llvm.loop !9

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

34:                                               ; preds = %88, %33
  %35 = load i64, ptr %7, align 8, !tbaa !5
  %36 = icmp sge i64 %35, 0
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %95

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 -1, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 -1, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %67, %38
  %40 = load i64, ptr %11, align 8, !tbaa !5
  %41 = load i64, ptr %1, align 8, !tbaa !5
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %70

44:                                               ; preds = %39
  %45 = load i64, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds i64, ptr %20, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = icmp slt i64 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %44
  br label %67

50:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %51 = load i64, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds i64, ptr %20, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = load i64, ptr %5, align 8, !tbaa !5
  %55 = xor i64 %53, %54
  %56 = load i64, ptr %11, align 8, !tbaa !5
  %57 = getelementptr inbounds i64, ptr %20, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = and i64 %55, %58
  store i64 %59, ptr %12, align 8, !tbaa !5
  %60 = load i64, ptr %12, align 8, !tbaa !5
  %61 = load i64, ptr %10, align 8, !tbaa !5
  %62 = icmp sgt i64 %60, %61
  br i1 %62, label %63, label %66

63:                                               ; preds = %50
  %64 = load i64, ptr %12, align 8, !tbaa !5
  store i64 %64, ptr %10, align 8, !tbaa !5
  %65 = load i64, ptr %11, align 8, !tbaa !5
  store i64 %65, ptr %9, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %63, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %67

67:                                               ; preds = %66, %49
  %68 = load i64, ptr %11, align 8, !tbaa !5
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %11, align 8, !tbaa !5
  br label %39, !llvm.loop !11

70:                                               ; preds = %43
  %71 = load i64, ptr %10, align 8, !tbaa !5
  %72 = icmp slt i64 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  store i32 7, ptr %8, align 4
  br label %85

74:                                               ; preds = %70
  %75 = load i64, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds i64, ptr %20, i64 %75
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(8) %76)
          to label %77 unwind label %91

77:                                               ; preds = %74
  %78 = load i64, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds i64, ptr %20, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = load i64, ptr %5, align 8, !tbaa !5
  %82 = or i64 %81, %80
  store i64 %82, ptr %5, align 8, !tbaa !5
  %83 = load i64, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds i64, ptr %20, i64 %83
  store i64 -1, ptr %84, align 8, !tbaa !5
  store i32 0, ptr %8, align 4
  br label %85

85:                                               ; preds = %77, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %86 = load i32, ptr %8, align 4
  switch i32 %86, label %154 [
    i32 0, label %87
    i32 7, label %88
  ]

87:                                               ; preds = %85
  br label %88

88:                                               ; preds = %87, %85
  %89 = load i64, ptr %7, align 8, !tbaa !5
  %90 = add nsw i64 %89, -1
  store i64 %90, ptr %7, align 8, !tbaa !5
  br label %34, !llvm.loop !12

91:                                               ; preds = %74
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %13, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %148

95:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %115, %95
  %97 = load i64, ptr %15, align 8, !tbaa !5
  %98 = load i64, ptr %1, align 8, !tbaa !5
  %99 = icmp slt i64 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %118

101:                                              ; preds = %96
  %102 = load i64, ptr %15, align 8, !tbaa !5
  %103 = getelementptr inbounds i64, ptr %20, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !5
  %105 = icmp ne i64 %104, -1
  br i1 %105, label %106, label %114

106:                                              ; preds = %101
  %107 = load i64, ptr %15, align 8, !tbaa !5
  %108 = getelementptr inbounds i64, ptr %20, i64 %107
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(8) %108)
          to label %109 unwind label %110

109:                                              ; preds = %106
  br label %114

110:                                              ; preds = %106
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %13, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %148

114:                                              ; preds = %109, %101
  br label %115

115:                                              ; preds = %114
  %116 = load i64, ptr %15, align 8, !tbaa !5
  %117 = add nsw i64 %116, 1
  store i64 %117, ptr %15, align 8, !tbaa !5
  br label %96, !llvm.loop !13

118:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %139, %118
  %120 = load i64, ptr %16, align 8, !tbaa !5
  %121 = load i64, ptr %1, align 8, !tbaa !5
  %122 = icmp slt i64 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %146

124:                                              ; preds = %119
  %125 = load i64, ptr %16, align 8, !tbaa !5
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %125) #5
  %127 = load i64, ptr %126, align 8, !tbaa !5
  %128 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %127)
          to label %129 unwind label %142

129:                                              ; preds = %124
  %130 = load i64, ptr %16, align 8, !tbaa !5
  %131 = load i64, ptr %1, align 8, !tbaa !5
  %132 = sub nsw i64 %131, 1
  %133 = icmp eq i64 %130, %132
  %134 = zext i1 %133 to i64
  %135 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %134
  %136 = load i8, ptr %135, align 1, !tbaa !14
  %137 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %128, i8 noundef signext %136)
          to label %138 unwind label %142

138:                                              ; preds = %129
  br label %139

139:                                              ; preds = %138
  %140 = load i64, ptr %16, align 8, !tbaa !5
  %141 = add nsw i64 %140, 1
  store i64 %141, ptr %16, align 8, !tbaa !5
  br label %119, !llvm.loop !15

142:                                              ; preds = %129, %124
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %13, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %148

146:                                              ; preds = %123
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %147 = load ptr, ptr %2, align 8
  call void @llvm.stackrestore.p0(ptr %147)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void

148:                                              ; preds = %142, %110, %91
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %13, align 8
  %151 = load i32, ptr %14, align 4
  %152 = insertvalue { ptr, i32 } poison, ptr %150, 0
  %153 = insertvalue { ptr, i32 } %152, i32 %151, 1
  resume { ptr, i32 } %153

154:                                              ; preds = %85
  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: 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 dso_local void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

; 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 dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_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

; 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 %"class.std::vector", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %3 = 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)
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %5 = call ptr @llvm.stacksave.p0()
  %6 = alloca i64, i64 %4, align 16
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %.preheader47

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03348 = phi i64 [ %11, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds i64, ptr %6, i64 %.03348
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %11 = add nuw nsw i64 %.03348, 1
  %12 = load i64, ptr %1, align 8, !tbaa !5
  %13 = icmp slt i64 %11, %12
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader47:                                     ; preds = %._crit_edge, %._crit_edge53.thread
  %.03956 = phi i64 [ 30, %._crit_edge ], [ %49, %._crit_edge53.thread ]
  %.04055 = phi i64 [ 0, %._crit_edge ], [ %.141, %._crit_edge53.thread ]
  %14 = load i64, ptr %1, align 8, !tbaa !5
  %15 = icmp sgt i64 %14, 0
  br i1 %15, label %.lr.ph52, label %._crit_edge53.thread

.lr.ph52:                                         ; preds = %.preheader47
  %16 = xor i64 %.04055, -1
  %xtraiter = and i64 %14, 1
  %17 = icmp eq i64 %14, 1
  br i1 %17, label %._crit_edge53.unr-lcssa, label %.lr.ph52.new

.lr.ph52.new:                                     ; preds = %.lr.ph52
  %unroll_iter = and i64 %14, 9223372036854775806
  br label %27

.preheader46:                                     ; preds = %._crit_edge53.thread
  %18 = load i64, ptr %1, align 8, !tbaa !5
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %.lr.ph58, label %._crit_edge61

._crit_edge53.unr-lcssa:                          ; preds = %42, %.lr.ph52
  %.238.lcssa.ph = phi i64 [ poison, %.lr.ph52 ], [ %.238.1, %42 ]
  %.2.lcssa.ph = phi i64 [ poison, %.lr.ph52 ], [ %.2.1, %42 ]
  %.03451.unr = phi i64 [ 0, %.lr.ph52 ], [ %43, %42 ]
  %.03550.unr = phi i64 [ -1, %.lr.ph52 ], [ %.2.1, %42 ]
  %.03649.unr = phi i64 [ -1, %.lr.ph52 ], [ %.238.1, %42 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge53, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge53.unr-lcssa
  %20 = getelementptr inbounds i64, ptr %6, i64 %.03451.unr
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %._crit_edge53, label %23

23:                                               ; preds = %.epil.preheader
  %24 = and i64 %21, %16
  %25 = icmp sgt i64 %24, %.03550.unr
  %spec.select.epil = select i1 %25, i64 %.03451.unr, i64 %.03649.unr
  %spec.select45.epil = call i64 @llvm.smax.i64(i64 %24, i64 %.03550.unr)
  br label %._crit_edge53

._crit_edge53:                                    ; preds = %.epil.preheader, %23, %._crit_edge53.unr-lcssa
  %.238.lcssa = phi i64 [ %.238.lcssa.ph, %._crit_edge53.unr-lcssa ], [ %.03649.unr, %.epil.preheader ], [ %spec.select.epil, %23 ]
  %.2.lcssa = phi i64 [ %.2.lcssa.ph, %._crit_edge53.unr-lcssa ], [ %.03550.unr, %.epil.preheader ], [ %spec.select45.epil, %23 ]
  %26 = icmp slt i64 %.2.lcssa, 0
  br i1 %26, label %._crit_edge53.thread, label %44

27:                                               ; preds = %42, %.lr.ph52.new
  %.03451 = phi i64 [ 0, %.lr.ph52.new ], [ %43, %42 ]
  %.03550 = phi i64 [ -1, %.lr.ph52.new ], [ %.2.1, %42 ]
  %.03649 = phi i64 [ -1, %.lr.ph52.new ], [ %.238.1, %42 ]
  %niter = phi i64 [ 0, %.lr.ph52.new ], [ %niter.next.1, %42 ]
  %28 = getelementptr inbounds i64, ptr %6, i64 %.03451
  %29 = load i64, ptr %28, align 16, !tbaa !5
  %30 = icmp slt i64 %29, 0
  br i1 %30, label %34, label %31

31:                                               ; preds = %27
  %32 = and i64 %29, %16
  %33 = icmp sgt i64 %32, %.03550
  %spec.select = select i1 %33, i64 %.03451, i64 %.03649
  %spec.select45 = call i64 @llvm.smax.i64(i64 %32, i64 %.03550)
  br label %34

34:                                               ; preds = %27, %31
  %.238 = phi i64 [ %.03649, %27 ], [ %spec.select, %31 ]
  %.2 = phi i64 [ %.03550, %27 ], [ %spec.select45, %31 ]
  %35 = or disjoint i64 %.03451, 1
  %36 = getelementptr inbounds i64, ptr %6, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = icmp slt i64 %37, 0
  br i1 %38, label %42, label %39

39:                                               ; preds = %34
  %40 = and i64 %37, %16
  %41 = icmp sgt i64 %40, %.2
  %spec.select.1 = select i1 %41, i64 %35, i64 %.238
  %spec.select45.1 = call i64 @llvm.smax.i64(i64 %40, i64 %.2)
  br label %42

42:                                               ; preds = %39, %34
  %.238.1 = phi i64 [ %.238, %34 ], [ %spec.select.1, %39 ]
  %.2.1 = phi i64 [ %.2, %34 ], [ %spec.select45.1, %39 ]
  %43 = add nuw nsw i64 %.03451, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge53.unr-lcssa, label %27, !llvm.loop !11

44:                                               ; preds = %._crit_edge53
  %45 = getelementptr inbounds i64, ptr %6, i64 %.238.lcssa
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %45)
          to label %46 unwind label %50

46:                                               ; preds = %44
  %47 = load i64, ptr %45, align 8, !tbaa !5
  %48 = or i64 %47, %.04055
  store i64 -1, ptr %45, align 8, !tbaa !5
  br label %._crit_edge53.thread

._crit_edge53.thread:                             ; preds = %.preheader47, %._crit_edge53, %46
  %.141 = phi i64 [ %48, %46 ], [ %.04055, %._crit_edge53 ], [ %.04055, %.preheader47 ]
  %49 = add nsw i64 %.03956, -1
  %.not63 = icmp eq i64 %.03956, 0
  br i1 %.not63, label %.preheader46, label %.preheader47, !llvm.loop !12

50:                                               ; preds = %44
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %80

.preheader:                                       ; preds = %59
  %52 = icmp sgt i64 %60, 0
  br i1 %52, label %.lr.ph60, label %._crit_edge61

.lr.ph58:                                         ; preds = %.preheader46, %59
  %53 = phi i64 [ %60, %59 ], [ %18, %.preheader46 ]
  %.03057 = phi i64 [ %61, %59 ], [ 0, %.preheader46 ]
  %54 = getelementptr inbounds i64, ptr %6, i64 %.03057
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %.not = icmp eq i64 %55, -1
  br i1 %.not, label %59, label %56

56:                                               ; preds = %.lr.ph58
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %54)
          to label %._crit_edge62 unwind label %57

._crit_edge62:                                    ; preds = %56
  %.pre = load i64, ptr %1, align 8, !tbaa !5
  br label %59

57:                                               ; preds = %56
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %80

59:                                               ; preds = %._crit_edge62, %.lr.ph58
  %60 = phi i64 [ %.pre, %._crit_edge62 ], [ %53, %.lr.ph58 ]
  %61 = add nuw nsw i64 %.03057, 1
  %62 = icmp slt i64 %61, %60
  br i1 %62, label %.lr.ph58, label %.preheader, !llvm.loop !13

._crit_edge61:                                    ; preds = %74, %.preheader46, %.preheader
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.stackrestore.p0(ptr %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret void

.lr.ph60:                                         ; preds = %.preheader, %74
  %.059 = phi i64 [ %75, %74 ], [ 0, %.preheader ]
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.059) #6
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %64)
          to label %66 unwind label %78

66:                                               ; preds = %.lr.ph60
  %67 = load i64, ptr %1, align 8, !tbaa !5
  %68 = add nsw i64 %67, -1
  %69 = icmp eq i64 %.059, %68
  %70 = zext i1 %69 to i64
  %71 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !14
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %65, i8 noundef signext %72)
          to label %74 unwind label %78

74:                                               ; preds = %66
  %75 = add nuw nsw i64 %.059, 1
  %76 = load i64, ptr %1, align 8, !tbaa !5
  %77 = icmp slt i64 %75, %76
  br i1 %77, label %.lr.ph60, label %._crit_edge61, !llvm.loop !15

78:                                               ; preds = %66, %.lr.ph60
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %80

80:                                               ; preds = %78, %57, %50
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %58, %57 ], [ %79, %78 ]
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn
}

; 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 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 dso_local void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

; 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 dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10}


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