; LLVM IR from tangjz/acm-icpc :: lydsy/3031.ll (Z9factorizex)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@_ZZ9factorizexE7enabled = external hidden global i8, align 1
@_ZZ9factorizexE3tot = external hidden global i32, align 4
@_ZZ9factorizexE2pr = external hidden global [125001 x i32], align 16
@_ZZ9factorizexE1d = external hidden global [1000001 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9factorizex(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, i64 noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i1, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca { i64, i32 }, align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca i32, align 4
  %19 = alloca { i64, i32 }, align 8
  store ptr %0, ptr %3, align 8
  store i64 %1, ptr %4, align 8, !tbaa !5
  %20 = load i8, ptr @_ZZ9factorizexE7enabled, align 1, !tbaa !9, !range !11, !noundef !12
  %21 = trunc i8 %20 to i1
  br i1 %21, label %83, label %22

22:                                               ; preds = %2
  store i32 0, ptr @_ZZ9factorizexE3tot, align 4, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ9factorizexE1d, i8 0, i64 4000004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 2, ptr %5, align 4, !tbaa !13
  br label %23

23:                                               ; preds = %76, %22
  %24 = load i32, ptr %5, align 4, !tbaa !13
  %25 = icmp slt i32 %24, 1000001
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %79

27:                                               ; preds = %23
  %28 = load i32, ptr %5, align 4, !tbaa !13
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1000001 x i32], ptr @_ZZ9factorizexE1d, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !13
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %42, label %33

33:                                               ; preds = %27
  %34 = load i32, ptr %5, align 4, !tbaa !13
  %35 = load i32, ptr %5, align 4, !tbaa !13
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1000001 x i32], ptr @_ZZ9factorizexE1d, i64 0, i64 %36
  store i32 %34, ptr %37, align 4, !tbaa !13
  %38 = load i32, ptr @_ZZ9factorizexE3tot, align 4, !tbaa !13
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr @_ZZ9factorizexE3tot, align 4, !tbaa !13
  %40 = sext i32 %38 to i64
  %41 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %40
  store i32 %34, ptr %41, align 4, !tbaa !13
  br label %42

42:                                               ; preds = %33, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  br label %43

43:                                               ; preds = %71, %42
  %44 = load i32, ptr %5, align 4, !tbaa !13
  %45 = load i32, ptr %7, align 4, !tbaa !13
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !13
  %49 = mul nsw i32 %44, %48
  store i32 %49, ptr %8, align 4, !tbaa !13
  %50 = icmp slt i32 %49, 1000001
  br i1 %50, label %52, label %51

51:                                               ; preds = %43
  store i32 5, ptr %6, align 4
  br label %74

52:                                               ; preds = %43
  %53 = load i32, ptr %7, align 4, !tbaa !13
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !13
  %57 = load i32, ptr %8, align 4, !tbaa !13
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1000001 x i32], ptr @_ZZ9factorizexE1d, i64 0, i64 %58
  store i32 %56, ptr %59, align 4, !tbaa !13
  %60 = load i32, ptr %5, align 4, !tbaa !13
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1000001 x i32], ptr @_ZZ9factorizexE1d, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !13
  %64 = load i32, ptr %7, align 4, !tbaa !13
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !13
  %68 = icmp eq i32 %63, %67
  br i1 %68, label %69, label %70

69:                                               ; preds = %52
  store i32 5, ptr %6, align 4
  br label %74

70:                                               ; preds = %52
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %7, align 4, !tbaa !13
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %7, align 4, !tbaa !13
  br label %43, !llvm.loop !15

74:                                               ; preds = %69, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %5, align 4, !tbaa !13
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %5, align 4, !tbaa !13
  br label %23, !llvm.loop !17

79:                                               ; preds = %26
  %80 = load i32, ptr @_ZZ9factorizexE3tot, align 4, !tbaa !13
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %81
  store i32 1000001, ptr %82, align 4, !tbaa !13
  store i8 1, ptr @_ZZ9factorizexE7enabled, align 1, !tbaa !9
  br label %83

83:                                               ; preds = %79, %2
  store i1 false, ptr %9, align 1
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !13
  br label %84

84:                                               ; preds = %142, %83
  %85 = load i32, ptr %10, align 4, !tbaa !13
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !13
  %89 = sext i32 %88 to i64
  %90 = load i32, ptr %10, align 4, !tbaa !13
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !13
  %94 = sext i32 %93 to i64
  %95 = mul nsw i64 %89, %94
  %96 = load i64, ptr %4, align 8, !tbaa !5
  %97 = icmp sle i64 %95, %96
  br i1 %97, label %99, label %98

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

99:                                               ; preds = %84
  %100 = load i64, ptr %4, align 8, !tbaa !5
  %101 = load i32, ptr %10, align 4, !tbaa !13
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !13
  %105 = sext i32 %104 to i64
  %106 = srem i64 %100, %105
  %107 = icmp eq i64 %106, 0
  br i1 %107, label %108, label %141

108:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !13
  br label %109

109:                                              ; preds = %119, %108
  %110 = load i32, ptr %10, align 4, !tbaa !13
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !13
  %114 = sext i32 %113 to i64
  %115 = load i64, ptr %4, align 8, !tbaa !5
  %116 = sdiv i64 %115, %114
  store i64 %116, ptr %4, align 8, !tbaa !5
  %117 = load i32, ptr %11, align 4, !tbaa !13
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %11, align 4, !tbaa !13
  br label %119

119:                                              ; preds = %109
  %120 = load i64, ptr %4, align 8, !tbaa !5
  %121 = load i32, ptr %10, align 4, !tbaa !13
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !13
  %125 = sext i32 %124 to i64
  %126 = srem i64 %120, %125
  %127 = icmp eq i64 %126, 0
  br i1 %127, label %109, label %128, !llvm.loop !18

128:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %129 = load i32, ptr %10, align 4, !tbaa !13
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !13
  %133 = sext i32 %132 to i64
  store i64 %133, ptr %13, align 8, !tbaa !5
  %134 = invoke { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %135 unwind label %137

135:                                              ; preds = %128
  store { i64, i32 } %134, ptr %16, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %16, i64 12, i1 false)
  invoke void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(12) %12)
          to label %136 unwind label %137

136:                                              ; preds = %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %141

137:                                              ; preds = %135, %128
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %14, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %160

141:                                              ; preds = %136, %99
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %10, align 4, !tbaa !13
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %10, align 4, !tbaa !13
  br label %84, !llvm.loop !19

145:                                              ; preds = %98
  %146 = load i64, ptr %4, align 8, !tbaa !5
  %147 = icmp sgt i64 %146, 1
  br i1 %147, label %148, label %156

148:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 1, ptr %18, align 4, !tbaa !13
  %149 = invoke { i64, i32 } @_ZSt9make_pairIRxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %150 unwind label %152

150:                                              ; preds = %148
  store { i64, i32 } %149, ptr %19, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %19, i64 12, i1 false)
  invoke void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(12) %17)
          to label %151 unwind label %152

151:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  br label %156

152:                                              ; preds = %150, %148
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %14, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  br label %160

156:                                              ; preds = %151, %145
  store i1 true, ptr %9, align 1
  store i32 1, ptr %6, align 4
  %157 = load i1, ptr %9, align 1
  br i1 %157, label %159, label %158

158:                                              ; preds = %156
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %159

159:                                              ; preds = %158, %156
  ret void

160:                                              ; preds = %152, %137
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %14, align 8
  %163 = load i32, ptr %15, align 4
  %164 = insertvalue { ptr, i32 } poison, ptr %162, 0
  %165 = insertvalue { ptr, i32 } %164, i32 %163, 1
  resume { ptr, i32 } %165
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

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


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@_ZZ9factorizexE7enabled = external hidden local_unnamed_addr global i8, align 1
@_ZZ9factorizexE3tot = external hidden local_unnamed_addr global i32, align 4
@_ZZ9factorizexE2pr = external hidden local_unnamed_addr global [125001 x i32], align 16
@_ZZ9factorizexE1d = external hidden local_unnamed_addr global [1000001 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9factorizex(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, i64 noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i32, align 4
  store i64 %1, ptr %3, align 8, !tbaa !5
  %9 = load i8, ptr @_ZZ9factorizexE7enabled, align 1, !tbaa !9, !range !11, !noundef !12
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %39, label %11

11:                                               ; preds = %2
  store i32 0, ptr @_ZZ9factorizexE3tot, align 4, !tbaa !13
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000004) @_ZZ9factorizexE1d, i8 0, i64 4000004, i1 false)
  br label %15

12:                                               ; preds = %._crit_edge
  %13 = sext i32 %24 to i64
  %14 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %13
  store i32 1000001, ptr %14, align 4, !tbaa !13
  store i8 1, ptr @_ZZ9factorizexE7enabled, align 1, !tbaa !9
  br label %39

15:                                               ; preds = %11, %._crit_edge
  %indvars.iv49 = phi i64 [ 2, %11 ], [ %indvars.iv.next50, %._crit_edge ]
  %16 = phi i32 [ 0, %11 ], [ %24, %._crit_edge ]
  %17 = getelementptr inbounds [1000001 x i32], ptr @_ZZ9factorizexE1d, i64 0, i64 %indvars.iv49
  %18 = load i32, ptr %17, align 4, !tbaa !13
  %.not = icmp eq i32 %18, 0
  %19 = trunc nuw nsw i64 %indvars.iv49 to i32
  br i1 %.not, label %20, label %._crit_edge55

20:                                               ; preds = %15
  store i32 %19, ptr %17, align 4, !tbaa !13
  %21 = add nsw i32 %16, 1
  store i32 %21, ptr @_ZZ9factorizexE3tot, align 4, !tbaa !13
  %22 = sext i32 %16 to i64
  %23 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %22
  store i32 %19, ptr %23, align 4, !tbaa !13
  br label %._crit_edge55

._crit_edge55:                                    ; preds = %15, %20
  %24 = phi i32 [ %21, %20 ], [ %16, %15 ]
  %25 = load i32, ptr @_ZZ9factorizexE2pr, align 16, !tbaa !13
  %26 = mul nsw i32 %25, %19
  %27 = icmp slt i32 %26, 1000001
  br i1 %27, label %.lr.ph, label %._crit_edge

28:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %indvars.iv.next
  %30 = load i32, ptr %29, align 4, !tbaa !13
  %31 = mul nsw i32 %30, %19
  %32 = icmp slt i32 %31, 1000001
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !15

.lr.ph:                                           ; preds = %._crit_edge55, %28
  %indvars.iv = phi i64 [ %indvars.iv.next, %28 ], [ 0, %._crit_edge55 ]
  %33 = phi i32 [ %31, %28 ], [ %26, %._crit_edge55 ]
  %34 = phi i32 [ %30, %28 ], [ %25, %._crit_edge55 ]
  %35 = sext i32 %33 to i64
  %36 = getelementptr inbounds [1000001 x i32], ptr @_ZZ9factorizexE1d, i64 0, i64 %35
  store i32 %34, ptr %36, align 4, !tbaa !13
  %37 = load i32, ptr %17, align 4, !tbaa !13
  %38 = icmp eq i32 %37, %34
  br i1 %38, label %._crit_edge, label %28

._crit_edge:                                      ; preds = %28, %.lr.ph, %._crit_edge55
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next50, 1000001
  br i1 %exitcond.not, label %12, label %15, !llvm.loop !17

39:                                               ; preds = %12, %2
  tail call void @_ZNSt6vectorISt4pairIxiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %40 = load i32, ptr @_ZZ9factorizexE2pr, align 16, !tbaa !13
  %41 = sext i32 %40 to i64
  %42 = mul nsw i64 %41, %41
  %.not3140 = icmp sgt i64 %42, %1
  br i1 %.not3140, label %._crit_edge44, label %.lr.ph43

.lr.ph43:                                         ; preds = %39
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  br label %44

._crit_edge44:                                    ; preds = %63, %39
  %.lcssa = phi i64 [ %1, %39 ], [ %64, %63 ]
  %43 = icmp sgt i64 %.lcssa, 1
  br i1 %43, label %69, label %75

44:                                               ; preds = %.lr.ph43, %63
  %45 = phi i64 [ %1, %.lr.ph43 ], [ %64, %63 ]
  %indvars.iv52 = phi i64 [ 0, %.lr.ph43 ], [ %indvars.iv.next53, %63 ]
  %46 = phi i64 [ %41, %.lr.ph43 ], [ %67, %63 ]
  %47 = srem i64 %45, %46
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %49, label %63

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  br label %50

50:                                               ; preds = %50, %49
  %51 = phi i32 [ %54, %50 ], [ 0, %49 ]
  %52 = phi i64 [ %53, %50 ], [ %45, %49 ]
  %53 = sdiv i64 %52, %46
  %54 = add nuw nsw i32 %51, 1
  %55 = srem i64 %53, %46
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %50, label %57, !llvm.loop !18

57:                                               ; preds = %50
  store i64 %53, ptr %3, align 8, !tbaa !5
  store i32 %54, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store i64 %46, ptr %6, align 8, !tbaa !5
  %58 = invoke { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %59 unwind label %61

59:                                               ; preds = %57
  %.fca.0.extract1 = extractvalue { i64, i32 } %58, 0
  %.fca.1.extract2 = extractvalue { i64, i32 } %58, 1
  store i64 %.fca.0.extract1, ptr %5, align 8
  store i32 %.fca.1.extract2, ptr %.sroa.24.0..sroa_idx, align 8
  invoke void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(12) %5)
          to label %60 unwind label %61

60:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %63

61:                                               ; preds = %59, %57
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %76

63:                                               ; preds = %44, %60
  %64 = phi i64 [ %45, %44 ], [ %53, %60 ]
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %65 = getelementptr inbounds [125001 x i32], ptr @_ZZ9factorizexE2pr, i64 0, i64 %indvars.iv.next53
  %66 = load i32, ptr %65, align 4, !tbaa !13
  %67 = sext i32 %66 to i64
  %68 = mul nsw i64 %67, %67
  %.not31 = icmp sgt i64 %68, %64
  br i1 %.not31, label %._crit_edge44, label %44, !llvm.loop !19

69:                                               ; preds = %._crit_edge44
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 1, ptr %8, align 4, !tbaa !13
  %70 = invoke { i64, i32 } @_ZSt9make_pairIRxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %71 unwind label %73

71:                                               ; preds = %69
  %.fca.0.extract = extractvalue { i64, i32 } %70, 0
  %.fca.1.extract = extractvalue { i64, i32 } %70, 1
  store i64 %.fca.0.extract, ptr %7, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(12) %7)
          to label %72 unwind label %73

72:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %75

73:                                               ; preds = %71, %69
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %76

75:                                               ; preds = %._crit_edge44, %72
  ret void

76:                                               ; preds = %73, %61
  %.pn = phi { ptr, i32 } [ %62, %61 ], [ %74, %73 ]
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  resume { ptr, i32 } %.pn
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nounwind }

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

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


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