; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 01. Mathematics (no of div with seive)

; 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

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

32:                                               ; preds = %41, %0
  %33 = load i64, ptr %6, align 8, !tbaa !8
  %34 = load i64, ptr %2, align 8, !tbaa !8
  %35 = icmp sle i64 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %44

37:                                               ; preds = %32
  %38 = load i64, ptr %6, align 8, !tbaa !8
  %39 = load i64, ptr %6, align 8, !tbaa !8
  %40 = getelementptr inbounds i64, ptr %31, i64 %39
  store i64 %38, ptr %40, align 8, !tbaa !8
  br label %41

41:                                               ; preds = %37
  %42 = load i64, ptr %6, align 8, !tbaa !8
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %6, align 8, !tbaa !8
  br label %32, !llvm.loop !11

44:                                               ; preds = %36
  call void @llvm.memset.p0.i64(ptr align 16 %28, i8 1, i64 %26, i1 false)
  %45 = getelementptr inbounds i8, ptr %28, i64 0
  store i8 0, ptr %45, align 16, !tbaa !13
  %46 = getelementptr inbounds i8, ptr %28, i64 1
  store i8 0, ptr %46, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 2, ptr %7, align 8, !tbaa !8
  br label %47

47:                                               ; preds = %88, %44
  %48 = load i64, ptr %7, align 8, !tbaa !8
  %49 = load i64, ptr %7, align 8, !tbaa !8
  %50 = mul nsw i64 %48, %49
  %51 = load i64, ptr %2, align 8, !tbaa !8
  %52 = icmp sle i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %47
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %91

54:                                               ; preds = %47
  %55 = load i64, ptr %7, align 8, !tbaa !8
  %56 = getelementptr inbounds i8, ptr %28, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !13, !range !15, !noundef !16
  %58 = trunc i8 %57 to i1
  %59 = zext i1 %58 to i32
  %60 = icmp eq i32 %59, 1
  br i1 %60, label %61, label %87

61:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %62 = load i64, ptr %7, align 8, !tbaa !8
  %63 = mul nsw i64 2, %62
  store i64 %63, ptr %9, align 8, !tbaa !17
  br label %64

64:                                               ; preds = %82, %61
  %65 = load i64, ptr %9, align 8, !tbaa !17
  %66 = load i64, ptr %2, align 8, !tbaa !8
  %67 = icmp sle i64 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %86

69:                                               ; preds = %64
  %70 = load i64, ptr %9, align 8, !tbaa !17
  %71 = getelementptr inbounds i8, ptr %28, i64 %70
  store i8 0, ptr %71, align 1, !tbaa !13
  %72 = load i64, ptr %9, align 8, !tbaa !17
  %73 = getelementptr inbounds i64, ptr %31, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !8
  %75 = load i64, ptr %9, align 8, !tbaa !17
  %76 = icmp eq i64 %74, %75
  br i1 %76, label %77, label %81

77:                                               ; preds = %69
  %78 = load i64, ptr %7, align 8, !tbaa !8
  %79 = load i64, ptr %9, align 8, !tbaa !17
  %80 = getelementptr inbounds i64, ptr %31, i64 %79
  store i64 %78, ptr %80, align 8, !tbaa !8
  br label %81

81:                                               ; preds = %77, %69
  br label %82

82:                                               ; preds = %81
  %83 = load i64, ptr %7, align 8, !tbaa !8
  %84 = load i64, ptr %9, align 8, !tbaa !17
  %85 = add nsw i64 %84, %83
  store i64 %85, ptr %9, align 8, !tbaa !17
  br label %64, !llvm.loop !19

86:                                               ; preds = %68
  br label %87

87:                                               ; preds = %86, %54
  br label %88

88:                                               ; preds = %87
  %89 = load i64, ptr %7, align 8, !tbaa !8
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %7, align 8, !tbaa !8
  br label %47, !llvm.loop !20

91:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !21
  br label %92

92:                                               ; preds = %110, %91
  %93 = load i64, ptr %2, align 8, !tbaa !8
  %94 = icmp sgt i64 %93, 1
  br i1 %94, label %95, label %117

95:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %96 = load i64, ptr %2, align 8, !tbaa !8
  %97 = getelementptr inbounds i64, ptr %31, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !8
  store i64 %98, ptr %12, align 8, !tbaa !8
  br label %99

99:                                               ; preds = %104, %95
  %100 = load i64, ptr %2, align 8, !tbaa !8
  %101 = load i64, ptr %12, align 8, !tbaa !8
  %102 = srem i64 %100, %101
  %103 = icmp eq i64 %102, 0
  br i1 %103, label %104, label %110

104:                                              ; preds = %99
  %105 = load i64, ptr %11, align 8, !tbaa !8
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %11, align 8, !tbaa !8
  %107 = load i64, ptr %12, align 8, !tbaa !8
  %108 = load i64, ptr %2, align 8, !tbaa !8
  %109 = sdiv i64 %108, %107
  store i64 %109, ptr %2, align 8, !tbaa !8
  br label %99, !llvm.loop !23

110:                                              ; preds = %99
  %111 = load i64, ptr %11, align 8, !tbaa !8
  %112 = add nsw i64 %111, 1
  %113 = load i32, ptr %10, align 4, !tbaa !21
  %114 = sext i32 %113 to i64
  %115 = mul nsw i64 %114, %112
  %116 = trunc i64 %115 to i32
  store i32 %116, ptr %10, align 4, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %92, !llvm.loop !24

117:                                              ; preds = %92
  %118 = load i32, ptr %10, align 4, !tbaa !21
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %118)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %120 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %120)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %121 = load i32, ptr %1, align 4
  ret i32 %121
}

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 @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !10, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !10, i64 0}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !10, i64 0}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !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

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

.lr.ph.preheader:                                 ; preds = %0
  %21 = add nuw i64 %18, 1
  %min.iters.check = icmp ult i64 %18, 3
  br i1 %min.iters.check, label %.lr.ph.preheader65, label %vector.ph

.lr.ph.preheader65:                               ; preds = %middle.block, %.lr.ph.preheader
  %.02732.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %21, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %22 = getelementptr inbounds i64, ptr %20, i64 %index
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store <2 x i64> %vec.ind, ptr %22, align 16, !tbaa !8
  store <2 x i64> %step.add, ptr %23, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %21, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader65

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %17, i8 1, i64 %15, i1 false)
  %25 = getelementptr inbounds i8, ptr %17, i64 1
  store i8 0, ptr %25, align 1, !tbaa !15
  %.not2937 = icmp slt i64 %18, 4
  br i1 %.not2937, label %.preheader, label %.lr.ph41

.lr.ph:                                           ; preds = %.lr.ph.preheader65, %.lr.ph
  %.02732 = phi i64 [ %27, %.lr.ph ], [ %.02732.ph, %.lr.ph.preheader65 ]
  %26 = getelementptr inbounds i64, ptr %20, i64 %.02732
  store i64 %.02732, ptr %26, align 8, !tbaa !8
  %27 = add nuw i64 %.02732, 1
  %exitcond.not = icmp eq i64 %.02732, %18
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

.preheader:                                       ; preds = %.loopexit, %._crit_edge
  %28 = icmp sgt i64 %18, 1
  br i1 %28, label %.lr.ph51, label %._crit_edge52

.lr.ph41:                                         ; preds = %._crit_edge, %.loopexit
  %.02638 = phi i64 [ %38, %.loopexit ], [ 2, %._crit_edge ]
  %29 = getelementptr inbounds i8, ptr %17, i64 %.02638
  %30 = load i8, ptr %29, align 1, !tbaa !15, !range !18, !noundef !19
  %31 = trunc nuw i8 %30 to i1
  %32 = shl nuw nsw i64 %.02638, 1
  %.not3033 = icmp sle i64 %32, %18
  %or.cond.not = select i1 %31, i1 %.not3033, i1 false
  br i1 %or.cond.not, label %.lr.ph36, label %.loopexit

.lr.ph36:                                         ; preds = %.lr.ph41, %.lr.ph36
  %.02534 = phi i64 [ %37, %.lr.ph36 ], [ %32, %.lr.ph41 ]
  %33 = getelementptr inbounds i8, ptr %17, i64 %.02534
  store i8 0, ptr %33, align 1, !tbaa !15
  %34 = getelementptr inbounds i64, ptr %20, i64 %.02534
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = icmp eq i64 %35, %.02534
  %spec.store.select = select i1 %36, i64 %.02638, i64 %35
  store i64 %spec.store.select, ptr %34, align 8
  %37 = add nuw nsw i64 %.02534, %.02638
  %.not30 = icmp sgt i64 %37, %18
  br i1 %.not30, label %.loopexit, label %.lr.ph36, !llvm.loop !20

.loopexit:                                        ; preds = %.lr.ph36, %.lr.ph41
  %38 = add nuw nsw i64 %.02638, 1
  %39 = mul nuw nsw i64 %38, %38
  %.not29 = icmp sgt i64 %39, %18
  br i1 %.not29, label %.preheader, label %.lr.ph41, !llvm.loop !21

.lr.ph51:                                         ; preds = %.preheader, %49
  %.02450 = phi i32 [ %51, %49 ], [ 1, %.preheader ]
  %.lcssa4849 = phi i64 [ %.lcssa47, %49 ], [ %18, %.preheader ]
  %40 = getelementptr inbounds i64, ptr %20, i64 %.lcssa4849
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = srem i64 %.lcssa4849, %41
  %43 = icmp eq i64 %42, 0
  br i1 %43, label %.lr.ph44, label %49

.lr.ph44:                                         ; preds = %.lr.ph51, %.lr.ph44
  %.042 = phi i32 [ %45, %.lr.ph44 ], [ 0, %.lr.ph51 ]
  %44 = phi i64 [ %46, %.lr.ph44 ], [ %.lcssa4849, %.lr.ph51 ]
  %45 = add i32 %.042, 1
  %46 = sdiv i64 %44, %41
  %47 = srem i64 %46, %41
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %.lr.ph44, label %._crit_edge45, !llvm.loop !22

._crit_edge45:                                    ; preds = %.lr.ph44
  store i64 %46, ptr %1, align 8, !tbaa !8
  br label %49

49:                                               ; preds = %._crit_edge45, %.lr.ph51
  %.lcssa47 = phi i64 [ %46, %._crit_edge45 ], [ %.lcssa4849, %.lr.ph51 ]
  %.0.lcssa = phi i32 [ %45, %._crit_edge45 ], [ 0, %.lr.ph51 ]
  %50 = add i32 %.0.lcssa, 1
  %51 = mul i32 %50, %.02450
  %52 = icmp sgt i64 %.lcssa47, 1
  br i1 %52, label %.lr.ph51, label %._crit_edge52, !llvm.loop !23

._crit_edge52:                                    ; preds = %49, %0, %.preheader
  %.024.lcssa = phi i32 [ 1, %.preheader ], [ 1, %0 ], [ %51, %49 ]
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.024.lcssa)
  call void @llvm.stackrestore.p0(ptr %16)
  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 @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = distinct !{!17, !12, !14, !13}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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