; LLVM IR from kimwalisch/primesieve :: src/EratMedium.ll (ZN10primesieve10EratMedium10crossOff_7EPhmPNS_6BucketE)

; 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::EratMedium" = type { %"class.primesieve::Wheel", i64, ptr, %"class.primesieve::Vector", %"class.primesieve::Vector" }
%"class.primesieve::Wheel" = type { ptr, i64 }
%"class.primesieve::Vector" = type { ptr, ptr, ptr }
%"class.primesieve::SievingPrime" = type { i32, i32 }

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef) #2 align 2

declare void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8), i64 noundef, i64 noundef, i64 noundef) #2 align 2

; Function Attrs: mustprogress noinline uwtable
define dso_local void @_ZN10primesieve10EratMedium10crossOff_7EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) #4 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, 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
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %21 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %20, i32 0, i32 3
  %22 = call noundef ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  store ptr %22, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %23 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %20, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  store ptr %24, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = call noundef ptr @_ZN10primesieve6Bucket5beginEv(ptr noundef nonnull align 8 dereferenceable(8192) %25)
  store ptr %26, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = call noundef ptr @_ZN10primesieve6Bucket3endEv(ptr noundef nonnull align 8 dereferenceable(8192) %27)
  store ptr %28, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = call noundef i64 @_ZNK10primesieve12SievingPrime13getWheelIndexEv(ptr noundef nonnull align 4 dereferenceable(8) %29)
  store i64 %30, ptr %13, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %370, %4
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = icmp ne ptr %32, %33
  br i1 %34, label %35, label %373

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = call noundef i64 @_ZNK10primesieve12SievingPrime15getSievingPrimeEv(ptr noundef nonnull align 4 dereferenceable(8) %36)
  store i64 %37, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = call noundef i64 @_ZNK10primesieve12SievingPrime16getMultipleIndexEv(ptr noundef nonnull align 4 dereferenceable(8) %38)
  store i64 %39, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %40 = load i64, ptr %14, align 8, !tbaa !9
  %41 = mul i64 %40, 6
  %42 = add i64 %41, 1
  store i64 %42, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %43 = load i64, ptr %14, align 8, !tbaa !9
  %44 = mul i64 %43, 4
  %45 = add i64 %44, 1
  store i64 %45, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %46 = load i64, ptr %14, align 8, !tbaa !9
  %47 = mul i64 %46, 2
  %48 = add i64 %47, 0
  store i64 %48, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %49 = load i64, ptr %14, align 8, !tbaa !9
  %50 = mul i64 %49, 2
  %51 = add i64 %50, 1
  store i64 %51, ptr %19, align 8, !tbaa !9
  %52 = load i64, ptr %13, align 8, !tbaa !9
  switch i64 %52, label %53 [
    i64 0, label %56
    i64 1, label %95
    i64 2, label %134
    i64 3, label %173
    i64 4, label %212
    i64 5, label %251
    i64 6, label %290
    i64 7, label %329
  ]

53:                                               ; preds = %35
  unreachable

54:                                               ; No predecessors!
  br label %55

55:                                               ; preds = %357, %54
  br label %56

56:                                               ; preds = %55, %35
  %57 = load i64, ptr %15, align 8, !tbaa !9
  %58 = load i64, ptr %7, align 8, !tbaa !9
  %59 = icmp uge i64 %57, %58
  %60 = xor i1 %59, true
  %61 = xor i1 %60, true
  %62 = zext i1 %61 to i64
  %63 = call i64 @llvm.expect.i64(i64 %62, i64 0)
  %64 = icmp ne i64 %63, 0
  br i1 %64, label %65, label %84

65:                                               ; preds = %56
  %66 = load i64, ptr %7, align 8, !tbaa !9
  %67 = load i64, ptr %15, align 8, !tbaa !9
  %68 = sub i64 %67, %66
  store i64 %68, ptr %15, align 8, !tbaa !9
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds ptr, ptr %69, i64 0
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  %72 = call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %71)
  br i1 %72, label %73, label %77

73:                                               ; preds = %65
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds ptr, ptr %75, i64 0
  call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %74, ptr noundef nonnull align 8 dereferenceable(8) %76)
  br label %77

77:                                               ; preds = %73, %65
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds ptr, ptr %78, i64 0
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %80, i32 1
  store ptr %81, ptr %79, align 8, !tbaa !5
  %82 = load i64, ptr %14, align 8, !tbaa !9
  %83 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %80, i64 noundef %82, i64 noundef %83, i64 noundef 0)
  br label %368

84:                                               ; preds = %56
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = load i64, ptr %15, align 8, !tbaa !9
  %87 = getelementptr inbounds i8, ptr %85, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !15
  %89 = zext i8 %88 to i32
  %90 = and i32 %89, 254
  %91 = trunc i32 %90 to i8
  store i8 %91, ptr %87, align 1, !tbaa !15
  %92 = load i64, ptr %16, align 8, !tbaa !9
  %93 = load i64, ptr %15, align 8, !tbaa !9
  %94 = add i64 %93, %92
  store i64 %94, ptr %15, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %84, %35
  %96 = load i64, ptr %15, align 8, !tbaa !9
  %97 = load i64, ptr %7, align 8, !tbaa !9
  %98 = icmp uge i64 %96, %97
  %99 = xor i1 %98, true
  %100 = xor i1 %99, true
  %101 = zext i1 %100 to i64
  %102 = call i64 @llvm.expect.i64(i64 %101, i64 0)
  %103 = icmp ne i64 %102, 0
  br i1 %103, label %104, label %123

104:                                              ; preds = %95
  %105 = load i64, ptr %7, align 8, !tbaa !9
  %106 = load i64, ptr %15, align 8, !tbaa !9
  %107 = sub i64 %106, %105
  store i64 %107, ptr %15, align 8, !tbaa !9
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds ptr, ptr %108, i64 1
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %110)
  br i1 %111, label %112, label %116

112:                                              ; preds = %104
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds ptr, ptr %114, i64 1
  call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %113, ptr noundef nonnull align 8 dereferenceable(8) %115)
  br label %116

116:                                              ; preds = %112, %104
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds ptr, ptr %117, i64 1
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %119, i32 1
  store ptr %120, ptr %118, align 8, !tbaa !5
  %121 = load i64, ptr %14, align 8, !tbaa !9
  %122 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %119, i64 noundef %121, i64 noundef %122, i64 noundef 1)
  br label %368

123:                                              ; preds = %95
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = load i64, ptr %15, align 8, !tbaa !9
  %126 = getelementptr inbounds i8, ptr %124, i64 %125
  %127 = load i8, ptr %126, align 1, !tbaa !15
  %128 = zext i8 %127 to i32
  %129 = and i32 %128, 239
  %130 = trunc i32 %129 to i8
  store i8 %130, ptr %126, align 1, !tbaa !15
  %131 = load i64, ptr %17, align 8, !tbaa !9
  %132 = load i64, ptr %15, align 8, !tbaa !9
  %133 = add i64 %132, %131
  store i64 %133, ptr %15, align 8, !tbaa !9
  br label %134

134:                                              ; preds = %123, %35
  %135 = load i64, ptr %15, align 8, !tbaa !9
  %136 = load i64, ptr %7, align 8, !tbaa !9
  %137 = icmp uge i64 %135, %136
  %138 = xor i1 %137, true
  %139 = xor i1 %138, true
  %140 = zext i1 %139 to i64
  %141 = call i64 @llvm.expect.i64(i64 %140, i64 0)
  %142 = icmp ne i64 %141, 0
  br i1 %142, label %143, label %162

143:                                              ; preds = %134
  %144 = load i64, ptr %7, align 8, !tbaa !9
  %145 = load i64, ptr %15, align 8, !tbaa !9
  %146 = sub i64 %145, %144
  store i64 %146, ptr %15, align 8, !tbaa !9
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds ptr, ptr %147, i64 2
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  %150 = call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %149)
  br i1 %150, label %151, label %155

151:                                              ; preds = %143
  %152 = load ptr, ptr %10, align 8, !tbaa !5
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds ptr, ptr %153, i64 2
  call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %152, ptr noundef nonnull align 8 dereferenceable(8) %154)
  br label %155

155:                                              ; preds = %151, %143
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds ptr, ptr %156, i64 2
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %158, i32 1
  store ptr %159, ptr %157, align 8, !tbaa !5
  %160 = load i64, ptr %14, align 8, !tbaa !9
  %161 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %158, i64 noundef %160, i64 noundef %161, i64 noundef 2)
  br label %368

162:                                              ; preds = %134
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = load i64, ptr %15, align 8, !tbaa !9
  %165 = getelementptr inbounds i8, ptr %163, i64 %164
  %166 = load i8, ptr %165, align 1, !tbaa !15
  %167 = zext i8 %166 to i32
  %168 = and i32 %167, 247
  %169 = trunc i32 %168 to i8
  store i8 %169, ptr %165, align 1, !tbaa !15
  %170 = load i64, ptr %18, align 8, !tbaa !9
  %171 = load i64, ptr %15, align 8, !tbaa !9
  %172 = add i64 %171, %170
  store i64 %172, ptr %15, align 8, !tbaa !9
  br label %173

173:                                              ; preds = %162, %35
  %174 = load i64, ptr %15, align 8, !tbaa !9
  %175 = load i64, ptr %7, align 8, !tbaa !9
  %176 = icmp uge i64 %174, %175
  %177 = xor i1 %176, true
  %178 = xor i1 %177, true
  %179 = zext i1 %178 to i64
  %180 = call i64 @llvm.expect.i64(i64 %179, i64 0)
  %181 = icmp ne i64 %180, 0
  br i1 %181, label %182, label %201

182:                                              ; preds = %173
  %183 = load i64, ptr %7, align 8, !tbaa !9
  %184 = load i64, ptr %15, align 8, !tbaa !9
  %185 = sub i64 %184, %183
  store i64 %185, ptr %15, align 8, !tbaa !9
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = getelementptr inbounds ptr, ptr %186, i64 3
  %188 = load ptr, ptr %187, align 8, !tbaa !5
  %189 = call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %188)
  br i1 %189, label %190, label %194

190:                                              ; preds = %182
  %191 = load ptr, ptr %10, align 8, !tbaa !5
  %192 = load ptr, ptr %9, align 8, !tbaa !5
  %193 = getelementptr inbounds ptr, ptr %192, i64 3
  call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %191, ptr noundef nonnull align 8 dereferenceable(8) %193)
  br label %194

194:                                              ; preds = %190, %182
  %195 = load ptr, ptr %9, align 8, !tbaa !5
  %196 = getelementptr inbounds ptr, ptr %195, i64 3
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %197, i32 1
  store ptr %198, ptr %196, align 8, !tbaa !5
  %199 = load i64, ptr %14, align 8, !tbaa !9
  %200 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %197, i64 noundef %199, i64 noundef %200, i64 noundef 3)
  br label %368

201:                                              ; preds = %173
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = load i64, ptr %15, align 8, !tbaa !9
  %204 = getelementptr inbounds i8, ptr %202, i64 %203
  %205 = load i8, ptr %204, align 1, !tbaa !15
  %206 = zext i8 %205 to i32
  %207 = and i32 %206, 127
  %208 = trunc i32 %207 to i8
  store i8 %208, ptr %204, align 1, !tbaa !15
  %209 = load i64, ptr %17, align 8, !tbaa !9
  %210 = load i64, ptr %15, align 8, !tbaa !9
  %211 = add i64 %210, %209
  store i64 %211, ptr %15, align 8, !tbaa !9
  br label %212

212:                                              ; preds = %201, %35
  %213 = load i64, ptr %15, align 8, !tbaa !9
  %214 = load i64, ptr %7, align 8, !tbaa !9
  %215 = icmp uge i64 %213, %214
  %216 = xor i1 %215, true
  %217 = xor i1 %216, true
  %218 = zext i1 %217 to i64
  %219 = call i64 @llvm.expect.i64(i64 %218, i64 0)
  %220 = icmp ne i64 %219, 0
  br i1 %220, label %221, label %240

221:                                              ; preds = %212
  %222 = load i64, ptr %7, align 8, !tbaa !9
  %223 = load i64, ptr %15, align 8, !tbaa !9
  %224 = sub i64 %223, %222
  store i64 %224, ptr %15, align 8, !tbaa !9
  %225 = load ptr, ptr %9, align 8, !tbaa !5
  %226 = getelementptr inbounds ptr, ptr %225, i64 4
  %227 = load ptr, ptr %226, align 8, !tbaa !5
  %228 = call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %227)
  br i1 %228, label %229, label %233

229:                                              ; preds = %221
  %230 = load ptr, ptr %10, align 8, !tbaa !5
  %231 = load ptr, ptr %9, align 8, !tbaa !5
  %232 = getelementptr inbounds ptr, ptr %231, i64 4
  call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %230, ptr noundef nonnull align 8 dereferenceable(8) %232)
  br label %233

233:                                              ; preds = %229, %221
  %234 = load ptr, ptr %9, align 8, !tbaa !5
  %235 = getelementptr inbounds ptr, ptr %234, i64 4
  %236 = load ptr, ptr %235, align 8, !tbaa !5
  %237 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %236, i32 1
  store ptr %237, ptr %235, align 8, !tbaa !5
  %238 = load i64, ptr %14, align 8, !tbaa !9
  %239 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %236, i64 noundef %238, i64 noundef %239, i64 noundef 4)
  br label %368

240:                                              ; preds = %212
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  %242 = load i64, ptr %15, align 8, !tbaa !9
  %243 = getelementptr inbounds i8, ptr %241, i64 %242
  %244 = load i8, ptr %243, align 1, !tbaa !15
  %245 = zext i8 %244 to i32
  %246 = and i32 %245, 191
  %247 = trunc i32 %246 to i8
  store i8 %247, ptr %243, align 1, !tbaa !15
  %248 = load i64, ptr %19, align 8, !tbaa !9
  %249 = load i64, ptr %15, align 8, !tbaa !9
  %250 = add i64 %249, %248
  store i64 %250, ptr %15, align 8, !tbaa !9
  br label %251

251:                                              ; preds = %240, %35
  %252 = load i64, ptr %15, align 8, !tbaa !9
  %253 = load i64, ptr %7, align 8, !tbaa !9
  %254 = icmp uge i64 %252, %253
  %255 = xor i1 %254, true
  %256 = xor i1 %255, true
  %257 = zext i1 %256 to i64
  %258 = call i64 @llvm.expect.i64(i64 %257, i64 0)
  %259 = icmp ne i64 %258, 0
  br i1 %259, label %260, label %279

260:                                              ; preds = %251
  %261 = load i64, ptr %7, align 8, !tbaa !9
  %262 = load i64, ptr %15, align 8, !tbaa !9
  %263 = sub i64 %262, %261
  store i64 %263, ptr %15, align 8, !tbaa !9
  %264 = load ptr, ptr %9, align 8, !tbaa !5
  %265 = getelementptr inbounds ptr, ptr %264, i64 5
  %266 = load ptr, ptr %265, align 8, !tbaa !5
  %267 = call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %266)
  br i1 %267, label %268, label %272

268:                                              ; preds = %260
  %269 = load ptr, ptr %10, align 8, !tbaa !5
  %270 = load ptr, ptr %9, align 8, !tbaa !5
  %271 = getelementptr inbounds ptr, ptr %270, i64 5
  call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %269, ptr noundef nonnull align 8 dereferenceable(8) %271)
  br label %272

272:                                              ; preds = %268, %260
  %273 = load ptr, ptr %9, align 8, !tbaa !5
  %274 = getelementptr inbounds ptr, ptr %273, i64 5
  %275 = load ptr, ptr %274, align 8, !tbaa !5
  %276 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %275, i32 1
  store ptr %276, ptr %274, align 8, !tbaa !5
  %277 = load i64, ptr %14, align 8, !tbaa !9
  %278 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %275, i64 noundef %277, i64 noundef %278, i64 noundef 5)
  br label %368

279:                                              ; preds = %251
  %280 = load ptr, ptr %6, align 8, !tbaa !5
  %281 = load i64, ptr %15, align 8, !tbaa !9
  %282 = getelementptr inbounds i8, ptr %280, i64 %281
  %283 = load i8, ptr %282, align 1, !tbaa !15
  %284 = zext i8 %283 to i32
  %285 = and i32 %284, 251
  %286 = trunc i32 %285 to i8
  store i8 %286, ptr %282, align 1, !tbaa !15
  %287 = load i64, ptr %17, align 8, !tbaa !9
  %288 = load i64, ptr %15, align 8, !tbaa !9
  %289 = add i64 %288, %287
  store i64 %289, ptr %15, align 8, !tbaa !9
  br label %290

290:                                              ; preds = %279, %35
  %291 = load i64, ptr %15, align 8, !tbaa !9
  %292 = load i64, ptr %7, align 8, !tbaa !9
  %293 = icmp uge i64 %291, %292
  %294 = xor i1 %293, true
  %295 = xor i1 %294, true
  %296 = zext i1 %295 to i64
  %297 = call i64 @llvm.expect.i64(i64 %296, i64 0)
  %298 = icmp ne i64 %297, 0
  br i1 %298, label %299, label %318

299:                                              ; preds = %290
  %300 = load i64, ptr %7, align 8, !tbaa !9
  %301 = load i64, ptr %15, align 8, !tbaa !9
  %302 = sub i64 %301, %300
  store i64 %302, ptr %15, align 8, !tbaa !9
  %303 = load ptr, ptr %9, align 8, !tbaa !5
  %304 = getelementptr inbounds ptr, ptr %303, i64 6
  %305 = load ptr, ptr %304, align 8, !tbaa !5
  %306 = call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %305)
  br i1 %306, label %307, label %311

307:                                              ; preds = %299
  %308 = load ptr, ptr %10, align 8, !tbaa !5
  %309 = load ptr, ptr %9, align 8, !tbaa !5
  %310 = getelementptr inbounds ptr, ptr %309, i64 6
  call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %308, ptr noundef nonnull align 8 dereferenceable(8) %310)
  br label %311

311:                                              ; preds = %307, %299
  %312 = load ptr, ptr %9, align 8, !tbaa !5
  %313 = getelementptr inbounds ptr, ptr %312, i64 6
  %314 = load ptr, ptr %313, align 8, !tbaa !5
  %315 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %314, i32 1
  store ptr %315, ptr %313, align 8, !tbaa !5
  %316 = load i64, ptr %14, align 8, !tbaa !9
  %317 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %314, i64 noundef %316, i64 noundef %317, i64 noundef 6)
  br label %368

318:                                              ; preds = %290
  %319 = load ptr, ptr %6, align 8, !tbaa !5
  %320 = load i64, ptr %15, align 8, !tbaa !9
  %321 = getelementptr inbounds i8, ptr %319, i64 %320
  %322 = load i8, ptr %321, align 1, !tbaa !15
  %323 = zext i8 %322 to i32
  %324 = and i32 %323, 253
  %325 = trunc i32 %324 to i8
  store i8 %325, ptr %321, align 1, !tbaa !15
  %326 = load i64, ptr %16, align 8, !tbaa !9
  %327 = load i64, ptr %15, align 8, !tbaa !9
  %328 = add i64 %327, %326
  store i64 %328, ptr %15, align 8, !tbaa !9
  br label %329

329:                                              ; preds = %318, %35
  %330 = load i64, ptr %15, align 8, !tbaa !9
  %331 = load i64, ptr %7, align 8, !tbaa !9
  %332 = icmp uge i64 %330, %331
  %333 = xor i1 %332, true
  %334 = xor i1 %333, true
  %335 = zext i1 %334 to i64
  %336 = call i64 @llvm.expect.i64(i64 %335, i64 0)
  %337 = icmp ne i64 %336, 0
  br i1 %337, label %338, label %357

338:                                              ; preds = %329
  %339 = load i64, ptr %7, align 8, !tbaa !9
  %340 = load i64, ptr %15, align 8, !tbaa !9
  %341 = sub i64 %340, %339
  store i64 %341, ptr %15, align 8, !tbaa !9
  %342 = load ptr, ptr %9, align 8, !tbaa !5
  %343 = getelementptr inbounds ptr, ptr %342, i64 7
  %344 = load ptr, ptr %343, align 8, !tbaa !5
  %345 = call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %344)
  br i1 %345, label %346, label %350

346:                                              ; preds = %338
  %347 = load ptr, ptr %10, align 8, !tbaa !5
  %348 = load ptr, ptr %9, align 8, !tbaa !5
  %349 = getelementptr inbounds ptr, ptr %348, i64 7
  call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %347, ptr noundef nonnull align 8 dereferenceable(8) %349)
  br label %350

350:                                              ; preds = %346, %338
  %351 = load ptr, ptr %9, align 8, !tbaa !5
  %352 = getelementptr inbounds ptr, ptr %351, i64 7
  %353 = load ptr, ptr %352, align 8, !tbaa !5
  %354 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %353, i32 1
  store ptr %354, ptr %352, align 8, !tbaa !5
  %355 = load i64, ptr %14, align 8, !tbaa !9
  %356 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %353, i64 noundef %355, i64 noundef %356, i64 noundef 7)
  br label %368

357:                                              ; preds = %329
  %358 = load ptr, ptr %6, align 8, !tbaa !5
  %359 = load i64, ptr %15, align 8, !tbaa !9
  %360 = getelementptr inbounds i8, ptr %358, i64 %359
  %361 = load i8, ptr %360, align 1, !tbaa !15
  %362 = zext i8 %361 to i32
  %363 = and i32 %362, 223
  %364 = trunc i32 %363 to i8
  store i8 %364, ptr %360, align 1, !tbaa !15
  %365 = load i64, ptr %19, align 8, !tbaa !9
  %366 = load i64, ptr %15, align 8, !tbaa !9
  %367 = add i64 %366, %365
  store i64 %367, ptr %15, align 8, !tbaa !9
  br label %55, !llvm.loop !16

368:                                              ; preds = %350, %311, %272, %233, %194, %155, %116, %77
  br label %369

369:                                              ; preds = %368
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %370

370:                                              ; preds = %369
  %371 = load ptr, ptr %11, align 8, !tbaa !5
  %372 = getelementptr inbounds %"class.primesieve::SievingPrime", ptr %371, i32 1
  store ptr %372, ptr %11, align 8, !tbaa !5
  br label %31, !llvm.loop !18

373:                                              ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret void
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10primesieve12SievingPrime13getWheelIndexEv(ptr noundef nonnull align 4 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10primesieve12SievingPrime15getSievingPrimeEv(ptr noundef nonnull align 4 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10primesieve12SievingPrime16getMultipleIndexEv(ptr noundef nonnull align 4 dereferenceable(8)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 = { "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 noinline 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 = { 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, !6, i64 24}
!12 = !{!"_ZTSN10primesieve10EratMediumE", !13, i64 0, !10, i64 16, !6, i64 24, !14, i64 32, !14, i64 56}
!13 = !{!"_ZTSN10primesieve5WheelILi30ELi8ELi6EXadsoKNS_9WheelInitEL_ZNS_11wheel30InitEEEEEE", !10, i64 8}
!14 = !{!"_ZTSN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef) local_unnamed_addr #0 align 2

declare void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

; Function Attrs: mustprogress noinline uwtable
define dso_local void @_ZN10primesieve10EratMedium10crossOff_7EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr nocapture noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #2 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = tail call noundef ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call noundef ptr @_ZN10primesieve6Bucket5beginEv(ptr noundef nonnull align 8 dereferenceable(8192) %3)
  %10 = tail call noundef ptr @_ZN10primesieve6Bucket3endEv(ptr noundef nonnull align 8 dereferenceable(8192) %3)
  %11 = tail call noundef i64 @_ZNK10primesieve12SievingPrime13getWheelIndexEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  %.not142 = icmp eq ptr %9, %10
  br i1 %.not142, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %4
  %12 = getelementptr inbounds i8, ptr %6, i64 8
  %13 = getelementptr inbounds i8, ptr %6, i64 16
  %14 = getelementptr inbounds i8, ptr %6, i64 24
  %15 = getelementptr inbounds i8, ptr %6, i64 32
  %16 = getelementptr inbounds i8, ptr %6, i64 40
  %17 = getelementptr inbounds i8, ptr %6, i64 48
  %18 = getelementptr inbounds i8, ptr %6, i64 56
  br label %19

19:                                               ; preds = %.lr.ph, %141
  %.0143 = phi ptr [ %9, %.lr.ph ], [ %142, %141 ]
  %20 = tail call noundef i64 @_ZNK10primesieve12SievingPrime15getSievingPrimeEv(ptr noundef nonnull align 4 dereferenceable(8) %.0143)
  %21 = tail call noundef i64 @_ZNK10primesieve12SievingPrime16getMultipleIndexEv(ptr noundef nonnull align 4 dereferenceable(8) %.0143)
  %22 = mul i64 %20, 6
  %23 = or disjoint i64 %22, 1
  %24 = shl i64 %20, 2
  %25 = or disjoint i64 %24, 1
  %26 = shl i64 %20, 1
  %27 = or disjoint i64 %26, 1
  switch i64 %11, label %28 [
    i64 0, label %29
    i64 1, label %43
    i64 2, label %57
    i64 3, label %71
    i64 4, label %85
    i64 5, label %99
    i64 6, label %113
    i64 7, label %127
  ]

28:                                               ; preds = %19
  unreachable

29:                                               ; preds = %136, %19
  %.0125 = phi i64 [ %140, %136 ], [ %21, %19 ]
  %.not134 = icmp ult i64 %.0125, %2
  br i1 %.not134, label %38, label %30, !prof !13

30:                                               ; preds = %29
  %31 = sub i64 %.0125, %2
  %32 = load ptr, ptr %6, align 8, !tbaa !14
  %33 = tail call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %32)
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  tail call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(8) %6)
  br label %35

35:                                               ; preds = %34, %30
  %36 = load ptr, ptr %6, align 8, !tbaa !14
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  store ptr %37, ptr %6, align 8, !tbaa !14
  tail call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %36, i64 noundef %20, i64 noundef %31, i64 noundef 0)
  br label %141

38:                                               ; preds = %29
  %39 = getelementptr inbounds i8, ptr %1, i64 %.0125
  %40 = load i8, ptr %39, align 1, !tbaa !15
  %41 = and i8 %40, -2
  store i8 %41, ptr %39, align 1, !tbaa !15
  %42 = add i64 %.0125, %23
  br label %43

43:                                               ; preds = %38, %19
  %.1 = phi i64 [ %42, %38 ], [ %21, %19 ]
  %.not135 = icmp ult i64 %.1, %2
  br i1 %.not135, label %52, label %44, !prof !13

44:                                               ; preds = %43
  %45 = sub i64 %.1, %2
  %46 = load ptr, ptr %12, align 8, !tbaa !14
  %47 = tail call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %46)
  br i1 %47, label %48, label %49

48:                                               ; preds = %44
  tail call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(8) %12)
  br label %49

49:                                               ; preds = %48, %44
  %50 = load ptr, ptr %12, align 8, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %50, i64 8
  store ptr %51, ptr %12, align 8, !tbaa !14
  tail call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %50, i64 noundef %20, i64 noundef %45, i64 noundef 1)
  br label %141

52:                                               ; preds = %43
  %53 = getelementptr inbounds i8, ptr %1, i64 %.1
  %54 = load i8, ptr %53, align 1, !tbaa !15
  %55 = and i8 %54, -17
  store i8 %55, ptr %53, align 1, !tbaa !15
  %56 = add i64 %.1, %25
  br label %57

57:                                               ; preds = %52, %19
  %.2 = phi i64 [ %56, %52 ], [ %21, %19 ]
  %.not136 = icmp ult i64 %.2, %2
  br i1 %.not136, label %66, label %58, !prof !13

58:                                               ; preds = %57
  %59 = sub i64 %.2, %2
  %60 = load ptr, ptr %13, align 8, !tbaa !14
  %61 = tail call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %60)
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  tail call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(8) %13)
  br label %63

63:                                               ; preds = %62, %58
  %64 = load ptr, ptr %13, align 8, !tbaa !14
  %65 = getelementptr inbounds i8, ptr %64, i64 8
  store ptr %65, ptr %13, align 8, !tbaa !14
  tail call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %64, i64 noundef %20, i64 noundef %59, i64 noundef 2)
  br label %141

66:                                               ; preds = %57
  %67 = getelementptr inbounds i8, ptr %1, i64 %.2
  %68 = load i8, ptr %67, align 1, !tbaa !15
  %69 = and i8 %68, -9
  store i8 %69, ptr %67, align 1, !tbaa !15
  %70 = add i64 %.2, %26
  br label %71

71:                                               ; preds = %66, %19
  %.3 = phi i64 [ %70, %66 ], [ %21, %19 ]
  %.not137 = icmp ult i64 %.3, %2
  br i1 %.not137, label %80, label %72, !prof !13

72:                                               ; preds = %71
  %73 = sub i64 %.3, %2
  %74 = load ptr, ptr %14, align 8, !tbaa !14
  %75 = tail call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %74)
  br i1 %75, label %76, label %77

76:                                               ; preds = %72
  tail call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
  br label %77

77:                                               ; preds = %76, %72
  %78 = load ptr, ptr %14, align 8, !tbaa !14
  %79 = getelementptr inbounds i8, ptr %78, i64 8
  store ptr %79, ptr %14, align 8, !tbaa !14
  tail call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %78, i64 noundef %20, i64 noundef %73, i64 noundef 3)
  br label %141

80:                                               ; preds = %71
  %81 = getelementptr inbounds i8, ptr %1, i64 %.3
  %82 = load i8, ptr %81, align 1, !tbaa !15
  %83 = and i8 %82, 127
  store i8 %83, ptr %81, align 1, !tbaa !15
  %84 = add i64 %.3, %25
  br label %85

85:                                               ; preds = %80, %19
  %.4 = phi i64 [ %84, %80 ], [ %21, %19 ]
  %.not138 = icmp ult i64 %.4, %2
  br i1 %.not138, label %94, label %86, !prof !13

86:                                               ; preds = %85
  %87 = sub i64 %.4, %2
  %88 = load ptr, ptr %15, align 8, !tbaa !14
  %89 = tail call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %88)
  br i1 %89, label %90, label %91

90:                                               ; preds = %86
  tail call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(8) %15)
  br label %91

91:                                               ; preds = %90, %86
  %92 = load ptr, ptr %15, align 8, !tbaa !14
  %93 = getelementptr inbounds i8, ptr %92, i64 8
  store ptr %93, ptr %15, align 8, !tbaa !14
  tail call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %92, i64 noundef %20, i64 noundef %87, i64 noundef 4)
  br label %141

94:                                               ; preds = %85
  %95 = getelementptr inbounds i8, ptr %1, i64 %.4
  %96 = load i8, ptr %95, align 1, !tbaa !15
  %97 = and i8 %96, -65
  store i8 %97, ptr %95, align 1, !tbaa !15
  %98 = add i64 %.4, %27
  br label %99

99:                                               ; preds = %94, %19
  %.5 = phi i64 [ %98, %94 ], [ %21, %19 ]
  %.not139 = icmp ult i64 %.5, %2
  br i1 %.not139, label %108, label %100, !prof !13

100:                                              ; preds = %99
  %101 = sub i64 %.5, %2
  %102 = load ptr, ptr %16, align 8, !tbaa !14
  %103 = tail call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %102)
  br i1 %103, label %104, label %105

104:                                              ; preds = %100
  tail call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(8) %16)
  br label %105

105:                                              ; preds = %104, %100
  %106 = load ptr, ptr %16, align 8, !tbaa !14
  %107 = getelementptr inbounds i8, ptr %106, i64 8
  store ptr %107, ptr %16, align 8, !tbaa !14
  tail call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %106, i64 noundef %20, i64 noundef %101, i64 noundef 5)
  br label %141

108:                                              ; preds = %99
  %109 = getelementptr inbounds i8, ptr %1, i64 %.5
  %110 = load i8, ptr %109, align 1, !tbaa !15
  %111 = and i8 %110, -5
  store i8 %111, ptr %109, align 1, !tbaa !15
  %112 = add i64 %.5, %25
  br label %113

113:                                              ; preds = %108, %19
  %.6 = phi i64 [ %112, %108 ], [ %21, %19 ]
  %.not140 = icmp ult i64 %.6, %2
  br i1 %.not140, label %122, label %114, !prof !13

114:                                              ; preds = %113
  %115 = sub i64 %.6, %2
  %116 = load ptr, ptr %17, align 8, !tbaa !14
  %117 = tail call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %116)
  br i1 %117, label %118, label %119

118:                                              ; preds = %114
  tail call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(8) %17)
  br label %119

119:                                              ; preds = %118, %114
  %120 = load ptr, ptr %17, align 8, !tbaa !14
  %121 = getelementptr inbounds i8, ptr %120, i64 8
  store ptr %121, ptr %17, align 8, !tbaa !14
  tail call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %120, i64 noundef %20, i64 noundef %115, i64 noundef 6)
  br label %141

122:                                              ; preds = %113
  %123 = getelementptr inbounds i8, ptr %1, i64 %.6
  %124 = load i8, ptr %123, align 1, !tbaa !15
  %125 = and i8 %124, -3
  store i8 %125, ptr %123, align 1, !tbaa !15
  %126 = add i64 %.6, %23
  br label %127

127:                                              ; preds = %122, %19
  %.7 = phi i64 [ %21, %19 ], [ %126, %122 ]
  %.not141 = icmp ult i64 %.7, %2
  br i1 %.not141, label %136, label %128, !prof !13

128:                                              ; preds = %127
  %129 = sub i64 %.7, %2
  %130 = load ptr, ptr %18, align 8, !tbaa !14
  %131 = tail call noundef zeroext i1 @_ZN10primesieve6Bucket6isFullEPNS_12SievingPrimeE(ptr noundef %130)
  br i1 %131, label %132, label %133

132:                                              ; preds = %128
  tail call void @_ZN10primesieve10MemoryPool9addBucketERPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(8) %18)
  br label %133

133:                                              ; preds = %132, %128
  %134 = load ptr, ptr %18, align 8, !tbaa !14
  %135 = getelementptr inbounds i8, ptr %134, i64 8
  store ptr %135, ptr %18, align 8, !tbaa !14
  tail call void @_ZN10primesieve12SievingPrime3setEmmm(ptr noundef nonnull align 4 dereferenceable(8) %134, i64 noundef %20, i64 noundef %129, i64 noundef 7)
  br label %141

136:                                              ; preds = %127
  %137 = getelementptr inbounds i8, ptr %1, i64 %.7
  %138 = load i8, ptr %137, align 1, !tbaa !15
  %139 = and i8 %138, -33
  store i8 %139, ptr %137, align 1, !tbaa !15
  %140 = add i64 %.7, %27
  br label %29

141:                                              ; preds = %35, %49, %63, %77, %91, %105, %119, %133
  %142 = getelementptr inbounds i8, ptr %.0143, i64 8
  %.not = icmp eq ptr %142, %10
  br i1 %.not, label %._crit_edge, label %19, !llvm.loop !16

._crit_edge:                                      ; preds = %141, %4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN10primesieve6Bucket5beginEv(ptr noundef nonnull align 8 dereferenceable(8192)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN10primesieve6Bucket3endEv(ptr noundef nonnull align 8 dereferenceable(8192)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10primesieve12SievingPrime13getWheelIndexEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10primesieve12SievingPrime15getSievingPrimeEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10primesieve12SievingPrime16getMultipleIndexEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #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 noinline 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 = { 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, !11, i64 24}
!6 = !{!"_ZTSN10primesieve10EratMediumE", !7, i64 0, !8, i64 16, !11, i64 24, !12, i64 32, !12, i64 56}
!7 = !{!"_ZTSN10primesieve5WheelILi30ELi8ELi6EXadsoKNS_9WheelInitEL_ZNS_11wheel30InitEEEEEE", !8, i64 8}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_ZTSN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEE", !11, i64 0, !11, i64 8, !11, i64 16}
!13 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!14 = !{!11, !11, i64 0}
!15 = !{!9, !9, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass