; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Medium Hard/LOTERY/A.ll (Z5solveii)

; 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@ppro = external dso_local global [100001 x i32], align 16
@ippro = external dso_local global [100001 x i32], align 16
@primes = external dso_local global %"class.std::vector", align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solveii(i32 noundef %0, i32 noundef %1) #1 {
  %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 ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %25)
  %27 = fadd double %26, 1.000000e+00
  %28 = fptosi double %27 to i32
  store i32 %28, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr @primes, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %29 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #4
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %31 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #4
  %32 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %31, ptr %32, align 8
  br label %33

33:                                               ; preds = %82, %2
  %34 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br i1 %34, label %36, label %35

35:                                               ; preds = %33
  store i32 2, ptr %12, align 4
  br label %84

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr %13, align 4, !tbaa !5
  %39 = load i32, ptr %13, align 4, !tbaa !5
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = icmp sge i32 %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %36
  store i32 2, ptr %12, align 4
  br label %79

43:                                               ; preds = %36
  %44 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %44, ptr %7, align 4, !tbaa !5
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %63, %43
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %49, label %67

49:                                               ; preds = %45
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sdiv i32 %50, %51
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = mul nsw i32 %52, %53
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sub nsw i32 %55, %56
  %58 = add nsw i32 %57, 1
  %59 = icmp sge i32 %54, %58
  br i1 %59, label %60, label %62

60:                                               ; preds = %49
  %61 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %61, ptr %8, align 4, !tbaa !5
  br label %63

62:                                               ; preds = %49
  br label %67

63:                                               ; preds = %60
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = mul nsw i32 %65, %64
  store i32 %66, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !11

67:                                               ; preds = %62, %45
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, 1
  br i1 %69, label %70, label %78

70:                                               ; preds = %67
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = mul nsw i64 %72, %74
  %76 = srem i64 %75, 1000000007
  %77 = trunc i64 %76 to i32
  store i32 %77, ptr %6, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %70, %67
  store i32 0, ptr %12, align 4
  br label %79

79:                                               ; preds = %78, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %80 = load i32, ptr %12, align 4
  switch i32 %80, label %84 [
    i32 0, label %81
  ]

81:                                               ; preds = %79
  br label %82

82:                                               ; preds = %81
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br label %33

84:                                               ; preds = %79, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %85

85:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sub nsw i32 %86, %87
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %15, align 4, !tbaa !5
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %91 = load i32, ptr %90, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  store i32 %91, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %92 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %92, ptr %16, align 4, !tbaa !5
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = load i32, ptr %16, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100001 x i32], ptr @ppro, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = load i32, ptr %14, align 4, !tbaa !5
  %101 = sub nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100001 x i32], ptr @ippro, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = mul nsw i64 %99, %105
  %107 = srem i64 %106, 1000000007
  %108 = mul nsw i64 %94, %107
  %109 = srem i64 %108, 1000000007
  %110 = trunc i64 %109 to i32
  store i32 %110, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %111 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %111, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %112 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %112, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 2, ptr %21, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %170, %85
  %114 = load i32, ptr %21, align 4, !tbaa !5
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = icmp sle i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 6, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %173

118:                                              ; preds = %113
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = sub nsw i32 %119, 1
  %121 = load i32, ptr %21, align 4, !tbaa !5
  %122 = sdiv i32 %120, %121
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %19, align 4, !tbaa !5
  %124 = load i32, ptr %16, align 4, !tbaa !5
  %125 = load i32, ptr %21, align 4, !tbaa !5
  %126 = sdiv i32 %124, %125
  store i32 %126, ptr %20, align 4, !tbaa !5
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %128 = load i32, ptr %127, align 4, !tbaa !5
  store i32 %128, ptr %19, align 4, !tbaa !5
  %129 = load i32, ptr %19, align 4, !tbaa !5
  %130 = load i32, ptr %20, align 4, !tbaa !5
  %131 = icmp sgt i32 %129, %130
  br i1 %131, label %132, label %133

132:                                              ; preds = %118
  br label %170

133:                                              ; preds = %118
  %134 = load i32, ptr %19, align 4, !tbaa !5
  %135 = load i32, ptr %17, align 4, !tbaa !5
  %136 = icmp sge i32 %134, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %133
  br label %170

138:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %139 = load i32, ptr %17, align 4, !tbaa !5
  %140 = sub nsw i32 %139, 1
  store i32 %140, ptr %22, align 4, !tbaa !5
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %142 = load i32, ptr %141, align 4, !tbaa !5
  store i32 %142, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  %143 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %143, ptr %17, align 4, !tbaa !5
  %144 = load i32, ptr %6, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = load i32, ptr %18, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100001 x i32], ptr @ppro, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = load i32, ptr %17, align 4, !tbaa !5
  %152 = sub nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100001 x i32], ptr @ippro, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = mul nsw i64 %150, %156
  %158 = srem i64 %157, 1000000007
  %159 = mul nsw i64 %145, %158
  %160 = srem i64 %159, 1000000007
  %161 = trunc i64 %160 to i32
  store i32 %161, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %162 = load i32, ptr %21, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %164 = load i32, ptr %16, align 4, !tbaa !5
  %165 = load i32, ptr %18, align 4, !tbaa !5
  %166 = sdiv i32 %164, %165
  store i32 %166, ptr %24, align 4, !tbaa !5
  %167 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = sub nsw i32 %168, 1
  store i32 %169, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %170

170:                                              ; preds = %138, %137, %132
  %171 = load i32, ptr %21, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %21, align 4, !tbaa !5
  br label %113, !llvm.loop !13

173:                                              ; preds = %117
  %174 = load i32, ptr %6, align 4, !tbaa !5
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret i32 %174
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

%"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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@ppro = external dso_local local_unnamed_addr global [100001 x i32], align 16
@ippro = external dso_local local_unnamed_addr global [100001 x i32], align 16
@primes = external dso_local global %"class.std::vector", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 -1000000006, 1000000007) i32 @_Z5solveii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = alloca i32, align 4
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %12 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %0)
  %13 = fadd double %12, 1.000000e+00
  %14 = fptosi double %13 to i32
  store i32 %14, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %15 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #3
  store ptr %15, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %16 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @primes) #3
  store ptr %16, ptr %5, align 8
  %17 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %17, label %.lr.ph62, label %.thread

.lr.ph62:                                         ; preds = %2, %._crit_edge.thread
  %.04260 = phi i32 [ %.2, %._crit_edge.thread ], [ 1, %2 ]
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %.not = icmp slt i32 %19, %14
  br i1 %.not, label %.preheader, label %.thread.loopexit

.preheader:                                       ; preds = %.lr.ph62
  %.not5055 = icmp sgt i32 %19, %0
  br i1 %.not5055, label %._crit_edge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %20 = srem i32 %0, %19
  %.not51.not74 = icmp slt i32 %20, %1
  br i1 %.not51.not74, label %.lr.ph76, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph76
  %21 = srem i32 %0, %22
  %.not51.not = icmp slt i32 %21, %1
  br i1 %.not51.not, label %.lr.ph76, label %._crit_edge, !llvm.loop !9

.lr.ph76:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %.0445775 = phi i32 [ %22, %.lr.ph ], [ %19, %.lr.ph.preheader ]
  %22 = mul nsw i32 %.0445775, %19
  %.not50 = icmp sgt i32 %22, %0
  br i1 %.not50, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph76, %.lr.ph.preheader
  %.045.lcssa = phi i32 [ 1, %.lr.ph.preheader ], [ %.0445775, %.lr.ph76 ], [ %.0445775, %.lr.ph ]
  %23 = icmp sgt i32 %.045.lcssa, 1
  br i1 %23, label %24, label %._crit_edge.thread

24:                                               ; preds = %._crit_edge
  %25 = zext nneg i32 %.04260 to i64
  %26 = zext nneg i32 %.045.lcssa to i64
  %27 = mul nuw nsw i64 %26, %25
  %28 = urem i64 %27, 1000000007
  %29 = trunc nuw nsw i64 %28 to i32
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge, %24
  %.2 = phi i32 [ %29, %24 ], [ %.04260, %._crit_edge ], [ %.04260, %.preheader ]
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %31 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %31, label %.lr.ph62, label %.thread.loopexit

.thread.loopexit:                                 ; preds = %.lr.ph62, %._crit_edge.thread
  %.3.ph = phi i32 [ %.2, %._crit_edge.thread ], [ %.04260, %.lr.ph62 ]
  %32 = zext nneg i32 %.3.ph to i64
  br label %.thread

.thread:                                          ; preds = %.thread.loopexit, %2
  %.3 = phi i64 [ 1, %2 ], [ %32, %.thread.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  %33 = add i32 %0, 1
  %34 = sub i32 %33, %1
  store i32 %34, ptr %6, align 4, !tbaa !5
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %36 = load i32, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  %37 = sext i32 %0 to i64
  %38 = getelementptr inbounds [100001 x i32], ptr @ppro, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = add nsw i32 %36, -1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100001 x i32], ptr @ippro, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = mul nsw i64 %45, %40
  %47 = srem i64 %46, 1000000007
  %48 = mul nsw i64 %47, %.3
  %49 = srem i64 %48, 1000000007
  %50 = trunc nsw i64 %49 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #3
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %.not5266 = icmp slt i32 %51, 2
  br i1 %.not5266, label %._crit_edge71, label %.lr.ph70

._crit_edge71:                                    ; preds = %84, %.thread
  %.4.lcssa = phi i32 [ %50, %.thread ], [ %.5, %84 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret i32 %.4.lcssa

.lr.ph70:                                         ; preds = %.thread, %84
  %.069 = phi i32 [ %85, %84 ], [ 2, %.thread ]
  %.04068 = phi i32 [ %.141, %84 ], [ %36, %.thread ]
  %.467 = phi i32 [ %.5, %84 ], [ %50, %.thread ]
  %52 = sdiv i32 %41, %.069
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %7, align 4, !tbaa !5
  %54 = sdiv i32 %0, %.069
  store i32 %54, ptr %8, align 4, !tbaa !5
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %56 = load i32, ptr %55, align 4, !tbaa !5
  store i32 %56, ptr %7, align 4, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = icmp sle i32 %56, %57
  %.not53 = icmp slt i32 %56, %.04068
  %or.cond = select i1 %58, i1 %.not53, i1 false
  br i1 %or.cond, label %59, label %84

59:                                               ; preds = %.lr.ph70
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #3
  %60 = add nsw i32 %.04068, -1
  store i32 %60, ptr %9, align 4, !tbaa !5
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %62 = load i32, ptr %61, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #3
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = sext i32 %.467 to i64
  %65 = sext i32 %62 to i64
  %66 = getelementptr inbounds [100001 x i32], ptr @ppro, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = add nsw i32 %63, -1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100001 x i32], ptr @ippro, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = mul nsw i64 %73, %68
  %75 = srem i64 %74, 1000000007
  %76 = mul nsw i64 %75, %64
  %77 = srem i64 %76, 1000000007
  %78 = trunc nsw i64 %77 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #3
  %79 = add nsw i32 %.069, 1
  store i32 %79, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #3
  %80 = sdiv i32 %0, %62
  store i32 %80, ptr %11, align 4, !tbaa !5
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  br label %84

84:                                               ; preds = %.lr.ph70, %59
  %.5 = phi i32 [ %.467, %.lr.ph70 ], [ %78, %59 ]
  %.141 = phi i32 [ %.04068, %.lr.ph70 ], [ %63, %59 ]
  %.1 = phi i32 [ %.069, %.lr.ph70 ], [ %83, %59 ]
  %85 = add nsw i32 %.1, 1
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %.not52.not = icmp slt i32 %.1, %86
  br i1 %.not52.not, label %.lr.ph70, label %._crit_edge71, !llvm.loop !11
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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}


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