; LLVM IR from atcoder/ac-library :: test/example (lazyseg_practice1)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<S, std::allocator<S>>::_Vector_impl" }
%"struct.std::_Vector_base<S, std::allocator<S>>::_Vector_impl" = type { %"struct.std::_Vector_base<S, std::allocator<S>>::_Vector_impl_data" }
%"struct.std::_Vector_base<S, std::allocator<S>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%struct.S = type { %"struct.atcoder::static_modint", i32 }
%"struct.atcoder::static_modint" = type { i32 }
%"struct.atcoder::lazy_segtree" = type { i32, i32, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<F, std::allocator<F>>::_Vector_impl" }
%"struct.std::_Vector_base<F, std::allocator<F>>::_Vector_impl" = type { %"struct.std::_Vector_base<F, std::allocator<F>>::_Vector_impl_data" }
%"struct.std::_Vector_base<F, std::allocator<F>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.F = type { %"struct.atcoder::static_modint", %"struct.atcoder::static_modint" }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 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", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.S, align 4
  %11 = alloca %"struct.atcoder::lazy_segtree", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.F, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %struct.S, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #7
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  call void @_ZNSaI1SEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorI1SSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %25 unwind label %31

25:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI1SED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %45, %25
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %35, label %30

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

31:                                               ; preds = %0
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %6, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %7, align 4
  call void @_ZNSt15__new_allocatorI1SED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  br label %124

35:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %36 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %9)
          to label %37 unwind label %48

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %38 = getelementptr inbounds %struct.S, ptr %10, i32 0, i32 0
  %39 = load i32, ptr %9, align 4, !tbaa !5
  invoke void @_ZN7atcoder13static_modintILi998244353ELPv0EEC2IiTnPNSt9enable_ifIXsr13is_signed_intIT_EE5valueEvE4typeELS1_0EEES5_(ptr noundef nonnull align 4 dereferenceable(4) %38, i32 noundef %39)
          to label %40 unwind label %52

40:                                               ; preds = %37
  %41 = getelementptr inbounds %struct.S, ptr %10, i32 0, i32 1
  store i32 1, ptr %41, align 4, !tbaa !9
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI1SSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %43) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 4 %10, i64 8, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %45

45:                                               ; preds = %40
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %8, align 4, !tbaa !5
  br label %26, !llvm.loop !12

48:                                               ; preds = %35
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %6, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %7, align 4
  br label %56

52:                                               ; preds = %37
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %6, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %56

56:                                               ; preds = %52, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %123

57:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #7
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEEC2ERKSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(64) %11, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %58 unwind label %64

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %116, %58
  %60 = load i32, ptr %12, align 4, !tbaa !5
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %68, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %120

64:                                               ; preds = %57
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %6, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %7, align 4
  br label %122

68:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %69 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %13)
          to label %70 unwind label %86

70:                                               ; preds = %68
  %71 = load i32, ptr %13, align 4, !tbaa !5
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %94

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %74 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17)
          to label %75 unwind label %90

75:                                               ; preds = %73
  %76 = load i32, ptr %14, align 4, !tbaa !5
  %77 = load i32, ptr %15, align 4, !tbaa !5
  %78 = getelementptr inbounds %struct.F, ptr %18, i32 0, i32 0
  %79 = load i32, ptr %16, align 4, !tbaa !5
  invoke void @_ZN7atcoder13static_modintILi998244353ELPv0EEC2IiTnPNSt9enable_ifIXsr13is_signed_intIT_EE5valueEvE4typeELS1_0EEES5_(ptr noundef nonnull align 4 dereferenceable(4) %78, i32 noundef %79)
          to label %80 unwind label %90

80:                                               ; preds = %75
  %81 = getelementptr inbounds %struct.F, ptr %18, i32 0, i32 1
  %82 = load i32, ptr %17, align 4, !tbaa !5
  invoke void @_ZN7atcoder13static_modintILi998244353ELPv0EEC2IiTnPNSt9enable_ifIXsr13is_signed_intIT_EE5valueEvE4typeELS1_0EEES5_(ptr noundef nonnull align 4 dereferenceable(4) %81, i32 noundef %82)
          to label %83 unwind label %90

83:                                               ; preds = %80
  %84 = load i64, ptr %18, align 4
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEE5applyEiiS2_(ptr noundef nonnull align 8 dereferenceable(64) %11, i32 noundef %76, i32 noundef %77, i64 %84)
          to label %85 unwind label %90

85:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %115

86:                                               ; preds = %68
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %6, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %7, align 4
  br label %119

90:                                               ; preds = %83, %80, %75, %73
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %6, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %119

94:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %95 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %19, ptr noundef %20)
          to label %96 unwind label %106

96:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %97 = load i32, ptr %19, align 4, !tbaa !5
  %98 = load i32, ptr %20, align 4, !tbaa !5
  %99 = invoke i64 @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEE4prodEii(ptr noundef nonnull align 8 dereferenceable(64) %11, i32 noundef %97, i32 noundef %98)
          to label %100 unwind label %110

100:                                              ; preds = %96
  store i64 %99, ptr %21, align 4
  %101 = getelementptr inbounds %struct.S, ptr %21, i32 0, i32 0
  %102 = invoke noundef i32 @_ZNK7atcoder13static_modintILi998244353ELPv0EE3valEv(ptr noundef nonnull align 4 dereferenceable(4) %101)
          to label %103 unwind label %110

103:                                              ; preds = %100
  %104 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %102)
          to label %105 unwind label %110

105:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %115

106:                                              ; preds = %94
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %6, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %7, align 4
  br label %114

110:                                              ; preds = %103, %100, %96
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %6, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %114

114:                                              ; preds = %110, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %119

115:                                              ; preds = %105, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %12, align 4, !tbaa !5
  br label %59, !llvm.loop !14

119:                                              ; preds = %114, %90, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %11) #7
  br label %122

120:                                              ; preds = %63
  call void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %11) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #7
  call void @_ZNSt6vectorI1SSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %121 = load i32, ptr %1, align 4
  ret i32 %121

122:                                              ; preds = %119, %64
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #7
  br label %123

123:                                              ; preds = %122, %56
  call void @_ZNSt6vectorI1SSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %124

124:                                              ; preds = %123, %31
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %6, align 8
  %127 = load i32, ptr %7, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI1SSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 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) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEE5applyEiiS2_(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef, i64) #4 align 2

declare i32 @printf(ptr noundef, ...) #3

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

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

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

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

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

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


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<S, std::allocator<S>>::_Vector_impl" }
%"struct.std::_Vector_base<S, std::allocator<S>>::_Vector_impl" = type { %"struct.std::_Vector_base<S, std::allocator<S>>::_Vector_impl_data" }
%"struct.std::_Vector_base<S, std::allocator<S>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%struct.S = type { %"struct.atcoder::static_modint", i32 }
%"struct.atcoder::static_modint" = type { i32 }
%"struct.atcoder::lazy_segtree" = type { i32, i32, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<F, std::allocator<F>>::_Vector_impl" }
%"struct.std::_Vector_base<F, std::allocator<F>>::_Vector_impl" = type { %"struct.std::_Vector_base<F, std::allocator<F>>::_Vector_impl_data" }
%"struct.std::_Vector_base<F, std::allocator<F>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.F = type { %"struct.atcoder::static_modint", %"struct.atcoder::static_modint" }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca i32, align 4
  %6 = alloca %struct.S, align 8
  %7 = alloca %"struct.atcoder::lazy_segtree", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.F, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.S, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaI1SEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorI1SSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %20 unwind label %27

20:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI1SED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %20
  %23 = getelementptr inbounds i8, ptr %6, i64 4
  br label %29

._crit_edge:                                      ; preds = %29, %20
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #6
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEEC2ERKSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(64) %7, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %.preheader unwind label %37

.preheader:                                       ; preds = %._crit_edge
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph17, label %._crit_edge18

.lr.ph17:                                         ; preds = %.preheader
  %26 = getelementptr inbounds i8, ptr %13, i64 4
  br label %39

27:                                               ; preds = %0
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI1SED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %69

29:                                               ; preds = %.lr.ph, %29
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %29 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %31 = load i32, ptr %5, align 4, !tbaa !5
  call void @_ZN7atcoder13static_modintILi998244353ELPv0EEC2IiTnPNSt9enable_ifIXsr13is_signed_intIT_EE5valueEvE4typeELS1_0EEES5_(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef %31)
  store i32 1, ptr %23, align 4, !tbaa !9
  %32 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI1SSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #6
  %33 = load i64, ptr %6, align 8
  store i64 %33, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %29, label %._crit_edge, !llvm.loop !12

._crit_edge18:                                    ; preds = %63, %.preheader
  call void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %7) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #6
  call void @_ZNSt6vectorI1SSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

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

39:                                               ; preds = %.lr.ph17, %63
  %.016 = phi i32 [ 0, %.lr.ph17 ], [ %64, %63 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %8)
  %41 = load i32, ptr %8, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %53

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = load i32, ptr %10, align 4, !tbaa !5
  %47 = load i32, ptr %11, align 4, !tbaa !5
  call void @_ZN7atcoder13static_modintILi998244353ELPv0EEC2IiTnPNSt9enable_ifIXsr13is_signed_intIT_EE5valueEvE4typeELS1_0EEES5_(ptr noundef nonnull align 4 dereferenceable(4) %13, i32 noundef %47)
  %48 = load i32, ptr %12, align 4, !tbaa !5
  call void @_ZN7atcoder13static_modintILi998244353ELPv0EEC2IiTnPNSt9enable_ifIXsr13is_signed_intIT_EE5valueEvE4typeELS1_0EEES5_(ptr noundef nonnull align 4 dereferenceable(4) %26, i32 noundef %48)
  %49 = load i64, ptr %13, align 8
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEE5applyEiiS2_(ptr noundef nonnull align 8 dereferenceable(64) %7, i32 noundef %45, i32 noundef %46, i64 %49)
          to label %50 unwind label %51

50:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %63

51:                                               ; preds = %43
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %67

53:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #6
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %14, ptr noundef nonnull %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %55 = load i32, ptr %14, align 4, !tbaa !5
  %56 = load i32, ptr %15, align 4, !tbaa !5
  %57 = invoke i64 @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEE4prodEii(ptr noundef nonnull align 8 dereferenceable(64) %7, i32 noundef %55, i32 noundef %56)
          to label %58 unwind label %61

58:                                               ; preds = %53
  store i64 %57, ptr %16, align 8
  %59 = call noundef i32 @_ZNK7atcoder13static_modintILi998244353ELPv0EE3valEv(ptr noundef nonnull align 4 dereferenceable(4) %16)
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %59)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  br label %63

61:                                               ; preds = %53
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  br label %67

63:                                               ; preds = %58, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %64 = add nuw nsw i32 %.016, 1
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %39, label %._crit_edge18, !llvm.loop !14

67:                                               ; preds = %61, %51
  %.pn = phi { ptr, i32 } [ %52, %51 ], [ %62, %61 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEE1FXadL_Z7mappingS2_S1_EEXadL_Z11compositionS2_S2_EEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %7) #6
  br label %68

68:                                               ; preds = %67, %37
  %.pn.pn = phi { ptr, i32 } [ %.pn, %67 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #6
  call void @_ZNSt6vectorI1SSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %69

69:                                               ; preds = %68, %27
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %68 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI1SED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 = { 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 #3 = { nofree nounwind "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 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 = { nounwind }

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

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


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