; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/DIV (A)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@sieve = external dso_local global [1000001 x i32], align 16
@pd = external dso_local global [1000001 x %"class.std::vector"], align 16
@good = external dso_local global [1000001 x i32], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8getSievev() #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  call void @_Z8getSievev()
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %96, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 1000001
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %99

15:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %19, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = sdiv i32 %20, %24
  store i32 %25, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %55, %15
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 1
  br i1 %28, label %29, label %56

29:                                               ; preds = %26
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = icmp eq i32 %33, %34
  br i1 %35, label %36, label %42

36:                                               ; preds = %29
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sdiv i32 %38, %37
  store i32 %39, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %5, align 4, !tbaa !5
  br label %55

42:                                               ; preds = %29
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %6, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  store i32 %51, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sdiv i32 %53, %52
  store i32 %54, ptr %4, align 4, !tbaa !5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %42, %36
  br label %26, !llvm.loop !9

56:                                               ; preds = %26
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %7, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %63
  %65 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #5
  %66 = icmp eq i64 %65, 2
  br i1 %66, label %67, label %85

67:                                               ; preds = %56
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %69
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef 0) #5
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %74, label %85

74:                                               ; preds = %67
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %76
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef 1) #5
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp eq i32 %79, 2
  br i1 %80, label %81, label %85

81:                                               ; preds = %74
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1000001 x i32], ptr @good, i64 0, i64 %83
  store i32 1, ptr %84, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %81, %74, %67, %56
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %87
  %89 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #5
  %90 = icmp ugt i64 %89, 2
  br i1 %90, label %91, label %95

91:                                               ; preds = %85
  %92 = load i32, ptr %2, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %93
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %94) #5
  br label %95

95:                                               ; preds = %91, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !11

99:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %183, %99
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = icmp slt i32 %101, 1000001
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %186

104:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  store i8 0, ptr %10, align 1, !tbaa !12
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %106
  %108 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %107) #5
  %109 = icmp eq i64 %108, 2
  br i1 %109, label %110, label %153

110:                                              ; preds = %104
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %112
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %113, i64 noundef 0) #5
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %120
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef 0) #5
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp eq i32 %118, %123
  br i1 %124, label %125, label %153

125:                                              ; preds = %110
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %127
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %128, i64 noundef 1) #5
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %135
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %136, i64 noundef 1) #5
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = icmp eq i32 %133, %138
  br i1 %139, label %140, label %153

140:                                              ; preds = %125
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %142
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %143, i64 noundef 0) #5
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %147
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %148, i64 noundef 1) #5
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp ne i32 %145, %150
  br i1 %151, label %152, label %153

152:                                              ; preds = %140
  store i8 1, ptr %10, align 1, !tbaa !12
  br label %171

153:                                              ; preds = %140, %125, %110, %104
  %154 = load i32, ptr %9, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %155
  %157 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #5
  %158 = icmp eq i64 %157, 1
  br i1 %158, label %159, label %170

159:                                              ; preds = %153
  %160 = load i32, ptr %9, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %161
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %162, i64 noundef 0) #5
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [1000001 x i32], ptr @good, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %170

169:                                              ; preds = %159
  store i8 1, ptr %10, align 1, !tbaa !12
  br label %170

170:                                              ; preds = %169, %159, %153
  br label %171

171:                                              ; preds = %170, %152
  %172 = load i8, ptr %10, align 1, !tbaa !12, !range !14, !noundef !15
  %173 = trunc i8 %172 to i1
  br i1 %173, label %174, label %182

174:                                              ; preds = %171
  %175 = load i32, ptr %8, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %8, align 4, !tbaa !5
  %177 = icmp eq i32 %176, 9
  br i1 %177, label %178, label %181

178:                                              ; preds = %174
  store i32 0, ptr %8, align 4, !tbaa !5
  %179 = load i32, ptr %9, align 4, !tbaa !5
  %180 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %179)
  br label %181

181:                                              ; preds = %178, %174
  br label %182

182:                                              ; preds = %181, %171
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %9, align 4, !tbaa !5
  br label %100, !llvm.loop !16

186:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !10}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@sieve = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@pd = external dso_local global [1000001 x %"class.std::vector"], align 16
@good = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8getSievev() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  tail call void @_Z8getSievev()
  br label %3

3:                                                ; preds = %0, %40
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next, %40 ]
  %4 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %indvars.iv
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = trunc nuw nsw i64 %indvars.iv to i32
  %7 = sdiv i32 %6, %5
  %8 = icmp sgt i32 %7, 1
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %9 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %indvars.iv
  br label %10

10:                                               ; preds = %.lr.ph, %20
  %.04053 = phi i32 [ 1, %.lr.ph ], [ %.141, %20 ]
  %.04252 = phi i32 [ %7, %.lr.ph ], [ %.143, %20 ]
  %.04451 = phi i32 [ %5, %.lr.ph ], [ %.145, %20 ]
  %11 = zext nneg i32 %.04252 to i64
  %12 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %11
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = icmp eq i32 %13, %.04451
  br i1 %14, label %15, label %17

15:                                               ; preds = %10
  %16 = add nsw i32 %.04053, 1
  br label %20

17:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %18 = add nsw i32 %.04053, 1
  store i32 %18, ptr %1, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %19 = load i32, ptr %12, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %17, %15
  %.145 = phi i32 [ %.04451, %15 ], [ %19, %17 ]
  %.141 = phi i32 [ %16, %15 ], [ 1, %17 ]
  %.143 = sdiv i32 %.04252, %.145
  %21 = icmp sgt i32 %.143, 1
  br i1 %21, label %10, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %20, %3
  %.040.lcssa = phi i32 [ 1, %3 ], [ %.141, %20 ]
  %22 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %23 = add nsw i32 %.040.lcssa, 1
  store i32 %23, ptr %2, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %24 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %25 = icmp eq i64 %24, 2
  br i1 %25, label %26, label %36

26:                                               ; preds = %._crit_edge
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef 0) #5
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = icmp eq i32 %28, 2
  br i1 %29, label %30, label %36

30:                                               ; preds = %26
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef 1) #5
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = icmp eq i32 %32, 2
  br i1 %33, label %34, label %36

34:                                               ; preds = %30
  %35 = getelementptr inbounds [1000001 x i32], ptr @good, i64 0, i64 %indvars.iv
  store i32 1, ptr %35, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %34, %30, %26, %._crit_edge
  %37 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %38 = icmp ugt i64 %37, 2
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  br label %40

40:                                               ; preds = %39, %36
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1000001
  br i1 %exitcond.not, label %.preheader, label %3, !llvm.loop !11

41:                                               ; preds = %.critedge
  ret i32 0

.preheader:                                       ; preds = %40, %.critedge
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.critedge ], [ 1, %40 ]
  %.03955 = phi i32 [ %.1, %.critedge ], [ 0, %40 ]
  %42 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @pd, i64 0, i64 %indvars.iv58
  %43 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #5
  %44 = icmp eq i64 %43, 2
  br i1 %44, label %45, label %68

45:                                               ; preds = %.preheader
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef 0) #5
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef 0) #5
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = icmp eq i32 %50, %52
  br i1 %53, label %54, label %68

54:                                               ; preds = %45
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef 1) #5
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1000001 x i32], ptr @sieve, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef 1) #5
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp eq i32 %59, %61
  br i1 %62, label %63, label %68

63:                                               ; preds = %54
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef 0) #5
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef 1) #5
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %.not = icmp eq i32 %65, %67
  br i1 %.not, label %68, label %.critedge50

68:                                               ; preds = %63, %54, %45, %.preheader
  %69 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #5
  %70 = icmp eq i64 %69, 1
  br i1 %70, label %71, label %.critedge

71:                                               ; preds = %68
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef 0) #5
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1000001 x i32], ptr @good, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %.not48.not = icmp eq i32 %76, 0
  br i1 %.not48.not, label %.critedge, label %.critedge50

.critedge50:                                      ; preds = %63, %71
  %77 = add nsw i32 %.03955, 1
  %78 = icmp eq i32 %77, 9
  br i1 %78, label %79, label %.critedge

79:                                               ; preds = %.critedge50
  %80 = trunc nuw nsw i64 %indvars.iv58 to i32
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %80)
  br label %.critedge

.critedge:                                        ; preds = %68, %.critedge50, %79, %71
  %.1 = phi i32 [ 0, %79 ], [ %77, %.critedge50 ], [ %.03955, %71 ], [ %.03955, %68 ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next59, 1000001
  br i1 %exitcond61.not, label %41, label %.preheader, !llvm.loop !12
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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