; LLVM IR from ShahjalalShohag/code-library :: Math (Lagrange Interpolation with Polynomial Extraction)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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.modint = type { i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", 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 @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI6modintILi1000000007EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8LagrangeRSt6vectorI6modintILi1000000007EESaIS1_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.6") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector.6", align 8
  %5 = alloca %struct.modint, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.modint, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.modint, align 4
  %11 = alloca %struct.modint, align 4
  %12 = alloca %"class.std::vector.6", align 8
  %13 = alloca %struct.modint, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.modint, align 4
  %16 = alloca %struct.modint, align 4
  %17 = alloca %struct.modint, align 4
  %18 = alloca %struct.modint, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #8
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  invoke void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 0)
          to label %21 unwind label %30

21:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  invoke void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 0)
          to label %22 unwind label %34

22:                                               ; preds = %21
  invoke void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %23 unwind label %34

23:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %51, %23
  %25 = load i32, ptr %9, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  %28 = icmp sle i32 %25, %27
  br i1 %28, label %38, label %29

29:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %63

30:                                               ; preds = %0
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %6, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %7, align 4
  br label %117

34:                                               ; preds = %22, %21
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %6, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %117

38:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %39 = load i32, ptr %9, align 4, !tbaa !5
  invoke void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %39)
          to label %40 unwind label %54

40:                                               ; preds = %38
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = invoke i32 @_ZNK6modintILi1000000007EE3powEm(ptr noundef nonnull align 4 dereferenceable(4) %11, i64 noundef %42)
          to label %44 unwind label %54

44:                                               ; preds = %40
  %45 = getelementptr inbounds %struct.modint, ptr %10, i32 0, i32 0
  store i32 %43, ptr %45, align 4
  %46 = getelementptr inbounds %struct.modint, ptr %10, i32 0, i32 0
  %47 = load i32, ptr %46, align 4
  %48 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 %47)
          to label %49 unwind label %54

49:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  invoke void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %50 unwind label %58

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %9, align 4, !tbaa !5
  br label %24, !llvm.loop !9

54:                                               ; preds = %44, %40, %38
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %6, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %62

58:                                               ; preds = %49
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %6, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %7, align 4
  br label %62

62:                                               ; preds = %58, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %117

63:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #8
  invoke void @_Z8LagrangeRSt6vectorI6modintILi1000000007EESaIS1_EE(ptr dead_on_unwind writable sret(%"class.std::vector.6") align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %64 unwind label %72

64:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  invoke void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %13, i32 noundef 0)
          to label %65 unwind label %76

65:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %100, %65
  %67 = load i32, ptr %14, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = call noundef i64 @_ZNKSt6vectorI6modintILi1000000007EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  %70 = icmp ult i64 %68, %69
  br i1 %70, label %80, label %71

71:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %107

72:                                               ; preds = %63
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %6, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %7, align 4
  br label %116

76:                                               ; preds = %111, %107, %64
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %6, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %7, align 4
  br label %115

80:                                               ; preds = %66
  %81 = load i32, ptr %14, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %82) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %84 = load i32, ptr %2, align 4, !tbaa !5
  invoke void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %17, i32 noundef %84)
          to label %85 unwind label %103

85:                                               ; preds = %80
  %86 = load i32, ptr %14, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = invoke i32 @_ZNK6modintILi1000000007EE3powEm(ptr noundef nonnull align 4 dereferenceable(4) %17, i64 noundef %87)
          to label %89 unwind label %103

89:                                               ; preds = %85
  %90 = getelementptr inbounds %struct.modint, ptr %16, i32 0, i32 0
  store i32 %88, ptr %90, align 4
  %91 = getelementptr inbounds %struct.modint, ptr %16, i32 0, i32 0
  %92 = load i32, ptr %91, align 4
  %93 = invoke i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %83, i32 %92)
          to label %94 unwind label %103

94:                                               ; preds = %89
  %95 = getelementptr inbounds %struct.modint, ptr %15, i32 0, i32 0
  store i32 %93, ptr %95, align 4
  %96 = getelementptr inbounds %struct.modint, ptr %15, i32 0, i32 0
  %97 = load i32, ptr %96, align 4
  %98 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %13, i32 %97)
          to label %99 unwind label %103

99:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %14, align 4, !tbaa !5
  br label %66, !llvm.loop !11

103:                                              ; preds = %94, %89, %85, %80
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %6, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %115

107:                                              ; preds = %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %13, i64 4, i1 false), !tbaa.struct !12
  %108 = getelementptr inbounds %struct.modint, ptr %18, i32 0, i32 0
  %109 = load i32, ptr %108, align 4
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZlsILi1000000007EERSoS0_6modintIXT_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %109)
          to label %111 unwind label %76

111:                                              ; preds = %107
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %110, i8 noundef signext 10)
          to label %113 unwind label %76

113:                                              ; preds = %111
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %114 = load i32, ptr %1, align 4
  ret i32 %114

115:                                              ; preds = %103, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  br label %116

116:                                              ; preds = %115, %72
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #8
  br label %117

117:                                              ; preds = %116, %62, %34, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %6, align 8
  %120 = load i32, ptr %7, align 4
  %121 = insertvalue { ptr, i32 } poison, ptr %119, 0
  %122 = insertvalue { ptr, i32 } %121, i32 %120, 1
  resume { ptr, i32 } %122
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

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

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 = { 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 = { mustprogress norecurse 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 = { "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 #7 = { 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 #8 = { 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}
!12 = !{i64 0, i64 4, !5}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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.modint = type { i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", 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 @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI6modintILi1000000007EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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: inlinehint mustprogress uwtable
declare dso_local i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4), i32) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8LagrangeRSt6vectorI6modintILi1000000007EESaIS1_EE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.6") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector.6", align 8
  %4 = alloca %struct.modint, align 4
  %5 = alloca %struct.modint, align 4
  %6 = alloca %struct.modint, align 4
  %7 = alloca %"class.std::vector.6", align 8
  %8 = alloca %struct.modint, align 4
  %9 = alloca %struct.modint, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 0)
  invoke void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %12 unwind label %14

12:                                               ; preds = %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %.not24 = icmp slt i32 %13, 0
  br i1 %.not24, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %21, %12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  invoke void @_Z8LagrangeRSt6vectorI6modintILi1000000007EESaIS1_EE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.6") align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %28 unwind label %31

14:                                               ; preds = %0
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %51

.lr.ph:                                           ; preds = %12, %21
  %.01725 = phi i32 [ %22, %21 ], [ 1, %12 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef %.01725)
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = invoke i32 @_ZNK6modintILi1000000007EE3powEm(ptr noundef nonnull align 4 dereferenceable(4) %6, i64 noundef %17)
          to label %19 unwind label %24

19:                                               ; preds = %.lr.ph
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 %18)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  invoke void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %21 unwind label %26

21:                                               ; preds = %19
  %22 = add nuw nsw i32 %.01725, 1
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %.not = icmp sgt i32 %.01725, %23
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

24:                                               ; preds = %.lr.ph
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %51

26:                                               ; preds = %19
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %51

28:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 0)
  %29 = call noundef i64 @_ZNKSt6vectorI6modintILi1000000007EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %.not30 = icmp eq i64 %29, 0
  br i1 %.not30, label %._crit_edge29, label %.lr.ph28

._crit_edge29:                                    ; preds = %40, %28
  %.sroa.0.0.copyload = load i32, ptr %8, align 4, !tbaa !5
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZlsILi1000000007EERSoS0_6modintIXT_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %.sroa.0.0.copyload)
          to label %46 unwind label %33

31:                                               ; preds = %._crit_edge
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %50

33:                                               ; preds = %46, %._crit_edge29
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %49

.lr.ph28:                                         ; preds = %28, %40
  %indvars.iv = phi i64 [ %indvars.iv.next, %40 ], [ 0, %28 ]
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorI6modintILi1000000007EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %36 = load i32, ptr %1, align 4, !tbaa !5
  call void @_ZN6modintILi1000000007EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %9, i32 noundef %36)
  %37 = invoke i32 @_ZNK6modintILi1000000007EE3powEm(ptr noundef nonnull align 4 dereferenceable(4) %9, i64 noundef %indvars.iv)
          to label %38 unwind label %44

38:                                               ; preds = %.lr.ph28
  %39 = invoke i32 @_ZNK6modintILi1000000007EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %35, i32 %37)
          to label %40 unwind label %44

40:                                               ; preds = %38
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi1000000007EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 %39)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = call noundef i64 @_ZNKSt6vectorI6modintILi1000000007EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %43 = icmp ugt i64 %42, %indvars.iv.next
  br i1 %43, label %.lr.ph28, label %._crit_edge29, !llvm.loop !11

44:                                               ; preds = %38, %.lr.ph28
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %49

46:                                               ; preds = %._crit_edge29
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %30, i8 noundef signext 10)
          to label %48 unwind label %33

48:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

49:                                               ; preds = %44, %33
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %50

50:                                               ; preds = %49, %31
  %.pn.pn = phi { ptr, i32 } [ %.pn, %49 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %51

51:                                               ; preds = %24, %26, %50, %14
  %.pn21.pn = phi { ptr, i32 } [ %.pn.pn, %50 ], [ %15, %14 ], [ %27, %26 ], [ %25, %24 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @_ZNSt6vectorI6modintILi1000000007EESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn21.pn
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZlsILi1000000007EERSoS0_6modintIXT_EE(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #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 = { 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 #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 = { mustprogress norecurse 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 = { "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 = { 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 #7 = { 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,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass