; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src (fluidbrickgrid)

; 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.Array3d.29 = type { i32, i32, i32, ptr, i8, i8, i32 }
%class.GridIndexVector = type { i32, i32, i32, %"class.std::vector.17" }
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.GridIndex = type { i32, i32, i32 }
%struct.Brick = type <{ float, i8, [3 x i8] }>
%class.FluidBrickGrid = type <{ i32, i32, i32, [4 x i8], double, %class.AABB, %class.Array3d, %class.Array3d.0, [3 x %class.Array3d.0], i32, [4 x i8], %class.Array3d.0, i8, [3 x i8], i32, i32, float, float, float, i32, i32, i8, [7 x i8] }>
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.vmath::vec3" = type { float, float, float }
%class.Array3d = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], %"struct.FluidBrickGrid::DensityNode", i32, [4 x i8] }>
%"struct.FluidBrickGrid::DensityNode" = type { float, float, float }
%class.Array3d.0 = type { i32, i32, i32, ptr, i8, [3 x i8], %struct.Brick, i32 }

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14FluidBrickGrid19_getConnectedBricksEiiiR7Array3dI5BrickERS0_IbER15GridIndexVector(ptr noundef nonnull align 8 dereferenceable(353) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(40) %6) #2 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %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 %class.Array3d.29, align 8
  %19 = alloca %class.GridIndexVector, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca [6 x %struct.GridIndex], align 16
  %23 = alloca %struct.GridIndex, align 4
  %24 = alloca %struct.GridIndex, align 4
  %25 = alloca %struct.GridIndex, align 4
  %26 = alloca { i64, i32 }, align 8
  %27 = alloca %struct.GridIndex, align 4
  %28 = alloca { i64, i32 }, align 4
  %29 = alloca i32, align 4
  %30 = alloca %struct.GridIndex, align 4
  %31 = alloca { i64, i32 }, align 4
  %32 = alloca %struct.Brick, align 4
  %33 = alloca %struct.GridIndex, align 4
  %34 = alloca { i64, i32 }, align 4
  %35 = alloca %struct.GridIndex, align 4
  %36 = alloca { i64, i32 }, align 4
  %37 = alloca %struct.GridIndex, align 4
  %38 = alloca { i64, i32 }, align 4
  %39 = alloca %struct.GridIndex, align 4
  %40 = alloca { i64, i32 }, align 4
  %41 = alloca %struct.GridIndex, align 4
  %42 = alloca { i64, i32 }, align 4
  %43 = alloca %struct.GridIndex, align 4
  %44 = alloca { i64, i32 }, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %45 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %46 = getelementptr inbounds %class.FluidBrickGrid, ptr %45, i32 0, i32 7
  %47 = getelementptr inbounds %class.Array3d.0, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !11
  store i32 %48, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %49 = getelementptr inbounds %class.FluidBrickGrid, ptr %45, i32 0, i32 7
  %50 = getelementptr inbounds %class.Array3d.0, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 4, !tbaa !22
  store i32 %51, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %52 = getelementptr inbounds %class.FluidBrickGrid, ptr %45, i32 0, i32 7
  %53 = getelementptr inbounds %class.Array3d.0, ptr %52, i32 0, i32 2
  %54 = load i32, ptr %53, align 8, !tbaa !23
  store i32 %54, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #8
  %55 = load i32, ptr %15, align 4, !tbaa !9
  %56 = load i32, ptr %16, align 4, !tbaa !9
  %57 = load i32, ptr %17, align 4, !tbaa !9
  call void @_ZN7Array3dIbEC2Eiiib(ptr noundef nonnull align 8 dereferenceable(32) %18, i32 noundef %55, i32 noundef %56, i32 noundef %57, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #8
  %58 = load i32, ptr %15, align 4, !tbaa !9
  %59 = load i32, ptr %16, align 4, !tbaa !9
  %60 = load i32, ptr %17, align 4, !tbaa !9
  invoke void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40) %19, i32 noundef %58, i32 noundef %59, i32 noundef %60)
          to label %61 unwind label %103

61:                                               ; preds = %7
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = load i32, ptr %11, align 4, !tbaa !9
  invoke void @_ZN15GridIndexVector9push_backEiii(ptr noundef nonnull align 8 dereferenceable(40) %19, i32 noundef %62, i32 noundef %63, i32 noundef %64)
          to label %65 unwind label %107

65:                                               ; preds = %61
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = load i32, ptr %11, align 4, !tbaa !9
  invoke void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %66, i32 noundef %67, i32 noundef %68, i32 noundef %69, i1 noundef zeroext false)
          to label %70 unwind label %107

70:                                               ; preds = %65
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = load i32, ptr %11, align 4, !tbaa !9
  invoke void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %18, i32 noundef %71, i32 noundef %72, i32 noundef %73, i1 noundef zeroext true)
          to label %74 unwind label %107

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 72, ptr %22) #8
  %75 = getelementptr inbounds [6 x %struct.GridIndex], ptr %22, i32 0, i32 0
  %76 = getelementptr inbounds %struct.GridIndex, ptr %75, i64 6
  br label %77

77:                                               ; preds = %79, %74
  %78 = phi ptr [ %75, %74 ], [ %80, %79 ]
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %78)
          to label %79 unwind label %111

79:                                               ; preds = %77
  %80 = getelementptr inbounds %struct.GridIndex, ptr %78, i64 1
  %81 = icmp eq ptr %80, %76
  br i1 %81, label %82, label %77

82:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #8
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %23)
          to label %83 unwind label %115

83:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #8
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %24)
          to label %84 unwind label %119

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %198, %84
  %86 = invoke noundef zeroext i1 @_ZN15GridIndexVector5emptyEv(ptr noundef nonnull align 8 dereferenceable(40) %19)
          to label %87 unwind label %119

87:                                               ; preds = %85
  %88 = xor i1 %86, true
  br i1 %88, label %89, label %199

89:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #8
  %90 = invoke { i64, i32 } @_ZN15GridIndexVector4backEv(ptr noundef nonnull align 8 dereferenceable(40) %19)
          to label %91 unwind label %123

91:                                               ; preds = %89
  store { i64, i32 } %90, ptr %26, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 8 %26, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %25, i64 12, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #8
  invoke void @_ZN15GridIndexVector8pop_backEv(ptr noundef nonnull align 8 dereferenceable(40) %19)
          to label %92 unwind label %119

92:                                               ; preds = %91
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !24
  %93 = getelementptr inbounds [6 x %struct.GridIndex], ptr %22, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %27, i64 12, i1 false)
  %94 = getelementptr inbounds { i64, i32 }, ptr %28, i32 0, i32 0
  %95 = load i64, ptr %94, align 4
  %96 = getelementptr inbounds { i64, i32 }, ptr %28, i32 0, i32 1
  %97 = load i32, ptr %96, align 4
  invoke void @_ZN6Grid3d24getNeighbourGridIndices6E9GridIndexPS0_(i64 %95, i32 %97, ptr noundef %93)
          to label %98 unwind label %119

98:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %188, %98
  %100 = load i32, ptr %29, align 4, !tbaa !9
  %101 = icmp slt i32 %100, 6
  br i1 %101, label %127, label %102

102:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %192

103:                                              ; preds = %7
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %20, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %21, align 4
  br label %204

107:                                              ; preds = %70, %65, %61
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %20, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %21, align 4
  br label %203

111:                                              ; preds = %77
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %20, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %21, align 4
  br label %202

115:                                              ; preds = %82
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %20, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %21, align 4
  br label %201

119:                                              ; preds = %192, %92, %91, %85, %83
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %20, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %21, align 4
  br label %200

123:                                              ; preds = %89
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %20, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #8
  br label %200

127:                                              ; preds = %99
  %128 = load i32, ptr %29, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [6 x %struct.GridIndex], ptr %22, i64 0, i64 %129
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %130, i64 12, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !24
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = load i32, ptr %16, align 4, !tbaa !9
  %133 = load i32, ptr %17, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %30, i64 12, i1 false)
  %134 = getelementptr inbounds { i64, i32 }, ptr %31, i32 0, i32 0
  %135 = load i64, ptr %134, align 4
  %136 = getelementptr inbounds { i64, i32 }, ptr %31, i32 0, i32 1
  %137 = load i32, ptr %136, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %138 = invoke noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %135, i32 %137, i32 noundef %131, i32 noundef %132, i32 noundef %133)
          to label %139 unwind label %179

139:                                              ; preds = %127
  br i1 %138, label %140, label %160

140:                                              ; preds = %139
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %33, i64 12, i1 false)
  %142 = getelementptr inbounds { i64, i32 }, ptr %34, i32 0, i32 0
  %143 = load i64, ptr %142, align 4
  %144 = getelementptr inbounds { i64, i32 }, ptr %34, i32 0, i32 1
  %145 = load i32, ptr %144, align 4
  %146 = invoke i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %141, i64 %143, i32 %145)
          to label %147 unwind label %183

147:                                              ; preds = %140
  %148 = trunc i64 %146 to i40
  store i40 %148, ptr %32, align 4
  %149 = getelementptr inbounds %struct.Brick, ptr %32, i32 0, i32 1
  %150 = load i8, ptr %149, align 4, !tbaa !25, !range !26, !noundef !27
  %151 = trunc i8 %150 to i1
  br i1 %151, label %152, label %160

152:                                              ; preds = %147
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 4 %35, i64 12, i1 false)
  %153 = getelementptr inbounds { i64, i32 }, ptr %36, i32 0, i32 0
  %154 = load i64, ptr %153, align 4
  %155 = getelementptr inbounds { i64, i32 }, ptr %36, i32 0, i32 1
  %156 = load i32, ptr %155, align 4
  %157 = invoke noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %18, i64 %154, i32 %156)
          to label %158 unwind label %183

158:                                              ; preds = %152
  %159 = xor i1 %157, true
  br label %160

160:                                              ; preds = %158, %147, %139
  %161 = phi i1 [ false, %147 ], [ false, %139 ], [ %159, %158 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br i1 %161, label %162, label %187

162:                                              ; preds = %160
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %37, i64 12, i1 false)
  %163 = getelementptr inbounds { i64, i32 }, ptr %38, i32 0, i32 0
  %164 = load i64, ptr %163, align 4
  %165 = getelementptr inbounds { i64, i32 }, ptr %38, i32 0, i32 1
  %166 = load i32, ptr %165, align 4
  invoke void @_ZN15GridIndexVector9push_backE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %19, i64 %164, i32 %166)
          to label %167 unwind label %179

167:                                              ; preds = %162
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 4 %39, i64 12, i1 false)
  %169 = getelementptr inbounds { i64, i32 }, ptr %40, i32 0, i32 0
  %170 = load i64, ptr %169, align 4
  %171 = getelementptr inbounds { i64, i32 }, ptr %40, i32 0, i32 1
  %172 = load i32, ptr %171, align 4
  invoke void @_ZN7Array3dIbE3setE9GridIndexb(ptr noundef nonnull align 8 dereferenceable(32) %168, i64 %170, i32 %172, i1 noundef zeroext false)
          to label %173 unwind label %179

173:                                              ; preds = %167
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %41, i64 12, i1 false)
  %174 = getelementptr inbounds { i64, i32 }, ptr %42, i32 0, i32 0
  %175 = load i64, ptr %174, align 4
  %176 = getelementptr inbounds { i64, i32 }, ptr %42, i32 0, i32 1
  %177 = load i32, ptr %176, align 4
  invoke void @_ZN7Array3dIbE3setE9GridIndexb(ptr noundef nonnull align 8 dereferenceable(32) %18, i64 %175, i32 %177, i1 noundef zeroext true)
          to label %178 unwind label %179

178:                                              ; preds = %173
  br label %187

179:                                              ; preds = %173, %167, %162, %127
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %20, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %21, align 4
  br label %191

183:                                              ; preds = %152, %140
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %20, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %191

187:                                              ; preds = %178, %160
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %29, align 4, !tbaa !9
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %29, align 4, !tbaa !9
  br label %99, !llvm.loop !28

191:                                              ; preds = %183, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %200

192:                                              ; preds = %102
  %193 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %43, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 4 %43, i64 12, i1 false)
  %194 = getelementptr inbounds { i64, i32 }, ptr %44, i32 0, i32 0
  %195 = load i64, ptr %194, align 4
  %196 = getelementptr inbounds { i64, i32 }, ptr %44, i32 0, i32 1
  %197 = load i32, ptr %196, align 4
  invoke void @_ZN15GridIndexVector9push_backE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %193, i64 %195, i32 %197)
          to label %198 unwind label %119

198:                                              ; preds = %192
  br label %85, !llvm.loop !30

199:                                              ; preds = %87
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr %22) #8
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #8
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  ret void

200:                                              ; preds = %191, %123, %119
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  br label %201

201:                                              ; preds = %200, %115
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  br label %202

202:                                              ; preds = %201, %111
  call void @llvm.lifetime.end.p0(i64 72, ptr %22) #8
  br label %203

203:                                              ; preds = %202, %107
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #8
  br label %204

204:                                              ; preds = %203, %103
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #8
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %205

205:                                              ; preds = %204
  %206 = load ptr, ptr %20, align 8
  %207 = load i32, ptr %21, align 4
  %208 = insertvalue { ptr, i32 } poison, ptr %206, 0
  %209 = insertvalue { ptr, i32 } %208, i32 %207, 1
  resume { ptr, i32 } %209
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIbEC2Eiiib(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) unnamed_addr #2 align 2

declare void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN15GridIndexVector9push_backEiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN15GridIndexVector5emptyEv(ptr noundef nonnull align 8 dereferenceable(40)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN15GridIndexVector4backEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64, i32, i32 noundef, i32 noundef, i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40), i64, i32) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32), i64, i32) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN15GridIndexVector9push_backE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40), i64, i32) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIbE3setE9GridIndexb(ptr noundef nonnull align 8 dereferenceable(32), i64, i32, i1 noundef zeroext) #2 align 2

; Function Attrs: nounwind
declare void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #7

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress 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 = { 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 = { 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 #7 = { 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 #8 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 112}
!12 = !{!"_ZTS14FluidBrickGrid", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !14, i64 24, !17, i64 64, !20, i64 112, !7, i64 152, !10, i64 272, !20, i64 280, !18, i64 320, !10, i64 324, !10, i64 328, !16, i64 332, !16, i64 336, !16, i64 340, !10, i64 344, !10, i64 348, !18, i64 352}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS4AABB", !15, i64 0, !13, i64 16, !13, i64 24, !13, i64 32}
!15 = !{!"_ZTSN5vmath4vec3E", !16, i64 0, !16, i64 4, !16, i64 8}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTS7Array3dIN14FluidBrickGrid11DensityNodeEE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !18, i64 24, !19, i64 28, !10, i64 40}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTSN14FluidBrickGrid11DensityNodeE", !16, i64 0, !16, i64 4, !16, i64 8}
!20 = !{!"_ZTS7Array3dI5BrickE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !18, i64 24, !21, i64 28, !10, i64 36}
!21 = !{!"_ZTS5Brick", !16, i64 0, !18, i64 4}
!22 = !{!12, !10, i64 116}
!23 = !{!12, !10, i64 120}
!24 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!25 = !{!21, !18, i64 4}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}


; 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.Array3d.29 = type { i32, i32, i32, ptr, i8, i8, i32 }
%class.GridIndexVector = type { i32, i32, i32, %"class.std::vector.17" }
%"class.std::vector.17" = type { %"struct.std::_Vector_base.18" }
%"struct.std::_Vector_base.18" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.GridIndex = type { i32, i32, i32 }

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14FluidBrickGrid19_getConnectedBricksEiiiR7Array3dI5BrickERS0_IbER15GridIndexVector(ptr nocapture noundef nonnull readonly align 8 dereferenceable(353) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(40) %6) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca %class.Array3d.29, align 8
  %9 = alloca %class.GridIndexVector, align 8
  %10 = alloca [6 x %struct.GridIndex], align 16
  %11 = alloca %struct.GridIndex, align 8
  %12 = alloca %struct.GridIndex, align 8
  %13 = getelementptr inbounds i8, ptr %0, i64 112
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 116
  %16 = load i32, ptr %15, align 4, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %0, i64 120
  %18 = load i32, ptr %17, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  call void @_ZN7Array3dIbEC2Eiiib(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %14, i32 noundef %16, i32 noundef %18, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #8
  invoke void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef %14, i32 noundef %16, i32 noundef %18)
          to label %19 unwind label %30

19:                                               ; preds = %7
  invoke void @_ZN15GridIndexVector9push_backEiii(ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef %1, i32 noundef %2, i32 noundef %3)
          to label %20 unwind label %32

20:                                               ; preds = %19
  invoke void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext false)
          to label %21 unwind label %32

21:                                               ; preds = %20
  invoke void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
          to label %22 unwind label %32

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %10) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %.ptr.1 = getelementptr inbounds i8, ptr %10, i64 12
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %10, i64 24
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %10, i64 36
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %10, i64 48
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %10, i64 60
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12)
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 8
  %.sroa.227.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  br label %23

23:                                               ; preds = %29, %22
  %24 = call noundef zeroext i1 @_ZN15GridIndexVector5emptyEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
  br i1 %24, label %54, label %25

25:                                               ; preds = %23
  %26 = invoke { i64, i32 } @_ZN15GridIndexVector4backEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %27 unwind label %36

27:                                               ; preds = %25
  %.fca.0.extract = extractvalue { i64, i32 } %26, 0
  %.fca.1.extract = extractvalue { i64, i32 } %26, 1
  store i64 %.fca.0.extract, ptr %11, align 8
  store i32 %.fca.1.extract, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !22
  invoke void @_ZN15GridIndexVector8pop_backEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %28 unwind label %34

28:                                               ; preds = %27
  %.sroa.032.0.copyload = load i64, ptr %11, align 8
  %.sroa.233.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !22
  invoke void @_ZN6Grid3d24getNeighbourGridIndices6E9GridIndexPS0_(i64 %.sroa.032.0.copyload, i32 %.sroa.233.0.copyload, ptr noundef nonnull %10)
          to label %.preheader unwind label %34

29:                                               ; preds = %.critedge
  %.sroa.01.0.copyload = load i64, ptr %11, align 8
  %.sroa.22.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !22
  invoke void @_ZN15GridIndexVector9push_backE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload)
          to label %23 unwind label %34, !llvm.loop !23

30:                                               ; preds = %7
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %57

32:                                               ; preds = %21, %20, %19
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %56

34:                                               ; preds = %29, %28, %27
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %55

36:                                               ; preds = %25
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %55

.preheader:                                       ; preds = %28, %.critedge
  %indvars.iv = phi i64 [ %indvars.iv.next, %.critedge ], [ 0, %28 ]
  %38 = getelementptr inbounds [6 x %struct.GridIndex], ptr %10, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %38, i64 12, i1 false), !tbaa.struct !25
  %.sroa.026.0.copyload = load i64, ptr %12, align 8
  %.sroa.227.0.copyload = load i32, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !22
  %39 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.026.0.copyload, i32 %.sroa.227.0.copyload, i32 noundef %14, i32 noundef %16, i32 noundef %18)
  br i1 %39, label %40, label %.critedge

40:                                               ; preds = %.preheader
  %.sroa.021.0.copyload = load i64, ptr %12, align 8
  %.sroa.222.0.copyload = load i32, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !22
  %41 = invoke i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 %.sroa.021.0.copyload, i32 %.sroa.222.0.copyload)
          to label %42 unwind label %52

42:                                               ; preds = %40
  %43 = and i64 %41, 4294967296
  %.not = icmp eq i64 %43, 0
  br i1 %.not, label %.critedge, label %44

44:                                               ; preds = %42
  %.sroa.017.0.copyload = load i64, ptr %12, align 8
  %.sroa.218.0.copyload = load i32, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !22
  %45 = invoke noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 %.sroa.017.0.copyload, i32 %.sroa.218.0.copyload)
          to label %46 unwind label %52

46:                                               ; preds = %44
  br i1 %45, label %.critedge, label %47

47:                                               ; preds = %46
  %.sroa.013.0.copyload = load i64, ptr %12, align 8
  %.sroa.214.0.copyload = load i32, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !22
  invoke void @_ZN15GridIndexVector9push_backE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 %.sroa.013.0.copyload, i32 %.sroa.214.0.copyload)
          to label %48 unwind label %50

48:                                               ; preds = %47
  %.sroa.09.0.copyload = load i64, ptr %12, align 8
  %.sroa.210.0.copyload = load i32, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !22
  invoke void @_ZN7Array3dIbE3setE9GridIndexb(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 %.sroa.09.0.copyload, i32 %.sroa.210.0.copyload, i1 noundef zeroext false)
          to label %49 unwind label %50

49:                                               ; preds = %48
  %.sroa.05.0.copyload = load i64, ptr %12, align 8
  %.sroa.26.0.copyload = load i32, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !22
  invoke void @_ZN7Array3dIbE3setE9GridIndexb(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 %.sroa.05.0.copyload, i32 %.sroa.26.0.copyload, i1 noundef zeroext true)
          to label %.critedge unwind label %50

50:                                               ; preds = %49, %48, %47
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %55

52:                                               ; preds = %44, %40
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %55

.critedge:                                        ; preds = %42, %.preheader, %46, %49
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 6
  br i1 %exitcond.not, label %29, label %.preheader, !llvm.loop !26

54:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %10) #8
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #8
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  ret void

55:                                               ; preds = %50, %52, %36, %34
  %.pn.pn = phi { ptr, i32 } [ %35, %34 ], [ %37, %36 ], [ %51, %50 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %10) #8
  br label %56

56:                                               ; preds = %55, %32
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %55 ], [ %33, %32 ]
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #8
  br label %57

57:                                               ; preds = %56, %30
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %56 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #8
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIbEC2Eiiib(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) unnamed_addr #2 align 2

declare void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN15GridIndexVector5emptyEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN15GridIndexVector4backEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64, i32, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40), i64, i32) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32), i64, i32) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIbE3setE9GridIndexb(ptr noundef nonnull align 8 dereferenceable(32), i64, i32, i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #7

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 112}
!6 = !{!"_ZTS14FluidBrickGrid", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !11, i64 24, !14, i64 64, !18, i64 112, !8, i64 152, !7, i64 272, !18, i64 280, !16, i64 320, !7, i64 324, !7, i64 328, !13, i64 332, !13, i64 336, !13, i64 340, !7, i64 344, !7, i64 348, !16, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"_ZTS4AABB", !12, i64 0, !10, i64 16, !10, i64 24, !10, i64 32}
!12 = !{!"_ZTSN5vmath4vec3E", !13, i64 0, !13, i64 4, !13, i64 8}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_ZTS7Array3dIN14FluidBrickGrid11DensityNodeEE", !7, i64 0, !7, i64 4, !7, i64 8, !15, i64 16, !16, i64 24, !17, i64 28, !7, i64 40}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"bool", !8, i64 0}
!17 = !{!"_ZTSN14FluidBrickGrid11DensityNodeE", !13, i64 0, !13, i64 4, !13, i64 8}
!18 = !{!"_ZTS7Array3dI5BrickE", !7, i64 0, !7, i64 4, !7, i64 8, !15, i64 16, !16, i64 24, !19, i64 28, !7, i64 36}
!19 = !{!"_ZTS5Brick", !13, i64 0, !16, i64 4}
!20 = !{!6, !7, i64 116}
!21 = !{!6, !7, i64 120}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{i64 0, i64 4, !22, i64 4, i64 4, !22, i64 8, i64 4, !22}
!26 = distinct !{!26, !24}


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