; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/MTMXSUM/A.ll (Z3getPiS_S_S_)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@events = external dso_local global [100100 x %"class.std::vector"], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3subRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3getPiS_S_S_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::stack", align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"struct.std::pair", align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca i32, align 4
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca ptr, align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %37 = alloca ptr, align 8
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds i32, ptr %40, i64 1
  store i32 0, ptr %41, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %42 unwind label %48

42:                                               ; preds = %4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 2, ptr %13, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %96, %42
  %44 = load i32, ptr %13, align 4, !tbaa !9
  %45 = load i32, ptr @n, align 4, !tbaa !9
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %52, label %47

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %99

48:                                               ; preds = %4
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %11, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %338

52:                                               ; preds = %43
  br label %53

53:                                               ; preds = %73, %52
  %54 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %55 unwind label %74

55:                                               ; preds = %53
  br i1 %54, label %70, label %56

56:                                               ; preds = %55
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %59 unwind label %74

59:                                               ; preds = %56
  %60 = load i32, ptr %58, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %57, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %64, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = icmp sle i32 %63, %68
  br label %70

70:                                               ; preds = %59, %55
  %71 = phi i1 [ false, %55 ], [ %69, %59 ]
  br i1 %71, label %72, label %78

72:                                               ; preds = %70
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %73 unwind label %74

73:                                               ; preds = %72
  br label %53, !llvm.loop !11

74:                                               ; preds = %94, %81, %78, %72, %56, %53
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %11, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %338

78:                                               ; preds = %70
  %79 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %80 unwind label %74

80:                                               ; preds = %78
  br i1 %79, label %89, label %81

81:                                               ; preds = %80
  %82 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %83 unwind label %74

83:                                               ; preds = %81
  %84 = load i32, ptr %82, align 4, !tbaa !9
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = load i32, ptr %13, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %85, i64 %87
  store i32 %84, ptr %88, align 4, !tbaa !9
  br label %94

89:                                               ; preds = %80
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = load i32, ptr %13, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr %90, i64 %92
  store i32 0, ptr %93, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %89, %83
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %95 unwind label %74

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %13, align 4, !tbaa !9
  br label %43, !llvm.loop !13

99:                                               ; preds = %47
  br label %100

100:                                              ; preds = %105, %99
  %101 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %102 unwind label %106

102:                                              ; preds = %100
  %103 = xor i1 %101, true
  br i1 %103, label %104, label %110

104:                                              ; preds = %102
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %105 unwind label %106

105:                                              ; preds = %104
  br label %100, !llvm.loop !14

106:                                              ; preds = %110, %104, %100
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %11, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %12, align 4
  br label %338

110:                                              ; preds = %102
  %111 = load i32, ptr @n, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load i32, ptr @n, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %113, i64 %115
  store i32 %112, ptr %116, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) @n)
          to label %117 unwind label %106

117:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %118 = load i32, ptr @n, align 4, !tbaa !9
  %119 = sub nsw i32 %118, 1
  store i32 %119, ptr %14, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %170, %117
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %124, label %123

123:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %173

124:                                              ; preds = %120
  br label %125

125:                                              ; preds = %145, %124
  %126 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %127 unwind label %146

127:                                              ; preds = %125
  br i1 %126, label %142, label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %131 unwind label %146

131:                                              ; preds = %128
  %132 = load i32, ptr %130, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %129, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = load i32, ptr %14, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i32, ptr %136, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !9
  %141 = icmp sle i32 %135, %140
  br label %142

142:                                              ; preds = %131, %127
  %143 = phi i1 [ false, %127 ], [ %141, %131 ]
  br i1 %143, label %144, label %150

144:                                              ; preds = %142
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %145 unwind label %146

145:                                              ; preds = %144
  br label %125, !llvm.loop !15

146:                                              ; preds = %168, %153, %150, %144, %128, %125
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %11, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %338

150:                                              ; preds = %142
  %151 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %152 unwind label %146

152:                                              ; preds = %150
  br i1 %151, label %161, label %153

153:                                              ; preds = %152
  %154 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %155 unwind label %146

155:                                              ; preds = %153
  %156 = load i32, ptr %154, align 4, !tbaa !9
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = load i32, ptr %14, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds i32, ptr %157, i64 %159
  store i32 %156, ptr %160, align 4, !tbaa !9
  br label %168

161:                                              ; preds = %152
  %162 = load i32, ptr @n, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = load i32, ptr %14, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds i32, ptr %164, i64 %166
  store i32 %163, ptr %167, align 4, !tbaa !9
  br label %168

168:                                              ; preds = %161, %155
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %169 unwind label %146

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169
  %171 = load i32, ptr %14, align 4, !tbaa !9
  %172 = add nsw i32 %171, -1
  store i32 %172, ptr %14, align 4, !tbaa !9
  br label %120, !llvm.loop !16

173:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %174

174:                                              ; preds = %183, %173
  %175 = load i32, ptr %15, align 4, !tbaa !9
  %176 = load i32, ptr @n, align 4, !tbaa !9
  %177 = icmp sle i32 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %186

179:                                              ; preds = %174
  %180 = load i32, ptr %15, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %181
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %182) #4
  br label %183

183:                                              ; preds = %179
  %184 = load i32, ptr %15, align 4, !tbaa !9
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %15, align 4, !tbaa !9
  br label %174, !llvm.loop !17

186:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %187

187:                                              ; preds = %237, %186
  %188 = load i32, ptr %16, align 4, !tbaa !9
  %189 = load i32, ptr @n, align 4, !tbaa !9
  %190 = icmp sle i32 %188, %189
  br i1 %190, label %192, label %191

191:                                              ; preds = %187
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %262

192:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %193 = load i32, ptr %16, align 4, !tbaa !9
  %194 = load ptr, ptr %6, align 8, !tbaa !5
  %195 = load i32, ptr %16, align 4, !tbaa !9
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i32, ptr %194, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !9
  %199 = sub nsw i32 %193, %198
  store i32 %199, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = load i32, ptr %16, align 4, !tbaa !9
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds i32, ptr %200, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !9
  %205 = load i32, ptr %16, align 4, !tbaa !9
  %206 = sub nsw i32 %204, %205
  store i32 %206, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %207 = load i32, ptr %17, align 4, !tbaa !9
  %208 = load i32, ptr %18, align 4, !tbaa !9
  %209 = add nsw i32 %207, %208
  %210 = sub nsw i32 %209, 1
  store i32 %210, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %211 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %212 unwind label %240

212:                                              ; preds = %192
  %213 = load i32, ptr %211, align 4, !tbaa !9
  store i32 %213, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %214 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %215 unwind label %244

215:                                              ; preds = %212
  %216 = load i32, ptr %214, align 4, !tbaa !9
  store i32 %216, ptr %21, align 4, !tbaa !9
  %217 = load i32, ptr %19, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %218
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !9
  %220 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %221 unwind label %248

221:                                              ; preds = %215
  store i64 %220, ptr %22, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %219, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %222 unwind label %248

222:                                              ; preds = %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  %223 = load i32, ptr %21, align 4, !tbaa !9
  %224 = sub nsw i32 %223, 1
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %225
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  store i32 1, ptr %25, align 4, !tbaa !9
  %227 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %228 unwind label %252

228:                                              ; preds = %222
  store i64 %227, ptr %24, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %226, ptr noundef nonnull align 4 dereferenceable(8) %24)
          to label %229 unwind label %252

229:                                              ; preds = %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  %230 = load i32, ptr %20, align 4, !tbaa !9
  %231 = sub nsw i32 %230, 1
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  store i32 2, ptr %27, align 4, !tbaa !9
  %234 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %235 unwind label %256

235:                                              ; preds = %229
  store i64 %234, ptr %26, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %233, ptr noundef nonnull align 4 dereferenceable(8) %26)
          to label %236 unwind label %256

236:                                              ; preds = %235
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %237

237:                                              ; preds = %236
  %238 = load i32, ptr %16, align 4, !tbaa !9
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %16, align 4, !tbaa !9
  br label %187, !llvm.loop !18

240:                                              ; preds = %192
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %11, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %12, align 4
  br label %261

244:                                              ; preds = %212
  %245 = landingpad { ptr, i32 }
          cleanup
  %246 = extractvalue { ptr, i32 } %245, 0
  store ptr %246, ptr %11, align 8
  %247 = extractvalue { ptr, i32 } %245, 1
  store i32 %247, ptr %12, align 4
  br label %260

248:                                              ; preds = %221, %215
  %249 = landingpad { ptr, i32 }
          cleanup
  %250 = extractvalue { ptr, i32 } %249, 0
  store ptr %250, ptr %11, align 8
  %251 = extractvalue { ptr, i32 } %249, 1
  store i32 %251, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %260

252:                                              ; preds = %228, %222
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %11, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  br label %260

256:                                              ; preds = %235, %229
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %11, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  br label %260

260:                                              ; preds = %256, %252, %248, %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %261

261:                                              ; preds = %260, %240
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %338

262:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  store i32 0, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  store i32 0, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  store i32 0, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  store i32 0, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  %263 = load i32, ptr @n, align 4, !tbaa !9
  store i32 %263, ptr %32, align 4, !tbaa !9
  br label %264

264:                                              ; preds = %334, %262
  %265 = load i32, ptr %32, align 4, !tbaa !9
  %266 = icmp sge i32 %265, 1
  br i1 %266, label %268, label %267

267:                                              ; preds = %264
  store i32 20, ptr %33, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  br label %337

268:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #4
  %269 = load i32, ptr %32, align 4, !tbaa !9
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %270
  store ptr %271, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #4
  %272 = load ptr, ptr %34, align 8, !tbaa !5
  %273 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %272) #4
  %274 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %273, ptr %274, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #4
  %275 = load ptr, ptr %34, align 8, !tbaa !5
  %276 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %275) #4
  %277 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %36, i32 0, i32 0
  store ptr %276, ptr %277, align 8
  br label %278

278:                                              ; preds = %324, %268
  %279 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(8) %36) #4
  br i1 %279, label %281, label %280

280:                                              ; preds = %278
  store i32 23, ptr %33, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #4
  br label %326

281:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #4
  %282 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #4
  store ptr %282, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #4
  %283 = load ptr, ptr %37, align 8, !tbaa !5
  %284 = getelementptr inbounds %"struct.std::pair", ptr %283, i32 0, i32 0
  %285 = load i32, ptr %284, align 4, !tbaa !19
  store i32 %285, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #4
  %286 = load ptr, ptr %37, align 8, !tbaa !5
  %287 = getelementptr inbounds %"struct.std::pair", ptr %286, i32 0, i32 1
  %288 = load i32, ptr %287, align 4, !tbaa !21
  store i32 %288, ptr %39, align 4, !tbaa !9
  %289 = load i32, ptr %39, align 4, !tbaa !9
  %290 = icmp eq i32 %289, 0
  br i1 %290, label %291, label %297

291:                                              ; preds = %281
  %292 = load ptr, ptr %5, align 8, !tbaa !5
  %293 = load i32, ptr %38, align 4, !tbaa !9
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds i32, ptr %292, i64 %294
  %296 = load i32, ptr %295, align 4, !tbaa !9
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %28, i32 noundef %296)
  br label %323

297:                                              ; preds = %281
  %298 = load i32, ptr %39, align 4, !tbaa !9
  %299 = icmp eq i32 %298, 1
  br i1 %299, label %300, label %311

300:                                              ; preds = %297
  %301 = load ptr, ptr %5, align 8, !tbaa !5
  %302 = load i32, ptr %38, align 4, !tbaa !9
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds i32, ptr %301, i64 %303
  %305 = load i32, ptr %304, align 4, !tbaa !9
  call void @_Z3subRii(ptr noundef nonnull align 4 dereferenceable(4) %28, i32 noundef %305)
  %306 = load ptr, ptr %5, align 8, !tbaa !5
  %307 = load i32, ptr %38, align 4, !tbaa !9
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds i32, ptr %306, i64 %308
  %310 = load i32, ptr %309, align 4, !tbaa !9
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef %310)
  br label %322

311:                                              ; preds = %297
  %312 = load ptr, ptr %5, align 8, !tbaa !5
  %313 = load i32, ptr %38, align 4, !tbaa !9
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds i32, ptr %312, i64 %314
  %316 = load i32, ptr %315, align 4, !tbaa !9
  call void @_Z3subRii(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef %316)
  %317 = load ptr, ptr %5, align 8, !tbaa !5
  %318 = load i32, ptr %38, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds i32, ptr %317, i64 %319
  %321 = load i32, ptr %320, align 4, !tbaa !9
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef %321)
  br label %322

322:                                              ; preds = %311, %300
  br label %323

323:                                              ; preds = %322, %291
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #4
  br label %324

324:                                              ; preds = %323
  %325 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #4
  br label %278

326:                                              ; preds = %280
  %327 = load i32, ptr %28, align 4, !tbaa !9
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %31, i32 noundef %327)
  %328 = load i32, ptr %30, align 4, !tbaa !9
  call void @_Z3subRii(ptr noundef nonnull align 4 dereferenceable(4) %31, i32 noundef %328)
  %329 = load i32, ptr %31, align 4, !tbaa !9
  %330 = load ptr, ptr %8, align 8, !tbaa !5
  %331 = load i32, ptr %32, align 4, !tbaa !9
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds i32, ptr %330, i64 %332
  store i32 %329, ptr %333, align 4, !tbaa !9
  br label %334

334:                                              ; preds = %326
  %335 = load i32, ptr %32, align 4, !tbaa !9
  %336 = add nsw i32 %335, -1
  store i32 %336, ptr %32, align 4, !tbaa !9
  br label %264, !llvm.loop !22

337:                                              ; preds = %267
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #4
  ret void

338:                                              ; preds = %261, %146, %106, %74, %48
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #4
  br label %339

339:                                              ; preds = %338
  %340 = load ptr, ptr %11, align 8
  %341 = load i32, ptr %12, align 4
  %342 = insertvalue { ptr, i32 } poison, ptr %340, 0
  %343 = insertvalue { ptr, i32 } %342, i32 %341, 1
  resume { ptr, i32 } %343
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #1 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)) #1

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

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

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

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

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

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@events = external dso_local global [100100 x %"class.std::vector"], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3subRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3getPiS_S_S_(ptr nocapture noundef readonly %0, ptr nocapture noundef %1, ptr nocapture noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::stack", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %24 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 0, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %25 unwind label %29

25:                                               ; preds = %4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 2, ptr %7, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %.not61 = icmp slt i32 %26, 2
  br i1 %.not61, label %._crit_edge, label %.preheader56

.preheader56:                                     ; preds = %25, %51
  %27 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %27, label %.critedge, label %.lr.ph

._crit_edge:                                      ; preds = %51, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %28 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %28, label %._crit_edge64, label %.lr.ph63

29:                                               ; preds = %4
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %160

.lr.ph:                                           ; preds = %.preheader56, %40
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i32, ptr %0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr %0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %.not53 = icmp sgt i32 %35, %39
  br i1 %.not53, label %.critedge, label %40

40:                                               ; preds = %.lr.ph
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %41 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %41, label %.critedge, label %.lr.ph, !llvm.loop !9

42:                                               ; preds = %48
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %160

.critedge:                                        ; preds = %.lr.ph, %40, %.preheader56
  %44 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %44, label %48, label %45

45:                                               ; preds = %.critedge
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %47 = load i32, ptr %46, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %.critedge, %45
  %.sink = phi i32 [ %47, %45 ], [ 0, %.critedge ]
  %.sink94 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %.sink94 to i64
  %50 = getelementptr inbounds i32, ptr %1, i64 %49
  store i32 %.sink, ptr %50, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %51 unwind label %42

51:                                               ; preds = %48
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %52, %54
  br i1 %.not.not, label %.preheader56, label %._crit_edge, !llvm.loop !11

.lr.ph63:                                         ; preds = %._crit_edge, %.lr.ph63
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %55 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %55, label %._crit_edge64, label %.lr.ph63, !llvm.loop !12

56:                                               ; preds = %._crit_edge64
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %160

._crit_edge64:                                    ; preds = %.lr.ph63, %._crit_edge
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  %60 = sext i32 %58 to i64
  %61 = getelementptr inbounds i32, ptr %2, i64 %60
  store i32 %59, ptr %61, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) @n)
          to label %62 unwind label %56

62:                                               ; preds = %._crit_edge64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  br label %63

63:                                               ; preds = %88, %62
  %storemerge47.in.in = phi ptr [ @n, %62 ], [ %8, %88 ]
  %storemerge47.in = load i32, ptr %storemerge47.in.in, align 4, !tbaa !5
  %storemerge47 = add nsw i32 %storemerge47.in, -1
  store i32 %storemerge47, ptr %8, align 4, !tbaa !5
  %64 = icmp sgt i32 %storemerge47.in, 1
  br i1 %64, label %.preheader, label %66

.preheader:                                       ; preds = %63
  %65 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %65, label %.critedge2, label %.lr.ph65

66:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %.not4867 = icmp slt i32 %67, 1
  br i1 %.not4867, label %._crit_edge71.thread, label %.lr.ph70

._crit_edge71.thread:                             ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  br label %._crit_edge76.thread

.lr.ph65:                                         ; preds = %.preheader, %77
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr %0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %.not52 = icmp sgt i32 %72, %76
  br i1 %.not52, label %.critedge2, label %77

77:                                               ; preds = %.lr.ph65
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %78 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %78, label %.critedge2, label %.lr.ph65, !llvm.loop !13

79:                                               ; preds = %88
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %160

.critedge2:                                       ; preds = %.lr.ph65, %77, %.preheader
  %81 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %81, label %85, label %82

82:                                               ; preds = %.critedge2
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %84 = load i32, ptr %83, align 4, !tbaa !5
  br label %88

85:                                               ; preds = %.critedge2
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  br label %88

88:                                               ; preds = %85, %82
  %.sink95 = phi i32 [ %87, %85 ], [ %84, %82 ]
  %.sink98 = load i32, ptr %8, align 4, !tbaa !5
  %89 = sext i32 %.sink98 to i64
  %90 = getelementptr inbounds i32, ptr %2, i64 %89
  store i32 %.sink95, ptr %90, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %63 unwind label %79, !llvm.loop !14

._crit_edge71:                                    ; preds = %.lr.ph70
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  %.not5072 = icmp slt i32 %92, 1
  br i1 %.not5072, label %._crit_edge76.thread, label %.lr.ph75

.lr.ph70:                                         ; preds = %66, %.lr.ph70
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph70 ], [ 1, %66 ]
  %91 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %91) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %.not48.not = icmp slt i64 %indvars.iv, %93
  br i1 %.not48.not, label %.lr.ph70, label %._crit_edge71, !llvm.loop !15

._crit_edge76.thread:                             ; preds = %._crit_edge71, %._crit_edge71.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #4
  br label %._crit_edge83

._crit_edge76:                                    ; preds = %125
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #4
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #4
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #4
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #4
  store i32 0, ptr %21, align 4, !tbaa !5
  %94 = icmp sgt i32 %128, 0
  br i1 %94, label %.lr.ph82.preheader, label %._crit_edge83

.lr.ph82.preheader:                               ; preds = %._crit_edge76
  %95 = zext nneg i32 %128 to i64
  br label %.lr.ph82

.lr.ph75:                                         ; preds = %._crit_edge71, %125
  %storemerge4973 = phi i32 [ %127, %125 ], [ 1, %._crit_edge71 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %96 = sext i32 %storemerge4973 to i64
  %97 = getelementptr inbounds i32, ptr %1, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sub nsw i32 %storemerge4973, %98
  store i32 %99, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %100 = getelementptr inbounds i32, ptr %2, i64 %96
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sub nsw i32 %101, %storemerge4973
  store i32 %102, ptr %11, align 4, !tbaa !5
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #4
  store i32 0, ptr %13, align 4, !tbaa !5
  %107 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %108 unwind label %129

108:                                              ; preds = %.lr.ph75
  %109 = add i32 %99, -1
  %110 = add i32 %109, %102
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %111
  store i64 %107, ptr %12, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %112, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %113 unwind label %129

113:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #4
  store i32 1, ptr %15, align 4, !tbaa !5
  %114 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %115 unwind label %131

115:                                              ; preds = %113
  %116 = add nsw i32 %106, -1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %117
  store i64 %114, ptr %14, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %118, ptr noundef nonnull align 4 dereferenceable(8) %14)
          to label %119 unwind label %131

119:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #4
  store i32 2, ptr %17, align 4, !tbaa !5
  %120 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %121 unwind label %133

121:                                              ; preds = %119
  %122 = add nsw i32 %104, -1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %123
  store i64 %120, ptr %16, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %124, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %125 unwind label %133

125:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %9, align 4, !tbaa !5
  %128 = load i32, ptr @n, align 4, !tbaa !5
  %.not50.not = icmp slt i32 %126, %128
  br i1 %.not50.not, label %.lr.ph75, label %._crit_edge76, !llvm.loop !16

129:                                              ; preds = %108, %.lr.ph75
  %130 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br label %135

131:                                              ; preds = %115, %113
  %132 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  br label %135

133:                                              ; preds = %121, %119
  %134 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  br label %135

135:                                              ; preds = %133, %131, %129
  %.pn = phi { ptr, i32 } [ %134, %133 ], [ %132, %131 ], [ %130, %129 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  br label %160

._crit_edge83:                                    ; preds = %._crit_edge79, %._crit_edge76.thread, %._crit_edge76
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #4
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #4
  ret void

.lr.ph82:                                         ; preds = %.lr.ph82.preheader, %._crit_edge79
  %indvars.iv86 = phi i64 [ %95, %.lr.ph82.preheader ], [ %indvars.iv.next87, %._crit_edge79 ]
  %136 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @events, i64 0, i64 %indvars.iv86
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #4
  %137 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #4
  store ptr %137, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #4
  %138 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #4
  store ptr %138, ptr %23, align 8
  %139 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  br i1 %139, label %.lr.ph78, label %._crit_edge79

._crit_edge79:                                    ; preds = %157, %.lr.ph82
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #4
  %140 = load i32, ptr %18, align 4, !tbaa !5
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %21, i32 noundef %140)
  %141 = load i32, ptr %20, align 4, !tbaa !5
  call void @_Z3subRii(ptr noundef nonnull align 4 dereferenceable(4) %21, i32 noundef %141)
  %142 = load i32, ptr %21, align 4, !tbaa !5
  %143 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv86
  store i32 %142, ptr %143, align 4, !tbaa !5
  %indvars.iv.next87 = add nsw i64 %indvars.iv86, -1
  %144 = icmp sgt i64 %indvars.iv86, 1
  br i1 %144, label %.lr.ph82, label %._crit_edge83, !llvm.loop !17

.lr.ph78:                                         ; preds = %.lr.ph82, %157
  %145 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #4
  %146 = load i32, ptr %145, align 4, !tbaa !18
  %147 = getelementptr inbounds i8, ptr %145, i64 4
  %148 = load i32, ptr %147, align 4, !tbaa !20
  %149 = sext i32 %146 to i64
  %150 = getelementptr inbounds i32, ptr %0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  switch i32 %148, label %155 [
    i32 0, label %152
    i32 1, label %153
  ]

152:                                              ; preds = %.lr.ph78
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 noundef %151)
  br label %157

153:                                              ; preds = %.lr.ph78
  call void @_Z3subRii(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 noundef %151)
  %154 = load i32, ptr %150, align 4, !tbaa !5
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %19, i32 noundef %154)
  br label %157

155:                                              ; preds = %.lr.ph78
  call void @_Z3subRii(ptr noundef nonnull align 4 dereferenceable(4) %19, i32 noundef %151)
  %156 = load i32, ptr %150, align 4, !tbaa !5
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %20, i32 noundef %156)
  br label %157

157:                                              ; preds = %153, %155, %152
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #4
  %159 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  br i1 %159, label %.lr.ph78, label %._crit_edge79

160:                                              ; preds = %135, %79, %56, %42, %29
  %.pn54 = phi { ptr, i32 } [ %43, %42 ], [ %80, %79 ], [ %.pn, %135 ], [ %57, %56 ], [ %30, %29 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #4
  resume { ptr, i32 } %.pn54
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1 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 #1

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

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

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

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

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

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

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


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