; LLVM IR from ShahjalalShohag/code-library :: Data Structures (Top Tree)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<top_tree_node, std::allocator<top_tree_node>>::_Vector_impl" }
%"struct.std::_Vector_base<top_tree_node, std::allocator<top_tree_node>>::_Vector_impl" = type { %"struct.std::_Vector_base<top_tree_node, std::allocator<top_tree_node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<top_tree_node, std::allocator<top_tree_node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%struct.top_tree_node = type { ptr, [3 x ptr], i8, i8, i32, i8, i64, i64, i64, i64, i64, i64, %"struct.std::array", %"struct.std::array" }
%"struct.std::array" = type { [2 x i64] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %24 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %25 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %27
  %29 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %28, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  %31 = load i32, ptr %2, align 4, !tbaa !8
  %32 = mul nsw i32 2, %31
  %33 = sub nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  call void @_ZNSaI13top_tree_nodeEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt6vectorI13top_tree_nodeSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %34, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %35 unwind label %43

35:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI13top_tree_nodeED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %36

36:                                               ; preds = %53, %35
  %37 = load i32, ptr %7, align 4, !tbaa !8
  %38 = load i32, ptr %2, align 4, !tbaa !8
  %39 = mul nsw i32 2, %38
  %40 = sub nsw i32 %39, 1
  %41 = icmp slt i32 %37, %40
  br i1 %41, label %47, label %42

42:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %56

43:                                               ; preds = %0
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %5, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %6, align 4
  call void @_ZNSt15__new_allocatorI13top_tree_nodeED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  br label %243

47:                                               ; preds = %36
  %48 = load i32, ptr %7, align 4, !tbaa !8
  %49 = load i32, ptr %7, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %50) #7
  %52 = getelementptr inbounds %struct.top_tree_node, ptr %51, i32 0, i32 4
  store i32 %48, ptr %52, align 4, !tbaa !11
  br label %53

53:                                               ; preds = %47
  %54 = load i32, ptr %7, align 4, !tbaa !8
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %7, align 4, !tbaa !8
  br label %36, !llvm.loop !17

56:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %57

57:                                               ; preds = %72, %56
  %58 = load i32, ptr %8, align 4, !tbaa !8
  %59 = load i32, ptr %2, align 4, !tbaa !8
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %63 = load i32, ptr %8, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %64) #7
  store ptr %65, ptr %9, align 8, !tbaa !19
  %66 = load ptr, ptr %9, align 8, !tbaa !19
  %67 = getelementptr inbounds %struct.top_tree_node, ptr %66, i32 0, i32 3
  store i8 1, ptr %67, align 1, !tbaa !20
  %68 = load ptr, ptr %9, align 8, !tbaa !19
  %69 = getelementptr inbounds %struct.top_tree_node, ptr %68, i32 0, i32 2
  store i8 1, ptr %69, align 8, !tbaa !21
  %70 = load ptr, ptr %9, align 8, !tbaa !19
  invoke void @_ZN13top_tree_node6updateEv(ptr noundef nonnull align 8 dereferenceable(128) %70)
          to label %71 unwind label %75

71:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %8, align 4, !tbaa !8
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %8, align 4, !tbaa !8
  br label %57, !llvm.loop !22

75:                                               ; preds = %62
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %5, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %242

79:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !8
  br label %80

80:                                               ; preds = %109, %79
  %81 = load i32, ptr %10, align 4, !tbaa !8
  %82 = load i32, ptr %2, align 4, !tbaa !8
  %83 = sub nsw i32 %82, 1
  %84 = icmp slt i32 %81, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %121

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %87 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %88 unwind label %112

88:                                               ; preds = %86
  %89 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %87, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %90 unwind label %112

90:                                               ; preds = %88
  %91 = load i32, ptr %11, align 4, !tbaa !8
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr %11, align 4, !tbaa !8
  %93 = load i32, ptr %12, align 4, !tbaa !8
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %12, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %95 = load i32, ptr %11, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %96) #7
  store ptr %97, ptr %13, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %98 = load i32, ptr %12, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %99) #7
  store ptr %100, ptr %14, align 8, !tbaa !19
  %101 = load i32, ptr %2, align 4, !tbaa !8
  %102 = load i32, ptr %10, align 4, !tbaa !8
  %103 = add nsw i32 %101, %102
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %104) #7
  %106 = load ptr, ptr %13, align 8, !tbaa !19
  %107 = load ptr, ptr %14, align 8, !tbaa !19
  invoke void @_Z4linkP13top_tree_nodeS0_S0_(ptr noundef %105, ptr noundef %106, ptr noundef %107)
          to label %108 unwind label %116

108:                                              ; preds = %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %10, align 4, !tbaa !8
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %10, align 4, !tbaa !8
  br label %80, !llvm.loop !23

112:                                              ; preds = %88, %86
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %5, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %6, align 4
  br label %120

116:                                              ; preds = %90
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %5, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %120

120:                                              ; preds = %116, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %242

121:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %122 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %123 unwind label %156

123:                                              ; preds = %121
  br label %124

124:                                              ; preds = %237, %123
  %125 = load i32, ptr %15, align 4, !tbaa !8
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %15, align 4, !tbaa !8
  %127 = icmp ne i32 %125, 0
  br i1 %127, label %128, label %239

128:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %129 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %130 unwind label %160

130:                                              ; preds = %128
  %131 = load i32, ptr %16, align 4, !tbaa !8
  %132 = icmp eq i32 %131, 1
  br i1 %132, label %133, label %173

133:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %134 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %135 unwind label %164

135:                                              ; preds = %133
  %136 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %134, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %137 unwind label %164

137:                                              ; preds = %135
  %138 = load i32, ptr %17, align 4, !tbaa !8
  %139 = add nsw i32 %138, -1
  store i32 %139, ptr %17, align 4, !tbaa !8
  %140 = load i32, ptr %18, align 4, !tbaa !8
  %141 = add nsw i32 %140, -1
  store i32 %141, ptr %18, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %142 = load i32, ptr %17, align 4, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %143) #7
  %145 = load i32, ptr %18, align 4, !tbaa !8
  %146 = sext i32 %145 to i64
  %147 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %146) #7
  %148 = invoke noundef ptr @_Z11get_subtreeP13top_tree_nodeS0_(ptr noundef %144, ptr noundef %147)
          to label %149 unwind label %168

149:                                              ; preds = %137
  store ptr %148, ptr %19, align 8, !tbaa !19
  %150 = load ptr, ptr %19, align 8, !tbaa !19
  invoke void @_ZN13top_tree_node20do_subtree_incrementEl(ptr noundef nonnull align 8 dereferenceable(128) %150, i64 noundef 1)
          to label %151 unwind label %168

151:                                              ; preds = %149
  %152 = load ptr, ptr %19, align 8, !tbaa !19
  invoke void @_ZN13top_tree_node8downdateEv(ptr noundef nonnull align 8 dereferenceable(128) %152)
          to label %153 unwind label %168

153:                                              ; preds = %151
  %154 = load ptr, ptr %19, align 8, !tbaa !19
  invoke void @_ZN13top_tree_node10update_allEv(ptr noundef nonnull align 8 dereferenceable(128) %154)
          to label %155 unwind label %168

155:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %237

156:                                              ; preds = %121
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %5, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %6, align 4
  br label %241

160:                                              ; preds = %128
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %5, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %6, align 4
  br label %238

164:                                              ; preds = %135, %133
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %5, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %6, align 4
  br label %172

168:                                              ; preds = %153, %151, %149, %137
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %5, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %172

172:                                              ; preds = %168, %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %238

173:                                              ; preds = %130
  %174 = load i32, ptr %16, align 4, !tbaa !8
  %175 = icmp eq i32 %174, 2
  br i1 %175, label %176, label %208

176:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %177 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %178 unwind label %199

178:                                              ; preds = %176
  %179 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %177, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %180 unwind label %199

180:                                              ; preds = %178
  %181 = load i32, ptr %20, align 4, !tbaa !8
  %182 = add nsw i32 %181, -1
  store i32 %182, ptr %20, align 4, !tbaa !8
  %183 = load i32, ptr %21, align 4, !tbaa !8
  %184 = add nsw i32 %183, -1
  store i32 %184, ptr %21, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %185 = load i32, ptr %20, align 4, !tbaa !8
  %186 = sext i32 %185 to i64
  %187 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %186) #7
  %188 = load i32, ptr %21, align 4, !tbaa !8
  %189 = sext i32 %188 to i64
  %190 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %189) #7
  %191 = invoke noundef ptr @_Z8get_pathP13top_tree_nodeS0_(ptr noundef %187, ptr noundef %190)
          to label %192 unwind label %203

192:                                              ; preds = %180
  store ptr %191, ptr %22, align 8, !tbaa !19
  %193 = load ptr, ptr %22, align 8, !tbaa !19
  invoke void @_ZN13top_tree_node17do_path_incrementEl(ptr noundef nonnull align 8 dereferenceable(128) %193, i64 noundef 1)
          to label %194 unwind label %203

194:                                              ; preds = %192
  %195 = load ptr, ptr %22, align 8, !tbaa !19
  invoke void @_ZN13top_tree_node8downdateEv(ptr noundef nonnull align 8 dereferenceable(128) %195)
          to label %196 unwind label %203

196:                                              ; preds = %194
  %197 = load ptr, ptr %22, align 8, !tbaa !19
  invoke void @_ZN13top_tree_node10update_allEv(ptr noundef nonnull align 8 dereferenceable(128) %197)
          to label %198 unwind label %203

198:                                              ; preds = %196
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %236

199:                                              ; preds = %178, %176
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %5, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %6, align 4
  br label %207

203:                                              ; preds = %196, %194, %192, %180
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %5, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %207

207:                                              ; preds = %203, %199
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %238

208:                                              ; preds = %173
  %209 = load i32, ptr %16, align 4, !tbaa !8
  %210 = icmp eq i32 %209, 3
  br i1 %210, label %211, label %234

211:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %212 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %213 unwind label %230

213:                                              ; preds = %211
  %214 = load i32, ptr %23, align 4, !tbaa !8
  %215 = add nsw i32 %214, -1
  store i32 %215, ptr %23, align 4, !tbaa !8
  %216 = load i32, ptr %23, align 4, !tbaa !8
  %217 = sext i32 %216 to i64
  %218 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %217) #7
  invoke void @_ZN13top_tree_node9make_rootEv(ptr noundef nonnull align 8 dereferenceable(128) %218)
          to label %219 unwind label %230

219:                                              ; preds = %213
  %220 = load i32, ptr %23, align 4, !tbaa !8
  %221 = sext i32 %220 to i64
  %222 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %221) #7
  %223 = getelementptr inbounds %struct.top_tree_node, ptr %222, i32 0, i32 13
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIlLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %223, i64 noundef 0) #7
  %225 = load i64, ptr %224, align 8, !tbaa !24
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %225)
          to label %227 unwind label %230

227:                                              ; preds = %219
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %226, i8 noundef signext 10)
          to label %229 unwind label %230

229:                                              ; preds = %227
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %235

230:                                              ; preds = %227, %219, %213, %211
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %5, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %238

234:                                              ; preds = %208
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 517, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

235:                                              ; preds = %229
  br label %236

236:                                              ; preds = %235, %198
  br label %237

237:                                              ; preds = %236, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %124, !llvm.loop !25

238:                                              ; preds = %230, %207, %172, %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %241

239:                                              ; preds = %124
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @_ZNSt6vectorI13top_tree_nodeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %240 = load i32, ptr %1, align 4
  ret i32 %240

241:                                              ; preds = %238, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %242

242:                                              ; preds = %241, %120, %75
  call void @_ZNSt6vectorI13top_tree_nodeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %243

243:                                              ; preds = %242, %43
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %244

244:                                              ; preds = %243
  %245 = load ptr, ptr %5, align 8
  %246 = load i32, ptr %6, align 4
  %247 = insertvalue { ptr, i32 } poison, ptr %245, 0
  %248 = insertvalue { ptr, i32 } %247, i32 %246, 1
  resume { ptr, i32 } %248
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4linkP13top_tree_nodeS0_S0_(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z11get_subtreeP13top_tree_nodeS0_(ptr noundef, ptr noundef) #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z8get_pathP13top_tree_nodeS0_(ptr noundef, ptr noundef) #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 36}
!12 = !{!"_ZTS13top_tree_node", !13, i64 0, !10, i64 8, !14, i64 32, !14, i64 33, !9, i64 36, !14, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !16, i64 96, !16, i64 112}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!"bool", !10, i64 0}
!15 = !{!"long", !10, i64 0}
!16 = !{!"_ZTSSt5arrayIlLm2EE", !10, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!13, !13, i64 0}
!20 = !{!12, !14, i64 33}
!21 = !{!12, !14, i64 32}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
!24 = !{!15, !15, i64 0}
!25 = distinct !{!25, !18}


; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<top_tree_node, std::allocator<top_tree_node>>::_Vector_impl" }
%"struct.std::_Vector_base<top_tree_node, std::allocator<top_tree_node>>::_Vector_impl" = type { %"struct.std::_Vector_base<top_tree_node, std::allocator<top_tree_node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<top_tree_node, std::allocator<top_tree_node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  %20 = load i32, ptr %1, align 4, !tbaa !8
  %21 = shl nsw i32 %20, 1
  %22 = add nsw i32 %21, -1
  %23 = sext i32 %22 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #7
  call void @_ZNSaI13top_tree_nodeEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt6vectorI13top_tree_nodeSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %23, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %24 unwind label %28

24:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI13top_tree_nodeED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  %25 = load i32, ptr %1, align 4, !tbaa !8
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph, label %._crit_edge

.preheader44:                                     ; preds = %.lr.ph
  %27 = icmp sgt i32 %33, 0
  br i1 %27, label %.lr.ph47, label %._crit_edge

28:                                               ; preds = %0
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI13top_tree_nodeED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  br label %155

.lr.ph:                                           ; preds = %24, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %24 ]
  %30 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #7
  %31 = getelementptr inbounds i8, ptr %30, i64 36
  %32 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %32, ptr %31, align 4, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr %1, align 4, !tbaa !8
  %34 = shl nsw i32 %33, 1
  %35 = add nsw i32 %34, -1
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next, %36
  br i1 %37, label %.lr.ph, label %.preheader44, !llvm.loop !17

.preheader43:                                     ; preds = %.lr.ph47
  %38 = icmp sgt i32 %42, 1
  br i1 %38, label %.lr.ph49, label %._crit_edge

.lr.ph47:                                         ; preds = %.preheader44, %.lr.ph47
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %.lr.ph47 ], [ 0, %.preheader44 ]
  %39 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv54) #7
  %40 = getelementptr inbounds i8, ptr %39, i64 33
  store i8 1, ptr %40, align 1, !tbaa !19
  %41 = getelementptr inbounds i8, ptr %39, i64 32
  store i8 1, ptr %41, align 8, !tbaa !20
  call void @_ZN13top_tree_node6updateEv(ptr noundef nonnull align 8 dereferenceable(128) %39)
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %42 = load i32, ptr %1, align 4, !tbaa !8
  %43 = sext i32 %42 to i64
  %44 = icmp slt i64 %indvars.iv.next55, %43
  br i1 %44, label %.lr.ph47, label %.preheader43, !llvm.loop !21

._crit_edge:                                      ; preds = %65, %24, %.preheader44, %.preheader43
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %45 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %.preheader unwind label %96

.preheader:                                       ; preds = %._crit_edge
  %46 = load i32, ptr %6, align 4, !tbaa !8
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr %6, align 4, !tbaa !8
  %.not50 = icmp eq i32 %46, 0
  br i1 %.not50, label %._crit_edge52, label %.lr.ph51

.lr.ph49:                                         ; preds = %.preheader43, %65
  %.03148 = phi i32 [ %66, %65 ], [ 0, %.preheader43 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %48 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %49 unwind label %70

49:                                               ; preds = %.lr.ph49
  %50 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %51 unwind label %70

51:                                               ; preds = %49
  %52 = load i32, ptr %4, align 4, !tbaa !8
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %4, align 4, !tbaa !8
  %54 = load i32, ptr %5, align 4, !tbaa !8
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr %5, align 4, !tbaa !8
  %56 = sext i32 %53 to i64
  %57 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %56) #7
  %58 = load i32, ptr %5, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %59) #7
  %61 = load i32, ptr %1, align 4, !tbaa !8
  %62 = add nsw i32 %61, %.03148
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %63) #7
  invoke void @_Z4linkP13top_tree_nodeS0_S0_(ptr noundef nonnull %64, ptr noundef nonnull %57, ptr noundef nonnull %60)
          to label %65 unwind label %72

65:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %66 = add nuw nsw i32 %.03148, 1
  %67 = load i32, ptr %1, align 4, !tbaa !8
  %68 = add nsw i32 %67, -1
  %69 = icmp slt i32 %66, %68
  br i1 %69, label %.lr.ph49, label %._crit_edge, !llvm.loop !22

70:                                               ; preds = %49, %.lr.ph49
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %74

72:                                               ; preds = %51
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %74

74:                                               ; preds = %72, %70
  %.pn39 = phi { ptr, i32 } [ %73, %72 ], [ %71, %70 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %154

.lr.ph51:                                         ; preds = %.preheader, %149
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %75 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %76 unwind label %98

76:                                               ; preds = %.lr.ph51
  %77 = load i32, ptr %7, align 4, !tbaa !8
  switch i32 %77, label %148 [
    i32 1, label %78
    i32 2, label %105
    i32 3, label %128
  ]

78:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %79 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %80 unwind label %100

80:                                               ; preds = %78
  %81 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %79, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %82 unwind label %100

82:                                               ; preds = %80
  %83 = load i32, ptr %8, align 4, !tbaa !8
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr %8, align 4, !tbaa !8
  %85 = load i32, ptr %9, align 4, !tbaa !8
  %86 = add nsw i32 %85, -1
  store i32 %86, ptr %9, align 4, !tbaa !8
  %87 = sext i32 %84 to i64
  %88 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %87) #7
  %89 = load i32, ptr %9, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %90) #7
  %92 = invoke noundef ptr @_Z11get_subtreeP13top_tree_nodeS0_(ptr noundef nonnull %88, ptr noundef nonnull %91)
          to label %93 unwind label %102

93:                                               ; preds = %82
  call void @_ZN13top_tree_node20do_subtree_incrementEl(ptr noundef nonnull align 8 dereferenceable(128) %92, i64 noundef 1)
  invoke void @_ZN13top_tree_node8downdateEv(ptr noundef nonnull align 8 dereferenceable(128) %92)
          to label %94 unwind label %102

94:                                               ; preds = %93
  invoke void @_ZN13top_tree_node10update_allEv(ptr noundef nonnull align 8 dereferenceable(128) %92)
          to label %95 unwind label %102

95:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %149

96:                                               ; preds = %._crit_edge
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %153

98:                                               ; preds = %.lr.ph51
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %152

100:                                              ; preds = %80, %78
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %104

102:                                              ; preds = %94, %93, %82
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %104

104:                                              ; preds = %102, %100
  %.pn35 = phi { ptr, i32 } [ %103, %102 ], [ %101, %100 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %152

105:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %106 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %107 unwind label %123

107:                                              ; preds = %105
  %108 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %106, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %109 unwind label %123

109:                                              ; preds = %107
  %110 = load i32, ptr %10, align 4, !tbaa !8
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr %10, align 4, !tbaa !8
  %112 = load i32, ptr %11, align 4, !tbaa !8
  %113 = add nsw i32 %112, -1
  store i32 %113, ptr %11, align 4, !tbaa !8
  %114 = sext i32 %111 to i64
  %115 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %114) #7
  %116 = load i32, ptr %11, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %117) #7
  %119 = invoke noundef ptr @_Z8get_pathP13top_tree_nodeS0_(ptr noundef nonnull %115, ptr noundef nonnull %118)
          to label %120 unwind label %125

120:                                              ; preds = %109
  call void @_ZN13top_tree_node17do_path_incrementEl(ptr noundef nonnull align 8 dereferenceable(128) %119, i64 noundef 1)
  invoke void @_ZN13top_tree_node8downdateEv(ptr noundef nonnull align 8 dereferenceable(128) %119)
          to label %121 unwind label %125

121:                                              ; preds = %120
  invoke void @_ZN13top_tree_node10update_allEv(ptr noundef nonnull align 8 dereferenceable(128) %119)
          to label %122 unwind label %125

122:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %149

123:                                              ; preds = %107, %105
  %124 = landingpad { ptr, i32 }
          cleanup
  br label %127

125:                                              ; preds = %121, %120, %109
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %127

127:                                              ; preds = %125, %123
  %.pn = phi { ptr, i32 } [ %126, %125 ], [ %124, %123 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %152

128:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %129 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %130 unwind label %146

130:                                              ; preds = %128
  %131 = load i32, ptr %12, align 4, !tbaa !8
  %132 = add nsw i32 %131, -1
  store i32 %132, ptr %12, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %133) #7
  invoke void @_ZN13top_tree_node9make_rootEv(ptr noundef nonnull align 8 dereferenceable(128) %134)
          to label %135 unwind label %146

135:                                              ; preds = %130
  %136 = load i32, ptr %12, align 4, !tbaa !8
  %137 = sext i32 %136 to i64
  %138 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNSt6vectorI13top_tree_nodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %137) #7
  %139 = getelementptr inbounds i8, ptr %138, i64 112
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIlLm2EEixEm(ptr noundef nonnull align 8 dereferenceable(16) %139, i64 noundef 0) #7
  %141 = load i64, ptr %140, align 8, !tbaa !23
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %141)
          to label %143 unwind label %146

143:                                              ; preds = %135
  %144 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %142, i8 noundef signext 10)
          to label %145 unwind label %146

145:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  br label %149

146:                                              ; preds = %143, %135, %130, %128
  %147 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  br label %152

148:                                              ; preds = %76
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 517, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

149:                                              ; preds = %122, %145, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %150 = load i32, ptr %6, align 4, !tbaa !8
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %6, align 4, !tbaa !8
  %.not = icmp eq i32 %150, 0
  br i1 %.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !24

152:                                              ; preds = %146, %127, %104, %98
  %.pn35.pn = phi { ptr, i32 } [ %.pn35, %104 ], [ %.pn, %127 ], [ %147, %146 ], [ %99, %98 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %153

._crit_edge52:                                    ; preds = %149, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @_ZNSt6vectorI13top_tree_nodeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

153:                                              ; preds = %152, %96
  %.pn35.pn.pn = phi { ptr, i32 } [ %.pn35.pn, %152 ], [ %97, %96 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %154

154:                                              ; preds = %153, %74
  %.pn39.pn = phi { ptr, i32 } [ %.pn39, %74 ], [ %.pn35.pn.pn, %153 ]
  call void @_ZNSt6vectorI13top_tree_nodeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  br label %155

155:                                              ; preds = %154, %28
  %.pn39.pn.pn = phi { ptr, i32 } [ %.pn39.pn, %154 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn39.pn.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4linkP13top_tree_nodeS0_S0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z11get_subtreeP13top_tree_nodeS0_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z8get_pathP13top_tree_nodeS0_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 36}
!12 = !{!"_ZTS13top_tree_node", !13, i64 0, !10, i64 8, !14, i64 32, !14, i64 33, !9, i64 36, !14, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !16, i64 96, !16, i64 112}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!"bool", !10, i64 0}
!15 = !{!"long", !10, i64 0}
!16 = !{!"_ZTSSt5arrayIlLm2EE", !10, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!12, !14, i64 33}
!20 = !{!12, !14, i64 32}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = !{!15, !15, i64 0}
!24 = distinct !{!24, !18}


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