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

; 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.vmath::vec3" = type { float, float, float }
%class.TriangleMesh = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.0", i32, i32, i32, double, %"class.std::vector.5", %"class.std::vector.10", %class.Array3d }
%"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.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = 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 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.15", i32, [4 x i8] }>
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = 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 }
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%struct.GridIndex = type { i32, i32, i32 }
%"class.std::vector.20" = type { %"struct.std::_Vector_base.21" }
%"struct.std::_Vector_base.21" = type { %"struct.std::_Vector_base<GridIndex, std::allocator<GridIndex>>::_Vector_impl" }
%"struct.std::_Vector_base<GridIndex, std::allocator<GridIndex>>::_Vector_impl" = type { %"struct.std::_Vector_base<GridIndex, std::allocator<GridIndex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GridIndex, std::allocator<GridIndex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.GridIndex_t = type { i32, i32, i32 }

@_ZN9CBindings7SUCCESSE = external global i32, align 4

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

declare void @_ZN12TriangleMeshC1Ev(ptr noundef nonnull align 8 dereferenceable(232)) unnamed_addr #1

declare void @_ZN5utils20structToTriangleMeshERNS_14TriangleMesh_tER12TriangleMesh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(232)) #1

declare i32 @__gxx_personality_v0(...)

declare void @_ZN4AABBC1ERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef, double noundef) #2

; 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) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d19GridIndexToPositionE9GridIndexd(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, i64, i32, double noundef) #2

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathmIERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d18getGridIndexBoundsE4AABBdiiiP9GridIndexS2_(ptr noundef, double noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

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

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

; Function Attrs: nounwind
declare void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @utils_get_triangle_mesh_cells(ptr noundef %0, double noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) #6 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %class.TriangleMesh, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %class.AABB, align 8
  %17 = alloca %struct.GridIndex, align 4
  %18 = alloca %"class.vmath::vec3", align 4
  %19 = alloca { i64, i32 }, align 8
  %20 = alloca %"class.vmath::vec3", align 4
  %21 = alloca %struct.GridIndex, align 4
  %22 = alloca { i64, i32 }, align 4
  %23 = alloca %"class.vmath::vec3", align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.GridIndex, align 4
  %26 = alloca %struct.GridIndex, align 4
  %27 = alloca %class.AABB, align 8
  %28 = alloca %"class.std::vector.20", align 8
  %29 = alloca %struct.GridIndex, align 4
  %30 = alloca i32, align 4
  %31 = alloca %struct.GridIndex_t, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 232, ptr %13) #7
  call void @_ZN12TriangleMeshC1Ev(ptr noundef nonnull align 8 dereferenceable(232) %13)
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZN5utils20structToTriangleMeshERNS_14TriangleMesh_tER12TriangleMesh(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 8 dereferenceable(232) %13)
          to label %33 unwind label %80

33:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #7
  %34 = getelementptr inbounds %class.TriangleMesh, ptr %13, i32 0, i32 0
  invoke void @_ZN4AABBC1ERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(40) %16, ptr noundef nonnull align 8 dereferenceable(24) %34)
          to label %35 unwind label %84

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  %36 = getelementptr inbounds %class.AABB, ptr %16, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 8 %36, i64 12, i1 false), !tbaa.struct !13
  %37 = load double, ptr %8, align 8, !tbaa !9
  %38 = invoke { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef %18, double noundef %37)
          to label %39 unwind label %88

39:                                               ; preds = %35
  store { i64, i32 } %38, ptr %19, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 8 %19, i64 12, i1 false)
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !16
  %40 = load double, ptr %8, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %21, i64 12, i1 false)
  %41 = getelementptr inbounds { i64, i32 }, ptr %22, i32 0, i32 0
  %42 = load i64, ptr %41, align 4
  %43 = getelementptr inbounds { i64, i32 }, ptr %22, i32 0, i32 1
  %44 = load i32, ptr %43, align 4
  invoke void @_ZN6Grid3d19GridIndexToPositionE9GridIndexd(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %20, i64 %42, i32 %44, double noundef %40)
          to label %45 unwind label %92

45:                                               ; preds = %39
  invoke void @_ZN5vmathngERKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %23, ptr noundef nonnull align 4 dereferenceable(12) %20)
          to label %46 unwind label %96

46:                                               ; preds = %45
  invoke void @_ZN12TriangleMesh9translateEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232) %13, ptr noundef %23)
          to label %47 unwind label %100

47:                                               ; preds = %46
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #7
  %48 = getelementptr inbounds %class.AABB, ptr %16, i32 0, i32 0
  %49 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathmIERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %48, ptr noundef nonnull align 4 dereferenceable(12) %20)
          to label %50 unwind label %96

50:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %51 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #7
  store i32 %51, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #7
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %25)
          to label %52 unwind label %104

52:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #7
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %26)
          to label %53 unwind label %108

53:                                               ; preds = %52
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %16, i64 40, i1 false), !tbaa.struct !17
  %54 = load double, ptr %8, align 8, !tbaa !9
  %55 = load i32, ptr %24, align 4, !tbaa !11
  %56 = load i32, ptr %24, align 4, !tbaa !11
  %57 = load i32, ptr %24, align 4, !tbaa !11
  invoke void @_ZN6Grid3d18getGridIndexBoundsE4AABBdiiiP9GridIndexS2_(ptr noundef %27, double noundef %54, i32 noundef %55, i32 noundef %56, i32 noundef %57, ptr noundef %25, ptr noundef %26)
          to label %58 unwind label %112

58:                                               ; preds = %53
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #7
  call void @_ZNSt6vectorI9GridIndexSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  %59 = load i32, ptr %10, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  invoke void @_ZNSt6vectorI9GridIndexSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %60)
          to label %61 unwind label %116

61:                                               ; preds = %58
  %62 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 0
  %63 = load i32, ptr %62, align 4, !tbaa !18
  %64 = add nsw i32 %63, 1
  %65 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !20
  %67 = add nsw i32 %66, 1
  %68 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 2
  %69 = load i32, ptr %68, align 4, !tbaa !21
  %70 = add nsw i32 %69, 1
  %71 = load double, ptr %8, align 8, !tbaa !9
  invoke void @_ZN5utils26getCellsInsideTriangleMeshER12TriangleMeshiiidRSt6vectorI9GridIndexSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(232) %13, i32 noundef %64, i32 noundef %67, i32 noundef %70, double noundef %71, ptr noundef nonnull align 8 dereferenceable(24) %28)
          to label %72 unwind label %116

72:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #7
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %29)
          to label %73 unwind label %120

73:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 0, ptr %30, align 4, !tbaa !11
  br label %74

74:                                               ; preds = %150, %73
  %75 = load i32, ptr %30, align 4, !tbaa !11
  %76 = zext i32 %75 to i64
  %77 = call noundef i64 @_ZNKSt6vectorI9GridIndexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  %78 = icmp ult i64 %76, %77
  br i1 %78, label %124, label %79

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

80:                                               ; preds = %6
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %14, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %15, align 4
  br label %166

84:                                               ; preds = %33
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %14, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %15, align 4
  br label %165

88:                                               ; preds = %35
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %14, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %15, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #7
  br label %164

92:                                               ; preds = %39
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %14, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %15, align 4
  br label %163

96:                                               ; preds = %47, %45
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %14, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %15, align 4
  br label %162

100:                                              ; preds = %46
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %14, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %15, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #7
  br label %162

104:                                              ; preds = %50
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %14, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %15, align 4
  br label %161

108:                                              ; preds = %52
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %14, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %15, align 4
  br label %160

112:                                              ; preds = %53
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %14, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %15, align 4
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #7
  br label %160

116:                                              ; preds = %61, %58
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %14, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %15, align 4
  br label %159

120:                                              ; preds = %72
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %14, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #7
  br label %159

124:                                              ; preds = %74
  %125 = load i32, ptr %30, align 4, !tbaa !11
  %126 = zext i32 %125 to i64
  %127 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI9GridIndexSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %126) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %127, i64 12, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 12, ptr %31) #7
  %128 = getelementptr inbounds %struct.GridIndex_t, ptr %31, i32 0, i32 0
  %129 = getelementptr inbounds %struct.GridIndex, ptr %29, i32 0, i32 0
  %130 = load i32, ptr %129, align 4, !tbaa !18
  %131 = getelementptr inbounds %struct.GridIndex, ptr %17, i32 0, i32 0
  %132 = load i32, ptr %131, align 4, !tbaa !18
  %133 = add nsw i32 %130, %132
  store i32 %133, ptr %128, align 4, !tbaa !22
  %134 = getelementptr inbounds %struct.GridIndex_t, ptr %31, i32 0, i32 1
  %135 = getelementptr inbounds %struct.GridIndex, ptr %29, i32 0, i32 1
  %136 = load i32, ptr %135, align 4, !tbaa !20
  %137 = getelementptr inbounds %struct.GridIndex, ptr %17, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !20
  %139 = add nsw i32 %136, %138
  store i32 %139, ptr %134, align 4, !tbaa !24
  %140 = getelementptr inbounds %struct.GridIndex_t, ptr %31, i32 0, i32 2
  %141 = getelementptr inbounds %struct.GridIndex, ptr %29, i32 0, i32 2
  %142 = load i32, ptr %141, align 4, !tbaa !21
  %143 = getelementptr inbounds %struct.GridIndex, ptr %17, i32 0, i32 2
  %144 = load i32, ptr %143, align 4, !tbaa !21
  %145 = add nsw i32 %142, %144
  store i32 %145, ptr %140, align 4, !tbaa !25
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = load i32, ptr %30, align 4, !tbaa !11
  %148 = zext i32 %147 to i64
  %149 = getelementptr inbounds %struct.GridIndex_t, ptr %146, i64 %148
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %149, ptr align 4 %31, i64 12, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #7
  br label %150

150:                                              ; preds = %124
  %151 = load i32, ptr %30, align 4, !tbaa !11
  %152 = add i32 %151, 1
  store i32 %152, ptr %30, align 4, !tbaa !11
  br label %74, !llvm.loop !26

153:                                              ; preds = %79
  %154 = call noundef i64 @_ZNKSt6vectorI9GridIndexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  %155 = trunc i64 %154 to i32
  %156 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %155, ptr %156, align 4, !tbaa !11
  %157 = load i32, ptr @_ZN9CBindings7SUCCESSE, align 4, !tbaa !11
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %157, ptr %158, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #7
  call void @_ZNSt6vectorI9GridIndexSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #7
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %13) #7
  call void @llvm.lifetime.end.p0(i64 232, ptr %13) #7
  ret void

159:                                              ; preds = %120, %116
  call void @_ZNSt6vectorI9GridIndexSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #7
  br label %160

160:                                              ; preds = %159, %112, %108
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #7
  br label %161

161:                                              ; preds = %160, %104
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %162

162:                                              ; preds = %161, %100, %96
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #7
  br label %163

163:                                              ; preds = %162, %92
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  br label %164

164:                                              ; preds = %163, %88
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #7
  br label %165

165:                                              ; preds = %164, %84
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #7
  br label %166

166:                                              ; preds = %165, %80
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %13) #7
  call void @llvm.lifetime.end.p0(i64 232, ptr %13) #7
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %14, align 8
  %169 = load i32, ptr %15, align 4
  %170 = insertvalue { ptr, i32 } poison, ptr %168, 0
  %171 = insertvalue { ptr, i32 } %170, i32 %169, 1
  resume { ptr, i32 } %171
}

declare void @_ZN12TriangleMesh9translateEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) #1

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

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

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

declare void @_ZN5utils26getCellsInsideTriangleMeshER12TriangleMeshiiidRSt6vectorI9GridIndexSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(232), i32 noundef, i32 noundef, i32 noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #1

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11}
!17 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14, i64 16, i64 8, !9, i64 24, i64 8, !9, i64 32, i64 8, !9}
!18 = !{!19, !12, i64 0}
!19 = !{!"_ZTS9GridIndex", !12, i64 0, !12, i64 4, !12, i64 8}
!20 = !{!19, !12, i64 4}
!21 = !{!19, !12, i64 8}
!22 = !{!23, !12, i64 0}
!23 = !{!"_ZTS11GridIndex_t", !12, i64 0, !12, i64 4, !12, i64 8}
!24 = !{!23, !12, i64 4}
!25 = !{!23, !12, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; 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.vmath::vec3" = type { float, float, float }
%class.TriangleMesh = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.0", i32, i32, i32, double, %"class.std::vector.5", %"class.std::vector.10", %class.Array3d }
%"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.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = 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 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.15", i32, [4 x i8] }>
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = 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 }
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%struct.GridIndex = type { i32, i32, i32 }
%"class.std::vector.20" = type { %"struct.std::_Vector_base.21" }
%"struct.std::_Vector_base.21" = type { %"struct.std::_Vector_base<GridIndex, std::allocator<GridIndex>>::_Vector_impl" }
%"struct.std::_Vector_base<GridIndex, std::allocator<GridIndex>>::_Vector_impl" = type { %"struct.std::_Vector_base<GridIndex, std::allocator<GridIndex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<GridIndex, std::allocator<GridIndex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.GridIndex_t = type { i32, i32, i32 }

@_ZN9CBindings7SUCCESSE = external local_unnamed_addr global i32, align 4

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

declare void @_ZN12TriangleMeshC1Ev(ptr noundef nonnull align 8 dereferenceable(232)) unnamed_addr #1

declare void @_ZN5utils20structToTriangleMeshERNS_14TriangleMesh_tER12TriangleMesh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare void @_ZN4AABBC1ERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef, double noundef) local_unnamed_addr #2

; 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) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d19GridIndexToPositionE9GridIndexd(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, i64, i32, double noundef) local_unnamed_addr #2

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathmIERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d18getGridIndexBoundsE4AABBdiiiP9GridIndexS2_(ptr noundef, double noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind
declare void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232)) unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @utils_get_triangle_mesh_cells(ptr noundef %0, double noundef %1, ptr nocapture noundef writeonly %2, i32 noundef %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %7 = alloca %class.TriangleMesh, align 8
  %8 = alloca %class.AABB, align 8
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca %struct.GridIndex, align 4
  %13 = alloca %struct.GridIndex, align 4
  %14 = alloca %class.AABB, align 8
  %15 = alloca %"class.std::vector.20", align 8
  %16 = alloca %struct.GridIndex, align 4
  call void @llvm.lifetime.start.p0(i64 232, ptr nonnull %7) #7
  call void @_ZN12TriangleMeshC1Ev(ptr noundef nonnull align 8 dereferenceable(232) %7)
  invoke void @_ZN5utils20structToTriangleMeshERNS_14TriangleMesh_tER12TriangleMesh(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(232) %7)
          to label %17 unwind label %45

17:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #7
  invoke void @_ZN4AABBC1ERSt6vectorIN5vmath4vec3ESaIS2_EE(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %18 unwind label %47

18:                                               ; preds = %17
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 8 dereferenceable(12) %8, i64 12, i1 false), !tbaa.struct !5
  %19 = invoke { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef nonnull %9, double noundef %1)
          to label %20 unwind label %49

20:                                               ; preds = %18
  %.fca.0.extract = extractvalue { i64, i32 } %19, 0
  %.fca.1.extract = extractvalue { i64, i32 } %19, 1
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #7
  invoke void @_ZN6Grid3d19GridIndexToPositionE9GridIndexd(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %10, i64 %.fca.0.extract, i32 %.fca.1.extract, double noundef %1)
          to label %21 unwind label %51

21:                                               ; preds = %20
  invoke void @_ZN5vmathngERKNS_4vec3E(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %22 unwind label %53

22:                                               ; preds = %21
  invoke void @_ZN12TriangleMesh9translateEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232) %7, ptr noundef nonnull %11)
          to label %23 unwind label %55

23:                                               ; preds = %22
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  %24 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathmIERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %25 unwind label %53

25:                                               ; preds = %23
  %26 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #7
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #7
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef nonnull align 8 dereferenceable(40) %8, i64 40, i1 false), !tbaa.struct !10
  invoke void @_ZN6Grid3d18getGridIndexBoundsE4AABBdiiiP9GridIndexS2_(ptr noundef nonnull %14, double noundef %1, i32 noundef %26, i32 noundef %26, i32 noundef %26, ptr noundef nonnull %12, ptr noundef nonnull %13)
          to label %27 unwind label %57

27:                                               ; preds = %25
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #7
  call void @_ZNSt6vectorI9GridIndexSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %28 = sext i32 %3 to i64
  invoke void @_ZNSt6vectorI9GridIndexSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %28)
          to label %29 unwind label %59

29:                                               ; preds = %27
  %30 = load i32, ptr %13, align 4, !tbaa !13
  %31 = add nsw i32 %30, 1
  %32 = getelementptr inbounds i8, ptr %13, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !16
  %34 = add nsw i32 %33, 1
  %35 = getelementptr inbounds i8, ptr %13, i64 8
  %36 = load i32, ptr %35, align 4, !tbaa !17
  %37 = add nsw i32 %36, 1
  invoke void @_ZN5utils26getCellsInsideTriangleMeshER12TriangleMeshiiidRSt6vectorI9GridIndexSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(232) %7, i32 noundef %31, i32 noundef %34, i32 noundef %37, double noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %38 unwind label %59

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #7
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %16)
  %39 = call noundef i64 @_ZNKSt6vectorI9GridIndexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %.not = icmp eq i64 %39, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %38
  %.sroa.012.0.extract.trunc = trunc i64 %.fca.0.extract to i32
  %40 = getelementptr inbounds i8, ptr %16, i64 4
  %.sroa.012.4.extract.shift = lshr i64 %.fca.0.extract, 32
  %.sroa.012.4.extract.trunc = trunc nuw i64 %.sroa.012.4.extract.shift to i32
  %41 = getelementptr inbounds i8, ptr %16, i64 8
  br label %61

._crit_edge:                                      ; preds = %61, %38
  %42 = call noundef i64 @_ZNKSt6vectorI9GridIndexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %43 = trunc i64 %42 to i32
  store i32 %43, ptr %4, align 4, !tbaa !18
  %44 = load i32, ptr @_ZN9CBindings7SUCCESSE, align 4, !tbaa !18
  store i32 %44, ptr %5, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #7
  call void @_ZNSt6vectorI9GridIndexSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #7
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %7) #7
  call void @llvm.lifetime.end.p0(i64 232, ptr nonnull %7) #7
  ret void

45:                                               ; preds = %6
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %80

47:                                               ; preds = %17
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %79

49:                                               ; preds = %18
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #7
  br label %78

51:                                               ; preds = %20
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %77

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

55:                                               ; preds = %22
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  br label %76

57:                                               ; preds = %25
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %14) #7
  br label %75

59:                                               ; preds = %29, %27
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorI9GridIndexSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #7
  br label %75

61:                                               ; preds = %.lr.ph, %61
  %62 = phi i64 [ 0, %.lr.ph ], [ %72, %61 ]
  %.03139 = phi i32 [ 0, %.lr.ph ], [ %71, %61 ]
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI9GridIndexSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %62) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %63, i64 12, i1 false), !tbaa.struct !19
  %64 = load i32, ptr %16, align 4, !tbaa !13
  %65 = add nsw i32 %64, %.sroa.012.0.extract.trunc
  %66 = load i32, ptr %40, align 4, !tbaa !16
  %67 = add nsw i32 %66, %.sroa.012.4.extract.trunc
  %68 = load i32, ptr %41, align 4, !tbaa !17
  %69 = add nsw i32 %68, %.fca.1.extract
  %70 = getelementptr inbounds %struct.GridIndex_t, ptr %2, i64 %62
  store i32 %65, ptr %70, align 4, !tbaa !18
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %70, i64 4
  store i32 %67, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !18
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %70, i64 8
  store i32 %69, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !18
  %71 = add i32 %.03139, 1
  %72 = zext i32 %71 to i64
  %73 = call noundef i64 @_ZNKSt6vectorI9GridIndexSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %74 = icmp ugt i64 %73, %72
  br i1 %74, label %61, label %._crit_edge, !llvm.loop !20

75:                                               ; preds = %59, %57
  %.pn = phi { ptr, i32 } [ %60, %59 ], [ %58, %57 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  br label %76

76:                                               ; preds = %75, %55, %53
  %.pn.pn = phi { ptr, i32 } [ %.pn, %75 ], [ %54, %53 ], [ %56, %55 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #7
  br label %77

77:                                               ; preds = %76, %51
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %76 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  br label %78

78:                                               ; preds = %77, %49
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %77 ], [ %50, %49 ]
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #7
  br label %79

79:                                               ; preds = %78, %47
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %78 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #7
  br label %80

80:                                               ; preds = %79, %45
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %79 ], [ %46, %45 ]
  call void @_ZN12TriangleMeshD1Ev(ptr noundef nonnull align 8 dereferenceable(232) %7) #7
  call void @llvm.lifetime.end.p0(i64 232, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn
}

declare void @_ZN12TriangleMesh9translateEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef) local_unnamed_addr #1

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

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

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

declare void @_ZN5utils26getCellsInsideTriangleMeshER12TriangleMeshiiidRSt6vectorI9GridIndexSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(232), i32 noundef, i32 noundef, i32 noundef, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync 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 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 16, i64 8, !11, i64 24, i64 8, !11, i64 32, i64 8, !11}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS9GridIndex", !15, i64 0, !15, i64 4, !15, i64 8}
!15 = !{!"int", !8, i64 0}
!16 = !{!14, !15, i64 4}
!17 = !{!14, !15, i64 8}
!18 = !{!15, !15, i64 0}
!19 = !{i64 0, i64 4, !18, i64 4, i64 4, !18, i64 8, i64 4, !18}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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