; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/Sears 2016/Problem D (D)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { %"struct.std::pair.0", i32 }
%"struct.std::pair.0" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@root = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@ans = external dso_local global [100100 x i32], align 16
@q = external dso_local global %"class.std::vector", align 8
@cnt = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKSt4pairIS_IiiEiES3_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #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 nounwind uwtable
declare dso_local void @_Z3addi(i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3rmvi(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
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca %"struct.std::pair.0", align 4
  %8 = alloca { i64, i32 }, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %19)
  %21 = fptosi double %20 to i32
  store i32 %21, ptr @root, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %32, %0
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %29
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %30)
  br label %32

32:                                               ; preds = %27
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !9

35:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %49, %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4, ptr noundef %5)
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr %4, align 4, !tbaa !5
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %47 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %47, ptr %7, align 4
  %48 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store { i64, i32 } %48, ptr %8, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %8, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @q, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %49

49:                                               ; preds = %41
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !11

52:                                               ; preds = %40
  %53 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @q) #8
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %53, ptr %54, align 8
  %55 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @q) #8
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %55, ptr %56, align 8
  %57 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8
  %59 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIS2_IiiEiESt6vectorIS4_SaIS4_EEEEPFbRKS4_SB_EEvT_SE_T0_(ptr %58, ptr %60, ptr noundef @_Z3cmpRKSt4pairIS_IiiEiES3_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %61 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #8
  %62 = getelementptr inbounds %"struct.std::pair", ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %"struct.std::pair.0", ptr %62, i32 0, i32 0
  %64 = load i32, ptr %63, align 4, !tbaa !12
  store i32 %64, ptr %11, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %78, %52
  %66 = load i32, ptr %11, align 4, !tbaa !5
  %67 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #8
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 0
  %69 = getelementptr inbounds %"struct.std::pair.0", ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !15
  %71 = icmp sle i32 %66, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %81

73:                                               ; preds = %65
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %77)
  br label %78

78:                                               ; preds = %73
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %11, align 4, !tbaa !5
  br label %65, !llvm.loop !16

81:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %82 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #8
  %83 = getelementptr inbounds %"struct.std::pair", ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %"struct.std::pair.0", ptr %83, i32 0, i32 0
  %85 = load i32, ptr %84, align 4, !tbaa !12
  store i32 %85, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %86 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #8
  %87 = getelementptr inbounds %"struct.std::pair", ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %"struct.std::pair.0", ptr %87, i32 0, i32 1
  %89 = load i32, ptr %88, align 4, !tbaa !15
  store i32 %89, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %160, %81
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = load i32, ptr @m, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %163

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %96 = load i32, ptr %14, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef %97) #8
  %99 = getelementptr inbounds %"struct.std::pair", ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds %"struct.std::pair.0", ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 4, !tbaa !12
  store i32 %101, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %102 = load i32, ptr %14, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef %103) #8
  %105 = getelementptr inbounds %"struct.std::pair", ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds %"struct.std::pair.0", ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !15
  store i32 %107, ptr %16, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %112, %95
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = load i32, ptr %15, align 4, !tbaa !5
  %111 = icmp sgt i32 %109, %110
  br i1 %111, label %112, label %118

112:                                              ; preds = %108
  %113 = load i32, ptr %12, align 4, !tbaa !5
  %114 = add nsw i32 %113, -1
  store i32 %114, ptr %12, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %117)
  br label %108, !llvm.loop !17

118:                                              ; preds = %108
  br label %119

119:                                              ; preds = %123, %118
  %120 = load i32, ptr %13, align 4, !tbaa !5
  %121 = load i32, ptr %16, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %123, label %129

123:                                              ; preds = %119
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %13, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %128)
  br label %119, !llvm.loop !18

129:                                              ; preds = %119
  br label %130

130:                                              ; preds = %134, %129
  %131 = load i32, ptr %12, align 4, !tbaa !5
  %132 = load i32, ptr %15, align 4, !tbaa !5
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %140

134:                                              ; preds = %130
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %12, align 4, !tbaa !5
  %137 = sext i32 %135 to i64
  %138 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  call void @_Z3rmvi(i32 noundef %139)
  br label %130, !llvm.loop !19

140:                                              ; preds = %130
  br label %141

141:                                              ; preds = %145, %140
  %142 = load i32, ptr %13, align 4, !tbaa !5
  %143 = load i32, ptr %16, align 4, !tbaa !5
  %144 = icmp sgt i32 %142, %143
  br i1 %144, label %145, label %151

145:                                              ; preds = %141
  %146 = load i32, ptr %13, align 4, !tbaa !5
  %147 = add nsw i32 %146, -1
  store i32 %147, ptr %13, align 4, !tbaa !5
  %148 = sext i32 %146 to i64
  %149 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  call void @_Z3rmvi(i32 noundef %150)
  br label %141, !llvm.loop !20

151:                                              ; preds = %141
  %152 = load i32, ptr @cnt, align 4, !tbaa !5
  %153 = load i32, ptr %14, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef %154) #8
  %156 = getelementptr inbounds %"struct.std::pair", ptr %155, i32 0, i32 1
  %157 = load i32, ptr %156, align 4, !tbaa !21
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [100100 x i32], ptr @ans, i64 0, i64 %158
  store i32 %152, ptr %159, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %160

160:                                              ; preds = %151
  %161 = load i32, ptr %14, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %14, align 4, !tbaa !5
  br label %90, !llvm.loop !22

163:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %175, %163
  %165 = load i32, ptr %17, align 4, !tbaa !5
  %166 = load i32, ptr @m, align 4, !tbaa !5
  %167 = icmp slt i32 %165, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %178

169:                                              ; preds = %164
  %170 = load i32, ptr %17, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100100 x i32], ptr @ans, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %173)
  br label %175

175:                                              ; preds = %169
  %176 = load i32, ptr %17, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %17, align 4, !tbaa !5
  br label %164, !llvm.loop !23

178:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { %"struct.std::pair.0", i32 }
%"struct.std::pair.0" = type { i32, i32 }

@root = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@ans = external dso_local local_unnamed_addr global [100100 x i32], align 16
@q = external dso_local global %"class.std::vector", align 8
@cnt = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKSt4pairIS_IiiEiES3_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair.0", align 8
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %7)
  %9 = fptosi double %8 to i32
  store i32 %9, ptr @root, align 4, !tbaa !5
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph40, label %._crit_edge41

.lr.ph40:                                         ; preds = %._crit_edge
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %27

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge41:                                    ; preds = %27, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %19 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @q) #7
  %20 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @q) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIS2_IiiEiESt6vectorIS4_SaIS4_EEEEPFbRKS4_SB_EEvT_SE_T0_(ptr %19, ptr %20, ptr noundef nonnull @_Z3cmpRKSt4pairIS_IiiEiES3_)
  %21 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #7
  %22 = load i32, ptr %21, align 4, !tbaa !11
  %23 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #7
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  %25 = load i32, ptr %24, align 4, !tbaa !14
  %.not42 = icmp sgt i32 %22, %25
  br i1 %.not42, label %._crit_edge46, label %.lr.ph45.preheader

.lr.ph45.preheader:                               ; preds = %._crit_edge41
  %26 = sext i32 %22 to i64
  br label %.lr.ph45

27:                                               ; preds = %.lr.ph40, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %33 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %33, ptr %5, align 8
  %34 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.fca.0.extract = extractvalue { i64, i32 } %34, 0
  %.fca.1.extract = extractvalue { i64, i32 } %34, 1
  store i64 %.fca.0.extract, ptr %4, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @q, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %1, align 4, !tbaa !5
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %27, label %._crit_edge41, !llvm.loop !15

._crit_edge46:                                    ; preds = %.lr.ph45, %._crit_edge41
  %39 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #7
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #7
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph64.preheader, label %._crit_edge67

.lr.ph64.preheader:                               ; preds = %._crit_edge46
  %44 = getelementptr inbounds i8, ptr %41, i64 4
  %45 = load i32, ptr %44, align 4, !tbaa !14
  br label %.lr.ph64

.lr.ph45:                                         ; preds = %.lr.ph45.preheader, %.lr.ph45
  %indvars.iv72 = phi i64 [ %26, %.lr.ph45.preheader ], [ %indvars.iv.next73, %.lr.ph45 ]
  %46 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv72
  %47 = load i32, ptr %46, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %47)
  %indvars.iv.next73 = add nsw i64 %indvars.iv72, 1
  %48 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef 0) #7
  %49 = getelementptr inbounds i8, ptr %48, i64 4
  %50 = load i32, ptr %49, align 4, !tbaa !14
  %51 = sext i32 %50 to i64
  %.not.not = icmp slt i64 %indvars.iv72, %51
  br i1 %.not.not, label %.lr.ph45, label %._crit_edge46, !llvm.loop !16

.preheader:                                       ; preds = %._crit_edge58
  %52 = icmp sgt i32 %87, 0
  br i1 %52, label %.lr.ph66, label %._crit_edge67

.lr.ph64:                                         ; preds = %.lr.ph64.preheader, %._crit_edge58
  %indvars.iv88 = phi i64 [ 0, %.lr.ph64.preheader ], [ %indvars.iv.next89, %._crit_edge58 ]
  %.03161 = phi i32 [ %45, %.lr.ph64.preheader ], [ %.2.lcssa, %._crit_edge58 ]
  %.03260 = phi i32 [ %40, %.lr.ph64.preheader ], [ %.234.lcssa, %._crit_edge58 ]
  %53 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef %indvars.iv88) #7
  %54 = load i32, ptr %53, align 4, !tbaa !11
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef %indvars.iv88) #7
  %56 = getelementptr inbounds i8, ptr %55, i64 4
  %57 = load i32, ptr %56, align 4, !tbaa !14
  %58 = icmp sgt i32 %.03260, %54
  br i1 %58, label %.lr.ph49.preheader, label %.preheader37

.lr.ph49.preheader:                               ; preds = %.lr.ph64
  %59 = sext i32 %.03260 to i64
  %60 = sext i32 %54 to i64
  br label %.lr.ph49

.preheader37.loopexit:                            ; preds = %.lr.ph49
  %61 = trunc nsw i64 %indvars.iv.next76 to i32
  br label %.preheader37

.preheader37:                                     ; preds = %.preheader37.loopexit, %.lr.ph64
  %.133.lcssa = phi i32 [ %.03260, %.lr.ph64 ], [ %61, %.preheader37.loopexit ]
  %62 = icmp slt i32 %.03161, %57
  br i1 %62, label %.lr.ph51.preheader, label %.preheader36

.lr.ph51.preheader:                               ; preds = %.preheader37
  %63 = sext i32 %.03161 to i64
  %wide.trip.count = sext i32 %57 to i64
  br label %.lr.ph51

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %.lr.ph49
  %indvars.iv75 = phi i64 [ %59, %.lr.ph49.preheader ], [ %indvars.iv.next76, %.lr.ph49 ]
  %indvars.iv.next76 = add nsw i64 %indvars.iv75, -1
  %64 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv.next76
  %65 = load i32, ptr %64, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %65)
  %66 = icmp sgt i64 %indvars.iv.next76, %60
  br i1 %66, label %.lr.ph49, label %.preheader37.loopexit, !llvm.loop !17

.preheader36:                                     ; preds = %.lr.ph51, %.preheader37
  %.1.lcssa = phi i32 [ %.03161, %.preheader37 ], [ %57, %.lr.ph51 ]
  %67 = icmp slt i32 %.133.lcssa, %54
  br i1 %67, label %.lr.ph54.preheader, label %.preheader35

.lr.ph54.preheader:                               ; preds = %.preheader36
  %68 = sext i32 %.133.lcssa to i64
  %69 = sext i32 %54 to i64
  br label %.lr.ph54

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %.lr.ph51
  %indvars.iv78 = phi i64 [ %63, %.lr.ph51.preheader ], [ %indvars.iv.next79, %.lr.ph51 ]
  %indvars.iv.next79 = add nsw i64 %indvars.iv78, 1
  %70 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv.next79
  %71 = load i32, ptr %70, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %71)
  %exitcond.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count
  br i1 %exitcond.not, label %.preheader36, label %.lr.ph51, !llvm.loop !18

.preheader35:                                     ; preds = %.lr.ph54, %.preheader36
  %.234.lcssa = phi i32 [ %.133.lcssa, %.preheader36 ], [ %54, %.lr.ph54 ]
  %72 = icmp sgt i32 %.1.lcssa, %57
  br i1 %72, label %.lr.ph57.preheader, label %._crit_edge58

.lr.ph57.preheader:                               ; preds = %.preheader35
  %73 = sext i32 %.1.lcssa to i64
  %74 = sext i32 %57 to i64
  br label %.lr.ph57

.lr.ph54:                                         ; preds = %.lr.ph54.preheader, %.lr.ph54
  %indvars.iv81 = phi i64 [ %68, %.lr.ph54.preheader ], [ %indvars.iv.next82, %.lr.ph54 ]
  %indvars.iv.next82 = add nsw i64 %indvars.iv81, 1
  %75 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv81
  %76 = load i32, ptr %75, align 4, !tbaa !5
  call void @_Z3rmvi(i32 noundef %76)
  %exitcond84.not = icmp eq i64 %indvars.iv.next82, %69
  br i1 %exitcond84.not, label %.preheader35, label %.lr.ph54, !llvm.loop !19

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %.lr.ph57
  %indvars.iv85 = phi i64 [ %73, %.lr.ph57.preheader ], [ %indvars.iv.next86, %.lr.ph57 ]
  %indvars.iv.next86 = add nsw i64 %indvars.iv85, -1
  %77 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv85
  %78 = load i32, ptr %77, align 4, !tbaa !5
  call void @_Z3rmvi(i32 noundef %78)
  %79 = icmp sgt i64 %indvars.iv.next86, %74
  br i1 %79, label %.lr.ph57, label %._crit_edge58.loopexit, !llvm.loop !20

._crit_edge58.loopexit:                           ; preds = %.lr.ph57
  %80 = trunc nsw i64 %indvars.iv.next86 to i32
  br label %._crit_edge58

._crit_edge58:                                    ; preds = %._crit_edge58.loopexit, %.preheader35
  %.2.lcssa = phi i32 [ %.1.lcssa, %.preheader35 ], [ %80, %._crit_edge58.loopexit ]
  %81 = load i32, ptr @cnt, align 4, !tbaa !5
  %82 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @q, i64 noundef %indvars.iv88) #7
  %83 = getelementptr inbounds i8, ptr %82, i64 8
  %84 = load i32, ptr %83, align 4, !tbaa !21
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100100 x i32], ptr @ans, i64 0, i64 %85
  store i32 %81, ptr %86, align 4, !tbaa !5
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %87 = load i32, ptr @m, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next89, %88
  br i1 %89, label %.lr.ph64, label %.preheader, !llvm.loop !22

._crit_edge67:                                    ; preds = %.lr.ph66, %._crit_edge46, %.preheader
  ret i32 0

.lr.ph66:                                         ; preds = %.preheader, %.lr.ph66
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.lr.ph66 ], [ 0, %.preheader ]
  %90 = getelementptr inbounds [100100 x i32], ptr @ans, i64 0, i64 %indvars.iv91
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %91)
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %93 = load i32, ptr @m, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = icmp slt i64 %indvars.iv.next92, %94
  br i1 %95, label %.lr.ph66, label %._crit_edge67, !llvm.loop !23
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIS_IiiEiE", !13, i64 0, !6, i64 8}
!13 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!14 = !{!12, !6, i64 4}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!12, !6, i64 8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


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