; LLVM IR from kimwalisch/primesieve :: test (skipto_next_prime)

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

%struct.primesieve_iterator = type { i64, i64, i64, i64, ptr, ptr, i32 }

@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @check(i32 noundef) #0

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.primesieve_iterator, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %10 = call ptr @primesieve_generate_primes(i64 noundef 0, i64 noundef 100000, ptr noundef %2, i32 noundef 13)
  store ptr %10, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 56, ptr %4) #4
  call void @primesieve_init(ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %11 = load ptr, ptr %3, align 8, !tbaa !9
  %12 = load i64, ptr %2, align 8, !tbaa !5
  %13 = sub i64 %12, 1
  %14 = getelementptr inbounds i64, ptr %11, i64 %13
  %15 = load i64, ptr %14, align 8, !tbaa !5
  store i64 %15, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %63, %0
  %17 = load i64, ptr %5, align 8, !tbaa !5
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = sub i64 %18, 1
  %20 = icmp ult i64 %17, %19
  br i1 %20, label %21, label %66

21:                                               ; preds = %16
  %22 = load ptr, ptr %3, align 8, !tbaa !9
  %23 = load i64, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds i64, ptr %22, i64 %23
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = sub i64 %25, 1
  %27 = load i64, ptr %8, align 8, !tbaa !5
  call void @primesieve_skipto(ptr noundef %4, i64 noundef %26, i64 noundef %27)
  %28 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %28, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %3, align 8, !tbaa !9
  %30 = load i64, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds i64, ptr %29, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = sub i64 %32, 1
  %34 = load i64, ptr %7, align 8, !tbaa !5
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %33, i64 noundef %34)
  %36 = load i64, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %3, align 8, !tbaa !9
  %38 = load i64, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds i64, ptr %37, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = icmp eq i64 %36, %40
  %42 = zext i1 %41 to i32
  call void @check(i32 noundef %42)
  %43 = load ptr, ptr %3, align 8, !tbaa !9
  %44 = load i64, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds i64, ptr %43, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = load i64, ptr %8, align 8, !tbaa !5
  call void @primesieve_skipto(ptr noundef %4, i64 noundef %46, i64 noundef %47)
  %48 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %48, ptr %7, align 8, !tbaa !5
  %49 = load ptr, ptr %3, align 8, !tbaa !9
  %50 = load i64, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds i64, ptr %49, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = load i64, ptr %7, align 8, !tbaa !5
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %52, i64 noundef %53)
  %55 = load i64, ptr %7, align 8, !tbaa !5
  %56 = load ptr, ptr %3, align 8, !tbaa !9
  %57 = load i64, ptr %5, align 8, !tbaa !5
  %58 = add i64 %57, 1
  %59 = getelementptr inbounds i64, ptr %56, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = icmp eq i64 %55, %60
  %62 = zext i1 %61 to i32
  call void @check(i32 noundef %62)
  br label %63

63:                                               ; preds = %21
  %64 = load i64, ptr %5, align 8, !tbaa !5
  %65 = add i64 %64, 1
  store i64 %65, ptr %5, align 8, !tbaa !5
  br label %16, !llvm.loop !11

66:                                               ; preds = %16
  %67 = load i64, ptr %8, align 8, !tbaa !5
  call void @primesieve_skipto(ptr noundef %4, i64 noundef 0, i64 noundef %67)
  br label %68

68:                                               ; preds = %71, %66
  %69 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %69, ptr %7, align 8, !tbaa !5
  %70 = icmp ult i64 %69, 1000000000
  br i1 %70, label %71, label %75

71:                                               ; preds = %68
  %72 = load i64, ptr %7, align 8, !tbaa !5
  %73 = load i64, ptr %9, align 8, !tbaa !5
  %74 = add i64 %73, %72
  store i64 %74, ptr %9, align 8, !tbaa !5
  br label %68, !llvm.loop !13

75:                                               ; preds = %68
  %76 = load i64, ptr %9, align 8, !tbaa !5
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %76)
  %78 = load i64, ptr %9, align 8, !tbaa !5
  %79 = icmp eq i64 %78, 24739512092254535
  %80 = zext i1 %79 to i32
  call void @check(i32 noundef %80)
  %81 = load i64, ptr %8, align 8, !tbaa !5
  %82 = udiv i64 %81, 2
  %83 = load i64, ptr %8, align 8, !tbaa !5
  call void @primesieve_skipto(ptr noundef %4, i64 noundef %82, i64 noundef %83)
  %84 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %84, ptr %7, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %89, %75
  %86 = load i64, ptr %7, align 8, !tbaa !5
  %87 = load i64, ptr %8, align 8, !tbaa !5
  %88 = icmp ule i64 %86, %87
  br i1 %88, label %89, label %91

89:                                               ; preds = %85
  %90 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %90, ptr %7, align 8, !tbaa !5
  br label %85, !llvm.loop !14

91:                                               ; preds = %85
  store i64 1, ptr %5, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %110, %91
  %93 = load i64, ptr %5, align 8, !tbaa !5
  %94 = icmp ult i64 %93, 1000
  br i1 %94, label %95, label %113

95:                                               ; preds = %92
  %96 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %96, ptr %6, align 8, !tbaa !5
  %97 = call i64 @primesieve_prev_prime(ptr noundef %4)
  store i64 %97, ptr %7, align 8, !tbaa !5
  %98 = load i64, ptr %6, align 8, !tbaa !5
  %99 = load i64, ptr %7, align 8, !tbaa !5
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %98, i64 noundef %99)
  %101 = load i64, ptr %7, align 8, !tbaa !5
  %102 = load ptr, ptr %3, align 8, !tbaa !9
  %103 = load i64, ptr %2, align 8, !tbaa !5
  %104 = load i64, ptr %5, align 8, !tbaa !5
  %105 = sub i64 %103, %104
  %106 = getelementptr inbounds i64, ptr %102, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = icmp eq i64 %101, %107
  %109 = zext i1 %108 to i32
  call void @check(i32 noundef %109)
  br label %110

110:                                              ; preds = %95
  %111 = load i64, ptr %5, align 8, !tbaa !5
  %112 = add i64 %111, 1
  store i64 %112, ptr %5, align 8, !tbaa !5
  br label %92, !llvm.loop !15

113:                                              ; preds = %92
  call void @primesieve_skipto(ptr noundef %4, i64 noundef -60, i64 noundef 0)
  %114 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %114, ptr %7, align 8, !tbaa !5
  %115 = load i64, ptr %7, align 8, !tbaa !5
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %115)
  %117 = load i64, ptr %7, align 8, !tbaa !5
  %118 = icmp eq i64 %117, -59
  %119 = zext i1 %118 to i32
  call void @check(i32 noundef %119)
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %132, %113
  %121 = load i64, ptr %5, align 8, !tbaa !5
  %122 = icmp ult i64 %121, 100
  br i1 %122, label %123, label %135

123:                                              ; preds = %120
  %124 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %124, ptr %6, align 8, !tbaa !5
  %125 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %125, ptr %7, align 8, !tbaa !5
  %126 = load i64, ptr %6, align 8, !tbaa !5
  %127 = load i64, ptr %7, align 8, !tbaa !5
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %126, i64 noundef %127)
  %129 = load i64, ptr %7, align 8, !tbaa !5
  %130 = icmp eq i64 %129, -1
  %131 = zext i1 %130 to i32
  call void @check(i32 noundef %131)
  br label %132

132:                                              ; preds = %123
  %133 = load i64, ptr %5, align 8, !tbaa !5
  %134 = add i64 %133, 1
  store i64 %134, ptr %5, align 8, !tbaa !5
  br label %120, !llvm.loop !16

135:                                              ; preds = %120
  %136 = load ptr, ptr %3, align 8, !tbaa !9
  call void @primesieve_free(ptr noundef %136)
  call void @primesieve_free_iterator(ptr noundef %4)
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  ret i32 0
}

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

declare ptr @primesieve_generate_primes(i64 noundef, i64 noundef, ptr noundef, i32 noundef) #1

declare void @primesieve_init(ptr noundef) #1

declare void @primesieve_skipto(ptr noundef, i64 noundef, i64 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @primesieve_next_prime(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @primesieve_prev_prime(ptr noundef) #3

declare void @primesieve_free(ptr noundef) #1

declare void @primesieve_free_iterator(ptr noundef) #1

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.primesieve_iterator = type { i64, i64, i64, i64, ptr, ptr, i32 }

@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @check(i32 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca %struct.primesieve_iterator, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  store i64 0, ptr %1, align 8, !tbaa !5
  %3 = call ptr @primesieve_generate_primes(i64 noundef 0, i64 noundef 100000, ptr noundef nonnull %1, i32 noundef 13) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %2) #5
  call void @primesieve_init(ptr noundef nonnull %2) #5
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %5 = getelementptr i64, ptr %3, i64 %4
  %6 = getelementptr i8, ptr %5, i64 -8
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %.not59 = icmp eq i64 %4, 1
  br i1 %.not59, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.04651 = phi i64 [ %22, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds i64, ptr %3, i64 %.04651
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = add i64 %9, -1
  call void @primesieve_skipto(ptr noundef nonnull %2, i64 noundef %10, i64 noundef %7) #5
  %11 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %12 = load i64, ptr %8, align 8, !tbaa !5
  %13 = add i64 %12, -1
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %13, i64 noundef %11)
  %15 = load i64, ptr %8, align 8, !tbaa !5
  %16 = icmp eq i64 %11, %15
  %17 = zext i1 %16 to i32
  call void @check(i32 noundef %17)
  %18 = load i64, ptr %8, align 8, !tbaa !5
  call void @primesieve_skipto(ptr noundef nonnull %2, i64 noundef %18, i64 noundef %7) #5
  %19 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %20 = load i64, ptr %8, align 8, !tbaa !5
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %20, i64 noundef %19)
  %22 = add nuw i64 %.04651, 1
  %23 = getelementptr inbounds i64, ptr %3, i64 %22
  %24 = load i64, ptr %23, align 8, !tbaa !5
  %25 = icmp eq i64 %19, %24
  %26 = zext i1 %25 to i32
  call void @check(i32 noundef %26)
  %27 = load i64, ptr %1, align 8, !tbaa !5
  %28 = add i64 %27, -1
  %29 = icmp ult i64 %22, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @primesieve_skipto(ptr noundef nonnull %2, i64 noundef 0, i64 noundef %7) #5
  br label %30

30:                                               ; preds = %30, %._crit_edge
  %.0 = phi i64 [ 0, %._crit_edge ], [ %33, %30 ]
  %31 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %32 = icmp ult i64 %31, 1000000000
  %33 = add i64 %31, %.0
  br i1 %32, label %30, label %34, !llvm.loop !11

34:                                               ; preds = %30
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.0)
  %36 = icmp eq i64 %.0, 24739512092254535
  %37 = zext i1 %36 to i32
  call void @check(i32 noundef %37)
  %38 = lshr i64 %7, 1
  call void @primesieve_skipto(ptr noundef nonnull %2, i64 noundef %38, i64 noundef %7) #5
  %39 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %.not52 = icmp ugt i64 %39, %7
  br i1 %.not52, label %.preheader.preheader, label %.lr.ph54

.lr.ph54:                                         ; preds = %34, %.lr.ph54
  %40 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %.not = icmp ugt i64 %40, %7
  br i1 %.not, label %.preheader.preheader, label %.lr.ph54, !llvm.loop !12

.preheader.preheader:                             ; preds = %.lr.ph54, %34
  %.14855.ph = phi i64 [ %39, %34 ], [ %40, %.lr.ph54 ]
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.156 = phi i64 [ %49, %.preheader ], [ 1, %.preheader.preheader ]
  %.14855 = phi i64 [ %41, %.preheader ], [ %.14855.ph, %.preheader.preheader ]
  %41 = call i64 @primesieve_prev_prime(ptr noundef nonnull %2)
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %.14855, i64 noundef %41)
  %43 = load i64, ptr %1, align 8, !tbaa !5
  %44 = sub i64 %43, %.156
  %45 = getelementptr inbounds i64, ptr %3, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = icmp eq i64 %41, %46
  %48 = zext i1 %47 to i32
  call void @check(i32 noundef %48)
  %49 = add nuw nsw i64 %.156, 1
  %exitcond.not = icmp eq i64 %49, 1000
  br i1 %exitcond.not, label %50, label %.preheader, !llvm.loop !13

50:                                               ; preds = %.preheader
  call void @primesieve_skipto(ptr noundef nonnull %2, i64 noundef -60, i64 noundef 0) #5
  %51 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %51)
  %53 = icmp eq i64 %51, -59
  %54 = zext i1 %53 to i32
  call void @check(i32 noundef %54)
  br label %55

55:                                               ; preds = %50, %55
  %.258 = phi i64 [ 0, %50 ], [ %60, %55 ]
  %.24957 = phi i64 [ %51, %50 ], [ %56, %55 ]
  %56 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.24957, i64 noundef %56)
  %58 = icmp eq i64 %56, -1
  %59 = zext i1 %58 to i32
  call void @check(i32 noundef %59)
  %60 = add nuw nsw i64 %.258, 1
  %exitcond60.not = icmp eq i64 %60, 100
  br i1 %exitcond60.not, label %61, label %55, !llvm.loop !14

61:                                               ; preds = %55
  call void @primesieve_free(ptr noundef %3) #5
  call void @primesieve_free_iterator(ptr noundef nonnull %2) #5
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

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

declare ptr @primesieve_generate_primes(i64 noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @primesieve_init(ptr noundef) local_unnamed_addr #3

declare void @primesieve_skipto(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @primesieve_next_prime(ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @primesieve_prev_prime(ptr noundef) local_unnamed_addr #4

declare void @primesieve_free(ptr noundef) local_unnamed_addr #3

declare void @primesieve_free_iterator(ptr noundef) local_unnamed_addr #3

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

attributes #0 = { 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 = { nofree nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 = { 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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass