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

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

@small_primes = external dso_local constant [25 x i64], align 16
@large_primes = external dso_local constant [20 x i64], align 16
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = 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 i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  store i64 25, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %6 = load i64, ptr %3, align 8, !tbaa !5
  %7 = call ptr @primesieve_generate_n_primes(i64 noundef %6, i64 noundef 0, i32 noundef 13)
  store ptr %7, ptr %4, align 8, !tbaa !9
  store i64 0, ptr %2, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %28, %0
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = load i64, ptr %3, align 8, !tbaa !5
  %11 = icmp ult i64 %9, %10
  br i1 %11, label %12, label %31

12:                                               ; preds = %8
  %13 = load i64, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !9
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds i64, ptr %14, i64 %15
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %13, i64 noundef %17)
  %19 = load ptr, ptr %4, align 8, !tbaa !9
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds i64, ptr %19, i64 %20
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = load i64, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds [25 x i64], ptr @small_primes, i64 0, i64 %23
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = icmp eq i64 %22, %25
  %27 = zext i1 %26 to i32
  call void @check(i32 noundef %27)
  br label %28

28:                                               ; preds = %12
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = add i64 %29, 1
  store i64 %30, ptr %2, align 8, !tbaa !5
  br label %8, !llvm.loop !11

31:                                               ; preds = %8
  %32 = load ptr, ptr %4, align 8, !tbaa !9
  call void @primesieve_free(ptr noundef %32)
  store i64 20, ptr %3, align 8, !tbaa !5
  %33 = load i64, ptr %3, align 8, !tbaa !5
  %34 = call ptr @primesieve_generate_n_primes(i64 noundef %33, i64 noundef 10000000000000000, i32 noundef 13)
  store ptr %34, ptr %4, align 8, !tbaa !9
  store i64 0, ptr %2, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %55, %31
  %36 = load i64, ptr %2, align 8, !tbaa !5
  %37 = load i64, ptr %3, align 8, !tbaa !5
  %38 = icmp ult i64 %36, %37
  br i1 %38, label %39, label %58

39:                                               ; preds = %35
  %40 = load i64, ptr %2, align 8, !tbaa !5
  %41 = load ptr, ptr %4, align 8, !tbaa !9
  %42 = load i64, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds i64, ptr %41, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %40, i64 noundef %44)
  %46 = load ptr, ptr %4, align 8, !tbaa !9
  %47 = load i64, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds i64, ptr %46, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = load i64, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds [20 x i64], ptr @large_primes, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = icmp eq i64 %49, %52
  %54 = zext i1 %53 to i32
  call void @check(i32 noundef %54)
  br label %55

55:                                               ; preds = %39
  %56 = load i64, ptr %2, align 8, !tbaa !5
  %57 = add i64 %56, 1
  store i64 %57, ptr %2, align 8, !tbaa !5
  br label %35, !llvm.loop !13

58:                                               ; preds = %35
  %59 = load ptr, ptr %4, align 8, !tbaa !9
  call void @primesieve_free(ptr noundef %59)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %60 = call ptr @primesieve_generate_n_primes(i64 noundef 100000, i64 noundef 65436, i32 noundef 9)
  store ptr %60, ptr %5, align 8, !tbaa !9
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %62 = load ptr, ptr %5, align 8, !tbaa !9
  %63 = icmp eq ptr %62, null
  %64 = zext i1 %63 to i32
  call void @check(i32 noundef %64)
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  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_n_primes(i64 noundef, i64 noundef, i32 noundef) #1

declare void @primesieve_free(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 = { 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}


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

@small_primes = external dso_local local_unnamed_addr constant [25 x i64], align 16
@large_primes = external dso_local local_unnamed_addr constant [20 x i64], align 16
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = 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 = tail call ptr @primesieve_generate_n_primes(i64 noundef 25, i64 noundef 0, i32 noundef 13) #3
  %2 = load i64, ptr %1, align 8, !tbaa !5
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 0, i64 noundef %2)
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %5 = load i64, ptr @small_primes, align 16, !tbaa !5
  %6 = icmp eq i64 %4, %5
  %7 = zext i1 %6 to i32
  tail call void @check(i32 noundef %7)
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 1, i64 noundef %9)
  %11 = load i64, ptr %8, align 8, !tbaa !5
  %12 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 8), align 8, !tbaa !5
  %13 = icmp eq i64 %11, %12
  %14 = zext i1 %13 to i32
  tail call void @check(i32 noundef %14)
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 2, i64 noundef %16)
  %18 = load i64, ptr %15, align 8, !tbaa !5
  %19 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 16), align 16, !tbaa !5
  %20 = icmp eq i64 %18, %19
  %21 = zext i1 %20 to i32
  tail call void @check(i32 noundef %21)
  %22 = getelementptr inbounds i8, ptr %1, i64 24
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 3, i64 noundef %23)
  %25 = load i64, ptr %22, align 8, !tbaa !5
  %26 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 24), align 8, !tbaa !5
  %27 = icmp eq i64 %25, %26
  %28 = zext i1 %27 to i32
  tail call void @check(i32 noundef %28)
  %29 = getelementptr inbounds i8, ptr %1, i64 32
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 4, i64 noundef %30)
  %32 = load i64, ptr %29, align 8, !tbaa !5
  %33 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 32), align 16, !tbaa !5
  %34 = icmp eq i64 %32, %33
  %35 = zext i1 %34 to i32
  tail call void @check(i32 noundef %35)
  %36 = getelementptr inbounds i8, ptr %1, i64 40
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 5, i64 noundef %37)
  %39 = load i64, ptr %36, align 8, !tbaa !5
  %40 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 40), align 8, !tbaa !5
  %41 = icmp eq i64 %39, %40
  %42 = zext i1 %41 to i32
  tail call void @check(i32 noundef %42)
  %43 = getelementptr inbounds i8, ptr %1, i64 48
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 6, i64 noundef %44)
  %46 = load i64, ptr %43, align 8, !tbaa !5
  %47 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 48), align 16, !tbaa !5
  %48 = icmp eq i64 %46, %47
  %49 = zext i1 %48 to i32
  tail call void @check(i32 noundef %49)
  %50 = getelementptr inbounds i8, ptr %1, i64 56
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 7, i64 noundef %51)
  %53 = load i64, ptr %50, align 8, !tbaa !5
  %54 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 56), align 8, !tbaa !5
  %55 = icmp eq i64 %53, %54
  %56 = zext i1 %55 to i32
  tail call void @check(i32 noundef %56)
  %57 = getelementptr inbounds i8, ptr %1, i64 64
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 8, i64 noundef %58)
  %60 = load i64, ptr %57, align 8, !tbaa !5
  %61 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 64), align 16, !tbaa !5
  %62 = icmp eq i64 %60, %61
  %63 = zext i1 %62 to i32
  tail call void @check(i32 noundef %63)
  %64 = getelementptr inbounds i8, ptr %1, i64 72
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 9, i64 noundef %65)
  %67 = load i64, ptr %64, align 8, !tbaa !5
  %68 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 72), align 8, !tbaa !5
  %69 = icmp eq i64 %67, %68
  %70 = zext i1 %69 to i32
  tail call void @check(i32 noundef %70)
  %71 = getelementptr inbounds i8, ptr %1, i64 80
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 10, i64 noundef %72)
  %74 = load i64, ptr %71, align 8, !tbaa !5
  %75 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 80), align 16, !tbaa !5
  %76 = icmp eq i64 %74, %75
  %77 = zext i1 %76 to i32
  tail call void @check(i32 noundef %77)
  %78 = getelementptr inbounds i8, ptr %1, i64 88
  %79 = load i64, ptr %78, align 8, !tbaa !5
  %80 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 11, i64 noundef %79)
  %81 = load i64, ptr %78, align 8, !tbaa !5
  %82 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 88), align 8, !tbaa !5
  %83 = icmp eq i64 %81, %82
  %84 = zext i1 %83 to i32
  tail call void @check(i32 noundef %84)
  %85 = getelementptr inbounds i8, ptr %1, i64 96
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %87 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 12, i64 noundef %86)
  %88 = load i64, ptr %85, align 8, !tbaa !5
  %89 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 96), align 16, !tbaa !5
  %90 = icmp eq i64 %88, %89
  %91 = zext i1 %90 to i32
  tail call void @check(i32 noundef %91)
  %92 = getelementptr inbounds i8, ptr %1, i64 104
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 13, i64 noundef %93)
  %95 = load i64, ptr %92, align 8, !tbaa !5
  %96 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 104), align 8, !tbaa !5
  %97 = icmp eq i64 %95, %96
  %98 = zext i1 %97 to i32
  tail call void @check(i32 noundef %98)
  %99 = getelementptr inbounds i8, ptr %1, i64 112
  %100 = load i64, ptr %99, align 8, !tbaa !5
  %101 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 14, i64 noundef %100)
  %102 = load i64, ptr %99, align 8, !tbaa !5
  %103 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 112), align 16, !tbaa !5
  %104 = icmp eq i64 %102, %103
  %105 = zext i1 %104 to i32
  tail call void @check(i32 noundef %105)
  %106 = getelementptr inbounds i8, ptr %1, i64 120
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 15, i64 noundef %107)
  %109 = load i64, ptr %106, align 8, !tbaa !5
  %110 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 120), align 8, !tbaa !5
  %111 = icmp eq i64 %109, %110
  %112 = zext i1 %111 to i32
  tail call void @check(i32 noundef %112)
  %113 = getelementptr inbounds i8, ptr %1, i64 128
  %114 = load i64, ptr %113, align 8, !tbaa !5
  %115 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 16, i64 noundef %114)
  %116 = load i64, ptr %113, align 8, !tbaa !5
  %117 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 128), align 16, !tbaa !5
  %118 = icmp eq i64 %116, %117
  %119 = zext i1 %118 to i32
  tail call void @check(i32 noundef %119)
  %120 = getelementptr inbounds i8, ptr %1, i64 136
  %121 = load i64, ptr %120, align 8, !tbaa !5
  %122 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 17, i64 noundef %121)
  %123 = load i64, ptr %120, align 8, !tbaa !5
  %124 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 136), align 8, !tbaa !5
  %125 = icmp eq i64 %123, %124
  %126 = zext i1 %125 to i32
  tail call void @check(i32 noundef %126)
  %127 = getelementptr inbounds i8, ptr %1, i64 144
  %128 = load i64, ptr %127, align 8, !tbaa !5
  %129 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 18, i64 noundef %128)
  %130 = load i64, ptr %127, align 8, !tbaa !5
  %131 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 144), align 16, !tbaa !5
  %132 = icmp eq i64 %130, %131
  %133 = zext i1 %132 to i32
  tail call void @check(i32 noundef %133)
  %134 = getelementptr inbounds i8, ptr %1, i64 152
  %135 = load i64, ptr %134, align 8, !tbaa !5
  %136 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 19, i64 noundef %135)
  %137 = load i64, ptr %134, align 8, !tbaa !5
  %138 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 152), align 8, !tbaa !5
  %139 = icmp eq i64 %137, %138
  %140 = zext i1 %139 to i32
  tail call void @check(i32 noundef %140)
  %141 = getelementptr inbounds i8, ptr %1, i64 160
  %142 = load i64, ptr %141, align 8, !tbaa !5
  %143 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 20, i64 noundef %142)
  %144 = load i64, ptr %141, align 8, !tbaa !5
  %145 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 160), align 16, !tbaa !5
  %146 = icmp eq i64 %144, %145
  %147 = zext i1 %146 to i32
  tail call void @check(i32 noundef %147)
  %148 = getelementptr inbounds i8, ptr %1, i64 168
  %149 = load i64, ptr %148, align 8, !tbaa !5
  %150 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 21, i64 noundef %149)
  %151 = load i64, ptr %148, align 8, !tbaa !5
  %152 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 168), align 8, !tbaa !5
  %153 = icmp eq i64 %151, %152
  %154 = zext i1 %153 to i32
  tail call void @check(i32 noundef %154)
  %155 = getelementptr inbounds i8, ptr %1, i64 176
  %156 = load i64, ptr %155, align 8, !tbaa !5
  %157 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 22, i64 noundef %156)
  %158 = load i64, ptr %155, align 8, !tbaa !5
  %159 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 176), align 16, !tbaa !5
  %160 = icmp eq i64 %158, %159
  %161 = zext i1 %160 to i32
  tail call void @check(i32 noundef %161)
  %162 = getelementptr inbounds i8, ptr %1, i64 184
  %163 = load i64, ptr %162, align 8, !tbaa !5
  %164 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 23, i64 noundef %163)
  %165 = load i64, ptr %162, align 8, !tbaa !5
  %166 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 184), align 8, !tbaa !5
  %167 = icmp eq i64 %165, %166
  %168 = zext i1 %167 to i32
  tail call void @check(i32 noundef %168)
  %169 = getelementptr inbounds i8, ptr %1, i64 192
  %170 = load i64, ptr %169, align 8, !tbaa !5
  %171 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 24, i64 noundef %170)
  %172 = load i64, ptr %169, align 8, !tbaa !5
  %173 = load i64, ptr getelementptr inbounds (i8, ptr @small_primes, i64 192), align 16, !tbaa !5
  %174 = icmp eq i64 %172, %173
  %175 = zext i1 %174 to i32
  tail call void @check(i32 noundef %175)
  tail call void @primesieve_free(ptr noundef %1) #3
  %176 = tail call ptr @primesieve_generate_n_primes(i64 noundef 20, i64 noundef 10000000000000000, i32 noundef 13) #3
  %177 = load i64, ptr %176, align 8, !tbaa !5
  %178 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 0, i64 noundef %177)
  %179 = load i64, ptr %176, align 8, !tbaa !5
  %180 = load i64, ptr @large_primes, align 16, !tbaa !5
  %181 = icmp eq i64 %179, %180
  %182 = zext i1 %181 to i32
  tail call void @check(i32 noundef %182)
  %183 = getelementptr inbounds i8, ptr %176, i64 8
  %184 = load i64, ptr %183, align 8, !tbaa !5
  %185 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 1, i64 noundef %184)
  %186 = load i64, ptr %183, align 8, !tbaa !5
  %187 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 8), align 8, !tbaa !5
  %188 = icmp eq i64 %186, %187
  %189 = zext i1 %188 to i32
  tail call void @check(i32 noundef %189)
  %190 = getelementptr inbounds i8, ptr %176, i64 16
  %191 = load i64, ptr %190, align 8, !tbaa !5
  %192 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 2, i64 noundef %191)
  %193 = load i64, ptr %190, align 8, !tbaa !5
  %194 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 16), align 16, !tbaa !5
  %195 = icmp eq i64 %193, %194
  %196 = zext i1 %195 to i32
  tail call void @check(i32 noundef %196)
  %197 = getelementptr inbounds i8, ptr %176, i64 24
  %198 = load i64, ptr %197, align 8, !tbaa !5
  %199 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 3, i64 noundef %198)
  %200 = load i64, ptr %197, align 8, !tbaa !5
  %201 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 24), align 8, !tbaa !5
  %202 = icmp eq i64 %200, %201
  %203 = zext i1 %202 to i32
  tail call void @check(i32 noundef %203)
  %204 = getelementptr inbounds i8, ptr %176, i64 32
  %205 = load i64, ptr %204, align 8, !tbaa !5
  %206 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 4, i64 noundef %205)
  %207 = load i64, ptr %204, align 8, !tbaa !5
  %208 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 32), align 16, !tbaa !5
  %209 = icmp eq i64 %207, %208
  %210 = zext i1 %209 to i32
  tail call void @check(i32 noundef %210)
  %211 = getelementptr inbounds i8, ptr %176, i64 40
  %212 = load i64, ptr %211, align 8, !tbaa !5
  %213 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 5, i64 noundef %212)
  %214 = load i64, ptr %211, align 8, !tbaa !5
  %215 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 40), align 8, !tbaa !5
  %216 = icmp eq i64 %214, %215
  %217 = zext i1 %216 to i32
  tail call void @check(i32 noundef %217)
  %218 = getelementptr inbounds i8, ptr %176, i64 48
  %219 = load i64, ptr %218, align 8, !tbaa !5
  %220 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 6, i64 noundef %219)
  %221 = load i64, ptr %218, align 8, !tbaa !5
  %222 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 48), align 16, !tbaa !5
  %223 = icmp eq i64 %221, %222
  %224 = zext i1 %223 to i32
  tail call void @check(i32 noundef %224)
  %225 = getelementptr inbounds i8, ptr %176, i64 56
  %226 = load i64, ptr %225, align 8, !tbaa !5
  %227 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 7, i64 noundef %226)
  %228 = load i64, ptr %225, align 8, !tbaa !5
  %229 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 56), align 8, !tbaa !5
  %230 = icmp eq i64 %228, %229
  %231 = zext i1 %230 to i32
  tail call void @check(i32 noundef %231)
  %232 = getelementptr inbounds i8, ptr %176, i64 64
  %233 = load i64, ptr %232, align 8, !tbaa !5
  %234 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 8, i64 noundef %233)
  %235 = load i64, ptr %232, align 8, !tbaa !5
  %236 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 64), align 16, !tbaa !5
  %237 = icmp eq i64 %235, %236
  %238 = zext i1 %237 to i32
  tail call void @check(i32 noundef %238)
  %239 = getelementptr inbounds i8, ptr %176, i64 72
  %240 = load i64, ptr %239, align 8, !tbaa !5
  %241 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 9, i64 noundef %240)
  %242 = load i64, ptr %239, align 8, !tbaa !5
  %243 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 72), align 8, !tbaa !5
  %244 = icmp eq i64 %242, %243
  %245 = zext i1 %244 to i32
  tail call void @check(i32 noundef %245)
  %246 = getelementptr inbounds i8, ptr %176, i64 80
  %247 = load i64, ptr %246, align 8, !tbaa !5
  %248 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 10, i64 noundef %247)
  %249 = load i64, ptr %246, align 8, !tbaa !5
  %250 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 80), align 16, !tbaa !5
  %251 = icmp eq i64 %249, %250
  %252 = zext i1 %251 to i32
  tail call void @check(i32 noundef %252)
  %253 = getelementptr inbounds i8, ptr %176, i64 88
  %254 = load i64, ptr %253, align 8, !tbaa !5
  %255 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 11, i64 noundef %254)
  %256 = load i64, ptr %253, align 8, !tbaa !5
  %257 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 88), align 8, !tbaa !5
  %258 = icmp eq i64 %256, %257
  %259 = zext i1 %258 to i32
  tail call void @check(i32 noundef %259)
  %260 = getelementptr inbounds i8, ptr %176, i64 96
  %261 = load i64, ptr %260, align 8, !tbaa !5
  %262 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 12, i64 noundef %261)
  %263 = load i64, ptr %260, align 8, !tbaa !5
  %264 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 96), align 16, !tbaa !5
  %265 = icmp eq i64 %263, %264
  %266 = zext i1 %265 to i32
  tail call void @check(i32 noundef %266)
  %267 = getelementptr inbounds i8, ptr %176, i64 104
  %268 = load i64, ptr %267, align 8, !tbaa !5
  %269 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 13, i64 noundef %268)
  %270 = load i64, ptr %267, align 8, !tbaa !5
  %271 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 104), align 8, !tbaa !5
  %272 = icmp eq i64 %270, %271
  %273 = zext i1 %272 to i32
  tail call void @check(i32 noundef %273)
  %274 = getelementptr inbounds i8, ptr %176, i64 112
  %275 = load i64, ptr %274, align 8, !tbaa !5
  %276 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 14, i64 noundef %275)
  %277 = load i64, ptr %274, align 8, !tbaa !5
  %278 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 112), align 16, !tbaa !5
  %279 = icmp eq i64 %277, %278
  %280 = zext i1 %279 to i32
  tail call void @check(i32 noundef %280)
  %281 = getelementptr inbounds i8, ptr %176, i64 120
  %282 = load i64, ptr %281, align 8, !tbaa !5
  %283 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 15, i64 noundef %282)
  %284 = load i64, ptr %281, align 8, !tbaa !5
  %285 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 120), align 8, !tbaa !5
  %286 = icmp eq i64 %284, %285
  %287 = zext i1 %286 to i32
  tail call void @check(i32 noundef %287)
  %288 = getelementptr inbounds i8, ptr %176, i64 128
  %289 = load i64, ptr %288, align 8, !tbaa !5
  %290 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 16, i64 noundef %289)
  %291 = load i64, ptr %288, align 8, !tbaa !5
  %292 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 128), align 16, !tbaa !5
  %293 = icmp eq i64 %291, %292
  %294 = zext i1 %293 to i32
  tail call void @check(i32 noundef %294)
  %295 = getelementptr inbounds i8, ptr %176, i64 136
  %296 = load i64, ptr %295, align 8, !tbaa !5
  %297 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 17, i64 noundef %296)
  %298 = load i64, ptr %295, align 8, !tbaa !5
  %299 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 136), align 8, !tbaa !5
  %300 = icmp eq i64 %298, %299
  %301 = zext i1 %300 to i32
  tail call void @check(i32 noundef %301)
  %302 = getelementptr inbounds i8, ptr %176, i64 144
  %303 = load i64, ptr %302, align 8, !tbaa !5
  %304 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 18, i64 noundef %303)
  %305 = load i64, ptr %302, align 8, !tbaa !5
  %306 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 144), align 16, !tbaa !5
  %307 = icmp eq i64 %305, %306
  %308 = zext i1 %307 to i32
  tail call void @check(i32 noundef %308)
  %309 = getelementptr inbounds i8, ptr %176, i64 152
  %310 = load i64, ptr %309, align 8, !tbaa !5
  %311 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 19, i64 noundef %310)
  %312 = load i64, ptr %309, align 8, !tbaa !5
  %313 = load i64, ptr getelementptr inbounds (i8, ptr @large_primes, i64 152), align 8, !tbaa !5
  %314 = icmp eq i64 %312, %313
  %315 = zext i1 %314 to i32
  tail call void @check(i32 noundef %315)
  tail call void @primesieve_free(ptr noundef nonnull %176) #3
  %316 = tail call ptr @primesieve_generate_n_primes(i64 noundef 100000, i64 noundef 65436, i32 noundef 9) #3
  %317 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %318 = icmp eq ptr %316, null
  %319 = zext i1 %318 to i32
  tail call void @check(i32 noundef %319)
  %320 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %321 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  ret i32 0
}

declare ptr @primesieve_generate_n_primes(i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

declare void @primesieve_free(ptr noundef) local_unnamed_addr #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 = { "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, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass