; LLVM IR from tangjz/acm-icpc :: leetcode/extra (DD_2020007-多源 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"

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

@n = external dso_local global i32, align 4
@lim = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@ord = external dso_local global [100001 x i32], align 16
@par = external dso_local global [100001 x i32], align 16
@f = external dso_local global [2 x [100001 x %"struct.std::pair"]], align 16
@e = external dso_local global [100001 x %"class.std::vector"], align 16
@sp = external dso_local global [100001 x i8], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair", align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %"struct.std::pair", align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef %2, ptr noundef @lim)
  %32 = icmp eq i32 %31, 3
  br i1 %32, label %33, label %34

33:                                               ; preds = %0
  br label %36

34:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 11, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

35:                                               ; No predecessors!
  br label %36

36:                                               ; preds = %35, %33
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @lim)
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) %37)
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp sle i32 1, %39
  br i1 %40, label %41, label %46

41:                                               ; preds = %36
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @lim)
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) %42)
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp sle i32 %44, 100000
  br label %46

46:                                               ; preds = %41, %36
  %47 = phi i1 [ false, %36 ], [ %45, %41 ]
  br i1 %47, label %48, label %49

48:                                               ; preds = %46
  br label %51

49:                                               ; preds = %46
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 12, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

50:                                               ; No predecessors!
  br label %51

51:                                               ; preds = %50, %48
  br label %52

52:                                               ; preds = %74, %51
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %2, align 4, !tbaa !5
  %55 = icmp ne i32 %53, 0
  br i1 %55, label %56, label %78

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %3)
  %58 = icmp eq i32 %57, 1
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  br label %62

60:                                               ; preds = %56
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 15, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

61:                                               ; No predecessors!
  br label %62

62:                                               ; preds = %61, %59
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = icmp sle i32 1, %63
  br i1 %64, label %65, label %69

65:                                               ; preds = %62
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br label %69

69:                                               ; preds = %65, %62
  %70 = phi i1 [ false, %62 ], [ %68, %65 ]
  br i1 %70, label %71, label %72

71:                                               ; preds = %69
  br label %74

72:                                               ; preds = %69
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.3, i32 noundef 16, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

73:                                               ; No predecessors!
  br label %74

74:                                               ; preds = %73, %71
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100001 x i8], ptr @sp, i64 0, i64 %76
  store i8 1, ptr %77, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %52, !llvm.loop !11

78:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 2, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  br label %79

79:                                               ; preds = %109, %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %84, label %83

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

84:                                               ; preds = %79
  %85 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %5)
  %86 = icmp eq i32 %85, 1
  br i1 %86, label %87, label %88

87:                                               ; preds = %84
  br label %90

88:                                               ; preds = %84
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 20, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

89:                                               ; No predecessors!
  br label %90

90:                                               ; preds = %89, %87
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = icmp sle i32 1, %91
  br i1 %92, label %93, label %97

93:                                               ; preds = %90
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = load i32, ptr @n, align 4, !tbaa !5
  %96 = icmp sle i32 %94, %95
  br label %97

97:                                               ; preds = %93, %90
  %98 = phi i1 [ false, %90 ], [ %96, %93 ]
  br i1 %98, label %99, label %100

99:                                               ; preds = %97
  br label %102

100:                                              ; preds = %97
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.3, i32 noundef 21, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

101:                                              ; No predecessors!
  br label %102

102:                                              ; preds = %101, %99
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %104
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %107
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %108, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %109

109:                                              ; preds = %102
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %4, align 4, !tbaa !5
  br label %79, !llvm.loop !13

112:                                              ; preds = %83
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 -1, ptr getelementptr inbounds ([100001 x i32], ptr @par, i64 0, i64 1), align 4, !tbaa !5
  %113 = load i32, ptr @tot, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr @tot, align 4, !tbaa !5
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %115
  store i32 1, ptr %116, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %181, %112
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = load i32, ptr @tot, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  store i32 7, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %184

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  store i32 %126, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %128
  store ptr %129, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %130 = load ptr, ptr %9, align 8, !tbaa !14
  %131 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %130) #7
  %132 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %131, ptr %132, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %133 = load ptr, ptr %9, align 8, !tbaa !14
  %134 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %133) #7
  %135 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %134, ptr %135, align 8
  br label %136

136:                                              ; preds = %159, %122
  %137 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %137, label %139, label %138

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

139:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %140 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %141 = load i32, ptr %140, align 4, !tbaa !5
  store i32 %141, ptr %12, align 4, !tbaa !5
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = icmp ne i32 %142, %146
  br i1 %147, label %148, label %158

148:                                              ; preds = %139
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = load i32, ptr %12, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %151
  store i32 %149, ptr %152, align 4, !tbaa !5
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = load i32, ptr @tot, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr @tot, align 4, !tbaa !5
  %156 = sext i32 %154 to i64
  %157 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %156
  store i32 %153, ptr %157, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %148, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %159

159:                                              ; preds = %158
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %136

161:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 -1, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 -1, ptr %15, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr getelementptr inbounds ([2 x [100001 x %"struct.std::pair"]], ptr @f, i64 0, i64 1), i64 0, i64 %163
  %165 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %164, ptr noundef nonnull align 4 dereferenceable(8) %13) #7
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %167
  %169 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %168, ptr noundef nonnull align 4 dereferenceable(8) %165)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %170 = load i32, ptr %8, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100001 x i8], ptr @sp, i64 0, i64 %171
  %173 = load i8, ptr %172, align 1, !tbaa !9, !range !16, !noundef !17
  %174 = trunc i8 %173 to i1
  br i1 %174, label %175, label %180

175:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %176 = load i32, ptr %8, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %177
  %179 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %178, ptr noundef nonnull align 4 dereferenceable(8) %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %180

180:                                              ; preds = %175, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %6, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %6, align 4, !tbaa !5
  br label %117, !llvm.loop !18

184:                                              ; preds = %121
  %185 = load i32, ptr @tot, align 4, !tbaa !5
  %186 = load i32, ptr @n, align 4, !tbaa !5
  %187 = icmp eq i32 %185, %186
  br i1 %187, label %188, label %189

188:                                              ; preds = %184
  br label %191

189:                                              ; preds = %184
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.3, i32 noundef 39, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

190:                                              ; No predecessors!
  br label %191

191:                                              ; preds = %190, %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %192 = load i32, ptr @n, align 4, !tbaa !5
  %193 = sub nsw i32 %192, 1
  store i32 %193, ptr %18, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %245, %191
  %195 = load i32, ptr %18, align 4, !tbaa !5
  %196 = icmp sge i32 %195, 0
  br i1 %196, label %198, label %197

197:                                              ; preds = %194
  store i32 12, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %248

198:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %199 = load i32, ptr %18, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  store i32 %202, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %203 = load i32, ptr %19, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  store i32 %206, ptr %20, align 4, !tbaa !5
  %207 = load i32, ptr %20, align 4, !tbaa !5
  %208 = icmp eq i32 %207, -1
  br i1 %208, label %216, label %209

209:                                              ; preds = %198
  %210 = load i32, ptr %19, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %211
  %213 = getelementptr inbounds %"struct.std::pair", ptr %212, i32 0, i32 0
  %214 = load i32, ptr %213, align 8, !tbaa !19
  %215 = icmp slt i32 %214, 0
  br i1 %215, label %216, label %217

216:                                              ; preds = %209, %198
  store i32 14, ptr %7, align 4
  br label %242

217:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %218 = load i32, ptr %19, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %219
  %221 = getelementptr inbounds %"struct.std::pair", ptr %220, i32 0, i32 0
  %222 = load i32, ptr %221, align 8, !tbaa !19
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %22, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  %224 = load i32, ptr %20, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %225
  %227 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %226, ptr noundef nonnull align 4 dereferenceable(8) %21)
  br i1 %227, label %228, label %232

228:                                              ; preds = %217
  %229 = load i32, ptr %20, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %230
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %231, ptr noundef nonnull align 4 dereferenceable(8) %21) #7
  br label %232

232:                                              ; preds = %228, %217
  %233 = load i32, ptr %20, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr getelementptr inbounds ([2 x [100001 x %"struct.std::pair"]], ptr @f, i64 0, i64 1), i64 0, i64 %234
  %236 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %235, ptr noundef nonnull align 4 dereferenceable(8) %21)
  br i1 %236, label %237, label %241

237:                                              ; preds = %232
  %238 = load i32, ptr %20, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr getelementptr inbounds ([2 x [100001 x %"struct.std::pair"]], ptr @f, i64 0, i64 1), i64 0, i64 %239
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %240, ptr noundef nonnull align 4 dereferenceable(8) %21) #7
  br label %241

241:                                              ; preds = %237, %232
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  store i32 0, ptr %7, align 4
  br label %242

242:                                              ; preds = %241, %216
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  %243 = load i32, ptr %7, align 4
  switch i32 %243, label %344 [
    i32 0, label %244
    i32 14, label %245
  ]

244:                                              ; preds = %242
  br label %245

245:                                              ; preds = %244, %242
  %246 = load i32, ptr %18, align 4, !tbaa !5
  %247 = add nsw i32 %246, -1
  store i32 %247, ptr %18, align 4, !tbaa !5
  br label %194, !llvm.loop !21

248:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %317, %248
  %250 = load i32, ptr %24, align 4, !tbaa !5
  %251 = load i32, ptr @n, align 4, !tbaa !5
  %252 = icmp slt i32 %250, %251
  br i1 %252, label %254, label %253

253:                                              ; preds = %249
  store i32 15, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %320

254:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %255 = load i32, ptr %24, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %256
  %258 = load i32, ptr %257, align 4, !tbaa !5
  store i32 %258, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %259 = load i32, ptr %25, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !5
  store i32 %262, ptr %26, align 4, !tbaa !5
  %263 = load i32, ptr %26, align 4, !tbaa !5
  %264 = icmp eq i32 %263, -1
  br i1 %264, label %265, label %266

265:                                              ; preds = %254
  store i32 17, ptr %7, align 4
  br label %314

266:                                              ; preds = %254
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %267 = load i32, ptr %26, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %268
  %270 = getelementptr inbounds %"struct.std::pair", ptr %269, i32 0, i32 1
  %271 = load i32, ptr %270, align 4, !tbaa !22
  %272 = load i32, ptr %25, align 4, !tbaa !5
  %273 = icmp eq i32 %271, %272
  %274 = zext i1 %273 to i32
  store i32 %274, ptr %27, align 4, !tbaa !5
  %275 = load i32, ptr %27, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [2 x [100001 x %"struct.std::pair"]], ptr @f, i64 0, i64 %276
  %278 = load i32, ptr %26, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr %277, i64 0, i64 %279
  %281 = getelementptr inbounds %"struct.std::pair", ptr %280, i32 0, i32 0
  %282 = load i32, ptr %281, align 8, !tbaa !19
  %283 = icmp slt i32 %282, 0
  br i1 %283, label %284, label %285

284:                                              ; preds = %266
  store i32 17, ptr %7, align 4
  br label %313

285:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %286 = load i32, ptr %27, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [2 x [100001 x %"struct.std::pair"]], ptr @f, i64 0, i64 %287
  %289 = load i32, ptr %26, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr %288, i64 0, i64 %290
  %292 = getelementptr inbounds %"struct.std::pair", ptr %291, i32 0, i32 0
  %293 = load i32, ptr %292, align 8, !tbaa !19
  %294 = add nsw i32 %293, 1
  store i32 %294, ptr %29, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %29, ptr noundef nonnull align 4 dereferenceable(4) %26)
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  %295 = load i32, ptr %25, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %296
  %298 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %297, ptr noundef nonnull align 4 dereferenceable(8) %28)
  br i1 %298, label %299, label %303

299:                                              ; preds = %285
  %300 = load i32, ptr %25, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %301
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %302, ptr noundef nonnull align 4 dereferenceable(8) %28) #7
  br label %303

303:                                              ; preds = %299, %285
  %304 = load i32, ptr %25, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr getelementptr inbounds ([2 x [100001 x %"struct.std::pair"]], ptr @f, i64 0, i64 1), i64 0, i64 %305
  %307 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %306, ptr noundef nonnull align 4 dereferenceable(8) %28)
  br i1 %307, label %308, label %312

308:                                              ; preds = %303
  %309 = load i32, ptr %25, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr getelementptr inbounds ([2 x [100001 x %"struct.std::pair"]], ptr @f, i64 0, i64 1), i64 0, i64 %310
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %311, ptr noundef nonnull align 4 dereferenceable(8) %28) #7
  br label %312

312:                                              ; preds = %308, %303
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  store i32 0, ptr %7, align 4
  br label %313

313:                                              ; preds = %312, %284
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %314

314:                                              ; preds = %313, %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  %315 = load i32, ptr %7, align 4
  switch i32 %315, label %344 [
    i32 0, label %316
    i32 17, label %317
  ]

316:                                              ; preds = %314
  br label %317

317:                                              ; preds = %316, %314
  %318 = load i32, ptr %24, align 4, !tbaa !5
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %24, align 4, !tbaa !5
  br label %249, !llvm.loop !23

320:                                              ; preds = %253
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 1, ptr %30, align 4, !tbaa !5
  br label %321

321:                                              ; preds = %337, %320
  %322 = load i32, ptr %30, align 4, !tbaa !5
  %323 = load i32, ptr @n, align 4, !tbaa !5
  %324 = icmp sle i32 %322, %323
  br i1 %324, label %326, label %325

325:                                              ; preds = %321
  store i32 18, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %340

326:                                              ; preds = %321
  %327 = load i32, ptr %30, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %328
  %330 = getelementptr inbounds %"struct.std::pair", ptr %329, i32 0, i32 0
  %331 = load i32, ptr %330, align 8, !tbaa !19
  %332 = load i32, ptr @lim, align 4, !tbaa !5
  %333 = icmp sle i32 %331, %332
  %334 = zext i1 %333 to i32
  %335 = load i32, ptr %23, align 4, !tbaa !5
  %336 = add nsw i32 %335, %334
  store i32 %336, ptr %23, align 4, !tbaa !5
  br label %337

337:                                              ; preds = %326
  %338 = load i32, ptr %30, align 4, !tbaa !5
  %339 = add nsw i32 %338, 1
  store i32 %339, ptr %30, align 4, !tbaa !5
  br label %321, !llvm.loop !24

340:                                              ; preds = %325
  %341 = load i32, ptr %23, align 4, !tbaa !5
  %342 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %341)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %343 = load i32, ptr %1, align 4
  ret i32 %343

344:                                              ; preds = %314, %242
  unreachable
}

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #6 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)) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #6 align 2

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

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

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

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 = { "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 = { noreturn 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 = { 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 }
attributes #8 = { noreturn 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 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}
!19 = !{!20, !6, i64 0}
!20 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!21 = distinct !{!21, !12}
!22 = !{!20, !6, i64 4}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !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"

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

@n = external dso_local global i32, align 4
@lim = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@ord = external dso_local local_unnamed_addr global [100001 x i32], align 16
@par = external dso_local local_unnamed_addr global [100001 x i32], align 16
@f = external dso_local global [2 x [100001 x %"struct.std::pair"]], align 16
@e = external dso_local global [100001 x %"class.std::vector"], align 16
@sp = external dso_local local_unnamed_addr global [100001 x i8], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %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 %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair", align 4
  %18 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %1, ptr noundef nonnull @lim)
  %20 = icmp eq i32 %19, 3
  br i1 %20, label %22, label %21

21:                                               ; preds = %0
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 11, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

22:                                               ; preds = %0
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) @lim)
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %27, label %.critedge

27:                                               ; preds = %22
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) @lim)
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 100001
  br i1 %31, label %.preheader47, label %.critedge

.preheader47:                                     ; preds = %27
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %1, align 4, !tbaa !5
  %.not49 = icmp eq i32 %32, 0
  br i1 %.not49, label %.preheader47.._crit_edge_crit_edge, label %.lr.ph

.preheader47.._crit_edge_crit_edge:               ; preds = %.preheader47
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

.critedge:                                        ; preds = %22, %27
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 12, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

.lr.ph:                                           ; preds = %.preheader47, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %2)
  %35 = icmp eq i32 %34, 1
  br i1 %35, label %37, label %36

36:                                               ; preds = %.lr.ph
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 15, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

37:                                               ; preds = %.lr.ph
  %38 = load i32, ptr %2, align 4
  %39 = icmp sgt i32 %38, 0
  %40 = load i32, ptr @n, align 4
  %41 = icmp sle i32 %38, %40
  %42 = select i1 %39, i1 %41, i1 false
  br i1 %42, label %44, label %43

43:                                               ; preds = %37
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.3, i32 noundef 16, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

44:                                               ; preds = %37
  %45 = zext nneg i32 %38 to i64
  %46 = getelementptr inbounds [100001 x i8], ptr @sp, i64 0, i64 %45
  store i8 1, ptr %46, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %47, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %44, %.preheader47.._crit_edge_crit_edge
  %49 = phi i32 [ %.pre, %.preheader47.._crit_edge_crit_edge ], [ %40, %44 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 2, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %.not4250 = icmp slt i32 %49, 2
  br i1 %.not4250, label %.lr.ph59.preheader, label %.lr.ph52

.lr.ph59.preheader:                               ; preds = %60, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  store i32 -1, ptr getelementptr inbounds (i8, ptr @par, i64 4), align 4, !tbaa !5
  store i32 1, ptr @tot, align 4, !tbaa !5
  store i32 1, ptr @ord, align 16, !tbaa !5
  br label %.lr.ph59

.lr.ph52:                                         ; preds = %._crit_edge, %60
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %4)
  %51 = icmp eq i32 %50, 1
  br i1 %51, label %53, label %52

52:                                               ; preds = %.lr.ph52
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 20, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

53:                                               ; preds = %.lr.ph52
  %54 = load i32, ptr %4, align 4
  %55 = icmp sgt i32 %54, 0
  %56 = load i32, ptr @n, align 4
  %57 = icmp sle i32 %54, %56
  %58 = select i1 %55, i1 %57, i1 false
  br i1 %58, label %60, label %59

59:                                               ; preds = %53
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.3, i32 noundef 21, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

60:                                               ; preds = %53
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %62
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %65
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %66, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %3, align 4, !tbaa !5
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %.not42.not = icmp slt i32 %67, %69
  br i1 %.not42.not, label %.lr.ph52, label %.lr.ph59.preheader, !llvm.loop !13

._crit_edge60:                                    ; preds = %114
  %.pre86 = load i32, ptr @n, align 4, !tbaa !5
  %70 = icmp eq i32 %115, %.pre86
  br i1 %70, label %.preheader46, label %118

.preheader46:                                     ; preds = %._crit_edge60
  %71 = icmp sgt i32 %.pre86, 0
  br i1 %71, label %.lr.ph63.preheader, label %._crit_edge71

.lr.ph63.preheader:                               ; preds = %.preheader46
  %72 = zext nneg i32 %.pre86 to i64
  br label %.lr.ph63

.lr.ph59:                                         ; preds = %.lr.ph59.preheader, %114
  %indvars.iv = phi i64 [ 0, %.lr.ph59.preheader ], [ %indvars.iv.next, %114 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %73 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %75
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %77 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #8
  store ptr %77, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %78 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #8
  store ptr %78, ptr %7, align 8
  %79 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br i1 %79, label %.lr.ph55, label %._crit_edge56

._crit_edge56:                                    ; preds = %106, %.lr.ph59
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 -1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store i32 -1, ptr %10, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr getelementptr inbounds (i8, ptr @f, i64 800008), i64 0, i64 %81
  %83 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %82, ptr noundef nonnull align 4 dereferenceable(8) %8) #8
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %85
  %87 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %86, ptr noundef nonnull align 4 dereferenceable(8) %83)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100001 x i8], ptr @sp, i64 0, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !9, !range !14, !noundef !15
  %92 = trunc nuw i8 %91 to i1
  br i1 %92, label %109, label %114

.lr.ph55:                                         ; preds = %.lr.ph59, %106
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %.not44 = icmp eq i32 %94, %98
  br i1 %.not44, label %106, label %99

99:                                               ; preds = %.lr.ph55
  %100 = sext i32 %94 to i64
  %101 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %100
  store i32 %95, ptr %101, align 4, !tbaa !5
  %102 = load i32, ptr @tot, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr @tot, align 4, !tbaa !5
  %104 = sext i32 %102 to i64
  %105 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %104
  store i32 %94, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %99, %.lr.ph55
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %108 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br i1 %108, label %.lr.ph55, label %._crit_edge56

109:                                              ; preds = %._crit_edge56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %111
  %113 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %112, ptr noundef nonnull align 4 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  br label %114

114:                                              ; preds = %109, %._crit_edge56
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %115 = load i32, ptr @tot, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = icmp slt i64 %indvars.iv.next, %116
  br i1 %117, label %.lr.ph59, label %._crit_edge60, !llvm.loop !16

118:                                              ; preds = %._crit_edge60
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.3, i32 noundef 39, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

.preheader45:                                     ; preds = %141
  %.pre87 = load i32, ptr @n, align 4, !tbaa !5
  %119 = icmp sgt i32 %.pre87, 0
  br i1 %119, label %.lr.ph65, label %._crit_edge71

.lr.ph63:                                         ; preds = %.lr.ph63.preheader, %141
  %indvars.iv77 = phi i64 [ %72, %.lr.ph63.preheader ], [ %indvars.iv.next78, %141 ]
  %indvars.iv.next78 = add nsw i64 %indvars.iv77, -1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %120 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv.next78
  %121 = load i32, ptr %120, align 4, !tbaa !5
  store i32 %121, ptr %13, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = icmp eq i32 %124, -1
  br i1 %125, label %141, label %126

126:                                              ; preds = %.lr.ph63
  %127 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %122
  %128 = load i32, ptr %127, align 8, !tbaa !17
  %129 = icmp slt i32 %128, 0
  br i1 %129, label %141, label %130

130:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %131 = add nuw nsw i32 %128, 1
  store i32 %131, ptr %15, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  %132 = sext i32 %124 to i64
  %133 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %132
  %134 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %133, ptr noundef nonnull align 4 dereferenceable(8) %14)
  br i1 %134, label %135, label %136

135:                                              ; preds = %130
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %133, ptr noundef nonnull align 4 dereferenceable(8) %14) #8
  br label %136

136:                                              ; preds = %135, %130
  %137 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr getelementptr inbounds (i8, ptr @f, i64 800008), i64 0, i64 %132
  %138 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %137, ptr noundef nonnull align 4 dereferenceable(8) %14)
  br i1 %138, label %139, label %140

139:                                              ; preds = %136
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %137, ptr noundef nonnull align 4 dereferenceable(8) %14) #8
  br label %140

140:                                              ; preds = %139, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  br label %141

141:                                              ; preds = %.lr.ph63, %126, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  %142 = icmp ugt i64 %indvars.iv77, 1
  br i1 %142, label %.lr.ph63, label %.preheader45, !llvm.loop !19

.preheader:                                       ; preds = %185
  %.not4367 = icmp slt i32 %186, 1
  br i1 %.not4367, label %._crit_edge71, label %.lr.ph70

.lr.ph70:                                         ; preds = %.preheader
  %143 = load i32, ptr @lim, align 4, !tbaa !5
  %144 = add nuw i32 %186, 1
  %wide.trip.count = zext i32 %144 to i64
  %min.iters.check = icmp ult i32 %186, 9
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph70
  %indvars.iv83.ph = phi i64 [ 1, %.lr.ph70 ], [ %ind.end, %middle.block ]
  %.03468.ph = phi i32 [ 0, %.lr.ph70 ], [ %158, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph70
  %145 = zext nneg i32 %186 to i64
  %n.mod.vf = and i64 %145, 7
  %146 = icmp eq i64 %n.mod.vf, 0
  %147 = select i1 %146, i64 8, i64 %n.mod.vf
  %n.vec = sub nsw i64 %145, %147
  %ind.end = add nsw i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %143, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %155, %vector.body ]
  %vec.phi99 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %156, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %148 = or disjoint i64 %index, 5
  %149 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %offset.idx
  %150 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %148
  %wide.vec = load <8 x i32>, ptr %149, align 8, !tbaa !17
  %wide.vec100 = load <8 x i32>, ptr %150, align 8, !tbaa !17
  %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec101 = shufflevector <8 x i32> %wide.vec100, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %151 = icmp sle <4 x i32> %strided.vec, %broadcast.splat
  %152 = icmp sle <4 x i32> %strided.vec101, %broadcast.splat
  %153 = zext <4 x i1> %151 to <4 x i32>
  %154 = zext <4 x i1> %152 to <4 x i32>
  %155 = add <4 x i32> %vec.phi, %153
  %156 = add <4 x i32> %vec.phi99, %154
  %index.next = add nuw i64 %index, 8
  %157 = icmp eq i64 %index.next, %n.vec
  br i1 %157, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %156, %155
  %158 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br label %scalar.ph.preheader

.lr.ph65:                                         ; preds = %.preheader45, %185
  %159 = phi i32 [ %186, %185 ], [ %.pre87, %.preheader45 ]
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %185 ], [ 0, %.preheader45 ]
  %160 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv80
  %161 = load i32, ptr %160, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #8
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100001 x i32], ptr @par, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  store i32 %164, ptr %16, align 4, !tbaa !5
  %165 = icmp eq i32 %164, -1
  br i1 %165, label %185, label %166

166:                                              ; preds = %.lr.ph65
  %167 = sext i32 %164 to i64
  %168 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %167, i32 1
  %169 = load i32, ptr %168, align 4, !tbaa !23
  %170 = icmp eq i32 %169, %161
  %171 = zext i1 %170 to i64
  %172 = getelementptr inbounds [2 x [100001 x %"struct.std::pair"]], ptr @f, i64 0, i64 %171, i64 %167
  %173 = load i32, ptr %172, align 8, !tbaa !17
  %174 = icmp slt i32 %173, 0
  br i1 %174, label %185, label %175

175:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #8
  %176 = add nuw nsw i32 %173, 1
  store i32 %176, ptr %18, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  %177 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %162
  %178 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %177, ptr noundef nonnull align 4 dereferenceable(8) %17)
  br i1 %178, label %179, label %180

179:                                              ; preds = %175
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %177, ptr noundef nonnull align 4 dereferenceable(8) %17) #8
  br label %180

180:                                              ; preds = %179, %175
  %181 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr getelementptr inbounds (i8, ptr @f, i64 800008), i64 0, i64 %162
  %182 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %181, ptr noundef nonnull align 4 dereferenceable(8) %17)
  br i1 %182, label %183, label %184

183:                                              ; preds = %180
  call void @_ZSt4swapIiiENSt9enable_ifIXsr6__and_ISt14__is_swappableIT_ES1_IT0_EEE5valueEvE4typeERSt4pairIS2_S4_ESA_(ptr noundef nonnull align 4 dereferenceable(8) %181, ptr noundef nonnull align 4 dereferenceable(8) %17) #8
  br label %184

184:                                              ; preds = %183, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  %.pre88 = load i32, ptr @n, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %184, %166, %.lr.ph65
  %186 = phi i32 [ %.pre88, %184 ], [ %159, %166 ], [ %159, %.lr.ph65 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %187 = sext i32 %186 to i64
  %188 = icmp slt i64 %indvars.iv.next81, %187
  br i1 %188, label %.lr.ph65, label %.preheader, !llvm.loop !24

._crit_edge71:                                    ; preds = %scalar.ph, %.preheader46, %.preheader45, %.preheader
  %.034.lcssa = phi i32 [ 0, %.preheader ], [ 0, %.preheader45 ], [ 0, %.preheader46 ], [ %194, %scalar.ph ]
  %189 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %.034.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %scalar.ph ], [ %indvars.iv83.ph, %scalar.ph.preheader ]
  %.03468 = phi i32 [ %194, %scalar.ph ], [ %.03468.ph, %scalar.ph.preheader ]
  %190 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @f, i64 0, i64 %indvars.iv83
  %191 = load i32, ptr %190, align 8, !tbaa !17
  %192 = icmp sle i32 %191, %143
  %193 = zext i1 %192 to i32
  %194 = add nuw nsw i32 %.03468, %193
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge71, label %scalar.ph, !llvm.loop !25
}

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

; 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 void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #6 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 #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #6 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #7

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 = { 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 #3 = { noreturn 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !12}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = !{!18, !6, i64 4}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12, !22, !21}


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