; 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 = 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.27 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, i32, [4 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.0 = type { i32, i32, i32, ptr, i8, [3 x i8], %struct.Brick, i32 }
%struct.Brick = type <{ float, i8, [3 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14FluidBrickGrid35_initializeDensityGridFromSaveStateER23FluidBrickGridSaveState(ptr noundef nonnull align 8 dereferenceable(353) %0, ptr noundef nonnull align 8 dereferenceable(625) %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.Array3d, align 8
  %6 = alloca %class.Array3d, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %class.Array3d.27, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca 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
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #5
  %22 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !21
  %26 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 2
  %27 = load i32, ptr %26, align 8, !tbaa !22
  call void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEEC2Eiii(ptr noundef nonnull align 8 dereferenceable(44) %6, i32 noundef %23, i32 noundef %25, i32 noundef %27)
  %28 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 6
  invoke void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEEaSERKS2_(ptr dead_on_unwind writable sret(%class.Array3d) align 8 %5, ptr noundef nonnull align 8 dereferenceable(44) %28, ptr noundef nonnull align 8 dereferenceable(44) %6)
          to label %29 unwind label %44

29:                                               ; preds = %2
  call void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(44) %5) #5
  call void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(44) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #5
  %30 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !21
  %34 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !22
  call void @_ZN7Array3dIfEC2Eiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %31, i32 noundef %33, i32 noundef %35)
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN23FluidBrickGridSaveState21getCurrentDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625) %36, ptr noundef nonnull align 8 dereferenceable(36) %9)
          to label %37 unwind label %48

37:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !23
  br label %38

38:                                               ; preds = %92, %37
  %39 = load i32, ptr %11, align 4, !tbaa !23
  %40 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 2
  %41 = load i32, ptr %40, align 8, !tbaa !22
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %52, label %43

43:                                               ; preds = %38
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %95

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

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

52:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !23
  br label %53

53:                                               ; preds = %88, %52
  %54 = load i32, ptr %13, align 4, !tbaa !23
  %55 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !21
  %57 = icmp slt i32 %54, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %53
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %91

59:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !23
  br label %60

60:                                               ; preds = %80, %59
  %61 = load i32, ptr %14, align 4, !tbaa !23
  %62 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !9
  %64 = icmp slt i32 %61, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %60
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %87

66:                                               ; preds = %60
  %67 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 6
  %68 = load i32, ptr %14, align 4, !tbaa !23
  %69 = load i32, ptr %13, align 4, !tbaa !23
  %70 = load i32, ptr %11, align 4, !tbaa !23
  %71 = invoke noundef ptr @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(44) %67, i32 noundef %68, i32 noundef %69, i32 noundef %70)
          to label %72 unwind label %83

72:                                               ; preds = %66
  store ptr %71, ptr %10, align 8, !tbaa !5
  %73 = load i32, ptr %14, align 4, !tbaa !23
  %74 = load i32, ptr %13, align 4, !tbaa !23
  %75 = load i32, ptr %11, align 4, !tbaa !23
  %76 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %73, i32 noundef %74, i32 noundef %75)
          to label %77 unwind label %83

77:                                               ; preds = %72
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.FluidBrickGrid::DensityNode", ptr %78, i32 0, i32 0
  store float %76, ptr %79, align 4, !tbaa !24
  br label %80

80:                                               ; preds = %77
  %81 = load i32, ptr %14, align 4, !tbaa !23
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %14, align 4, !tbaa !23
  br label %60, !llvm.loop !25

83:                                               ; preds = %72, %66
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %7, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %204

87:                                               ; preds = %65
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %13, align 4, !tbaa !23
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %13, align 4, !tbaa !23
  br label %53, !llvm.loop !27

91:                                               ; preds = %58
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %11, align 4, !tbaa !23
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %11, align 4, !tbaa !23
  br label %38, !llvm.loop !28

95:                                               ; preds = %43
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN23FluidBrickGridSaveState20getTargetDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625) %96, ptr noundef nonnull align 8 dereferenceable(36) %9)
          to label %97 unwind label %104

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !23
  br label %98

98:                                               ; preds = %148, %97
  %99 = load i32, ptr %15, align 4, !tbaa !23
  %100 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 2
  %101 = load i32, ptr %100, align 8, !tbaa !22
  %102 = icmp slt i32 %99, %101
  br i1 %102, label %108, label %103

103:                                              ; preds = %98
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %151

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

108:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !23
  br label %109

109:                                              ; preds = %144, %108
  %110 = load i32, ptr %16, align 4, !tbaa !23
  %111 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !21
  %113 = icmp slt i32 %110, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %109
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %147

115:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !23
  br label %116

116:                                              ; preds = %136, %115
  %117 = load i32, ptr %17, align 4, !tbaa !23
  %118 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !9
  %120 = icmp slt i32 %117, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %116
  store i32 17, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %143

122:                                              ; preds = %116
  %123 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 6
  %124 = load i32, ptr %17, align 4, !tbaa !23
  %125 = load i32, ptr %16, align 4, !tbaa !23
  %126 = load i32, ptr %15, align 4, !tbaa !23
  %127 = invoke noundef ptr @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(44) %123, i32 noundef %124, i32 noundef %125, i32 noundef %126)
          to label %128 unwind label %139

128:                                              ; preds = %122
  store ptr %127, ptr %10, align 8, !tbaa !5
  %129 = load i32, ptr %17, align 4, !tbaa !23
  %130 = load i32, ptr %16, align 4, !tbaa !23
  %131 = load i32, ptr %15, align 4, !tbaa !23
  %132 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %129, i32 noundef %130, i32 noundef %131)
          to label %133 unwind label %139

133:                                              ; preds = %128
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = getelementptr inbounds %"struct.FluidBrickGrid::DensityNode", ptr %134, i32 0, i32 1
  store float %132, ptr %135, align 4, !tbaa !29
  br label %136

136:                                              ; preds = %133
  %137 = load i32, ptr %17, align 4, !tbaa !23
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %17, align 4, !tbaa !23
  br label %116, !llvm.loop !30

139:                                              ; preds = %128, %122
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %7, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %204

143:                                              ; preds = %121
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %16, align 4, !tbaa !23
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %16, align 4, !tbaa !23
  br label %109, !llvm.loop !31

147:                                              ; preds = %114
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %15, align 4, !tbaa !23
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %15, align 4, !tbaa !23
  br label %98, !llvm.loop !32

151:                                              ; preds = %103
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN23FluidBrickGridSaveState22getVelocityDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625) %152, ptr noundef nonnull align 8 dereferenceable(36) %9)
          to label %153 unwind label %104

153:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !23
  br label %154

154:                                              ; preds = %200, %153
  %155 = load i32, ptr %18, align 4, !tbaa !23
  %156 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 2
  %157 = load i32, ptr %156, align 8, !tbaa !22
  %158 = icmp slt i32 %155, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %154
  store i32 20, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %203

160:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !23
  br label %161

161:                                              ; preds = %196, %160
  %162 = load i32, ptr %19, align 4, !tbaa !23
  %163 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !21
  %165 = icmp slt i32 %162, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %161
  store i32 23, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %199

167:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !23
  br label %168

168:                                              ; preds = %188, %167
  %169 = load i32, ptr %20, align 4, !tbaa !23
  %170 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 0
  %171 = load i32, ptr %170, align 8, !tbaa !9
  %172 = icmp slt i32 %169, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %168
  store i32 26, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %195

174:                                              ; preds = %168
  %175 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 6
  %176 = load i32, ptr %20, align 4, !tbaa !23
  %177 = load i32, ptr %19, align 4, !tbaa !23
  %178 = load i32, ptr %18, align 4, !tbaa !23
  %179 = invoke noundef ptr @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(44) %175, i32 noundef %176, i32 noundef %177, i32 noundef %178)
          to label %180 unwind label %191

180:                                              ; preds = %174
  store ptr %179, ptr %10, align 8, !tbaa !5
  %181 = load i32, ptr %20, align 4, !tbaa !23
  %182 = load i32, ptr %19, align 4, !tbaa !23
  %183 = load i32, ptr %18, align 4, !tbaa !23
  %184 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %181, i32 noundef %182, i32 noundef %183)
          to label %185 unwind label %191

185:                                              ; preds = %180
  %186 = load ptr, ptr %10, align 8, !tbaa !5
  %187 = getelementptr inbounds %"struct.FluidBrickGrid::DensityNode", ptr %186, i32 0, i32 1
  store float %184, ptr %187, align 4, !tbaa !29
  br label %188

188:                                              ; preds = %185
  %189 = load i32, ptr %20, align 4, !tbaa !23
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %20, align 4, !tbaa !23
  br label %168, !llvm.loop !33

191:                                              ; preds = %180, %174
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %7, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %204

195:                                              ; preds = %173
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %19, align 4, !tbaa !23
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %19, align 4, !tbaa !23
  br label %161, !llvm.loop !34

199:                                              ; preds = %166
  br label %200

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

203:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #5
  ret void

204:                                              ; preds = %191, %139, %104, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %205

205:                                              ; preds = %204, %48
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #5
  br label %206

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEEaSERKS2_(ptr dead_on_unwind noalias writable sret(%class.Array3d) align 8, ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 8 dereferenceable(44)) #3 align 2

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

declare void @_ZN23FluidBrickGridSaveState21getCurrentDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36)) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef, i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef) #1 align 2

declare void @_ZN23FluidBrickGridSaveState20getTargetDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36)) #4

declare void @_ZN23FluidBrickGridSaveState22getVelocityDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36)) #4

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

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

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

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


; 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 = 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.27 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14FluidBrickGrid35_initializeDensityGridFromSaveStateER23FluidBrickGridSaveState(ptr noundef nonnull align 8 dereferenceable(353) %0, ptr noundef nonnull align 8 dereferenceable(625) %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.Array3d, align 8
  %4 = alloca %class.Array3d, align 8
  %5 = alloca %class.Array3d.27, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  %6 = load i32, ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !20
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !21
  call void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEEC2Eiii(ptr noundef nonnull align 8 dereferenceable(44) %4, i32 noundef %6, i32 noundef %8, i32 noundef %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 64
  invoke void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEEaSERKS2_(ptr dead_on_unwind nonnull writable sret(%class.Array3d) align 8 %3, ptr noundef nonnull align 8 dereferenceable(44) %11, ptr noundef nonnull align 8 dereferenceable(44) %4)
          to label %12 unwind label %30

12:                                               ; preds = %2
  call void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(44) %3) #5
  call void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(44) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #5
  %13 = load i32, ptr %0, align 8, !tbaa !5
  %14 = load i32, ptr %7, align 4, !tbaa !20
  %15 = load i32, ptr %9, align 8, !tbaa !21
  call void @_ZN7Array3dIfEC2Eiii(ptr noundef nonnull align 8 dereferenceable(36) %5, i32 noundef %13, i32 noundef %14, i32 noundef %15)
  invoke void @_ZN23FluidBrickGridSaveState21getCurrentDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625) %1, ptr noundef nonnull align 8 dereferenceable(36) %5)
          to label %.preheader66 unwind label %32

.preheader66:                                     ; preds = %12
  %16 = load i32, ptr %9, align 8, !tbaa !21
  %17 = icmp sgt i32 %16, 0
  %18 = load i32, ptr %7, align 4
  %19 = icmp sgt i32 %18, 0
  %or.cond = select i1 %17, i1 %19, i1 false
  br i1 %or.cond, label %.preheader65, label %._crit_edge72

.preheader65:                                     ; preds = %.preheader66, %._crit_edge69
  %20 = phi i32 [ %37, %._crit_edge69 ], [ %16, %.preheader66 ]
  %21 = phi i32 [ %38, %._crit_edge69 ], [ %18, %.preheader66 ]
  %22 = phi i32 [ %39, %._crit_edge69 ], [ %18, %.preheader66 ]
  %.05170 = phi i32 [ %40, %._crit_edge69 ], [ 0, %.preheader66 ]
  %23 = icmp sgt i32 %22, 0
  %24 = load i32, ptr %0, align 8
  %25 = icmp sgt i32 %24, 0
  %or.cond107 = select i1 %23, i1 %25, i1 false
  br i1 %or.cond107, label %.preheader64, label %._crit_edge69

._crit_edge72:                                    ; preds = %._crit_edge69, %.preheader66
  invoke void @_ZN23FluidBrickGridSaveState20getTargetDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625) %1, ptr noundef nonnull align 8 dereferenceable(36) %5)
          to label %.preheader63 unwind label %65

.preheader63:                                     ; preds = %._crit_edge72
  %26 = load i32, ptr %9, align 8, !tbaa !21
  %27 = icmp sgt i32 %26, 0
  %28 = load i32, ptr %7, align 4
  %29 = icmp sgt i32 %28, 0
  %or.cond109 = select i1 %27, i1 %29, i1 false
  br i1 %or.cond109, label %.preheader62, label %._crit_edge80

30:                                               ; preds = %2
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEED2Ev(ptr noundef nonnull align 8 dereferenceable(44) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  br label %118

32:                                               ; preds = %12
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %117

.preheader64:                                     ; preds = %.preheader65, %._crit_edge
  %34 = phi i32 [ %42, %._crit_edge ], [ %21, %.preheader65 ]
  %35 = phi i32 [ %43, %._crit_edge ], [ %24, %.preheader65 ]
  %.05068 = phi i32 [ %44, %._crit_edge ], [ 0, %.preheader65 ]
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph, label %._crit_edge

._crit_edge69.loopexit:                           ; preds = %._crit_edge
  %.pre95 = load i32, ptr %9, align 8, !tbaa !21
  br label %._crit_edge69

._crit_edge69:                                    ; preds = %._crit_edge69.loopexit, %.preheader65
  %37 = phi i32 [ %.pre95, %._crit_edge69.loopexit ], [ %20, %.preheader65 ]
  %38 = phi i32 [ %42, %._crit_edge69.loopexit ], [ %21, %.preheader65 ]
  %39 = phi i32 [ %42, %._crit_edge69.loopexit ], [ %22, %.preheader65 ]
  %40 = add nuw nsw i32 %.05170, 1
  %41 = icmp slt i32 %40, %37
  br i1 %41, label %.preheader65, label %._crit_edge72, !llvm.loop !22

._crit_edge.loopexit:                             ; preds = %49
  %.pre = load i32, ptr %7, align 4, !tbaa !20
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader64
  %42 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %34, %.preheader64 ]
  %43 = phi i32 [ %51, %._crit_edge.loopexit ], [ %35, %.preheader64 ]
  %44 = add nuw nsw i32 %.05068, 1
  %45 = icmp slt i32 %44, %42
  br i1 %45, label %.preheader64, label %._crit_edge69.loopexit, !llvm.loop !25

.lr.ph:                                           ; preds = %.preheader64, %49
  %.04967 = phi i32 [ %50, %49 ], [ 0, %.preheader64 ]
  %46 = invoke noundef ptr @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(44) %11, i32 noundef %.04967, i32 noundef %.05068, i32 noundef %.05170)
          to label %47 unwind label %53

47:                                               ; preds = %.lr.ph
  %48 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %5, i32 noundef %.04967, i32 noundef %.05068, i32 noundef %.05170)
          to label %49 unwind label %53

49:                                               ; preds = %47
  store float %48, ptr %46, align 4, !tbaa !26
  %50 = add nuw nsw i32 %.04967, 1
  %51 = load i32, ptr %0, align 8, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !27

53:                                               ; preds = %47, %.lr.ph
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %117

.preheader62:                                     ; preds = %.preheader63, %._crit_edge77
  %55 = phi i32 [ %70, %._crit_edge77 ], [ %26, %.preheader63 ]
  %56 = phi i32 [ %71, %._crit_edge77 ], [ %28, %.preheader63 ]
  %57 = phi i32 [ %72, %._crit_edge77 ], [ %28, %.preheader63 ]
  %.04878 = phi i32 [ %73, %._crit_edge77 ], [ 0, %.preheader63 ]
  %58 = icmp sgt i32 %57, 0
  %59 = load i32, ptr %0, align 8
  %60 = icmp sgt i32 %59, 0
  %or.cond111 = select i1 %58, i1 %60, i1 false
  br i1 %or.cond111, label %.preheader61, label %._crit_edge77

._crit_edge80:                                    ; preds = %._crit_edge77, %.preheader63
  invoke void @_ZN23FluidBrickGridSaveState22getVelocityDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625) %1, ptr noundef nonnull align 8 dereferenceable(36) %5)
          to label %.preheader60 unwind label %65

.preheader60:                                     ; preds = %._crit_edge80
  %61 = load i32, ptr %9, align 8, !tbaa !21
  %62 = icmp sgt i32 %61, 0
  %63 = load i32, ptr %7, align 4
  %64 = icmp sgt i32 %63, 0
  %or.cond113 = select i1 %62, i1 %64, i1 false
  br i1 %or.cond113, label %.preheader59, label %._crit_edge88

65:                                               ; preds = %._crit_edge80, %._crit_edge72
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %117

.preheader61:                                     ; preds = %.preheader62, %._crit_edge75
  %67 = phi i32 [ %75, %._crit_edge75 ], [ %56, %.preheader62 ]
  %68 = phi i32 [ %76, %._crit_edge75 ], [ %59, %.preheader62 ]
  %.04776 = phi i32 [ %77, %._crit_edge75 ], [ 0, %.preheader62 ]
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph74, label %._crit_edge75

._crit_edge77.loopexit:                           ; preds = %._crit_edge75
  %.pre97 = load i32, ptr %9, align 8, !tbaa !21
  br label %._crit_edge77

._crit_edge77:                                    ; preds = %._crit_edge77.loopexit, %.preheader62
  %70 = phi i32 [ %.pre97, %._crit_edge77.loopexit ], [ %55, %.preheader62 ]
  %71 = phi i32 [ %75, %._crit_edge77.loopexit ], [ %56, %.preheader62 ]
  %72 = phi i32 [ %75, %._crit_edge77.loopexit ], [ %57, %.preheader62 ]
  %73 = add nuw nsw i32 %.04878, 1
  %74 = icmp slt i32 %73, %70
  br i1 %74, label %.preheader62, label %._crit_edge80, !llvm.loop !28

._crit_edge75.loopexit:                           ; preds = %82
  %.pre96 = load i32, ptr %7, align 4, !tbaa !20
  br label %._crit_edge75

._crit_edge75:                                    ; preds = %._crit_edge75.loopexit, %.preheader61
  %75 = phi i32 [ %.pre96, %._crit_edge75.loopexit ], [ %67, %.preheader61 ]
  %76 = phi i32 [ %85, %._crit_edge75.loopexit ], [ %68, %.preheader61 ]
  %77 = add nuw nsw i32 %.04776, 1
  %78 = icmp slt i32 %77, %75
  br i1 %78, label %.preheader61, label %._crit_edge77.loopexit, !llvm.loop !29

.lr.ph74:                                         ; preds = %.preheader61, %82
  %.04673 = phi i32 [ %84, %82 ], [ 0, %.preheader61 ]
  %79 = invoke noundef ptr @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(44) %11, i32 noundef %.04673, i32 noundef %.04776, i32 noundef %.04878)
          to label %80 unwind label %87

80:                                               ; preds = %.lr.ph74
  %81 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %5, i32 noundef %.04673, i32 noundef %.04776, i32 noundef %.04878)
          to label %82 unwind label %87

82:                                               ; preds = %80
  %83 = getelementptr inbounds i8, ptr %79, i64 4
  store float %81, ptr %83, align 4, !tbaa !30
  %84 = add nuw nsw i32 %.04673, 1
  %85 = load i32, ptr %0, align 8, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %.lr.ph74, label %._crit_edge75.loopexit, !llvm.loop !31

87:                                               ; preds = %80, %.lr.ph74
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %117

.preheader59:                                     ; preds = %.preheader60, %._crit_edge85
  %89 = phi i32 [ %98, %._crit_edge85 ], [ %61, %.preheader60 ]
  %90 = phi i32 [ %99, %._crit_edge85 ], [ %63, %.preheader60 ]
  %91 = phi i32 [ %100, %._crit_edge85 ], [ %63, %.preheader60 ]
  %.04586 = phi i32 [ %101, %._crit_edge85 ], [ 0, %.preheader60 ]
  %92 = icmp sgt i32 %91, 0
  %93 = load i32, ptr %0, align 8
  %94 = icmp sgt i32 %93, 0
  %or.cond115 = select i1 %92, i1 %94, i1 false
  br i1 %or.cond115, label %.preheader, label %._crit_edge85

._crit_edge88:                                    ; preds = %._crit_edge85, %.preheader60
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #5
  ret void

.preheader:                                       ; preds = %.preheader59, %._crit_edge83
  %95 = phi i32 [ %103, %._crit_edge83 ], [ %90, %.preheader59 ]
  %96 = phi i32 [ %104, %._crit_edge83 ], [ %93, %.preheader59 ]
  %.04484 = phi i32 [ %105, %._crit_edge83 ], [ 0, %.preheader59 ]
  %97 = icmp sgt i32 %96, 0
  br i1 %97, label %.lr.ph82, label %._crit_edge83

._crit_edge85.loopexit:                           ; preds = %._crit_edge83
  %.pre99 = load i32, ptr %9, align 8, !tbaa !21
  br label %._crit_edge85

._crit_edge85:                                    ; preds = %._crit_edge85.loopexit, %.preheader59
  %98 = phi i32 [ %.pre99, %._crit_edge85.loopexit ], [ %89, %.preheader59 ]
  %99 = phi i32 [ %103, %._crit_edge85.loopexit ], [ %90, %.preheader59 ]
  %100 = phi i32 [ %103, %._crit_edge85.loopexit ], [ %91, %.preheader59 ]
  %101 = add nuw nsw i32 %.04586, 1
  %102 = icmp slt i32 %101, %98
  br i1 %102, label %.preheader59, label %._crit_edge88, !llvm.loop !32

._crit_edge83.loopexit:                           ; preds = %110
  %.pre98 = load i32, ptr %7, align 4, !tbaa !20
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %._crit_edge83.loopexit, %.preheader
  %103 = phi i32 [ %.pre98, %._crit_edge83.loopexit ], [ %95, %.preheader ]
  %104 = phi i32 [ %113, %._crit_edge83.loopexit ], [ %96, %.preheader ]
  %105 = add nuw nsw i32 %.04484, 1
  %106 = icmp slt i32 %105, %103
  br i1 %106, label %.preheader, label %._crit_edge85.loopexit, !llvm.loop !33

.lr.ph82:                                         ; preds = %.preheader, %110
  %.081 = phi i32 [ %112, %110 ], [ 0, %.preheader ]
  %107 = invoke noundef ptr @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(44) %11, i32 noundef %.081, i32 noundef %.04484, i32 noundef %.04586)
          to label %108 unwind label %115

108:                                              ; preds = %.lr.ph82
  %109 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %5, i32 noundef %.081, i32 noundef %.04484, i32 noundef %.04586)
          to label %110 unwind label %115

110:                                              ; preds = %108
  %111 = getelementptr inbounds i8, ptr %107, i64 4
  store float %109, ptr %111, align 4, !tbaa !30
  %112 = add nuw nsw i32 %.081, 1
  %113 = load i32, ptr %0, align 8, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %.lr.ph82, label %._crit_edge83.loopexit, !llvm.loop !34

115:                                              ; preds = %108, %.lr.ph82
  %116 = landingpad { ptr, i32 }
          cleanup
  br label %117

117:                                              ; preds = %53, %65, %87, %115, %32
  %.pn.pn = phi { ptr, i32 } [ %33, %32 ], [ %54, %53 ], [ %88, %87 ], [ %116, %115 ], [ %66, %65 ]
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #5
  br label %118

118:                                              ; preds = %117, %30
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %117 ], [ %31, %30 ]
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEEaSERKS2_(ptr dead_on_unwind noalias writable sret(%class.Array3d) align 8, ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 8 dereferenceable(44)) local_unnamed_addr #3 align 2

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

declare void @_ZN23FluidBrickGridSaveState21getCurrentDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7Array3dIN14FluidBrickGrid11DensityNodeEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

declare void @_ZN23FluidBrickGridSaveState20getTargetDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #4

declare void @_ZN23FluidBrickGridSaveState22getVelocityDensityGridER7Array3dIfE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #4

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!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 4}
!21 = !{!6, !7, i64 8}
!22 = distinct !{!22, !23, !24}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!"llvm.loop.unswitch.partial.disable"}
!25 = distinct !{!25, !23, !24}
!26 = !{!17, !13, i64 0}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23, !24}
!29 = distinct !{!29, !23, !24}
!30 = !{!17, !13, i64 4}
!31 = distinct !{!31, !23}
!32 = distinct !{!32, !23, !24}
!33 = distinct !{!33, !23, !24}
!34 = distinct !{!34, !23}


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