; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #605 (Div. 3)/D. Remove One Element (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %13 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %21
  %23 = call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %22, i64 noundef 20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %25 = load i64, ptr %2, align 8, !tbaa !8
  %26 = call ptr @llvm.stacksave.p0()
  store ptr %26, ptr %3, align 8
  %27 = alloca i64, i64 %25, align 16
  store i64 %25, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %28

28:                                               ; preds = %37, %0
  %29 = load i64, ptr %5, align 8, !tbaa !8
  %30 = load i64, ptr %2, align 8, !tbaa !8
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %40

33:                                               ; preds = %28
  %34 = load i64, ptr %5, align 8, !tbaa !8
  %35 = getelementptr inbounds i64, ptr %27, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %35)
  br label %37

37:                                               ; preds = %33
  %38 = load i64, ptr %5, align 8, !tbaa !8
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %5, align 8, !tbaa !8
  br label %28, !llvm.loop !11

40:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store i64 1, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %41

41:                                               ; preds = %172, %40
  %42 = load i64, ptr %8, align 8, !tbaa !8
  %43 = load i64, ptr %2, align 8, !tbaa !8
  %44 = icmp slt i64 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %175

46:                                               ; preds = %41
  %47 = load i64, ptr %8, align 8, !tbaa !8
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %49, label %59

49:                                               ; preds = %46
  %50 = load i64, ptr %8, align 8, !tbaa !8
  %51 = getelementptr inbounds i64, ptr %27, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = load i64, ptr %8, align 8, !tbaa !8
  %54 = add nsw i64 %53, 1
  %55 = getelementptr inbounds i64, ptr %27, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !8
  %57 = icmp sge i64 %52, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %49
  store i64 1, ptr %6, align 8, !tbaa !8
  br label %171

59:                                               ; preds = %49, %46
  %60 = load i64, ptr %8, align 8, !tbaa !8
  %61 = load i64, ptr %2, align 8, !tbaa !8
  %62 = sub nsw i64 %61, 1
  %63 = icmp eq i64 %60, %62
  br i1 %63, label %64, label %76

64:                                               ; preds = %59
  %65 = load i64, ptr %8, align 8, !tbaa !8
  %66 = getelementptr inbounds i64, ptr %27, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = load i64, ptr %8, align 8, !tbaa !8
  %69 = sub nsw i64 %68, 1
  %70 = getelementptr inbounds i64, ptr %27, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !8
  %72 = icmp sle i64 %67, %71
  br i1 %72, label %73, label %76

73:                                               ; preds = %64
  %74 = load i64, ptr %2, align 8, !tbaa !8
  %75 = add nsw i64 %74, -1
  store i64 %75, ptr %2, align 8, !tbaa !8
  br label %170

76:                                               ; preds = %64, %59
  %77 = load i64, ptr %8, align 8, !tbaa !8
  %78 = getelementptr inbounds i64, ptr %27, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = load i64, ptr %8, align 8, !tbaa !8
  %81 = sub nsw i64 %80, 1
  %82 = getelementptr inbounds i64, ptr %27, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = icmp sgt i64 %79, %83
  br i1 %84, label %85, label %95

85:                                               ; preds = %76
  %86 = load i64, ptr %8, align 8, !tbaa !8
  %87 = getelementptr inbounds i64, ptr %27, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !8
  %89 = load i64, ptr %8, align 8, !tbaa !8
  %90 = add nsw i64 %89, 1
  %91 = getelementptr inbounds i64, ptr %27, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %93 = icmp slt i64 %88, %92
  br i1 %93, label %94, label %95

94:                                               ; preds = %85
  br label %172

95:                                               ; preds = %85, %76
  %96 = load i64, ptr %8, align 8, !tbaa !8
  %97 = add nsw i64 %96, 1
  %98 = getelementptr inbounds i64, ptr %27, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !8
  %100 = load i64, ptr %8, align 8, !tbaa !8
  %101 = sub nsw i64 %100, 1
  %102 = getelementptr inbounds i64, ptr %27, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !8
  %104 = icmp sgt i64 %99, %103
  br i1 %104, label %105, label %149

105:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %106 = load i64, ptr %8, align 8, !tbaa !8
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %9, align 8, !tbaa !8
  br label %108

108:                                              ; preds = %124, %105
  %109 = load i64, ptr %9, align 8, !tbaa !8
  %110 = load i64, ptr %2, align 8, !tbaa !8
  %111 = sub nsw i64 %110, 1
  %112 = icmp slt i64 %109, %111
  br i1 %112, label %113, label %122

113:                                              ; preds = %108
  %114 = load i64, ptr %9, align 8, !tbaa !8
  %115 = getelementptr inbounds i64, ptr %27, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = load i64, ptr %9, align 8, !tbaa !8
  %118 = add nsw i64 %117, 1
  %119 = getelementptr inbounds i64, ptr %27, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !8
  %121 = icmp slt i64 %116, %120
  br label %122

122:                                              ; preds = %113, %108
  %123 = phi i1 [ false, %108 ], [ %121, %113 ]
  br i1 %123, label %124, label %127

124:                                              ; preds = %122
  %125 = load i64, ptr %9, align 8, !tbaa !8
  %126 = add nsw i64 %125, 1
  store i64 %126, ptr %9, align 8, !tbaa !8
  br label %108, !llvm.loop !13

127:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %128 = load i64, ptr %9, align 8, !tbaa !8
  %129 = load i64, ptr %6, align 8, !tbaa !8
  %130 = sub nsw i64 %128, %129
  store i64 %130, ptr %10, align 8, !tbaa !8
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %132 = load i64, ptr %131, align 8, !tbaa !8
  store i64 %132, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %133 = load i64, ptr %8, align 8, !tbaa !8
  %134 = getelementptr inbounds i64, ptr %27, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !8
  %136 = load i64, ptr %8, align 8, !tbaa !8
  %137 = add nsw i64 %136, 1
  %138 = getelementptr inbounds i64, ptr %27, i64 %137
  %139 = load i64, ptr %138, align 8, !tbaa !8
  %140 = icmp slt i64 %135, %139
  br i1 %140, label %141, label %143

141:                                              ; preds = %127
  %142 = load i64, ptr %8, align 8, !tbaa !8
  store i64 %142, ptr %6, align 8, !tbaa !8
  br label %146

143:                                              ; preds = %127
  %144 = load i64, ptr %8, align 8, !tbaa !8
  %145 = add nsw i64 %144, 1
  store i64 %145, ptr %6, align 8, !tbaa !8
  br label %146

146:                                              ; preds = %143, %141
  %147 = load i64, ptr %9, align 8, !tbaa !8
  %148 = sub nsw i64 %147, 1
  store i64 %148, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %168

149:                                              ; preds = %95
  %150 = load i64, ptr %8, align 8, !tbaa !8
  %151 = getelementptr inbounds i64, ptr %27, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !8
  %153 = load i64, ptr %8, align 8, !tbaa !8
  %154 = sub nsw i64 %153, 1
  %155 = getelementptr inbounds i64, ptr %27, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !8
  %157 = icmp sgt i64 %152, %156
  br i1 %157, label %158, label %165

158:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %159 = load i64, ptr %8, align 8, !tbaa !8
  %160 = load i64, ptr %6, align 8, !tbaa !8
  %161 = sub nsw i64 %159, %160
  %162 = add nsw i64 %161, 1
  store i64 %162, ptr %11, align 8, !tbaa !8
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %164 = load i64, ptr %163, align 8, !tbaa !8
  store i64 %164, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %167

165:                                              ; preds = %149
  %166 = load i64, ptr %8, align 8, !tbaa !8
  store i64 %166, ptr %6, align 8, !tbaa !8
  br label %167

167:                                              ; preds = %165, %158
  br label %168

168:                                              ; preds = %167, %146
  br label %169

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169, %73
  br label %171

171:                                              ; preds = %170, %58
  br label %172

172:                                              ; preds = %171, %94
  %173 = load i64, ptr %8, align 8, !tbaa !8
  %174 = add nsw i64 %173, 1
  store i64 %174, ptr %8, align 8, !tbaa !8
  br label %41, !llvm.loop !14

175:                                              ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %176 = load i64, ptr %2, align 8, !tbaa !8
  %177 = load i64, ptr %6, align 8, !tbaa !8
  %178 = sub nsw i64 %176, %177
  store i64 %178, ptr %12, align 8, !tbaa !8
  %179 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %180 = load i64, ptr %179, align 8, !tbaa !8
  store i64 %180, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %181 = load i64, ptr %7, align 8, !tbaa !8
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %181)
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %182, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %184 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %184)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %185 = load i32, ptr %1, align 4
  ret i32 %185
}

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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216), i64 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

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

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

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 willreturn }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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 = !{!"long", !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}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %14
  %16 = tail call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %15, i64 noundef 20)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  %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 !8
  %19 = call ptr @llvm.stacksave.p0()
  %20 = alloca i64, i64 %18, align 16
  %21 = load i64, ptr %1, align 8, !tbaa !8
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store i64 1, ptr %2, align 8, !tbaa !8
  br label %._crit_edge50

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store i64 1, ptr %2, align 8, !tbaa !8
  %23 = icmp sgt i64 %28, 0
  br i1 %23, label %.lr.ph49, label %._crit_edge50

.lr.ph49:                                         ; preds = %._crit_edge
  %24 = getelementptr inbounds i8, ptr %20, i64 8
  br label %35

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03945 = phi i64 [ %27, %.lr.ph ], [ 0, %0 ]
  %25 = getelementptr inbounds i64, ptr %20, i64 %.03945
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %27 = add nuw nsw i64 %.03945, 1
  %28 = load i64, ptr %1, align 8, !tbaa !8
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge50:                                    ; preds = %.thread43, %._crit_edge.thread, %._crit_edge
  %.037.lcssa = phi i64 [ 0, %._crit_edge ], [ 0, %._crit_edge.thread ], [ %.2, %.thread43 ]
  %.lcssa = phi i64 [ %28, %._crit_edge ], [ %21, %._crit_edge.thread ], [ %84, %.thread43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %30 = sub nsw i64 %.lcssa, %.037.lcssa
  store i64 %30, ptr %5, align 8, !tbaa !8
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %32 = load i64, ptr %31, align 8, !tbaa !8
  store i64 %32, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %32)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.stackrestore.p0(ptr %19)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  ret i32 0

35:                                               ; preds = %.lr.ph49, %.thread43
  %36 = phi i64 [ %28, %.lr.ph49 ], [ %84, %.thread43 ]
  %.03647 = phi i64 [ 0, %.lr.ph49 ], [ %83, %.thread43 ]
  %.03746 = phi i64 [ 0, %.lr.ph49 ], [ %.2, %.thread43 ]
  %37 = icmp eq i64 %.03647, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %35
  %39 = load i64, ptr %20, align 16, !tbaa !8
  %40 = load i64, ptr %24, align 8, !tbaa !8
  %.not = icmp slt i64 %39, %40
  br i1 %.not, label %41, label %.thread43

41:                                               ; preds = %38, %35
  %42 = add nsw i64 %36, -1
  %43 = icmp ne i64 %.03647, %42
  %44 = getelementptr inbounds i64, ptr %20, i64 %.03647
  %45 = load i64, ptr %44, align 8, !tbaa !8
  %46 = getelementptr i8, ptr %44, i64 -8
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %.not42 = icmp sgt i64 %45, %47
  %or.cond = select i1 %43, i1 true, i1 %.not42
  br i1 %or.cond, label %._crit_edge53, label %48

48:                                               ; preds = %41
  store i64 %.03647, ptr %1, align 8, !tbaa !8
  br label %.thread43

._crit_edge53:                                    ; preds = %41
  %49 = getelementptr inbounds i64, ptr %20, i64 %.03647
  %50 = icmp sgt i64 %45, %47
  br i1 %50, label %51, label %.thread

51:                                               ; preds = %._crit_edge53
  %52 = getelementptr i8, ptr %49, i64 8
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = icmp slt i64 %45, %53
  br i1 %54, label %.thread43, label %55

55:                                               ; preds = %51
  %56 = add nsw i64 %.03647, 1
  %57 = getelementptr inbounds i64, ptr %20, i64 %56
  %58 = icmp sgt i64 %53, %47
  br i1 %58, label %.preheader, label %79

.thread:                                          ; preds = %._crit_edge53
  %59 = add nsw i64 %.03647, 1
  %60 = getelementptr inbounds i64, ptr %20, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = icmp sgt i64 %61, %47
  br i1 %62, label %.preheader, label %.thread43

.preheader:                                       ; preds = %55, %.thread
  %.ph = phi ptr [ %60, %.thread ], [ %57, %55 ]
  %.ph44 = phi i64 [ %59, %.thread ], [ %56, %55 ]
  %smax = call i64 @llvm.smax.i64(i64 %.ph44, i64 %42)
  br label %63

63:                                               ; preds = %.preheader, %65
  %.0 = phi i64 [ %68, %65 ], [ %.ph44, %.preheader ]
  %64 = icmp slt i64 %.0, %42
  br i1 %64, label %65, label %.critedge

65:                                               ; preds = %63
  %66 = getelementptr inbounds i64, ptr %20, i64 %.0
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = add nsw i64 %.0, 1
  %69 = getelementptr inbounds i64, ptr %20, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = icmp slt i64 %67, %70
  br i1 %71, label %63, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %63, %65
  %.0.lcssa = phi i64 [ %smax, %63 ], [ %.0, %65 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %72 = sub nsw i64 %.0.lcssa, %.03746
  store i64 %72, ptr %3, align 8, !tbaa !8
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %74 = load i64, ptr %73, align 8, !tbaa !8
  store i64 %74, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  %75 = load i64, ptr %49, align 8, !tbaa !8
  %76 = load i64, ptr %.ph, align 8, !tbaa !8
  %77 = icmp slt i64 %75, %76
  %.036. = select i1 %77, i64 %.03647, i64 %.ph44
  %78 = add nsw i64 %.0.lcssa, -1
  br label %.thread43

79:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %reass.sub = sub i64 %.03647, %.03746
  %80 = add i64 %reass.sub, 1
  store i64 %80, ptr %4, align 8, !tbaa !8
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %82 = load i64, ptr %81, align 8, !tbaa !8
  store i64 %82, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br label %.thread43

.thread43:                                        ; preds = %.thread, %38, %79, %.critedge, %48, %51
  %.2 = phi i64 [ %.03746, %48 ], [ %.03746, %51 ], [ %.036., %.critedge ], [ %.03746, %79 ], [ 1, %38 ], [ %.03647, %.thread ]
  %.1 = phi i64 [ %.03647, %48 ], [ %.03647, %51 ], [ %78, %.critedge ], [ %.03647, %79 ], [ 0, %38 ], [ %.03647, %.thread ]
  %83 = add nsw i64 %.1, 1
  %84 = load i64, ptr %1, align 8, !tbaa !8
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %35, label %._crit_edge50, !llvm.loop !14
}

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 nounwind uwtable
declare dso_local noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216), i64 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

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

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

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

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

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

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

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

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


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