; LLVM IR from duc0/ContestNeko :: CPPProjects/Interval.ll (Z5solveRK12IntervalListIiE)

; 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.IntervalList = type <{ %"class.std::vector", i8, [7 x i8], %"class.std::vector.0", %"class.std::vector.0", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Interval<int>, std::allocator<Interval<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<Interval<int>, std::allocator<Interval<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Interval<int>, std::allocator<Interval<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Interval<int>, std::allocator<Interval<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.MaximumCliqueInterval = type { %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", i32, ptr }
%class.MaxTree = type { %struct.SegmentTree }
%struct.SegmentTree = type { %"class.std::vector.5", %"class.std::function", %"class.std::function.10", %"class.std::function.12", %"class.std::function.14", i32, i32, i32, i32 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<SegmentTree<int, MaxTreeQ<int>>::TreeNode, std::allocator<SegmentTree<int, MaxTreeQ<int>>::TreeNode>>::_Vector_impl" }
%"struct.std::_Vector_base<SegmentTree<int, MaxTreeQ<int>>::TreeNode, std::allocator<SegmentTree<int, MaxTreeQ<int>>::TreeNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<SegmentTree<int, MaxTreeQ<int>>::TreeNode, std::allocator<SegmentTree<int, MaxTreeQ<int>>::TreeNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SegmentTree<int, MaxTreeQ<int>>::TreeNode, std::allocator<SegmentTree<int, MaxTreeQ<int>>::TreeNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::function.10" = type { %"class.std::_Function_base", ptr }
%"class.std::function.12" = type { %"class.std::_Function_base", ptr }
%"class.std::function.14" = type { %"class.std::_Function_base", ptr }

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solveRK12IntervalListIiE(ptr noundef nonnull align 8 dereferenceable(84) %0) #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %class.IntervalList, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %class.MaximumCliqueInterval, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %class.MaxTree, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr %3) #5
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN12IntervalListIiEC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(84) %3, ptr noundef nonnull align 8 dereferenceable(84) %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %20 = invoke noundef i32 @_ZNK12IntervalListIiE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(84) %3)
          to label %21 unwind label %41

21:                                               ; preds = %1
  store i32 %20, ptr %4, align 4, !tbaa !9
  invoke void @_ZN12IntervalListIiE19compressCoordinatesEv(ptr noundef nonnull align 8 dereferenceable(84) %3)
          to label %22 unwind label %41

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 88, ptr %7) #5
  invoke void @_ZN21MaximumCliqueIntervalIiEC2ERK12IntervalListIiE(ptr noundef nonnull align 8 dereferenceable(88) %7, ptr noundef nonnull align 8 dereferenceable(84) %3)
          to label %23 unwind label %45

23:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %24 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE21getSortedLeftIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %3, i32 noundef 1)
          to label %25 unwind label %49

25:                                               ; preds = %23
  %26 = invoke noundef i32 @_ZNK8IntervalIiE7getLeftEv(ptr noundef nonnull align 4 dereferenceable(8) %24)
          to label %27 unwind label %49

27:                                               ; preds = %25
  store i32 %26, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE22getSortedRightIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %3, i32 noundef %28)
          to label %30 unwind label %53

30:                                               ; preds = %27
  %31 = invoke noundef i32 @_ZNK8IntervalIiE8getRightEv(ptr noundef nonnull align 4 dereferenceable(8) %29)
          to label %32 unwind label %53

32:                                               ; preds = %30
  store i32 %31, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 168, ptr %10) #5
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = load i32, ptr %9, align 4, !tbaa !9
  invoke void @_ZN7MaxTreeIiEC2Eii(ptr noundef nonnull align 8 dereferenceable(168) %10, i32 noundef %33, i32 noundef %34)
          to label %35 unwind label %57

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %122, %35
  %37 = load i32, ptr %13, align 4, !tbaa !9
  %38 = load i32, ptr %4, align 4, !tbaa !9
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %61, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %132

41:                                               ; preds = %21, %1
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %5, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %6, align 4
  br label %138

45:                                               ; preds = %22
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %5, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %6, align 4
  br label %137

49:                                               ; preds = %25, %23
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %5, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %6, align 4
  br label %136

53:                                               ; preds = %30, %27
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %5, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %6, align 4
  br label %135

57:                                               ; preds = %32
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %5, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %6, align 4
  br label %134

61:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = invoke noundef i32 @_ZNK21MaximumCliqueIntervalIiE21getMaxCliqueSizeAtIdxEi(ptr noundef nonnull align 8 dereferenceable(88) %7, i32 noundef %62)
          to label %64 unwind label %98

64:                                               ; preds = %61
  store i32 %63, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE21getSortedLeftIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %3, i32 noundef %65)
          to label %67 unwind label %102

67:                                               ; preds = %64
  store ptr %66, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = invoke noundef i32 @_ZNK8IntervalIiE7getLeftEv(ptr noundef nonnull align 4 dereferenceable(8) %68)
          to label %70 unwind label %106

70:                                               ; preds = %67
  store i32 %69, ptr %16, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %95, %70
  %72 = load i32, ptr %12, align 4, !tbaa !9
  %73 = load i32, ptr %4, align 4, !tbaa !9
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %75, label %83

75:                                               ; preds = %71
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE22getSortedRightIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %3, i32 noundef %76)
          to label %78 unwind label %106

78:                                               ; preds = %75
  %79 = invoke noundef i32 @_ZNK8IntervalIiE8getRightEv(ptr noundef nonnull align 4 dereferenceable(8) %77)
          to label %80 unwind label %106

80:                                               ; preds = %78
  %81 = load i32, ptr %16, align 4, !tbaa !9
  %82 = icmp slt i32 %79, %81
  br label %83

83:                                               ; preds = %80, %71
  %84 = phi i1 [ false, %71 ], [ %82, %80 ]
  br i1 %84, label %85, label %114

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE22getSortedRightIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %3, i32 noundef %86)
          to label %88 unwind label %110

88:                                               ; preds = %85
  store ptr %87, ptr %17, align 8, !tbaa !5
  %89 = load ptr, ptr %17, align 8, !tbaa !5
  %90 = invoke noundef i32 @_ZNK8IntervalIiE7getLeftEv(ptr noundef nonnull align 4 dereferenceable(8) %89)
          to label %91 unwind label %110

91:                                               ; preds = %88
  %92 = load ptr, ptr %17, align 8, !tbaa !5
  %93 = invoke noundef i32 @_ZNK8IntervalIiE8getRightEv(ptr noundef nonnull align 4 dereferenceable(8) %92)
          to label %94 unwind label %110

94:                                               ; preds = %91
  invoke void @_ZN7MaxTreeIiE3addEiii(ptr noundef nonnull align 8 dereferenceable(168) %10, i32 noundef %90, i32 noundef %93, i32 noundef 1)
          to label %95 unwind label %110

95:                                               ; preds = %94
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %71, !llvm.loop !11

98:                                               ; preds = %61
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %5, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %6, align 4
  br label %131

102:                                              ; preds = %64
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %5, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %6, align 4
  br label %130

106:                                              ; preds = %78, %75, %67
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %5, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %6, align 4
  br label %129

110:                                              ; preds = %94, %91, %88, %85
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %5, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %129

114:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %115 = load i32, ptr %14, align 4, !tbaa !9
  %116 = invoke noundef i32 @_ZN7MaxTreeIiE8queryMaxEv(ptr noundef nonnull align 8 dereferenceable(168) %10)
          to label %117 unwind label %125

117:                                              ; preds = %114
  %118 = add nsw i32 %115, %116
  store i32 %118, ptr %18, align 4, !tbaa !9
  %119 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %120 unwind label %125

120:                                              ; preds = %117
  %121 = load i32, ptr %119, align 4, !tbaa !9
  store i32 %121, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %122

122:                                              ; preds = %120
  %123 = load i32, ptr %13, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %13, align 4, !tbaa !9
  br label %36, !llvm.loop !13

125:                                              ; preds = %117, %114
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %5, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %129

129:                                              ; preds = %125, %110, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %130

130:                                              ; preds = %129, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %131

131:                                              ; preds = %130, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @_ZN11SegmentTreeIi8MaxTreeQIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(168) %10) #5
  br label %134

132:                                              ; preds = %40
  %133 = load i32, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @_ZN11SegmentTreeIi8MaxTreeQIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(168) %10) #5
  call void @llvm.lifetime.end.p0(i64 168, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZN21MaximumCliqueIntervalIiED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %7) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @_ZN12IntervalListIiED2Ev(ptr noundef nonnull align 8 dereferenceable(84) %3) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr %3) #5
  ret i32 %133

134:                                              ; preds = %131, %57
  call void @llvm.lifetime.end.p0(i64 168, ptr %10) #5
  br label %135

135:                                              ; preds = %134, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %136

136:                                              ; preds = %135, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZN21MaximumCliqueIntervalIiED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %7) #5
  br label %137

137:                                              ; preds = %136, %45
  call void @llvm.lifetime.end.p0(i64 88, ptr %7) #5
  br label %138

138:                                              ; preds = %137, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @_ZN12IntervalListIiED2Ev(ptr noundef nonnull align 8 dereferenceable(84) %3) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr %3) #5
  br label %139

139:                                              ; preds = %138
  %140 = load ptr, ptr %5, align 8
  %141 = load i32, ptr %6, align 4
  %142 = insertvalue { ptr, i32 } poison, ptr %140, 0
  %143 = insertvalue { ptr, i32 } %142, i32 %141, 1
  resume { ptr, i32 } %143
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12IntervalListIiEC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef nonnull align 8 dereferenceable(84)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12IntervalListIiE19compressCoordinatesEv(ptr noundef nonnull align 8 dereferenceable(84)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21MaximumCliqueIntervalIiEC2ERK12IntervalListIiE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(84)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7MaxTreeIiEC2Eii(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK21MaximumCliqueIntervalIiE21getMaxCliqueSizeAtIdxEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7MaxTreeIiE3addEiii(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7MaxTreeIiE8queryMaxEv(ptr noundef nonnull align 8 dereferenceable(168)) #3 align 2

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

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

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

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

%class.IntervalList = type <{ %"class.std::vector", i8, [7 x i8], %"class.std::vector.0", %"class.std::vector.0", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Interval<int>, std::allocator<Interval<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<Interval<int>, std::allocator<Interval<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Interval<int>, std::allocator<Interval<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Interval<int>, std::allocator<Interval<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.MaximumCliqueInterval = type { %"class.std::vector.0", %"class.std::vector.0", %"class.std::vector.0", i32, ptr }
%class.MaxTree = type { %struct.SegmentTree }
%struct.SegmentTree = type { %"class.std::vector.5", %"class.std::function", %"class.std::function.10", %"class.std::function.12", %"class.std::function.14", i32, i32, i32, i32 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<SegmentTree<int, MaxTreeQ<int>>::TreeNode, std::allocator<SegmentTree<int, MaxTreeQ<int>>::TreeNode>>::_Vector_impl" }
%"struct.std::_Vector_base<SegmentTree<int, MaxTreeQ<int>>::TreeNode, std::allocator<SegmentTree<int, MaxTreeQ<int>>::TreeNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<SegmentTree<int, MaxTreeQ<int>>::TreeNode, std::allocator<SegmentTree<int, MaxTreeQ<int>>::TreeNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SegmentTree<int, MaxTreeQ<int>>::TreeNode, std::allocator<SegmentTree<int, MaxTreeQ<int>>::TreeNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::function.10" = type { %"class.std::_Function_base", ptr }
%"class.std::function.12" = type { %"class.std::_Function_base", ptr }
%"class.std::function.14" = type { %"class.std::_Function_base", ptr }

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

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

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

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

; 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 #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solveRK12IntervalListIiE(ptr noundef nonnull align 8 dereferenceable(84) %0) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.IntervalList, align 8
  %3 = alloca %class.MaximumCliqueInterval, align 8
  %4 = alloca %class.MaxTree, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %2) #5
  call void @_ZN12IntervalListIiEC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(84) %2, ptr noundef nonnull align 8 dereferenceable(84) %0)
  %7 = call noundef i32 @_ZNK12IntervalListIiE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(84) %2)
  invoke void @_ZN12IntervalListIiE19compressCoordinatesEv(ptr noundef nonnull align 8 dereferenceable(84) %2)
          to label %8 unwind label %17

8:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %3) #5
  invoke void @_ZN21MaximumCliqueIntervalIiEC2ERK12IntervalListIiE(ptr noundef nonnull align 8 dereferenceable(88) %3, ptr noundef nonnull align 8 dereferenceable(84) %2)
          to label %9 unwind label %19

9:                                                ; preds = %8
  %10 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE21getSortedLeftIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %2, i32 noundef 1)
  %11 = call noundef i32 @_ZNK8IntervalIiE7getLeftEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %12 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE22getSortedRightIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %2, i32 noundef %7)
  %13 = call noundef i32 @_ZNK8IntervalIiE8getRightEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %4) #5
  invoke void @_ZN7MaxTreeIiEC2Eii(ptr noundef nonnull align 8 dereferenceable(168) %4, i32 noundef %11, i32 noundef %13)
          to label %14 unwind label %21

14:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  %.not38 = icmp slt i32 %7, 1
  br i1 %.not38, label %._crit_edge, label %.lr.ph41.preheader

.lr.ph41.preheader:                               ; preds = %14
  %15 = add nuw i32 %7, 1
  br label %.lr.ph41

._crit_edge:                                      ; preds = %38, %14
  %16 = phi i32 [ 0, %14 ], [ %41, %38 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @_ZN11SegmentTreeIi8MaxTreeQIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(168) %4) #5
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %4) #5
  call void @_ZN21MaximumCliqueIntervalIiED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %3) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #5
  call void @_ZN12IntervalListIiED2Ev(ptr noundef nonnull align 8 dereferenceable(84) %2) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %2) #5
  ret i32 %16

17:                                               ; preds = %1
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %48

19:                                               ; preds = %8
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %47

21:                                               ; preds = %9
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %46

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %38
  %.02440 = phi i32 [ %.125.lcssa, %38 ], [ 1, %.lr.ph41.preheader ]
  %.02639 = phi i32 [ %42, %38 ], [ 1, %.lr.ph41.preheader ]
  %23 = call noundef i32 @_ZNK21MaximumCliqueIntervalIiE21getMaxCliqueSizeAtIdxEi(ptr noundef nonnull align 8 dereferenceable(88) %3, i32 noundef %.02639)
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE21getSortedLeftIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %2, i32 noundef %.02639)
  %25 = call noundef i32 @_ZNK8IntervalIiE7getLeftEv(ptr noundef nonnull align 4 dereferenceable(8) %24)
  %.not2834 = icmp sgt i32 %.02440, %7
  br i1 %.not2834, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph41, %33
  %.12535 = phi i32 [ %34, %33 ], [ %.02440, %.lr.ph41 ]
  %26 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE22getSortedRightIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %2, i32 noundef %.12535)
  %27 = call noundef i32 @_ZNK8IntervalIiE8getRightEv(ptr noundef nonnull align 4 dereferenceable(8) %26)
  %28 = icmp slt i32 %27, %25
  br i1 %28, label %29, label %.critedge

29:                                               ; preds = %.lr.ph
  %30 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK12IntervalListIiE22getSortedRightIntervalEi(ptr noundef nonnull align 8 dereferenceable(84) %2, i32 noundef %.12535)
  %31 = call noundef i32 @_ZNK8IntervalIiE7getLeftEv(ptr noundef nonnull align 4 dereferenceable(8) %30)
  %32 = call noundef i32 @_ZNK8IntervalIiE8getRightEv(ptr noundef nonnull align 4 dereferenceable(8) %30)
  invoke void @_ZN7MaxTreeIiE3addEiii(ptr noundef nonnull align 8 dereferenceable(168) %4, i32 noundef %31, i32 noundef %32, i32 noundef 1)
          to label %33 unwind label %35

33:                                               ; preds = %29
  %34 = add i32 %.12535, 1
  %exitcond.not = icmp eq i32 %.12535, %7
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !9

35:                                               ; preds = %29
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %45

.critedge:                                        ; preds = %.lr.ph, %33, %.lr.ph41
  %.125.lcssa = phi i32 [ %.02440, %.lr.ph41 ], [ %15, %33 ], [ %.12535, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %37 = invoke noundef i32 @_ZN7MaxTreeIiE8queryMaxEv(ptr noundef nonnull align 8 dereferenceable(168) %4)
          to label %38 unwind label %43

38:                                               ; preds = %.critedge
  %39 = add nsw i32 %37, %23
  store i32 %39, ptr %6, align 4, !tbaa !5
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %41 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %41, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %42 = add nuw i32 %.02639, 1
  %exitcond42.not = icmp eq i32 %.02639, %7
  br i1 %exitcond42.not, label %._crit_edge, label %.lr.ph41, !llvm.loop !11

43:                                               ; preds = %.critedge
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  br label %45

45:                                               ; preds = %43, %35
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @_ZN11SegmentTreeIi8MaxTreeQIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(168) %4) #5
  br label %46

46:                                               ; preds = %45, %21
  %.pn.pn = phi { ptr, i32 } [ %.pn, %45 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %4) #5
  call void @_ZN21MaximumCliqueIntervalIiED2Ev(ptr noundef nonnull align 8 dereferenceable(88) %3) #5
  br label %47

47:                                               ; preds = %46, %19
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %46 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #5
  br label %48

48:                                               ; preds = %47, %17
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %47 ], [ %18, %17 ]
  call void @_ZN12IntervalListIiED2Ev(ptr noundef nonnull align 8 dereferenceable(84) %2) #5
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12IntervalListIiEC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef nonnull align 8 dereferenceable(84)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12IntervalListIiE19compressCoordinatesEv(ptr noundef nonnull align 8 dereferenceable(84)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21MaximumCliqueIntervalIiEC2ERK12IntervalListIiE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(84)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7MaxTreeIiEC2Eii(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK21MaximumCliqueIntervalIiE21getMaxCliqueSizeAtIdxEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7MaxTreeIiE3addEiii(ptr noundef nonnull align 8 dereferenceable(168), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7MaxTreeIiE8queryMaxEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #3 align 2

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

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

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

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


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