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

; 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 }
%class.FluidMaterialGrid = type { i32, i32, i32, %class.SubdividedArray3d }
%class.SubdividedArray3d = type { i32, i32, i32, i32, i32, i32, %class.Array3d, i32, double }
%class.Array3d = type { i32, i32, i32, ptr, i8, i8, 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: mustprogress uwtable
declare dso_local noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72), i64, i32) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN17FluidMaterialGrid26isCellNeighbouringMaterialEiii8Material(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i8 noundef signext %4) #1 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca [26 x %struct.GridIndex], align 16
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.GridIndex, align 4
  %16 = alloca { i64, i32 }, 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 i8 %4, ptr %11, align 1, !tbaa !11
  %17 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 312, ptr %12) #5
  %18 = getelementptr inbounds [26 x %struct.GridIndex], ptr %12, i32 0, i32 0
  %19 = getelementptr inbounds %struct.GridIndex, ptr %18, i64 26
  br label %20

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

24:                                               ; preds = %20
  %25 = load i32, ptr %8, align 4, !tbaa !9
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = load i32, ptr %10, align 4, !tbaa !9
  %28 = getelementptr inbounds [26 x %struct.GridIndex], ptr %12, i64 0, i64 0
  call void @_ZN6Grid3d25getNeighbourGridIndices26EiiiP9GridIndex(i32 noundef %25, i32 noundef %26, i32 noundef %27, ptr noundef %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %47, %24
  %30 = load i32, ptr %13, align 4, !tbaa !9
  %31 = icmp slt i32 %30, 26
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 2, ptr %14, align 4
  br label %50

33:                                               ; preds = %29
  %34 = getelementptr inbounds %class.FluidMaterialGrid, ptr %17, i32 0, i32 3
  %35 = load i32, ptr %13, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [26 x %struct.GridIndex], ptr %12, i64 0, i64 %36
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %37, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %15, i64 12, i1 false)
  %38 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 0
  %39 = load i64, ptr %38, align 4
  %40 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 1
  %41 = load i32, ptr %40, align 4
  %42 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %34, i64 %39, i32 %41)
  %43 = load i8, ptr %11, align 1, !tbaa !11
  %44 = icmp eq i8 %42, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %33
  store i1 true, ptr %6, align 1
  store i32 1, ptr %14, align 4
  br label %50

46:                                               ; preds = %33
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %13, align 4, !tbaa !9
  br label %29, !llvm.loop !14

50:                                               ; preds = %45, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %51 = load i32, ptr %14, align 4
  switch i32 %51, label %53 [
    i32 2, label %52
  ]

52:                                               ; preds = %50
  store i1 false, ptr %6, align 1
  store i32 1, ptr %14, align 4
  br label %53

53:                                               ; preds = %52, %50
  call void @llvm.lifetime.end.p0(i64 312, ptr %12) #5
  %54 = load i1, ptr %6, align 1
  ret i1 %54
}

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

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

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

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"_ZTS8Material", !7, i64 0}
!13 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!14 = distinct !{!14, !15}
!15 = !{!"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 uwtable
declare dso_local noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72), i64, i32) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN17FluidMaterialGrid26isCellNeighbouringMaterialEiii8Material(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i8 noundef signext %4) local_unnamed_addr #0 align 2 {
  %6 = alloca [26 x %struct.GridIndex], align 16
  call void @llvm.lifetime.start.p0(i64 312, ptr nonnull %6) #4
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6)
  %.ptr.1 = getelementptr inbounds i8, ptr %6, i64 12
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %6, i64 24
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %6, i64 36
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %6, i64 48
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %6, i64 60
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5)
  %.ptr.6 = getelementptr inbounds i8, ptr %6, i64 72
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.6)
  %.ptr.7 = getelementptr inbounds i8, ptr %6, i64 84
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.7)
  %.ptr.8 = getelementptr inbounds i8, ptr %6, i64 96
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.8)
  %.ptr.9 = getelementptr inbounds i8, ptr %6, i64 108
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.9)
  %.ptr.10 = getelementptr inbounds i8, ptr %6, i64 120
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.10)
  %.ptr.11 = getelementptr inbounds i8, ptr %6, i64 132
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.11)
  %.ptr.12 = getelementptr inbounds i8, ptr %6, i64 144
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.12)
  %.ptr.13 = getelementptr inbounds i8, ptr %6, i64 156
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.13)
  %.ptr.14 = getelementptr inbounds i8, ptr %6, i64 168
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.14)
  %.ptr.15 = getelementptr inbounds i8, ptr %6, i64 180
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.15)
  %.ptr.16 = getelementptr inbounds i8, ptr %6, i64 192
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.16)
  %.ptr.17 = getelementptr inbounds i8, ptr %6, i64 204
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.17)
  %.ptr.18 = getelementptr inbounds i8, ptr %6, i64 216
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.18)
  %.ptr.19 = getelementptr inbounds i8, ptr %6, i64 228
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.19)
  %.ptr.20 = getelementptr inbounds i8, ptr %6, i64 240
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.20)
  %.ptr.21 = getelementptr inbounds i8, ptr %6, i64 252
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.21)
  %.ptr.22 = getelementptr inbounds i8, ptr %6, i64 264
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.22)
  %.ptr.23 = getelementptr inbounds i8, ptr %6, i64 276
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.23)
  %.ptr.24 = getelementptr inbounds i8, ptr %6, i64 288
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.24)
  %.ptr.25 = getelementptr inbounds i8, ptr %6, i64 300
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.25)
  call void @_ZN6Grid3d25getNeighbourGridIndices26EiiiP9GridIndex(i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.01.0.copyload = load i64, ptr %6, align 16
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.22.0.copyload = load i32, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !5
  %8 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload)
  %9 = icmp eq i8 %8, %4
  br i1 %9, label %.critedge, label %10

10:                                               ; preds = %5
  %.sroa.01.0.copyload.1 = load i64, ptr %.ptr.1, align 4
  %.sroa.22.0..sroa_idx.1 = getelementptr inbounds i8, ptr %6, i64 20
  %.sroa.22.0.copyload.1 = load i32, ptr %.sroa.22.0..sroa_idx.1, align 4, !tbaa !5
  %11 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.1, i32 %.sroa.22.0.copyload.1)
  %12 = icmp eq i8 %11, %4
  br i1 %12, label %.critedge, label %13

13:                                               ; preds = %10
  %.sroa.01.0.copyload.2 = load i64, ptr %.ptr.2, align 8
  %.sroa.22.0..sroa_idx.2 = getelementptr inbounds i8, ptr %6, i64 32
  %.sroa.22.0.copyload.2 = load i32, ptr %.sroa.22.0..sroa_idx.2, align 16, !tbaa !5
  %14 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.2, i32 %.sroa.22.0.copyload.2)
  %15 = icmp eq i8 %14, %4
  br i1 %15, label %.critedge, label %16

16:                                               ; preds = %13
  %.sroa.01.0.copyload.3 = load i64, ptr %.ptr.3, align 4
  %.sroa.22.0..sroa_idx.3 = getelementptr inbounds i8, ptr %6, i64 44
  %.sroa.22.0.copyload.3 = load i32, ptr %.sroa.22.0..sroa_idx.3, align 4, !tbaa !5
  %17 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.3, i32 %.sroa.22.0.copyload.3)
  %18 = icmp eq i8 %17, %4
  br i1 %18, label %.critedge, label %19

19:                                               ; preds = %16
  %.sroa.01.0.copyload.4 = load i64, ptr %.ptr.4, align 16
  %.sroa.22.0..sroa_idx.4 = getelementptr inbounds i8, ptr %6, i64 56
  %.sroa.22.0.copyload.4 = load i32, ptr %.sroa.22.0..sroa_idx.4, align 8, !tbaa !5
  %20 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.4, i32 %.sroa.22.0.copyload.4)
  %21 = icmp eq i8 %20, %4
  br i1 %21, label %.critedge, label %22

22:                                               ; preds = %19
  %.sroa.01.0.copyload.5 = load i64, ptr %.ptr.5, align 4
  %.sroa.22.0..sroa_idx.5 = getelementptr inbounds i8, ptr %6, i64 68
  %.sroa.22.0.copyload.5 = load i32, ptr %.sroa.22.0..sroa_idx.5, align 4, !tbaa !5
  %23 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.5, i32 %.sroa.22.0.copyload.5)
  %24 = icmp eq i8 %23, %4
  br i1 %24, label %.critedge, label %25

25:                                               ; preds = %22
  %.sroa.01.0.copyload.6 = load i64, ptr %.ptr.6, align 8
  %.sroa.22.0..sroa_idx.6 = getelementptr inbounds i8, ptr %6, i64 80
  %.sroa.22.0.copyload.6 = load i32, ptr %.sroa.22.0..sroa_idx.6, align 16, !tbaa !5
  %26 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.6, i32 %.sroa.22.0.copyload.6)
  %27 = icmp eq i8 %26, %4
  br i1 %27, label %.critedge, label %28

28:                                               ; preds = %25
  %.sroa.01.0.copyload.7 = load i64, ptr %.ptr.7, align 4
  %.sroa.22.0..sroa_idx.7 = getelementptr inbounds i8, ptr %6, i64 92
  %.sroa.22.0.copyload.7 = load i32, ptr %.sroa.22.0..sroa_idx.7, align 4, !tbaa !5
  %29 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.7, i32 %.sroa.22.0.copyload.7)
  %30 = icmp eq i8 %29, %4
  br i1 %30, label %.critedge, label %31

31:                                               ; preds = %28
  %.sroa.01.0.copyload.8 = load i64, ptr %.ptr.8, align 16
  %.sroa.22.0..sroa_idx.8 = getelementptr inbounds i8, ptr %6, i64 104
  %.sroa.22.0.copyload.8 = load i32, ptr %.sroa.22.0..sroa_idx.8, align 8, !tbaa !5
  %32 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.8, i32 %.sroa.22.0.copyload.8)
  %33 = icmp eq i8 %32, %4
  br i1 %33, label %.critedge, label %34

34:                                               ; preds = %31
  %.sroa.01.0.copyload.9 = load i64, ptr %.ptr.9, align 4
  %.sroa.22.0..sroa_idx.9 = getelementptr inbounds i8, ptr %6, i64 116
  %.sroa.22.0.copyload.9 = load i32, ptr %.sroa.22.0..sroa_idx.9, align 4, !tbaa !5
  %35 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.9, i32 %.sroa.22.0.copyload.9)
  %36 = icmp eq i8 %35, %4
  br i1 %36, label %.critedge, label %37

37:                                               ; preds = %34
  %.sroa.01.0.copyload.10 = load i64, ptr %.ptr.10, align 8
  %.sroa.22.0..sroa_idx.10 = getelementptr inbounds i8, ptr %6, i64 128
  %.sroa.22.0.copyload.10 = load i32, ptr %.sroa.22.0..sroa_idx.10, align 16, !tbaa !5
  %38 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.10, i32 %.sroa.22.0.copyload.10)
  %39 = icmp eq i8 %38, %4
  br i1 %39, label %.critedge, label %40

40:                                               ; preds = %37
  %.sroa.01.0.copyload.11 = load i64, ptr %.ptr.11, align 4
  %.sroa.22.0..sroa_idx.11 = getelementptr inbounds i8, ptr %6, i64 140
  %.sroa.22.0.copyload.11 = load i32, ptr %.sroa.22.0..sroa_idx.11, align 4, !tbaa !5
  %41 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.11, i32 %.sroa.22.0.copyload.11)
  %42 = icmp eq i8 %41, %4
  br i1 %42, label %.critedge, label %43

43:                                               ; preds = %40
  %.sroa.01.0.copyload.12 = load i64, ptr %.ptr.12, align 16
  %.sroa.22.0..sroa_idx.12 = getelementptr inbounds i8, ptr %6, i64 152
  %.sroa.22.0.copyload.12 = load i32, ptr %.sroa.22.0..sroa_idx.12, align 8, !tbaa !5
  %44 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.12, i32 %.sroa.22.0.copyload.12)
  %45 = icmp eq i8 %44, %4
  br i1 %45, label %.critedge, label %46

46:                                               ; preds = %43
  %.sroa.01.0.copyload.13 = load i64, ptr %.ptr.13, align 4
  %.sroa.22.0..sroa_idx.13 = getelementptr inbounds i8, ptr %6, i64 164
  %.sroa.22.0.copyload.13 = load i32, ptr %.sroa.22.0..sroa_idx.13, align 4, !tbaa !5
  %47 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.13, i32 %.sroa.22.0.copyload.13)
  %48 = icmp eq i8 %47, %4
  br i1 %48, label %.critedge, label %49

49:                                               ; preds = %46
  %.sroa.01.0.copyload.14 = load i64, ptr %.ptr.14, align 8
  %.sroa.22.0..sroa_idx.14 = getelementptr inbounds i8, ptr %6, i64 176
  %.sroa.22.0.copyload.14 = load i32, ptr %.sroa.22.0..sroa_idx.14, align 16, !tbaa !5
  %50 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.14, i32 %.sroa.22.0.copyload.14)
  %51 = icmp eq i8 %50, %4
  br i1 %51, label %.critedge, label %52

52:                                               ; preds = %49
  %.sroa.01.0.copyload.15 = load i64, ptr %.ptr.15, align 4
  %.sroa.22.0..sroa_idx.15 = getelementptr inbounds i8, ptr %6, i64 188
  %.sroa.22.0.copyload.15 = load i32, ptr %.sroa.22.0..sroa_idx.15, align 4, !tbaa !5
  %53 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.15, i32 %.sroa.22.0.copyload.15)
  %54 = icmp eq i8 %53, %4
  br i1 %54, label %.critedge, label %55

55:                                               ; preds = %52
  %.sroa.01.0.copyload.16 = load i64, ptr %.ptr.16, align 16
  %.sroa.22.0..sroa_idx.16 = getelementptr inbounds i8, ptr %6, i64 200
  %.sroa.22.0.copyload.16 = load i32, ptr %.sroa.22.0..sroa_idx.16, align 8, !tbaa !5
  %56 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.16, i32 %.sroa.22.0.copyload.16)
  %57 = icmp eq i8 %56, %4
  br i1 %57, label %.critedge, label %58

58:                                               ; preds = %55
  %.sroa.01.0.copyload.17 = load i64, ptr %.ptr.17, align 4
  %.sroa.22.0..sroa_idx.17 = getelementptr inbounds i8, ptr %6, i64 212
  %.sroa.22.0.copyload.17 = load i32, ptr %.sroa.22.0..sroa_idx.17, align 4, !tbaa !5
  %59 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.17, i32 %.sroa.22.0.copyload.17)
  %60 = icmp eq i8 %59, %4
  br i1 %60, label %.critedge, label %61

61:                                               ; preds = %58
  %.sroa.01.0.copyload.18 = load i64, ptr %.ptr.18, align 8
  %.sroa.22.0..sroa_idx.18 = getelementptr inbounds i8, ptr %6, i64 224
  %.sroa.22.0.copyload.18 = load i32, ptr %.sroa.22.0..sroa_idx.18, align 16, !tbaa !5
  %62 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.18, i32 %.sroa.22.0.copyload.18)
  %63 = icmp eq i8 %62, %4
  br i1 %63, label %.critedge, label %64

64:                                               ; preds = %61
  %.sroa.01.0.copyload.19 = load i64, ptr %.ptr.19, align 4
  %.sroa.22.0..sroa_idx.19 = getelementptr inbounds i8, ptr %6, i64 236
  %.sroa.22.0.copyload.19 = load i32, ptr %.sroa.22.0..sroa_idx.19, align 4, !tbaa !5
  %65 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.19, i32 %.sroa.22.0.copyload.19)
  %66 = icmp eq i8 %65, %4
  br i1 %66, label %.critedge, label %67

67:                                               ; preds = %64
  %.sroa.01.0.copyload.20 = load i64, ptr %.ptr.20, align 16
  %.sroa.22.0..sroa_idx.20 = getelementptr inbounds i8, ptr %6, i64 248
  %.sroa.22.0.copyload.20 = load i32, ptr %.sroa.22.0..sroa_idx.20, align 8, !tbaa !5
  %68 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.20, i32 %.sroa.22.0.copyload.20)
  %69 = icmp eq i8 %68, %4
  br i1 %69, label %.critedge, label %70

70:                                               ; preds = %67
  %.sroa.01.0.copyload.21 = load i64, ptr %.ptr.21, align 4
  %.sroa.22.0..sroa_idx.21 = getelementptr inbounds i8, ptr %6, i64 260
  %.sroa.22.0.copyload.21 = load i32, ptr %.sroa.22.0..sroa_idx.21, align 4, !tbaa !5
  %71 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.21, i32 %.sroa.22.0.copyload.21)
  %72 = icmp eq i8 %71, %4
  br i1 %72, label %.critedge, label %73

73:                                               ; preds = %70
  %.sroa.01.0.copyload.22 = load i64, ptr %.ptr.22, align 8
  %.sroa.22.0..sroa_idx.22 = getelementptr inbounds i8, ptr %6, i64 272
  %.sroa.22.0.copyload.22 = load i32, ptr %.sroa.22.0..sroa_idx.22, align 16, !tbaa !5
  %74 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.22, i32 %.sroa.22.0.copyload.22)
  %75 = icmp eq i8 %74, %4
  br i1 %75, label %.critedge, label %76

76:                                               ; preds = %73
  %.sroa.01.0.copyload.23 = load i64, ptr %.ptr.23, align 4
  %.sroa.22.0..sroa_idx.23 = getelementptr inbounds i8, ptr %6, i64 284
  %.sroa.22.0.copyload.23 = load i32, ptr %.sroa.22.0..sroa_idx.23, align 4, !tbaa !5
  %77 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.23, i32 %.sroa.22.0.copyload.23)
  %78 = icmp eq i8 %77, %4
  br i1 %78, label %.critedge, label %79

79:                                               ; preds = %76
  %.sroa.01.0.copyload.24 = load i64, ptr %.ptr.24, align 16
  %.sroa.22.0..sroa_idx.24 = getelementptr inbounds i8, ptr %6, i64 296
  %.sroa.22.0.copyload.24 = load i32, ptr %.sroa.22.0..sroa_idx.24, align 8, !tbaa !5
  %80 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.24, i32 %.sroa.22.0.copyload.24)
  %81 = icmp eq i8 %80, %4
  br i1 %81, label %.critedge, label %82

82:                                               ; preds = %79
  %.sroa.01.0.copyload.25 = load i64, ptr %.ptr.25, align 4
  %.sroa.22.0..sroa_idx.25 = getelementptr inbounds i8, ptr %6, i64 308
  %.sroa.22.0.copyload.25 = load i32, ptr %.sroa.22.0..sroa_idx.25, align 4, !tbaa !5
  %83 = call noundef signext i8 @_ZN17SubdividedArray3dI8MaterialEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 %.sroa.01.0.copyload.25, i32 %.sroa.22.0.copyload.25)
  %84 = icmp eq i8 %83, %4
  br label %.critedge

.critedge:                                        ; preds = %82, %79, %76, %73, %70, %67, %64, %61, %58, %55, %52, %49, %46, %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %5
  %.lcssa = phi i1 [ true, %5 ], [ true, %10 ], [ true, %13 ], [ true, %16 ], [ true, %19 ], [ true, %22 ], [ true, %25 ], [ true, %28 ], [ true, %31 ], [ true, %34 ], [ true, %37 ], [ true, %40 ], [ true, %43 ], [ true, %46 ], [ true, %49 ], [ true, %52 ], [ true, %55 ], [ true, %58 ], [ true, %61 ], [ true, %64 ], [ true, %67 ], [ true, %70 ], [ true, %73 ], [ true, %76 ], [ true, %79 ], [ %84, %82 ]
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %6) #4
  ret i1 %.lcssa
}

; 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 nounwind uwtable
declare dso_local void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

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

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

attributes #0 = { 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 #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 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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