; LLVM IR from lzyrapx/Competitive-Programming :: Codeforces/Math/1257G.ll (Z3mul4polyS_)

; 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.poly = type <{ %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@rv = external dso_local global [3456912 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 @_ZN4polyC2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3ext4polyi(ptr dead_on_unwind noalias writable sret(%struct.poly) align 8, ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3dftP4polyii(ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3mul4polyS_(ptr dead_on_unwind noalias writable sret(%struct.poly) align 8 %0, ptr noundef %1, ptr noundef %2) #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i1, align 1
  %13 = alloca %struct.poly, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.poly, align 8
  %17 = alloca %struct.poly, align 8
  %18 = alloca %struct.poly, align 8
  %19 = alloca %struct.poly, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %20 = getelementptr inbounds %struct.poly, ptr %1, i32 0, i32 1
  %21 = load i32, ptr %20, align 8, !tbaa !11
  store i32 %21, ptr %10, align 4, !tbaa !9
  %22 = getelementptr inbounds %struct.poly, ptr %2, i32 0, i32 1
  %23 = load i32, ptr %22, align 8, !tbaa !11
  store i32 %23, ptr %11, align 4, !tbaa !9
  store i1 false, ptr %12, align 1
  call void @_ZN4polyC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  invoke void @_ZN4polyC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13)
          to label %24 unwind label %36

24:                                               ; preds = %3
  br label %25

25:                                               ; preds = %31, %24
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = load i32, ptr %10, align 4, !tbaa !9
  %28 = load i32, ptr %11, align 4, !tbaa !9
  %29 = add nsw i32 %27, %28
  %30 = icmp sle i32 %26, %29
  br i1 %30, label %31, label %40

31:                                               ; preds = %25
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = shl i32 %32, 1
  store i32 %33, ptr %7, align 4, !tbaa !9
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %8, align 4, !tbaa !9
  br label %25, !llvm.loop !17

36:                                               ; preds = %3
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %14, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %15, align 4
  br label %142

40:                                               ; preds = %25
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %61, %40
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %64

45:                                               ; preds = %41
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = ashr i32 %46, 1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3456912 x i32], ptr @rv, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = ashr i32 %50, 1
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = and i32 %52, 1
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = sub nsw i32 %54, 1
  %56 = shl i32 %53, %55
  %57 = or i32 %51, %56
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [3456912 x i32], ptr @rv, i64 0, i64 %59
  store i32 %57, ptr %60, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %45
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %9, align 4, !tbaa !9
  br label %41, !llvm.loop !19

64:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #5
  invoke void @_ZN4polyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(28) %17, ptr noundef nonnull align 8 dereferenceable(28) %1)
          to label %65 unwind label %105

65:                                               ; preds = %64
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = sub nsw i32 %66, 1
  invoke void @_Z3ext4polyi(ptr dead_on_unwind writable sret(%struct.poly) align 8 %16, ptr noundef %17, i32 noundef %67)
          to label %68 unwind label %109

68:                                               ; preds = %65
  %69 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN4polyaSEOS_(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef nonnull align 8 dereferenceable(28) %16) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %16) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %17) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #5
  invoke void @_ZN4polyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(28) %19, ptr noundef nonnull align 8 dereferenceable(28) %2)
          to label %70 unwind label %114

70:                                               ; preds = %68
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = sub nsw i32 %71, 1
  invoke void @_Z3ext4polyi(ptr dead_on_unwind writable sret(%struct.poly) align 8 %18, ptr noundef %19, i32 noundef %72)
          to label %73 unwind label %118

73:                                               ; preds = %70
  %74 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN4polyaSEOS_(ptr noundef nonnull align 8 dereferenceable(28) %13, ptr noundef nonnull align 8 dereferenceable(28) %18) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %18) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  %75 = load i32, ptr %7, align 4, !tbaa !9
  call void @_Z3dftP4polyii(ptr noundef %0, i32 noundef 1, i32 noundef %75)
  %76 = load i32, ptr %7, align 4, !tbaa !9
  call void @_Z3dftP4polyii(ptr noundef %13, i32 noundef 1, i32 noundef %76)
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %102, %73
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %81, label %123

81:                                               ; preds = %77
  %82 = getelementptr inbounds %struct.poly, ptr %0, i32 0, i32 0
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %84) #5
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = mul nsw i64 1, %87
  %89 = getelementptr inbounds %struct.poly, ptr %13, i32 0, i32 0
  %90 = load i32, ptr %9, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %91) #5
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = mul nsw i64 %88, %94
  %96 = srem i64 %95, 998244353
  %97 = trunc i64 %96 to i32
  %98 = getelementptr inbounds %struct.poly, ptr %0, i32 0, i32 0
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %100) #5
  store i32 %97, ptr %101, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %81
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %9, align 4, !tbaa !9
  br label %77, !llvm.loop !20

105:                                              ; preds = %64
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %14, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %15, align 4
  br label %113

109:                                              ; preds = %65
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %14, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %15, align 4
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %17) #5
  br label %113

113:                                              ; preds = %109, %105
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  br label %141

114:                                              ; preds = %68
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %14, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %15, align 4
  br label %122

118:                                              ; preds = %70
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %14, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %15, align 4
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %19) #5
  br label %122

122:                                              ; preds = %118, %114
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  br label %141

123:                                              ; preds = %77
  %124 = load i32, ptr %7, align 4, !tbaa !9
  call void @_Z3dftP4polyii(ptr noundef %0, i32 noundef -1, i32 noundef %124)
  %125 = load i32, ptr %10, align 4, !tbaa !9
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = add nsw i32 %125, %126
  %128 = getelementptr inbounds %struct.poly, ptr %0, i32 0, i32 1
  store i32 %127, ptr %128, align 8, !tbaa !11
  %129 = getelementptr inbounds %struct.poly, ptr %0, i32 0, i32 0
  %130 = load i32, ptr %10, align 4, !tbaa !9
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = add nsw i32 %130, %131
  %133 = add nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  invoke void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %129, i64 noundef %134)
          to label %135 unwind label %137

135:                                              ; preds = %123
  store i1 true, ptr %12, align 1
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  %136 = load i1, ptr %12, align 1
  br i1 %136, label %144, label %143

137:                                              ; preds = %123
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %14, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %15, align 4
  br label %141

141:                                              ; preds = %137, %122, %113
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13) #5
  br label %142

142:                                              ; preds = %141, %36
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %145

143:                                              ; preds = %135
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0) #5
  br label %144

144:                                              ; preds = %143, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void

145:                                              ; preds = %142
  %146 = load ptr, ptr %14, align 8
  %147 = load i32, ptr %15, align 4
  %148 = insertvalue { ptr, i32 } poison, ptr %146, 0
  %149 = insertvalue { ptr, i32 } %148, i32 %147, 1
  resume { ptr, i32 } %149
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4polyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(28) ptr @_ZN4polyaSEOS_(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(28)) #3 align 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTS4poly", !13, i64 0, !10, i64 24}
!13 = !{!"_ZTSSt6vectorIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; 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.poly = type <{ %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@rv = external dso_local local_unnamed_addr global [3456912 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 @_ZN4polyC2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3ext4polyi(ptr dead_on_unwind noalias writable sret(%struct.poly) align 8, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3dftP4polyii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3mul4polyS_(ptr dead_on_unwind noalias nonnull writable sret(%struct.poly) align 8 %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.poly, align 8
  %5 = alloca %struct.poly, align 8
  %6 = alloca %struct.poly, align 8
  %7 = alloca %struct.poly, align 8
  %8 = alloca %struct.poly, align 8
  %9 = getelementptr inbounds i8, ptr %1, i64 24
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %2, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !5
  tail call void @_ZN4polyC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  invoke void @_ZN4polyC2Ev(ptr noundef nonnull align 8 dereferenceable(28) %4)
          to label %.preheader44 unwind label %20

.preheader44:                                     ; preds = %3
  %13 = add nsw i32 %12, %10
  %.not45 = icmp slt i32 %13, 1
  br i1 %.not45, label %._crit_edge, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph
  %14 = icmp sgt i32 %18, 1
  br i1 %14, label %.lr.ph51, label %._crit_edge

.lr.ph51:                                         ; preds = %.preheader
  %15 = icmp eq i32 %18, 2
  br i1 %15, label %._crit_edge.loopexit.epilog-lcssa, label %.lr.ph51.new

.lr.ph51.new:                                     ; preds = %.lr.ph51
  %wide.trip.count = zext nneg i32 %18 to i64
  %16 = shl nuw i32 1, %.03446
  %17 = add nsw i64 %wide.trip.count, -4
  br label %22

.lr.ph:                                           ; preds = %.preheader44, %.lr.ph
  %.03347 = phi i32 [ %18, %.lr.ph ], [ 1, %.preheader44 ]
  %.03446 = phi i32 [ %19, %.lr.ph ], [ 0, %.preheader44 ]
  %18 = shl i32 %.03347, 1
  %19 = add nuw nsw i32 %.03446, 1
  %.not = icmp sgt i32 %18, %13
  br i1 %.not, label %.preheader, label %.lr.ph, !llvm.loop !15

20:                                               ; preds = %3
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %81

22:                                               ; preds = %22, %.lr.ph51.new
  %indvars.iv = phi i64 [ 1, %.lr.ph51.new ], [ %indvars.iv.next.1, %22 ]
  %niter = phi i64 [ 0, %.lr.ph51.new ], [ %niter.next.1, %22 ]
  %23 = lshr i64 %indvars.iv, 1
  %24 = and i64 %23, 2147483647
  %25 = getelementptr inbounds [3456912 x i32], ptr @rv, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = ashr i32 %26, 1
  %28 = or i32 %27, %16
  %29 = getelementptr inbounds [3456912 x i32], ptr @rv, i64 0, i64 %indvars.iv
  store i32 %28, ptr %29, align 4, !tbaa !17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = lshr i64 %indvars.iv.next, 1
  %31 = and i64 %30, 2147483647
  %32 = getelementptr inbounds [3456912 x i32], ptr @rv, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !17
  %34 = ashr i32 %33, 1
  %35 = getelementptr inbounds [3456912 x i32], ptr @rv, i64 0, i64 %indvars.iv.next
  store i32 %34, ptr %35, align 4, !tbaa !17
  %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, %17
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.epilog-lcssa, label %22, !llvm.loop !18

._crit_edge.loopexit.epilog-lcssa:                ; preds = %22, %.lr.ph51
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph51 ], [ %indvars.iv.next.1, %22 ]
  %36 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %37 = lshr i64 %indvars.iv.unr, 1
  %38 = and i64 %37, 2147483647
  %39 = getelementptr inbounds [3456912 x i32], ptr @rv, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !17
  %41 = ashr i32 %40, 1
  %42 = and i32 %36, 1
  %43 = shl nuw i32 %42, %.03446
  %44 = or i32 %41, %43
  %45 = getelementptr inbounds [3456912 x i32], ptr @rv, i64 0, i64 %indvars.iv.unr
  store i32 %44, ptr %45, align 4, !tbaa !17
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %.preheader44, %.preheader
  %.033.lcssa64 = phi i32 [ %18, %.preheader ], [ 1, %.preheader44 ], [ %18, %._crit_edge.loopexit.epilog-lcssa ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  invoke void @_ZN4polyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(28) %6, ptr noundef nonnull align 8 dereferenceable(28) %1)
          to label %46 unwind label %64

46:                                               ; preds = %._crit_edge
  %47 = add nsw i32 %.033.lcssa64, -1
  invoke void @_Z3ext4polyi(ptr dead_on_unwind nonnull writable sret(%struct.poly) align 8 %5, ptr noundef nonnull %6, i32 noundef %47)
          to label %48 unwind label %66

48:                                               ; preds = %46
  %49 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN4polyaSEOS_(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef nonnull align 8 dereferenceable(28) %5) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %5) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  invoke void @_ZN4polyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(28) %8, ptr noundef nonnull align 8 dereferenceable(28) %2)
          to label %50 unwind label %69

50:                                               ; preds = %48
  invoke void @_Z3ext4polyi(ptr dead_on_unwind nonnull writable sret(%struct.poly) align 8 %7, ptr noundef nonnull %8, i32 noundef %47)
          to label %51 unwind label %71

51:                                               ; preds = %50
  %52 = call noundef nonnull align 8 dereferenceable(28) ptr @_ZN4polyaSEOS_(ptr noundef nonnull align 8 dereferenceable(28) %4, ptr noundef nonnull align 8 dereferenceable(28) %7) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %7) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @_Z3dftP4polyii(ptr noundef nonnull %0, i32 noundef 1, i32 noundef %.033.lcssa64)
  call void @_Z3dftP4polyii(ptr noundef nonnull %4, i32 noundef 1, i32 noundef %.033.lcssa64)
  %53 = icmp sgt i32 %.033.lcssa64, 0
  br i1 %53, label %.lr.ph54.preheader, label %._crit_edge55

.lr.ph54.preheader:                               ; preds = %51
  %wide.trip.count60 = zext nneg i32 %.033.lcssa64 to i64
  br label %.lr.ph54

.lr.ph54:                                         ; preds = %.lr.ph54.preheader, %.lr.ph54
  %indvars.iv57 = phi i64 [ 0, %.lr.ph54.preheader ], [ %indvars.iv.next58, %.lr.ph54 ]
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv57) #5
  %55 = load i32, ptr %54, align 4, !tbaa !17
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv57) #5
  %58 = load i32, ptr %57, align 4, !tbaa !17
  %59 = sext i32 %58 to i64
  %60 = mul nsw i64 %59, %56
  %61 = srem i64 %60, 998244353
  %62 = trunc nsw i64 %61 to i32
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv57) #5
  store i32 %62, ptr %63, align 4, !tbaa !17
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %._crit_edge55, label %.lr.ph54, !llvm.loop !19

64:                                               ; preds = %._crit_edge
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %68

66:                                               ; preds = %46
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %6) #5
  br label %68

68:                                               ; preds = %66, %64
  %.pn = phi { ptr, i32 } [ %67, %66 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %80

69:                                               ; preds = %48
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %73

71:                                               ; preds = %50
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %8) #5
  br label %73

73:                                               ; preds = %71, %69
  %.pn39 = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %80

._crit_edge55:                                    ; preds = %.lr.ph54, %51
  call void @_Z3dftP4polyii(ptr noundef nonnull %0, i32 noundef -1, i32 noundef %.033.lcssa64)
  %74 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %13, ptr %74, align 8, !tbaa !5
  %75 = add nsw i32 %13, 1
  %76 = sext i32 %75 to i64
  invoke void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %76)
          to label %77 unwind label %78

77:                                               ; preds = %._crit_edge55
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  ret void

78:                                               ; preds = %._crit_edge55
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %80

80:                                               ; preds = %78, %73, %68
  %.pn41 = phi { ptr, i32 } [ %79, %78 ], [ %.pn39, %73 ], [ %.pn, %68 ]
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %4) #5
  br label %81

81:                                               ; preds = %80, %20
  %.pn41.pn = phi { ptr, i32 } [ %.pn41, %80 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %0) #5
  resume { ptr, i32 } %.pn41.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4polyC2ERKS_(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(28)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(28) ptr @_ZN4polyaSEOS_(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #3 align 2

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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, !14, i64 24}
!6 = !{!"_ZTS4poly", !7, i64 0, !14, i64 24}
!7 = !{!"_ZTSSt6vectorIiSaIiEE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"int", !12, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!14, !14, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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