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

; 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"

%struct.GridIndex = type { i32, i32, i32 }
%struct.Brick = type <{ float, i8, [3 x i8] }>
%class.FluidBrickGrid = type <{ i32, i32, i32, [4 x i8], double, %class.AABB, %class.Array3d, %class.Array3d.0, [3 x %class.Array3d.0], i32, [4 x i8], %class.Array3d.0, i8, [3 x i8], i32, i32, float, float, float, i32, i32, i8, [7 x i8] }>
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.vmath::vec3" = type { float, float, float }
%class.Array3d = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], %"struct.FluidBrickGrid::DensityNode", i32, [4 x i8] }>
%"struct.FluidBrickGrid::DensityNode" = type { float, float, float }
%class.Array3d.0 = type { i32, i32, i32, ptr, i8, [3 x i8], %struct.Brick, i32 }

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN14FluidBrickGrid29_isBrickNextToActiveNeighbourEiii(ptr noundef nonnull align 8 dereferenceable(353) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #4 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [6 x %struct.GridIndex], align 16
  %10 = alloca %struct.GridIndex, align 4
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.GridIndex, align 4
  %15 = alloca { i64, i32 }, align 4
  %16 = alloca %struct.Brick, align 4
  %17 = alloca %struct.GridIndex, align 4
  %18 = alloca { i64, i32 }, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %19 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #6
  %20 = getelementptr inbounds [6 x %struct.GridIndex], ptr %9, i32 0, i32 0
  %21 = getelementptr inbounds %struct.GridIndex, ptr %20, i64 6
  br label %22

22:                                               ; preds = %22, %4
  %23 = phi ptr [ %20, %4 ], [ %24, %22 ]
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %23)
  %24 = getelementptr inbounds %struct.GridIndex, ptr %23, i64 1
  %25 = icmp eq ptr %24, %21
  br i1 %25, label %26, label %22

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #6
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = getelementptr inbounds [6 x %struct.GridIndex], ptr %9, i64 0, i64 0
  call void @_ZN6Grid3d24getNeighbourGridIndices6EiiiP9GridIndex(i32 noundef %27, i32 noundef %28, i32 noundef %29, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  store i8 0, ptr %11, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %68, %26
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = icmp slt i32 %32, 6
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  store i32 2, ptr %13, align 4
  br label %71

35:                                               ; preds = %31
  %36 = load i32, ptr %12, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [6 x %struct.GridIndex], ptr %9, i64 0, i64 %37
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %38, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !13
  %39 = getelementptr inbounds %class.FluidBrickGrid, ptr %19, i32 0, i32 7
  %40 = getelementptr inbounds %class.Array3d.0, ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !14
  %42 = getelementptr inbounds %class.FluidBrickGrid, ptr %19, i32 0, i32 7
  %43 = getelementptr inbounds %class.Array3d.0, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !24
  %45 = getelementptr inbounds %class.FluidBrickGrid, ptr %19, i32 0, i32 7
  %46 = getelementptr inbounds %class.Array3d.0, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %14, i64 12, i1 false)
  %48 = getelementptr inbounds { i64, i32 }, ptr %15, i32 0, i32 0
  %49 = load i64, ptr %48, align 4
  %50 = getelementptr inbounds { i64, i32 }, ptr %15, i32 0, i32 1
  %51 = load i32, ptr %50, align 4
  %52 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %49, i32 %51, i32 noundef %41, i32 noundef %44, i32 noundef %47)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  br i1 %52, label %53, label %64

53:                                               ; preds = %35
  %54 = getelementptr inbounds %class.FluidBrickGrid, ptr %19, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %17, i64 12, i1 false)
  %55 = getelementptr inbounds { i64, i32 }, ptr %18, i32 0, i32 0
  %56 = load i64, ptr %55, align 4
  %57 = getelementptr inbounds { i64, i32 }, ptr %18, i32 0, i32 1
  %58 = load i32, ptr %57, align 4
  %59 = call i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %54, i64 %56, i32 %58)
  %60 = trunc i64 %59 to i40
  store i40 %60, ptr %16, align 4
  %61 = getelementptr inbounds %struct.Brick, ptr %16, i32 0, i32 1
  %62 = load i8, ptr %61, align 4, !tbaa !26, !range !27, !noundef !28
  %63 = trunc i8 %62 to i1
  br label %64

64:                                               ; preds = %53, %35
  %65 = phi i1 [ false, %35 ], [ %63, %53 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br i1 %65, label %66, label %67

66:                                               ; preds = %64
  store i8 1, ptr %11, align 1, !tbaa !11
  store i32 2, ptr %13, align 4
  br label %71

67:                                               ; preds = %64
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %12, align 4, !tbaa !9
  br label %31, !llvm.loop !29

71:                                               ; preds = %66, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %72

72:                                               ; preds = %71
  %73 = load i8, ptr %11, align 1, !tbaa !11, !range !27, !noundef !28
  %74 = trunc i8 %73 to i1
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #6
  ret i1 %74
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d24getNeighbourGridIndices6EiiiP9GridIndex(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #5

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

%struct.GridIndex = type { i32, i32, i32 }

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN14FluidBrickGrid29_isBrickNextToActiveNeighbourEiii(ptr noundef nonnull align 8 dereferenceable(353) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #4 align 2 {
  %5 = alloca [6 x %struct.GridIndex], align 16
  %6 = alloca %struct.GridIndex, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #6
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %.ptr.1 = getelementptr inbounds i8, ptr %5, i64 12
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %5, i64 24
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %5, i64 36
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %5, i64 48
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %5, i64 60
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #6
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @_ZN6Grid3d24getNeighbourGridIndices6EiiiP9GridIndex(i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %5)
  %.sroa.27.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %7 = getelementptr inbounds i8, ptr %0, i64 112
  %8 = getelementptr inbounds i8, ptr %0, i64 116
  %9 = getelementptr inbounds i8, ptr %0, i64 120
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 16 dereferenceable(12) %5, i64 12, i1 false), !tbaa.struct !5
  %.sroa.06.0.copyload = load i64, ptr %6, align 8
  %.sroa.27.0.copyload = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %10 = load i32, ptr %7, align 8, !tbaa !10
  %11 = load i32, ptr %8, align 4, !tbaa !22
  %12 = load i32, ptr %9, align 8, !tbaa !23
  %13 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.06.0.copyload, i32 %.sroa.27.0.copyload, i32 noundef %10, i32 noundef %11, i32 noundef %12)
  br i1 %13, label %14, label %.critedge

14:                                               ; preds = %4
  %.sroa.01.0.copyload = load i64, ptr %6, align 8
  %.sroa.22.0.copyload = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %15 = call i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %7, i64 %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload)
  %16 = and i64 %15, 4294967296
  %.not = icmp eq i64 %16, 0
  br i1 %.not, label %.critedge, label %52

.critedge:                                        ; preds = %4, %14
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1, i64 12, i1 false), !tbaa.struct !5
  %.sroa.06.0.copyload.1 = load i64, ptr %6, align 8
  %.sroa.27.0.copyload.1 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %17 = load i32, ptr %7, align 8, !tbaa !10
  %18 = load i32, ptr %8, align 4, !tbaa !22
  %19 = load i32, ptr %9, align 8, !tbaa !23
  %20 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.06.0.copyload.1, i32 %.sroa.27.0.copyload.1, i32 noundef %17, i32 noundef %18, i32 noundef %19)
  br i1 %20, label %21, label %.critedge.1

21:                                               ; preds = %.critedge
  %.sroa.01.0.copyload.1 = load i64, ptr %6, align 8
  %.sroa.22.0.copyload.1 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %22 = call i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %7, i64 %.sroa.01.0.copyload.1, i32 %.sroa.22.0.copyload.1)
  %23 = and i64 %22, 4294967296
  %.not.1 = icmp eq i64 %23, 0
  br i1 %.not.1, label %.critedge.1, label %52

.critedge.1:                                      ; preds = %21, %.critedge
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 8 dereferenceable(12) %.ptr.2, i64 12, i1 false), !tbaa.struct !5
  %.sroa.06.0.copyload.2 = load i64, ptr %6, align 8
  %.sroa.27.0.copyload.2 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %24 = load i32, ptr %7, align 8, !tbaa !10
  %25 = load i32, ptr %8, align 4, !tbaa !22
  %26 = load i32, ptr %9, align 8, !tbaa !23
  %27 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.06.0.copyload.2, i32 %.sroa.27.0.copyload.2, i32 noundef %24, i32 noundef %25, i32 noundef %26)
  br i1 %27, label %28, label %.critedge.2

28:                                               ; preds = %.critedge.1
  %.sroa.01.0.copyload.2 = load i64, ptr %6, align 8
  %.sroa.22.0.copyload.2 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %29 = call i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %7, i64 %.sroa.01.0.copyload.2, i32 %.sroa.22.0.copyload.2)
  %30 = and i64 %29, 4294967296
  %.not.2 = icmp eq i64 %30, 0
  br i1 %.not.2, label %.critedge.2, label %52

.critedge.2:                                      ; preds = %28, %.critedge.1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3, i64 12, i1 false), !tbaa.struct !5
  %.sroa.06.0.copyload.3 = load i64, ptr %6, align 8
  %.sroa.27.0.copyload.3 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %31 = load i32, ptr %7, align 8, !tbaa !10
  %32 = load i32, ptr %8, align 4, !tbaa !22
  %33 = load i32, ptr %9, align 8, !tbaa !23
  %34 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.06.0.copyload.3, i32 %.sroa.27.0.copyload.3, i32 noundef %31, i32 noundef %32, i32 noundef %33)
  br i1 %34, label %35, label %.critedge.3

35:                                               ; preds = %.critedge.2
  %.sroa.01.0.copyload.3 = load i64, ptr %6, align 8
  %.sroa.22.0.copyload.3 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %36 = call i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %7, i64 %.sroa.01.0.copyload.3, i32 %.sroa.22.0.copyload.3)
  %37 = and i64 %36, 4294967296
  %.not.3 = icmp eq i64 %37, 0
  br i1 %.not.3, label %.critedge.3, label %52

.critedge.3:                                      ; preds = %35, %.critedge.2
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 16 dereferenceable(12) %.ptr.4, i64 12, i1 false), !tbaa.struct !5
  %.sroa.06.0.copyload.4 = load i64, ptr %6, align 8
  %.sroa.27.0.copyload.4 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %38 = load i32, ptr %7, align 8, !tbaa !10
  %39 = load i32, ptr %8, align 4, !tbaa !22
  %40 = load i32, ptr %9, align 8, !tbaa !23
  %41 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.06.0.copyload.4, i32 %.sroa.27.0.copyload.4, i32 noundef %38, i32 noundef %39, i32 noundef %40)
  br i1 %41, label %42, label %.critedge.4

42:                                               ; preds = %.critedge.3
  %.sroa.01.0.copyload.4 = load i64, ptr %6, align 8
  %.sroa.22.0.copyload.4 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %43 = call i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %7, i64 %.sroa.01.0.copyload.4, i32 %.sroa.22.0.copyload.4)
  %44 = and i64 %43, 4294967296
  %.not.4 = icmp eq i64 %44, 0
  br i1 %.not.4, label %.critedge.4, label %52

.critedge.4:                                      ; preds = %42, %.critedge.3
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5, i64 12, i1 false), !tbaa.struct !5
  %.sroa.06.0.copyload.5 = load i64, ptr %6, align 8
  %.sroa.27.0.copyload.5 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %45 = load i32, ptr %7, align 8, !tbaa !10
  %46 = load i32, ptr %8, align 4, !tbaa !22
  %47 = load i32, ptr %9, align 8, !tbaa !23
  %48 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.06.0.copyload.5, i32 %.sroa.27.0.copyload.5, i32 noundef %45, i32 noundef %46, i32 noundef %47)
  br i1 %48, label %49, label %.critedge.5

49:                                               ; preds = %.critedge.4
  %.sroa.01.0.copyload.5 = load i64, ptr %6, align 8
  %.sroa.22.0.copyload.5 = load i32, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !6
  %50 = call i64 @_ZN7Array3dI5BrickEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(40) %7, i64 %.sroa.01.0.copyload.5, i32 %.sroa.22.0.copyload.5)
  %51 = and i64 %50, 4294967296
  %.not.5 = icmp eq i64 %51, 0
  br i1 %.not.5, label %.critedge.5, label %52

.critedge.5:                                      ; preds = %49, %.critedge.4
  br label %52

52:                                               ; preds = %.critedge.5, %49, %42, %35, %28, %21, %14
  %.lcssa = phi i1 [ true, %14 ], [ true, %21 ], [ true, %28 ], [ true, %35 ], [ true, %42 ], [ true, %49 ], [ false, %.critedge.5 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #6
  ret i1 %.lcssa
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d24getNeighbourGridIndices6EiiiP9GridIndex(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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


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