; LLVM IR from ShahjalalShohag/code-library :: Number Theory/Dirichlet Convolution.ll (ZN9Dirichlet4initEv)

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

@_ZN9Dirichlet3phiE = external dso_local global [10000009 x i64], align 16
@_ZN9Dirichlet2dpE = external dso_local global [10000009 x %struct.modint], align 16
@_ZN9Dirichlet3invE = external dso_local global %struct.modint, align 4
@_ZN9Dirichlet2szE = external dso_local global i32, align 4
@_ZN9Dirichlet3spfE = external dso_local global [10000009 x i32], align 16
@_ZN9Dirichlet5primeE = external dso_local global [10000009 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9Dirichlet4initEv() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.modint, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.modint, align 4
  %7 = alloca %struct.modint, align 4
  %8 = alloca %struct.modint, align 4
  call void @llvm.memset.p0.i64(ptr align 16 @_ZN9Dirichlet3spfE, i8 0, i64 40000036, i1 false)
  store i64 1, ptr getelementptr inbounds ([10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 1), align 8, !tbaa !5
  store i32 0, ptr @_ZN9Dirichlet2szE, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 2, ptr %1, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %125, %0
  %10 = load i32, ptr %1, align 4, !tbaa !9
  %11 = icmp slt i32 %10, 10000009
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %128

13:                                               ; preds = %9
  %14 = load i32, ptr %1, align 4, !tbaa !9
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet3spfE, i64 0, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !9
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %35

19:                                               ; preds = %13
  %20 = load i32, ptr %1, align 4, !tbaa !9
  %21 = sub nsw i32 %20, 1
  %22 = sext i32 %21 to i64
  %23 = load i32, ptr %1, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %24
  store i64 %22, ptr %25, align 8, !tbaa !5
  %26 = load i32, ptr %1, align 4, !tbaa !9
  %27 = load i32, ptr %1, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet3spfE, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !9
  %30 = load i32, ptr %1, align 4, !tbaa !9
  %31 = load i32, ptr @_ZN9Dirichlet2szE, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr @_ZN9Dirichlet2szE, align 4, !tbaa !9
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %33
  store i32 %30, ptr %34, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %19, %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %121, %35
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = load i32, ptr @_ZN9Dirichlet2szE, align 4, !tbaa !9
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %40, label %58

40:                                               ; preds = %36
  %41 = load i32, ptr %1, align 4, !tbaa !9
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = mul nsw i32 %41, %45
  %47 = icmp slt i32 %46, 10000009
  br i1 %47, label %48, label %58

48:                                               ; preds = %40
  %49 = load i32, ptr %3, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = load i32, ptr %1, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet3spfE, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !9
  %57 = icmp sle i32 %52, %56
  br label %58

58:                                               ; preds = %48, %40, %36
  %59 = phi i1 [ false, %40 ], [ false, %36 ], [ %57, %48 ]
  br i1 %59, label %61, label %60

60:                                               ; preds = %58
  store i32 5, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %124

61:                                               ; preds = %58
  %62 = load i32, ptr %3, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = load i32, ptr %1, align 4, !tbaa !9
  %67 = load i32, ptr %3, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = mul nsw i32 %66, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet3spfE, i64 0, i64 %72
  store i32 %65, ptr %73, align 4, !tbaa !9
  %74 = load i32, ptr %1, align 4, !tbaa !9
  %75 = load i32, ptr %3, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = srem i32 %74, %78
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %100

81:                                               ; preds = %61
  %82 = load i32, ptr %1, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = load i32, ptr %3, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = mul nsw i64 %85, %90
  %92 = load i32, ptr %1, align 4, !tbaa !9
  %93 = load i32, ptr %3, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = mul nsw i32 %92, %96
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %98
  store i64 %91, ptr %99, align 8, !tbaa !5
  br label %120

100:                                              ; preds = %61
  %101 = load i32, ptr %1, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !5
  %105 = load i32, ptr %3, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = mul nsw i64 %104, %110
  %112 = load i32, ptr %1, align 4, !tbaa !9
  %113 = load i32, ptr %3, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = mul nsw i32 %112, %116
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %118
  store i64 %111, ptr %119, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %100, %81
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %3, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %3, align 4, !tbaa !9
  br label %36, !llvm.loop !11

124:                                              ; preds = %60
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %1, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %1, align 4, !tbaa !9
  br label %9, !llvm.loop !13

128:                                              ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef 0)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @_ZN9Dirichlet2dpE, ptr align 4 %4, i64 4, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %151, %128
  %130 = load i32, ptr %5, align 4, !tbaa !9
  %131 = icmp slt i32 %130, 10000009
  br i1 %131, label %133, label %132

132:                                              ; preds = %129
  store i32 8, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %154

133:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %134 = load i32, ptr %5, align 4, !tbaa !9
  %135 = sub nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [10000009 x %struct.modint], ptr @_ZN9Dirichlet2dpE, i64 0, i64 %136
  %138 = load i32, ptr %5, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %139
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = srem i64 %141, 998244353
  %143 = trunc i64 %142 to i32
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef %143)
  %144 = getelementptr inbounds %struct.modint, ptr %7, i32 0, i32 0
  %145 = load i32, ptr %144, align 4
  %146 = call i32 @_ZNK6modintILi998244353EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %137, i32 %145)
  %147 = getelementptr inbounds %struct.modint, ptr %6, i32 0, i32 0
  store i32 %146, ptr %147, align 4
  %148 = load i32, ptr %5, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [10000009 x %struct.modint], ptr @_ZN9Dirichlet2dpE, i64 0, i64 %149
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %150, ptr align 4 %6, i64 4, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %151

151:                                              ; preds = %133
  %152 = load i32, ptr %5, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %5, align 4, !tbaa !9
  br label %129, !llvm.loop !15

154:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @_ZN9Dirichlet3invE, ptr align 4 %8, i64 4, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

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

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

%struct.modint = type { i32 }

@_ZN9Dirichlet3phiE = external dso_local local_unnamed_addr global [10000009 x i64], align 16
@_ZN9Dirichlet2dpE = external dso_local global [10000009 x %struct.modint], align 16
@_ZN9Dirichlet3invE = external dso_local local_unnamed_addr global %struct.modint, align 4
@_ZN9Dirichlet2szE = external dso_local local_unnamed_addr global i32, align 4
@_ZN9Dirichlet3spfE = external dso_local local_unnamed_addr global [10000009 x i32], align 16
@_ZN9Dirichlet5primeE = external dso_local local_unnamed_addr global [10000009 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9Dirichlet4initEv() local_unnamed_addr #0 {
  %1 = alloca %struct.modint, align 4
  %2 = alloca %struct.modint, align 4
  %3 = alloca %struct.modint, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000036) @_ZN9Dirichlet3spfE, i8 0, i64 40000036, i1 false)
  store i64 1, ptr getelementptr inbounds (i8, ptr @_ZN9Dirichlet3phiE, i64 8), align 8, !tbaa !5
  store i32 0, ptr @_ZN9Dirichlet2szE, align 4, !tbaa !9
  br label %6

4:                                                ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef 0)
  %5 = load i32, ptr %1, align 4, !tbaa !9
  store i32 %5, ptr @_ZN9Dirichlet2dpE, align 16, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  br label %42

6:                                                ; preds = %0, %.critedge
  %indvars.iv42 = phi i64 [ 2, %0 ], [ %indvars.iv.next43, %.critedge ]
  %7 = phi i32 [ 0, %0 ], [ %19, %.critedge ]
  %8 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet3spfE, i64 0, i64 %indvars.iv42
  %9 = load i32, ptr %8, align 4, !tbaa !9
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %11, label %18

11:                                               ; preds = %6
  %12 = add nsw i64 %indvars.iv42, -1
  %13 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %indvars.iv42
  store i64 %12, ptr %13, align 8, !tbaa !5
  %14 = trunc nuw nsw i64 %indvars.iv42 to i32
  store i32 %14, ptr %8, align 4, !tbaa !9
  %15 = add nsw i32 %7, 1
  store i32 %15, ptr @_ZN9Dirichlet2szE, align 4, !tbaa !9
  %16 = sext i32 %7 to i64
  %17 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %16
  store i32 %14, ptr %17, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %11, %6
  %19 = phi i32 [ %15, %11 ], [ %7, %6 ]
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %18
  %21 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %indvars.iv42
  %wide.trip.count = zext nneg i32 %19 to i64
  %22 = trunc nuw nsw i64 %indvars.iv42 to i32
  br label %23

23:                                               ; preds = %.lr.ph, %30
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %30 ]
  %24 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet5primeE, i64 0, i64 %indvars.iv
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = mul nsw i32 %25, %22
  %27 = icmp slt i32 %26, 10000009
  br i1 %27, label %28, label %.critedge

28:                                               ; preds = %23
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %.not = icmp sgt i32 %25, %29
  br i1 %.not, label %.critedge, label %30

.critedge:                                        ; preds = %28, %30, %23, %18
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %exitcond45.not = icmp eq i64 %indvars.iv.next43, 10000009
  br i1 %exitcond45.not, label %4, label %6, !llvm.loop !11

30:                                               ; preds = %28
  %31 = sext i32 %26 to i64
  %32 = getelementptr inbounds [10000009 x i32], ptr @_ZN9Dirichlet3spfE, i64 0, i64 %31
  store i32 %25, ptr %32, align 4, !tbaa !9
  %33 = srem i32 %22, %25
  %34 = icmp ne i32 %33, 0
  %35 = load i64, ptr %21, align 8, !tbaa !5
  %36 = sext i1 %34 to i32
  %.sink = add nsw i32 %25, %36
  %37 = sext i32 %.sink to i64
  %38 = mul nsw i64 %35, %37
  %39 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %31
  store i64 %38, ptr %39, align 8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %23, !llvm.loop !13

40:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 1)
  %41 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %41, ptr @_ZN9Dirichlet3invE, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret void

42:                                               ; preds = %4, %42
  %indvars.iv46 = phi i64 [ 1, %4 ], [ %indvars.iv.next47, %42 ]
  %43 = add nsw i64 %indvars.iv46, -1
  %44 = getelementptr inbounds [10000009 x %struct.modint], ptr @_ZN9Dirichlet2dpE, i64 0, i64 %43
  %45 = getelementptr inbounds [10000009 x i64], ptr @_ZN9Dirichlet3phiE, i64 0, i64 %indvars.iv46
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = srem i64 %46, 998244353
  %48 = trunc nsw i64 %47 to i32
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %48)
  %49 = load i32, ptr %2, align 4
  %50 = call i32 @_ZNK6modintILi998244353EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %44, i32 %49)
  %51 = getelementptr inbounds [10000009 x %struct.modint], ptr @_ZN9Dirichlet2dpE, i64 0, i64 %indvars.iv46
  store i32 %50, ptr %51, align 4, !tbaa !9
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond49.not = icmp eq i64 %indvars.iv.next47, 10000009
  br i1 %exitcond49.not, label %40, label %42, !llvm.loop !14
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #3 align 2

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

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 nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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}


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