; LLVM IR from kazunetakahashi/atcoder :: 2019/1102_future-contest-2020-qual/A.ll (ZN5Field13other_place_2ERKSt6vectorIiSaIiEE)

; 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.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.1" = type { i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.19" = type { %"struct.std::_Vector_base.20" }
%"struct.std::_Vector_base.20" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::tuple<int, int>, std::tuple<int, int>, std::_Identity<std::tuple<int, int>>, std::less<std::tuple<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::tuple<int, int>, std::tuple<int, int>, std::_Identity<std::tuple<int, int>>, std::less<std::tuple<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.37" = type { ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.Field = type <{ i32, i32, %"class.std::vector.19", %"class.std::vector.24", %"class.std::vector.9", %"class.std::tuple", i8, [7 x i8] }>
%"class.std::vector.24" = type { %"struct.std::_Vector_base.25" }
%"struct.std::_Vector_base.25" = type { %"struct.std::_Vector_base<std::vector<State>, std::allocator<std::vector<State>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<State>, std::allocator<std::vector<State>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<State>, std::allocator<std::vector<State>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<State>, std::allocator<std::vector<State>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN5Field1VE = external dso_local global %"class.std::vector.9", align 8
@_ZL17reverse_direction = external hidden constant [4 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Tools8setminusEiRKSt6vectorIiSaIiEE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #3

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

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

38:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #5
  call void @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr %5, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #5
  %41 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.37", ptr %11, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #5
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.37", ptr %12, i32 0, i32 0
  store ptr %43, ptr %44, align 8
  br label %45

45:                                               ; preds = %80, %38
  %46 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br i1 %46, label %52, label %47

47:                                               ; preds = %45
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %82

48:                                               ; preds = %2
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %7, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %8, align 4
  br label %221

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %54 = load i32, ptr %53, align 4, !tbaa !30
  store i32 %54, ptr %14, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %55 = getelementptr inbounds %class.Field, ptr %33, i32 0, i32 4
  %56 = load i32, ptr %14, align 4, !tbaa !30
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %57) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %58, i64 8, i1 false)
  %59 = invoke noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %15)
          to label %60 unwind label %63

60:                                               ; preds = %52
  %61 = icmp ne i32 %59, -1
  br i1 %61, label %62, label %67

62:                                               ; preds = %60
  store i32 3, ptr %13, align 4
  br label %74

63:                                               ; preds = %67, %52
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %7, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %220

67:                                               ; preds = %60
  %68 = invoke { ptr, i8 } @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 4 dereferenceable(8) %15)
          to label %69 unwind label %63

69:                                               ; preds = %67
  %70 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 0
  %71 = extractvalue { ptr, i8 } %68, 0
  store ptr %71, ptr %70, align 8
  %72 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 1
  %73 = extractvalue { ptr, i8 } %68, 1
  store i8 %73, ptr %72, align 8
  store i32 0, ptr %13, align 4
  br label %74

74:                                               ; preds = %69, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %75 = load i32, ptr %13, align 4
  switch i32 %75, label %77 [
    i32 0, label %76
  ]

76:                                               ; preds = %74
  store i32 0, ptr %13, align 4
  br label %77

77:                                               ; preds = %76, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  %78 = load i32, ptr %13, align 4
  switch i32 %78, label %227 [
    i32 0, label %79
    i32 3, label %80
  ]

79:                                               ; preds = %77
  br label %80

80:                                               ; preds = %79, %77
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br label %45

82:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr %9, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %83 = load ptr, ptr %17, align 8, !tbaa !5
  %84 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %83) #5
  %85 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %86) #5
  %88 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %87, ptr %88, align 8
  br label %89

89:                                               ; preds = %141, %82
  %90 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  br i1 %90, label %92, label %91

91:                                               ; preds = %89
  store i32 4, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %143

92:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %93 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  store ptr %93, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !30
  br label %94

94:                                               ; preds = %135, %92
  %95 = load i32, ptr %21, align 4, !tbaa !30
  %96 = icmp slt i32 %95, 4
  br i1 %96, label %98, label %97

97:                                               ; preds = %94
  store i32 6, ptr %13, align 4
  br label %139

98:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %99 = load ptr, ptr %20, align 8, !tbaa !5
  %100 = load i32, ptr %21, align 4, !tbaa !30
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef %101) #5
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %22, ptr noundef nonnull align 4 dereferenceable(8) %99, ptr noundef nonnull align 4 dereferenceable(8) %102)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %103 = invoke noundef i32 @_ZNK5Field9get_stateERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %104 unwind label %111

104:                                              ; preds = %98
  store i32 %103, ptr %23, align 4, !tbaa !31
  %105 = load i32, ptr %23, align 4, !tbaa !31
  %106 = icmp eq i32 %105, 2
  br i1 %106, label %107, label %115

107:                                              ; preds = %104
  %108 = load ptr, ptr %20, align 8, !tbaa !5
  %109 = load i32, ptr %21, align 4, !tbaa !30
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %108, i32 noundef %109)
          to label %110 unwind label %111

110:                                              ; preds = %107
  store i32 6, ptr %13, align 4
  br label %132

111:                                              ; preds = %122, %107, %98
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %7, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %8, align 4
  br label %138

115:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %116 = invoke ptr @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %117 unwind label %126

117:                                              ; preds = %115
  %118 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %116, ptr %118, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %119 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  %120 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  %121 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br i1 %121, label %122, label %130

122:                                              ; preds = %117
  %123 = load ptr, ptr %20, align 8, !tbaa !5
  %124 = load i32, ptr %21, align 4, !tbaa !30
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %123, i32 noundef %124)
          to label %125 unwind label %111

125:                                              ; preds = %122
  store i32 6, ptr %13, align 4
  br label %132

126:                                              ; preds = %115
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %7, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %138

130:                                              ; preds = %117
  br label %131

131:                                              ; preds = %130
  store i32 0, ptr %13, align 4
  br label %132

132:                                              ; preds = %131, %125, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %133 = load i32, ptr %13, align 4
  switch i32 %133, label %139 [
    i32 0, label %134
  ]

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %21, align 4, !tbaa !30
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %21, align 4, !tbaa !30
  br label %94, !llvm.loop !33

138:                                              ; preds = %126, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %220

139:                                              ; preds = %132, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %140

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

141:                                              ; preds = %140
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  br label %89

143:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  store ptr %9, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %144 = load ptr, ptr %26, align 8, !tbaa !5
  %145 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %144) #5
  %146 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %147 = load ptr, ptr %26, align 8, !tbaa !5
  %148 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %147) #5
  %149 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %148, ptr %149, align 8
  br label %150

150:                                              ; preds = %216, %143
  %151 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28) #5
  br i1 %151, label %153, label %152

152:                                              ; preds = %150
  store i32 9, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %219

153:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %154 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #5
  store ptr %154, ptr %29, align 8, !tbaa !5
  %155 = load ptr, ptr %29, align 8, !tbaa !5
  %156 = invoke noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %155)
          to label %157 unwind label %160

157:                                              ; preds = %153
  %158 = icmp ne i32 %156, -1
  br i1 %158, label %159, label %164

159:                                              ; preds = %157
  store i32 10, ptr %13, align 4
  br label %213

160:                                              ; preds = %209, %204, %153
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %7, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %8, align 4
  br label %218

164:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store i32 0, ptr %30, align 4, !tbaa !30
  br label %165

165:                                              ; preds = %200, %164
  %166 = load i32, ptr %30, align 4, !tbaa !30
  %167 = icmp slt i32 %166, 4
  br i1 %167, label %169, label %168

168:                                              ; preds = %165
  store i32 11, ptr %13, align 4
  br label %203

169:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %170 = load ptr, ptr %29, align 8, !tbaa !5
  %171 = load i32, ptr %30, align 4, !tbaa !30
  %172 = sext i32 %171 to i64
  %173 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef %172) #5
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %31, ptr noundef nonnull align 4 dereferenceable(8) %170, ptr noundef nonnull align 4 dereferenceable(8) %173)
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %174 = invoke noundef i32 @_ZN5Tools3getIiEET_RKSt5tupleIJiiEERKSt6vectorIS6_IS1_SaIS1_EESaIS8_EE(ptr noundef nonnull align 4 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %175 unwind label %191

175:                                              ; preds = %169
  store i32 %174, ptr %32, align 4, !tbaa !30
  %176 = load i32, ptr %32, align 4, !tbaa !30
  %177 = icmp eq i32 %176, -1
  br i1 %177, label %178, label %196

178:                                              ; preds = %175
  %179 = load ptr, ptr %29, align 8, !tbaa !5
  %180 = load i32, ptr %30, align 4, !tbaa !30
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %179, i32 noundef %180)
          to label %181 unwind label %191

181:                                              ; preds = %178
  %182 = invoke noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %31)
          to label %183 unwind label %191

183:                                              ; preds = %181
  %184 = icmp eq i32 %182, -1
  br i1 %184, label %185, label %195

185:                                              ; preds = %183
  %186 = load i32, ptr %30, align 4, !tbaa !30
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [4 x i32], ptr @_ZL17reverse_direction, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !30
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %31, i32 noundef %189)
          to label %190 unwind label %191

190:                                              ; preds = %185
  br label %195

191:                                              ; preds = %185, %181, %178, %169
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %7, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %218

195:                                              ; preds = %190, %183
  store i32 11, ptr %13, align 4
  br label %197

196:                                              ; preds = %175
  store i32 0, ptr %13, align 4
  br label %197

197:                                              ; preds = %196, %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  %198 = load i32, ptr %13, align 4
  switch i32 %198, label %203 [
    i32 0, label %199
  ]

199:                                              ; preds = %197
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %30, align 4, !tbaa !30
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %30, align 4, !tbaa !30
  br label %165, !llvm.loop !35

203:                                              ; preds = %197, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %204

204:                                              ; preds = %203
  %205 = load ptr, ptr %29, align 8, !tbaa !5
  %206 = invoke noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %205)
          to label %207 unwind label %160

207:                                              ; preds = %204
  %208 = icmp eq i32 %206, -1
  br i1 %208, label %209, label %212

209:                                              ; preds = %207
  %210 = load ptr, ptr %29, align 8, !tbaa !5
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %33, ptr noundef nonnull align 4 dereferenceable(8) %210, i32 noundef 0)
          to label %211 unwind label %160

211:                                              ; preds = %209
  br label %212

212:                                              ; preds = %211, %207
  store i32 0, ptr %13, align 4
  br label %213

213:                                              ; preds = %212, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  %214 = load i32, ptr %13, align 4
  switch i32 %214, label %227 [
    i32 0, label %215
    i32 10, label %216
  ]

215:                                              ; preds = %213
  br label %216

216:                                              ; preds = %215, %213
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #5
  br label %150

218:                                              ; preds = %191, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %220

219:                                              ; preds = %152
  call void @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  ret void

220:                                              ; preds = %218, %138, %63
  call void @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %221

221:                                              ; preds = %220, %48
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  br label %222

222:                                              ; preds = %221
  %223 = load ptr, ptr %7, align 8
  %224 = load i32, ptr %8, align 4
  %225 = insertvalue { ptr, i32 } poison, ptr %223, 0
  %226 = insertvalue { ptr, i32 } %225, i32 %224, 1
  resume { ptr, i32 } %226

227:                                              ; preds = %213, %77
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK5Field9get_stateERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89), ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS5Field", !11, i64 0, !11, i64 4, !12, i64 8, !16, i64 32, !20, i64 56, !24, i64 80, !29, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIS_IiSaIiEESaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSSt6vectorIS_I5StateSaIS0_EESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseISt6vectorI5StateSaIS1_EESaIS3_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt6vectorI5StateSaIS1_EESaIS3_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt6vectorI5StateSaIS1_EESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTSSt6vectorISt5tupleIJiiEESaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseISt5tupleIJiiEESaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseISt5tupleIJiiEESaIS1_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt5tupleIJiiEESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSSt5tupleIJiiEE", !25, i64 0}
!25 = !{!"_ZTSSt11_Tuple_implILm0EJiiEE", !26, i64 0, !28, i64 4}
!26 = !{!"_ZTSSt11_Tuple_implILm1EJiEE", !27, i64 0}
!27 = !{!"_ZTSSt10_Head_baseILm1EiLb0EE", !11, i64 0}
!28 = !{!"_ZTSSt10_Head_baseILm0EiLb0EE", !11, i64 0}
!29 = !{!"bool", !7, i64 0}
!30 = !{!11, !11, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"_ZTS5State", !7, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


; 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.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.1" = type { i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.19" = type { %"struct.std::_Vector_base.20" }
%"struct.std::_Vector_base.20" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::tuple<int, int>, std::tuple<int, int>, std::_Identity<std::tuple<int, int>>, std::less<std::tuple<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::tuple<int, int>, std::tuple<int, int>, std::_Identity<std::tuple<int, int>>, std::less<std::tuple<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.37" = type { ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@_ZN5Field1VE = external dso_local global %"class.std::vector.9", align 8
@_ZL17reverse_direction = external hidden local_unnamed_addr constant [4 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Tools8setminusEiRKSt6vectorIiSaIiEE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Field13other_place_2ERKSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::vector.19", align 8
  %5 = alloca %"class.std::set", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.37", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.37", align 8
  %8 = alloca %"class.std::tuple", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"class.std::tuple", align 4
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"class.std::tuple", align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  %17 = load i32, ptr %0, align 8, !tbaa !5
  call void @_ZN5Tools8setminusEiRKSt6vectorIiSaIiEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %3, i32 noundef %17, ptr noundef nonnull align 8 dereferenceable(24) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %19 unwind label %27

19:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #4
  call void @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %20 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  store ptr %20, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %21 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  store ptr %21, ptr %7, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %19
  %23 = getelementptr inbounds i8, ptr %0, i64 56
  br label %29

._crit_edge:                                      ; preds = %41, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %24 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  store ptr %24, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %25 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  store ptr %25, ptr %10, align 8
  %26 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br i1 %26, label %.lr.ph63, label %._crit_edge64

27:                                               ; preds = %2
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %127

29:                                               ; preds = %.lr.ph, %41
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %31 = load i32, ptr %30, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %32) #4
  %34 = load i64, ptr %33, align 4
  store i64 %34, ptr %8, align 8
  %35 = invoke noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %36 unwind label %37

36:                                               ; preds = %29
  %.not48 = icmp eq i32 %35, -1
  br i1 %.not48, label %39, label %41

37:                                               ; preds = %39, %29
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %126

39:                                               ; preds = %36
  %40 = invoke { ptr, i8 } @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %41 unwind label %37

41:                                               ; preds = %39, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %43, label %29, label %._crit_edge

._crit_edge64:                                    ; preds = %.loopexit54, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  %44 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  store ptr %44, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  %45 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  store ptr %45, ptr %15, align 8
  %46 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  br i1 %46, label %.lr.ph67, label %._crit_edge68

.lr.ph63:                                         ; preds = %._crit_edge, %.loopexit54
  %47 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %48 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef 0) #4
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %11, ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %48)
  %49 = invoke noundef i32 @_ZNK5Field9get_stateERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %50 unwind label %.loopexit55

50:                                               ; preds = %.lr.ph63
  %51 = icmp eq i32 %49, 2
  br i1 %51, label %.invoke, label %53

.invoke:                                          ; preds = %50, %63, %73, %83, %55, %67, %77, %87
  %52 = phi i32 [ 0, %55 ], [ 1, %67 ], [ 2, %77 ], [ 3, %87 ], [ 0, %50 ], [ 1, %63 ], [ 2, %73 ], [ 3, %83 ]
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %47, i32 noundef %52)
          to label %.critedge unwind label %.loopexit.split-lp

.loopexit55:                                      ; preds = %80, %70, %60, %.lr.ph63
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %90

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

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %54 = invoke ptr @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %55 unwind label %58

55:                                               ; preds = %53
  store ptr %54, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %56 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  store ptr %56, ptr %13, align 8
  %57 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br i1 %57, label %.invoke, label %60

58:                                               ; preds = %85, %75, %65, %53
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br label %90

60:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %61 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef 1) #4
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %11, ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %61)
  %62 = invoke noundef i32 @_ZNK5Field9get_stateERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %63 unwind label %.loopexit55

63:                                               ; preds = %60
  %64 = icmp eq i32 %62, 2
  br i1 %64, label %.invoke, label %65

65:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %66 = invoke ptr @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %67 unwind label %58

67:                                               ; preds = %65
  store ptr %66, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %68 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  store ptr %68, ptr %13, align 8
  %69 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br i1 %69, label %.invoke, label %70

70:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %71 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef 2) #4
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %11, ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %71)
  %72 = invoke noundef i32 @_ZNK5Field9get_stateERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %73 unwind label %.loopexit55

73:                                               ; preds = %70
  %74 = icmp eq i32 %72, 2
  br i1 %74, label %.invoke, label %75

75:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %76 = invoke ptr @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %77 unwind label %58

77:                                               ; preds = %75
  store ptr %76, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %78 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  store ptr %78, ptr %13, align 8
  %79 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br i1 %79, label %.invoke, label %80

80:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %81 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef 3) #4
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %11, ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %81)
  %82 = invoke noundef i32 @_ZNK5Field9get_stateERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %83 unwind label %.loopexit55

83:                                               ; preds = %80
  %84 = icmp eq i32 %82, 2
  br i1 %84, label %.invoke, label %85

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %86 = invoke ptr @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %87 unwind label %58

87:                                               ; preds = %85
  store ptr %86, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %88 = call ptr @_ZNKSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  store ptr %88, ptr %13, align 8
  %89 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br i1 %89, label %.invoke, label %.loopexit54.loopexit

.loopexit54.loopexit:                             ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %.loopexit54

90:                                               ; preds = %.loopexit55, %.loopexit.split-lp, %58
  %.pn46 = phi { ptr, i32 } [ %59, %58 ], [ %lpad.loopexit, %.loopexit55 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br label %126

.critedge:                                        ; preds = %.invoke
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %.loopexit54

.loopexit54:                                      ; preds = %.loopexit54.loopexit, %.critedge
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  %92 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br i1 %92, label %.lr.ph63, label %._crit_edge64

._crit_edge68:                                    ; preds = %122, %._crit_edge64
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  ret void

.lr.ph67:                                         ; preds = %._crit_edge64, %122
  %93 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %94 = invoke noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %93)
          to label %95 unwind label %98

95:                                               ; preds = %.lr.ph67
  %.not = icmp eq i32 %94, -1
  br i1 %.not, label %.preheader.preheader, label %122

.preheader.preheader:                             ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef 0) #4
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %16, ptr noundef nonnull align 4 dereferenceable(8) %93, ptr noundef nonnull align 4 dereferenceable(8) %96)
  %97 = call noundef i32 @_ZN5Tools3getIiEET_RKSt5tupleIJiiEERKSt6vectorIS6_IS1_SaIS1_EESaIS8_EE(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %.not44 = icmp eq i32 %97, -1
  br i1 %.not44, label %100, label %.preheader.1

98:                                               ; preds = %121, %.loopexit, %.lr.ph67
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %125

100:                                              ; preds = %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %.03565.lcssa.wide = phi i64 [ 0, %.preheader.preheader ], [ 1, %.preheader.1 ], [ 2, %.preheader.2 ], [ 3, %.preheader.3 ]
  %101 = trunc nuw nsw i64 %.03565.lcssa.wide to i32
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %93, i32 noundef %101)
          to label %102 unwind label %109

102:                                              ; preds = %100
  %103 = invoke noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %104 unwind label %109

104:                                              ; preds = %102
  %105 = icmp eq i32 %103, -1
  br i1 %105, label %106, label %111

106:                                              ; preds = %104
  %107 = getelementptr inbounds [4 x i32], ptr @_ZL17reverse_direction, i64 0, i64 %.03565.lcssa.wide
  %108 = load i32, ptr %107, align 4, !tbaa !29
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %16, i32 noundef %108)
          to label %111 unwind label %109

109:                                              ; preds = %106, %102, %100
  %110 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  br label %125

111:                                              ; preds = %104, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  br label %.loopexit

.preheader.1:                                     ; preds = %.preheader.preheader
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  %112 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef 1) #4
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %16, ptr noundef nonnull align 4 dereferenceable(8) %93, ptr noundef nonnull align 4 dereferenceable(8) %112)
  %113 = call noundef i32 @_ZN5Tools3getIiEET_RKSt5tupleIJiiEERKSt6vectorIS6_IS1_SaIS1_EESaIS8_EE(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %.not44.1 = icmp eq i32 %113, -1
  br i1 %.not44.1, label %100, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  %114 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef 2) #4
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %16, ptr noundef nonnull align 4 dereferenceable(8) %93, ptr noundef nonnull align 4 dereferenceable(8) %114)
  %115 = call noundef i32 @_ZN5Tools3getIiEET_RKSt5tupleIJiiEERKSt6vectorIS6_IS1_SaIS1_EESaIS8_EE(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %.not44.2 = icmp eq i32 %115, -1
  br i1 %.not44.2, label %100, label %.preheader.3

.preheader.3:                                     ; preds = %.preheader.2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  %116 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN5Field1VE, i64 noundef 3) #4
  call void @_ZplRKSt5tupleIJiiEES2_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %16, ptr noundef nonnull align 4 dereferenceable(8) %93, ptr noundef nonnull align 4 dereferenceable(8) %116)
  %117 = call noundef i32 @_ZN5Tools3getIiEET_RKSt5tupleIJiiEERKSt6vectorIS6_IS1_SaIS1_EESaIS8_EE(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %.not44.3 = icmp eq i32 %117, -1
  br i1 %.not44.3, label %100, label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %.preheader.3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %111
  %118 = invoke noundef i32 @_ZNK5Field13get_directionERKSt5tupleIJiiEE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %93)
          to label %119 unwind label %98

119:                                              ; preds = %.loopexit
  %120 = icmp eq i32 %118, -1
  br i1 %120, label %121, label %122

121:                                              ; preds = %119
  invoke void @_ZN5Field13set_directionERKSt5tupleIJiiEEi(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 4 dereferenceable(8) %93, i32 noundef 0)
          to label %122 unwind label %98

122:                                              ; preds = %119, %121, %95
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJiiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %124 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJiiEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  br i1 %124, label %.lr.ph67, label %._crit_edge68

125:                                              ; preds = %109, %98
  %.pn = phi { ptr, i32 } [ %99, %98 ], [ %110, %109 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  br label %126

126:                                              ; preds = %125, %90, %37
  %.pn49 = phi { ptr, i32 } [ %38, %37 ], [ %.pn46, %90 ], [ %.pn, %125 ]
  call void @_ZNSt3setISt5tupleIJiiEESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  br label %127

127:                                              ; preds = %126, %27
  %.pn49.pn = phi { ptr, i32 } [ %.pn49, %126 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn49.pn
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS5Field", !7, i64 0, !7, i64 4, !10, i64 8, !15, i64 32, !19, i64 56, !23, i64 80, !28, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIS_IiSaIiEESaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"_ZTSSt6vectorIS_I5StateSaIS0_EESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseISt6vectorI5StateSaIS1_EESaIS3_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt6vectorI5StateSaIS1_EESaIS3_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt6vectorI5StateSaIS1_EESaIS3_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!19 = !{!"_ZTSSt6vectorISt5tupleIJiiEESaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseISt5tupleIJiiEESaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt5tupleIJiiEESaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseISt5tupleIJiiEESaIS1_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!23 = !{!"_ZTSSt5tupleIJiiEE", !24, i64 0}
!24 = !{!"_ZTSSt11_Tuple_implILm0EJiiEE", !25, i64 0, !27, i64 4}
!25 = !{!"_ZTSSt11_Tuple_implILm1EJiEE", !26, i64 0}
!26 = !{!"_ZTSSt10_Head_baseILm1EiLb0EE", !7, i64 0}
!27 = !{!"_ZTSSt10_Head_baseILm0EiLb0EE", !7, i64 0}
!28 = !{!"bool", !8, i64 0}
!29 = !{!7, !7, i64 0}


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