; LLVM IR from eyangch/competitive-programming :: COCI/2021 (sjeckanje)

; 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.segtree = type { [800005 x [2 x [2 x i64]]], [800005 x i64] }
%"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" }

@N = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@A = external dso_local global [200000 x i64], align 16
@S = external dso_local global %struct.segtree, align 8
@_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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  call void @_ZN7segtree4initEv(ptr noundef nonnull align 8 dereferenceable(32000200) @S)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %16

16:                                               ; preds = %25, %0
  %17 = load i64, ptr %2, align 8, !tbaa !8
  %18 = load i64, ptr @N, align 8, !tbaa !8
  %19 = icmp slt i64 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %28

21:                                               ; preds = %16
  %22 = load i64, ptr %2, align 8, !tbaa !8
  %23 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  br label %25

25:                                               ; preds = %21
  %26 = load i64, ptr %2, align 8, !tbaa !8
  %27 = add nsw i64 %26, 1
  store i64 %27, ptr %2, align 8, !tbaa !8
  br label %16, !llvm.loop !11

28:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %29

29:                                               ; preds = %45, %28
  %30 = load i64, ptr %3, align 8, !tbaa !8
  %31 = load i64, ptr @N, align 8, !tbaa !8
  %32 = sub nsw i64 %31, 1
  %33 = icmp slt i64 %30, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %48

35:                                               ; preds = %29
  %36 = load i64, ptr %3, align 8, !tbaa !8
  %37 = load i64, ptr %3, align 8, !tbaa !8
  %38 = add nsw i64 %37, 1
  %39 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !8
  %41 = load i64, ptr %3, align 8, !tbaa !8
  %42 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = sub nsw i64 %40, %43
  call void @_ZN7segtree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(32000200) @S, i64 noundef %36, i64 noundef %44, i64 noundef 0, i64 noundef 200000, i64 noundef 1)
  br label %45

45:                                               ; preds = %35
  %46 = load i64, ptr %3, align 8, !tbaa !8
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %3, align 8, !tbaa !8
  br label %29, !llvm.loop !13

48:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %49

49:                                               ; preds = %80, %48
  %50 = load i64, ptr %4, align 8, !tbaa !8
  %51 = load i64, ptr @Q, align 8, !tbaa !8
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %83

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %58 = load i64, ptr %5, align 8, !tbaa !8
  %59 = sub nsw i64 %58, 2
  store i64 %59, ptr %5, align 8, !tbaa !8
  %60 = load i64, ptr %6, align 8, !tbaa !8
  %61 = add nsw i64 %60, -1
  store i64 %61, ptr %6, align 8, !tbaa !8
  %62 = load i64, ptr %5, align 8, !tbaa !8
  %63 = icmp sge i64 %62, 0
  br i1 %63, label %64, label %67

64:                                               ; preds = %54
  %65 = load i64, ptr %5, align 8, !tbaa !8
  %66 = load i64, ptr %7, align 8, !tbaa !8
  call void @_ZN7segtree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(32000200) @S, i64 noundef %65, i64 noundef %66, i64 noundef 0, i64 noundef 200000, i64 noundef 1)
  br label %67

67:                                               ; preds = %64, %54
  %68 = load i64, ptr %6, align 8, !tbaa !8
  %69 = load i64, ptr @N, align 8, !tbaa !8
  %70 = sub nsw i64 %69, 2
  %71 = icmp sle i64 %68, %70
  br i1 %71, label %72, label %76

72:                                               ; preds = %67
  %73 = load i64, ptr %6, align 8, !tbaa !8
  %74 = load i64, ptr %7, align 8, !tbaa !8
  %75 = sub nsw i64 0, %74
  call void @_ZN7segtree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(32000200) @S, i64 noundef %73, i64 noundef %75, i64 noundef 0, i64 noundef 200000, i64 noundef 1)
  br label %76

76:                                               ; preds = %72, %67
  %77 = call noundef i64 @_ZN7segtree3qryEv(ptr noundef nonnull align 8 dereferenceable(32000200) @S)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %77)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %78, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %80

80:                                               ; preds = %76
  %81 = load i64, ptr %4, align 8, !tbaa !8
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %4, align 8, !tbaa !8
  br label %49, !llvm.loop !14

83:                                               ; preds = %53
  %84 = load i32, ptr %1, align 4
  ret i32 %84
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7segtree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(32000200), i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7segtree3qryEv(ptr noundef nonnull align 8 dereferenceable(32000200)) #3 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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !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}


; 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.segtree = type { [800005 x [2 x [2 x i64]]], [800005 x i64] }
%"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" }

@N = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@A = external dso_local global [200000 x i64], align 16
@S = external dso_local global %struct.segtree, align 8
@_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 i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  tail call void @_ZN7segtree4initEv(ptr noundef nonnull align 8 dereferenceable(32000200) @S)
  %12 = load i64, ptr @N, align 8, !tbaa !8
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph, label %.preheader

.preheader15:                                     ; preds = %.lr.ph
  %14 = icmp sgt i64 %18, 1
  br i1 %14, label %.lr.ph18, label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.01216 = phi i64 [ %17, %.lr.ph ], [ 0, %0 ]
  %15 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.01216
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %17 = add nuw nsw i64 %.01216, 1
  %18 = load i64, ptr @N, align 8, !tbaa !8
  %19 = icmp slt i64 %17, %18
  br i1 %19, label %.lr.ph, label %.preheader15, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph18, %0, %.preheader15
  %20 = load i64, ptr @Q, align 8, !tbaa !8
  %21 = icmp sgt i64 %20, 0
  br i1 %21, label %.lr.ph20, label %._crit_edge

.lr.ph18:                                         ; preds = %.preheader15, %.lr.ph18
  %.01117 = phi i64 [ %22, %.lr.ph18 ], [ 0, %.preheader15 ]
  %22 = add nuw nsw i64 %.01117, 1
  %23 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %22
  %24 = load i64, ptr %23, align 8, !tbaa !8
  %25 = getelementptr inbounds [200000 x i64], ptr @A, i64 0, i64 %.01117
  %26 = load i64, ptr %25, align 8, !tbaa !8
  %27 = sub nsw i64 %24, %26
  tail call void @_ZN7segtree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(32000200) @S, i64 noundef %.01117, i64 noundef %27, i64 noundef 0, i64 noundef 200000, i64 noundef 1)
  %28 = load i64, ptr @N, align 8, !tbaa !8
  %29 = add nsw i64 %28, -1
  %30 = icmp slt i64 %22, %29
  br i1 %30, label %.lr.ph18, label %.preheader, !llvm.loop !13

._crit_edge:                                      ; preds = %48, %.preheader
  ret i32 0

.lr.ph20:                                         ; preds = %.preheader, %48
  %.019 = phi i64 [ %52, %48 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %34 = load i64, ptr %1, align 8, !tbaa !8
  %35 = add nsw i64 %34, -2
  store i64 %35, ptr %1, align 8, !tbaa !8
  %36 = load i64, ptr %2, align 8, !tbaa !8
  %37 = add nsw i64 %36, -1
  store i64 %37, ptr %2, align 8, !tbaa !8
  %38 = icmp sgt i64 %34, 1
  br i1 %38, label %39, label %41

39:                                               ; preds = %.lr.ph20
  %40 = load i64, ptr %3, align 8, !tbaa !8
  call void @_ZN7segtree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(32000200) @S, i64 noundef %35, i64 noundef %40, i64 noundef 0, i64 noundef 200000, i64 noundef 1)
  %.pre = load i64, ptr %2, align 8, !tbaa !8
  br label %41

41:                                               ; preds = %39, %.lr.ph20
  %42 = phi i64 [ %.pre, %39 ], [ %37, %.lr.ph20 ]
  %43 = load i64, ptr @N, align 8, !tbaa !8
  %44 = add nsw i64 %43, -2
  %.not = icmp sgt i64 %42, %44
  br i1 %.not, label %48, label %45

45:                                               ; preds = %41
  %46 = load i64, ptr %3, align 8, !tbaa !8
  %47 = sub nsw i64 0, %46
  call void @_ZN7segtree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(32000200) @S, i64 noundef %42, i64 noundef %47, i64 noundef 0, i64 noundef 200000, i64 noundef 1)
  br label %48

48:                                               ; preds = %45, %41
  %49 = call noundef i64 @_ZN7segtree3qryEv(ptr noundef nonnull align 8 dereferenceable(32000200) @S)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %49)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %50, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %52 = add nuw nsw i64 %.019, 1
  %53 = load i64, ptr @Q, align 8, !tbaa !8
  %54 = icmp slt i64 %52, %53
  br i1 %54, label %.lr.ph20, label %._crit_edge, !llvm.loop !14
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7segtree4initEv(ptr noundef nonnull align 8 dereferenceable(32000200)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7segtree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(32000200), i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7segtree3qryEv(ptr noundef nonnull align 8 dereferenceable(32000200)) local_unnamed_addr #3 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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !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}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass