; LLVM IR from tangjz/acm-icpc :: lydsy (4725)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::pair<int, int>>, std::_Select1st<std::pair<const int, std::pair<int, int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::pair<int, int>>, std::_Select1st<std::pair<const int, std::pair<int, int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.0" = type { i32, %"struct.std::pair" }

@n = external dso_local global i32, align 4
@r = external dso_local global [101 x i32], align 16
@tot = external dso_local global i32, align 4
@que = external dso_local global [1449 x i32], align 16
@f = external dso_local global [101 x i64], align 16
@Hash = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair", align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 4
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([101 x i32], ptr @r, i64 0, i64 1), align 4, !tbaa !5
  store i64 1, ptr getelementptr inbounds ([101 x i64], ptr @f, i64 0, i64 1), align 8, !tbaa !9
  store i32 2, ptr getelementptr inbounds ([101 x i32], ptr @r, i64 0, i64 2), align 8, !tbaa !5
  store i64 2, ptr getelementptr inbounds ([101 x i64], ptr @f, i64 0, i64 2), align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 2, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  %18 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %18, ptr %2, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %19 = load i64, ptr getelementptr inbounds ([101 x i64], ptr @f, i64 0, i64 2), align 16, !tbaa !9
  %20 = load i64, ptr getelementptr inbounds ([101 x i64], ptr @f, i64 0, i64 1), align 8, !tbaa !9
  %21 = sub nsw i64 %19, %20
  %22 = trunc i64 %21 to i32
  store i32 %22, ptr %5, align 4, !tbaa !5
  %23 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  store i32 3, ptr @n, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %126, %0
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = and i32 %26, 1
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %36

29:                                               ; preds = %25
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = sub nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = shl i64 %34, 1
  br label %49

36:                                               ; preds = %25
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = sub nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = add nsw i64 %41, %47
  br label %49

49:                                               ; preds = %36, %29
  %50 = phi i64 [ %35, %29 ], [ %48, %36 ]
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %52
  store i64 %50, ptr %53, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %86, %49
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 5, ptr %7, align 4
  br label %89

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sub nsw i32 %64, %65
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !9
  %70 = sub nsw i64 %63, %69
  store i64 %70, ptr %8, align 8, !tbaa !9
  %71 = load i64, ptr %8, align 8, !tbaa !9
  %72 = icmp sge i64 %71, 1000000001
  br i1 %72, label %73, label %74

73:                                               ; preds = %59
  store i32 5, ptr %7, align 4
  br label %83

74:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sub nsw i32 %75, %76
  store i32 %77, ptr %10, align 4, !tbaa !5
  %78 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %78, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %79 = load i64, ptr %8, align 8, !tbaa !9
  %80 = trunc i64 %79 to i32
  store i32 %80, ptr %11, align 4, !tbaa !5
  %81 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %82 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %81, ptr noundef nonnull align 4 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  store i32 0, ptr %7, align 4
  br label %83

83:                                               ; preds = %74, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %84 = load i32, ptr %7, align 4
  switch i32 %84, label %89 [
    i32 0, label %85
  ]

85:                                               ; preds = %83
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !5
  br label %54, !llvm.loop !11

89:                                               ; preds = %83, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %97
  store i32 %95, ptr %98, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %106, %90
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %101
  %103 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %102)
  %104 = icmp ne i64 %103, 0
  br i1 %104, label %105, label %112

105:                                              ; preds = %99
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %109, align 4, !tbaa !5
  br label %99, !llvm.loop !13

112:                                              ; preds = %99
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !9
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = sub nsw i64 %116, %121
  %123 = icmp sge i64 %122, 1000000001
  br i1 %123, label %124, label %125

124:                                              ; preds = %112
  br label %129

125:                                              ; preds = %112
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr @n, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr @n, align 4, !tbaa !5
  br label %25, !llvm.loop !14

129:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %130 = call ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #7
  %131 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %12, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  br label %132

132:                                              ; preds = %145, %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %133 = call ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #7
  %134 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  %135 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %147

137:                                              ; preds = %132
  %138 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %139 = getelementptr inbounds %"struct.std::pair.0", ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 4, !tbaa !15
  %141 = load i32, ptr @tot, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr @tot, align 4, !tbaa !5
  %143 = sext i32 %141 to i64
  %144 = getelementptr inbounds [1449 x i32], ptr @que, i64 0, i64 %143
  store i32 %140, ptr %144, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %137
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br label %132, !llvm.loop !18

147:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %148 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %14)
  br label %149

149:                                              ; preds = %187, %147
  %150 = load i32, ptr %14, align 4, !tbaa !5
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %14, align 4, !tbaa !5
  %152 = icmp ne i32 %150, 0
  br i1 %152, label %153, label %188

153:                                              ; preds = %149
  %154 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %15)
  %155 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %156 = icmp ne i64 %155, 0
  br i1 %156, label %157, label %164

157:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %158 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %158, i64 8, i1 false)
  %159 = getelementptr inbounds %"struct.std::pair", ptr %16, i32 0, i32 0
  %160 = load i32, ptr %159, align 4, !tbaa !19
  %161 = getelementptr inbounds %"struct.std::pair", ptr %16, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !20
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %160, i32 noundef %162)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %187

164:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %165 = load i32, ptr %15, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = load i32, ptr @tot, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds i32, ptr @que, i64 %168
  %170 = call noundef ptr @_ZSt11upper_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %169, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %171 = ptrtoint ptr %170 to i64
  %172 = sub i64 %171, ptrtoint (ptr @que to i64)
  %173 = sdiv exact i64 %172, 4
  %174 = sub nsw i64 %166, %173
  %175 = sub nsw i64 %174, 1
  %176 = trunc i64 %175 to i32
  store i32 %176, ptr %17, align 4, !tbaa !5
  %177 = load i32, ptr @n, align 4, !tbaa !5
  %178 = load i32, ptr %17, align 4, !tbaa !5
  %179 = shl i32 %178, 1
  %180 = add nsw i32 %177, %179
  %181 = add nsw i32 %180, 1
  %182 = load i32, ptr @n, align 4, !tbaa !5
  %183 = load i32, ptr %17, align 4, !tbaa !5
  %184 = shl i32 %183, 1
  %185 = add nsw i32 %182, %184
  %186 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %181, i32 noundef %185)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %187

187:                                              ; preds = %164, %157
  br label %149, !llvm.loop !21

188:                                              ; preds = %149
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  %189 = load i32, ptr %1, align 4
  ret i32 %189
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; 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 i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIKiS_IiiEE", !6, i64 0, !17, i64 4}
!17 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!18 = distinct !{!18, !12}
!19 = !{!17, !6, i64 0}
!20 = !{!17, !6, i64 4}
!21 = distinct !{!21, !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.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::pair<int, int>>, std::_Select1st<std::pair<const int, std::pair<int, int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::pair<int, int>>, std::_Select1st<std::pair<const int, std::pair<int, int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@r = external dso_local global [101 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [1449 x i32], align 16
@f = external dso_local local_unnamed_addr global [101 x i64], align 16
@Hash = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 1, ptr getelementptr inbounds (i8, ptr @r, i64 4), align 4, !tbaa !5
  store i64 1, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !9
  store i32 2, ptr getelementptr inbounds (i8, ptr @r, i64 8), align 8, !tbaa !5
  store i64 2, ptr getelementptr inbounds (i8, ptr @f, i64 16), align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 2, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  %12 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %12, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %13 = load i64, ptr getelementptr inbounds (i8, ptr @f, i64 16), align 16, !tbaa !9
  %14 = load i64, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !9
  %15 = sub nsw i64 %13, %14
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %4, align 4, !tbaa !5
  %17 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %18 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %1) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  br label %19

19:                                               ; preds = %._crit_edge, %0
  %20 = phi i32 [ 3, %0 ], [ %79, %._crit_edge ]
  store i32 %20, ptr @n, align 4, !tbaa !5
  %21 = and i32 %20, 1
  %.not = icmp eq i32 %21, 0
  %22 = add nsw i32 %20, -1
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %23
  %25 = load i64, ptr %24, align 8, !tbaa !9
  br i1 %.not, label %28, label %26

26:                                               ; preds = %19
  %27 = shl i64 %25, 1
  br label %33

28:                                               ; preds = %19
  %29 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %23
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = add nsw i64 %25, %31
  br label %33

33:                                               ; preds = %28, %26
  %34 = phi i64 [ %27, %26 ], [ %32, %28 ]
  %35 = sext i32 %20 to i64
  %36 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %35
  store i64 %34, ptr %36, align 8, !tbaa !9
  %37 = icmp sgt i32 %20, 1
  br i1 %37, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %33, %48
  %38 = phi i32 [ %54, %48 ], [ %20, %33 ]
  %.016 = phi i32 [ %53, %48 ], [ 1, %33 ]
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = sub nsw i32 %38, %.016
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = sub nsw i64 %41, %45
  %47 = icmp slt i64 %46, 1000000001
  br i1 %47, label %48, label %.critedge

48:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 %42, ptr %6, align 4, !tbaa !5
  %49 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %49, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %50 = trunc i64 %46 to i32
  store i32 %50, ptr %7, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %52 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %51, ptr noundef nonnull align 4 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %53 = add nuw nsw i32 %.016, 1
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %.lr.ph, label %..critedge.loopexit_crit_edge, !llvm.loop !11

..critedge.loopexit_crit_edge:                    ; preds = %48
  %.pre28 = sext i32 %54 to i64
  br label %.critedge

.critedge:                                        ; preds = %.lr.ph, %..critedge.loopexit_crit_edge, %33
  %.pre-phi = phi i64 [ %35, %33 ], [ %.pre28, %..critedge.loopexit_crit_edge ], [ %39, %.lr.ph ]
  %56 = phi i32 [ %20, %33 ], [ %54, %..critedge.loopexit_crit_edge ], [ %38, %.lr.ph ]
  %57 = add nsw i32 %56, -1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %.pre-phi
  store i32 %60, ptr %61, align 4, !tbaa !5
  %62 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %61)
  %.not1319 = icmp eq i64 %62, 0
  br i1 %.not1319, label %._crit_edge, label %.lr.ph20

.lr.ph20:                                         ; preds = %.critedge, %.lr.ph20
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [101 x i32], ptr @r, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %65, align 4, !tbaa !5
  %68 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %65)
  %.not13 = icmp eq i64 %68, 0
  br i1 %.not13, label %._crit_edge, label %.lr.ph20, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph20, %.critedge
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = add nsw i32 %69, -1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [101 x i64], ptr @f, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !9
  %77 = sub nsw i64 %72, %76
  %78 = icmp sgt i64 %77, 1000000000
  %79 = add nsw i32 %69, 1
  br i1 %78, label %80, label %19, !llvm.loop !14

80:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %81 = call ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #6
  store ptr %81, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %82 = call ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #6
  store ptr %82, ptr %9, align 8
  %83 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br i1 %83, label %.lr.ph22, label %._crit_edge23

._crit_edge23:                                    ; preds = %.lr.ph22, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %85 = load i32, ptr %10, align 4, !tbaa !5
  %86 = add nsw i32 %85, -1
  store i32 %86, ptr %10, align 4, !tbaa !5
  %.not1424 = icmp eq i32 %85, 0
  br i1 %.not1424, label %._crit_edge27, label %.lr.ph26

.lr.ph22:                                         ; preds = %80, %.lr.ph22
  %87 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %88 = load i32, ptr %87, align 4, !tbaa !15
  %89 = load i32, ptr @tot, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr @tot, align 4, !tbaa !5
  %91 = sext i32 %89 to i64
  %92 = getelementptr inbounds [1449 x i32], ptr @que, i64 0, i64 %91
  store i32 %88, ptr %92, align 4, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %94 = call ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @Hash) #6
  store ptr %94, ptr %9, align 8
  %95 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEES6_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br i1 %95, label %.lr.ph22, label %._crit_edge23, !llvm.loop !18

.lr.ph26:                                         ; preds = %._crit_edge23, %118
  %96 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %11)
  %97 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %.not15 = icmp eq i64 %97, 0
  br i1 %.not15, label %101, label %98

98:                                               ; preds = %.lr.ph26
  %99 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) @Hash, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %.sroa.0.0.copyload = load i32, ptr %99, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %99, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 4
  %100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sroa.0.0.copyload, i32 noundef %.sroa.4.0.copyload)
  br label %118

101:                                              ; preds = %.lr.ph26
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = load i32, ptr @tot, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr @que, i64 %104
  %106 = call noundef ptr @_ZSt11upper_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %105, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %107 = ptrtoint ptr %106 to i64
  %108 = sub i64 %107, ptrtoint (ptr @que to i64)
  %109 = lshr exact i64 %108, 2
  %110 = trunc i64 %109 to i32
  %111 = xor i32 %110, -1
  %112 = add i32 %102, %111
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = shl i32 %112, 1
  %115 = add nsw i32 %114, %113
  %116 = add nsw i32 %115, 1
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %116, i32 noundef %115)
  br label %118

118:                                              ; preds = %101, %98
  %119 = load i32, ptr %10, align 4, !tbaa !5
  %120 = add nsw i32 %119, -1
  store i32 %120, ptr %10, align 4, !tbaa !5
  %.not14 = icmp eq i32 %119, 0
  br i1 %.not14, label %._crit_edge27, label %.lr.ph26, !llvm.loop !19

._crit_edge27:                                    ; preds = %118, %._crit_edge23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  ret i32 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 uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; 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 uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__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 #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiS0_IiiEEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

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

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

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

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


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