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

; 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 [31 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 [36 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = 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 = load i64, ptr %8, align 8, !tbaa !5
  call void @primesieve_jump_to(ptr noundef %4, i64 noundef %25, i64 noundef %26)
  %27 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %27, ptr %7, align 8, !tbaa !5
  %28 = load ptr, ptr %3, align 8, !tbaa !9
  %29 = load i64, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds i64, ptr %28, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = load i64, ptr %7, align 8, !tbaa !5
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %31, i64 noundef %32)
  %34 = load i64, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %3, align 8, !tbaa !9
  %36 = load i64, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds i64, ptr %35, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = icmp eq i64 %34, %38
  %40 = zext i1 %39 to i32
  call void @check(i32 noundef %40)
  %41 = load ptr, ptr %3, align 8, !tbaa !9
  %42 = load i64, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds i64, ptr %41, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = add i64 %44, 1
  %46 = load i64, ptr %8, align 8, !tbaa !5
  call void @primesieve_jump_to(ptr noundef %4, i64 noundef %45, i64 noundef %46)
  %47 = call i64 @primesieve_next_prime(ptr noundef %4)
  store i64 %47, ptr %7, align 8, !tbaa !5
  %48 = load ptr, ptr %3, align 8, !tbaa !9
  %49 = load i64, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds i64, ptr %48, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = add i64 %51, 1
  %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_jump_to(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 ule 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_jump_to(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_jump_to(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 = %131, %113
  %121 = load i64, ptr %5, align 8, !tbaa !5
  %122 = icmp ult i64 %121, 1000
  br i1 %122, label %123, label %134

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 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %126)
  %128 = load i64, ptr %7, align 8, !tbaa !5
  %129 = icmp eq i64 %128, -1
  %130 = zext i1 %129 to i32
  call void @check(i32 noundef %130)
  br label %131

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

134:                                              ; preds = %120
  %135 = load ptr, ptr %3, align 8, !tbaa !9
  call void @primesieve_free(ptr noundef %135)
  call void @primesieve_free_iterator(ptr noundef %4)
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  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_jump_to(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 [31 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 [36 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = 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
  %.not58 = icmp eq i64 %4, 1
  br i1 %.not58, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.04550 = phi i64 [ %22, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds i64, ptr %3, i64 %.04550
  %9 = load i64, ptr %8, align 8, !tbaa !5
  call void @primesieve_jump_to(ptr noundef nonnull %2, i64 noundef %9, i64 noundef %7) #5
  %10 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %11 = load i64, ptr %8, align 8, !tbaa !5
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %11, i64 noundef %10)
  %13 = load i64, ptr %8, align 8, !tbaa !5
  %14 = icmp eq i64 %10, %13
  %15 = zext i1 %14 to i32
  call void @check(i32 noundef %15)
  %16 = load i64, ptr %8, align 8, !tbaa !5
  %17 = add i64 %16, 1
  call void @primesieve_jump_to(ptr noundef nonnull %2, i64 noundef %17, i64 noundef %7) #5
  %18 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %19 = load i64, ptr %8, align 8, !tbaa !5
  %20 = add i64 %19, 1
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %20, i64 noundef %18)
  %22 = add nuw i64 %.04550, 1
  %23 = getelementptr inbounds i64, ptr %3, i64 %22
  %24 = load i64, ptr %23, align 8, !tbaa !5
  %25 = icmp eq i64 %18, %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_jump_to(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, 1000000001
  %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_jump_to(ptr noundef nonnull %2, i64 noundef %38, i64 noundef %7) #5
  %39 = call i64 @primesieve_next_prime(ptr noundef nonnull %2)
  %.not51 = icmp ugt i64 %39, %7
  br i1 %.not51, label %.preheader.preheader, label %.lr.ph53

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

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

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.155 = phi i64 [ %49, %.preheader ], [ 1, %.preheader.preheader ]
  %.14754 = phi i64 [ %41, %.preheader ], [ %.14754.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 %.14754, i64 noundef %41)
  %43 = load i64, ptr %1, align 8, !tbaa !5
  %44 = sub i64 %43, %.155
  %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 %.155, 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_jump_to(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
  %.257 = phi i64 [ 0, %50 ], [ %60, %55 ]
  %.24856 = 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.6, i64 noundef %.24856)
  %58 = icmp eq i64 %56, -1
  %59 = zext i1 %58 to i32
  call void @check(i32 noundef %59)
  %60 = add nuw nsw i64 %.257, 1
  %exitcond59.not = icmp eq i64 %60, 1000
  br i1 %exitcond59.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.7)
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  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_jump_to(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