; LLVM IR from abeaumont/competitive-programming :: kattis (sylvester)

; 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 [3 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 i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  br label %22

22:                                               ; preds = %119, %0
  %23 = load i64, ptr %2, align 8, !tbaa !8
  %24 = add nsw i64 %23, -1
  store i64 %24, ptr %2, align 8, !tbaa !8
  %25 = icmp ne i64 %23, 0
  br i1 %25, label %26, label %120

26:                                               ; preds = %22
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %32 = load i64, ptr %5, align 8, !tbaa !8
  store i64 %32, ptr %8, align 8, !tbaa !8
  br label %33

33:                                               ; preds = %111, %26
  %34 = load i64, ptr %8, align 8, !tbaa !8
  %35 = load i64, ptr %5, align 8, !tbaa !8
  %36 = load i64, ptr %7, align 8, !tbaa !8
  %37 = add nsw i64 %35, %36
  %38 = icmp slt i64 %34, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %33
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %114

40:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %41 = load i64, ptr %4, align 8, !tbaa !8
  store i64 %41, ptr %10, align 8, !tbaa !8
  br label %42

42:                                               ; preds = %107, %40
  %43 = load i64, ptr %10, align 8, !tbaa !8
  %44 = load i64, ptr %4, align 8, !tbaa !8
  %45 = load i64, ptr %6, align 8, !tbaa !8
  %46 = add nsw i64 %44, %45
  %47 = icmp slt i64 %43, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %42
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %110

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 1, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %50 = load i64, ptr %8, align 8, !tbaa !8
  store i64 %50, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %51 = load i64, ptr %10, align 8, !tbaa !8
  store i64 %51, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %52 = load i64, ptr %3, align 8, !tbaa !8
  store i64 %52, ptr %14, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %91, %49
  %54 = load i64, ptr %14, align 8, !tbaa !8
  %55 = icmp sgt i64 %54, 1
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %94

57:                                               ; preds = %53
  %58 = load i64, ptr %12, align 8, !tbaa !8
  %59 = load i64, ptr %14, align 8, !tbaa !8
  %60 = sdiv i64 %59, 2
  %61 = icmp sge i64 %58, %60
  br i1 %61, label %62, label %70

62:                                               ; preds = %57
  %63 = load i64, ptr %13, align 8, !tbaa !8
  %64 = load i64, ptr %14, align 8, !tbaa !8
  %65 = sdiv i64 %64, 2
  %66 = icmp sge i64 %63, %65
  br i1 %66, label %67, label %70

67:                                               ; preds = %62
  %68 = load i64, ptr %11, align 8, !tbaa !8
  %69 = mul nsw i64 %68, -1
  store i64 %69, ptr %11, align 8, !tbaa !8
  br label %70

70:                                               ; preds = %67, %62, %57
  %71 = load i64, ptr %12, align 8, !tbaa !8
  %72 = load i64, ptr %14, align 8, !tbaa !8
  %73 = sdiv i64 %72, 2
  %74 = icmp sge i64 %71, %73
  br i1 %74, label %75, label %80

75:                                               ; preds = %70
  %76 = load i64, ptr %14, align 8, !tbaa !8
  %77 = sdiv i64 %76, 2
  %78 = load i64, ptr %12, align 8, !tbaa !8
  %79 = sub nsw i64 %78, %77
  store i64 %79, ptr %12, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %75, %70
  %81 = load i64, ptr %13, align 8, !tbaa !8
  %82 = load i64, ptr %14, align 8, !tbaa !8
  %83 = sdiv i64 %82, 2
  %84 = icmp sge i64 %81, %83
  br i1 %84, label %85, label %90

85:                                               ; preds = %80
  %86 = load i64, ptr %14, align 8, !tbaa !8
  %87 = sdiv i64 %86, 2
  %88 = load i64, ptr %13, align 8, !tbaa !8
  %89 = sub nsw i64 %88, %87
  store i64 %89, ptr %13, align 8, !tbaa !8
  br label %90

90:                                               ; preds = %85, %80
  br label %91

91:                                               ; preds = %90
  %92 = load i64, ptr %14, align 8, !tbaa !8
  %93 = sdiv i64 %92, 2
  store i64 %93, ptr %14, align 8, !tbaa !8
  br label %53, !llvm.loop !11

94:                                               ; preds = %56
  %95 = load i64, ptr %11, align 8, !tbaa !8
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %95)
  %97 = load i64, ptr %10, align 8, !tbaa !8
  %98 = load i64, ptr %4, align 8, !tbaa !8
  %99 = load i64, ptr %6, align 8, !tbaa !8
  %100 = add nsw i64 %98, %99
  %101 = sub nsw i64 %100, 1
  %102 = icmp eq i64 %97, %101
  %103 = zext i1 %102 to i64
  %104 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %103
  %105 = load i8, ptr %104, align 1, !tbaa !13
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %96, i8 noundef signext %105)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %107

107:                                              ; preds = %94
  %108 = load i64, ptr %10, align 8, !tbaa !8
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %10, align 8, !tbaa !8
  br label %42, !llvm.loop !14

110:                                              ; preds = %48
  br label %111

111:                                              ; preds = %110
  %112 = load i64, ptr %8, align 8, !tbaa !8
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %8, align 8, !tbaa !8
  br label %33, !llvm.loop !15

114:                                              ; preds = %39
  %115 = load i64, ptr %2, align 8, !tbaa !8
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %119

117:                                              ; preds = %114
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  br label %119

119:                                              ; preds = %117, %114
  br label %22, !llvm.loop !16

120:                                              ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %121 = load i32, ptr %1, align 4
  ret i32 %121
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #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 @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !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 [3 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 = 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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %14 = load i64, ptr %1, align 8, !tbaa !8
  %15 = add nsw i64 %14, -1
  store i64 %15, ptr %1, align 8, !tbaa !8
  %.not49 = icmp eq i64 %14, 0
  br i1 %.not49, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %0, %59
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %21 = load i64, ptr %6, align 8, !tbaa !8
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph47.preheader, label %._crit_edge48

.lr.ph47.preheader:                               ; preds = %.lr.ph51
  %23 = load i64, ptr %4, align 8, !tbaa !8
  %.pre = load i64, ptr %3, align 8, !tbaa !8
  %.pre53 = load i64, ptr %5, align 8, !tbaa !8
  br label %.lr.ph47

._crit_edge48:                                    ; preds = %._crit_edge44, %.lr.ph51
  %24 = load i64, ptr %1, align 8, !tbaa !8
  %.not33 = icmp eq i64 %24, 0
  br i1 %.not33, label %._crit_edge52, label %59

.lr.ph47:                                         ; preds = %.lr.ph47.preheader, %._crit_edge44
  %25 = phi i64 [ %30, %._crit_edge44 ], [ %21, %.lr.ph47.preheader ]
  %26 = phi i64 [ %31, %._crit_edge44 ], [ %23, %.lr.ph47.preheader ]
  %27 = phi i64 [ %32, %._crit_edge44 ], [ %.pre53, %.lr.ph47.preheader ]
  %28 = phi i64 [ %33, %._crit_edge44 ], [ %.pre, %.lr.ph47.preheader ]
  %.03045 = phi i64 [ %34, %._crit_edge44 ], [ %23, %.lr.ph47.preheader ]
  %29 = icmp sgt i64 %27, 0
  br i1 %29, label %.lr.ph43, label %._crit_edge44

._crit_edge44.loopexit:                           ; preds = %._crit_edge
  %.pre54 = load i64, ptr %4, align 8, !tbaa !8
  %.pre55 = load i64, ptr %6, align 8, !tbaa !8
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %._crit_edge44.loopexit, %.lr.ph47
  %30 = phi i64 [ %.pre55, %._crit_edge44.loopexit ], [ %25, %.lr.ph47 ]
  %31 = phi i64 [ %.pre54, %._crit_edge44.loopexit ], [ %26, %.lr.ph47 ]
  %32 = phi i64 [ %51, %._crit_edge44.loopexit ], [ %27, %.lr.ph47 ]
  %33 = phi i64 [ %50, %._crit_edge44.loopexit ], [ %28, %.lr.ph47 ]
  %34 = add nsw i64 %.03045, 1
  %35 = add nsw i64 %30, %31
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %.lr.ph47, label %._crit_edge48, !llvm.loop !11

.lr.ph43:                                         ; preds = %.lr.ph47, %._crit_edge
  %.02941 = phi i64 [ %49, %._crit_edge ], [ %28, %.lr.ph47 ]
  %37 = load i64, ptr %2, align 8, !tbaa !8
  %38 = icmp sgt i64 %37, 1
  br i1 %38, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph43
  %.027.lcssa = phi i64 [ 1, %.lr.ph43 ], [ %.128, %.lr.ph ]
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.027.lcssa)
  %40 = load i64, ptr %3, align 8, !tbaa !8
  %41 = load i64, ptr %5, align 8, !tbaa !8
  %42 = add i64 %40, -1
  %43 = add i64 %42, %41
  %44 = icmp eq i64 %.02941, %43
  %45 = zext i1 %44 to i64
  %46 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !13
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %39, i8 noundef signext %47)
  %49 = add nsw i64 %.02941, 1
  %50 = load i64, ptr %3, align 8, !tbaa !8
  %51 = load i64, ptr %5, align 8, !tbaa !8
  %52 = add nsw i64 %51, %50
  %53 = icmp slt i64 %49, %52
  br i1 %53, label %.lr.ph43, label %._crit_edge44.loopexit, !llvm.loop !14

.lr.ph:                                           ; preds = %.lr.ph43, %.lr.ph
  %.040 = phi i64 [ %54, %.lr.ph ], [ %37, %.lr.ph43 ]
  %.02439 = phi i64 [ %.1, %.lr.ph ], [ %.02941, %.lr.ph43 ]
  %.02538 = phi i64 [ %.126, %.lr.ph ], [ %.03045, %.lr.ph43 ]
  %.02737 = phi i64 [ %.128, %.lr.ph ], [ 1, %.lr.ph43 ]
  %54 = lshr i64 %.040, 1
  %.not34 = icmp slt i64 %.02538, %54
  %.not35 = icmp slt i64 %.02439, %54
  %or.cond = select i1 %.not34, i1 true, i1 %.not35
  %55 = sub nsw i64 0, %.02737
  %.128 = select i1 %or.cond, i64 %.02737, i64 %55
  %56 = select i1 %.not34, i64 0, i64 %54
  %.126 = sub nsw i64 %.02538, %56
  %57 = select i1 %.not35, i64 0, i64 %54
  %.1 = sub nsw i64 %.02439, %57
  %58 = icmp ugt i64 %.040, 3
  br i1 %58, label %.lr.ph, label %._crit_edge, !llvm.loop !15

59:                                               ; preds = %._crit_edge48
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %.pre56 = load i64, ptr %1, align 8, !tbaa !8
  %61 = add nsw i64 %.pre56, -1
  store i64 %61, ptr %1, align 8, !tbaa !8
  %.not = icmp eq i64 %.pre56, 0
  br i1 %.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !16

._crit_edge52:                                    ; preds = %59, %._crit_edge48, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #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 @_ZNSirsERx(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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

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

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

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


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