; LLVM IR from ShahjalalShohag/code-library :: Math/Faulhaber Formula Fastest.ll (Z9faulhaberii)

; 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.combi = type { i32, %"class.std::vector.6", %"class.std::vector.6", %"class.std::vector.6" }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<modint<1000000007>, std::allocator<modint<1000000007>>>::_Vector_impl" }
%"struct.std::_Vector_base<modint<1000000007>, std::allocator<modint<1000000007>>>::_Vector_impl" = type { %"struct.std::_Vector_base<modint<1000000007>, std::allocator<modint<1000000007>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<modint<1000000007>, std::allocator<modint<1000000007>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.poly = type { %"class.std::vector.6" }
%struct.modint = type { i32 }

@C = external dso_local global %struct.combi, align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4polyC2IJiEEEDpT_(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) unnamed_addr #4 align 2

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

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

24:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  invoke void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef 1)
          to label %25 unwind label %36

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %60, %25
  %27 = load i32, ptr %12, align 4, !tbaa !5
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  %30 = icmp sle i32 %27, %29
  br i1 %30, label %40, label %31

31:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %67

32:                                               ; preds = %3
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %9, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %10, align 4
  br label %109

36:                                               ; preds = %69, %67, %24
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %9, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %10, align 4
  br label %108

40:                                               ; preds = %26
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  invoke void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %13, i32 noundef %42)
          to label %43 unwind label %63

43:                                               ; preds = %40
  %44 = getelementptr inbounds %struct.modint, ptr %13, i32 0, i32 0
  %45 = load i32, ptr %44, align 4
  %46 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmLES0_(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 %45)
          to label %47 unwind label %63

47:                                               ; preds = %43
  %48 = load i32, ptr %12, align 4, !tbaa !5
  %49 = invoke i32 @_ZN5combi3invEi(ptr noundef nonnull align 8 dereferenceable(80) @C, i32 noundef %48)
          to label %50 unwind label %63

50:                                               ; preds = %47
  %51 = getelementptr inbounds %struct.modint, ptr %14, i32 0, i32 0
  store i32 %49, ptr %51, align 4
  %52 = getelementptr inbounds %struct.modint, ptr %14, i32 0, i32 0
  %53 = load i32, ptr %52, align 4
  %54 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmLES0_(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 %53)
          to label %55 unwind label %63

55:                                               ; preds = %50
  %56 = getelementptr inbounds %struct.poly, ptr %8, i32 0, i32 0
  %57 = load i32, ptr %12, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %59, ptr align 4 %11, i64 4, i1 false), !tbaa.struct !9
  br label %60

60:                                               ; preds = %55
  %61 = load i32, ptr %12, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %12, align 4, !tbaa !5
  br label %26, !llvm.loop !10

63:                                               ; preds = %50, %47, %43, %40
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %9, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %108

67:                                               ; preds = %31
  %68 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN4polymLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %69 unwind label %36

69:                                               ; preds = %67
  store i1 false, ptr %15, align 1
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  invoke void @_ZN4polyC2IJiEEEDpT_(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %71)
          to label %72 unwind label %36

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %97, %72
  %74 = load i32, ptr %16, align 4, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = icmp sle i32 %74, %75
  br i1 %76, label %78, label %77

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

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %79 = load i32, ptr %16, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  %81 = invoke i32 @_ZNK4polyixEi(ptr noundef nonnull align 8 dereferenceable(24) %8, i32 noundef %80)
          to label %82 unwind label %100

82:                                               ; preds = %78
  %83 = getelementptr inbounds %struct.modint, ptr %18, i32 0, i32 0
  store i32 %81, ptr %83, align 4
  %84 = load i32, ptr %16, align 4, !tbaa !5
  %85 = invoke i32 @_ZN5combi4factEi(ptr noundef nonnull align 8 dereferenceable(80) @C, i32 noundef %84)
          to label %86 unwind label %100

86:                                               ; preds = %82
  %87 = getelementptr inbounds %struct.modint, ptr %19, i32 0, i32 0
  store i32 %85, ptr %87, align 4
  %88 = getelementptr inbounds %struct.modint, ptr %19, i32 0, i32 0
  %89 = load i32, ptr %88, align 4
  %90 = invoke i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 %89)
          to label %91 unwind label %100

91:                                               ; preds = %86
  %92 = getelementptr inbounds %struct.modint, ptr %17, i32 0, i32 0
  store i32 %90, ptr %92, align 4
  %93 = getelementptr inbounds %struct.poly, ptr %0, i32 0, i32 0
  %94 = load i32, ptr %16, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %95) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %96, ptr align 4 %17, i64 4, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %97

97:                                               ; preds = %91
  %98 = load i32, ptr %16, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %16, align 4, !tbaa !5
  br label %73, !llvm.loop !12

100:                                              ; preds = %86, %82, %78
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %9, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %108

104:                                              ; preds = %77
  store i1 true, ptr %15, align 1
  %105 = load i1, ptr %15, align 1
  br i1 %105, label %107, label %106

106:                                              ; preds = %104
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %107

107:                                              ; preds = %106, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  ret void

108:                                              ; preds = %100, %63, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  br label %109

109:                                              ; preds = %108, %32
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %9, align 8
  %112 = load i32, ptr %10, align 4
  %113 = insertvalue { ptr, i32 } poison, ptr %111, 0
  %114 = insertvalue { ptr, i32 } %113, i32 %112, 1
  resume { ptr, i32 } %114
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZN5combi3invEi(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZN5combi4factEi(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) #3 align 2

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


; 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.combi = type { i32, %"class.std::vector.6", %"class.std::vector.6", %"class.std::vector.6" }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<modint<1000000007>, std::allocator<modint<1000000007>>>::_Vector_impl" }
%"struct.std::_Vector_base<modint<1000000007>, std::allocator<modint<1000000007>>>::_Vector_impl" = type { %"struct.std::_Vector_base<modint<1000000007>, std::allocator<modint<1000000007>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<modint<1000000007>, std::allocator<modint<1000000007>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.poly = type { %"class.std::vector.6" }
%struct.modint = type { i32 }

@C = external dso_local global %struct.combi, align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4polyC2IJiEEEDpT_(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9faulhaberii(ptr dead_on_unwind noalias writable sret(%struct.poly) align 8 %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.poly, align 8
  %5 = alloca %struct.poly, align 8
  %6 = alloca %struct.modint, align 4
  %7 = alloca %struct.modint, align 4
  %8 = alloca %struct.modint, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %9 = add i32 %2, 2
  call void @_Z9Bernoullii(ptr dead_on_unwind nonnull writable sret(%struct.poly) align 8 %4, i32 noundef %9)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  invoke void @_ZN4polyC2IJiEEEDpT_(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %9)
          to label %10 unwind label %14

10:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef 1)
  %11 = add i32 %2, 1
  %.not27 = icmp slt i32 %2, 0
  br i1 %.not27, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %10
  %12 = add nsw i32 %1, 1
  %wide.trip.count = zext i32 %9 to i64
  br label %18

._crit_edge:                                      ; preds = %18, %10
  %13 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN4polymLERKS_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %26 unwind label %16

14:                                               ; preds = %3
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %38

16:                                               ; preds = %26, %._crit_edge
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %37

18:                                               ; preds = %.lr.ph, %18
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %18 ]
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef %12)
  %19 = load i32, ptr %7, align 4
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmLES0_(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 %19)
  %21 = trunc nuw nsw i64 %indvars.iv to i32
  %22 = call i32 @_ZN5combi3invEi(ptr noundef nonnull align 8 dereferenceable(80) @C, i32 noundef %21)
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEmLES0_(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 %22)
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #5
  %25 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %25, ptr %24, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond, label %._crit_edge, label %18, !llvm.loop !9

26:                                               ; preds = %._crit_edge
  invoke void @_ZN4polyC2IJiEEEDpT_(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %11)
          to label %.preheader unwind label %16

.preheader:                                       ; preds = %26
  br i1 %.not27, label %._crit_edge32, label %.lr.ph31.preheader

.lr.ph31.preheader:                               ; preds = %.preheader
  %wide.trip.count37 = zext i32 %11 to i64
  br label %.lr.ph31

.lr.ph31:                                         ; preds = %.lr.ph31.preheader, %33
  %indvars.iv34 = phi i64 [ 0, %.lr.ph31.preheader ], [ %indvars.iv.next35, %33 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
  %27 = trunc nuw nsw i64 %indvars.iv.next35 to i32
  %28 = invoke i32 @_ZNK4polyixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %27)
          to label %29 unwind label %35

29:                                               ; preds = %.lr.ph31
  store i32 %28, ptr %8, align 4
  %30 = trunc nuw nsw i64 %indvars.iv34 to i32
  %31 = call i32 @_ZN5combi4factEi(ptr noundef nonnull align 8 dereferenceable(80) @C, i32 noundef %30)
  %32 = invoke i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 %31)
          to label %33 unwind label %35

33:                                               ; preds = %29
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv34) #5
  store i32 %32, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %exitcond38.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count37
  br i1 %exitcond38.not, label %._crit_edge32, label %.lr.ph31, !llvm.loop !11

35:                                               ; preds = %29, %.lr.ph31
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %37

._crit_edge32:                                    ; preds = %33, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret void

37:                                               ; preds = %35, %16
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %17, %16 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %38

38:                                               ; preds = %37, %14
  %.pn.pn = phi { ptr, i32 } [ %.pn, %37 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN4polyD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZN5combi3invEi(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN4polymLERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK4polyixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZN5combi4factEi(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) local_unnamed_addr #2 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


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