; LLVM IR from upupming/algorithm :: acwing/日常刷题/扫描线/1228. 油漆面积 (main)

; 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.Segment = type { i32, i32, i32, i32 }
%struct.SegmentTree = type { i32, i32, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@seg = external dso_local global [20020 x %struct.Segment], align 16
@tree = external dso_local global [40040 x %struct.SegmentTree], align 16
@n = external dso_local global i32, align 4
@x1 = external dso_local global i32, align 4
@x2 = external dso_local global i32, align 4
@y1 = external dso_local global i32, align 4
@y2 = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildiii(i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6changeiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %67, %0
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sle i32 %8, %9
  br i1 %10, label %12, label %11

11:                                               ; preds = %7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %70

12:                                               ; preds = %7
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @x1)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @y1)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @x2)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @y2)
  %17 = load i32, ptr @x1, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = mul nsw i32 2, %18
  %20 = sub nsw i32 %19, 1
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %21
  %23 = getelementptr inbounds %struct.Segment, ptr %22, i32 0, i32 0
  store i32 %17, ptr %23, align 16, !tbaa !9
  %24 = load i32, ptr @y1, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = mul nsw i32 2, %25
  %27 = sub nsw i32 %26, 1
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %28
  %30 = getelementptr inbounds %struct.Segment, ptr %29, i32 0, i32 1
  store i32 %24, ptr %30, align 4, !tbaa !11
  %31 = load i32, ptr @y2, align 4, !tbaa !5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = mul nsw i32 2, %32
  %34 = sub nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.Segment, ptr %36, i32 0, i32 2
  store i32 %31, ptr %37, align 8, !tbaa !12
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = mul nsw i32 2, %38
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.Segment, ptr %42, i32 0, i32 3
  store i32 1, ptr %43, align 4, !tbaa !13
  %44 = load i32, ptr @x2, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = mul nsw i32 2, %45
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %47
  %49 = getelementptr inbounds %struct.Segment, ptr %48, i32 0, i32 0
  store i32 %44, ptr %49, align 16, !tbaa !9
  %50 = load i32, ptr @y1, align 4, !tbaa !5
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = mul nsw i32 2, %51
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %53
  %55 = getelementptr inbounds %struct.Segment, ptr %54, i32 0, i32 1
  store i32 %50, ptr %55, align 4, !tbaa !11
  %56 = load i32, ptr @y2, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = mul nsw i32 2, %57
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %59
  %61 = getelementptr inbounds %struct.Segment, ptr %60, i32 0, i32 2
  store i32 %56, ptr %61, align 8, !tbaa !12
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = mul nsw i32 2, %62
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %64
  %66 = getelementptr inbounds %struct.Segment, ptr %65, i32 0, i32 3
  store i32 -1, ptr %66, align 4, !tbaa !13
  br label %67

67:                                               ; preds = %12
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %2, align 4, !tbaa !5
  br label %7, !llvm.loop !14

70:                                               ; preds = %11
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = mul nsw i32 2, %71
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.Segment, ptr getelementptr inbounds (%struct.Segment, ptr @seg, i64 1), i64 %73
  call void @_ZSt4sortIP7SegmentEvT_S2_(ptr noundef getelementptr inbounds (%struct.Segment, ptr @seg, i64 1), ptr noundef %74)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_Z5buildiii(i32 noundef 1, i32 noundef 0, i32 noundef 10010)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %115, %70
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = mul nsw i32 2, %77
  %79 = icmp sle i32 %76, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %118

81:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %82 = load i32, ptr getelementptr inbounds (%struct.SegmentTree, ptr getelementptr inbounds ([40040 x %struct.SegmentTree], ptr @tree, i64 0, i64 1), i32 0, i32 3), align 4, !tbaa !16
  store i32 %82, ptr %5, align 4, !tbaa !5
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.Segment, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 16, !tbaa !9
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sub nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.Segment, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 16, !tbaa !9
  %95 = sub nsw i32 %88, %94
  %96 = mul nsw i32 %83, %95
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = add nsw i32 %97, %96
  store i32 %98, ptr %3, align 4, !tbaa !5
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.Segment, ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 4, !tbaa !11
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.Segment, ptr %106, i32 0, i32 2
  %108 = load i32, ptr %107, align 8, !tbaa !12
  %109 = sub nsw i32 %108, 1
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %111
  %113 = getelementptr inbounds %struct.Segment, ptr %112, i32 0, i32 3
  %114 = load i32, ptr %113, align 4, !tbaa !13
  call void @_Z6changeiiii(i32 noundef 1, i32 noundef %103, i32 noundef %109, i32 noundef %114)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %115

115:                                              ; preds = %81
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %4, align 4, !tbaa !5
  br label %75, !llvm.loop !18

118:                                              ; preds = %80
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %119)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP7SegmentEvT_S2_(ptr noundef, ptr noundef) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

attributes #0 = { 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 #1 = { nocallback nofree nosync 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 = { 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 #5 = { 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 = !{!"_ZTS7Segment", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !6, i64 12}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !6, i64 12}
!17 = !{!"_ZTS11SegmentTree", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!18 = distinct !{!18, !15}


; 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.Segment = type { i32, i32, i32, i32 }
%struct.SegmentTree = type { i32, i32, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@seg = external dso_local global [20020 x %struct.Segment], align 16
@tree = external dso_local local_unnamed_addr global [40040 x %struct.SegmentTree], align 16
@n = external dso_local global i32, align 4
@x1 = external dso_local global i32, align 4
@x2 = external dso_local global i32, align 4
@y1 = external dso_local global i32, align 4
@y2 = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6changeiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not24 = icmp slt i32 %2, 1
  br i1 %.not24, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %2, %0 ], [ %25, %.lr.ph ]
  %3 = shl nsw i32 %.lcssa, 1
  %4 = sext i32 %3 to i64
  %5 = getelementptr inbounds %struct.Segment, ptr getelementptr inbounds (i8, ptr @seg, i64 16), i64 %4
  tail call void @_ZSt4sortIP7SegmentEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seg, i64 16), ptr noundef nonnull %5)
  tail call void @_Z5buildiii(i32 noundef 1, i32 noundef 0, i32 noundef 10010)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not2326 = icmp slt i32 %6, 1
  br i1 %.not2326, label %._crit_edge31, label %.lr.ph30

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @x1)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @y1)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) @x2)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @y2)
  %11 = load i32, ptr @x1, align 4, !tbaa !5
  %12 = shl nuw nsw i64 %indvars.iv, 1
  %13 = add nsw i64 %12, -1
  %14 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %13
  store i32 %11, ptr %14, align 16, !tbaa !9
  %15 = load i32, ptr @y1, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %14, i64 4
  store i32 %15, ptr %16, align 4, !tbaa !11
  %17 = load i32, ptr @y2, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %14, i64 8
  store i32 %17, ptr %18, align 8, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %14, i64 12
  store i32 1, ptr %19, align 4, !tbaa !13
  %20 = load i32, ptr @x2, align 4, !tbaa !5
  %21 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %12
  store i32 %20, ptr %21, align 16, !tbaa !9
  %22 = getelementptr inbounds i8, ptr %21, i64 4
  store i32 %15, ptr %22, align 4, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %21, i64 8
  store i32 %17, ptr %23, align 8, !tbaa !12
  %24 = getelementptr inbounds i8, ptr %21, i64 12
  store i32 -1, ptr %24, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %.not.not = icmp slt i64 %indvars.iv, %26
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge31:                                    ; preds = %.lr.ph30, %._crit_edge
  %.021.lcssa = phi i32 [ 0, %._crit_edge ], [ %37, %.lr.ph30 ]
  %27 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.021.lcssa)
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph30:                                         ; preds = %._crit_edge, %.lr.ph30
  %indvars.iv36 = phi i64 [ %indvars.iv.next37, %.lr.ph30 ], [ 1, %._crit_edge ]
  %.02127 = phi i32 [ %37, %.lr.ph30 ], [ 0, %._crit_edge ]
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @tree, i64 28), align 4, !tbaa !16
  %30 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %indvars.iv36
  %31 = load i32, ptr %30, align 16, !tbaa !9
  %32 = add nsw i64 %indvars.iv36, -1
  %33 = getelementptr inbounds [20020 x %struct.Segment], ptr @seg, i64 0, i64 %32
  %34 = load i32, ptr %33, align 16, !tbaa !9
  %35 = sub nsw i32 %31, %34
  %36 = mul nsw i32 %35, %29
  %37 = add nsw i32 %36, %.02127
  %38 = getelementptr inbounds i8, ptr %30, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %30, i64 8
  %41 = load i32, ptr %40, align 8, !tbaa !12
  %42 = add nsw i32 %41, -1
  %43 = getelementptr inbounds i8, ptr %30, i64 12
  %44 = load i32, ptr %43, align 4, !tbaa !13
  tail call void @_Z6changeiiii(i32 noundef 1, i32 noundef %39, i32 noundef %42, i32 noundef %44)
  %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = shl nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %.not23.not = icmp slt i64 %indvars.iv36, %47
  br i1 %.not23.not, label %.lr.ph30, label %._crit_edge31, !llvm.loop !18
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP7SegmentEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { 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 #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 = { "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 = { 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" }

!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 = !{!"_ZTS7Segment", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !6, i64 12}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !6, i64 12}
!17 = !{!"_ZTS11SegmentTree", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!18 = distinct !{!18, !15}


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