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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.vmath::vec3" = type { float, float, float }
%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.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 }
%class.TriangleMesh = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.1", i32, i32, i32, double, %"class.std::vector.6", %"class.std::vector.11", %class.Array3d.16 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Array3d.16 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.17", i32, [4 x i8] }>
%"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 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [111 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@__FUNCTION__._ZN14FluidBrickGrid12getBrickMeshER12TriangleMesh = external hidden unnamed_addr constant [13 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: noreturn nounwind
declare void @abort() #6

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN14FluidBrickGrid12getBrickMeshER12TriangleMesh(ptr noundef nonnull align 8 dereferenceable(353) %0, ptr noundef nonnull align 8 dereferenceable(232) %1) #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca ptr, align 8
  %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 %struct.Brick, align 4
  %18 = alloca %"class.vmath::vec3", align 4
  %19 = alloca %"class.vmath::vec3", align 4
  %20 = alloca double, align 8
  %21 = alloca %struct.Brick, align 4
  %22 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8
  %24 = call noundef zeroext i1 @_ZN14FluidBrickGrid13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(353) %23)
  br i1 %24, label %35, label %25

25:                                               ; preds = %2
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef @.str.1)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef @.str.2)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef @.str.3)
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef @.str.4)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef @__FUNCTION__._ZN14FluidBrickGrid12getBrickMeshER12TriangleMesh)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef @.str.5)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %32, i32 noundef 81)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @abort() #8
  unreachable

35:                                               ; preds = %2
  %36 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 12
  %37 = load i8, ptr %36, align 8, !tbaa !9, !range !21, !noundef !22
  %38 = trunc i8 %37 to i1
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i1 false, ptr %3, align 1
  br label %185

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %41 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 5
  %42 = getelementptr inbounds %class.AABB, ptr %41, i32 0, i32 1
  %43 = load double, ptr %42, align 8, !tbaa !23
  store double %43, ptr %6, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %44 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 5
  %45 = getelementptr inbounds %class.AABB, ptr %44, i32 0, i32 2
  %46 = load double, ptr %45, align 8, !tbaa !25
  store double %46, ptr %7, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %47 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 5
  %48 = getelementptr inbounds %class.AABB, ptr %47, i32 0, i32 3
  %49 = load double, ptr %48, align 8, !tbaa !26
  store double %49, ptr %8, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #9
  %50 = load double, ptr %6, align 8, !tbaa !24
  %51 = fmul double 5.000000e-01, %50
  %52 = fptrunc double %51 to float
  %53 = load double, ptr %7, align 8, !tbaa !24
  %54 = fmul double 5.000000e-01, %53
  %55 = fptrunc double %54 to float
  %56 = load double, ptr %8, align 8, !tbaa !24
  %57 = fmul double 5.000000e-01, %56
  %58 = fptrunc double %57 to float
  call void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef %52, float noundef %55, float noundef %58)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %59 unwind label %67

59:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !27
  br label %60

60:                                               ; preds = %180, %59
  %61 = load i32, ptr %13, align 4, !tbaa !27
  %62 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 11
  %63 = getelementptr inbounds %class.Array3d.0, ptr %62, i32 0, i32 2
  %64 = load i32, ptr %63, align 8, !tbaa !28
  %65 = icmp slt i32 %61, %64
  br i1 %65, label %71, label %66

66:                                               ; preds = %60
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %183

67:                                               ; preds = %40
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %11, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %12, align 4
  br label %184

71:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 0, ptr %15, align 4, !tbaa !27
  br label %72

72:                                               ; preds = %176, %71
  %73 = load i32, ptr %15, align 4, !tbaa !27
  %74 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 11
  %75 = getelementptr inbounds %class.Array3d.0, ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !29
  %77 = icmp slt i32 %73, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %72
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %179

79:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !27
  br label %80

80:                                               ; preds = %171, %79
  %81 = load i32, ptr %16, align 4, !tbaa !27
  %82 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 11
  %83 = getelementptr inbounds %class.Array3d.0, ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !30
  %85 = icmp slt i32 %81, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %80
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %175

87:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %88 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 11
  %89 = load i32, ptr %16, align 4, !tbaa !27
  %90 = load i32, ptr %15, align 4, !tbaa !27
  %91 = load i32, ptr %13, align 4, !tbaa !27
  %92 = invoke i64 @_ZN7Array3dI5BrickEclEiii(ptr noundef nonnull align 8 dereferenceable(40) %88, i32 noundef %89, i32 noundef %90, i32 noundef %91)
          to label %93 unwind label %139

93:                                               ; preds = %87
  %94 = trunc i64 %92 to i40
  store i40 %94, ptr %17, align 4
  %95 = getelementptr inbounds %struct.Brick, ptr %17, i32 0, i32 1
  %96 = load i8, ptr %95, align 4, !tbaa !31, !range !21, !noundef !22
  %97 = trunc i8 %96 to i1
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br i1 %97, label %98, label %170

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #9
  %99 = load i32, ptr %16, align 4, !tbaa !27
  %100 = sitofp i32 %99 to double
  %101 = load double, ptr %6, align 8, !tbaa !24
  %102 = fmul double %100, %101
  %103 = fptrunc double %102 to float
  %104 = load i32, ptr %15, align 4, !tbaa !27
  %105 = sitofp i32 %104 to double
  %106 = load double, ptr %7, align 8, !tbaa !24
  %107 = fmul double %105, %106
  %108 = fptrunc double %107 to float
  %109 = load i32, ptr %13, align 4, !tbaa !27
  %110 = sitofp i32 %109 to double
  %111 = load double, ptr %8, align 8, !tbaa !24
  %112 = fmul double %110, %111
  %113 = fptrunc double %112 to float
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %19, float noundef %103, float noundef %108, float noundef %113)
          to label %114 unwind label %143

114:                                              ; preds = %98
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %18, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %19)
          to label %115 unwind label %147

115:                                              ; preds = %114
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %18, i64 12, i1 false), !tbaa.struct !32
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %116 = getelementptr inbounds %class.FluidBrickGrid, ptr %23, i32 0, i32 11
  %117 = load i32, ptr %16, align 4, !tbaa !27
  %118 = load i32, ptr %15, align 4, !tbaa !27
  %119 = load i32, ptr %13, align 4, !tbaa !27
  %120 = invoke i64 @_ZN7Array3dI5BrickEclEiii(ptr noundef nonnull align 8 dereferenceable(40) %116, i32 noundef %117, i32 noundef %118, i32 noundef %119)
          to label %121 unwind label %152

121:                                              ; preds = %115
  %122 = trunc i64 %120 to i40
  store i40 %122, ptr %21, align 4
  %123 = getelementptr inbounds %struct.Brick, ptr %21, i32 0, i32 0
  %124 = load float, ptr %123, align 4, !tbaa !34
  %125 = fpext float %124 to double
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  store double %125, ptr %20, align 8, !tbaa !24
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %class.TriangleMesh, ptr %126, i32 0, i32 0
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %127, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %128 unwind label %156

128:                                              ; preds = %121
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %class.TriangleMesh, ptr %129, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #9
  %131 = load double, ptr %20, align 8, !tbaa !24
  %132 = fptrunc double %131 to float
  %133 = load double, ptr %20, align 8, !tbaa !24
  %134 = fptrunc double %133 to float
  %135 = load double, ptr %20, align 8, !tbaa !24
  %136 = fptrunc double %135 to float
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %22, float noundef %132, float noundef %134, float noundef %136)
          to label %137 unwind label %160

137:                                              ; preds = %128
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %130, ptr noundef nonnull align 4 dereferenceable(12) %22)
          to label %138 unwind label %164

138:                                              ; preds = %137
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  br label %170

139:                                              ; preds = %87
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %11, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %174

143:                                              ; preds = %98
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %11, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %12, align 4
  br label %151

147:                                              ; preds = %114
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %11, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %12, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #9
  br label %151

151:                                              ; preds = %147, %143
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #9
  br label %174

152:                                              ; preds = %115
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %11, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %169

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

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

164:                                              ; preds = %137
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %11, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %12, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #9
  br label %168

168:                                              ; preds = %164, %160
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #9
  br label %169

169:                                              ; preds = %168, %156, %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  br label %174

170:                                              ; preds = %138, %93
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %16, align 4, !tbaa !27
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %16, align 4, !tbaa !27
  br label %80, !llvm.loop !35

174:                                              ; preds = %169, %151, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  br label %184

175:                                              ; preds = %86
  br label %176

176:                                              ; preds = %175
  %177 = load i32, ptr %15, align 4, !tbaa !27
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %15, align 4, !tbaa !27
  br label %72, !llvm.loop !37

179:                                              ; preds = %78
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %13, align 4, !tbaa !27
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %13, align 4, !tbaa !27
  br label %60, !llvm.loop !38

183:                                              ; preds = %66
  store i1 true, ptr %3, align 1
  store i32 1, ptr %14, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %185

184:                                              ; preds = %174, %67
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %187

185:                                              ; preds = %183, %39
  %186 = load i1, ptr %3, align 1
  ret i1 %186

187:                                              ; preds = %184
  %188 = load ptr, ptr %11, align 8
  %189 = load i32, ptr %12, align 4
  %190 = insertvalue { ptr, i32 } poison, ptr %188, 0
  %191 = insertvalue { ptr, i32 } %190, i32 %189, 1
  resume { ptr, i32 } %191
}

declare void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1

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

declare void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #5 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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, !17, i64 320}
!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 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!10, !12, i64 40}
!24 = !{!12, !12, i64 0}
!25 = !{!10, !12, i64 48}
!26 = !{!10, !12, i64 56}
!27 = !{!11, !11, i64 0}
!28 = !{!10, !11, i64 288}
!29 = !{!10, !11, i64 284}
!30 = !{!10, !11, i64 280}
!31 = !{!20, !17, i64 4}
!32 = !{i64 0, i64 4, !33, i64 4, i64 4, !33, i64 8, i64 4, !33}
!33 = !{!15, !15, i64 0}
!34 = !{!20, !15, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = distinct !{!37, !36}
!38 = distinct !{!38, !36}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.vmath::vec3" = type { float, float, float }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [111 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@__FUNCTION__._ZN14FluidBrickGrid12getBrickMeshER12TriangleMesh = external hidden unnamed_addr constant [13 x i8], align 1

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #6

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN14FluidBrickGrid12getBrickMeshER12TriangleMesh(ptr noundef nonnull align 8 dereferenceable(353) %0, ptr noundef nonnull align 8 dereferenceable(232) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.vmath::vec3", align 4
  %4 = alloca %"class.vmath::vec3", align 4
  %5 = alloca %"class.vmath::vec3", align 4
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = tail call noundef zeroext i1 @_ZN14FluidBrickGrid13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(353) %0)
  br i1 %8, label %19, label %9

9:                                                ; preds = %2
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @.str.1)
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull @.str.2)
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @.str.3)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @.str.4)
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull @__FUNCTION__._ZN14FluidBrickGrid12getBrickMeshER12TriangleMesh)
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @.str.5)
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef 81)
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  tail call void @abort() #8
  unreachable

19:                                               ; preds = %2
  %20 = getelementptr inbounds i8, ptr %0, i64 320
  %21 = load i8, ptr %20, align 8, !tbaa !5, !range !20, !noundef !21
  %22 = trunc nuw i8 %21 to i1
  br i1 %22, label %23, label %108

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %0, i64 40
  %25 = load double, ptr %24, align 8, !tbaa !22
  %26 = getelementptr inbounds i8, ptr %0, i64 48
  %27 = load double, ptr %26, align 8, !tbaa !23
  %28 = getelementptr inbounds i8, ptr %0, i64 56
  %29 = load double, ptr %28, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #9
  %30 = fmul double %25, 5.000000e-01
  %31 = fptrunc double %30 to float
  %32 = fmul double %27, 5.000000e-01
  %33 = fptrunc double %32 to float
  %34 = fmul double %29, 5.000000e-01
  %35 = fptrunc double %34 to float
  call void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef %31, float noundef %33, float noundef %35)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %.preheader47 unwind label %53

.preheader47:                                     ; preds = %23
  %36 = getelementptr inbounds i8, ptr %0, i64 280
  %37 = getelementptr inbounds i8, ptr %0, i64 288
  %38 = load i32, ptr %37, align 8, !tbaa !25
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.preheader46.lr.ph, label %._crit_edge53

.preheader46.lr.ph:                               ; preds = %.preheader47
  %40 = getelementptr inbounds i8, ptr %0, i64 284
  %41 = getelementptr inbounds i8, ptr %1, i64 24
  %42 = load i32, ptr %40, align 4, !tbaa !26
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.preheader46, label %._crit_edge53

.preheader46:                                     ; preds = %.preheader46.lr.ph, %._crit_edge50
  %44 = phi i32 [ %61, %._crit_edge50 ], [ %38, %.preheader46.lr.ph ]
  %45 = phi i32 [ %62, %._crit_edge50 ], [ %42, %.preheader46.lr.ph ]
  %46 = phi i32 [ %63, %._crit_edge50 ], [ %42, %.preheader46.lr.ph ]
  %.03651 = phi i32 [ %64, %._crit_edge50 ], [ 0, %.preheader46.lr.ph ]
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.preheader.lr.ph, label %._crit_edge50

.preheader.lr.ph:                                 ; preds = %.preheader46
  %48 = uitofp nneg i32 %.03651 to double
  %49 = fmul double %29, %48
  %50 = fptrunc double %49 to float
  %51 = load i32, ptr %36, align 8, !tbaa !27
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.preheader, label %._crit_edge50

._crit_edge53:                                    ; preds = %._crit_edge50, %.preheader46.lr.ph, %.preheader47
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #9
  br label %108

53:                                               ; preds = %23
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %107

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %55 = phi i32 [ %66, %._crit_edge ], [ %45, %.preheader.lr.ph ]
  %56 = phi i32 [ %67, %._crit_edge ], [ %51, %.preheader.lr.ph ]
  %.03749 = phi i32 [ %68, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %58 = uitofp nneg i32 %.03749 to double
  %59 = fmul double %27, %58
  %60 = fptrunc double %59 to float
  br label %70

._crit_edge50.loopexit:                           ; preds = %._crit_edge
  %.pre56 = load i32, ptr %37, align 8, !tbaa !25
  br label %._crit_edge50

._crit_edge50:                                    ; preds = %.preheader.lr.ph, %._crit_edge50.loopexit, %.preheader46
  %61 = phi i32 [ %.pre56, %._crit_edge50.loopexit ], [ %44, %.preheader46 ], [ %44, %.preheader.lr.ph ]
  %62 = phi i32 [ %66, %._crit_edge50.loopexit ], [ %45, %.preheader46 ], [ %45, %.preheader.lr.ph ]
  %63 = phi i32 [ %66, %._crit_edge50.loopexit ], [ %46, %.preheader46 ], [ %46, %.preheader.lr.ph ]
  %64 = add nuw nsw i32 %.03651, 1
  %65 = icmp slt i32 %64, %61
  br i1 %65, label %.preheader46, label %._crit_edge53, !llvm.loop !28

._crit_edge.loopexit:                             ; preds = %102
  %.pre = load i32, ptr %40, align 4, !tbaa !26
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %66 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %55, %.preheader ]
  %67 = phi i32 [ %104, %._crit_edge.loopexit ], [ %56, %.preheader ]
  %68 = add nuw nsw i32 %.03749, 1
  %69 = icmp slt i32 %68, %66
  br i1 %69, label %.preheader, label %._crit_edge50.loopexit, !llvm.loop !31

70:                                               ; preds = %.lr.ph, %102
  %.03848 = phi i32 [ 0, %.lr.ph ], [ %103, %102 ]
  %71 = invoke i64 @_ZN7Array3dI5BrickEclEiii(ptr noundef nonnull align 8 dereferenceable(40) %36, i32 noundef %.03848, i32 noundef %.03749, i32 noundef %.03651)
          to label %72 unwind label %86

72:                                               ; preds = %70
  %73 = and i64 %71, 4294967296
  %.not = icmp eq i64 %73, 0
  br i1 %.not, label %102, label %74

74:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #9
  %75 = uitofp nneg i32 %.03848 to double
  %76 = fmul double %25, %75
  %77 = fptrunc double %76 to float
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef %77, float noundef %60, float noundef %50)
          to label %78 unwind label %88

78:                                               ; preds = %74
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %79 unwind label %90

79:                                               ; preds = %78
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5, i64 12, i1 false), !tbaa.struct !32
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #9
  %80 = invoke i64 @_ZN7Array3dI5BrickEclEiii(ptr noundef nonnull align 8 dereferenceable(40) %36, i32 noundef %.03848, i32 noundef %.03749, i32 noundef %.03651)
          to label %81 unwind label %93

81:                                               ; preds = %79
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %82 unwind label %95

82:                                               ; preds = %81
  %.sroa.0.sroa.0.0.extract.trunc = trunc i64 %80 to i32
  %83 = bitcast i32 %.sroa.0.sroa.0.0.extract.trunc to float
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #9
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef %83, float noundef %83, float noundef %83)
          to label %84 unwind label %97

84:                                               ; preds = %82
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %85 unwind label %99

85:                                               ; preds = %84
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #9
  br label %102

86:                                               ; preds = %70
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %106

88:                                               ; preds = %74
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %92

90:                                               ; preds = %78
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #9
  br label %92

92:                                               ; preds = %90, %88
  %.pn = phi { ptr, i32 } [ %91, %90 ], [ %89, %88 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #9
  br label %106

93:                                               ; preds = %79
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %106

95:                                               ; preds = %81
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %106

97:                                               ; preds = %82
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %101

99:                                               ; preds = %84
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #9
  br label %101

101:                                              ; preds = %99, %97
  %.pn41 = phi { ptr, i32 } [ %100, %99 ], [ %98, %97 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #9
  br label %106

102:                                              ; preds = %72, %85
  %103 = add nuw nsw i32 %.03848, 1
  %104 = load i32, ptr %36, align 8, !tbaa !27
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %70, label %._crit_edge.loopexit, !llvm.loop !34

106:                                              ; preds = %93, %95, %101, %92, %86
  %.pn41.pn.pn = phi { ptr, i32 } [ %.pn, %92 ], [ %87, %86 ], [ %.pn41, %101 ], [ %96, %95 ], [ %94, %93 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #9
  br label %107

107:                                              ; preds = %106, %53
  %.pn41.pn.pn.pn = phi { ptr, i32 } [ %.pn41.pn.pn, %106 ], [ %54, %53 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn41.pn.pn.pn

108:                                              ; preds = %19, %._crit_edge53
  ret i1 %22
}

declare void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1

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

declare void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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, !16, i64 320}
!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 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!6, !10, i64 40}
!23 = !{!6, !10, i64 48}
!24 = !{!6, !10, i64 56}
!25 = !{!6, !7, i64 288}
!26 = !{!6, !7, i64 284}
!27 = !{!6, !7, i64 280}
!28 = distinct !{!28, !29, !30}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!"llvm.loop.unswitch.partial.disable"}
!31 = distinct !{!31, !29, !30}
!32 = !{i64 0, i64 4, !33, i64 4, i64 4, !33, i64 8, i64 4, !33}
!33 = !{!13, !13, i64 0}
!34 = distinct !{!34, !29}


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