; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x43-线段树/245. 你能回答这些问题吗.ll (Z3askiii)

; 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.SegmentTree = type { i32, i32, i32, i32, i32, i32 }

@t = external dso_local global [2000040 x %struct.SegmentTree], align 16

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3askiii(ptr dead_on_unwind noalias writable sret(%struct.SegmentTree) align 4 %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.SegmentTree, align 4
  %11 = alloca %struct.SegmentTree, align 4
  %12 = alloca %struct.SegmentTree, align 4
  %13 = alloca %struct.SegmentTree, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  store i32 %3, ptr %7, align 4, !tbaa !5
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [2000040 x %struct.SegmentTree], ptr @t, i64 0, i64 %19
  %21 = getelementptr inbounds %struct.SegmentTree, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp sle i32 %17, %22
  br i1 %23, label %24, label %36

24:                                               ; preds = %4
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [2000040 x %struct.SegmentTree], ptr @t, i64 0, i64 %27
  %29 = getelementptr inbounds %struct.SegmentTree, ptr %28, i32 0, i32 1
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = icmp sge i32 %25, %30
  br i1 %31, label %32, label %36

32:                                               ; preds = %24
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [2000040 x %struct.SegmentTree], ptr @t, i64 0, i64 %34
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 8 %35, i64 24, i1 false), !tbaa.struct !12
  br label %140

36:                                               ; preds = %24, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [2000040 x %struct.SegmentTree], ptr @t, i64 0, i64 %38
  %40 = getelementptr inbounds %struct.SegmentTree, ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !9
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [2000040 x %struct.SegmentTree], ptr @t, i64 0, i64 %43
  %45 = getelementptr inbounds %struct.SegmentTree, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = add nsw i32 %41, %46
  %48 = ashr i32 %47, 1
  store i32 %48, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 -1073741824, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 4
  store i32 %49, ptr %50, align 4, !tbaa !13
  %51 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 3
  store i32 %49, ptr %51, align 4, !tbaa !14
  %52 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 5
  store i32 %49, ptr %52, align 4, !tbaa !15
  %53 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 2
  store i32 %49, ptr %53, align 4, !tbaa !16
  %54 = load i32, ptr %9, align 4, !tbaa !5
  %55 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 4
  store i32 %54, ptr %55, align 4, !tbaa !13
  %56 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 3
  store i32 %54, ptr %56, align 4, !tbaa !14
  %57 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 5
  store i32 %54, ptr %57, align 4, !tbaa !15
  %58 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 2
  store i32 %54, ptr %58, align 4, !tbaa !16
  %59 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 5
  store i32 0, ptr %59, align 4, !tbaa !15
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %63, label %73

63:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #4
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = mul nsw i32 2, %64
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3askiii(ptr dead_on_unwind writable sret(%struct.SegmentTree) align 4 %12, i32 noundef %65, i32 noundef %66, i32 noundef %67)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %12, i64 24, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #4
  %68 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 5
  %69 = load i32, ptr %68, align 4, !tbaa !15
  %70 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 5
  %71 = load i32, ptr %70, align 4, !tbaa !15
  %72 = add nsw i32 %71, %69
  store i32 %72, ptr %70, align 4, !tbaa !15
  br label %73

73:                                               ; preds = %63, %36
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  %77 = icmp sge i32 %74, %76
  br i1 %77, label %78, label %89

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = mul nsw i32 2, %79
  %81 = add nsw i32 %80, 1
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3askiii(ptr dead_on_unwind writable sret(%struct.SegmentTree) align 4 %13, i32 noundef %81, i32 noundef %82, i32 noundef %83)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %13, i64 24, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  %84 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 5
  %85 = load i32, ptr %84, align 4, !tbaa !15
  %86 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 5
  %87 = load i32, ptr %86, align 4, !tbaa !15
  %88 = add nsw i32 %87, %85
  store i32 %88, ptr %86, align 4, !tbaa !15
  br label %89

89:                                               ; preds = %78, %73
  %90 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %91 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 3
  %92 = load i32, ptr %91, align 4, !tbaa !14
  %93 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 5
  %94 = load i32, ptr %93, align 4, !tbaa !15
  %95 = add nsw i32 %92, %94
  store i32 %95, ptr %14, align 4, !tbaa !5
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %90, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 3
  store i32 %97, ptr %98, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = icmp sgt i32 %99, %100
  br i1 %101, label %102, label %108

102:                                              ; preds = %89
  %103 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 3
  %104 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 3
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %103, ptr noundef nonnull align 4 dereferenceable(4) %104)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 3
  store i32 %106, ptr %107, align 4, !tbaa !14
  br label %108

108:                                              ; preds = %102, %89
  %109 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %110 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 5
  %111 = load i32, ptr %110, align 4, !tbaa !15
  %112 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 4
  %113 = load i32, ptr %112, align 4, !tbaa !13
  %114 = add nsw i32 %111, %113
  store i32 %114, ptr %15, align 4, !tbaa !5
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %109, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 4
  store i32 %116, ptr %117, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  %121 = icmp slt i32 %118, %120
  br i1 %121, label %122, label %128

122:                                              ; preds = %108
  %123 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 4
  %124 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 4
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %123, ptr noundef nonnull align 4 dereferenceable(4) %124)
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 4
  store i32 %126, ptr %127, align 4, !tbaa !13
  br label %128

128:                                              ; preds = %122, %108
  %129 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 2
  %130 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 2
  %131 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %129, ptr noundef nonnull align 4 dereferenceable(4) %130)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %132 = getelementptr inbounds %struct.SegmentTree, ptr %10, i32 0, i32 4
  %133 = load i32, ptr %132, align 4, !tbaa !13
  %134 = getelementptr inbounds %struct.SegmentTree, ptr %11, i32 0, i32 3
  %135 = load i32, ptr %134, align 4, !tbaa !14
  %136 = add nsw i32 %133, %135
  store i32 %136, ptr %16, align 4, !tbaa !5
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %131, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = getelementptr inbounds %struct.SegmentTree, ptr %0, i32 0, i32 2
  store i32 %138, ptr %139, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %140

140:                                              ; preds = %128, %32
  ret void
}

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

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


; 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.SegmentTree = type { i32, i32, i32, i32, i32, i32 }

@t = external dso_local local_unnamed_addr global [2000040 x %struct.SegmentTree], align 16

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3askiii(ptr dead_on_unwind noalias writable sret(%struct.SegmentTree) align 4 %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = alloca %struct.SegmentTree, align 4
  %6 = alloca %struct.SegmentTree, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = sext i32 %1 to i64
  %11 = getelementptr inbounds [2000040 x %struct.SegmentTree], ptr @t, i64 0, i64 %10
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %.not = icmp slt i32 %12, %2
  %.phi.trans.insert = getelementptr inbounds i8, ptr %11, i64 4
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !10
  %.not24 = icmp sgt i32 %.pre, %3
  %or.cond = select i1 %.not, i1 true, i1 %.not24
  br i1 %or.cond, label %._crit_edge, label %13

13:                                               ; preds = %4
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %11, i64 24, i1 false), !tbaa.struct !11
  br label %64

._crit_edge:                                      ; preds = %4
  %14 = add nsw i32 %.pre, %12
  %15 = ashr i32 %14, 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  %16 = getelementptr inbounds i8, ptr %5, i64 16
  %17 = getelementptr inbounds i8, ptr %5, i64 12
  %18 = getelementptr inbounds i8, ptr %5, i64 8
  store <4 x i32> <i32 -1073741824, i32 -1073741824, i32 -1073741824, i32 -1073741824>, ptr %18, align 4, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %6, i64 16
  %20 = getelementptr inbounds i8, ptr %6, i64 12
  %21 = getelementptr inbounds i8, ptr %6, i64 20
  %22 = getelementptr inbounds i8, ptr %6, i64 8
  store <4 x i32> <i32 -1073741824, i32 -1073741824, i32 -1073741824, i32 -1073741824>, ptr %22, align 4, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 0, ptr %23, align 4, !tbaa !13
  %.not25 = icmp slt i32 %15, %2
  br i1 %.not25, label %28, label %24

24:                                               ; preds = %._crit_edge
  %25 = getelementptr inbounds i8, ptr %5, i64 20
  %26 = shl nsw i32 %1, 1
  call void @_Z3askiii(ptr dead_on_unwind nonnull writable sret(%struct.SegmentTree) align 4 %5, i32 noundef %26, i32 noundef %2, i32 noundef %3)
  %27 = load i32, ptr %25, align 4, !tbaa !13
  store i32 %27, ptr %23, align 4, !tbaa !13
  br label %28

28:                                               ; preds = %24, %._crit_edge
  %29 = phi i32 [ %27, %24 ], [ -1073741824, %._crit_edge ]
  %30 = phi i32 [ %27, %24 ], [ 0, %._crit_edge ]
  %.not26.not = icmp slt i32 %15, %3
  br i1 %.not26.not, label %31, label %36

31:                                               ; preds = %28
  %32 = shl nsw i32 %1, 1
  %33 = or disjoint i32 %32, 1
  call void @_Z3askiii(ptr dead_on_unwind nonnull writable sret(%struct.SegmentTree) align 4 %6, i32 noundef %33, i32 noundef %2, i32 noundef %3)
  %34 = load i32, ptr %21, align 4, !tbaa !13
  %35 = add nsw i32 %30, %34
  store i32 %35, ptr %23, align 4, !tbaa !13
  %.pre28 = load i32, ptr %20, align 4, !tbaa !14
  br label %36

36:                                               ; preds = %31, %28
  %37 = phi i32 [ %34, %31 ], [ -1073741824, %28 ]
  %38 = phi i32 [ %.pre28, %31 ], [ -1073741824, %28 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %39 = add nsw i32 %29, %38
  store i32 %39, ptr %7, align 4, !tbaa !12
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %41 = load i32, ptr %40, align 4, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %41, ptr %42, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br i1 %.not25, label %43, label %46

43:                                               ; preds = %36
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %42, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %45 = load i32, ptr %44, align 4, !tbaa !12
  store i32 %45, ptr %42, align 4, !tbaa !14
  %.pre29 = load i32, ptr %21, align 4, !tbaa !13
  br label %46

46:                                               ; preds = %43, %36
  %47 = phi i32 [ %.pre29, %43 ], [ %37, %36 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %48 = load i32, ptr %16, align 4, !tbaa !15
  %49 = add nsw i32 %48, %47
  store i32 %49, ptr %8, align 4, !tbaa !12
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %51 = load i32, ptr %50, align 4, !tbaa !12
  %52 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %51, ptr %52, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br i1 %.not26.not, label %56, label %53

53:                                               ; preds = %46
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %52, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %55 = load i32, ptr %54, align 4, !tbaa !12
  store i32 %55, ptr %52, align 4, !tbaa !15
  br label %56

56:                                               ; preds = %53, %46
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %22)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %58 = load i32, ptr %16, align 4, !tbaa !15
  %59 = load i32, ptr %20, align 4, !tbaa !14
  %60 = add nsw i32 %59, %58
  store i32 %60, ptr %9, align 4, !tbaa !12
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %57, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %62 = load i32, ptr %61, align 4, !tbaa !12
  %63 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %62, ptr %63, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  br label %64

64:                                               ; preds = %56, %13
  ret void
}

; Function Attrs: mustprogress 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) #3

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass