; LLVM IR from ShahjalalShohag/code-library :: Graph Theory (Number of DAG)

; 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.modint = type { i32 }
%"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" }

@dp = external dso_local global [262144 x %struct.modint], align 16
@e = external dso_local global [262144 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.modint, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.modint, align 4
  %13 = alloca %struct.modint, align 4
  %14 = alloca %struct.modint, align 4
  %15 = alloca %struct.modint, align 4
  %16 = alloca %struct.modint, align 4
  %17 = alloca %struct.modint, align 4
  store i32 0, ptr %1, align 4
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  %24 = 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)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %26

26:                                               ; preds = %54, %0
  %27 = load i32, ptr %4, align 4, !tbaa !8
  %28 = load i32, ptr %3, align 4, !tbaa !8
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %34 = load i32, ptr %5, align 4, !tbaa !8
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr %5, align 4, !tbaa !8
  %36 = load i32, ptr %6, align 4, !tbaa !8
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr %6, align 4, !tbaa !8
  %38 = load i32, ptr %6, align 4, !tbaa !8
  %39 = shl i32 1, %38
  %40 = load i32, ptr %5, align 4, !tbaa !8
  %41 = shl i32 1, %40
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = or i32 %44, %39
  store i32 %45, ptr %43, align 4, !tbaa !8
  %46 = load i32, ptr %5, align 4, !tbaa !8
  %47 = shl i32 1, %46
  %48 = load i32, ptr %6, align 4, !tbaa !8
  %49 = shl i32 1, %48
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = or i32 %52, %47
  store i32 %53, ptr %51, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %54

54:                                               ; preds = %31
  %55 = load i32, ptr %4, align 4, !tbaa !8
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %4, align 4, !tbaa !8
  br label %26, !llvm.loop !11

57:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @dp, ptr align 4 %7, i64 4, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 1, ptr %8, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %142, %57
  %59 = load i32, ptr %8, align 4, !tbaa !8
  %60 = load i32, ptr %2, align 4, !tbaa !8
  %61 = shl i32 1, %60
  %62 = icmp slt i32 %59, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %58
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %145

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

65:                                               ; preds = %88, %64
  %66 = load i32, ptr %10, align 4, !tbaa !8
  %67 = load i32, ptr %2, align 4, !tbaa !8
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %91

70:                                               ; preds = %65
  %71 = load i32, ptr %8, align 4, !tbaa !8
  %72 = load i32, ptr %10, align 4, !tbaa !8
  %73 = ashr i32 %71, %72
  %74 = and i32 %73, 1
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %87

76:                                               ; preds = %70
  %77 = load i32, ptr %10, align 4, !tbaa !8
  %78 = shl i32 1, %77
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = load i32, ptr %8, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %86 = or i32 %85, %81
  store i32 %86, ptr %84, align 4, !tbaa !8
  br label %87

87:                                               ; preds = %76, %70
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %10, align 4, !tbaa !8
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %10, align 4, !tbaa !8
  br label %65, !llvm.loop !14

91:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %92 = load i32, ptr %8, align 4, !tbaa !8
  store i32 %92, ptr %11, align 4, !tbaa !8
  br label %93

93:                                               ; preds = %136, %91
  %94 = load i32, ptr %11, align 4, !tbaa !8
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %97, label %96

96:                                               ; preds = %93
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %141

97:                                               ; preds = %93
  %98 = load i32, ptr %11, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !8
  %102 = load i32, ptr %11, align 4, !tbaa !8
  %103 = and i32 %101, %102
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %97
  br label %136

106:                                              ; preds = %97
  %107 = load i32, ptr %11, align 4, !tbaa !8
  %108 = call i32 @llvm.ctpop.i32(i32 %107)
  %109 = and i32 %108, 1
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %123

111:                                              ; preds = %106
  %112 = load i32, ptr %8, align 4, !tbaa !8
  %113 = load i32, ptr %11, align 4, !tbaa !8
  %114 = xor i32 %112, %113
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [262144 x %struct.modint], ptr @dp, i64 0, i64 %115
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %116, i64 4, i1 false), !tbaa.struct !13
  %117 = load i32, ptr %8, align 4, !tbaa !8
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [262144 x %struct.modint], ptr @dp, i64 0, i64 %118
  %120 = getelementptr inbounds %struct.modint, ptr %12, i32 0, i32 0
  %121 = load i32, ptr %120, align 4
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi998244353EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %119, i32 %121)
  br label %135

123:                                              ; preds = %106
  %124 = load i32, ptr %8, align 4, !tbaa !8
  %125 = load i32, ptr %11, align 4, !tbaa !8
  %126 = xor i32 %124, %125
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [262144 x %struct.modint], ptr @dp, i64 0, i64 %127
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %128, i64 4, i1 false), !tbaa.struct !13
  %129 = load i32, ptr %8, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [262144 x %struct.modint], ptr @dp, i64 0, i64 %130
  %132 = getelementptr inbounds %struct.modint, ptr %13, i32 0, i32 0
  %133 = load i32, ptr %132, align 4
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi998244353EEmIES0_(ptr noundef nonnull align 4 dereferenceable(4) %131, i32 %133)
  br label %135

135:                                              ; preds = %123, %111
  br label %136

136:                                              ; preds = %135, %105
  %137 = load i32, ptr %11, align 4, !tbaa !8
  %138 = sub nsw i32 %137, 1
  %139 = load i32, ptr %8, align 4, !tbaa !8
  %140 = and i32 %138, %139
  store i32 %140, ptr %11, align 4, !tbaa !8
  br label %93, !llvm.loop !15

141:                                              ; preds = %96
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %8, align 4, !tbaa !8
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %8, align 4, !tbaa !8
  br label %58, !llvm.loop !16

145:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  %146 = load i32, ptr %2, align 4, !tbaa !8
  %147 = shl i32 1, %146
  %148 = sub nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [262144 x %struct.modint], ptr @dp, i64 0, i64 %149
  %151 = load i32, ptr %3, align 4, !tbaa !8
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %16, i32 noundef %151)
  %152 = getelementptr inbounds %struct.modint, ptr %16, i32 0, i32 0
  %153 = load i32, ptr %152, align 4
  %154 = call i32 @_ZNK6modintILi998244353EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %150, i32 %153)
  %155 = getelementptr inbounds %struct.modint, ptr %15, i32 0, i32 0
  store i32 %154, ptr %155, align 4
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %17, i32 noundef 2)
  %156 = getelementptr inbounds %struct.modint, ptr %17, i32 0, i32 0
  %157 = load i32, ptr %156, align 4
  %158 = call i32 @_ZNK6modintILi998244353EEdvES0_(ptr noundef nonnull align 4 dereferenceable(4) %15, i32 %157)
  %159 = getelementptr inbounds %struct.modint, ptr %14, i32 0, i32 0
  store i32 %158, ptr %159, align 4
  %160 = getelementptr inbounds %struct.modint, ptr %14, i32 0, i32 0
  %161 = load i32, ptr %160, align 4
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZlsILi998244353EERSoS0_6modintIXT_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %161)
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %162, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  %164 = load i32, ptr %1, align 4
  ret i32 %164
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi998244353EEmIES0_(ptr noundef nonnull align 4 dereferenceable(4), i32) #6 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) #7

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

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

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

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #8 = { 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 #9 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i64 0, i64 4, !8}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.modint = type { i32 }
%"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" }

@dp = external dso_local global [262144 x %struct.modint], align 16
@e = external dso_local local_unnamed_addr global [262144 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.modint, align 4
  %6 = alloca %struct.modint, align 4
  %7 = alloca %struct.modint, align 4
  %8 = alloca %struct.modint, align 4
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %15 = 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)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %17 = load i32, ptr %2, align 4, !tbaa !8
  %.not34 = icmp slt i32 %17, 1
  br i1 %.not34, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 1)
  %18 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %18, ptr @dp, align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %19 = load i32, ptr %1, align 4, !tbaa !8
  %20 = shl nuw i32 1, %19
  %21 = icmp sgt i32 %20, 1
  br i1 %21, label %.preheader33, label %._crit_edge40

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.035 = phi i32 [ %38, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %24 = load i32, ptr %3, align 4, !tbaa !8
  %25 = add nsw i32 %24, -1
  %26 = load i32, ptr %4, align 4, !tbaa !8
  %27 = add nsw i32 %26, -1
  %28 = shl nuw i32 1, %27
  %29 = shl nuw i32 1, %25
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !8
  %33 = or i32 %32, %28
  store i32 %33, ptr %31, align 4, !tbaa !8
  %34 = sext i32 %28 to i64
  %35 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !8
  %37 = or i32 %36, %29
  store i32 %37, ptr %35, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %38 = add nuw nsw i32 %.035, 1
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %.not.not = icmp slt i32 %.035, %39
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader33:                                     ; preds = %._crit_edge, %84
  %indvars.iv = phi i64 [ %indvars.iv.next, %84 ], [ 1, %._crit_edge ]
  %40 = phi i32 [ %85, %84 ], [ %19, %._crit_edge ]
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph37, label %.preheader33..preheader_crit_edge

.preheader33..preheader_crit_edge:                ; preds = %.preheader33
  %.pre = trunc nuw nsw i64 %indvars.iv to i32
  br label %.preheader

.lr.ph37:                                         ; preds = %.preheader33
  %42 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %indvars.iv
  %43 = trunc nuw nsw i64 %indvars.iv to i32
  %xtraiter = and i32 %40, 1
  %44 = icmp eq i32 %40, 1
  br i1 %44, label %.preheader.loopexit.unr-lcssa, label %.lr.ph37.new

.lr.ph37.new:                                     ; preds = %.lr.ph37
  %unroll_iter = and i32 %40, 2147483646
  br label %64

._crit_edge40:                                    ; preds = %84, %._crit_edge
  %.lcssa = phi i32 [ %19, %._crit_edge ], [ %85, %84 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %notmask = shl nsw i32 -1, %.lcssa
  %45 = xor i32 %notmask, -1
  %46 = zext nneg i32 %45 to i64
  %47 = getelementptr inbounds [262144 x %struct.modint], ptr @dp, i64 0, i64 %46
  %48 = load i32, ptr %2, align 4, !tbaa !8
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef %48)
  %49 = load i32, ptr %7, align 4
  %50 = call i32 @_ZNK6modintILi998244353EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %47, i32 %49)
  store i32 %50, ptr %6, align 4
  call void @_ZN6modintILi998244353EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 2)
  %51 = load i32, ptr %8, align 4
  %52 = call i32 @_ZNK6modintILi998244353EEdvES0_(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 %51)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZlsILi998244353EERSoS0_6modintIXT_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 %52)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %53, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

.preheader.loopexit.unr-lcssa:                    ; preds = %82, %.lr.ph37
  %.02836.unr = phi i32 [ 0, %.lr.ph37 ], [ %83, %82 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader.loopexit.unr-lcssa
  %55 = shl nuw i32 1, %.02836.unr
  %56 = and i32 %55, %43
  %.not32.epil = icmp eq i32 %56, 0
  br i1 %.not32.epil, label %.preheader, label %57

57:                                               ; preds = %.epil.preheader
  %58 = sext i32 %55 to i64
  %59 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = load i32, ptr %42, align 4, !tbaa !8
  %62 = or i32 %61, %60
  store i32 %62, ptr %42, align 4, !tbaa !8
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit.unr-lcssa, %57, %.epil.preheader, %.preheader33..preheader_crit_edge
  %.pre-phi = phi i32 [ %.pre, %.preheader33..preheader_crit_edge ], [ %43, %.epil.preheader ], [ %43, %57 ], [ %43, %.preheader.loopexit.unr-lcssa ]
  %63 = getelementptr inbounds [262144 x %struct.modint], ptr @dp, i64 0, i64 %indvars.iv
  br label %89

64:                                               ; preds = %82, %.lr.ph37.new
  %.02836 = phi i32 [ 0, %.lr.ph37.new ], [ %83, %82 ]
  %niter = phi i32 [ 0, %.lr.ph37.new ], [ %niter.next.1, %82 ]
  %65 = shl nuw i32 1, %.02836
  %66 = and i32 %65, %43
  %.not32 = icmp eq i32 %66, 0
  br i1 %.not32, label %73, label %67

67:                                               ; preds = %64
  %68 = zext nneg i32 %65 to i64
  %69 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !8
  %71 = load i32, ptr %42, align 4, !tbaa !8
  %72 = or i32 %71, %70
  store i32 %72, ptr %42, align 4, !tbaa !8
  br label %73

73:                                               ; preds = %64, %67
  %74 = shl nuw i32 2, %.02836
  %75 = and i32 %74, %43
  %.not32.1 = icmp eq i32 %75, 0
  br i1 %.not32.1, label %82, label %76

76:                                               ; preds = %73
  %77 = sext i32 %74 to i64
  %78 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %77
  %79 = load i32, ptr %78, align 8, !tbaa !8
  %80 = load i32, ptr %42, align 4, !tbaa !8
  %81 = or i32 %80, %79
  store i32 %81, ptr %42, align 4, !tbaa !8
  br label %82

82:                                               ; preds = %76, %73
  %83 = add nuw nsw i32 %.02836, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %64, !llvm.loop !13

84:                                               ; preds = %104
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %85 = load i32, ptr %1, align 4, !tbaa !8
  %86 = shl nuw i32 1, %85
  %87 = sext i32 %86 to i64
  %88 = icmp slt i64 %indvars.iv.next, %87
  br i1 %88, label %.preheader33, label %._crit_edge40, !llvm.loop !14

89:                                               ; preds = %.preheader, %104
  %.02738 = phi i32 [ %.pre-phi, %.preheader ], [ %106, %104 ]
  %90 = sext i32 %.02738 to i64
  %91 = getelementptr inbounds [262144 x i32], ptr @e, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !8
  %93 = and i32 %92, %.02738
  %.not30 = icmp eq i32 %93, 0
  br i1 %.not30, label %94, label %104

94:                                               ; preds = %89
  %95 = call range(i32 0, 33) i32 @llvm.ctpop.i32(i32 %.02738)
  %96 = and i32 %95, 1
  %.not31 = icmp eq i32 %96, 0
  %97 = xor i32 %.02738, %.pre-phi
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [262144 x %struct.modint], ptr @dp, i64 0, i64 %98
  %.sroa.01.0.copyload = load i32, ptr %99, align 4, !tbaa !8
  br i1 %.not31, label %102, label %100

100:                                              ; preds = %94
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi998244353EEpLES0_(ptr noundef nonnull align 4 dereferenceable(4) %63, i32 %.sroa.01.0.copyload)
  br label %104

102:                                              ; preds = %94
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi998244353EEmIES0_(ptr noundef nonnull align 4 dereferenceable(4) %63, i32 %.sroa.01.0.copyload)
  br label %104

104:                                              ; preds = %100, %102, %89
  %105 = add nuw i32 %.02738, 2147483647
  %106 = and i32 %105, %.pre-phi
  %.not29 = icmp eq i32 %106, 0
  br i1 %.not29, label %84, label %89, !llvm.loop !15
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6modintILi998244353EEmIES0_(ptr noundef nonnull align 4 dereferenceable(4), i32) local_unnamed_addr #5 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 #6

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

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

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

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


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