; LLVM IR from tangjz/acm-icpc :: 51nod/1538.ll (Z7polyDiviPiiS_S_S_)

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

@_ZZ7polyDiviPiiS_S_S_E1x = external hidden global [131072 x i32], align 16
@_ZZ7polyDiviPiiS_S_S_E1y = external hidden global [131072 x i32], 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 uwtable
declare dso_local void @_Z7polyInviPiS_(i32 noundef, ptr noundef, ptr noundef) #1

; 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) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3NTTiPii(i32 noundef, ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7polyDiviPiiS_S_S_(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #1 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !9
  %18 = load i32, ptr %7, align 4, !tbaa !5
  %19 = load i32, ptr %9, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %21, label %29

21:                                               ; preds = %6
  %22 = load ptr, ptr %11, align 8, !tbaa !9
  %23 = getelementptr inbounds i32, ptr %22, i64 0
  store i32 0, ptr %23, align 4, !tbaa !5
  %24 = load ptr, ptr %12, align 8, !tbaa !9
  %25 = load ptr, ptr %8, align 8, !tbaa !9
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = mul i64 %27, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %25, i64 %28, i1 false)
  br label %206

29:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = sub nsw i32 %30, %31
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %14, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %40, %29
  %35 = load i32, ptr %13, align 4, !tbaa !5
  %36 = load i32, ptr %14, align 4, !tbaa !5
  %37 = shl i32 %36, 1
  %38 = icmp slt i32 %35, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %34
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %13, align 4, !tbaa !5
  %42 = shl i32 %41, 1
  store i32 %42, ptr %13, align 4, !tbaa !5
  br label %34, !llvm.loop !11

43:                                               ; preds = %34
  %44 = load ptr, ptr %10, align 8, !tbaa !9
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = mul i64 %46, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @_ZZ7polyDiviPiiS_S_S_E1x, ptr align 4 %44, i64 %47, i1 false)
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %49
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef @_ZZ7polyDiviPiiS_S_S_E1x, ptr noundef %50)
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = load i32, ptr %13, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %63

54:                                               ; preds = %43
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %56
  %58 = load i32, ptr %13, align 4, !tbaa !5
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = sub nsw i32 %58, %59
  %61 = sext i32 %60 to i64
  %62 = mul i64 %61, 4
  call void @llvm.memset.p0.i64(ptr align 4 %57, i8 0, i64 %62, i1 false)
  br label %63

63:                                               ; preds = %54, %43
  %64 = load i32, ptr %14, align 4, !tbaa !5
  call void @_Z7polyInviPiS_(i32 noundef %64, ptr noundef @_ZZ7polyDiviPiiS_S_S_E1x, ptr noundef @_ZZ7polyDiviPiiS_S_S_E1y)
  %65 = load i32, ptr %14, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 %66
  %68 = load i32, ptr %13, align 4, !tbaa !5
  %69 = load i32, ptr %14, align 4, !tbaa !5
  %70 = sub nsw i32 %68, %69
  %71 = sext i32 %70 to i64
  %72 = mul i64 %71, 4
  call void @llvm.memset.p0.i64(ptr align 4 %67, i8 0, i64 %72, i1 false)
  %73 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %73, ptr noundef @_ZZ7polyDiviPiiS_S_S_E1y, i32 noundef 1)
  %74 = load ptr, ptr %8, align 8, !tbaa !9
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = mul i64 %76, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @_ZZ7polyDiviPiiS_S_S_E1x, ptr align 4 %74, i64 %77, i1 false)
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %79
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef @_ZZ7polyDiviPiiS_S_S_E1x, ptr noundef %80)
  %81 = load i32, ptr %14, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %82
  %84 = load i32, ptr %13, align 4, !tbaa !5
  %85 = load i32, ptr %14, align 4, !tbaa !5
  %86 = sub nsw i32 %84, %85
  %87 = sext i32 %86 to i64
  %88 = mul i64 %87, 4
  call void @llvm.memset.p0.i64(ptr align 4 %83, i8 0, i64 %88, i1 false)
  %89 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %89, ptr noundef @_ZZ7polyDiviPiiS_S_S_E1x, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %112, %63
  %91 = load i32, ptr %15, align 4, !tbaa !5
  %92 = load i32, ptr %13, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %115

95:                                               ; preds = %90
  %96 = load i32, ptr %15, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = load i32, ptr %15, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = mul nsw i64 %100, %105
  %107 = srem i64 %106, 104857601
  %108 = trunc i64 %107 to i32
  %109 = load i32, ptr %15, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %110
  store i32 %108, ptr %111, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %95
  %113 = load i32, ptr %15, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %15, align 4, !tbaa !5
  br label %90, !llvm.loop !13

115:                                              ; preds = %94
  %116 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %116, ptr noundef @_ZZ7polyDiviPiiS_S_S_E1x, i32 noundef -1)
  %117 = load i32, ptr %14, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %118
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef @_ZZ7polyDiviPiiS_S_S_E1x, ptr noundef %119)
  %120 = load ptr, ptr %11, align 8, !tbaa !9
  %121 = load i32, ptr %14, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = mul i64 %122, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %120, ptr align 16 @_ZZ7polyDiviPiiS_S_S_E1x, i64 %123, i1 false)
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %129, %115
  %125 = load i32, ptr %13, align 4, !tbaa !5
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %128, label %132

128:                                              ; preds = %124
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %13, align 4, !tbaa !5
  %131 = shl i32 %130, 1
  store i32 %131, ptr %13, align 4, !tbaa !5
  br label %124, !llvm.loop !14

132:                                              ; preds = %124
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %134
  %136 = load i32, ptr %13, align 4, !tbaa !5
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = sub nsw i32 %136, %137
  %139 = sext i32 %138 to i64
  %140 = mul i64 %139, 4
  call void @llvm.memset.p0.i64(ptr align 4 %135, i8 0, i64 %140, i1 false)
  %141 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %141, ptr noundef @_ZZ7polyDiviPiiS_S_S_E1x, i32 noundef 1)
  %142 = load ptr, ptr %10, align 8, !tbaa !9
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = mul i64 %144, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @_ZZ7polyDiviPiiS_S_S_E1y, ptr align 4 %142, i64 %145, i1 false)
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 %147
  %149 = load i32, ptr %13, align 4, !tbaa !5
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = sub nsw i32 %149, %150
  %152 = sext i32 %151 to i64
  %153 = mul i64 %152, 4
  call void @llvm.memset.p0.i64(ptr align 4 %148, i8 0, i64 %153, i1 false)
  %154 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %154, ptr noundef @_ZZ7polyDiviPiiS_S_S_E1y, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %177, %132
  %156 = load i32, ptr %16, align 4, !tbaa !5
  %157 = load i32, ptr %13, align 4, !tbaa !5
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %180

160:                                              ; preds = %155
  %161 = load i32, ptr %16, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = load i32, ptr %16, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = mul nsw i64 %165, %170
  %172 = srem i64 %171, 104857601
  %173 = trunc i64 %172 to i32
  %174 = load i32, ptr %16, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %175
  store i32 %173, ptr %176, align 4, !tbaa !5
  br label %177

177:                                              ; preds = %160
  %178 = load i32, ptr %16, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %16, align 4, !tbaa !5
  br label %155, !llvm.loop !15

180:                                              ; preds = %159
  %181 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %181, ptr noundef @_ZZ7polyDiviPiiS_S_S_E1x, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %202, %180
  %183 = load i32, ptr %17, align 4, !tbaa !5
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %205

187:                                              ; preds = %182
  %188 = load ptr, ptr %8, align 8, !tbaa !9
  %189 = load i32, ptr %17, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds i32, ptr %188, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = load i32, ptr %17, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = call noundef i32 @_Z7mod_subii(i32 noundef %192, i32 noundef %196)
  %198 = load ptr, ptr %12, align 8, !tbaa !9
  %199 = load i32, ptr %17, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds i32, ptr %198, i64 %200
  store i32 %197, ptr %201, align 4, !tbaa !5
  br label %202

202:                                              ; preds = %187
  %203 = load i32, ptr %17, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %17, align 4, !tbaa !5
  br label %182, !llvm.loop !16

205:                                              ; preds = %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %206

206:                                              ; preds = %205, %21
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_subii(i32 noundef, i32 noundef) #5

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

@_ZZ7polyDiviPiiS_S_S_E1x = external hidden global [131072 x i32], align 16
@_ZZ7polyDiviPiiS_S_S_E1y = external hidden global [131072 x i32], align 16

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

; Function Attrs: mustprogress 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) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3NTTiPii(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7polyDiviPiiS_S_S_(i32 noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr nocapture noundef readonly %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #0 {
  %7 = icmp slt i32 %0, %2
  br i1 %7, label %8, label %11

8:                                                ; preds = %6
  store i32 0, ptr %4, align 4, !tbaa !5
  %9 = sext i32 %0 to i64
  %10 = shl nsw i64 %9, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %1, i64 %10, i1 false)
  br label %.loopexit

11:                                               ; preds = %6
  %12 = sub nsw i32 %0, %2
  %13 = add nsw i32 %12, 1
  %14 = shl i32 %13, 1
  br label %15

15:                                               ; preds = %15, %11
  %.070 = phi i32 [ 1, %11 ], [ %17, %15 ]
  %16 = icmp slt i32 %.070, %14
  %17 = shl i32 %.070, 1
  br i1 %16, label %15, label %18, !llvm.loop !9

18:                                               ; preds = %15
  %19 = sext i32 %2 to i64
  %20 = shl nsw i64 %19, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @_ZZ7polyDiviPiiS_S_S_E1x, ptr align 4 %3, i64 %20, i1 false)
  %21 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %19
  tail call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1x, ptr noundef nonnull %21)
  %22 = icmp sgt i32 %.070, %2
  br i1 %22, label %23, label %27

23:                                               ; preds = %18
  %24 = sub nsw i32 %.070, %2
  %25 = sext i32 %24 to i64
  %26 = shl nsw i64 %25, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %21, i8 0, i64 %26, i1 false)
  br label %27

27:                                               ; preds = %23, %18
  tail call void @_Z7polyInviPiS_(i32 noundef %13, ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1x, ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1y)
  %28 = sext i32 %13 to i64
  %29 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 %28
  %30 = sub nsw i32 %.070, %13
  %31 = sext i32 %30 to i64
  %32 = shl nsw i64 %31, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %29, i8 0, i64 %32, i1 false)
  tail call void @_Z3NTTiPii(i32 noundef %.070, ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1y, i32 noundef 1)
  %33 = sext i32 %0 to i64
  %34 = shl nsw i64 %33, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @_ZZ7polyDiviPiiS_S_S_E1x, ptr align 4 %1, i64 %34, i1 false)
  %35 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %33
  tail call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1x, ptr noundef nonnull %35)
  %36 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 %28
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %36, i8 0, i64 %32, i1 false)
  tail call void @_Z3NTTiPii(i32 noundef %.070, ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1x, i32 noundef 1)
  %37 = icmp sgt i32 %.070, 0
  br i1 %37, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %27
  %wide.trip.count = zext nneg i32 %.070 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %38 = icmp eq i32 %.070, 1
  br i1 %38, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %39 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %indvars.iv.unr
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 0, i64 %indvars.iv.unr
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = mul nsw i64 %44, %41
  %46 = srem i64 %45, 104857601
  %47 = trunc nsw i64 %46 to i32
  store i32 %47, ptr %39, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %27
  tail call void @_Z3NTTiPii(i32 noundef %.070, ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1x, i32 noundef -1)
  tail call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1x, ptr noundef nonnull %36)
  %48 = shl nsw i64 %28, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr nonnull align 16 @_ZZ7polyDiviPiiS_S_S_E1x, i64 %48, i1 false)
  br label %67

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %49 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %indvars.iv
  %50 = load i32, ptr %49, align 8, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 0, i64 %indvars.iv
  %53 = load i32, ptr %52, align 8, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = mul nsw i64 %54, %51
  %56 = srem i64 %55, 104857601
  %57 = trunc nsw i64 %56 to i32
  store i32 %57, ptr %49, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %58 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %indvars.iv.next
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 0, i64 %indvars.iv.next
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = mul nsw i64 %63, %60
  %65 = srem i64 %64, 104857601
  %66 = trunc nsw i64 %65 to i32
  store i32 %66, ptr %58, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !11

67:                                               ; preds = %67, %._crit_edge
  %.1 = phi i32 [ 1, %._crit_edge ], [ %69, %67 ]
  %68 = icmp slt i32 %.1, %0
  %69 = shl i32 %.1, 1
  br i1 %68, label %67, label %70, !llvm.loop !12

70:                                               ; preds = %67
  %71 = sub nsw i32 %.1, %13
  %72 = sext i32 %71 to i64
  %73 = shl nsw i64 %72, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %36, i8 0, i64 %73, i1 false)
  tail call void @_Z3NTTiPii(i32 noundef %.1, ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1x, i32 noundef 1)
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @_ZZ7polyDiviPiiS_S_S_E1y, ptr align 4 %3, i64 %20, i1 false)
  %74 = getelementptr inbounds i32, ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 %19
  %75 = sub nsw i32 %.1, %2
  %76 = sext i32 %75 to i64
  %77 = shl nsw i64 %76, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %74, i8 0, i64 %77, i1 false)
  tail call void @_Z3NTTiPii(i32 noundef %.1, ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1y, i32 noundef 1)
  %78 = icmp sgt i32 %.1, 0
  br i1 %78, label %.lr.ph77.preheader, label %._crit_edge78

.lr.ph77.preheader:                               ; preds = %70
  %wide.trip.count86 = zext nneg i32 %.1 to i64
  %xtraiter93 = and i64 %wide.trip.count86, 1
  %79 = icmp eq i32 %.1, 1
  br i1 %79, label %._crit_edge78.loopexit.unr-lcssa, label %.lr.ph77.preheader.new

.lr.ph77.preheader.new:                           ; preds = %.lr.ph77.preheader
  %unroll_iter95 = and i64 %wide.trip.count86, 2147483646
  br label %.lr.ph77

._crit_edge78.loopexit.unr-lcssa:                 ; preds = %.lr.ph77, %.lr.ph77.preheader
  %indvars.iv83.unr = phi i64 [ 0, %.lr.ph77.preheader ], [ %indvars.iv.next84.1, %.lr.ph77 ]
  %lcmp.mod94.not = icmp eq i64 %xtraiter93, 0
  br i1 %lcmp.mod94.not, label %._crit_edge78, label %.lr.ph77.epil

.lr.ph77.epil:                                    ; preds = %._crit_edge78.loopexit.unr-lcssa
  %80 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %indvars.iv83.unr
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 0, i64 %indvars.iv83.unr
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = mul nsw i64 %85, %82
  %87 = srem i64 %86, 104857601
  %88 = trunc nsw i64 %87 to i32
  store i32 %88, ptr %80, align 4, !tbaa !5
  br label %._crit_edge78

._crit_edge78:                                    ; preds = %.lr.ph77.epil, %._crit_edge78.loopexit.unr-lcssa, %70
  tail call void @_Z3NTTiPii(i32 noundef %.1, ptr noundef nonnull @_ZZ7polyDiviPiiS_S_S_E1x, i32 noundef -1)
  %89 = icmp sgt i32 %2, 0
  br i1 %89, label %.lr.ph81.preheader, label %.loopexit

.lr.ph81.preheader:                               ; preds = %._crit_edge78
  %wide.trip.count91 = zext nneg i32 %2 to i64
  br label %.lr.ph81

.lr.ph77:                                         ; preds = %.lr.ph77, %.lr.ph77.preheader.new
  %indvars.iv83 = phi i64 [ 0, %.lr.ph77.preheader.new ], [ %indvars.iv.next84.1, %.lr.ph77 ]
  %niter96 = phi i64 [ 0, %.lr.ph77.preheader.new ], [ %niter96.next.1, %.lr.ph77 ]
  %90 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %indvars.iv83
  %91 = load i32, ptr %90, align 8, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 0, i64 %indvars.iv83
  %94 = load i32, ptr %93, align 8, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = mul nsw i64 %95, %92
  %97 = srem i64 %96, 104857601
  %98 = trunc nsw i64 %97 to i32
  store i32 %98, ptr %90, align 8, !tbaa !5
  %indvars.iv.next84 = or disjoint i64 %indvars.iv83, 1
  %99 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %indvars.iv.next84
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1y, i64 0, i64 %indvars.iv.next84
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = mul nsw i64 %104, %101
  %106 = srem i64 %105, 104857601
  %107 = trunc nsw i64 %106 to i32
  store i32 %107, ptr %99, align 4, !tbaa !5
  %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2
  %niter96.next.1 = add i64 %niter96, 2
  %niter96.ncmp.1 = icmp eq i64 %niter96.next.1, %unroll_iter95
  br i1 %niter96.ncmp.1, label %._crit_edge78.loopexit.unr-lcssa, label %.lr.ph77, !llvm.loop !13

.lr.ph81:                                         ; preds = %.lr.ph81.preheader, %.lr.ph81
  %indvars.iv88 = phi i64 [ 0, %.lr.ph81.preheader ], [ %indvars.iv.next89, %.lr.ph81 ]
  %108 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv88
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = getelementptr inbounds [131072 x i32], ptr @_ZZ7polyDiviPiiS_S_S_E1x, i64 0, i64 %indvars.iv88
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = tail call noundef i32 @_Z7mod_subii(i32 noundef %109, i32 noundef %111)
  %113 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv88
  store i32 %112, ptr %113, align 4, !tbaa !5
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count91
  br i1 %exitcond92.not, label %.loopexit, label %.lr.ph81, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph81, %._crit_edge78, %8
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_subii(i32 noundef, i32 noundef) local_unnamed_addr #4

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

!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}
!14 = distinct !{!14, !10}


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