; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101471L)

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

%"struct.std::pair" = type { i32, i32 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, 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.0" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@ord1 = external dso_local global [100001 x i32], align 16
@ord2 = external dso_local global [100001 x i32], align 16
@ord = external dso_local global [100001 x i32], align 16
@a = external dso_local global [100001 x %"struct.std::pair"], align 16
@b = external dso_local global [100001 x %"struct.std::pair"], align 16
@sp = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkv() #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair.0", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %38, %0
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %26
  %28 = getelementptr inbounds %"struct.std::pair", ptr %27, i32 0, i32 0
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %30
  %32 = getelementptr inbounds %"struct.std::pair", ptr %31, i32 0, i32 1
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %28, ptr noundef %32)
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100001 x i32], ptr @ord1, i64 0, i64 %36
  store i32 %34, ptr %37, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %24
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !9

41:                                               ; preds = %23
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr @ord1, i64 %43
  %45 = getelementptr inbounds i32, ptr %44, i64 1
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef getelementptr inbounds (i32, ptr @ord1, i64 1), ptr noundef %45, ptr noundef @_Z4cmp1RKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %65, %41
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %46
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %53
  %55 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 0
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %57
  %59 = getelementptr inbounds %"struct.std::pair", ptr %58, i32 0, i32 1
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %55, ptr noundef %59)
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100001 x i32], ptr @ord2, i64 0, i64 %63
  store i32 %61, ptr %64, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %51
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %3, align 4, !tbaa !5
  br label %46, !llvm.loop !11

68:                                               ; preds = %50
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr @ord2, i64 %70
  %72 = getelementptr inbounds i32, ptr %71, i64 1
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef getelementptr inbounds (i32, ptr @ord2, i64 1), ptr noundef %72, ptr noundef @_Z4cmp2RKiS0_)
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #8
  store i8 1, ptr %4, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %73 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %73, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %74 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %74, ptr %6, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %151, %68
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = icmp sge i32 %76, 1
  br i1 %77, label %79, label %78

78:                                               ; preds = %75
  store i32 8, ptr %7, align 4
  br label %154

79:                                               ; preds = %75
  br label %80

80:                                               ; preds = %116, %79
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = icmp sge i32 %81, 1
  br i1 %82, label %83, label %97

83:                                               ; preds = %80
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100001 x i32], ptr @ord1, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %88
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100001 x i32], ptr @ord2, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %94
  %96 = call noundef zeroext i1 @_ZStleIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %89, ptr noundef nonnull align 4 dereferenceable(8) %95)
  br label %97

97:                                               ; preds = %83, %80
  %98 = phi i1 [ false, %80 ], [ %96, %83 ]
  br i1 %98, label %99, label %119

99:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100001 x i32], ptr @ord2, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %104
  %106 = getelementptr inbounds %"struct.std::pair", ptr %105, i32 0, i32 1
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100001 x i32], ptr @ord2, i64 0, i64 %108
  %110 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %106, ptr noundef nonnull align 4 dereferenceable(4) %109)
  store i64 %110, ptr %8, align 4
  %111 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(8) %8)
  %112 = getelementptr inbounds { ptr, i8 }, ptr %9, i32 0, i32 0
  %113 = extractvalue { ptr, i8 } %111, 0
  store ptr %113, ptr %112, align 8
  %114 = getelementptr inbounds { ptr, i8 }, ptr %9, i32 0, i32 1
  %115 = extractvalue { ptr, i8 } %111, 1
  store i8 %115, ptr %114, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %116

116:                                              ; preds = %99
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr %6, align 4, !tbaa !5
  br label %80, !llvm.loop !14

119:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100001 x i32], ptr @ord1, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %124
  %126 = getelementptr inbounds %"struct.std::pair", ptr %125, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  %127 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %126, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i64 %127, ptr %11, align 4
  %128 = call ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE11lower_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %129 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %128, ptr %129, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %130 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #8
  %131 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  %132 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br i1 %132, label %133, label %134

133:                                              ; preds = %119
  store i8 0, ptr %4, align 1, !tbaa !12
  store i32 8, ptr %7, align 4
  br label %148

134:                                              ; preds = %119
  %135 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  %136 = getelementptr inbounds %"struct.std::pair", ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !15
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100001 x i32], ptr @ord1, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %142
  store i32 %137, ptr %143, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %10, i64 8, i1 false), !tbaa.struct !17
  %144 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8
  %146 = call ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr %145)
  %147 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  store i32 0, ptr %7, align 4
  br label %148

148:                                              ; preds = %134, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %149 = load i32, ptr %7, align 4
  switch i32 %149, label %154 [
    i32 0, label %150
  ]

150:                                              ; preds = %148
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %5, align 4, !tbaa !5
  %153 = add nsw i32 %152, -1
  store i32 %153, ptr %5, align 4, !tbaa !5
  br label %75, !llvm.loop !20

154:                                              ; preds = %148, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %155

155:                                              ; preds = %154
  %156 = load i8, ptr %4, align 1, !tbaa !12, !range !21, !noundef !22
  %157 = trunc i8 %156 to i1
  br i1 %157, label %158, label %193

158:                                              ; preds = %155
  %159 = call noundef zeroext i1 @_Z5checkv()
  %160 = zext i1 %159 to i8
  store i8 %160, ptr %4, align 1, !tbaa !12
  %161 = load i8, ptr %4, align 1, !tbaa !12, !range !21, !noundef !22
  %162 = trunc i8 %161 to i1
  br i1 %162, label %163, label %192

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

164:                                              ; preds = %186, %163
  %165 = load i32, ptr %16, align 4, !tbaa !5
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = icmp sle i32 %165, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %189

169:                                              ; preds = %164
  %170 = load i32, ptr %16, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %171
  %173 = getelementptr inbounds %"struct.std::pair", ptr %172, i32 0, i32 0
  %174 = load i32, ptr %16, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %175
  %177 = getelementptr inbounds %"struct.std::pair", ptr %176, i32 0, i32 1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %173, ptr noundef nonnull align 4 dereferenceable(4) %177) #8
  %178 = load i32, ptr %16, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %179
  %181 = getelementptr inbounds %"struct.std::pair", ptr %180, i32 0, i32 0
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %183
  %185 = getelementptr inbounds %"struct.std::pair", ptr %184, i32 0, i32 1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %181, ptr noundef nonnull align 4 dereferenceable(4) %185) #8
  br label %186

186:                                              ; preds = %169
  %187 = load i32, ptr %16, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %16, align 4, !tbaa !5
  br label %164, !llvm.loop !23

189:                                              ; preds = %168
  %190 = call noundef zeroext i1 @_Z5checkv()
  %191 = zext i1 %190 to i8
  store i8 %191, ptr %4, align 1, !tbaa !12
  br label %192

192:                                              ; preds = %189, %158
  br label %193

193:                                              ; preds = %192, %155
  %194 = load i8, ptr %4, align 1, !tbaa !12, !range !21, !noundef !22
  %195 = trunc i8 %194 to i1
  br i1 %195, label %196, label %212

196:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %197

197:                                              ; preds = %208, %196
  %198 = load i32, ptr %17, align 4, !tbaa !5
  %199 = load i32, ptr @n, align 4, !tbaa !5
  %200 = icmp sle i32 %198, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %211

202:                                              ; preds = %197
  %203 = load i32, ptr %17, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %206)
  br label %208

208:                                              ; preds = %202
  %209 = load i32, ptr %17, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %17, align 4, !tbaa !5
  br label %197, !llvm.loop !24

211:                                              ; preds = %201
  br label %214

212:                                              ; preds = %193
  %213 = call i32 @puts(ptr noundef @.str.3)
  br label %214

214:                                              ; preds = %212, %211
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #8
  %215 = load i32, ptr %1, align 4
  ret i32 %215
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStleIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #6

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

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

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

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

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

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

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

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

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

declare i32 @puts(ptr noundef) #4

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

%"struct.std::pair" = type { i32, i32 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, 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::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@ord1 = external dso_local global [100001 x i32], align 16
@ord2 = external dso_local global [100001 x i32], align 16
@ord = external dso_local local_unnamed_addr global [100001 x i32], align 16
@a = external dso_local global [100001 x %"struct.std::pair"], align 16
@b = external dso_local global [100001 x %"struct.std::pair"], align 16
@sp = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z4cmp2RKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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 uwtable
declare dso_local noundef zeroext i1 @_Z5checkv() local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not59 = icmp slt i32 %7, 1
  br i1 %.not59, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %7 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %8 = getelementptr inbounds i32, ptr @ord1, i64 %.pre-phi
  %9 = getelementptr inbounds i8, ptr %8, i64 4
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @ord1, i64 4), ptr noundef nonnull %9, ptr noundef nonnull @_Z4cmp1RKiS0_)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %.not4861 = icmp slt i32 %10, 1
  br i1 %.not4861, label %._crit_edge.._crit_edge65_crit_edge, label %.lr.ph64

._crit_edge.._crit_edge65_crit_edge:              ; preds = %._crit_edge
  %.pre100 = sext i32 %10 to i64
  br label %._crit_edge65

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %11 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv
  %12 = getelementptr inbounds i8, ptr %11, i64 4
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %14 = getelementptr inbounds [100001 x i32], ptr @ord1, i64 0, i64 %indvars.iv
  %15 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %15, ptr %14, align 4, !tbaa !5
  %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
  %.not.not = icmp slt i64 %indvars.iv, %17
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge65:                                    ; preds = %.lr.ph64, %._crit_edge.._crit_edge65_crit_edge
  %.pre-phi101 = phi i64 [ %.pre100, %._crit_edge.._crit_edge65_crit_edge ], [ %29, %.lr.ph64 ]
  %18 = getelementptr inbounds i32, ptr @ord2, i64 %.pre-phi101
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @ord2, i64 4), ptr noundef nonnull %19, ptr noundef nonnull @_Z4cmp2RKiS0_)
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.preheader57.preheader, label %._crit_edge74

.preheader57.preheader:                           ; preds = %._crit_edge65
  %22 = zext nneg i32 %20 to i64
  br label %.preheader57

.lr.ph64:                                         ; preds = %._crit_edge, %.lr.ph64
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph64 ], [ 1, %._crit_edge ]
  %23 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %indvars.iv85
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  %25 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %23, ptr noundef nonnull %24)
  %26 = getelementptr inbounds [100001 x i32], ptr @ord2, i64 0, i64 %indvars.iv85
  %27 = trunc nuw nsw i64 %indvars.iv85 to i32
  store i32 %27, ptr %26, align 4, !tbaa !5
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %.not48.not = icmp slt i64 %indvars.iv85, %29
  br i1 %.not48.not, label %.lr.ph64, label %._crit_edge65, !llvm.loop !11

.preheader57:                                     ; preds = %.preheader57.preheader, %58
  %indvars.iv91 = phi i64 [ %22, %.preheader57.preheader ], [ %indvars.iv.next92, %58 ]
  %.04373 = phi i32 [ %20, %.preheader57.preheader ], [ %.144.lcssa, %58 ]
  %30 = icmp sgt i32 %.04373, 0
  br i1 %30, label %.lr.ph68, label %.critedge

.lr.ph68:                                         ; preds = %.preheader57
  %31 = getelementptr inbounds [100001 x i32], ptr @ord1, i64 0, i64 %indvars.iv91
  %32 = zext nneg i32 %.04373 to i64
  br label %33

33:                                               ; preds = %.lr.ph68, %42
  %indvars.iv88 = phi i64 [ %32, %.lr.ph68 ], [ %indvars.iv.next89, %42 ]
  %34 = load i32, ptr %31, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %35
  %37 = getelementptr inbounds [100001 x i32], ptr @ord2, i64 0, i64 %indvars.iv88
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %39
  %41 = call noundef zeroext i1 @_ZStleIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %36, ptr noundef nonnull align 4 dereferenceable(8) %40)
  br i1 %41, label %42, label %.critedge.loopexit.split.loop.exit103

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %43 = load i32, ptr %37, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %44, i32 1
  %46 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %45, ptr noundef nonnull align 4 dereferenceable(4) %37)
  store i64 %46, ptr %1, align 8
  %47 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
  %48 = icmp sgt i64 %indvars.iv88, 1
  br i1 %48, label %33, label %.critedge, !llvm.loop !12

.critedge.loopexit.split.loop.exit103:            ; preds = %33
  %49 = trunc nuw nsw i64 %indvars.iv88 to i32
  br label %.critedge

.critedge:                                        ; preds = %42, %.critedge.loopexit.split.loop.exit103, %.preheader57
  %.144.lcssa = phi i32 [ %.04373, %.preheader57 ], [ %49, %.critedge.loopexit.split.loop.exit103 ], [ 0, %42 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %50 = getelementptr inbounds [100001 x i32], ptr @ord1, i64 0, i64 %indvars.iv91
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %52, i32 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  %54 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %54, ptr %3, align 8
  %55 = call ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE11lower_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store ptr %55, ptr %2, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %56 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #7
  store ptr %56, ptr %5, align 8
  %57 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br i1 %57, label %.thread52, label %58

.thread52:                                        ; preds = %.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %.thread54

58:                                               ; preds = %.critedge
  %59 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  %60 = getelementptr inbounds i8, ptr %59, i64 4
  %61 = load i32, ptr %60, align 4, !tbaa !13
  %62 = load i32, ptr %50, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %63
  store i32 %61, ptr %64, align 4, !tbaa !5
  %.sroa.09.0.copyload = load ptr, ptr %2, align 8, !tbaa !15
  %65 = call ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr %.sroa.09.0.copyload)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %indvars.iv.next92 = add nsw i64 %indvars.iv91, -1
  %66 = icmp sgt i64 %indvars.iv91, 1
  br i1 %66, label %.preheader57, label %._crit_edge74, !llvm.loop !17

._crit_edge74:                                    ; preds = %58, %._crit_edge65
  %67 = call noundef zeroext i1 @_Z5checkv()
  br i1 %67, label %.preheader56, label %.thread54

.preheader56:                                     ; preds = %._crit_edge74
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %.not4975 = icmp slt i32 %68, 1
  br i1 %.not4975, label %._crit_edge78, label %.lr.ph77

._crit_edge78:                                    ; preds = %.lr.ph77, %.preheader56
  %69 = call noundef zeroext i1 @_Z5checkv()
  br i1 %69, label %.preheader, label %.thread54

.preheader:                                       ; preds = %._crit_edge78
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %.not5079 = icmp slt i32 %70, 1
  br i1 %.not5079, label %.loopexit, label %.lr.ph81

.lr.ph77:                                         ; preds = %.preheader56, %.lr.ph77
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph77 ], [ 1, %.preheader56 ]
  %71 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv94
  %72 = getelementptr inbounds i8, ptr %71, i64 4
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %71, ptr noundef nonnull align 4 dereferenceable(4) %72) #7
  %73 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @b, i64 0, i64 %indvars.iv94
  %74 = getelementptr inbounds i8, ptr %73, i64 4
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %73, ptr noundef nonnull align 4 dereferenceable(4) %74) #7
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %.not49.not = icmp slt i64 %indvars.iv94, %76
  br i1 %.not49.not, label %.lr.ph77, label %._crit_edge78, !llvm.loop !18

.lr.ph81:                                         ; preds = %.preheader, %.lr.ph81
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %.lr.ph81 ], [ 1, %.preheader ]
  %77 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv97
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %78)
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %.not50.not = icmp slt i64 %indvars.iv97, %81
  br i1 %.not50.not, label %.lr.ph81, label %.loopexit, !llvm.loop !19

.thread54:                                        ; preds = %.thread52, %._crit_edge74, %._crit_edge78
  %82 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph81, %.preheader, %.thread54
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStleIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 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 = { 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 #6 = { 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 #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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 4}
!14 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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