; LLVM IR from eyangch/competitive-programming :: Codeforces/492 (e)

; 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" }

@ans = external dso_local global [1000000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = 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 i32, align 4
  %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
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  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
  %24 = 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)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %28 = load i64, ptr %2, align 8, !tbaa !8
  %29 = icmp eq i64 %28, 1
  br i1 %29, label %30, label %33

30:                                               ; preds = %0
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %105

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

34:                                               ; preds = %37, %33
  %35 = load i64, ptr %7, align 8, !tbaa !8
  %36 = icmp ne i64 %35, 1
  br i1 %36, label %37, label %46

37:                                               ; preds = %34
  %38 = load i64, ptr %5, align 8, !tbaa !8
  %39 = load i64, ptr %7, align 8, !tbaa !8
  %40 = add nsw i64 %39, %38
  store i64 %40, ptr %7, align 8, !tbaa !8
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = load i64, ptr %7, align 8, !tbaa !8
  %43 = srem i64 %42, %41
  store i64 %43, ptr %7, align 8, !tbaa !8
  %44 = load i64, ptr %8, align 8, !tbaa !8
  %45 = add nsw i64 %44, 1
  store i64 %45, ptr %8, align 8, !tbaa !8
  br label %34, !llvm.loop !11

46:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %47 = load i64, ptr %8, align 8, !tbaa !8
  %48 = load i64, ptr %4, align 8, !tbaa !8
  %49 = mul nsw i64 %47, %48
  %50 = load i64, ptr %2, align 8, !tbaa !8
  %51 = srem i64 %49, %50
  store i64 %51, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %52

52:                                               ; preds = %76, %46
  %53 = load i64, ptr %10, align 8, !tbaa !8
  %54 = load i64, ptr %3, align 8, !tbaa !8
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %58, ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %60 = load i64, ptr %9, align 8, !tbaa !8
  %61 = load i64, ptr %12, align 8, !tbaa !8
  %62 = mul nsw i64 %60, %61
  %63 = load i64, ptr %2, align 8, !tbaa !8
  %64 = srem i64 %62, %63
  store i64 %64, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %65 = load i64, ptr %11, align 8, !tbaa !8
  %66 = load i64, ptr %13, align 8, !tbaa !8
  %67 = sub nsw i64 %65, %66
  %68 = load i64, ptr %2, align 8, !tbaa !8
  %69 = add nsw i64 %67, %68
  %70 = load i64, ptr %2, align 8, !tbaa !8
  %71 = srem i64 %69, %70
  store i64 %71, ptr %14, align 8, !tbaa !8
  %72 = load i64, ptr %14, align 8, !tbaa !8
  %73 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !8
  %75 = add nsw i64 %74, 1
  store i64 %75, ptr %73, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  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 %76

76:                                               ; preds = %57
  %77 = load i64, ptr %10, align 8, !tbaa !8
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %10, align 8, !tbaa !8
  br label %52, !llvm.loop !13

79:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %97, %79
  %81 = load i64, ptr %17, align 8, !tbaa !8
  %82 = load i64, ptr %2, align 8, !tbaa !8
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 7, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %100

85:                                               ; preds = %80
  %86 = load i64, ptr %17, align 8, !tbaa !8
  %87 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !8
  %89 = load i64, ptr %15, align 8, !tbaa !8
  %90 = icmp sgt i64 %88, %89
  br i1 %90, label %91, label %96

91:                                               ; preds = %85
  %92 = load i64, ptr %17, align 8, !tbaa !8
  %93 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !8
  store i64 %94, ptr %15, align 8, !tbaa !8
  %95 = load i64, ptr %17, align 8, !tbaa !8
  store i64 %95, ptr %16, align 8, !tbaa !8
  br label %96

96:                                               ; preds = %91, %85
  br label %97

97:                                               ; preds = %96
  %98 = load i64, ptr %17, align 8, !tbaa !8
  %99 = add nsw i64 %98, 1
  store i64 %99, ptr %17, align 8, !tbaa !8
  br label %80, !llvm.loop !14

100:                                              ; preds = %84
  %101 = load i64, ptr %16, align 8, !tbaa !8
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %101)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @.str.1)
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %105

105:                                              ; preds = %100, %30
  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
  %106 = load i32, ptr %1, align 4
  ret i32 %106
}

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: 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: 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) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(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: 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 = { "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 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 = 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" }

@ans = external dso_local local_unnamed_addr global [1000000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = 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 = 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)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %17 = load i64, ptr %1, align 8, !tbaa !8
  %18 = icmp eq i64 %17, 1
  br i1 %18, label %20, label %.preheader27

.preheader27:                                     ; preds = %0
  %19 = load i64, ptr %4, align 8, !tbaa !8
  br label %22

20:                                               ; preds = %0
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %73

22:                                               ; preds = %.preheader27, %22
  %.02329 = phi i64 [ 0, %.preheader27 ], [ %24, %22 ]
  %.02428 = phi i64 [ 0, %.preheader27 ], [ %25, %22 ]
  %23 = add nsw i64 %19, %.02329
  %24 = srem i64 %23, %17
  %25 = add nuw nsw i64 %.02428, 1
  %.not = icmp eq i64 %24, 1
  br i1 %.not, label %26, label %22, !llvm.loop !11

26:                                               ; preds = %22
  %27 = load i64, ptr %3, align 8, !tbaa !8
  %28 = mul nsw i64 %27, %25
  %29 = srem i64 %28, %17
  %30 = load i64, ptr %2, align 8, !tbaa !8
  %31 = icmp sgt i64 %30, 0
  br i1 %31, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %26
  %32 = phi i64 [ %17, %26 ], [ %39, %.lr.ph ]
  %33 = icmp sgt i64 %32, 0
  br i1 %33, label %.lr.ph34.preheader, label %._crit_edge

.lr.ph34.preheader:                               ; preds = %.preheader
  %xtraiter = and i64 %32, 3
  %34 = icmp ult i64 %32, 4
  br i1 %34, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph34.preheader.new

.lr.ph34.preheader.new:                           ; preds = %.lr.ph34.preheader
  %unroll_iter = and i64 %32, 9223372036854775804
  br label %.lr.ph34

.lr.ph:                                           ; preds = %26, %.lr.ph
  %.02230 = phi i64 [ %48, %.lr.ph ], [ 0, %26 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %37 = load i64, ptr %6, align 8, !tbaa !8
  %38 = mul nsw i64 %37, %29
  %39 = load i64, ptr %1, align 8, !tbaa !8
  %40 = srem i64 %38, %39
  %41 = load i64, ptr %5, align 8, !tbaa !8
  %42 = sub i64 %39, %40
  %43 = add i64 %42, %41
  %44 = srem i64 %43, %39
  %45 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %45, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %48 = add nuw nsw i64 %.02230, 1
  %49 = load i64, ptr %2, align 8, !tbaa !8
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %.lr.ph, label %.preheader, !llvm.loop !13

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph34, %.lr.ph34.preheader
  %spec.select26.lcssa.ph = phi i64 [ poison, %.lr.ph34.preheader ], [ %spec.select26.3, %.lr.ph34 ]
  %.033.unr = phi i64 [ 0, %.lr.ph34.preheader ], [ %72, %.lr.ph34 ]
  %.01832.unr = phi i64 [ 0, %.lr.ph34.preheader ], [ %spec.select26.3, %.lr.ph34 ]
  %.01931.unr = phi i64 [ 0, %.lr.ph34.preheader ], [ %spec.select.3, %.lr.ph34 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph34.epil

.lr.ph34.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph34.epil
  %.033.epil = phi i64 [ %54, %.lr.ph34.epil ], [ %.033.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.01832.epil = phi i64 [ %spec.select26.epil, %.lr.ph34.epil ], [ %.01832.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.01931.epil = phi i64 [ %spec.select.epil, %.lr.ph34.epil ], [ %.01931.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph34.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %51 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %.033.epil
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = icmp sgt i64 %52, %.01931.epil
  %spec.select.epil = call i64 @llvm.smax.i64(i64 %52, i64 %.01931.epil)
  %spec.select26.epil = select i1 %53, i64 %.033.epil, i64 %.01832.epil
  %54 = add nuw nsw i64 %.033.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph34.epil, !llvm.loop !14

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph34.epil, %.preheader
  %.018.lcssa = phi i64 [ 0, %.preheader ], [ %spec.select26.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %spec.select26.epil, %.lr.ph34.epil ]
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.018.lcssa)
  %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.1)
  br label %73

.lr.ph34:                                         ; preds = %.lr.ph34, %.lr.ph34.preheader.new
  %.033 = phi i64 [ 0, %.lr.ph34.preheader.new ], [ %72, %.lr.ph34 ]
  %.01832 = phi i64 [ 0, %.lr.ph34.preheader.new ], [ %spec.select26.3, %.lr.ph34 ]
  %.01931 = phi i64 [ 0, %.lr.ph34.preheader.new ], [ %spec.select.3, %.lr.ph34 ]
  %niter = phi i64 [ 0, %.lr.ph34.preheader.new ], [ %niter.next.3, %.lr.ph34 ]
  %57 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %.033
  %58 = load i64, ptr %57, align 16, !tbaa !8
  %59 = icmp sgt i64 %58, %.01931
  %spec.select = call i64 @llvm.smax.i64(i64 %58, i64 %.01931)
  %spec.select26 = select i1 %59, i64 %.033, i64 %.01832
  %60 = or disjoint i64 %.033, 1
  %61 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !8
  %63 = icmp sgt i64 %62, %spec.select
  %spec.select.1 = call i64 @llvm.smax.i64(i64 %62, i64 %spec.select)
  %spec.select26.1 = select i1 %63, i64 %60, i64 %spec.select26
  %64 = or disjoint i64 %.033, 2
  %65 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %64
  %66 = load i64, ptr %65, align 16, !tbaa !8
  %67 = icmp sgt i64 %66, %spec.select.1
  %spec.select.2 = call i64 @llvm.smax.i64(i64 %66, i64 %spec.select.1)
  %spec.select26.2 = select i1 %67, i64 %64, i64 %spec.select26.1
  %68 = or disjoint i64 %.033, 3
  %69 = getelementptr inbounds [1000000 x i64], ptr @ans, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = icmp sgt i64 %70, %spec.select.2
  %spec.select.3 = call i64 @llvm.smax.i64(i64 %70, i64 %spec.select.2)
  %spec.select26.3 = select i1 %71, i64 %68, i64 %spec.select26.2
  %72 = add nuw nsw i64 %.033, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph34, !llvm.loop !16

73:                                               ; preds = %._crit_edge, %20
  %.sink = phi ptr [ %56, %._crit_edge ], [ %21, %20 ]
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  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 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: 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 #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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: 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

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

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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !12}


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