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

; 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.Array3d.20 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.10", i32, [4 x i8] }>
%"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 }
%struct.GridIndex = type { i32, i32, i32 }

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

declare i32 @__gxx_personality_v0(...)

; 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 @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5utils18_getCollisionGridZER12TriangleMeshdR7Array3dISt6vectorIdSaIdEEE(ptr noundef nonnull align 8 dereferenceable(232), double noundef, ptr noundef nonnull align 8 dereferenceable(60)) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5utils26getCellsInsideTriangleMeshER12TriangleMeshiiidRSt6vectorI9GridIndexSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(232) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5) #2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %class.Array3d.20, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca %"class.vmath::vec3", align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.GridIndex, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !11
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %13) #5
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN7Array3dISt6vectorIdSaIdEEEC2Eiii(ptr noundef nonnull align 8 dereferenceable(60) %13, i32 noundef %26, i32 noundef %27, i32 noundef 1)
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = load double, ptr %11, align 8, !tbaa !11
  invoke void @_ZN5utils18_getCollisionGridZER12TriangleMeshdR7Array3dISt6vectorIdSaIdEEE(ptr noundef nonnull align 8 dereferenceable(232) %28, double noundef %29, ptr noundef nonnull align 8 dereferenceable(60) %13)
          to label %30 unwind label %36

30:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %133, %30
  %32 = load i32, ptr %17, align 4, !tbaa !9
  %33 = load i32, ptr %10, align 4, !tbaa !9
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %40, label %35

35:                                               ; preds = %31
  store i32 2, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %136

36:                                               ; preds = %6
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %14, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %15, align 4
  br label %137

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %129, %40
  %42 = load i32, ptr %19, align 4, !tbaa !9
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %132

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %122, %46
  %48 = load i32, ptr %20, align 4, !tbaa !9
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 8, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %128

52:                                               ; preds = %47
  %53 = load i32, ptr %20, align 4, !tbaa !9
  %54 = load i32, ptr %19, align 4, !tbaa !9
  %55 = invoke noundef ptr @_ZN7Array3dISt6vectorIdSaIdEEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(60) %13, i32 noundef %53, i32 noundef %54, i32 noundef 0)
          to label %56 unwind label %62

56:                                               ; preds = %52
  store ptr %55, ptr %16, align 8, !tbaa !5
  %57 = load ptr, ptr %16, align 8, !tbaa !5
  %58 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #5
  %59 = urem i64 %58, 2
  %60 = icmp ne i64 %59, 0
  br i1 %60, label %61, label %66

61:                                               ; preds = %56
  br label %122

62:                                               ; preds = %52
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %14, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %15, align 4
  br label %127

66:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #5
  %67 = load i32, ptr %20, align 4, !tbaa !9
  %68 = load i32, ptr %19, align 4, !tbaa !9
  %69 = load i32, ptr %17, align 4, !tbaa !9
  %70 = load double, ptr %11, align 8, !tbaa !11
  invoke void @_ZN6Grid3d21GridIndexToCellCenterEiiid(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %22, i32 noundef %67, i32 noundef %68, i32 noundef %69, double noundef %70)
          to label %71 unwind label %82

71:                                               ; preds = %66
  %72 = getelementptr inbounds %"class.vmath::vec3", ptr %22, i32 0, i32 2
  %73 = load float, ptr %72, align 4, !tbaa !13
  %74 = fpext float %73 to double
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #5
  store double %74, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %103, %71
  %76 = load i32, ptr %24, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = load ptr, ptr %16, align 8, !tbaa !5
  %79 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %78) #5
  %80 = icmp ult i64 %77, %79
  br i1 %80, label %86, label %81

81:                                               ; preds = %75
  store i32 11, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %106

82:                                               ; preds = %66
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %14, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #5
  br label %126

86:                                               ; preds = %75
  %87 = load ptr, ptr %16, align 8, !tbaa !5
  %88 = load i32, ptr %24, align 4, !tbaa !9
  %89 = zext i32 %88 to i64
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %87, i64 noundef %89)
          to label %91 unwind label %98

91:                                               ; preds = %86
  %92 = load double, ptr %90, align 8, !tbaa !11
  %93 = load double, ptr %21, align 8, !tbaa !11
  %94 = fcmp olt double %92, %93
  br i1 %94, label %95, label %102

95:                                               ; preds = %91
  %96 = load i32, ptr %23, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %23, align 4, !tbaa !9
  br label %102

98:                                               ; preds = %86
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %14, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %125

102:                                              ; preds = %95, %91
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %24, align 4, !tbaa !9
  %105 = add i32 %104, 1
  store i32 %105, ptr %24, align 4, !tbaa !9
  br label %75, !llvm.loop !16

106:                                              ; preds = %81
  %107 = load i32, ptr %23, align 4, !tbaa !9
  %108 = srem i32 %107, 2
  %109 = icmp eq i32 %108, 1
  br i1 %109, label %110, label %121

110:                                              ; preds = %106
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #5
  %112 = load i32, ptr %20, align 4, !tbaa !9
  %113 = load i32, ptr %19, align 4, !tbaa !9
  %114 = load i32, ptr %17, align 4, !tbaa !9
  invoke void @_ZN9GridIndexC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %25, i32 noundef %112, i32 noundef %113, i32 noundef %114)
          to label %115 unwind label %117

115:                                              ; preds = %110
  invoke void @_ZNSt6vectorI9GridIndexSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %111, ptr noundef nonnull align 4 dereferenceable(12) %25)
          to label %116 unwind label %117

116:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #5
  br label %121

117:                                              ; preds = %115, %110
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %14, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #5
  br label %125

121:                                              ; preds = %116, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %122

122:                                              ; preds = %121, %61
  %123 = load i32, ptr %20, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %20, align 4, !tbaa !9
  br label %47, !llvm.loop !18

125:                                              ; preds = %117, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %126

126:                                              ; preds = %125, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %127

127:                                              ; preds = %126, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %137

128:                                              ; preds = %51
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %19, align 4, !tbaa !9
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %19, align 4, !tbaa !9
  br label %41, !llvm.loop !19

132:                                              ; preds = %45
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %17, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %17, align 4, !tbaa !9
  br label %31, !llvm.loop !20

136:                                              ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @_ZN7Array3dISt6vectorIdSaIdEEED2Ev(ptr noundef nonnull align 8 dereferenceable(60) %13) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #5
  ret void

137:                                              ; preds = %127, %36
  call void @_ZN7Array3dISt6vectorIdSaIdEEED2Ev(ptr noundef nonnull align 8 dereferenceable(60) %13) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #5
  br label %138

138:                                              ; preds = %137
  %139 = load ptr, ptr %14, align 8
  %140 = load i32, ptr %15, align 4
  %141 = insertvalue { ptr, i32 } poison, ptr %139, 0
  %142 = insertvalue { ptr, i32 } %141, i32 %140, 1
  resume { ptr, i32 } %142
}

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

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

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

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

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

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

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

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

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


; 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.Array3d.20 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.10", i32, [4 x i8] }>
%"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 }
%struct.GridIndex = type { i32, i32, i32 }

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

declare i32 @__gxx_personality_v0(...)

; 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 @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5utils18_getCollisionGridZER12TriangleMeshdR7Array3dISt6vectorIdSaIdEEE(ptr noundef nonnull align 8 dereferenceable(232), double noundef, ptr noundef nonnull align 8 dereferenceable(60)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5utils26getCellsInsideTriangleMeshER12TriangleMeshiiidRSt6vectorI9GridIndexSaIS3_EE(ptr noundef nonnull align 8 dereferenceable(232) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %class.Array3d.20, align 8
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca %struct.GridIndex, align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #5
  call void @_ZN7Array3dISt6vectorIdSaIdEEEC2Eiii(ptr noundef nonnull align 8 dereferenceable(60) %7, i32 noundef %1, i32 noundef %2, i32 noundef 1)
  invoke void @_ZN5utils18_getCollisionGridZER12TriangleMeshdR7Array3dISt6vectorIdSaIdEEE(ptr noundef nonnull align 8 dereferenceable(232) %0, double noundef %4, ptr noundef nonnull align 8 dereferenceable(60) %7)
          to label %.preheader49 unwind label %44

.preheader49:                                     ; preds = %6
  %10 = icmp sgt i32 %3, 0
  br i1 %10, label %.preheader48.lr.ph, label %._crit_edge

.preheader48.lr.ph:                               ; preds = %.preheader49
  %11 = icmp sgt i32 %2, 0
  %12 = getelementptr inbounds i8, ptr %8, i64 8
  %13 = icmp sgt i32 %1, 0
  %or.cond = and i1 %11, %13
  br i1 %or.cond, label %.preheader48.us.us, label %._crit_edge

.preheader48.us.us:                               ; preds = %.preheader48.lr.ph, %._crit_edge57.split.us.us.us
  %.03867.us.us = phi i32 [ %39, %._crit_edge57.split.us.us.us ], [ 0, %.preheader48.lr.ph ]
  br label %.preheader.us.us.us

.preheader.us.us.us:                              ; preds = %._crit_edge55.us.us.us, %.preheader48.us.us
  %.03756.us.us.us = phi i32 [ 0, %.preheader48.us.us ], [ %38, %._crit_edge55.us.us.us ]
  br label %14

14:                                               ; preds = %._crit_edge.us.us.us.thread, %.preheader.us.us.us
  %.03653.us.us.us = phi i32 [ 0, %.preheader.us.us.us ], [ %27, %._crit_edge.us.us.us.thread ]
  %15 = invoke noundef ptr @_ZN7Array3dISt6vectorIdSaIdEEE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(60) %7, i32 noundef %.03653.us.us.us, i32 noundef %.03756.us.us.us, i32 noundef 0)
          to label %16 unwind label %.split.us.split.us.split.us

16:                                               ; preds = %14
  %17 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %18 = and i64 %17, 1
  %.not.us.us.us = icmp eq i64 %18, 0
  br i1 %.not.us.us.us, label %19, label %._crit_edge.us.us.us.thread

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  invoke void @_ZN6Grid3d21GridIndexToCellCenterEiiid(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %8, i32 noundef %.03653.us.us.us, i32 noundef %.03756.us.us.us, i32 noundef %.03867.us.us, double noundef %4)
          to label %20 unwind label %.split59.us.split.us.split.us

20:                                               ; preds = %19
  %21 = load float, ptr %12, align 4, !tbaa !5
  %22 = fpext float %21 to double
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  %23 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %.not = icmp eq i64 %23, 0
  br i1 %.not, label %._crit_edge.us.us.us.thread, label %.lr.ph.us.us.us

._crit_edge.us.us.us:                             ; preds = %30
  %24 = and i32 %.1.us.us.us, 1
  %.not84 = icmp eq i32 %24, 0
  br i1 %.not84, label %._crit_edge.us.us.us.thread, label %25

25:                                               ; preds = %._crit_edge.us.us.us
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #5
  call void @_ZN9GridIndexC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %9, i32 noundef %.03653.us.us.us, i32 noundef %.03756.us.us.us, i32 noundef %.03867.us.us)
  invoke void @_ZNSt6vectorI9GridIndexSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %26 unwind label %.split62.us.split.us.split.us

26:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #5
  br label %._crit_edge.us.us.us.thread

._crit_edge.us.us.us.thread:                      ; preds = %20, %26, %._crit_edge.us.us.us, %16
  %27 = add nuw nsw i32 %.03653.us.us.us, 1
  %exitcond.not = icmp eq i32 %27, %1
  br i1 %exitcond.not, label %._crit_edge55.us.us.us, label %14, !llvm.loop !10

.lr.ph.us.us.us:                                  ; preds = %20, %30
  %28 = phi i64 [ %35, %30 ], [ 0, %20 ]
  %.052.us.us.us = phi i32 [ %34, %30 ], [ 0, %20 ]
  %.03351.us.us.us = phi i32 [ %.1.us.us.us, %30 ], [ 0, %20 ]
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %28)
          to label %30 unwind label %.split65.us.split.us.split.us

30:                                               ; preds = %.lr.ph.us.us.us
  %31 = load double, ptr %29, align 8, !tbaa !12
  %32 = fcmp olt double %31, %22
  %33 = zext i1 %32 to i32
  %.1.us.us.us = add nuw nsw i32 %.03351.us.us.us, %33
  %34 = add i32 %.052.us.us.us, 1
  %35 = zext i32 %34 to i64
  %36 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %37 = icmp ugt i64 %36, %35
  br i1 %37, label %.lr.ph.us.us.us, label %._crit_edge.us.us.us, !llvm.loop !14

._crit_edge55.us.us.us:                           ; preds = %._crit_edge.us.us.us.thread
  %38 = add nuw nsw i32 %.03756.us.us.us, 1
  %exitcond81.not = icmp eq i32 %38, %2
  br i1 %exitcond81.not, label %._crit_edge57.split.us.us.us, label %.preheader.us.us.us, !llvm.loop !15

._crit_edge57.split.us.us.us:                     ; preds = %._crit_edge55.us.us.us
  %39 = add nuw nsw i32 %.03867.us.us, 1
  %exitcond82.not = icmp eq i32 %39, %3
  br i1 %exitcond82.not, label %._crit_edge, label %.preheader48.us.us, !llvm.loop !16

.split.us.split.us.split.us:                      ; preds = %14
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %46

.split59.us.split.us.split.us:                    ; preds = %19
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  br label %46

.split62.us.split.us.split.us:                    ; preds = %25
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #5
  br label %46

.split65.us.split.us.split.us:                    ; preds = %.lr.ph.us.us.us
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %46

._crit_edge:                                      ; preds = %._crit_edge57.split.us.us.us, %.preheader48.lr.ph, %.preheader49
  call void @_ZN7Array3dISt6vectorIdSaIdEEED2Ev(ptr noundef nonnull align 8 dereferenceable(60) %7) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #5
  ret void

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

46:                                               ; preds = %.split.us.split.us.split.us, %.split65.us.split.us.split.us, %.split62.us.split.us.split.us, %.split59.us.split.us.split.us, %44
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %45, %44 ], [ %40, %.split.us.split.us.split.us ], [ %41, %.split59.us.split.us.split.us ], [ %43, %.split65.us.split.us.split.us ], [ %42, %.split62.us.split.us.split.us ]
  call void @_ZN7Array3dISt6vectorIdSaIdEEED2Ev(ptr noundef nonnull align 8 dereferenceable(60) %7) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #5
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTSN5vmath4vec3E", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}


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