; LLVM IR from kimwalisch/primesieve :: src/Erat.ll (ZN10primesieve4Erat14initAlgorithmsEmRNS_10MemoryPoolE)

; 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.primesieve::Erat" = type { i64, i64, i64, i64, %"class.primesieve::Vector", i64, i64, %"class.primesieve::EratSmall", %"class.primesieve::EratBig", %"class.primesieve::EratMedium" }
%"class.primesieve::Vector" = type { ptr, ptr, ptr }
%"class.primesieve::EratSmall" = type { %"class.primesieve::Wheel", i64, i64, %"class.primesieve::Vector.0" }
%"class.primesieve::Wheel" = type { ptr, i64 }
%"class.primesieve::Vector.0" = type { ptr, ptr, ptr }
%"class.primesieve::EratBig" = type { %"class.primesieve::Wheel.1", i64, i64, i64, ptr, %"class.primesieve::Vector.2" }
%"class.primesieve::Wheel.1" = type { ptr, i64 }
%"class.primesieve::Vector.2" = type { ptr, ptr, ptr }
%"class.primesieve::EratMedium" = type { %"class.primesieve::Wheel", i64, ptr, %"class.primesieve::Vector.2", %"class.primesieve::Vector.2" }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10primesieve4Erat14initAlgorithmsEmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(280) %0, i64 noundef %1, ptr noundef nonnull align 1 %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %16 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 1
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = call noundef i64 @_ZN12_GLOBAL__N_15isqrtImEET_S1_(i64 noundef %17)
  store i64 %18, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %19 = call noundef i64 @_ZN10primesieve4Erat14getL1CacheSizeEv()
  store i64 %19, ptr %8, align 8, !tbaa !9
  %20 = load i64, ptr %8, align 8, !tbaa !9
  %21 = call noundef i64 @_ZN12_GLOBAL__N_19inBetweenIimiEET0_T_S1_T1_(i32 noundef 16384, i64 noundef %20, i32 noundef 8388608)
  store i64 %21, ptr %8, align 8, !tbaa !9
  %22 = load i64, ptr %8, align 8, !tbaa !9
  %23 = call noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef %22, i64 noundef 8)
  %24 = mul i64 %23, 8
  store i64 %24, ptr %8, align 8, !tbaa !9
  %25 = load i64, ptr %5, align 8, !tbaa !9
  %26 = call noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef %25, i64 noundef 8)
  %27 = mul i64 %26, 8
  store i64 %27, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %29 = load i64, ptr %28, align 8, !tbaa !9
  store i64 %29, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %30 = load i64, ptr %7, align 8, !tbaa !9
  %31 = uitofp i64 %30 to double
  %32 = fmul double %31, 2.000000e+00
  %33 = fptoui double %32 to i64
  store i64 %33, ptr %10, align 8, !tbaa !9
  %34 = load i64, ptr %10, align 8, !tbaa !9
  %35 = load i64, ptr %9, align 8, !tbaa !9
  %36 = icmp ugt i64 %34, %35
  br i1 %36, label %37, label %43

37:                                               ; preds = %3
  %38 = load i64, ptr %10, align 8, !tbaa !9
  %39 = load i64, ptr %9, align 8, !tbaa !9
  %40 = urem i64 %38, %39
  %41 = load i64, ptr %10, align 8, !tbaa !9
  %42 = sub i64 %41, %40
  store i64 %42, ptr %10, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %37, %3
  %44 = load i64, ptr %9, align 8, !tbaa !9
  %45 = load i64, ptr %10, align 8, !tbaa !9
  %46 = load i64, ptr %5, align 8, !tbaa !9
  %47 = call noundef i64 @_ZN12_GLOBAL__N_19inBetweenImmmEET0_T_S1_T1_(i64 noundef %44, i64 noundef %45, i64 noundef %46)
  store i64 %47, ptr %10, align 8, !tbaa !9
  %48 = load i64, ptr %10, align 8, !tbaa !9
  %49 = call noundef i64 @_ZN12_GLOBAL__N_19inBetweenIimiEET0_T_S1_T1_(i32 noundef 16384, i64 noundef %48, i32 noundef 8388608)
  store i64 %49, ptr %10, align 8, !tbaa !9
  %50 = load i64, ptr %10, align 8, !tbaa !9
  %51 = call noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef %50, i64 noundef 8)
  %52 = mul i64 %51, 8
  store i64 %52, ptr %10, align 8, !tbaa !9
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %54 = load i64, ptr %53, align 8, !tbaa !9
  store i64 %54, ptr %9, align 8, !tbaa !9
  %55 = load i64, ptr %9, align 8, !tbaa !9
  %56 = uitofp i64 %55 to double
  %57 = fmul double %56, 2.000000e-01
  %58 = fptoui double %57 to i64
  %59 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 5
  store i64 %58, ptr %59, align 8, !tbaa !21
  %60 = load i64, ptr %10, align 8, !tbaa !9
  %61 = uitofp i64 %60 to double
  %62 = fmul double %61, 3.000000e+00
  %63 = fptoui double %62 to i64
  %64 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 6
  store i64 %63, ptr %64, align 8, !tbaa !22
  %65 = load i64, ptr %7, align 8, !tbaa !9
  %66 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 6
  %67 = load i64, ptr %66, align 8, !tbaa !22
  %68 = icmp ugt i64 %65, %67
  br i1 %68, label %69, label %84

69:                                               ; preds = %43
  %70 = load i64, ptr %10, align 8, !tbaa !9
  %71 = call noundef i64 @_ZN12_GLOBAL__N_19floorPow2ImEET_S1_(i64 noundef %70)
  store i64 %71, ptr %10, align 8, !tbaa !9
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %73 = load i64, ptr %72, align 8, !tbaa !9
  store i64 %73, ptr %9, align 8, !tbaa !9
  %74 = load i64, ptr %9, align 8, !tbaa !9
  %75 = uitofp i64 %74 to double
  %76 = fmul double %75, 2.000000e-01
  %77 = fptoui double %76 to i64
  %78 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 5
  store i64 %77, ptr %78, align 8, !tbaa !21
  %79 = load i64, ptr %10, align 8, !tbaa !9
  %80 = uitofp i64 %79 to double
  %81 = fmul double %80, 3.000000e+00
  %82 = fptoui double %81 to i64
  %83 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 6
  store i64 %82, ptr %83, align 8, !tbaa !22
  br label %84

84:                                               ; preds = %69, %43
  %85 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 5
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 5
  store i64 %87, ptr %88, align 8, !tbaa !21
  %89 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 6
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 6
  store i64 %91, ptr %92, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %93 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 0
  %94 = load i64, ptr %93, align 8, !tbaa !23
  %95 = call noundef i64 @_ZN10primesieve4Erat13byteRemainderEm(i64 noundef %94)
  store i64 %95, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %96 = load i64, ptr %10, align 8, !tbaa !9
  %97 = mul i64 %96, 30
  %98 = add i64 %97, 6
  store i64 %98, ptr %12, align 8, !tbaa !9
  %99 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 0
  %100 = load i64, ptr %99, align 8, !tbaa !23
  %101 = load i64, ptr %11, align 8, !tbaa !9
  %102 = sub i64 %100, %101
  %103 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 2
  store i64 %102, ptr %103, align 8, !tbaa !24
  %104 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 2
  %105 = load i64, ptr %104, align 8, !tbaa !24
  %106 = load i64, ptr %12, align 8, !tbaa !9
  %107 = call noundef i64 @_ZN12_GLOBAL__N_110checkedAddEmm(i64 noundef %105, i64 noundef %106)
  %108 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 3
  store i64 %107, ptr %108, align 8, !tbaa !25
  %109 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 3
  %110 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 1
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef nonnull align 8 dereferenceable(8) %110)
  %112 = load i64, ptr %111, align 8, !tbaa !9
  %113 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 3
  store i64 %112, ptr %113, align 8, !tbaa !25
  %114 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 3
  %115 = load i64, ptr %114, align 8, !tbaa !25
  %116 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 1
  %117 = load i64, ptr %116, align 8, !tbaa !11
  %118 = icmp uge i64 %115, %117
  br i1 %118, label %119, label %141

119:                                              ; preds = %84
  %120 = load i64, ptr %7, align 8, !tbaa !9
  %121 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 6
  %122 = load i64, ptr %121, align 8, !tbaa !22
  %123 = icmp ule i64 %120, %122
  br i1 %123, label %124, label %141

124:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %125 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 1
  %126 = load i64, ptr %125, align 8, !tbaa !11
  %127 = call noundef i64 @_ZN10primesieve4Erat13byteRemainderEm(i64 noundef %126)
  store i64 %127, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %128 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 1
  %129 = load i64, ptr %128, align 8, !tbaa !11
  %130 = load i64, ptr %13, align 8, !tbaa !9
  %131 = sub i64 %129, %130
  %132 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 2
  %133 = load i64, ptr %132, align 8, !tbaa !24
  %134 = sub i64 %131, %133
  store i64 %134, ptr %14, align 8, !tbaa !9
  %135 = load i64, ptr %14, align 8, !tbaa !9
  %136 = udiv i64 %135, 30
  %137 = add i64 %136, 1
  store i64 %137, ptr %10, align 8, !tbaa !9
  %138 = load i64, ptr %10, align 8, !tbaa !9
  %139 = call noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef %138, i64 noundef 8)
  %140 = mul i64 %139, 8
  store i64 %140, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %141

141:                                              ; preds = %124, %119, %84
  %142 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 4
  %143 = load i64, ptr %10, align 8, !tbaa !9
  call void @_ZN10primesieve6VectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %142, i64 noundef %143)
  %144 = load i64, ptr %7, align 8, !tbaa !9
  %145 = call noundef i64 @_ZN10primesieve8PreSieve11getMaxPrimeEv()
  %146 = icmp ugt i64 %144, %145
  br i1 %146, label %147, label %154

147:                                              ; preds = %141
  %148 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 7
  %149 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 1
  %150 = load i64, ptr %149, align 8, !tbaa !11
  %151 = load i64, ptr %8, align 8, !tbaa !9
  %152 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 5
  %153 = load i64, ptr %152, align 8, !tbaa !21
  call void @_ZN10primesieve9EratSmall4initEmmm(ptr noundef nonnull align 8 dereferenceable(56) %148, i64 noundef %150, i64 noundef %151, i64 noundef %153)
  br label %154

154:                                              ; preds = %147, %141
  %155 = load i64, ptr %7, align 8, !tbaa !9
  %156 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 5
  %157 = load i64, ptr %156, align 8, !tbaa !21
  %158 = icmp ugt i64 %155, %157
  br i1 %158, label %159, label %166

159:                                              ; preds = %154
  %160 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 9
  %161 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 1
  %162 = load i64, ptr %161, align 8, !tbaa !11
  %163 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 6
  %164 = load i64, ptr %163, align 8, !tbaa !22
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium4initEmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(80) %160, i64 noundef %162, i64 noundef %164, ptr noundef nonnull align 1 %165)
  br label %166

166:                                              ; preds = %159, %154
  %167 = load i64, ptr %7, align 8, !tbaa !9
  %168 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 6
  %169 = load i64, ptr %168, align 8, !tbaa !22
  %170 = icmp ugt i64 %167, %169
  br i1 %170, label %171, label %179

171:                                              ; preds = %166
  %172 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 8
  %173 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 1
  %174 = load i64, ptr %173, align 8, !tbaa !11
  %175 = getelementptr inbounds %"class.primesieve::Erat", ptr %15, i32 0, i32 4
  %176 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %175) #6
  %177 = load i64, ptr %7, align 8, !tbaa !9
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve7EratBig4initEmmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(72) %172, i64 noundef %174, i64 noundef %176, i64 noundef %177, ptr noundef nonnull align 1 %178)
  br label %179

179:                                              ; preds = %171, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #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
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN10primesieve4Erat14getL1CacheSizeEv() #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_15isqrtImEET_S1_(i64 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_19inBetweenIimiEET0_T_S1_T1_(i32 noundef, i64 noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef, i64 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_19inBetweenImmmEET0_T_S1_T1_(i64 noundef, i64 noundef, i64 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_19floorPow2ImEET_S1_(i64 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN10primesieve4Erat13byteRemainderEm(i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_110checkedAddEmm(i64 noundef, i64 noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN10primesieve8PreSieve11getMaxPrimeEv() #4 align 2

declare void @_ZN10primesieve9EratSmall4initEmmm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef, i64 noundef) #5

declare void @_ZN10primesieve10EratMedium4initEmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef, i64 noundef, ptr noundef nonnull align 1) #5

declare void @_ZN10primesieve7EratBig4initEmmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 1) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSN10primesieve4EratE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !13, i64 32, !10, i64 56, !10, i64 64, !14, i64 72, !17, i64 128, !20, i64 200}
!13 = !{!"_ZTSN10primesieve6VectorIhSaIhEEE", !6, i64 0, !6, i64 8, !6, i64 16}
!14 = !{!"_ZTSN10primesieve9EratSmallE", !15, i64 0, !10, i64 16, !10, i64 24, !16, i64 32}
!15 = !{!"_ZTSN10primesieve5WheelILi30ELi8ELi6EXadsoKNS_9WheelInitEL_ZNS_11wheel30InitEEEEEE", !10, i64 8}
!16 = !{!"_ZTSN10primesieve6VectorINS_12SievingPrimeESaIS1_EEE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSN10primesieve7EratBigE", !18, i64 0, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !19, i64 48}
!18 = !{!"_ZTSN10primesieve5WheelILi210ELi48ELi10EXadsoKNS_9WheelInitEL_ZNS_12wheel210InitEEEEEE", !10, i64 8}
!19 = !{!"_ZTSN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTSN10primesieve10EratMediumE", !15, i64 0, !10, i64 16, !6, i64 24, !19, i64 32, !19, i64 56}
!21 = !{!12, !10, i64 56}
!22 = !{!12, !10, i64 64}
!23 = !{!12, !10, i64 0}
!24 = !{!12, !10, i64 16}
!25 = !{!12, !10, i64 24}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10primesieve4Erat14initAlgorithmsEmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(280) %0, i64 noundef %1, ptr noundef nonnull align 1 %2) local_unnamed_addr #0 align 2 {
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef i64 @_ZN12_GLOBAL__N_15isqrtImEET_S1_(i64 noundef %9)
  store i64 %10, ptr %5, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %11 = tail call noundef i64 @_ZN10primesieve4Erat14getL1CacheSizeEv()
  %12 = tail call noundef i64 @_ZN12_GLOBAL__N_19inBetweenIimiEET0_T_S1_T1_(i32 noundef 16384, i64 noundef %11, i32 noundef 8388608)
  %13 = tail call noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef %12, i64 noundef 8)
  %14 = shl i64 %13, 3
  store i64 %14, ptr %6, align 8, !tbaa !19
  %15 = tail call noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef %1, i64 noundef 8)
  %16 = shl i64 %15, 3
  store i64 %16, ptr %4, align 8, !tbaa !19
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %18 = load i64, ptr %17, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %19 = uitofp i64 %10 to double
  %20 = fmul double %19, 2.000000e+00
  %21 = fptoui double %20 to i64
  %22 = icmp ult i64 %18, %21
  br i1 %22, label %23, label %26

23:                                               ; preds = %3
  %24 = urem i64 %21, %18
  %25 = sub i64 %21, %24
  br label %26

26:                                               ; preds = %23, %3
  %storemerge = phi i64 [ %25, %23 ], [ %21, %3 ]
  %27 = load i64, ptr %4, align 8, !tbaa !19
  %28 = call noundef i64 @_ZN12_GLOBAL__N_19inBetweenImmmEET0_T_S1_T1_(i64 noundef %18, i64 noundef %storemerge, i64 noundef %27)
  %29 = call noundef i64 @_ZN12_GLOBAL__N_19inBetweenIimiEET0_T_S1_T1_(i32 noundef 16384, i64 noundef %28, i32 noundef 8388608)
  %30 = call noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef %29, i64 noundef 8)
  %31 = shl i64 %30, 3
  store i64 %31, ptr %7, align 8, !tbaa !19
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %33 = load i64, ptr %32, align 8, !tbaa !19
  %34 = uitofp i64 %33 to double
  %35 = fmul double %34, 2.000000e-01
  %36 = fptoui double %35 to i64
  %37 = getelementptr inbounds i8, ptr %0, i64 56
  store i64 %36, ptr %37, align 8, !tbaa !20
  %38 = load i64, ptr %7, align 8, !tbaa !19
  %39 = uitofp i64 %38 to double
  %40 = fmul double %39, 3.000000e+00
  %41 = fptoui double %40 to i64
  %42 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 %41, ptr %42, align 8, !tbaa !21
  %43 = icmp ugt i64 %10, %41
  br i1 %43, label %44, label %55

44:                                               ; preds = %26
  %45 = call noundef i64 @_ZN12_GLOBAL__N_19floorPow2ImEET_S1_(i64 noundef %38)
  store i64 %45, ptr %7, align 8, !tbaa !19
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %47 = load i64, ptr %46, align 8, !tbaa !19
  %48 = uitofp i64 %47 to double
  %49 = fmul double %48, 2.000000e-01
  %50 = fptoui double %49 to i64
  store i64 %50, ptr %37, align 8, !tbaa !20
  %51 = load i64, ptr %7, align 8, !tbaa !19
  %52 = uitofp i64 %51 to double
  %53 = fmul double %52, 3.000000e+00
  %54 = fptoui double %53 to i64
  store i64 %54, ptr %42, align 8, !tbaa !21
  br label %55

55:                                               ; preds = %44, %26
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %57 = load i64, ptr %56, align 8, !tbaa !19
  store i64 %57, ptr %37, align 8, !tbaa !20
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %59 = load i64, ptr %58, align 8, !tbaa !19
  store i64 %59, ptr %42, align 8, !tbaa !21
  %60 = load i64, ptr %0, align 8, !tbaa !22
  %61 = call noundef i64 @_ZN10primesieve4Erat13byteRemainderEm(i64 noundef %60)
  %62 = load i64, ptr %7, align 8, !tbaa !19
  %63 = mul i64 %62, 30
  %64 = add i64 %63, 6
  %65 = load i64, ptr %0, align 8, !tbaa !22
  %66 = sub i64 %65, %61
  %67 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %66, ptr %67, align 8, !tbaa !23
  %68 = call noundef i64 @_ZN12_GLOBAL__N_110checkedAddEmm(i64 noundef %66, i64 noundef %64)
  %69 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %68, ptr %69, align 8, !tbaa !24
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %71 = load i64, ptr %70, align 8, !tbaa !19
  store i64 %71, ptr %69, align 8, !tbaa !24
  %72 = load i64, ptr %8, align 8, !tbaa !5
  %.not = icmp ult i64 %71, %72
  br i1 %.not, label %86, label %73

73:                                               ; preds = %55
  %74 = load i64, ptr %5, align 8, !tbaa !19
  %75 = load i64, ptr %42, align 8, !tbaa !21
  %.not13 = icmp ugt i64 %74, %75
  br i1 %.not13, label %86, label %76

76:                                               ; preds = %73
  %77 = call noundef i64 @_ZN10primesieve4Erat13byteRemainderEm(i64 noundef %72)
  %78 = load i64, ptr %8, align 8, !tbaa !5
  %79 = load i64, ptr %67, align 8, !tbaa !23
  %80 = add i64 %77, %79
  %81 = sub i64 %78, %80
  %82 = udiv i64 %81, 30
  %83 = add nuw nsw i64 %82, 1
  store i64 %83, ptr %7, align 8, !tbaa !19
  %84 = call noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef %83, i64 noundef 8)
  %85 = shl i64 %84, 3
  store i64 %85, ptr %7, align 8, !tbaa !19
  br label %86

86:                                               ; preds = %76, %73, %55
  %87 = getelementptr inbounds i8, ptr %0, i64 32
  %88 = load i64, ptr %7, align 8, !tbaa !19
  call void @_ZN10primesieve6VectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %87, i64 noundef %88)
  %89 = load i64, ptr %5, align 8, !tbaa !19
  %90 = call noundef i64 @_ZN10primesieve8PreSieve11getMaxPrimeEv()
  %91 = icmp ugt i64 %89, %90
  br i1 %91, label %92, label %97

92:                                               ; preds = %86
  %93 = getelementptr inbounds i8, ptr %0, i64 72
  %94 = load i64, ptr %8, align 8, !tbaa !5
  %95 = load i64, ptr %6, align 8, !tbaa !19
  %96 = load i64, ptr %37, align 8, !tbaa !20
  call void @_ZN10primesieve9EratSmall4initEmmm(ptr noundef nonnull align 8 dereferenceable(56) %93, i64 noundef %94, i64 noundef %95, i64 noundef %96)
  br label %97

97:                                               ; preds = %92, %86
  %98 = load i64, ptr %5, align 8, !tbaa !19
  %99 = load i64, ptr %37, align 8, !tbaa !20
  %100 = icmp ugt i64 %98, %99
  br i1 %100, label %101, label %105

101:                                              ; preds = %97
  %102 = getelementptr inbounds i8, ptr %0, i64 200
  %103 = load i64, ptr %8, align 8, !tbaa !5
  %104 = load i64, ptr %42, align 8, !tbaa !21
  call void @_ZN10primesieve10EratMedium4initEmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(80) %102, i64 noundef %103, i64 noundef %104, ptr noundef nonnull align 1 %2)
  %.pre = load i64, ptr %5, align 8, !tbaa !19
  br label %105

105:                                              ; preds = %101, %97
  %106 = phi i64 [ %.pre, %101 ], [ %98, %97 ]
  %107 = load i64, ptr %42, align 8, !tbaa !21
  %108 = icmp ugt i64 %106, %107
  br i1 %108, label %109, label %114

109:                                              ; preds = %105
  %110 = getelementptr inbounds i8, ptr %0, i64 128
  %111 = load i64, ptr %8, align 8, !tbaa !5
  %112 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %87) #6
  %113 = load i64, ptr %5, align 8, !tbaa !19
  call void @_ZN10primesieve7EratBig4initEmmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(72) %110, i64 noundef %111, i64 noundef %112, i64 noundef %113, ptr noundef nonnull align 1 %2)
  br label %114

114:                                              ; preds = %109, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN10primesieve4Erat14getL1CacheSizeEv() local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_15isqrtImEET_S1_(i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_19inBetweenIimiEET0_T_S1_T1_(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_17ceilDivImmEET_S1_T0_(i64 noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_19inBetweenImmmEET0_T_S1_T1_(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_19floorPow2ImEET_S1_(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN10primesieve4Erat13byteRemainderEm(i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_110checkedAddEmm(i64 noundef, i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN10primesieve8PreSieve11getMaxPrimeEv() local_unnamed_addr #4 align 2

declare void @_ZN10primesieve9EratSmall4initEmmm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #5

declare void @_ZN10primesieve10EratMedium4initEmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef, i64 noundef, ptr noundef nonnull align 1) local_unnamed_addr #5

declare void @_ZN10primesieve7EratBig4initEmmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 1) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { "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, !7, i64 8}
!6 = !{!"_ZTSN10primesieve4EratE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 56, !7, i64 64, !12, i64 72, !15, i64 128, !18, i64 200}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN10primesieve6VectorIhSaIhEEE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTSN10primesieve9EratSmallE", !13, i64 0, !7, i64 16, !7, i64 24, !14, i64 32}
!13 = !{!"_ZTSN10primesieve5WheelILi30ELi8ELi6EXadsoKNS_9WheelInitEL_ZNS_11wheel30InitEEEEEE", !7, i64 8}
!14 = !{!"_ZTSN10primesieve6VectorINS_12SievingPrimeESaIS1_EEE", !11, i64 0, !11, i64 8, !11, i64 16}
!15 = !{!"_ZTSN10primesieve7EratBigE", !16, i64 0, !7, i64 16, !7, i64 24, !7, i64 32, !11, i64 40, !17, i64 48}
!16 = !{!"_ZTSN10primesieve5WheelILi210ELi48ELi10EXadsoKNS_9WheelInitEL_ZNS_12wheel210InitEEEEEE", !7, i64 8}
!17 = !{!"_ZTSN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEE", !11, i64 0, !11, i64 8, !11, i64 16}
!18 = !{!"_ZTSN10primesieve10EratMediumE", !13, i64 0, !7, i64 16, !11, i64 24, !17, i64 32, !17, i64 56}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !7, i64 56}
!21 = !{!6, !7, i64 64}
!22 = !{!6, !7, i64 0}
!23 = !{!6, !7, i64 16}
!24 = !{!6, !7, i64 24}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,TailCallElimPass