; LLVM IR from ShahjalalShohag/code-library :: Number Theory/Min_25 Sieve.ll (Z5solvexSt6vectorI6modintILi1000000007EESaIS1_EE)

; 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.modint = type { i32 }

@primes = external dso_local global [200009 x i32], align 16
@p = external dso_local global i32, align 4
@deg = external dso_local global i32, align 4
@pref = external dso_local global [3 x [200009 x %struct.modint]], align 16
@poly = external dso_local global [3 x %struct.modint], align 4
@r = external dso_local global i32, align 4
@id1 = external dso_local global [200009 x i32], align 16
@id2 = external dso_local global [200009 x i32], align 16
@n = external dso_local global i64, align 8
@tot = external dso_local global i32, align 4
@g = external dso_local global [3 x [200009 x %struct.modint]], align 16
@a = external dso_local global [200009 x i64], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5sievei(i32 noundef) #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 nounwind uwtable
declare dso_local void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #2 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6get_idx(i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Z2yoxi(i64 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @_Z5solvexSt6vectorI6modintILi1000000007EESaIS1_EE(i64 noundef %0, ptr noundef %1) #0 {
  %3 = alloca %struct.modint, align 4
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %struct.modint, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.modint, align 4
  %13 = alloca %struct.modint, align 4
  %14 = alloca %struct.modint, align 4
  %15 = alloca %struct.modint, align 4
  %16 = alloca %struct.modint, align 4
  %17 = alloca %struct.modint, align 4
  %18 = alloca %struct.modint, align 4
  %19 = alloca %struct.modint, align 4
  %20 = alloca %struct.modint, align 4
  %21 = alloca %struct.modint, align 4
  %22 = alloca %struct.modint, align 4
  %23 = alloca %struct.modint, align 4
  %24 = alloca %struct.modint, align 4
  %25 = alloca %struct.modint, align 4
  %26 = alloca %struct.modint, align 4
  %27 = alloca %struct.modint, align 4
  %28 = alloca %struct.modint, align 4
  %29 = alloca %struct.modint, align 4
  %30 = alloca %struct.modint, align 4
  %31 = alloca %struct.modint, align 4
  %32 = alloca %struct.modint, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca %struct.modint, align 4
  %38 = alloca i32, align 4
  %39 = alloca %struct.modint, align 4
  %40 = alloca %struct.modint, align 4
  %41 = alloca %struct.modint, align 4
  %42 = alloca %struct.modint, align 4
  %43 = alloca %struct.modint, align 4
  %44 = alloca %struct.modint, align 4
  store i64 %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %45 = load i64, ptr %4, align 8, !tbaa !5
  store i64 %45, ptr @n, align 8, !tbaa !5
  %46 = call noundef i64 @_ZNKSt6vectorI6modintILi1000000007EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %47 = trunc i64 %46 to i32
  store i32 %47, ptr @deg, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %48

48:                                               ; preds = %60, %2
  %49 = load i32, ptr %6, align 4, !tbaa !11
  %50 = load i32, ptr @deg, align 4, !tbaa !11
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %63

53:                                               ; preds = %48
  %54 = load i32, ptr %6, align 4, !tbaa !11
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %55) #6
  %57 = load i32, ptr %6, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [3 x %struct.modint], ptr @poly, i64 0, i64 %58
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %59, ptr align 4 %56, i64 4, i1 false), !tbaa.struct !13
  br label %60

60:                                               ; preds = %53
  %61 = load i32, ptr %6, align 4, !tbaa !11
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %6, align 4, !tbaa !11
  br label %48, !llvm.loop !14

63:                                               ; preds = %52
  %64 = load i64, ptr @n, align 8, !tbaa !5
  %65 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %64)
  %66 = fptosi double %65 to i32
  store i32 %66, ptr @r, align 4, !tbaa !11
  br label %67

67:                                               ; preds = %76, %63
  %68 = load i32, ptr @r, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = mul nsw i64 1, %69
  %71 = load i32, ptr @r, align 4, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = mul nsw i64 %70, %72
  %74 = load i64, ptr @n, align 8, !tbaa !5
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %76, label %79

76:                                               ; preds = %67
  %77 = load i32, ptr @r, align 4, !tbaa !11
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @r, align 4, !tbaa !11
  br label %67, !llvm.loop !16

79:                                               ; preds = %67
  br label %80

80:                                               ; preds = %89, %79
  %81 = load i32, ptr @r, align 4, !tbaa !11
  %82 = sext i32 %81 to i64
  %83 = mul nsw i64 1, %82
  %84 = load i32, ptr @r, align 4, !tbaa !11
  %85 = sext i32 %84 to i64
  %86 = mul nsw i64 %83, %85
  %87 = load i64, ptr @n, align 8, !tbaa !5
  %88 = icmp sgt i64 %86, %87
  br i1 %88, label %89, label %92

89:                                               ; preds = %80
  %90 = load i32, ptr @r, align 4, !tbaa !11
  %91 = add nsw i32 %90, -1
  store i32 %91, ptr @r, align 4, !tbaa !11
  br label %80, !llvm.loop !17

92:                                               ; preds = %80
  %93 = load i32, ptr @r, align 4, !tbaa !11
  call void @_Z5sievei(i32 noundef %93)
  store i32 0, ptr @tot, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 1, ptr %7, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %215, %92
  %95 = load i64, ptr %7, align 8, !tbaa !5
  %96 = load i64, ptr @n, align 8, !tbaa !5
  %97 = icmp sle i64 %95, %96
  br i1 %97, label %98, label %218

98:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %99 = load i64, ptr @n, align 8, !tbaa !5
  %100 = load i64, ptr %7, align 8, !tbaa !5
  %101 = sdiv i64 %99, %100
  store i64 %101, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %102 = load i64, ptr @n, align 8, !tbaa !5
  %103 = load i64, ptr %8, align 8, !tbaa !5
  %104 = sdiv i64 %102, %103
  store i64 %104, ptr %9, align 8, !tbaa !5
  %105 = load i64, ptr %8, align 8, !tbaa !5
  %106 = load i32, ptr @tot, align 4, !tbaa !11
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr @tot, align 4, !tbaa !11
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [200009 x i64], ptr @a, i64 0, i64 %108
  store i64 %105, ptr %109, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %110 = load i64, ptr %8, align 8, !tbaa !5
  %111 = srem i64 %110, 1000000007
  %112 = trunc i64 %111 to i32
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 noundef %112)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %113

113:                                              ; preds = %197, %98
  %114 = load i32, ptr %11, align 4, !tbaa !11
  %115 = load i32, ptr @deg, align 4, !tbaa !11
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %200

118:                                              ; preds = %113
  %119 = load i32, ptr %11, align 4, !tbaa !11
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %121, label %132

121:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %13, i32 noundef 1)
  %122 = getelementptr inbounds %struct.modint, ptr %13, i32 0, i32 0
  %123 = load i32, ptr %122, align 4
  %124 = call i32 @_ZNK6modintILi1000000007EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %123)
  %125 = getelementptr inbounds %struct.modint, ptr %12, i32 0, i32 0
  store i32 %124, ptr %125, align 4
  %126 = load i32, ptr %11, align 4, !tbaa !11
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %127
  %129 = load i32, ptr @tot, align 4, !tbaa !11
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [200009 x %struct.modint], ptr %128, i64 0, i64 %130
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %131, ptr align 4 %12, i64 4, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %132

132:                                              ; preds = %121, %118
  %133 = load i32, ptr %11, align 4, !tbaa !11
  %134 = icmp eq i32 %133, 1
  br i1 %134, label %135, label %158

135:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 noundef 1)
  %136 = getelementptr inbounds %struct.modint, ptr %18, i32 0, i32 0
  %137 = load i32, ptr %136, align 4
  %138 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %137)
  %139 = getelementptr inbounds %struct.modint, ptr %17, i32 0, i32 0
  store i32 %138, ptr %139, align 4
  %140 = getelementptr inbounds %struct.modint, ptr %17, i32 0, i32 0
  %141 = load i32, ptr %140, align 4
  %142 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %141)
  %143 = getelementptr inbounds %struct.modint, ptr %16, i32 0, i32 0
  store i32 %142, ptr %143, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %19, i32 noundef 2)
  %144 = getelementptr inbounds %struct.modint, ptr %19, i32 0, i32 0
  %145 = load i32, ptr %144, align 4
  %146 = call i32 @_ZNK6modintILi1000000007EEdvES0_(ptr noundef nonnull align 4 dereferenceable(4) %16, i32 %145)
  %147 = getelementptr inbounds %struct.modint, ptr %15, i32 0, i32 0
  store i32 %146, ptr %147, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %20, i32 noundef 1)
  %148 = getelementptr inbounds %struct.modint, ptr %20, i32 0, i32 0
  %149 = load i32, ptr %148, align 4
  %150 = call i32 @_ZNK6modintILi1000000007EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %15, i32 %149)
  %151 = getelementptr inbounds %struct.modint, ptr %14, i32 0, i32 0
  store i32 %150, ptr %151, align 4
  %152 = load i32, ptr %11, align 4, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %153
  %155 = load i32, ptr @tot, align 4, !tbaa !11
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [200009 x %struct.modint], ptr %154, i64 0, i64 %156
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %157, ptr align 4 %14, i64 4, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %158

158:                                              ; preds = %135, %132
  %159 = load i32, ptr %11, align 4, !tbaa !11
  %160 = icmp eq i32 %159, 2
  br i1 %160, label %161, label %196

161:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %26, i32 noundef 1)
  %162 = getelementptr inbounds %struct.modint, ptr %26, i32 0, i32 0
  %163 = load i32, ptr %162, align 4
  %164 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %163)
  %165 = getelementptr inbounds %struct.modint, ptr %25, i32 0, i32 0
  store i32 %164, ptr %165, align 4
  %166 = getelementptr inbounds %struct.modint, ptr %25, i32 0, i32 0
  %167 = load i32, ptr %166, align 4
  %168 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %167)
  %169 = getelementptr inbounds %struct.modint, ptr %24, i32 0, i32 0
  store i32 %168, ptr %169, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %10, i64 4, i1 false), !tbaa.struct !13
  %170 = getelementptr inbounds %struct.modint, ptr %29, i32 0, i32 0
  %171 = load i32, ptr %170, align 4
  %172 = call i32 @_ZmlILi1000000007EE6modintIXT_EEiS1_(i32 noundef 2, i32 %171)
  %173 = getelementptr inbounds %struct.modint, ptr %28, i32 0, i32 0
  store i32 %172, ptr %173, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef 1)
  %174 = getelementptr inbounds %struct.modint, ptr %30, i32 0, i32 0
  %175 = load i32, ptr %174, align 4
  %176 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %28, i32 %175)
  %177 = getelementptr inbounds %struct.modint, ptr %27, i32 0, i32 0
  store i32 %176, ptr %177, align 4
  %178 = getelementptr inbounds %struct.modint, ptr %27, i32 0, i32 0
  %179 = load i32, ptr %178, align 4
  %180 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %24, i32 %179)
  %181 = getelementptr inbounds %struct.modint, ptr %23, i32 0, i32 0
  store i32 %180, ptr %181, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %31, i32 noundef 6)
  %182 = getelementptr inbounds %struct.modint, ptr %31, i32 0, i32 0
  %183 = load i32, ptr %182, align 4
  %184 = call i32 @_ZNK6modintILi1000000007EEdvES0_(ptr noundef nonnull align 4 dereferenceable(4) %23, i32 %183)
  %185 = getelementptr inbounds %struct.modint, ptr %22, i32 0, i32 0
  store i32 %184, ptr %185, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %32, i32 noundef 1)
  %186 = getelementptr inbounds %struct.modint, ptr %32, i32 0, i32 0
  %187 = load i32, ptr %186, align 4
  %188 = call i32 @_ZNK6modintILi1000000007EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %22, i32 %187)
  %189 = getelementptr inbounds %struct.modint, ptr %21, i32 0, i32 0
  store i32 %188, ptr %189, align 4
  %190 = load i32, ptr %11, align 4, !tbaa !11
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %191
  %193 = load i32, ptr @tot, align 4, !tbaa !11
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [200009 x %struct.modint], ptr %192, i64 0, i64 %194
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %195, ptr align 4 %21, i64 4, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %196

196:                                              ; preds = %161, %158
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %11, align 4, !tbaa !11
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %11, align 4, !tbaa !11
  br label %113, !llvm.loop !18

200:                                              ; preds = %117
  %201 = load i64, ptr %8, align 8, !tbaa !5
  %202 = load i32, ptr @r, align 4, !tbaa !11
  %203 = sext i32 %202 to i64
  %204 = icmp sle i64 %201, %203
  br i1 %204, label %205, label %209

205:                                              ; preds = %200
  %206 = load i32, ptr @tot, align 4, !tbaa !11
  %207 = load i64, ptr %8, align 8, !tbaa !5
  %208 = getelementptr inbounds [200009 x i32], ptr @id1, i64 0, i64 %207
  store i32 %206, ptr %208, align 4, !tbaa !11
  br label %215

209:                                              ; preds = %200
  %210 = load i32, ptr @tot, align 4, !tbaa !11
  %211 = load i64, ptr @n, align 8, !tbaa !5
  %212 = load i64, ptr %8, align 8, !tbaa !5
  %213 = sdiv i64 %211, %212
  %214 = getelementptr inbounds [200009 x i32], ptr @id2, i64 0, i64 %213
  store i32 %210, ptr %214, align 4, !tbaa !11
  br label %215

215:                                              ; preds = %209, %205
  %216 = load i64, ptr %9, align 8, !tbaa !5
  %217 = add nsw i64 %216, 1
  store i64 %217, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %94, !llvm.loop !19

218:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  store i32 1, ptr %33, align 4, !tbaa !11
  br label %219

219:                                              ; preds = %312, %218
  %220 = load i32, ptr %33, align 4, !tbaa !11
  %221 = load i32, ptr @p, align 4, !tbaa !11
  %222 = icmp sle i32 %220, %221
  br i1 %222, label %224, label %223

223:                                              ; preds = %219
  store i32 14, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  br label %315

224:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #6
  store i32 1, ptr %35, align 4, !tbaa !11
  br label %225

225:                                              ; preds = %308, %224
  %226 = load i32, ptr %35, align 4, !tbaa !11
  %227 = load i32, ptr @tot, align 4, !tbaa !11
  %228 = icmp sle i32 %226, %227
  br i1 %228, label %229, label %246

229:                                              ; preds = %225
  %230 = load i32, ptr %33, align 4, !tbaa !11
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !11
  %234 = sext i32 %233 to i64
  %235 = load i32, ptr %35, align 4, !tbaa !11
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [200009 x i64], ptr @a, i64 0, i64 %236
  %238 = load i64, ptr %237, align 8, !tbaa !5
  %239 = load i32, ptr %33, align 4, !tbaa !11
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !11
  %243 = sext i32 %242 to i64
  %244 = sdiv i64 %238, %243
  %245 = icmp sle i64 %234, %244
  br label %246

246:                                              ; preds = %229, %225
  %247 = phi i1 [ false, %225 ], [ %245, %229 ]
  br i1 %247, label %249, label %248

248:                                              ; preds = %246
  store i32 17, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #6
  br label %311

249:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  %250 = load i32, ptr %35, align 4, !tbaa !11
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [200009 x i64], ptr @a, i64 0, i64 %251
  %253 = load i64, ptr %252, align 8, !tbaa !5
  %254 = load i32, ptr %33, align 4, !tbaa !11
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !11
  %258 = sext i32 %257 to i64
  %259 = sdiv i64 %253, %258
  %260 = call noundef i32 @_Z6get_idx(i64 noundef %259)
  store i32 %260, ptr %36, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #6
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %37, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #6
  store i32 0, ptr %38, align 4, !tbaa !11
  br label %261

261:                                              ; preds = %304, %249
  %262 = load i32, ptr %38, align 4, !tbaa !11
  %263 = load i32, ptr @deg, align 4, !tbaa !11
  %264 = icmp slt i32 %262, %263
  br i1 %264, label %266, label %265

265:                                              ; preds = %261
  store i32 20, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #6
  br label %307

266:                                              ; preds = %261
  %267 = load i32, ptr %38, align 4, !tbaa !11
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %268
  %270 = load i32, ptr %36, align 4, !tbaa !11
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [200009 x %struct.modint], ptr %269, i64 0, i64 %271
  %273 = load i32, ptr %38, align 4, !tbaa !11
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @pref, i64 0, i64 %274
  %276 = load i32, ptr %33, align 4, !tbaa !11
  %277 = sub nsw i32 %276, 1
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [200009 x %struct.modint], ptr %275, i64 0, i64 %278
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 4 %279, i64 4, i1 false), !tbaa.struct !13
  %280 = getelementptr inbounds %struct.modint, ptr %41, i32 0, i32 0
  %281 = load i32, ptr %280, align 4
  %282 = call i32 @_ZNK6modintILi1000000007EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %272, i32 %281)
  %283 = getelementptr inbounds %struct.modint, ptr %40, i32 0, i32 0
  store i32 %282, ptr %283, align 4
  %284 = getelementptr inbounds %struct.modint, ptr %40, i32 0, i32 0
  %285 = load i32, ptr %284, align 4
  %286 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %37, i32 %285)
  %287 = getelementptr inbounds %struct.modint, ptr %39, i32 0, i32 0
  store i32 %286, ptr %287, align 4
  %288 = load i32, ptr %38, align 4, !tbaa !11
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %289
  %291 = load i32, ptr %35, align 4, !tbaa !11
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [200009 x %struct.modint], ptr %290, i64 0, i64 %292
  %294 = getelementptr inbounds %struct.modint, ptr %39, i32 0, i32 0
  %295 = load i32, ptr %294, align 4
  %296 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmIES0_(ptr noundef nonnull align 4 dereferenceable(4) %293, i32 %295)
  %297 = load i32, ptr %33, align 4, !tbaa !11
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %298
  %300 = load i32, ptr %299, align 4, !tbaa !11
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %42, i32 noundef %300)
  %301 = getelementptr inbounds %struct.modint, ptr %42, i32 0, i32 0
  %302 = load i32, ptr %301, align 4
  %303 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmLES0_(ptr noundef nonnull align 4 dereferenceable(4) %37, i32 %302)
  br label %304

304:                                              ; preds = %266
  %305 = load i32, ptr %38, align 4, !tbaa !11
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %38, align 4, !tbaa !11
  br label %261, !llvm.loop !20

307:                                              ; preds = %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  br label %308

308:                                              ; preds = %307
  %309 = load i32, ptr %35, align 4, !tbaa !11
  %310 = add nsw i32 %309, 1
  store i32 %310, ptr %35, align 4, !tbaa !11
  br label %225, !llvm.loop !21

311:                                              ; preds = %248
  br label %312

312:                                              ; preds = %311
  %313 = load i32, ptr %33, align 4, !tbaa !11
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %33, align 4, !tbaa !11
  br label %219, !llvm.loop !22

315:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #6
  %316 = load i64, ptr @n, align 8, !tbaa !5
  %317 = call i32 @_Z2yoxi(i64 noundef %316, i32 noundef 0)
  %318 = getelementptr inbounds %struct.modint, ptr %43, i32 0, i32 0
  store i32 %317, ptr %318, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %44, i32 noundef 1)
  %319 = getelementptr inbounds %struct.modint, ptr %44, i32 0, i32 0
  %320 = load i32, ptr %319, align 4
  %321 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %43, i32 %320)
  %322 = getelementptr inbounds %struct.modint, ptr %3, i32 0, i32 0
  store i32 %321, ptr %322, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #6
  store i32 1, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %323 = getelementptr inbounds %struct.modint, ptr %3, i32 0, i32 0
  %324 = load i32, ptr %323, align 4
  ret i32 %324
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZmlILi1000000007EE6modintIXT_EEiS1_(i32 noundef, i32) #0

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 long", !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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 4, !11}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}


; 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.modint = type { i32 }

@primes = external dso_local local_unnamed_addr global [200009 x i32], align 16
@p = external dso_local local_unnamed_addr global i32, align 4
@deg = external dso_local local_unnamed_addr global i32, align 4
@pref = external dso_local local_unnamed_addr global [3 x [200009 x %struct.modint]], align 16
@poly = external dso_local local_unnamed_addr global [3 x %struct.modint], align 4
@r = external dso_local local_unnamed_addr global i32, align 4
@id1 = external dso_local local_unnamed_addr global [200009 x i32], align 16
@id2 = external dso_local local_unnamed_addr global [200009 x i32], align 16
@n = external dso_local local_unnamed_addr global i64, align 8
@tot = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local global [3 x [200009 x %struct.modint]], align 16
@a = external dso_local local_unnamed_addr global [200009 x i64], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5sievei(i32 noundef) 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 nounwind uwtable
declare dso_local void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6get_idx(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_Z2yoxi(i64 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @_Z5solvexSt6vectorI6modintILi1000000007EESaIS1_EE(i64 noundef %0, ptr noundef nonnull %1) local_unnamed_addr #0 {
  %3 = alloca %struct.modint, align 4
  %4 = alloca %struct.modint, align 4
  %5 = alloca %struct.modint, align 4
  %6 = alloca %struct.modint, align 4
  %7 = alloca %struct.modint, align 4
  %8 = alloca %struct.modint, align 4
  %9 = alloca %struct.modint, align 4
  %10 = alloca %struct.modint, align 4
  %11 = alloca %struct.modint, align 4
  %12 = alloca %struct.modint, align 4
  %13 = alloca %struct.modint, align 4
  %14 = alloca %struct.modint, align 4
  %15 = alloca %struct.modint, align 4
  %16 = alloca %struct.modint, align 4
  %17 = alloca %struct.modint, align 4
  %18 = alloca %struct.modint, align 4
  %19 = alloca %struct.modint, align 4
  %20 = alloca %struct.modint, align 4
  %21 = alloca %struct.modint, align 4
  store i64 %0, ptr @n, align 8, !tbaa !5
  %22 = tail call noundef i64 @_ZNKSt6vectorI6modintILi1000000007EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr @deg, align 4, !tbaa !9
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %2
  %25 = load i64, ptr @n, align 8, !tbaa !5
  %26 = tail call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %25)
  %27 = fptosi double %26 to i32
  %28 = load i64, ptr @n, align 8, !tbaa !5
  %29 = sext i32 %27 to i64
  br label %36

.lr.ph:                                           ; preds = %2, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %2 ]
  %30 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #5
  %31 = getelementptr inbounds [3 x %struct.modint], ptr @poly, i64 0, i64 %indvars.iv
  %32 = load i32, ptr %30, align 4, !tbaa !9
  store i32 %32, ptr %31, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr @deg, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !11

36:                                               ; preds = %36, %._crit_edge
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %36 ], [ %29, %._crit_edge ]
  %37 = mul nsw i64 %indvars.iv91, %indvars.iv91
  %38 = icmp slt i64 %37, %28
  %indvars.iv.next92 = add nsw i64 %indvars.iv91, 1
  br i1 %38, label %36, label %.preheader63, !llvm.loop !13

.preheader63:                                     ; preds = %36
  %39 = trunc nsw i64 %indvars.iv91 to i32
  store i32 %39, ptr @r, align 4, !tbaa !9
  %sext = shl i64 %indvars.iv91, 32
  %40 = ashr exact i64 %sext, 32
  %41 = mul nsw i64 %40, %40
  %42 = icmp sgt i64 %41, %28
  br i1 %42, label %.lr.ph66, label %46

.lr.ph66:                                         ; preds = %.preheader63, %.lr.ph66
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph66 ], [ %indvars.iv91, %.preheader63 ]
  %indvars.iv.next95 = add nsw i64 %indvars.iv94, -1
  %43 = mul nsw i64 %indvars.iv.next95, %indvars.iv.next95
  %44 = icmp sgt i64 %43, %28
  br i1 %44, label %.lr.ph66, label %._crit_edge67, !llvm.loop !14

._crit_edge67:                                    ; preds = %.lr.ph66
  %45 = trunc nsw i64 %indvars.iv.next95 to i32
  store i32 %45, ptr @r, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %._crit_edge67, %.preheader63
  %.lcssa = phi i32 [ %45, %._crit_edge67 ], [ %39, %.preheader63 ]
  tail call void @_Z5sievei(i32 noundef %.lcssa)
  store i32 0, ptr @tot, align 4, !tbaa !9
  %47 = load i64, ptr @n, align 8, !tbaa !5
  %.not73 = icmp slt i64 %47, 1
  br i1 %.not73, label %._crit_edge87, label %.lr.ph76

.preheader62:                                     ; preds = %106
  %48 = load i32, ptr @p, align 4, !tbaa !9
  %.not5885 = icmp slt i32 %48, 1
  %49 = icmp slt i32 %63, 1
  %or.cond = select i1 %.not5885, i1 true, i1 %49
  br i1 %or.cond, label %._crit_edge87, label %.preheader

.lr.ph76:                                         ; preds = %46, %106
  %50 = phi i32 [ %63, %106 ], [ 0, %46 ]
  %51 = phi i64 [ %107, %106 ], [ %47, %46 ]
  %.05074 = phi i64 [ %108, %106 ], [ 1, %46 ]
  %52 = udiv i64 %51, %.05074
  %53 = sdiv i64 %51, %52
  %54 = add nsw i32 %50, 1
  store i32 %54, ptr @tot, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [200009 x i64], ptr @a, i64 0, i64 %55
  store i64 %52, ptr %56, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %57 = srem i64 %52, 1000000007
  %58 = trunc nuw nsw i64 %57 to i32
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %58)
  %59 = load i32, ptr @deg, align 4, !tbaa !9
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.lr.ph71, label %._crit_edge72

._crit_edge72:                                    ; preds = %96, %.lr.ph76
  %61 = load i32, ptr @r, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %.not61 = icmp sgt i64 %52, %62
  %63 = load i32, ptr @tot, align 4, !tbaa !9
  br i1 %.not61, label %102, label %100

.lr.ph71:                                         ; preds = %.lr.ph76, %96
  %.05169 = phi i32 [ %97, %96 ], [ 0, %.lr.ph76 ]
  switch i32 %.05169, label %96 [
    i32 0, label %64
    i32 1, label %70
    i32 2, label %81
  ]

64:                                               ; preds = %.lr.ph71
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef 1)
  %65 = load i32, ptr %4, align 4
  %66 = call i32 @_ZNK6modintILi1000000007EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %65)
  %67 = load i32, ptr @tot, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200009 x %struct.modint], ptr @g, i64 0, i64 %68
  store i32 %66, ptr %69, align 4, !tbaa !9
  br label %96

70:                                               ; preds = %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef 1)
  %71 = load i32, ptr %7, align 4
  %72 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %71)
  %73 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %72)
  store i32 %73, ptr %6, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 2)
  %74 = load i32, ptr %8, align 4
  %75 = call i32 @_ZNK6modintILi1000000007EEdvES0_(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 %74)
  store i32 %75, ptr %5, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %9, i32 noundef 1)
  %76 = load i32, ptr %9, align 4
  %77 = call i32 @_ZNK6modintILi1000000007EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 %76)
  %78 = load i32, ptr @tot, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [200009 x %struct.modint], ptr getelementptr inbounds (i8, ptr @g, i64 800036), i64 0, i64 %79
  store i32 %77, ptr %80, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %96

81:                                               ; preds = %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %13, i32 noundef 1)
  %82 = load i32, ptr %13, align 4
  %83 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %82)
  %84 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %83)
  store i32 %84, ptr %12, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #5
  %.sroa.020.0.copyload = load i32, ptr %3, align 4, !tbaa !9
  %85 = call i32 @_ZmlILi1000000007EE6modintIXT_EEiS1_(i32 noundef 2, i32 %.sroa.020.0.copyload)
  store i32 %85, ptr %14, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %15, i32 noundef 1)
  %86 = load i32, ptr %15, align 4
  %87 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %14, i32 %86)
  %88 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 %87)
  store i32 %88, ptr %11, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %16, i32 noundef 6)
  %89 = load i32, ptr %16, align 4
  %90 = call i32 @_ZNK6modintILi1000000007EEdvES0_(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 %89)
  store i32 %90, ptr %10, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %17, i32 noundef 1)
  %91 = load i32, ptr %17, align 4
  %92 = call i32 @_ZNK6modintILi1000000007EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %91)
  %93 = load i32, ptr @tot, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200009 x %struct.modint], ptr getelementptr inbounds (i8, ptr @g, i64 1600072), i64 0, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  br label %96

96:                                               ; preds = %70, %64, %.lr.ph71, %81
  %97 = add nuw nsw i32 %.05169, 1
  %98 = load i32, ptr @deg, align 4, !tbaa !9
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %.lr.ph71, label %._crit_edge72, !llvm.loop !15

100:                                              ; preds = %._crit_edge72
  %101 = getelementptr inbounds [200009 x i32], ptr @id1, i64 0, i64 %52
  store i32 %63, ptr %101, align 4, !tbaa !9
  %.pre = load i64, ptr @n, align 8, !tbaa !5
  br label %106

102:                                              ; preds = %._crit_edge72
  %103 = load i64, ptr @n, align 8, !tbaa !5
  %104 = sdiv i64 %103, %52
  %105 = getelementptr inbounds [200009 x i32], ptr @id2, i64 0, i64 %104
  store i32 %63, ptr %105, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %102, %100
  %107 = phi i64 [ %103, %102 ], [ %.pre, %100 ]
  %108 = add nuw nsw i64 %53, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %.not.not = icmp slt i64 %53, %107
  br i1 %.not.not, label %.lr.ph76, label %.preheader62, !llvm.loop !16

.preheader:                                       ; preds = %.preheader62, %.critedge
  %109 = phi i32 [ %128, %.critedge ], [ %48, %.preheader62 ]
  %110 = phi i32 [ %129, %.critedge ], [ %63, %.preheader62 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.critedge ], [ 1, %.preheader62 ]
  %111 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %indvars.iv103
  %.not5981 = icmp slt i32 %110, 1
  br i1 %.not5981, label %.critedge, label %.lr.ph83

.lr.ph83:                                         ; preds = %.preheader
  %112 = add nsw i64 %indvars.iv103, -1
  %113 = load i32, ptr %111, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = load i64, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !5
  %116 = sdiv i64 %115, %114
  %.not60113 = icmp slt i64 %116, %114
  br i1 %.not60113, label %.critedge.loopexit, label %.lr.ph115

._crit_edge87.loopexit88:                         ; preds = %.critedge
  %.pre107 = load i64, ptr @n, align 8, !tbaa !5
  br label %._crit_edge87

._crit_edge87:                                    ; preds = %46, %._crit_edge87.loopexit88, %.preheader62
  %117 = phi i64 [ %.pre107, %._crit_edge87.loopexit88 ], [ %107, %.preheader62 ], [ %47, %46 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #5
  %118 = call i32 @_Z2yoxi(i64 noundef %117, i32 noundef 0)
  store i32 %118, ptr %20, align 4
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %21, i32 noundef 1)
  %119 = load i32, ptr %21, align 4
  %120 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %20, i32 %119)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #5
  ret i32 %120

121:                                              ; preds = %._crit_edge80
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100114, 1
  %122 = load i32, ptr %111, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [200009 x i64], ptr @a, i64 0, i64 %indvars.iv.next101
  %125 = load i64, ptr %124, align 8, !tbaa !5
  %126 = sdiv i64 %125, %123
  %.not60 = icmp slt i64 %126, %123
  br i1 %.not60, label %.critedge.loopexit, label %.lr.ph115, !llvm.loop !17

.critedge.loopexit:                               ; preds = %121, %._crit_edge80, %.lr.ph83
  %127 = phi i32 [ %110, %.lr.ph83 ], [ %136, %._crit_edge80 ], [ %136, %121 ]
  %.pre106 = load i32, ptr @p, align 4, !tbaa !9
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %128 = phi i32 [ %.pre106, %.critedge.loopexit ], [ %109, %.preheader ]
  %129 = phi i32 [ %127, %.critedge.loopexit ], [ %110, %.preheader ]
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %130 = sext i32 %128 to i64
  %.not58.not = icmp slt i64 %indvars.iv103, %130
  br i1 %.not58.not, label %.preheader, label %._crit_edge87.loopexit88, !llvm.loop !18

.lr.ph115:                                        ; preds = %.lr.ph83, %121
  %131 = phi i64 [ %126, %121 ], [ %116, %.lr.ph83 ]
  %indvars.iv100114 = phi i64 [ %indvars.iv.next101, %121 ], [ 1, %.lr.ph83 ]
  %132 = call noundef i32 @_Z6get_idx(i64 noundef %131)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #5
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 noundef 1)
  %133 = load i32, ptr @deg, align 4, !tbaa !9
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %.lr.ph79, label %._crit_edge80

.lr.ph79:                                         ; preds = %.lr.ph115
  %135 = sext i32 %132 to i64
  br label %138

._crit_edge80:                                    ; preds = %138, %.lr.ph115
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #5
  %136 = load i32, ptr @tot, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %.not59.not = icmp slt i64 %indvars.iv100114, %137
  br i1 %.not59.not, label %121, label %.critedge.loopexit, !llvm.loop !17

138:                                              ; preds = %.lr.ph79, %138
  %indvars.iv97 = phi i64 [ 0, %.lr.ph79 ], [ %indvars.iv.next98, %138 ]
  %139 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %indvars.iv97, i64 %135
  %140 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @pref, i64 0, i64 %indvars.iv97, i64 %112
  %.sroa.0.0.copyload = load i32, ptr %140, align 4, !tbaa !9
  %141 = call i32 @_ZNK6modintILi1000000007EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %139, i32 %.sroa.0.0.copyload)
  %142 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 %141)
  %143 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %indvars.iv97, i64 %indvars.iv100114
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmIES0_(ptr noundef nonnull align 4 dereferenceable(4) %143, i32 %142)
  %145 = load i32, ptr %111, align 4, !tbaa !9
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %19, i32 noundef %145)
  %146 = load i32, ptr %19, align 4
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmLES0_(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 %146)
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %148 = load i32, ptr @deg, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = icmp slt i64 %indvars.iv.next98, %149
  br i1 %150, label %138, label %._crit_edge80, !llvm.loop !20
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZmlILi1000000007EE6modintIXT_EEiS1_(i32 noundef, i32) local_unnamed_addr #0

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { inlinehint 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 = { 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 #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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !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}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = distinct !{!20, !12}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass