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

; 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 { i64, i64, i64 }
%"struct.atcoder::lazy_segtree" = type { i32, i32, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>

@.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 [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 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: 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 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 8
  %11 = alloca %struct.S, align 8
  %12 = alloca %"struct.atcoder::lazy_segtree", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.S, align 8
  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
  %18 = 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
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 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 %20, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %21 unwind label %27

21:                                               ; 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 %22

22:                                               ; preds = %55, %21
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %31, label %26

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

27:                                               ; preds = %0
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %6, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, 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 %105

31:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %32 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %9)
          to label %33 unwind label %43

33:                                               ; preds = %31
  %34 = load i32, ptr %9, align 4, !tbaa !5
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %47

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

43:                                               ; preds = %31
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %6, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %104

47:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #7
  %48 = getelementptr inbounds %struct.S, ptr %11, i32 0, i32 0
  store i64 0, ptr %48, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.S, ptr %11, i32 0, i32 1
  store i64 1, ptr %49, align 8, !tbaa !12
  %50 = getelementptr inbounds %struct.S, ptr %11, i32 0, i32 2
  store i64 0, ptr %50, align 8, !tbaa !13
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI1SSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %52) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %53, ptr align 8 %11, i64 24, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  br label %54

54:                                               ; preds = %47, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %8, align 4, !tbaa !5
  br label %22, !llvm.loop !16

58:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 80, ptr %12) #7
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEEC2ERKSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(80) %12, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %59 unwind label %65

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

60:                                               ; preds = %97, %59
  %61 = load i32, ptr %13, align 4, !tbaa !5
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %69, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %101

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

69:                                               ; preds = %60
  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
  %70 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %14, ptr noundef %15, ptr noundef %16)
          to label %71 unwind label %80

71:                                               ; preds = %69
  %72 = load i32, ptr %15, align 4, !tbaa !5
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %15, align 4, !tbaa !5
  %74 = load i32, ptr %14, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %76, label %84

76:                                               ; preds = %71
  %77 = load i32, ptr %15, align 4, !tbaa !5
  %78 = load i32, ptr %16, align 4, !tbaa !5
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEE5applyEiib(ptr noundef nonnull align 8 dereferenceable(80) %12, i32 noundef %77, i32 noundef %78, i1 noundef zeroext true)
          to label %79 unwind label %80

79:                                               ; preds = %76
  br label %96

80:                                               ; preds = %76, %69
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %6, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %7, align 4
  br label %100

84:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #7
  %85 = load i32, ptr %15, align 4, !tbaa !5
  %86 = load i32, ptr %16, align 4, !tbaa !5
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEE4prodEii(ptr dead_on_unwind writable sret(%struct.S) align 8 %17, ptr noundef nonnull align 8 dereferenceable(80) %12, i32 noundef %85, i32 noundef %86)
          to label %87 unwind label %92

87:                                               ; preds = %84
  %88 = getelementptr inbounds %struct.S, ptr %17, i32 0, i32 2
  %89 = load i64, ptr %88, align 8, !tbaa !13
  %90 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %89)
          to label %91 unwind label %92

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %96

92:                                               ; preds = %87, %84
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %6, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %100

96:                                               ; preds = %91, %79
  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 %97

97:                                               ; preds = %96
  %98 = load i32, ptr %13, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %13, align 4, !tbaa !5
  br label %60, !llvm.loop !18

100:                                              ; preds = %92, %80
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %12) #7
  br label %103

101:                                              ; preds = %64
  call void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %12) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %12) #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
  %102 = load i32, ptr %1, align 4
  ret i32 %102

103:                                              ; preds = %100, %65
  call void @llvm.lifetime.end.p0(i64 80, ptr %12) #7
  br label %104

104:                                              ; preds = %103, %43
  call void @_ZNSt6vectorI1SSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %105

105:                                              ; preds = %104, %27
  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 %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %6, align 8
  %108 = load i32, ptr %7, align 4
  %109 = insertvalue { ptr, i32 } poison, ptr %107, 0
  %110 = insertvalue { ptr, i32 } %109, i32 %108, 1
  resume { ptr, i32 } %110
}

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 #4 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 #5 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEEC2ERKSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEE5applyEiib(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef, i32 noundef, i1 noundef zeroext) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEE4prodEii(ptr dead_on_unwind noalias writable sret(%struct.S) align 8, ptr noundef nonnull align 8 dereferenceable(80), i32 noundef, i32 noundef) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) 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 #4 align 2

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

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


; 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.atcoder::lazy_segtree" = type { i32, i32, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%struct.S = type { i64, i64, i64 }

@.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 [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 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.atcoder::lazy_segtree", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.S, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %11 = 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) #7
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @_ZNSaI1SEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt6vectorI1SSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %13, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %14 unwind label %20

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

._crit_edge:                                      ; preds = %28, %14
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #7
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEEC2ERKSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %.preheader unwind label %32

.preheader:                                       ; preds = %._crit_edge
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph21, label %._crit_edge22

.lr.ph21:                                         ; preds = %.preheader
  %19 = getelementptr inbounds i8, ptr %10, i64 16
  br label %34

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

.lr.ph:                                           ; preds = %14, %28
  %indvars.iv = phi i64 [ %indvars.iv.next, %28 ], [ 0, %14 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %5)
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = icmp eq i32 %23, 0
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI1SSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #7
  %.sroa.43.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 8
  br i1 %24, label %26, label %27

26:                                               ; preds = %.lr.ph
  store i64 1, ptr %25, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.43.0..sroa_idx, i8 0, i64 16, i1 false)
  br label %28

27:                                               ; preds = %.lr.ph
  store i64 0, ptr %25, align 8, !tbaa !9
  store i64 1, ptr %.sroa.43.0..sroa_idx, align 8, !tbaa !9
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 16
  store i64 0, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %27, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge22:                                    ; preds = %51, %.preheader
  call void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #7
  call void @_ZNSt6vectorI1SSaIS0_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

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

34:                                               ; preds = %.lr.ph21, %51
  %.020 = phi i32 [ 0, %.lr.ph21 ], [ %52, %51 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr %8, align 4, !tbaa !5
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %40, label %44

40:                                               ; preds = %34
  %41 = load i32, ptr %9, align 4, !tbaa !5
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEE5applyEiib(ptr noundef nonnull align 8 dereferenceable(80) %6, i32 noundef %37, i32 noundef %41, i1 noundef zeroext true)
          to label %51 unwind label %42

42:                                               ; preds = %40
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %55

44:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  %45 = load i32, ptr %9, align 4, !tbaa !5
  invoke void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEE4prodEii(ptr dead_on_unwind nonnull writable sret(%struct.S) align 8 %10, ptr noundef nonnull align 8 dereferenceable(80) %6, i32 noundef %37, i32 noundef %45)
          to label %46 unwind label %49

46:                                               ; preds = %44
  %47 = load i64, ptr %19, align 8, !tbaa !13
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %47)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  br label %51

49:                                               ; preds = %44
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  br label %55

51:                                               ; preds = %40, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %52 = add nuw nsw i32 %.020, 1
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %34, label %._crit_edge22, !llvm.loop !15

55:                                               ; preds = %49, %42
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #7
  br label %56

56:                                               ; preds = %55, %32
  %.pn.pn = phi { ptr, i32 } [ %.pn, %55 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #7
  call void @_ZNSt6vectorI1SSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %57

57:                                               ; preds = %56, %20
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %56 ], [ %21, %20 ]
  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 } %.pn.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEEC2ERKSt6vectorIS1_SaIS1_EE(ptr noundef nonnull align 8 dereferenceable(80), 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_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEE5applyEiib(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEE4prodEii(ptr dead_on_unwind noalias writable sret(%struct.S) align 8, ptr noundef nonnull align 8 dereferenceable(80), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7atcoder12lazy_segtreeI1SXadL_Z2opS1_S1_EEXadL_Z1evEEbXadL_Z7mappingbS1_EEXadL_Z11compositionbbEEXadL_Z2idvEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) 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 #3 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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


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