; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2015-16/Jan 2016/Gold (lightsout)

; 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.3" = 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::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, int>, std::_Select1st<std::pair<const std::vector<int>, int>>, std::less<std::vector<int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, int>, std::_Select1st<std::pair<const std::vector<int>, int>>, std::less<std::vector<int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"struct.std::pair" = type { i32, i32 }

@N = external dso_local global i32, align 4
@v = external dso_local global %"class.std::vector.3", align 8
@ang = external dso_local global %"class.std::vector.7", align 8
@dist = external dso_local global %"class.std::vector.7", align 8
@ret = external dso_local global %"class.std::vector.7", align 8
@m = external dso_local global %"class.std::map", align 8
@.str.20 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnSt4pairIiiES0_S0_(i64, i64, i64) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3disSt4pairIiiES0_(i64, i64) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca %"struct.std::pair", 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 %"class.std::vector.7", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::vector.7", align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.20, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %28 unwind label %37

28:                                               ; preds = %0
  invoke void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %29 unwind label %41

29:                                               ; preds = %28
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  call void @_Z2reIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  %30 = load i32, ptr @N, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %31)
  call void @_Z2reISt4pairIiiEEvRSt6vectorIT_SaIS3_EE(ptr noundef nonnull align 8 dereferenceable(24) @v)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %68, %29
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %46, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %71

37:                                               ; preds = %0
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  br label %45

41:                                               ; preds = %28
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %4, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %45

45:                                               ; preds = %41, %37
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  br label %287

46:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = load i32, ptr @N, align 4, !tbaa !5
  %49 = add nsw i32 %47, %48
  %50 = sub nsw i32 %49, 1
  %51 = load i32, ptr @N, align 4, !tbaa !5
  %52 = srem i32 %50, %51
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %53) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %54, i64 8, i1 false)
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %56) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %57, i64 8, i1 false)
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  %60 = load i32, ptr @N, align 4, !tbaa !5
  %61 = srem i32 %59, %60
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %62) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %63, i64 8, i1 false)
  %64 = load i64, ptr %8, align 4
  %65 = load i64, ptr %9, align 4
  %66 = load i64, ptr %10, align 4
  %67 = call noundef i32 @_Z3sgnSt4pairIiiES0_S0_(i64 %64, i64 %65, i64 %66)
  store i32 %67, ptr %7, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @ang, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %68

68:                                               ; preds = %46
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !5
  br label %32, !llvm.loop !9

71:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %90, %71
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = load i32, ptr @N, align 4, !tbaa !5
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %93

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %79) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %80, i64 8, i1 false)
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  %83 = load i32, ptr @N, align 4, !tbaa !5
  %84 = srem i32 %82, %83
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %85) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %86, i64 8, i1 false)
  %87 = load i64, ptr %13, align 4
  %88 = load i64, ptr %14, align 4
  %89 = call noundef i32 @_Z3disSt4pairIiiES0_(i64 %87, i64 %88)
  store i32 %89, ptr %12, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @dist, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %90

90:                                               ; preds = %77
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %11, align 4, !tbaa !5
  br label %72, !llvm.loop !11

93:                                               ; preds = %76
  %94 = load i32, ptr @N, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %95)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %116, %93
  %97 = load i32, ptr %15, align 4, !tbaa !5
  %98 = load i32, ptr @N, align 4, !tbaa !5
  %99 = sub nsw i32 %98, 1
  %100 = icmp slt i32 %97, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %119

102:                                              ; preds = %96
  %103 = load i32, ptr %15, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %104) #5
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %15, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %108) #5
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %106, %110
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %114) #5
  store i32 %111, ptr %115, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %102
  %117 = load i32, ptr %15, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %15, align 4, !tbaa !5
  br label %96, !llvm.loop !12

119:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %120 = load i32, ptr @N, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  store i32 %121, ptr %16, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %143, %119
  %123 = load i32, ptr %16, align 4, !tbaa !5
  %124 = icmp sge i32 %123, 0
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %146

126:                                              ; preds = %122
  %127 = load i32, ptr %16, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %128) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %130 = load i32, ptr %16, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  %132 = load i32, ptr @N, align 4, !tbaa !5
  %133 = srem i32 %131, %132
  %134 = sext i32 %133 to i64
  %135 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %134) #5
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i32, ptr %16, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %138) #5
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = add nsw i32 %136, %140
  store i32 %141, ptr %17, align 4, !tbaa !5
  %142 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %129, ptr noundef nonnull align 4 dereferenceable(4) %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %143

143:                                              ; preds = %126
  %144 = load i32, ptr %16, align 4, !tbaa !5
  %145 = add nsw i32 %144, -1
  store i32 %145, ptr %16, align 4, !tbaa !5
  br label %122, !llvm.loop !13

146:                                              ; preds = %125
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ang, i64 noundef 0) #5
  store i32 1000000007, ptr %147, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %193, %146
  %149 = load i32, ptr %18, align 4, !tbaa !5
  %150 = load i32, ptr @N, align 4, !tbaa !5
  %151 = icmp slt i32 %149, %150
  br i1 %151, label %153, label %152

152:                                              ; preds = %148
  store i32 14, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %196

153:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %189, %153
  %155 = load i32, ptr %21, align 4, !tbaa !5
  %156 = load i32, ptr @N, align 4, !tbaa !5
  %157 = icmp slt i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  store i32 17, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %192

159:                                              ; preds = %154
  %160 = load i32, ptr %21, align 4, !tbaa !5
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %176

162:                                              ; preds = %159
  %163 = load i32, ptr %18, align 4, !tbaa !5
  %164 = load i32, ptr %21, align 4, !tbaa !5
  %165 = add nsw i32 %163, %164
  %166 = sub nsw i32 %165, 1
  %167 = load i32, ptr @N, align 4, !tbaa !5
  %168 = srem i32 %166, %167
  %169 = sext i32 %168 to i64
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %169) #5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 4 dereferenceable(4) %170)
          to label %171 unwind label %172

171:                                              ; preds = %162
  br label %176

172:                                              ; preds = %184, %176, %162
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %4, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %287

176:                                              ; preds = %171, %159
  %177 = load i32, ptr %18, align 4, !tbaa !5
  %178 = load i32, ptr %21, align 4, !tbaa !5
  %179 = add nsw i32 %177, %178
  %180 = load i32, ptr @N, align 4, !tbaa !5
  %181 = srem i32 %179, %180
  %182 = sext i32 %181 to i64
  %183 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ang, i64 noundef %182) #5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 4 dereferenceable(4) %183)
          to label %184 unwind label %172

184:                                              ; preds = %176
  %185 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt6vectorIiSaIiEEiSt4lessIS2_ESaISt4pairIKS2_iEEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %186 unwind label %172

186:                                              ; preds = %184
  %187 = load i32, ptr %185, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %185, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %186
  %190 = load i32, ptr %21, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %21, align 4, !tbaa !5
  br label %154, !llvm.loop !14

192:                                              ; preds = %158
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %18, align 4, !tbaa !5
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %18, align 4, !tbaa !5
  br label %148, !llvm.loop !15

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

197:                                              ; preds = %282, %196
  %198 = load i32, ptr %23, align 4, !tbaa !5
  %199 = load i32, ptr @N, align 4, !tbaa !5
  %200 = icmp slt i32 %198, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  store i32 20, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %285

202:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 0, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %276, %202
  %204 = load i32, ptr %26, align 4, !tbaa !5
  %205 = load i32, ptr @N, align 4, !tbaa !5
  %206 = icmp slt i32 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  store i32 23, ptr %19, align 4
  br label %279

208:                                              ; preds = %203
  %209 = load i32, ptr %26, align 4, !tbaa !5
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %223

211:                                              ; preds = %208
  %212 = load i32, ptr %23, align 4, !tbaa !5
  %213 = load i32, ptr %26, align 4, !tbaa !5
  %214 = add nsw i32 %212, %213
  %215 = sub nsw i32 %214, 1
  %216 = load i32, ptr @N, align 4, !tbaa !5
  %217 = srem i32 %215, %216
  %218 = sext i32 %217 to i64
  %219 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %218) #5
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = load i32, ptr %25, align 4, !tbaa !5
  %222 = add nsw i32 %221, %220
  store i32 %222, ptr %25, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %211, %208
  %224 = load i32, ptr %26, align 4, !tbaa !5
  %225 = icmp ne i32 %224, 0
  br i1 %225, label %226, label %240

226:                                              ; preds = %223
  %227 = load i32, ptr %23, align 4, !tbaa !5
  %228 = load i32, ptr %26, align 4, !tbaa !5
  %229 = add nsw i32 %227, %228
  %230 = sub nsw i32 %229, 1
  %231 = load i32, ptr @N, align 4, !tbaa !5
  %232 = srem i32 %230, %231
  %233 = sext i32 %232 to i64
  %234 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %233) #5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 4 dereferenceable(4) %234)
          to label %235 unwind label %236

235:                                              ; preds = %226
  br label %240

236:                                              ; preds = %248, %240, %226
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %4, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %5, align 4
  br label %280

240:                                              ; preds = %235, %223
  %241 = load i32, ptr %23, align 4, !tbaa !5
  %242 = load i32, ptr %26, align 4, !tbaa !5
  %243 = add nsw i32 %241, %242
  %244 = load i32, ptr @N, align 4, !tbaa !5
  %245 = srem i32 %243, %244
  %246 = sext i32 %245 to i64
  %247 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ang, i64 noundef %246) #5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 4 dereferenceable(4) %247)
          to label %248 unwind label %236

248:                                              ; preds = %240
  %249 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt6vectorIiSaIiEEiSt4lessIS2_ESaISt4pairIKS2_iEEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %250 unwind label %236

250:                                              ; preds = %248
  %251 = load i32, ptr %249, align 4, !tbaa !5
  %252 = icmp eq i32 %251, 1
  br i1 %252, label %253, label %275

253:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %254 = load i32, ptr %23, align 4, !tbaa !5
  %255 = load i32, ptr %26, align 4, !tbaa !5
  %256 = add nsw i32 %254, %255
  %257 = load i32, ptr @N, align 4, !tbaa !5
  %258 = srem i32 %256, %257
  %259 = sext i32 %258 to i64
  %260 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %259) #5
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %262 = load i32, ptr %25, align 4, !tbaa !5
  %263 = add nsw i32 %261, %262
  %264 = load i32, ptr %23, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %265) #5
  %267 = load i32, ptr %266, align 4, !tbaa !5
  %268 = sub nsw i32 %263, %267
  store i32 %268, ptr %27, align 4, !tbaa !5
  %269 = invoke noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %270 unwind label %271

270:                                              ; preds = %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  store i32 23, ptr %19, align 4
  br label %279

271:                                              ; preds = %253
  %272 = landingpad { ptr, i32 }
          cleanup
  %273 = extractvalue { ptr, i32 } %272, 0
  store ptr %273, ptr %4, align 8
  %274 = extractvalue { ptr, i32 } %272, 1
  store i32 %274, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %280

275:                                              ; preds = %250
  br label %276

276:                                              ; preds = %275
  %277 = load i32, ptr %26, align 4, !tbaa !5
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %26, align 4, !tbaa !5
  br label %203, !llvm.loop !16

279:                                              ; preds = %270, %207
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %281

280:                                              ; preds = %271, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %287

281:                                              ; preds = %279
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  br label %282

282:                                              ; preds = %281
  %283 = load i32, ptr %23, align 4, !tbaa !5
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %23, align 4, !tbaa !5
  br label %197, !llvm.loop !17

285:                                              ; preds = %201
  call void @_Z2psIiJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %22)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  %286 = load i32, ptr %1, align 4
  ret i32 %286

287:                                              ; preds = %280, %172, %45
  %288 = load ptr, ptr %4, align 8
  %289 = load i32, ptr %5, align 4
  %290 = insertvalue { ptr, i32 } poison, ptr %288, 0
  %291 = insertvalue { ptr, i32 } %290, i32 %289, 1
  resume { ptr, i32 } %291
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2reIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2psIiJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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


; 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.3" = 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::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, int>, std::_Select1st<std::pair<const std::vector<int>, int>>, std::less<std::vector<int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, int>, std::_Select1st<std::pair<const std::vector<int>, int>>, std::less<std::vector<int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@N = external dso_local global i32, align 4
@v = external dso_local global %"class.std::vector.3", align 8
@ang = external dso_local global %"class.std::vector.7", align 8
@dist = external dso_local global %"class.std::vector.7", align 8
@ret = external dso_local global %"class.std::vector.7", align 8
@m = external dso_local global %"class.std::map", align 8
@.str.20 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnSt4pairIiiES0_S0_(i64, i64, i64) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3disSt4pairIiiES0_(i64, i64) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector.7", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector.7", align 8
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.20, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %10 unwind label %18

10:                                               ; preds = %0
  invoke void @_Z5setIONSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %11 unwind label %20

11:                                               ; preds = %10
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #4
  call void @_Z2reIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  %12 = load i32, ptr @N, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %13)
  call void @_Z2reISt4pairIiiEEvRSt6vectorIT_SaIS3_EE(ptr noundef nonnull align 8 dereferenceable(24) @v)
  %14 = load i32, ptr @N, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %.preheader73.._crit_edge_crit_edge

.preheader73:                                     ; preds = %.lr.ph
  %16 = icmp sgt i32 %37, 0
  br i1 %16, label %.lr.ph78, label %.preheader73.._crit_edge_crit_edge

.preheader73.._crit_edge_crit_edge:               ; preds = %11, %.preheader73
  %17 = phi i32 [ %37, %.preheader73 ], [ %14, %11 ]
  %.pre136 = sext i32 %17 to i64
  br label %._crit_edge

18:                                               ; preds = %0
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %22

20:                                               ; preds = %10
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  br label %22

22:                                               ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #4
  br label %171

.lr.ph:                                           ; preds = %11, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %11 ]
  %23 = phi i32 [ %37, %.lr.ph ], [ %14, %11 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %24 = trunc i64 %indvars.iv to i32
  %25 = add i32 %24, -1
  %26 = add i32 %25, %23
  %27 = srem i32 %26, %23
  %28 = sext i32 %27 to i64
  %29 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %28) #4
  %.sroa.043.0.copyload = load i64, ptr %29, align 4
  %30 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv) #4
  %.sroa.042.0.copyload = load i64, ptr %30, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr @N, align 4, !tbaa !5
  %32 = trunc nuw nsw i64 %indvars.iv.next to i32
  %33 = srem i32 %32, %31
  %34 = zext nneg i32 %33 to i64
  %35 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %34) #4
  %.sroa.041.0.copyload = load i64, ptr %35, align 4
  %36 = call noundef i32 @_Z3sgnSt4pairIiiES0_S0_(i64 %.sroa.043.0.copyload, i64 %.sroa.042.0.copyload, i64 %.sroa.041.0.copyload)
  store i32 %36, ptr %3, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @ang, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %37 = load i32, ptr @N, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next, %38
  br i1 %39, label %.lr.ph, label %.preheader73, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph78, %.preheader73.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre136, %.preheader73.._crit_edge_crit_edge ], [ %51, %.lr.ph78 ]
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %.pre-phi)
  %40 = load i32, ptr @N, align 4, !tbaa !5
  %41 = add nsw i32 %40, -1
  %42 = icmp sgt i32 %40, 1
  br i1 %42, label %.lr.ph81, label %.preheader

.lr.ph78:                                         ; preds = %.preheader73, %.lr.ph78
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.lr.ph78 ], [ 0, %.preheader73 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %43 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv108) #4
  %.sroa.036.0.copyload = load i64, ptr %43, align 4
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %44 = load i32, ptr @N, align 4, !tbaa !5
  %45 = trunc nuw nsw i64 %indvars.iv.next109 to i32
  %46 = srem i32 %45, %44
  %47 = zext nneg i32 %46 to i64
  %48 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %47) #4
  %.sroa.0.0.copyload = load i64, ptr %48, align 4
  %49 = call noundef i32 @_Z3disSt4pairIiiES0_(i64 %.sroa.036.0.copyload, i64 %.sroa.0.0.copyload)
  store i32 %49, ptr %4, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @dist, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv.next109, %51
  br i1 %52, label %.lr.ph78, label %._crit_edge, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph81, %._crit_edge
  %.lcssa74 = phi i32 [ %41, %._crit_edge ], [ %62, %.lr.ph81 ]
  %53 = icmp sgt i32 %.lcssa74, -1
  br i1 %53, label %.lr.ph84.preheader, label %._crit_edge85

.lr.ph84.preheader:                               ; preds = %.preheader
  %54 = zext nneg i32 %.lcssa74 to i64
  br label %.lr.ph84

.lr.ph81:                                         ; preds = %._crit_edge, %.lr.ph81
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %.lr.ph81 ], [ 0, %._crit_edge ]
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %indvars.iv111) #4
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %indvars.iv111) #4
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, %56
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %indvars.iv.next112) #4
  store i32 %59, ptr %60, align 4, !tbaa !5
  %61 = load i32, ptr @N, align 4, !tbaa !5
  %62 = add nsw i32 %61, -1
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next112, %63
  br i1 %64, label %.lr.ph81, label %.preheader, !llvm.loop !12

._crit_edge85:                                    ; preds = %.lr.ph84, %.preheader
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ang, i64 noundef 0) #4
  store i32 1000000007, ptr %65, align 4, !tbaa !5
  %66 = load i32, ptr @N, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph92, label %._crit_edge93.thread

._crit_edge93.thread:                             ; preds = %._crit_edge85
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %._crit_edge102

.lr.ph84:                                         ; preds = %.lr.ph84.preheader, %.lr.ph84
  %indvars.iv114 = phi i64 [ %54, %.lr.ph84.preheader ], [ %indvars.iv.next115, %.lr.ph84 ]
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %indvars.iv114) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %69 = load i32, ptr @N, align 4, !tbaa !5
  %70 = trunc i64 %indvars.iv114 to i32
  %71 = add i32 %70, 1
  %72 = srem i32 %71, %69
  %73 = zext nneg i32 %72 to i64
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %73) #4
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %indvars.iv114) #4
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %77, %75
  store i32 %78, ptr %5, align 4, !tbaa !5
  %79 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %68, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  %indvars.iv.next115 = add nsw i64 %indvars.iv114, -1
  %.not = icmp eq i64 %indvars.iv114, 0
  br i1 %.not, label %._crit_edge85, label %.lr.ph84, !llvm.loop !13

._crit_edge93:                                    ; preds = %._crit_edge89
  %80 = icmp sgt i32 %96, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br i1 %80, label %.lr.ph101, label %._crit_edge102

.lr.ph92:                                         ; preds = %._crit_edge85, %._crit_edge89
  %.05490 = phi i32 [ %95, %._crit_edge89 ], [ 0, %._crit_edge85 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %81 = load i32, ptr @N, align 4, !tbaa !5
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %._crit_edge89

83:                                               ; preds = %.lr.ph92
  %84 = add nsw i32 %.05490, -1
  %85 = urem i32 %.05490, %81
  %86 = zext nneg i32 %85 to i64
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ang, i64 noundef %86) #4
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %87)
          to label %88 unwind label %.loopexit.split-lp

88:                                               ; preds = %83
  %89 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt6vectorIiSaIiEEiSt4lessIS2_ESaISt4pairIKS2_iEEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %90 unwind label %.loopexit.split-lp

90:                                               ; preds = %88
  %91 = load i32, ptr %89, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %89, align 4, !tbaa !5
  %93 = load i32, ptr @N, align 4, !tbaa !5
  %94 = icmp sgt i32 %93, 1
  br i1 %94, label %.peel.next, label %._crit_edge89

._crit_edge89:                                    ; preds = %110, %90, %.lr.ph92
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  %95 = add nuw nsw i32 %.05490, 1
  %96 = load i32, ptr @N, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %.lr.ph92, label %._crit_edge93, !llvm.loop !14

.peel.next:                                       ; preds = %90, %110
  %98 = phi i32 [ %114, %110 ], [ %93, %90 ]
  %.05386 = phi i32 [ %113, %110 ], [ 1, %90 ]
  %99 = add i32 %84, %.05386
  %100 = srem i32 %99, %98
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %101) #4
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %102)
          to label %._crit_edge133 unwind label %.loopexit118

.loopexit118:                                     ; preds = %.peel.next, %._crit_edge133, %108
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %103

.loopexit.split-lp:                               ; preds = %83, %88
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %103

103:                                              ; preds = %.loopexit.split-lp, %.loopexit118
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit118 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  br label %171

._crit_edge133:                                   ; preds = %.peel.next
  %.pre = load i32, ptr @N, align 4, !tbaa !5
  %104 = add nuw nsw i32 %.05386, %.05490
  %105 = srem i32 %104, %.pre
  %106 = zext nneg i32 %105 to i64
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ang, i64 noundef %106) #4
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %107)
          to label %108 unwind label %.loopexit118

108:                                              ; preds = %._crit_edge133
  %109 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt6vectorIiSaIiEEiSt4lessIS2_ESaISt4pairIKS2_iEEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %110 unwind label %.loopexit118

110:                                              ; preds = %108
  %111 = load i32, ptr %109, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %109, align 4, !tbaa !5
  %113 = add nuw nsw i32 %.05386, 1
  %114 = load i32, ptr @N, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %.peel.next, label %._crit_edge89, !llvm.loop !15

._crit_edge102:                                   ; preds = %.loopexit, %._crit_edge93.thread, %._crit_edge93
  call void @_Z2psIiJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  ret i32 0

.lr.ph101:                                        ; preds = %._crit_edge93, %.loopexit
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %.loopexit ], [ 0, %._crit_edge93 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  %116 = load i32, ptr @N, align 4, !tbaa !5
  %117 = icmp sgt i32 %116, 0
  br i1 %117, label %.thread.peel, label %.loopexit

.thread.peel:                                     ; preds = %.lr.ph101
  %118 = trunc nuw nsw i64 %indvars.iv128 to i32
  %119 = srem i32 %118, %116
  %120 = zext nneg i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ang, i64 noundef %120) #4
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(4) %121)
          to label %122 unwind label %.loopexit.split-lp123

122:                                              ; preds = %.thread.peel
  %123 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt6vectorIiSaIiEEiSt4lessIS2_ESaISt4pairIKS2_iEEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %124 unwind label %.loopexit.split-lp123

124:                                              ; preds = %122
  %125 = load i32, ptr %123, align 4, !tbaa !5
  %126 = icmp eq i32 %125, 1
  br i1 %126, label %.loopexit127, label %127

127:                                              ; preds = %124
  %128 = load i32, ptr @N, align 4, !tbaa !5
  %129 = icmp sgt i32 %128, 1
  br i1 %129, label %.peel.next120, label %.loopexit

.peel.next120:                                    ; preds = %127
  %130 = trunc i64 %indvars.iv128 to i32
  %131 = add i32 %130, -1
  br label %136

132:                                              ; preds = %155
  %133 = add nuw nsw i32 %.095, 1
  %134 = load i32, ptr @N, align 4, !tbaa !5
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %136, label %.loopexit, !llvm.loop !17

136:                                              ; preds = %132, %.peel.next120
  %137 = phi i32 [ %128, %.peel.next120 ], [ %134, %132 ]
  %.095 = phi i32 [ 1, %.peel.next120 ], [ %133, %132 ]
  %.05194 = phi i32 [ 0, %.peel.next120 ], [ %143, %132 ]
  %138 = add i32 %131, %.095
  %139 = srem i32 %138, %137
  %140 = sext i32 %139 to i64
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %140) #4
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = add nsw i32 %142, %.05194
  %144 = load i32, ptr @N, align 4, !tbaa !5
  %145 = srem i32 %138, %144
  %146 = sext i32 %145 to i64
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dist, i64 noundef %146) #4
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(4) %147)
          to label %.thread unwind label %.loopexit122

.loopexit122:                                     ; preds = %136, %.thread, %153
  %lpad.loopexit124 = landingpad { ptr, i32 }
          cleanup
  br label %148

.loopexit.split-lp123:                            ; preds = %.thread.peel, %122
  %lpad.loopexit.split-lp125 = landingpad { ptr, i32 }
          cleanup
  br label %148

148:                                              ; preds = %.loopexit.split-lp123, %.loopexit122
  %lpad.phi126 = phi { ptr, i32 } [ %lpad.loopexit124, %.loopexit122 ], [ %lpad.loopexit.split-lp125, %.loopexit.split-lp123 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %171

.thread:                                          ; preds = %136
  %.pre135 = load i32, ptr @N, align 4, !tbaa !5
  %149 = add nuw nsw i32 %.095, %118
  %150 = srem i32 %149, %.pre135
  %151 = zext nneg i32 %150 to i64
  %152 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ang, i64 noundef %151) #4
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(4) %152)
          to label %153 unwind label %.loopexit122

153:                                              ; preds = %.thread
  %154 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapISt6vectorIiSaIiEEiSt4lessIS2_ESaISt4pairIKS2_iEEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @m, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %155 unwind label %.loopexit122

155:                                              ; preds = %153
  %156 = load i32, ptr %154, align 4, !tbaa !5
  %157 = icmp eq i32 %156, 1
  br i1 %157, label %.loopexit127, label %132

.loopexit127:                                     ; preds = %155, %124
  %.172.lcssa = phi i32 [ 0, %124 ], [ %143, %155 ]
  %.lcssa = phi i32 [ %118, %124 ], [ %149, %155 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %158 = load i32, ptr @N, align 4, !tbaa !5
  %159 = srem i32 %.lcssa, %158
  %160 = zext nneg i32 %159 to i64
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %160) #4
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = add nsw i32 %162, %.172.lcssa
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ret, i64 noundef %indvars.iv128) #4
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sub i32 %163, %165
  store i32 %166, ptr %9, align 4, !tbaa !5
  %167 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  br label %.loopexit

.loopexit:                                        ; preds = %132, %127, %.lr.ph101, %.loopexit127
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %168 = load i32, ptr @N, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = icmp slt i64 %indvars.iv.next129, %169
  br i1 %170, label %.lr.ph101, label %._crit_edge102, !llvm.loop !18

171:                                              ; preds = %148, %103, %22
  %.pn69 = phi { ptr, i32 } [ %lpad.phi, %103 ], [ %lpad.phi126, %148 ], [ %.pn, %22 ]
  resume { ptr, i32 } %.pn69
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2reIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2psIiJEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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


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