; LLVM IR from DionysiosB/CodeForces :: 0900-0999 (994B-KnightsOfAPolygonalTable)

; 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.knight = type { i64, i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<knight, std::allocator<knight>>::_Vector_impl" }
%"struct.std::_Vector_base<knight, std::allocator<knight>>::_Vector_impl" = type { %"struct.std::_Vector_base<knight, std::allocator<knight>>::_Vector_impl_data" }
%"struct.std::_Vector_base<knight, std::allocator<knight>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.5" = type { i8 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z13knightCompare6knightS_(ptr noundef byval(%struct.knight) align 8, ptr noundef byval(%struct.knight) align 8) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.std::multiset", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.std::vector.3", align 8
  %16 = alloca i64, align 8
  %17 = alloca %"class.std::allocator.5", align 1
  %18 = alloca i64, align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #6
  %25 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZNSaI6knightEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorI6knightSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %25, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %26 unwind label %32

26:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI6knightED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %41, %26
  %28 = load i64, ptr %8, align 8, !tbaa !5
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %36, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %44

32:                                               ; preds = %0
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %6, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %7, align 4
  call void @_ZNSt15__new_allocatorI6knightED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %207

36:                                               ; preds = %27
  %37 = load i64, ptr %8, align 8, !tbaa !5
  %38 = load i64, ptr %8, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %38) #6
  %40 = getelementptr inbounds %struct.knight, ptr %39, i32 0, i32 2
  store i64 %37, ptr %40, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %36
  %42 = load i64, ptr %8, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %8, align 8, !tbaa !5
  br label %27, !llvm.loop !11

44:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %56, %44
  %46 = load i64, ptr %9, align 8, !tbaa !5
  %47 = load i64, ptr %2, align 8, !tbaa !5
  %48 = icmp slt i64 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %63

50:                                               ; preds = %45
  %51 = load i64, ptr %9, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %51) #6
  %53 = getelementptr inbounds %struct.knight, ptr %52, i32 0, i32 0
  %54 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %53)
          to label %55 unwind label %59

55:                                               ; preds = %50
  br label %56

56:                                               ; preds = %55
  %57 = load i64, ptr %9, align 8, !tbaa !5
  %58 = add nsw i64 %57, 1
  store i64 %58, ptr %9, align 8, !tbaa !5
  br label %45, !llvm.loop !13

59:                                               ; preds = %50
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %6, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %206

63:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %75, %63
  %65 = load i64, ptr %10, align 8, !tbaa !5
  %66 = load i64, ptr %2, align 8, !tbaa !5
  %67 = icmp slt i64 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %82

69:                                               ; preds = %64
  %70 = load i64, ptr %10, align 8, !tbaa !5
  %71 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %70) #6
  %72 = getelementptr inbounds %struct.knight, ptr %71, i32 0, i32 1
  %73 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %72)
          to label %74 unwind label %78

74:                                               ; preds = %69
  br label %75

75:                                               ; preds = %74
  %76 = load i64, ptr %10, align 8, !tbaa !5
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %10, align 8, !tbaa !5
  br label %64, !llvm.loop !14

78:                                               ; preds = %69
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %6, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %206

82:                                               ; preds = %68
  %83 = call ptr @_ZNSt6vectorI6knightSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %84 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %83, ptr %84, align 8
  %85 = call ptr @_ZNSt6vectorI6knightSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %86 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %85, ptr %86, align 8
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  %89 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP6knightSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %88, ptr %90, ptr noundef @_Z13knightCompare6knightS_)
          to label %91 unwind label %106

91:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  %92 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %92, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %93 unwind label %110

93:                                               ; preds = %91
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %94 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #6
  %95 = getelementptr inbounds %struct.knight, ptr %94, i32 0, i32 1
  %96 = load i64, ptr %95, align 8, !tbaa !15
  %97 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #6
  %98 = getelementptr inbounds %struct.knight, ptr %97, i32 0, i32 2
  %99 = load i64, ptr %98, align 8, !tbaa !9
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %99) #6
  store i64 %96, ptr %100, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 1, ptr %18, align 8, !tbaa !16
  br label %101

101:                                              ; preds = %174, %93
  %102 = load i64, ptr %18, align 8, !tbaa !16
  %103 = load i64, ptr %2, align 8, !tbaa !5
  %104 = icmp slt i64 %102, %103
  br i1 %104, label %114, label %105

105:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %177

106:                                              ; preds = %82
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %6, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %7, align 4
  br label %206

110:                                              ; preds = %91
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %6, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %205

114:                                              ; preds = %101
  %115 = load i64, ptr %18, align 8, !tbaa !16
  %116 = sub nsw i64 %115, 1
  %117 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %116) #6
  %118 = getelementptr inbounds %struct.knight, ptr %117, i32 0, i32 0
  %119 = load i64, ptr %118, align 8, !tbaa !18
  %120 = load i64, ptr %18, align 8, !tbaa !16
  %121 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %120) #6
  %122 = getelementptr inbounds %struct.knight, ptr %121, i32 0, i32 0
  %123 = load i64, ptr %122, align 8, !tbaa !18
  %124 = icmp slt i64 %119, %123
  br i1 %124, label %125, label %162

125:                                              ; preds = %114
  %126 = load i64, ptr %18, align 8, !tbaa !16
  %127 = sub nsw i64 %126, 1
  %128 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %127) #6
  %129 = getelementptr inbounds %struct.knight, ptr %128, i32 0, i32 1
  %130 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %129)
          to label %131 unwind label %157

131:                                              ; preds = %125
  %132 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %130, ptr %132, align 8
  %133 = load i64, ptr %18, align 8, !tbaa !16
  %134 = sub nsw i64 %133, 1
  %135 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %134) #6
  %136 = getelementptr inbounds %struct.knight, ptr %135, i32 0, i32 1
  %137 = load i64, ptr %136, align 8, !tbaa !15
  %138 = load i64, ptr %14, align 8, !tbaa !5
  %139 = add nsw i64 %138, %137
  store i64 %139, ptr %14, align 8, !tbaa !5
  %140 = call noundef i64 @_ZNKSt8multisetIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  %141 = load i64, ptr %3, align 8, !tbaa !5
  %142 = icmp ugt i64 %140, %141
  br i1 %142, label %143, label %161

143:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %144 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  %145 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %144, ptr %145, align 8
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %147 = load i64, ptr %146, align 8, !tbaa !5
  %148 = load i64, ptr %14, align 8, !tbaa !5
  %149 = sub nsw i64 %148, %147
  store i64 %149, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  %150 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  %151 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %150, ptr %151, align 8
  %152 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8
  %154 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr %153)
          to label %155 unwind label %157

155:                                              ; preds = %143
  %156 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %154, ptr %156, align 8
  br label %161

157:                                              ; preds = %143, %125
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %6, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %204

161:                                              ; preds = %155, %131
  br label %162

162:                                              ; preds = %161, %114
  %163 = load i64, ptr %14, align 8, !tbaa !5
  %164 = load i64, ptr %18, align 8, !tbaa !16
  %165 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %164) #6
  %166 = getelementptr inbounds %struct.knight, ptr %165, i32 0, i32 1
  %167 = load i64, ptr %166, align 8, !tbaa !15
  %168 = add nsw i64 %163, %167
  %169 = load i64, ptr %18, align 8, !tbaa !16
  %170 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %169) #6
  %171 = getelementptr inbounds %struct.knight, ptr %170, i32 0, i32 2
  %172 = load i64, ptr %171, align 8, !tbaa !9
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %172) #6
  store i64 %168, ptr %173, align 8, !tbaa !5
  br label %174

174:                                              ; preds = %162
  %175 = load i64, ptr %18, align 8, !tbaa !16
  %176 = add nsw i64 %175, 1
  store i64 %176, ptr %18, align 8, !tbaa !16
  br label %101, !llvm.loop !19

177:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 0, ptr %23, align 8, !tbaa !16
  br label %178

178:                                              ; preds = %189, %177
  %179 = load i64, ptr %23, align 8, !tbaa !16
  %180 = load i64, ptr %2, align 8, !tbaa !5
  %181 = icmp slt i64 %179, %180
  br i1 %181, label %183, label %182

182:                                              ; preds = %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %196

183:                                              ; preds = %178
  %184 = load i64, ptr %23, align 8, !tbaa !16
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %184) #6
  %186 = load i64, ptr %185, align 8, !tbaa !5
  %187 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %186)
          to label %188 unwind label %192

188:                                              ; preds = %183
  br label %189

189:                                              ; preds = %188
  %190 = load i64, ptr %23, align 8, !tbaa !16
  %191 = add nsw i64 %190, 1
  store i64 %191, ptr %23, align 8, !tbaa !16
  br label %178, !llvm.loop !20

192:                                              ; preds = %183
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %6, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %204

196:                                              ; preds = %182
  %197 = invoke i32 @puts(ptr noundef @.str.3)
          to label %198 unwind label %200

198:                                              ; preds = %196
  store i32 0, ptr %1, align 4
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #6
  call void @_ZNSt6vectorI6knightSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %199 = load i32, ptr %1, align 4
  ret i32 %199

200:                                              ; preds = %196
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %6, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %7, align 4
  br label %204

204:                                              ; preds = %200, %192, %157
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  br label %205

205:                                              ; preds = %204, %110
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #6
  br label %206

206:                                              ; preds = %205, %106, %78, %59
  call void @_ZNSt6vectorI6knightSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %207

207:                                              ; preds = %206, %32
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %208

208:                                              ; preds = %207
  %209 = load ptr, ptr %6, align 8
  %210 = load i32, ptr %7, align 4
  %211 = insertvalue { ptr, i32 } poison, ptr %209, 0
  %212 = insertvalue { ptr, i32 } %211, i32 %210, 1
  resume { ptr, i32 } %212
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaI6knightEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

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

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

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

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

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

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

declare i32 @puts(ptr noundef) #3

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI6knightED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTS6knight", !6, i64 0, !6, i64 8, !6, i64 16}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!10, !6, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!10, !6, i64 0}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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.knight = type { i64, i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<knight, std::allocator<knight>>::_Vector_impl" }
%"struct.std::_Vector_base<knight, std::allocator<knight>>::_Vector_impl" = type { %"struct.std::_Vector_base<knight, std::allocator<knight>>::_Vector_impl_data" }
%"struct.std::_Vector_base<knight, std::allocator<knight>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.5" = type { i8 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z13knightCompare6knightS_(ptr noundef byval(%struct.knight) align 8, ptr noundef byval(%struct.knight) align 8) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::multiset", align 8
  %6 = alloca %"class.std::vector.3", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::allocator.5", align 1
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %11 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaI6knightEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorI6knightSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %11, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %12 unwind label %16

12:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI6knightED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %13 = load i64, ptr %1, align 8, !tbaa !5
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.preheader44:                                     ; preds = %.lr.ph
  %15 = icmp sgt i64 %21, 0
  br i1 %15, label %.lr.ph47, label %._crit_edge

16:                                               ; preds = %0
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI6knightED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %104

.lr.ph:                                           ; preds = %12, %.lr.ph
  %.03745 = phi i64 [ %20, %.lr.ph ], [ 0, %12 ]
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03745) #6
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  store i64 %.03745, ptr %19, align 8, !tbaa !9
  %20 = add nuw nsw i64 %.03745, 1
  %21 = load i64, ptr %1, align 8, !tbaa !5
  %22 = icmp slt i64 %20, %21
  br i1 %22, label %.lr.ph, label %.preheader44, !llvm.loop !11

.preheader43:                                     ; preds = %.lr.ph47
  %23 = icmp sgt i64 %27, 0
  br i1 %23, label %.lr.ph49, label %._crit_edge

.lr.ph47:                                         ; preds = %.preheader44, %.lr.ph47
  %.03846 = phi i64 [ %26, %.lr.ph47 ], [ 0, %.preheader44 ]
  %24 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03846) #6
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %24)
  %26 = add nuw nsw i64 %.03846, 1
  %27 = load i64, ptr %1, align 8, !tbaa !5
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph47, label %.preheader43, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph49, %12, %.preheader44, %.preheader43
  %29 = call ptr @_ZNSt6vectorI6knightSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %30 = call ptr @_ZNSt6vectorI6knightSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP6knightSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %29, ptr %30, ptr noundef nonnull @_Z13knightCompare6knightS_)
          to label %37 unwind label %51

.lr.ph49:                                         ; preds = %.preheader43, %.lr.ph49
  %.03948 = phi i64 [ %34, %.lr.ph49 ], [ 0, %.preheader43 ]
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03948) #6
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %32)
  %34 = add nuw nsw i64 %.03948, 1
  %35 = load i64, ptr %1, align 8, !tbaa !5
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %.lr.ph49, label %._crit_edge, !llvm.loop !14

37:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %38 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %38, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %39 unwind label %53

39:                                               ; preds = %37
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !15
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %45) #6
  store i64 %42, ptr %46, align 8, !tbaa !5
  %47 = load i64, ptr %1, align 8, !tbaa !5
  %48 = icmp sgt i64 %47, 1
  br i1 %48, label %.lr.ph53, label %.preheader

.preheader:                                       ; preds = %83, %39
  %49 = phi i64 [ %47, %39 ], [ %93, %83 ]
  %50 = icmp sgt i64 %49, 0
  br i1 %50, label %.lr.ph55, label %._crit_edge56

51:                                               ; preds = %._crit_edge
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %103

53:                                               ; preds = %37
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %102

.lr.ph53:                                         ; preds = %39, %83
  %.03451 = phi i64 [ %92, %83 ], [ 1, %39 ]
  %.03550 = phi i64 [ %.136, %83 ], [ 0, %39 ]
  %55 = add nsw i64 %.03451, -1
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %55) #6
  %57 = load i64, ptr %56, align 8, !tbaa !16
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03451) #6
  %59 = load i64, ptr %58, align 8, !tbaa !16
  %60 = icmp slt i64 %57, %59
  br i1 %60, label %61, label %83

61:                                               ; preds = %.lr.ph53
  %62 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %55) #6
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  %64 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %63)
          to label %65 unwind label %81

65:                                               ; preds = %61
  %66 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %55) #6
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load i64, ptr %67, align 8, !tbaa !15
  %69 = add nsw i64 %68, %.03550
  %70 = call noundef i64 @_ZNKSt8multisetIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  %71 = load i64, ptr %2, align 8, !tbaa !5
  %72 = icmp ugt i64 %70, %71
  br i1 %72, label %73, label %83

73:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %74 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  store ptr %74, ptr %9, align 8
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %76 = load i64, ptr %75, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %77 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  %78 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr %77)
          to label %79 unwind label %81

79:                                               ; preds = %73
  %80 = sub nsw i64 %69, %76
  br label %83

81:                                               ; preds = %73, %61
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %102

83:                                               ; preds = %65, %79, %.lr.ph53
  %.136 = phi i64 [ %80, %79 ], [ %69, %65 ], [ %.03550, %.lr.ph53 ]
  %84 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03451) #6
  %85 = getelementptr inbounds i8, ptr %84, i64 8
  %86 = load i64, ptr %85, align 8, !tbaa !15
  %87 = add nsw i64 %86, %.136
  %88 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI6knightSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03451) #6
  %89 = getelementptr inbounds i8, ptr %88, i64 16
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %90) #6
  store i64 %87, ptr %91, align 8, !tbaa !5
  %92 = add nuw nsw i64 %.03451, 1
  %93 = load i64, ptr %1, align 8, !tbaa !5
  %94 = icmp slt i64 %92, %93
  br i1 %94, label %.lr.ph53, label %.preheader, !llvm.loop !17

._crit_edge56:                                    ; preds = %.lr.ph55, %.preheader
  %95 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  call void @_ZNSt6vectorI6knightSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

.lr.ph55:                                         ; preds = %.preheader, %.lr.ph55
  %.054 = phi i64 [ %99, %.lr.ph55 ], [ 0, %.preheader ]
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.054) #6
  %97 = load i64, ptr %96, align 8, !tbaa !5
  %98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %97)
  %99 = add nuw nsw i64 %.054, 1
  %100 = load i64, ptr %1, align 8, !tbaa !5
  %101 = icmp slt i64 %99, %100
  br i1 %101, label %.lr.ph55, label %._crit_edge56, !llvm.loop !18

102:                                              ; preds = %81, %53
  %.pn = phi { ptr, i32 } [ %82, %81 ], [ %54, %53 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  br label %103

103:                                              ; preds = %102, %51
  %.pn.pn = phi { ptr, i32 } [ %.pn, %102 ], [ %52, %51 ]
  call void @_ZNSt6vectorI6knightSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %104

104:                                              ; preds = %103, %16
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %103 ], [ %17, %16 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaI6knightEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI6knightED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

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

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


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