; LLVM IR from tangjz/acm-icpc :: projecteuler/602.ll (Z7polyMuliPiS_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"

@_ZZ7polyMuliPiS_S_E2tp = external hidden global [4000001 x i32], align 16
@_ZZ7polyMuliPiS_S_E2rt = external hidden global [4000001 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 @_Z4conviPiiS_iS_(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7polyMuliPiS_S_(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %27, %4
  %19 = load i32, ptr %9, align 4, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %30

23:                                               ; preds = %18
  %24 = load i32, ptr %9, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %25
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %23
  %28 = load i32, ptr %9, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %9, align 4, !tbaa !5
  br label %18, !llvm.loop !11

30:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %126, %30
  %32 = load i32, ptr %10, align 4, !tbaa !5
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %129

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %122, %36
  %38 = load i32, ptr %10, align 4, !tbaa !5
  %39 = load i32, ptr %12, align 4, !tbaa !5
  %40 = add nsw i32 %38, %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %37
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %125

44:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %45 = load i32, ptr %10, align 4, !tbaa !5
  %46 = add nsw i32 %45, 262144
  store i32 %46, ptr %13, align 4, !tbaa !5
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i32, ptr %10, align 4, !tbaa !5
  %50 = sub nsw i32 %48, %49
  %51 = load ptr, ptr %6, align 8, !tbaa !9
  %52 = load i32, ptr %10, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %51, i64 %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %55 = load i32, ptr %12, align 4, !tbaa !5
  %56 = add nsw i32 %55, 262144
  store i32 %56, ptr %14, align 4, !tbaa !5
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %12, align 4, !tbaa !5
  %60 = sub nsw i32 %58, %59
  %61 = load ptr, ptr %7, align 8, !tbaa !9
  %62 = load i32, ptr %12, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i32, ptr %61, i64 %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %65 = load i32, ptr %10, align 4, !tbaa !5
  %66 = load i32, ptr %12, align 4, !tbaa !5
  %67 = add nsw i32 %65, %66
  %68 = add nsw i32 %67, 524288
  %69 = sub nsw i32 %68, 1
  store i32 %69, ptr %15, align 4, !tbaa !5
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = sub nsw i32 %71, %72
  %74 = load i32, ptr %12, align 4, !tbaa !5
  %75 = sub nsw i32 %73, %74
  call void @_Z4conviPiiS_iS_(i32 noundef %50, ptr noundef %54, i32 noundef %60, ptr noundef %64, i32 noundef %75, ptr noundef @_ZZ7polyMuliPiS_S_E2tp)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %118, %44
  %77 = load i32, ptr %16, align 4, !tbaa !5
  %78 = icmp slt i32 %77, 524287
  br i1 %78, label %79, label %87

79:                                               ; preds = %76
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = add nsw i32 %80, %81
  %83 = load i32, ptr %16, align 4, !tbaa !5
  %84 = add nsw i32 %82, %83
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br label %87

87:                                               ; preds = %79, %76
  %88 = phi i1 [ false, %76 ], [ %86, %79 ]
  br i1 %88, label %90, label %89

89:                                               ; preds = %87
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %121

90:                                               ; preds = %87
  %91 = load i32, ptr %16, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2tp, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = add nsw i32 %95, %96
  %98 = load i32, ptr %16, align 4, !tbaa !5
  %99 = add nsw i32 %97, %98
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, %94
  store i32 %103, ptr %101, align 4, !tbaa !5
  %104 = icmp sge i32 %103, 1000000007
  br i1 %104, label %105, label %116

105:                                              ; preds = %90
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = load i32, ptr %12, align 4, !tbaa !5
  %108 = add nsw i32 %106, %107
  %109 = load i32, ptr %16, align 4, !tbaa !5
  %110 = add nsw i32 %108, %109
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1000000007
  store i32 %114, ptr %112, align 4, !tbaa !5
  %115 = icmp ne i32 %114, 0
  br label %116

116:                                              ; preds = %105, %90
  %117 = phi i1 [ false, %90 ], [ %115, %105 ]
  br label %118

118:                                              ; preds = %116
  %119 = load i32, ptr %16, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %16, align 4, !tbaa !5
  br label %76, !llvm.loop !13

121:                                              ; preds = %89
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = add nsw i32 %123, 262144
  store i32 %124, ptr %12, align 4, !tbaa !5
  br label %37, !llvm.loop !14

125:                                              ; preds = %43
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = add nsw i32 %127, 262144
  store i32 %128, ptr %10, align 4, !tbaa !5
  br label %31, !llvm.loop !15

129:                                              ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %144, %129
  %131 = load i32, ptr %17, align 4, !tbaa !5
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  br label %147

135:                                              ; preds = %130
  %136 = load i32, ptr %17, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load ptr, ptr %8, align 8, !tbaa !9
  %141 = load i32, ptr %17, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr %140, i64 %142
  store i32 %139, ptr %143, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %135
  %145 = load i32, ptr %17, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %17, align 4, !tbaa !5
  br label %130, !llvm.loop !16

147:                                              ; preds = %134
  ret void
}

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

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

@_ZZ7polyMuliPiS_S_E2tp = external hidden global [4000001 x i32], align 16
@_ZZ7polyMuliPiS_S_E2rt = external hidden local_unnamed_addr global [4000001 x i32], 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 uwtable
declare dso_local void @_Z4conviPiiS_iS_(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7polyMuliPiS_S_(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 {
  %5 = ptrtoint ptr %3 to i64
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  %10 = icmp sgt i32 %0, 0
  br i1 %10, label %.preheader43.preheader, label %._crit_edge52

.preheader43.preheader:                           ; preds = %4
  %11 = zext nneg i32 %0 to i64
  %12 = shl nuw nsw i64 %11, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ7polyMuliPiS_S_E2rt, i8 0, i64 %12, i1 false), !tbaa !5
  br label %.preheader43

.preheader43:                                     ; preds = %.preheader43.preheader, %._crit_edge
  %indvar = phi i32 [ 0, %.preheader43.preheader ], [ %indvar.next, %._crit_edge ]
  %13 = phi i32 [ %0, %.preheader43.preheader ], [ %32, %._crit_edge ]
  %indvars.iv59 = phi i64 [ 0, %.preheader43.preheader ], [ %16, %._crit_edge ]
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv59, %14
  %16 = add nuw nsw i64 %indvars.iv59, 262144
  br i1 %15, label %.lr.ph48, label %.preheader43.._crit_edge_crit_edge

.preheader43.._crit_edge_crit_edge:               ; preds = %.preheader43
  %.pre66 = trunc nuw i64 %16 to i32
  br label %._crit_edge

.lr.ph48:                                         ; preds = %.preheader43
  %17 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv59
  %18 = trunc nuw i64 %16 to i32
  %19 = trunc nuw nsw i64 %indvars.iv59 to i32
  br label %34

.preheader:                                       ; preds = %._crit_edge
  %20 = icmp sgt i32 %32, 0
  br i1 %20, label %.lr.ph51.preheader, label %._crit_edge52

.lr.ph51.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %32 to i64
  %min.iters.check78 = icmp ult i32 %32, 8
  %21 = sub i64 %5, ptrtoint (ptr @_ZZ7polyMuliPiS_S_E2rt to i64)
  %diff.check = icmp ult i64 %21, 32
  %or.cond = or i1 %min.iters.check78, %diff.check
  br i1 %or.cond, label %.lr.ph51.preheader88, label %vector.ph79

.lr.ph51.preheader88:                             ; preds = %middle.block76, %.lr.ph51.preheader
  %indvars.iv62.ph = phi i64 [ 0, %.lr.ph51.preheader ], [ %n.vec81, %middle.block76 ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph51.prol.loopexit, label %.lr.ph51.prol

.lr.ph51.prol:                                    ; preds = %.lr.ph51.preheader88, %.lr.ph51.prol
  %indvars.iv62.prol = phi i64 [ %indvars.iv.next63.prol, %.lr.ph51.prol ], [ %indvars.iv62.ph, %.lr.ph51.preheader88 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph51.prol ], [ 0, %.lr.ph51.preheader88 ]
  %22 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %indvars.iv62.prol
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv62.prol
  store i32 %23, ptr %24, align 4, !tbaa !5
  %indvars.iv.next63.prol = add nuw nsw i64 %indvars.iv62.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph51.prol.loopexit, label %.lr.ph51.prol, !llvm.loop !9

.lr.ph51.prol.loopexit:                           ; preds = %.lr.ph51.prol, %.lr.ph51.preheader88
  %indvars.iv62.unr = phi i64 [ %indvars.iv62.ph, %.lr.ph51.preheader88 ], [ %indvars.iv.next63.prol, %.lr.ph51.prol ]
  %25 = sub nsw i64 %indvars.iv62.ph, %wide.trip.count
  %26 = icmp ugt i64 %25, -4
  br i1 %26, label %._crit_edge52, label %.lr.ph51

vector.ph79:                                      ; preds = %.lr.ph51.preheader
  %n.vec81 = and i64 %wide.trip.count, 2147483640
  br label %vector.body83

vector.body83:                                    ; preds = %vector.body83, %vector.ph79
  %index84 = phi i64 [ 0, %vector.ph79 ], [ %index.next87, %vector.body83 ]
  %27 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %index84
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %wide.load85 = load <4 x i32>, ptr %27, align 16, !tbaa !5
  %wide.load86 = load <4 x i32>, ptr %28, align 16, !tbaa !5
  %29 = getelementptr inbounds i32, ptr %3, i64 %index84
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  store <4 x i32> %wide.load85, ptr %29, align 4, !tbaa !5
  store <4 x i32> %wide.load86, ptr %30, align 4, !tbaa !5
  %index.next87 = add nuw i64 %index84, 8
  %31 = icmp eq i64 %index.next87, %n.vec81
  br i1 %31, label %middle.block76, label %vector.body83, !llvm.loop !11

middle.block76:                                   ; preds = %vector.body83
  %cmp.n = icmp eq i64 %n.vec81, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge52, label %.lr.ph51.preheader88

._crit_edge:                                      ; preds = %.critedge, %.preheader43.._crit_edge_crit_edge
  %.pre-phi = phi i32 [ %.pre66, %.preheader43.._crit_edge_crit_edge ], [ %18, %.critedge ]
  %32 = phi i32 [ %13, %.preheader43.._crit_edge_crit_edge ], [ %54, %.critedge ]
  %33 = icmp slt i32 %.pre-phi, %32
  %indvar.next = add i32 %indvar, 1
  br i1 %33, label %.preheader43, label %.preheader, !llvm.loop !15

34:                                               ; preds = %.lr.ph48, %.critedge
  %indvar71 = phi i32 [ 0, %.lr.ph48 ], [ %indvar.next72, %.critedge ]
  %indvars.iv56 = phi i64 [ 0, %.lr.ph48 ], [ %indvars.iv.next57, %.critedge ]
  %35 = add i32 %indvar, %indvar71
  %36 = shl i32 %35, 18
  %37 = add i32 %indvar, %indvar71
  %38 = add nuw nsw i64 %indvars.iv56, %indvars.iv59
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 %18, ptr %7, align 4, !tbaa !5
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sub nsw i32 %40, %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 262144
  %42 = trunc nuw i64 %indvars.iv.next57 to i32
  store i32 %42, ptr %8, align 4, !tbaa !5
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = trunc nuw nsw i64 %indvars.iv56 to i32
  %46 = sub nsw i32 %44, %45
  %47 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv56
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %48 = trunc i64 %38 to i32
  %49 = add i32 %48, 524287
  store i32 %49, ptr %9, align 4, !tbaa !5
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = trunc nuw i64 %38 to i32
  %53 = sub i32 %51, %52
  call void @_Z4conviPiiS_iS_(i32 noundef %41, ptr noundef %17, i32 noundef %46, ptr noundef %47, i32 noundef %53, ptr noundef nonnull @_ZZ7polyMuliPiS_S_E2tp)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %smax = call i32 @llvm.smax.i32(i32 %54, i32 %36)
  %55 = shl i32 %37, 18
  %56 = sub i32 %smax, %55
  %min.iters.check = icmp ult i32 %56, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %34
  %57 = call i32 @llvm.umin.i32(i32 %56, i32 524286)
  %narrow = add nuw nsw i32 %57, 1
  %58 = zext nneg i32 %narrow to i64
  %n.mod.vf = and i64 %58, 7
  %59 = icmp eq i64 %n.mod.vf, 0
  %60 = select i1 %59, i64 8, i64 %n.mod.vf
  %n.vec = sub nsw i64 %58, %60
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %61 = add nuw nsw i64 %index, %38
  %62 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2tp, i64 0, i64 %index
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %wide.load = load <4 x i32>, ptr %62, align 16, !tbaa !5
  %wide.load73 = load <4 x i32>, ptr %63, align 16, !tbaa !5
  %64 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %61
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  %wide.load74 = load <4 x i32>, ptr %64, align 16, !tbaa !5
  %wide.load75 = load <4 x i32>, ptr %65, align 16, !tbaa !5
  %66 = add nsw <4 x i32> %wide.load74, %wide.load
  %67 = add nsw <4 x i32> %wide.load75, %wide.load73
  %68 = icmp sgt <4 x i32> %66, <i32 1000000006, i32 1000000006, i32 1000000006, i32 1000000006>
  %69 = icmp sgt <4 x i32> %67, <i32 1000000006, i32 1000000006, i32 1000000006, i32 1000000006>
  %70 = add nsw <4 x i32> %66, <i32 -1000000007, i32 -1000000007, i32 -1000000007, i32 -1000000007>
  %71 = add nsw <4 x i32> %67, <i32 -1000000007, i32 -1000000007, i32 -1000000007, i32 -1000000007>
  %72 = select <4 x i1> %68, <4 x i32> %70, <4 x i32> %66
  %73 = select <4 x i1> %69, <4 x i32> %71, <4 x i32> %67
  store <4 x i32> %72, ptr %64, align 16, !tbaa !5
  store <4 x i32> %73, ptr %65, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %74 = icmp eq i64 %index.next, %n.vec
  br i1 %74, label %scalar.ph.preheader, label %vector.body, !llvm.loop !16

scalar.ph.preheader:                              ; preds = %vector.body, %34
  %indvars.iv.ph = phi i64 [ 0, %34 ], [ %n.vec, %vector.body ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %81
  %indvars.iv = phi i64 [ %indvars.iv.next, %81 ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %75 = add nuw nsw i64 %indvars.iv, %38
  %76 = trunc nuw i64 %75 to i32
  %77 = icmp sgt i32 %54, %76
  br i1 %77, label %81, label %.critedge

.critedge:                                        ; preds = %81, %scalar.ph
  %78 = add nuw nsw i64 %indvars.iv.next57, %indvars.iv59
  %79 = trunc nuw i64 %78 to i32
  %80 = icmp sgt i32 %54, %79
  %indvar.next72 = add i32 %indvar71, 1
  br i1 %80, label %34, label %._crit_edge, !llvm.loop !17

81:                                               ; preds = %scalar.ph
  %82 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2tp, i64 0, i64 %indvars.iv
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %75
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = add nsw i32 %85, %83
  %87 = icmp sgt i32 %86, 1000000006
  %88 = add nsw i32 %86, -1000000007
  %spec.select = select i1 %87, i32 %88, i32 %86
  store i32 %spec.select, ptr %84, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 524287
  br i1 %exitcond.not, label %.critedge, label %scalar.ph, !llvm.loop !18

._crit_edge52:                                    ; preds = %.lr.ph51.prol.loopexit, %.lr.ph51, %middle.block76, %4, %.preheader
  ret void

.lr.ph51:                                         ; preds = %.lr.ph51.prol.loopexit, %.lr.ph51
  %indvars.iv62 = phi i64 [ %indvars.iv.next63.3, %.lr.ph51 ], [ %indvars.iv62.unr, %.lr.ph51.prol.loopexit ]
  %89 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %indvars.iv62
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv62
  store i32 %90, ptr %91, align 4, !tbaa !5
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %92 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %indvars.iv.next63
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.next63
  store i32 %93, ptr %94, align 4, !tbaa !5
  %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
  %95 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %indvars.iv.next63.1
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.next63.1
  store i32 %96, ptr %97, align 4, !tbaa !5
  %indvars.iv.next63.2 = add nuw nsw i64 %indvars.iv62, 3
  %98 = getelementptr inbounds [4000001 x i32], ptr @_ZZ7polyMuliPiS_S_E2rt, i64 0, i64 %indvars.iv.next63.2
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.next63.2
  store i32 %99, ptr %100, align 4, !tbaa !5
  %indvars.iv.next63.3 = add nuw nsw i64 %indvars.iv62, 4
  %exitcond65.not.3 = icmp eq i64 %indvars.iv.next63.3, %wide.trip.count
  br i1 %exitcond65.not.3, label %._crit_edge52, label %.lr.ph51, !llvm.loop !19
}

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

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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.unroll.disable"}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !13, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !14, !13}
!19 = distinct !{!19, !12, !13}


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