; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #797 (Div. 3)/B. Array Decrements.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" }

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 {
  %1 = alloca i64, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  %18 = 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)
  %19 = load i64, ptr %1, align 8, !tbaa !5
  %20 = call ptr @llvm.stacksave.p0()
  store ptr %20, ptr %2, align 8
  %21 = alloca i64, i64 %19, align 16
  store i64 %19, ptr %3, align 8
  %22 = load i64, ptr %1, align 8, !tbaa !5
  %23 = alloca i64, i64 %22, align 16
  store i64 %22, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store ptr %21, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  store ptr %24, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = mul nuw i64 8, %19
  %27 = udiv i64 %26, 8
  %28 = getelementptr inbounds i64, ptr %25, i64 %27
  store ptr %28, ptr %7, align 8, !tbaa !9
  br label %29

29:                                               ; preds = %38, %0
  %30 = load ptr, ptr %6, align 8, !tbaa !9
  %31 = load ptr, ptr %7, align 8, !tbaa !9
  %32 = icmp ne ptr %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %35 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %35, ptr %8, align 8, !tbaa !9
  %36 = load ptr, ptr %8, align 8, !tbaa !9
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %36)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %38

38:                                               ; preds = %34
  %39 = load ptr, ptr %6, align 8, !tbaa !9
  %40 = getelementptr inbounds i64, ptr %39, i32 1
  store ptr %40, ptr %6, align 8, !tbaa !9
  br label %29

41:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr %23, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %42 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %42, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %43 = load ptr, ptr %9, align 8, !tbaa !9
  %44 = mul nuw i64 8, %22
  %45 = udiv i64 %44, 8
  %46 = getelementptr inbounds i64, ptr %43, i64 %45
  store ptr %46, ptr %11, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %56, %41
  %48 = load ptr, ptr %10, align 8, !tbaa !9
  %49 = load ptr, ptr %11, align 8, !tbaa !9
  %50 = icmp ne ptr %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %59

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %53 = load ptr, ptr %10, align 8, !tbaa !9
  store ptr %53, ptr %12, align 8, !tbaa !9
  %54 = load ptr, ptr %12, align 8, !tbaa !9
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %54)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %56

56:                                               ; preds = %52
  %57 = load ptr, ptr %10, align 8, !tbaa !9
  %58 = getelementptr inbounds i64, ptr %57, i32 1
  store ptr %58, ptr %10, align 8, !tbaa !9
  br label %47

59:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i8 1, ptr %13, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %60 = getelementptr inbounds i64, ptr %21, i64 0
  %61 = load i64, ptr %60, align 16, !tbaa !5
  %62 = getelementptr inbounds i64, ptr %23, i64 0
  %63 = load i64, ptr %62, align 16, !tbaa !5
  %64 = sub nsw i64 %61, %63
  store i64 %64, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 1, ptr %15, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %80, %59
  %66 = load i64, ptr %15, align 8, !tbaa !5
  %67 = load i64, ptr %1, align 8, !tbaa !5
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %83

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %71 = load i64, ptr %15, align 8, !tbaa !5
  %72 = getelementptr inbounds i64, ptr %21, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = load i64, ptr %15, align 8, !tbaa !5
  %75 = getelementptr inbounds i64, ptr %23, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = sub nsw i64 %73, %76
  store i64 %77, ptr %16, align 8, !tbaa !5
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %79 = load i64, ptr %78, align 8, !tbaa !5
  store i64 %79, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %80

80:                                               ; preds = %70
  %81 = load i64, ptr %15, align 8, !tbaa !5
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %15, align 8, !tbaa !5
  br label %65, !llvm.loop !13

83:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 0, ptr %17, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %126, %83
  %85 = load i64, ptr %17, align 8, !tbaa !5
  %86 = load i64, ptr %1, align 8, !tbaa !5
  %87 = icmp slt i64 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %129

89:                                               ; preds = %84
  %90 = load i64, ptr %17, align 8, !tbaa !5
  %91 = getelementptr inbounds i64, ptr %21, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !5
  %93 = load i64, ptr %17, align 8, !tbaa !5
  %94 = getelementptr inbounds i64, ptr %23, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = icmp slt i64 %92, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %89
  store i8 0, ptr %13, align 1, !tbaa !11
  br label %98

98:                                               ; preds = %97, %89
  %99 = load i64, ptr %17, align 8, !tbaa !5
  %100 = getelementptr inbounds i64, ptr %21, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !5
  %102 = load i64, ptr %17, align 8, !tbaa !5
  %103 = getelementptr inbounds i64, ptr %23, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !5
  %105 = sub nsw i64 %101, %104
  %106 = load i64, ptr %14, align 8, !tbaa !5
  %107 = icmp sgt i64 %105, %106
  br i1 %107, label %108, label %109

108:                                              ; preds = %98
  store i8 0, ptr %13, align 1, !tbaa !11
  br label %109

109:                                              ; preds = %108, %98
  %110 = load i64, ptr %17, align 8, !tbaa !5
  %111 = getelementptr inbounds i64, ptr %21, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !5
  %113 = load i64, ptr %17, align 8, !tbaa !5
  %114 = getelementptr inbounds i64, ptr %23, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = sub nsw i64 %112, %115
  %117 = load i64, ptr %14, align 8, !tbaa !5
  %118 = icmp slt i64 %116, %117
  br i1 %118, label %119, label %125

119:                                              ; preds = %109
  %120 = load i64, ptr %17, align 8, !tbaa !5
  %121 = getelementptr inbounds i64, ptr %23, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !5
  %123 = icmp ne i64 %122, 0
  br i1 %123, label %124, label %125

124:                                              ; preds = %119
  store i8 0, ptr %13, align 1, !tbaa !11
  br label %125

125:                                              ; preds = %124, %119, %109
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %17, align 8, !tbaa !5
  %128 = add nsw i64 %127, 1
  store i64 %128, ptr %17, align 8, !tbaa !5
  br label %84, !llvm.loop !15

129:                                              ; preds = %88
  %130 = load i8, ptr %13, align 1, !tbaa !11, !range !16, !noundef !17
  %131 = trunc i8 %130 to i1
  %132 = zext i1 %131 to i64
  %133 = select i1 %131, ptr @.str.1, ptr @.str.2
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %133)
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %134, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  %136 = load ptr, ptr %2, align 8
  call void @llvm.stackrestore.p0(ptr %136)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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)) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!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" }

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %4 = 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)
  %5 = load i64, ptr %1, align 8, !tbaa !5
  %6 = call ptr @llvm.stacksave.p0()
  %7 = alloca i64, i64 %5, align 16
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = alloca i64, i64 %8, align 16
  %10 = getelementptr inbounds i64, ptr %7, i64 %5
  %.not34 = icmp eq i64 %5, 0
  br i1 %.not34, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %11 = getelementptr inbounds i64, ptr %9, i64 %8
  %.not3236 = icmp eq i64 %8, 0
  br i1 %.not3236, label %._crit_edge40, label %.lr.ph39

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03035 = phi ptr [ %13, %.lr.ph ], [ %7, %0 ]
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %.03035)
  %13 = getelementptr inbounds i8, ptr %.03035, i64 8
  %.not = icmp eq ptr %13, %10
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge40.loopexit:                           ; preds = %.lr.ph39
  %.pre = load i64, ptr %9, align 16, !tbaa !5
  br label %._crit_edge40

._crit_edge40:                                    ; preds = %._crit_edge40.loopexit, %._crit_edge
  %14 = phi i64 [ %.pre, %._crit_edge40.loopexit ], [ undef, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %15 = load i64, ptr %7, align 16, !tbaa !5
  %16 = sub nsw i64 %15, %14
  store i64 %16, ptr %2, align 8, !tbaa !5
  %17 = load i64, ptr %1, align 8, !tbaa !5
  %18 = icmp sgt i64 %17, 1
  br i1 %18, label %.lr.ph43, label %.preheader

.lr.ph39:                                         ; preds = %._crit_edge, %.lr.ph39
  %.03137 = phi ptr [ %20, %.lr.ph39 ], [ %9, %._crit_edge ]
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %.03137)
  %20 = getelementptr inbounds i8, ptr %.03137, i64 8
  %.not32 = icmp eq ptr %20, %11
  br i1 %.not32, label %._crit_edge40.loopexit, label %.lr.ph39

.preheader:                                       ; preds = %.lr.ph43, %._crit_edge40
  %21 = phi i64 [ %16, %._crit_edge40 ], [ %30, %.lr.ph43 ]
  %.lcssa = phi i64 [ %17, %._crit_edge40 ], [ %32, %.lr.ph43 ]
  %22 = icmp sgt i64 %.lcssa, 0
  br i1 %22, label %.lr.ph46.preheader, label %._crit_edge47

.lr.ph46.preheader:                               ; preds = %.preheader
  %xtraiter = and i64 %.lcssa, 1
  %23 = icmp eq i64 %.lcssa, 1
  br i1 %23, label %._crit_edge47.loopexit.unr-lcssa, label %.lr.ph46.preheader.new

.lr.ph46.preheader.new:                           ; preds = %.lr.ph46.preheader
  %unroll_iter = and i64 %.lcssa, 9223372036854775806
  br label %.lr.ph46

.lr.ph43:                                         ; preds = %._crit_edge40, %.lr.ph43
  %.02841 = phi i64 [ %31, %.lr.ph43 ], [ 1, %._crit_edge40 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %24 = getelementptr inbounds i64, ptr %7, i64 %.02841
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = getelementptr inbounds i64, ptr %9, i64 %.02841
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = sub nsw i64 %25, %27
  store i64 %28, ptr %3, align 8, !tbaa !5
  %29 = 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)
  %30 = load i64, ptr %29, align 8, !tbaa !5
  store i64 %30, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %31 = add nuw nsw i64 %.02841, 1
  %32 = load i64, ptr %1, align 8, !tbaa !5
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %.lr.ph43, label %.preheader, !llvm.loop !9

._crit_edge47.loopexit.unr-lcssa:                 ; preds = %.lr.ph46, %.lr.ph46.preheader
  %.3.lcssa.ph = phi i1 [ poison, %.lr.ph46.preheader ], [ %.3.1, %.lr.ph46 ]
  %.045.unr = phi i64 [ 0, %.lr.ph46.preheader ], [ %66, %.lr.ph46 ]
  %.02944.unr = phi i1 [ true, %.lr.ph46.preheader ], [ %.3.1, %.lr.ph46 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge47.loopexit, label %.lr.ph46.epil

.lr.ph46.epil:                                    ; preds = %._crit_edge47.loopexit.unr-lcssa
  %34 = getelementptr inbounds i64, ptr %7, i64 %.045.unr
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds i64, ptr %9, i64 %.045.unr
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = icmp sge i64 %35, %37
  %39 = sub nsw i64 %35, %37
  %40 = icmp sle i64 %39, %21
  %.not51.epil = and i1 %38, %40
  %41 = icmp sge i64 %39, %21
  %.not33.epil = icmp eq i64 %37, 0
  %or.cond.epil = or i1 %.not33.epil, %41
  %42 = select i1 %or.cond.epil, i1 %.not51.epil, i1 false
  %.3.epil = select i1 %42, i1 %.02944.unr, i1 false
  br label %._crit_edge47.loopexit

._crit_edge47.loopexit:                           ; preds = %._crit_edge47.loopexit.unr-lcssa, %.lr.ph46.epil
  %.3.lcssa = phi i1 [ %.3.lcssa.ph, %._crit_edge47.loopexit.unr-lcssa ], [ %.3.epil, %.lr.ph46.epil ]
  %43 = select i1 %.3.lcssa, ptr @.str.1, ptr @.str.2
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %._crit_edge47.loopexit, %.preheader
  %.029.lcssa = phi ptr [ @.str.1, %.preheader ], [ %43, %._crit_edge47.loopexit ]
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.029.lcssa)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.stackrestore.p0(ptr %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret void

.lr.ph46:                                         ; preds = %.lr.ph46, %.lr.ph46.preheader.new
  %.045 = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %66, %.lr.ph46 ]
  %.02944 = phi i1 [ true, %.lr.ph46.preheader.new ], [ %.3.1, %.lr.ph46 ]
  %niter = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %niter.next.1, %.lr.ph46 ]
  %46 = getelementptr inbounds i64, ptr %7, i64 %.045
  %47 = load i64, ptr %46, align 16, !tbaa !5
  %48 = getelementptr inbounds i64, ptr %9, i64 %.045
  %49 = load i64, ptr %48, align 16, !tbaa !5
  %50 = icmp sge i64 %47, %49
  %51 = sub nsw i64 %47, %49
  %52 = icmp sle i64 %51, %21
  %.not51 = and i1 %50, %52
  %53 = icmp sge i64 %51, %21
  %.not33 = icmp eq i64 %49, 0
  %or.cond = or i1 %.not33, %53
  %54 = or disjoint i64 %.045, 1
  %55 = getelementptr inbounds i64, ptr %7, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds i64, ptr %9, i64 %54
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = icmp sge i64 %56, %58
  %60 = sub nsw i64 %56, %58
  %61 = icmp sle i64 %60, %21
  %.not51.1 = and i1 %59, %61
  %62 = icmp sge i64 %60, %21
  %.not33.1 = icmp eq i64 %58, 0
  %or.cond.1 = or i1 %.not33.1, %62
  %63 = select i1 %or.cond.1, i1 %.not51.1, i1 false
  %64 = select i1 %63, i1 %or.cond, i1 false
  %65 = select i1 %64, i1 %.not51, i1 false
  %.3.1 = select i1 %65, i1 %.02944, i1 false
  %66 = add nuw nsw i64 %.045, 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_edge47.loopexit.unr-lcssa, label %.lr.ph46, !llvm.loop !11
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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 #4

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

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


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