; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Random Problems/B. Frodo and pillows (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 i64, 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
  store i32 0, ptr %1, align 4
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %20
  %22 = call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %21, i64 noundef 20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %23 = 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)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %26 = load i64, ptr %4, align 8, !tbaa !8
  store i64 %26, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %27 = load i64, ptr %4, align 8, !tbaa !8
  store i64 %27, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  %28 = load i64, ptr %3, align 8, !tbaa !8
  %29 = load i64, ptr %2, align 8, !tbaa !8
  %30 = icmp sge i64 %28, %29
  br i1 %30, label %31, label %37

31:                                               ; preds = %0
  %32 = load i64, ptr %2, align 8, !tbaa !8
  %33 = load i64, ptr %3, align 8, !tbaa !8
  %34 = sub nsw i64 %33, %32
  store i64 %34, ptr %3, align 8, !tbaa !8
  %35 = load i64, ptr %7, align 8, !tbaa !8
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %7, align 8, !tbaa !8
  br label %37

37:                                               ; preds = %31, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %38 = load i64, ptr %4, align 8, !tbaa !8
  %39 = load i64, ptr %5, align 8, !tbaa !8
  %40 = sub nsw i64 %38, %39
  %41 = icmp slt i64 %40, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %37
  %43 = load i64, ptr %4, align 8, !tbaa !8
  %44 = load i64, ptr %5, align 8, !tbaa !8
  %45 = sub nsw i64 %43, %44
  %46 = sub nsw i64 0, %45
  br label %51

47:                                               ; preds = %37
  %48 = load i64, ptr %4, align 8, !tbaa !8
  %49 = load i64, ptr %5, align 8, !tbaa !8
  %50 = sub nsw i64 %48, %49
  br label %51

51:                                               ; preds = %47, %42
  %52 = phi i64 [ %46, %42 ], [ %50, %47 ]
  %53 = load i64, ptr %4, align 8, !tbaa !8
  %54 = load i64, ptr %6, align 8, !tbaa !8
  %55 = sub nsw i64 %53, %54
  %56 = icmp slt i64 %55, 0
  br i1 %56, label %57, label %62

57:                                               ; preds = %51
  %58 = load i64, ptr %4, align 8, !tbaa !8
  %59 = load i64, ptr %6, align 8, !tbaa !8
  %60 = sub nsw i64 %58, %59
  %61 = sub nsw i64 0, %60
  br label %66

62:                                               ; preds = %51
  %63 = load i64, ptr %4, align 8, !tbaa !8
  %64 = load i64, ptr %6, align 8, !tbaa !8
  %65 = sub nsw i64 %63, %64
  br label %66

66:                                               ; preds = %62, %57
  %67 = phi i64 [ %61, %57 ], [ %65, %62 ]
  %68 = add nsw i64 %52, %67
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %8, align 8, !tbaa !8
  br label %70

70:                                               ; preds = %127, %66
  %71 = load i64, ptr %8, align 8, !tbaa !8
  %72 = load i64, ptr %3, align 8, !tbaa !8
  %73 = icmp sle i64 %71, %72
  br i1 %73, label %74, label %128

74:                                               ; preds = %70
  %75 = load i64, ptr %8, align 8, !tbaa !8
  %76 = load i64, ptr %3, align 8, !tbaa !8
  %77 = sub nsw i64 %76, %75
  store i64 %77, ptr %3, align 8, !tbaa !8
  %78 = load i64, ptr %7, align 8, !tbaa !8
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %80 = load i64, ptr %5, align 8, !tbaa !8
  %81 = sub nsw i64 %80, 1
  store i64 %81, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 1, ptr %10, align 8, !tbaa !8
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %83 = load i64, ptr %82, align 8, !tbaa !8
  store i64 %83, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %84 = load i64, ptr %6, align 8, !tbaa !8
  %85 = add nsw i64 %84, 1
  store i64 %85, ptr %11, align 8, !tbaa !8
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %87 = load i64, ptr %86, align 8, !tbaa !8
  store i64 %87, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %88 = load i64, ptr %4, align 8, !tbaa !8
  %89 = load i64, ptr %5, align 8, !tbaa !8
  %90 = sub nsw i64 %88, %89
  %91 = icmp slt i64 %90, 0
  br i1 %91, label %92, label %97

92:                                               ; preds = %74
  %93 = load i64, ptr %4, align 8, !tbaa !8
  %94 = load i64, ptr %5, align 8, !tbaa !8
  %95 = sub nsw i64 %93, %94
  %96 = sub nsw i64 0, %95
  br label %101

97:                                               ; preds = %74
  %98 = load i64, ptr %4, align 8, !tbaa !8
  %99 = load i64, ptr %5, align 8, !tbaa !8
  %100 = sub nsw i64 %98, %99
  br label %101

101:                                              ; preds = %97, %92
  %102 = phi i64 [ %96, %92 ], [ %100, %97 ]
  %103 = load i64, ptr %4, align 8, !tbaa !8
  %104 = load i64, ptr %6, align 8, !tbaa !8
  %105 = sub nsw i64 %103, %104
  %106 = icmp slt i64 %105, 0
  br i1 %106, label %107, label %112

107:                                              ; preds = %101
  %108 = load i64, ptr %4, align 8, !tbaa !8
  %109 = load i64, ptr %6, align 8, !tbaa !8
  %110 = sub nsw i64 %108, %109
  %111 = sub nsw i64 0, %110
  br label %116

112:                                              ; preds = %101
  %113 = load i64, ptr %4, align 8, !tbaa !8
  %114 = load i64, ptr %6, align 8, !tbaa !8
  %115 = sub nsw i64 %113, %114
  br label %116

116:                                              ; preds = %112, %107
  %117 = phi i64 [ %111, %107 ], [ %115, %112 ]
  %118 = add nsw i64 %102, %117
  %119 = add nsw i64 %118, 1
  store i64 %119, ptr %8, align 8, !tbaa !8
  %120 = load i64, ptr %5, align 8, !tbaa !8
  %121 = icmp eq i64 %120, 1
  br i1 %121, label %122, label %127

122:                                              ; preds = %116
  %123 = load i64, ptr %6, align 8, !tbaa !8
  %124 = load i64, ptr %2, align 8, !tbaa !8
  %125 = icmp eq i64 %123, %124
  br i1 %125, label %126, label %127

126:                                              ; preds = %122
  br label %128

127:                                              ; preds = %122, %116
  br label %70, !llvm.loop !11

128:                                              ; preds = %126, %70
  %129 = load i64, ptr %5, align 8, !tbaa !8
  %130 = icmp eq i64 %129, 1
  br i1 %130, label %131, label %141

131:                                              ; preds = %128
  %132 = load i64, ptr %6, align 8, !tbaa !8
  %133 = load i64, ptr %2, align 8, !tbaa !8
  %134 = icmp eq i64 %132, %133
  br i1 %134, label %135, label %141

135:                                              ; preds = %131
  %136 = load i64, ptr %3, align 8, !tbaa !8
  %137 = load i64, ptr %2, align 8, !tbaa !8
  %138 = sdiv i64 %136, %137
  %139 = load i64, ptr %7, align 8, !tbaa !8
  %140 = add nsw i64 %139, %138
  store i64 %140, ptr %7, align 8, !tbaa !8
  br label %141

141:                                              ; preds = %135, %131, %128
  %142 = load i64, ptr %7, align 8, !tbaa !8
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %142)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  ret i32 0
}

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: 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)) #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 @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; 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

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 = { 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 #6 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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 = alloca i64, align 8
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %15
  %17 = tail call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %16, i64 noundef 20)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %21 = load i64, ptr %3, align 8, !tbaa !8
  %22 = load i64, ptr %2, align 8, !tbaa !8
  %23 = load i64, ptr %1, align 8, !tbaa !8
  %.not = icmp slt i64 %22, %23
  br i1 %.not, label %26, label %24

24:                                               ; preds = %0
  %25 = sub nsw i64 %22, %23
  store i64 %25, ptr %2, align 8, !tbaa !8
  br label %26

26:                                               ; preds = %24, %0
  %.024 = phi i64 [ 1, %24 ], [ 0, %0 ]
  %27 = load i64, ptr %2, align 8, !tbaa !8
  %.not43.not74 = icmp sgt i64 %27, 0
  br i1 %.not43.not74, label %.lr.ph, label %._crit_edge

28:                                               ; preds = %.lr.ph
  %29 = load i64, ptr %3, align 8, !tbaa !8
  %30 = sub nsw i64 %29, %41
  %31 = call i64 @llvm.abs.i64(i64 %30, i1 true)
  %32 = sub nsw i64 %29, %44
  %33 = call i64 @llvm.abs.i64(i64 %32, i1 true)
  %34 = add nuw nsw i64 %31, %33
  %35 = load i64, ptr %2, align 8, !tbaa !8
  %.not43.not = icmp slt i64 %34, %35
  br i1 %.not43.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph:                                           ; preds = %26, %28
  %36 = phi i64 [ %35, %28 ], [ %27, %26 ]
  %.0.in78 = phi i64 [ %34, %28 ], [ 0, %26 ]
  %.177 = phi i64 [ %38, %28 ], [ %.024, %26 ]
  %.02576 = phi i64 [ %44, %28 ], [ %21, %26 ]
  %.02775 = phi i64 [ %41, %28 ], [ %21, %26 ]
  %.0.neg = xor i64 %.0.in78, -1
  %37 = add nsw i64 %36, %.0.neg
  store i64 %37, ptr %2, align 8, !tbaa !8
  %38 = add nuw nsw i64 %.177, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %39 = add nsw i64 %.02775, -1
  store i64 %39, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store i64 1, ptr %5, align 8, !tbaa !8
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %41 = load i64, ptr %40, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %42 = add nsw i64 %.02576, 1
  store i64 %42, ptr %6, align 8, !tbaa !8
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %44 = load i64, ptr %43, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %45 = icmp eq i64 %41, 1
  %46 = load i64, ptr %1, align 8
  %47 = icmp eq i64 %44, %46
  %or.cond = select i1 %45, i1 %47, i1 false
  br i1 %or.cond, label %.thread.thread, label %28, !llvm.loop !11

._crit_edge:                                      ; preds = %28, %26
  %.lcssa = phi i64 [ %23, %26 ], [ %46, %28 ]
  %.027.lcssa = phi i64 [ %21, %26 ], [ %41, %28 ]
  %.025.lcssa = phi i64 [ %21, %26 ], [ %44, %28 ]
  %.1.lcssa = phi i64 [ %.024, %26 ], [ %38, %28 ]
  %48 = icmp eq i64 %.027.lcssa, 1
  %49 = icmp eq i64 %.025.lcssa, %.lcssa
  %or.cond67 = select i1 %48, i1 %49, i1 false
  br i1 %or.cond67, label %.thread.thread, label %54

.thread.thread:                                   ; preds = %.lr.ph, %._crit_edge
  %.24960 = phi i64 [ %.1.lcssa, %._crit_edge ], [ %38, %.lr.ph ]
  %50 = phi i64 [ %.lcssa, %._crit_edge ], [ %44, %.lr.ph ]
  %51 = load i64, ptr %2, align 8, !tbaa !8
  %52 = sdiv i64 %51, %50
  %53 = add nsw i64 %52, %.24960
  br label %54

54:                                               ; preds = %.thread.thread, %._crit_edge
  %.3 = phi i64 [ %53, %.thread.thread ], [ %.1.lcssa, %._crit_edge ]
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.3)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress 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: 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 #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 @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #7

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 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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"}


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