; LLVM IR from chromia/lichtenberg :: src/tree.ll (ZN11lichtenberg4TreeC2ERKNS_10CellList2DE)

; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<lichtenberg::TreeNode *, std::allocator<lichtenberg::TreeNode *>>::_Deque_impl" }
%"struct.std::_Deque_base<lichtenberg::TreeNode *, std::allocator<lichtenberg::TreeNode *>>::_Deque_impl" = type { %"struct.std::_Deque_base<lichtenberg::TreeNode *, std::allocator<lichtenberg::TreeNode *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<lichtenberg::TreeNode *, std::allocator<lichtenberg::TreeNode *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%class.anon = type { ptr, ptr, ptr }
%"class.lichtenberg::Tree" = type { i32, i32, %"class.lichtenberg::TreeNode", %"class.std::vector" }
%"class.lichtenberg::TreeNode" = type <{ ptr, ptr, ptr, ptr, %"class.std::tuple", [4 x i8] }>
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Tuple_impl.1", %"struct.std::_Head_base.2" }
%"struct.std::_Tuple_impl.1" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.2" = type { i32 }
%"struct.std::_Head_base.3" = type { i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<lichtenberg::TreeNode, std::allocator<lichtenberg::TreeNode>>::_Vector_impl" }
%"struct.std::_Vector_base<lichtenberg::TreeNode, std::allocator<lichtenberg::TreeNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<lichtenberg::TreeNode, std::allocator<lichtenberg::TreeNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<lichtenberg::TreeNode, std::allocator<lichtenberg::TreeNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.lichtenberg::CellList2D" = type { ptr, i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11lichtenberg4TreeC2ERKNS_10CellList2DE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.std::stack", align 8
  %14 = alloca ptr, align 8
  %15 = alloca %class.anon, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8
  %22 = getelementptr inbounds %"class.lichtenberg::Tree", ptr %21, i32 0, i32 2
  call void @_ZN11lichtenberg8TreeNodeC1Ev(ptr noundef nonnull align 8 dereferenceable(44) %22)
  %23 = getelementptr inbounds %"class.lichtenberg::Tree", ptr %21, i32 0, i32 3
  call void @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.lichtenberg::CellList2D", ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !9
  store i32 %26, ptr %5, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %"class.lichtenberg::CellList2D", ptr %27, i32 0, i32 2
  %29 = load i32, ptr %28, align 4, !tbaa !13
  store i32 %29, ptr %6, align 4, !tbaa !12
  %30 = load i32, ptr %5, align 4, !tbaa !12
  %31 = getelementptr inbounds %"class.lichtenberg::Tree", ptr %21, i32 0, i32 0
  store i32 %30, ptr %31, align 8, !tbaa !14
  %32 = load i32, ptr %6, align 4, !tbaa !12
  %33 = getelementptr inbounds %"class.lichtenberg::Tree", ptr %21, i32 0, i32 1
  store i32 %32, ptr %33, align 4, !tbaa !28
  %34 = getelementptr inbounds %"class.lichtenberg::Tree", ptr %21, i32 0, i32 3
  %35 = load i32, ptr %5, align 4, !tbaa !12
  %36 = load i32, ptr %6, align 4, !tbaa !12
  %37 = mul nsw i32 %35, %36
  %38 = sext i32 %37 to i64
  invoke void @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %38)
          to label %39 unwind label %45

39:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !12
  br label %40

40:                                               ; preds = %103, %39
  %41 = load i32, ptr %9, align 4, !tbaa !12
  %42 = load i32, ptr %6, align 4, !tbaa !12
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %49, label %44

44:                                               ; preds = %40
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %106

45:                                               ; preds = %2
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  br label %252

49:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !12
  br label %50

50:                                               ; preds = %98, %49
  %51 = load i32, ptr %11, align 4, !tbaa !12
  %52 = load i32, ptr %5, align 4, !tbaa !12
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %102

55:                                               ; preds = %50
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load i32, ptr %11, align 4, !tbaa !12
  %58 = load i32, ptr %9, align 4, !tbaa !12
  %59 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %56, i32 noundef %57, i32 noundef %58)
          to label %60 unwind label %89

60:                                               ; preds = %55
  %61 = icmp eq i32 %59, 0
  br i1 %61, label %62, label %97

62:                                               ; preds = %60
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !12
  %65 = load i32, ptr %9, align 4, !tbaa !12
  %66 = invoke noundef zeroext i1 @_ZNK11lichtenberg10CellList2D13get_insulatedEii(ptr noundef nonnull align 8 dereferenceable(16) %63, i32 noundef %64, i32 noundef %65)
          to label %67 unwind label %89

67:                                               ; preds = %62
  br i1 %66, label %97, label %68

68:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %69 = getelementptr inbounds %"class.lichtenberg::Tree", ptr %21, i32 0, i32 3
  %70 = load i32, ptr %9, align 4, !tbaa !12
  %71 = load i32, ptr %5, align 4, !tbaa !12
  %72 = mul nsw i32 %70, %71
  %73 = load i32, ptr %11, align 4, !tbaa !12
  %74 = add nsw i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(44) ptr @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %75) #6
  store ptr %76, ptr %12, align 8, !tbaa !5
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !12
  %79 = load i32, ptr %9, align 4, !tbaa !12
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = load i32, ptr %11, align 4, !tbaa !12
  %82 = load i32, ptr %9, align 4, !tbaa !12
  %83 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D9get_countEii(ptr noundef nonnull align 8 dereferenceable(16) %80, i32 noundef %81, i32 noundef %82)
          to label %84 unwind label %93

84:                                               ; preds = %68
  invoke void @_ZN11lichtenberg8setpointEPNS_8TreeNodeEiii(ptr noundef %77, i32 noundef %78, i32 noundef %79, i32 noundef %83)
          to label %85 unwind label %93

85:                                               ; preds = %84
  %86 = getelementptr inbounds %"class.lichtenberg::Tree", ptr %21, i32 0, i32 2
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN11lichtenberg12connect1sideEPNS_8TreeNodeES1_(ptr noundef %86, ptr noundef %87)
          to label %88 unwind label %93

88:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %97

89:                                               ; preds = %62, %55
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %7, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %8, align 4
  br label %101

93:                                               ; preds = %85, %84, %68
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %7, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %101

97:                                               ; preds = %88, %67, %60
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %11, align 4, !tbaa !12
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %11, align 4, !tbaa !12
  br label %50, !llvm.loop !29

101:                                              ; preds = %93, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %252

102:                                              ; preds = %54
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %9, align 4, !tbaa !12
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %9, align 4, !tbaa !12
  br label %40, !llvm.loop !31

106:                                              ; preds = %44
  call void @llvm.lifetime.start.p0(i64 80, ptr %13) #6
  invoke void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %107 unwind label %130

107:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %108 = getelementptr inbounds %"class.lichtenberg::Tree", ptr %21, i32 0, i32 2
  store ptr %108, ptr %14, align 8, !tbaa !5
  invoke void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %109 unwind label %134

109:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  %110 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 0
  store ptr %21, ptr %110, align 8, !tbaa !32
  %111 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 1
  store ptr %5, ptr %111, align 8, !tbaa !5
  %112 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 2
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %113, ptr %112, align 8, !tbaa !5
  br label %114

114:                                              ; preds = %246, %109
  %115 = invoke noundef zeroext i1 @_ZNKSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %116 unwind label %138

116:                                              ; preds = %114
  %117 = xor i1 %115, true
  br i1 %117, label %118, label %248

118:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %120 unwind label %142

120:                                              ; preds = %118
  %121 = load ptr, ptr %119, align 8, !tbaa !5
  store ptr %121, ptr %16, align 8, !tbaa !5
  invoke void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %122 unwind label %142

122:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  store i8 0, ptr %17, align 1, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  %124 = getelementptr inbounds %"class.lichtenberg::TreeNode", ptr %123, i32 0, i32 3
  %125 = load ptr, ptr %124, align 8, !tbaa !36
  store ptr %125, ptr %18, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %242, %122
  %127 = load ptr, ptr %18, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %146, label %129

129:                                              ; preds = %126
  store i32 10, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %246

130:                                              ; preds = %106
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %7, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %8, align 4
  br label %251

134:                                              ; preds = %107
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %7, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %250

138:                                              ; preds = %114
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %7, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %8, align 4
  br label %249

142:                                              ; preds = %120, %118
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %7, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %8, align 4
  br label %247

146:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %147 = load ptr, ptr %18, align 8, !tbaa !5
  %148 = getelementptr inbounds %"class.lichtenberg::TreeNode", ptr %147, i32 0, i32 4
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %148) #6
  %150 = load i32, ptr %149, align 4, !tbaa !12
  store i32 %150, ptr %19, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %151 = load ptr, ptr %18, align 8, !tbaa !5
  %152 = getelementptr inbounds %"class.lichtenberg::TreeNode", ptr %151, i32 0, i32 4
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %152) #6
  %154 = load i32, ptr %153, align 4, !tbaa !12
  store i32 %154, ptr %20, align 4, !tbaa !12
  %155 = load i32, ptr %19, align 4, !tbaa !12
  %156 = sub nsw i32 %155, 1
  %157 = icmp sge i32 %156, 0
  br i1 %157, label %158, label %177

158:                                              ; preds = %146
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = load i32, ptr %19, align 4, !tbaa !12
  %161 = sub nsw i32 %160, 1
  %162 = load i32, ptr %20, align 4, !tbaa !12
  %163 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %159, i32 noundef %161, i32 noundef %162)
          to label %164 unwind label %172

164:                                              ; preds = %158
  %165 = icmp eq i32 %163, 4
  br i1 %165, label %166, label %176

166:                                              ; preds = %164
  %167 = load i32, ptr %19, align 4, !tbaa !12
  %168 = sub nsw i32 %167, 1
  %169 = load i32, ptr %20, align 4, !tbaa !12
  %170 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %168, i32 noundef %169, ptr noundef %170)
          to label %171 unwind label %172

171:                                              ; preds = %166
  store i8 1, ptr %17, align 1, !tbaa !34
  br label %176

172:                                              ; preds = %239, %229, %221, %209, %201, %190, %182, %166, %158
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %7, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  br label %247

176:                                              ; preds = %171, %164
  br label %177

177:                                              ; preds = %176, %146
  %178 = load i32, ptr %19, align 4, !tbaa !12
  %179 = add nsw i32 %178, 1
  %180 = load i32, ptr %5, align 4, !tbaa !12
  %181 = icmp slt i32 %179, %180
  br i1 %181, label %182, label %197

182:                                              ; preds = %177
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = load i32, ptr %19, align 4, !tbaa !12
  %185 = add nsw i32 %184, 1
  %186 = load i32, ptr %20, align 4, !tbaa !12
  %187 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %183, i32 noundef %185, i32 noundef %186)
          to label %188 unwind label %172

188:                                              ; preds = %182
  %189 = icmp eq i32 %187, 2
  br i1 %189, label %190, label %196

190:                                              ; preds = %188
  %191 = load i32, ptr %19, align 4, !tbaa !12
  %192 = add nsw i32 %191, 1
  %193 = load i32, ptr %20, align 4, !tbaa !12
  %194 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %192, i32 noundef %193, ptr noundef %194)
          to label %195 unwind label %172

195:                                              ; preds = %190
  store i8 1, ptr %17, align 1, !tbaa !34
  br label %196

196:                                              ; preds = %195, %188
  br label %197

197:                                              ; preds = %196, %177
  %198 = load i32, ptr %20, align 4, !tbaa !12
  %199 = sub nsw i32 %198, 1
  %200 = icmp sge i32 %199, 0
  br i1 %200, label %201, label %216

201:                                              ; preds = %197
  %202 = load ptr, ptr %4, align 8, !tbaa !5
  %203 = load i32, ptr %19, align 4, !tbaa !12
  %204 = load i32, ptr %20, align 4, !tbaa !12
  %205 = sub nsw i32 %204, 1
  %206 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %202, i32 noundef %203, i32 noundef %205)
          to label %207 unwind label %172

207:                                              ; preds = %201
  %208 = icmp eq i32 %206, 3
  br i1 %208, label %209, label %215

209:                                              ; preds = %207
  %210 = load i32, ptr %19, align 4, !tbaa !12
  %211 = load i32, ptr %20, align 4, !tbaa !12
  %212 = sub nsw i32 %211, 1
  %213 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %210, i32 noundef %212, ptr noundef %213)
          to label %214 unwind label %172

214:                                              ; preds = %209
  store i8 1, ptr %17, align 1, !tbaa !34
  br label %215

215:                                              ; preds = %214, %207
  br label %216

216:                                              ; preds = %215, %197
  %217 = load i32, ptr %20, align 4, !tbaa !12
  %218 = add nsw i32 %217, 1
  %219 = load i32, ptr %6, align 4, !tbaa !12
  %220 = icmp slt i32 %218, %219
  br i1 %220, label %221, label %236

221:                                              ; preds = %216
  %222 = load ptr, ptr %4, align 8, !tbaa !5
  %223 = load i32, ptr %19, align 4, !tbaa !12
  %224 = load i32, ptr %20, align 4, !tbaa !12
  %225 = add nsw i32 %224, 1
  %226 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %222, i32 noundef %223, i32 noundef %225)
          to label %227 unwind label %172

227:                                              ; preds = %221
  %228 = icmp eq i32 %226, 1
  br i1 %228, label %229, label %235

229:                                              ; preds = %227
  %230 = load i32, ptr %19, align 4, !tbaa !12
  %231 = load i32, ptr %20, align 4, !tbaa !12
  %232 = add nsw i32 %231, 1
  %233 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %230, i32 noundef %232, ptr noundef %233)
          to label %234 unwind label %172

234:                                              ; preds = %229
  store i8 1, ptr %17, align 1, !tbaa !34
  br label %235

235:                                              ; preds = %234, %227
  br label %236

236:                                              ; preds = %235, %216
  %237 = load i8, ptr %17, align 1, !tbaa !34, !range !37, !noundef !38
  %238 = trunc i8 %237 to i1
  br i1 %238, label %239, label %241

239:                                              ; preds = %236
  invoke void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %240 unwind label %172

240:                                              ; preds = %239
  br label %241

241:                                              ; preds = %240, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %242

242:                                              ; preds = %241
  %243 = load ptr, ptr %18, align 8, !tbaa !5
  %244 = getelementptr inbounds %"class.lichtenberg::TreeNode", ptr %243, i32 0, i32 2
  %245 = load ptr, ptr %244, align 8, !tbaa !39
  store ptr %245, ptr %18, align 8, !tbaa !5
  br label %126, !llvm.loop !40

246:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %114, !llvm.loop !41

247:                                              ; preds = %172, %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %249

248:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void

249:                                              ; preds = %247, %138
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  br label %250

250:                                              ; preds = %249, %134
  call void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #6
  br label %251

251:                                              ; preds = %250, %130
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #6
  br label %252

252:                                              ; preds = %251, %101, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  br label %253

253:                                              ; preds = %252
  %254 = load ptr, ptr %7, align 8
  %255 = load i32, ptr %8, align 4
  %256 = insertvalue { ptr, i32 } poison, ptr %254, 0
  %257 = insertvalue { ptr, i32 } %256, i32 %255, 1
  resume { ptr, i32 } %257
}

declare void @_ZN11lichtenberg8TreeNodeC1Ev(ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #1

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

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

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

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #1

declare noundef zeroext i1 @_ZNK11lichtenberg10CellList2D13get_insulatedEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #1

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

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

declare noundef i32 @_ZNK11lichtenberg10CellList2D9get_countEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #1

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, ptr noundef) #4 align 2

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

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

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

attributes #0 = { 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 #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 = { 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN11lichtenberg10CellList2DE", !6, i64 0, !11, i64 8, !11, i64 12}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 12}
!14 = !{!15, !11, i64 0}
!15 = !{!"_ZTSN11lichtenberg4TreeE", !11, i64 0, !11, i64 4, !16, i64 8, !24, i64 56}
!16 = !{!"_ZTSN11lichtenberg8TreeNodeE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !17, i64 32}
!17 = !{!"_ZTSSt5tupleIJiiiEE", !18, i64 0}
!18 = !{!"_ZTSSt11_Tuple_implILm0EJiiiEE", !19, i64 0, !23, i64 8}
!19 = !{!"_ZTSSt11_Tuple_implILm1EJiiEE", !20, i64 0, !22, i64 4}
!20 = !{!"_ZTSSt11_Tuple_implILm2EJiEE", !21, i64 0}
!21 = !{!"_ZTSSt10_Head_baseILm2EiLb0EE", !11, i64 0}
!22 = !{!"_ZTSSt10_Head_baseILm1EiLb0EE", !11, i64 0}
!23 = !{!"_ZTSSt10_Head_baseILm0EiLb0EE", !11, i64 0}
!24 = !{!"_ZTSSt6vectorIN11lichtenberg8TreeNodeESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIN11lichtenberg8TreeNodeESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN11lichtenberg8TreeNodeESaIS1_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN11lichtenberg8TreeNodeESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!15, !11, i64 4}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{!33, !6, i64 0}
!33 = !{!"_ZTSZN11lichtenberg4TreeC1ERKNS_10CellList2DEE3$_0", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!35, !35, i64 0}
!35 = !{!"bool", !7, i64 0}
!36 = !{!16, !6, i64 24}
!37 = !{i8 0, i8 2}
!38 = !{}
!39 = !{!16, !6, i64 16}
!40 = distinct !{!40, !30}
!41 = distinct !{!41, !30}


; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<lichtenberg::TreeNode *, std::allocator<lichtenberg::TreeNode *>>::_Deque_impl" }
%"struct.std::_Deque_base<lichtenberg::TreeNode *, std::allocator<lichtenberg::TreeNode *>>::_Deque_impl" = type { %"struct.std::_Deque_base<lichtenberg::TreeNode *, std::allocator<lichtenberg::TreeNode *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<lichtenberg::TreeNode *, std::allocator<lichtenberg::TreeNode *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%class.anon = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11lichtenberg4TreeC2ERKNS_10CellList2DE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::stack", align 8
  %5 = alloca ptr, align 8
  %6 = alloca %class.anon, align 8
  %7 = alloca ptr, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN11lichtenberg8TreeNodeC1Ev(ptr noundef nonnull align 8 dereferenceable(44) %8)
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !5
  store i32 %11, ptr %3, align 4, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %1, i64 12
  %13 = load i32, ptr %12, align 4, !tbaa !12
  store i32 %11, ptr %0, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %13, ptr %14, align 4, !tbaa !27
  %15 = mul nsw i32 %13, %11
  %16 = sext i32 %15 to i64
  invoke void @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %16)
          to label %.preheader78 unwind label %20

.preheader78:                                     ; preds = %2
  %17 = icmp sgt i32 %13, 0
  %18 = icmp sgt i32 %11, 0
  %or.cond = and i1 %17, %18
  br i1 %or.cond, label %.lr.ph.preheader, label %._crit_edge81

.lr.ph.preheader:                                 ; preds = %.preheader78, %._crit_edge
  %.06280 = phi i32 [ %22, %._crit_edge ], [ 0, %.preheader78 ]
  %19 = mul nuw nsw i32 %11, %.06280
  br label %.lr.ph

._crit_edge81:                                    ; preds = %._crit_edge, %.preheader78
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #6
  invoke void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %43 unwind label %52

20:                                               ; preds = %2
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %107

._crit_edge:                                      ; preds = %40
  %22 = add nuw nsw i32 %.06280, 1
  %exitcond.not = icmp eq i32 %22, %13
  br i1 %exitcond.not, label %._crit_edge81, label %.lr.ph.preheader, !llvm.loop !28

.lr.ph:                                           ; preds = %.lr.ph.preheader, %40
  %.06379 = phi i32 [ %41, %40 ], [ 0, %.lr.ph.preheader ]
  %23 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.06379, i32 noundef %.06280)
          to label %24 unwind label %36

24:                                               ; preds = %.lr.ph
  %25 = icmp eq i32 %23, 0
  br i1 %25, label %26, label %40

26:                                               ; preds = %24
  %27 = invoke noundef zeroext i1 @_ZNK11lichtenberg10CellList2D13get_insulatedEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.06379, i32 noundef %.06280)
          to label %28 unwind label %36

28:                                               ; preds = %26
  br i1 %27, label %40, label %29

29:                                               ; preds = %28
  %30 = add nuw nsw i32 %19, %.06379
  %31 = zext nneg i32 %30 to i64
  %32 = tail call noundef nonnull align 8 dereferenceable(44) ptr @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %31) #6
  %33 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D9get_countEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %.06379, i32 noundef %.06280)
          to label %34 unwind label %38

34:                                               ; preds = %29
  invoke void @_ZN11lichtenberg8setpointEPNS_8TreeNodeEiii(ptr noundef nonnull %32, i32 noundef %.06379, i32 noundef %.06280, i32 noundef %33)
          to label %35 unwind label %38

35:                                               ; preds = %34
  tail call void @_ZN11lichtenberg12connect1sideEPNS_8TreeNodeES1_(ptr noundef nonnull %8, ptr noundef nonnull %32)
  br label %40

36:                                               ; preds = %26, %.lr.ph
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %107

38:                                               ; preds = %34, %29
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %107

40:                                               ; preds = %24, %28, %35
  %41 = add nuw nsw i32 %.06379, 1
  %42 = icmp slt i32 %41, %11
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !31

43:                                               ; preds = %._crit_edge81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store ptr %8, ptr %5, align 8, !tbaa !32
  invoke void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %44 unwind label %54

44:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  store ptr %0, ptr %6, align 8, !tbaa !33
  %45 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %3, ptr %45, align 8, !tbaa !32
  %46 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %1, ptr %46, align 8, !tbaa !32
  %47 = call noundef zeroext i1 @_ZNKSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %47, label %._crit_edge91, label %.lr.ph90

.lr.ph90:                                         ; preds = %44, %._crit_edge88
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %49 = load ptr, ptr %48, align 8, !tbaa !32
  call void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %50 = getelementptr inbounds i8, ptr %49, i64 24
  %storemerge82 = load ptr, ptr %50, align 8, !tbaa !32
  store ptr %storemerge82, ptr %7, align 8, !tbaa !32
  %.not83 = icmp eq ptr %storemerge82, null
  br i1 %.not83, label %._crit_edge88, label %.lr.ph87

._crit_edge88:                                    ; preds = %102, %.lr.ph90
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %51 = call noundef zeroext i1 @_ZNKSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %51, label %._crit_edge91, label %.lr.ph90, !llvm.loop !35

52:                                               ; preds = %._crit_edge81
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %106

54:                                               ; preds = %43
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %105

.lr.ph87:                                         ; preds = %.lr.ph90, %102
  %storemerge85 = phi ptr [ %storemerge, %102 ], [ %storemerge82, %.lr.ph90 ]
  %.05884 = phi i1 [ %.476, %102 ], [ false, %.lr.ph90 ]
  %56 = getelementptr inbounds i8, ptr %storemerge85, i64 32
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %56) #6
  %58 = load i32, ptr %57, align 4, !tbaa !11
  %59 = load ptr, ptr %7, align 8, !tbaa !32
  %60 = getelementptr inbounds i8, ptr %59, i64 32
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %60) #6
  %62 = load i32, ptr %61, align 4, !tbaa !11
  %63 = add nsw i32 %58, -1
  %64 = icmp sgt i32 %58, 0
  br i1 %64, label %65, label %73

65:                                               ; preds = %.lr.ph87
  %66 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %63, i32 noundef %62)
          to label %67 unwind label %71

67:                                               ; preds = %65
  %68 = icmp eq i32 %66, 4
  br i1 %68, label %69, label %73

69:                                               ; preds = %67
  %70 = load ptr, ptr %7, align 8, !tbaa !32
  invoke void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %63, i32 noundef %62, ptr noundef %70)
          to label %73 unwind label %71

71:                                               ; preds = %.thread, %99, %95, %90, %86, %81, %77, %69, %65
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %105

73:                                               ; preds = %69, %67, %.lr.ph87
  %.159 = phi i1 [ %.05884, %67 ], [ %.05884, %.lr.ph87 ], [ true, %69 ]
  %74 = add nsw i32 %58, 1
  %75 = load i32, ptr %3, align 4, !tbaa !11
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %77, label %83

77:                                               ; preds = %73
  %78 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %74, i32 noundef %62)
          to label %79 unwind label %71

79:                                               ; preds = %77
  %80 = icmp eq i32 %78, 2
  br i1 %80, label %81, label %83

81:                                               ; preds = %79
  %82 = load ptr, ptr %7, align 8, !tbaa !32
  invoke void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %74, i32 noundef %62, ptr noundef %82)
          to label %83 unwind label %71

83:                                               ; preds = %81, %79, %73
  %.260 = phi i1 [ %.159, %79 ], [ %.159, %73 ], [ true, %81 ]
  %84 = add nsw i32 %62, -1
  %85 = icmp sgt i32 %62, 0
  br i1 %85, label %86, label %92

86:                                               ; preds = %83
  %87 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %58, i32 noundef %84)
          to label %88 unwind label %71

88:                                               ; preds = %86
  %89 = icmp eq i32 %87, 3
  br i1 %89, label %90, label %92

90:                                               ; preds = %88
  %91 = load ptr, ptr %7, align 8, !tbaa !32
  invoke void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %58, i32 noundef %84, ptr noundef %91)
          to label %92 unwind label %71

92:                                               ; preds = %90, %88, %83
  %.361 = phi i1 [ %.260, %88 ], [ %.260, %83 ], [ true, %90 ]
  %93 = add nsw i32 %62, 1
  %94 = icmp slt i32 %93, %13
  br i1 %94, label %95, label %101

95:                                               ; preds = %92
  %96 = invoke noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %58, i32 noundef %93)
          to label %97 unwind label %71

97:                                               ; preds = %95
  %98 = icmp eq i32 %96, 1
  br i1 %98, label %99, label %101

99:                                               ; preds = %97
  %100 = load ptr, ptr %7, align 8, !tbaa !32
  invoke void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %58, i32 noundef %93, ptr noundef %100)
          to label %.thread unwind label %71

101:                                              ; preds = %97, %92
  br i1 %.361, label %.thread, label %102

.thread:                                          ; preds = %99, %101
  invoke void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %102 unwind label %71

102:                                              ; preds = %.thread, %101
  %.476 = phi i1 [ true, %.thread ], [ false, %101 ]
  %103 = load ptr, ptr %7, align 8, !tbaa !32
  %104 = getelementptr inbounds i8, ptr %103, i64 16
  %storemerge = load ptr, ptr %104, align 8, !tbaa !32
  store ptr %storemerge, ptr %7, align 8, !tbaa !32
  %.not = icmp eq ptr %storemerge, null
  br i1 %.not, label %._crit_edge88, label %.lr.ph87, !llvm.loop !36

._crit_edge91:                                    ; preds = %._crit_edge88, %44
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret void

105:                                              ; preds = %71, %54
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %55, %54 ]
  call void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  br label %106

106:                                              ; preds = %105, %52
  %.pn.pn = phi { ptr, i32 } [ %.pn, %105 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #6
  br label %107

107:                                              ; preds = %36, %38, %106, %20
  %.pn72.pn = phi { ptr, i32 } [ %.pn.pn, %106 ], [ %21, %20 ], [ %39, %38 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  resume { ptr, i32 } %.pn72.pn
}

declare void @_ZN11lichtenberg8TreeNodeC1Ev(ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN11lichtenberg8TreeNodeESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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

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

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_ZNK11lichtenberg10CellList2D7get_dirEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZNK11lichtenberg10CellList2D13get_insulatedEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

declare noundef i32 @_ZNK11lichtenberg10CellList2D9get_countEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #1

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

; 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 uwtable
declare dso_local void @_ZNSt5stackIPN11lichtenberg8TreeNodeESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN11lichtenberg4TreeC1ERKNS_10CellList2DEENK3$_0clEiiPNS_8TreeNodeE"(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4 align 2

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

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

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

attributes #0 = { 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 #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 = { 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"_ZTSN11lichtenberg10CellList2DE", !7, i64 0, !10, i64 8, !10, i64 12}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!6, !10, i64 12}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN11lichtenberg4TreeE", !10, i64 0, !10, i64 4, !15, i64 8, !23, i64 56}
!15 = !{!"_ZTSN11lichtenberg8TreeNodeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !16, i64 32}
!16 = !{!"_ZTSSt5tupleIJiiiEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJiiiEE", !18, i64 0, !22, i64 8}
!18 = !{!"_ZTSSt11_Tuple_implILm1EJiiEE", !19, i64 0, !21, i64 4}
!19 = !{!"_ZTSSt11_Tuple_implILm2EJiEE", !20, i64 0}
!20 = !{!"_ZTSSt10_Head_baseILm2EiLb0EE", !10, i64 0}
!21 = !{!"_ZTSSt10_Head_baseILm1EiLb0EE", !10, i64 0}
!22 = !{!"_ZTSSt10_Head_baseILm0EiLb0EE", !10, i64 0}
!23 = !{!"_ZTSSt6vectorIN11lichtenberg8TreeNodeESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN11lichtenberg8TreeNodeESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN11lichtenberg8TreeNodeESaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN11lichtenberg8TreeNodeESaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!27 = !{!14, !10, i64 4}
!28 = distinct !{!28, !29, !30}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!"llvm.loop.unswitch.partial.disable"}
!31 = distinct !{!31, !29}
!32 = !{!7, !7, i64 0}
!33 = !{!34, !7, i64 0}
!34 = !{!"_ZTSZN11lichtenberg4TreeC1ERKNS_10CellList2DEE3$_0", !7, i64 0, !7, i64 8, !7, i64 16}
!35 = distinct !{!35, !29}
!36 = distinct !{!36, !29}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass