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

; 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
@g = external dso_local global [3 x [200009 x %struct.modint]], align 16

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4), i32) #2 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) #3

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @_Z2yoxi(i64 noundef %0, i32 noundef %1) #4 {
  %3 = alloca %struct.modint, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.modint, align 4
  %9 = alloca %struct.modint, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.modint, align 4
  %12 = alloca %struct.modint, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i32, 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 %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = load i64, ptr %4, align 8, !tbaa !5
  %28 = icmp sge i64 %26, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %2
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 0)
  br label %175

30:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %31 = load i64, ptr %4, align 8, !tbaa !5
  %32 = call noundef i32 @_Z6get_idx(i64 noundef %31)
  store i32 %32, ptr %6, align 4, !tbaa !9
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %55, %30
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = load i32, ptr @deg, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %58

38:                                               ; preds = %33
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [3 x %struct.modint], ptr @poly, i64 0, i64 %40
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %43
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [200009 x %struct.modint], ptr %44, i64 0, i64 %46
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %47, i64 4, i1 false), !tbaa.struct !11
  %48 = getelementptr inbounds %struct.modint, ptr %9, i32 0, i32 0
  %49 = load i32, ptr %48, align 4
  %50 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %41, i32 %49)
  %51 = getelementptr inbounds %struct.modint, ptr %8, i32 0, i32 0
  store i32 %50, ptr %51, align 4
  %52 = getelementptr inbounds %struct.modint, ptr %8, i32 0, i32 0
  %53 = load i32, ptr %52, align 4
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %53)
  br label %55

55:                                               ; preds = %38
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %7, align 4, !tbaa !9
  br label %33, !llvm.loop !12

58:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %81, %58
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = load i32, ptr @deg, align 4, !tbaa !9
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %59
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [3 x %struct.modint], ptr @poly, i64 0, i64 %66
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @pref, i64 0, i64 %69
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200009 x %struct.modint], ptr %70, i64 0, i64 %72
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %73, i64 4, i1 false), !tbaa.struct !11
  %74 = getelementptr inbounds %struct.modint, ptr %12, i32 0, i32 0
  %75 = load i32, ptr %74, align 4
  %76 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %67, i32 %75)
  %77 = getelementptr inbounds %struct.modint, ptr %11, i32 0, i32 0
  store i32 %76, ptr %77, align 4
  %78 = getelementptr inbounds %struct.modint, ptr %11, i32 0, i32 0
  %79 = load i32, ptr %78, align 4
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmIES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %79)
  br label %81

81:                                               ; preds = %64
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %10, align 4, !tbaa !9
  br label %59, !llvm.loop !14

84:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %85 = load i32, ptr %5, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %13, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %171, %84
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = load i32, ptr @p, align 4, !tbaa !9
  %90 = icmp sle i32 %88, %89
  br i1 %90, label %91, label %105

91:                                               ; preds = %87
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = load i64, ptr %4, align 8, !tbaa !5
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = sdiv i64 %97, %102
  %104 = icmp sle i64 %96, %103
  br label %105

105:                                              ; preds = %91, %87
  %106 = phi i1 [ false, %87 ], [ %104, %91 ]
  br i1 %106, label %108, label %107

107:                                              ; preds = %105
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %174

108:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  store i64 %113, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %166, %108
  %115 = load i64, ptr %15, align 8, !tbaa !5
  %116 = load i64, ptr %4, align 8, !tbaa !5
  %117 = icmp sle i64 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 11, ptr %14, align 4
  br label %169

119:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %120 = load i32, ptr %13, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !9
  %124 = load i32, ptr %16, align 4, !tbaa !9
  %125 = load i64, ptr %15, align 8, !tbaa !5
  %126 = call i32 @_Z4evaliix(i32 noundef %123, i32 noundef %124, i64 noundef %125)
  %127 = getelementptr inbounds %struct.modint, ptr %18, i32 0, i32 0
  store i32 %126, ptr %127, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %128 = load i64, ptr %4, align 8, !tbaa !5
  %129 = load i64, ptr %15, align 8, !tbaa !5
  %130 = sdiv i64 %128, %129
  %131 = load i32, ptr %13, align 4, !tbaa !9
  %132 = call i32 @_Z2yoxi(i64 noundef %130, i32 noundef %131)
  %133 = getelementptr inbounds %struct.modint, ptr %20, i32 0, i32 0
  store i32 %132, ptr %133, align 4
  %134 = load i32, ptr %16, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 1
  %136 = zext i1 %135 to i32
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %21, i32 noundef %136)
  %137 = getelementptr inbounds %struct.modint, ptr %21, i32 0, i32 0
  %138 = load i32, ptr %137, align 4
  %139 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %20, i32 %138)
  %140 = getelementptr inbounds %struct.modint, ptr %19, i32 0, i32 0
  store i32 %139, ptr %140, align 4
  %141 = getelementptr inbounds %struct.modint, ptr %19, i32 0, i32 0
  %142 = load i32, ptr %141, align 4
  %143 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 %142)
  %144 = getelementptr inbounds %struct.modint, ptr %17, i32 0, i32 0
  store i32 %143, ptr %144, align 4
  %145 = getelementptr inbounds %struct.modint, ptr %17, i32 0, i32 0
  %146 = load i32, ptr %145, align 4
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %146)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %148 = load i64, ptr %15, align 8, !tbaa !5
  %149 = load i64, ptr %4, align 8, !tbaa !5
  %150 = load i32, ptr %13, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = sdiv i64 %149, %154
  %156 = icmp sle i64 %148, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %119
  store i32 11, ptr %14, align 4
  br label %169

158:                                              ; preds = %119
  %159 = load i32, ptr %13, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = load i64, ptr %15, align 8, !tbaa !5
  %165 = mul nsw i64 %164, %163
  store i64 %165, ptr %15, align 8, !tbaa !5
  br label %166

166:                                              ; preds = %158
  %167 = load i32, ptr %16, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %16, align 4, !tbaa !9
  br label %114, !llvm.loop !15

169:                                              ; preds = %157, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %170

170:                                              ; preds = %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %13, align 4, !tbaa !9
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %13, align 4, !tbaa !9
  br label %87, !llvm.loop !16

174:                                              ; preds = %107
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %175

175:                                              ; preds = %174, %29
  %176 = getelementptr inbounds %struct.modint, ptr %3, i32 0, i32 0
  %177 = load i32, ptr %176, align 4
  ret i32 %177
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4), i32) #5 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: inlinehint mustprogress uwtable
declare dso_local i32 @_Z4evaliix(i32 noundef, i32 noundef, i64 noundef) #2

attributes #0 = { 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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 4, !9}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


; 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 global [3 x %struct.modint], align 4
@g = external dso_local local_unnamed_addr global [3 x [200009 x %struct.modint]], align 16

; 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
declare dso_local void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @_Z2yoxi(i64 noundef %0, i32 noundef %1) local_unnamed_addr #3 {
  %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 = sext i32 %1 to i64
  %8 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %.not = icmp slt i64 %10, %0
  br i1 %.not, label %12, label %11

11:                                               ; preds = %2
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 0)
  br label %.critedge

12:                                               ; preds = %2
  %13 = tail call noundef i32 @_Z6get_idx(i64 noundef %0)
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 0)
  %14 = load i32, ptr @deg, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %.preheader50

.lr.ph:                                           ; preds = %12
  %16 = sext i32 %13 to i64
  br label %18

.preheader51:                                     ; preds = %18
  %17 = icmp sgt i32 %23, 0
  br i1 %17, label %.lr.ph54, label %.preheader50

18:                                               ; preds = %.lr.ph, %18
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %18 ]
  %19 = getelementptr inbounds [3 x %struct.modint], ptr @poly, i64 0, i64 %indvars.iv
  %20 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @g, i64 0, i64 %indvars.iv, i64 %16
  %.sroa.024.0.copyload = load i32, ptr %20, align 4, !tbaa !5
  %21 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %19, i32 %.sroa.024.0.copyload)
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr @deg, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %18, label %.preheader51, !llvm.loop !9

.preheader50:                                     ; preds = %.lr.ph54, %12, %.preheader51
  %26 = load i32, ptr @p, align 4, !tbaa !5
  %.not46.not61 = icmp sgt i32 %26, %1
  br i1 %.not46.not61, label %.lr.ph63, label %.critedge

.lr.ph54:                                         ; preds = %.preheader51, %.lr.ph54
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph54 ], [ 0, %.preheader51 ]
  %27 = getelementptr inbounds [3 x %struct.modint], ptr @poly, i64 0, i64 %indvars.iv66
  %28 = getelementptr inbounds [3 x [200009 x %struct.modint]], ptr @pref, i64 0, i64 %indvars.iv66, i64 %7
  %.sroa.018.0.copyload = load i32, ptr %28, align 4, !tbaa !5
  %29 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %27, i32 %.sroa.018.0.copyload)
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmIES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %29)
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %31 = load i32, ptr @deg, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next67, %32
  br i1 %33, label %.lr.ph54, label %.preheader50, !llvm.loop !11

.lr.ph63:                                         ; preds = %.preheader50, %._crit_edge
  %34 = phi i32 [ %56, %._crit_edge ], [ %26, %.preheader50 ]
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %._crit_edge ], [ %7, %.preheader50 ]
  %indvars.iv.next70 = add nsw i64 %indvars.iv69, 1
  %35 = getelementptr inbounds [200009 x i32], ptr @primes, i64 0, i64 %indvars.iv.next70
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = sdiv i64 %0, %37
  %.not47 = icmp slt i64 %38, %37
  br i1 %.not47, label %.critedge, label %.preheader

.preheader:                                       ; preds = %.lr.ph63
  %.not4855 = icmp sgt i64 %37, %0
  br i1 %.not4855, label %._crit_edge, label %.lr.ph58.preheader

.lr.ph58.preheader:                               ; preds = %.preheader
  %39 = trunc nsw i64 %indvars.iv.next70 to i32
  br label %.lr.ph58

.lr.ph58:                                         ; preds = %.lr.ph58.preheader, %53
  %40 = phi i32 [ %50, %53 ], [ %36, %.lr.ph58.preheader ]
  %.04157 = phi i32 [ %55, %53 ], [ 1, %.lr.ph58.preheader ]
  %.04256 = phi i64 [ %54, %53 ], [ %37, %.lr.ph58.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %41 = call i32 @_Z4evaliix(i32 noundef %40, i32 noundef %.04157, i64 noundef %.04256)
  store i32 %41, ptr %4, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %42 = sdiv i64 %0, %.04256
  %43 = call i32 @_Z2yoxi(i64 noundef %42, i32 noundef %39)
  store i32 %43, ptr %5, align 4
  %44 = icmp ne i32 %.04157, 1
  %45 = zext i1 %44 to i32
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef %45)
  %46 = load i32, ptr %6, align 4
  %47 = call i32 @_ZNK6modintILi1000000007EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 %46)
  %48 = call i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 %47)
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %48)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %50 = load i32, ptr %35, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = sdiv i64 %0, %51
  %.not49 = icmp sgt i64 %.04256, %52
  br i1 %.not49, label %._crit_edge.loopexit, label %53

53:                                               ; preds = %.lr.ph58
  %54 = mul nsw i64 %.04256, %51
  %55 = add nuw nsw i32 %.04157, 1
  %.not48 = icmp sgt i64 %54, %0
  br i1 %.not48, label %._crit_edge.loopexit, label %.lr.ph58, !llvm.loop !12

._crit_edge.loopexit:                             ; preds = %.lr.ph58, %53
  %.pre = load i32, ptr @p, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %56 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %34, %.preheader ]
  %57 = sext i32 %56 to i64
  %.not46.not = icmp slt i64 %indvars.iv.next70, %57
  br i1 %.not46.not, label %.lr.ph63, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %._crit_edge, %.lr.ph63, %.preheader50, %11
  %58 = load i32, ptr %3, align 4
  ret i32 %58
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4), i32) local_unnamed_addr #4 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: inlinehint mustprogress uwtable
declare dso_local i32 @_Z4evaliix(i32 noundef, i32 noundef, i64 noundef) 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 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 = { 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 = !{!"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}
!13 = distinct !{!13, !10}


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