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

; 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.Array3d.0 = type { i32, i32, i32, ptr, i8, [3 x i8], %struct.Brick, i32 }
%struct.Brick = type <{ float, i8, [3 x i8] }>
%class.Array3d.29 = type { i32, i32, i32, ptr, i8, i8, i32 }
%class.Array3d.27 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, i32, [4 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 }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Array3dI5BrickED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

; 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 @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIbEclEiii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dI5BrickEaSERKS1_(ptr dead_on_unwind noalias writable sret(%class.Array3d.0) align 8, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14FluidBrickGrid38_initializeBrickGridQueueFromSaveStateER23FluidBrickGridSaveState(ptr noundef nonnull align 8 dereferenceable(353) %0, ptr noundef nonnull align 8 dereferenceable(625) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %class.Array3d.0, align 8
  %10 = alloca %class.Array3d.0, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %class.Array3d.29, align 8
  %14 = alloca %class.Array3d.27, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN23FluidBrickGridSaveState22getBrickGridDimensionsEPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(625) %22, ptr noundef %5, ptr noundef %6, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %38, %2
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 9
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %45

29:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #4
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = load i32, ptr %7, align 4, !tbaa !9
  call void @_ZN7Array3dI5BrickEC2Eiii(ptr noundef nonnull align 8 dereferenceable(40) %10, i32 noundef %30, i32 noundef %31, i32 noundef %32)
  %33 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 8
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [3 x %class.Array3d.0], ptr %33, i64 0, i64 %35
  invoke void @_ZN7Array3dI5BrickEaSERKS1_(ptr dead_on_unwind writable sret(%class.Array3d.0) align 8 %9, ptr noundef nonnull align 8 dereferenceable(40) %36, ptr noundef nonnull align 8 dereferenceable(40) %10)
          to label %37 unwind label %41

37:                                               ; preds = %29
  call void @_ZN7Array3dI5BrickED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #4
  call void @_ZN7Array3dI5BrickED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #4
  br label %38

38:                                               ; preds = %37
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %8, align 4, !tbaa !9
  br label %23, !llvm.loop !22

41:                                               ; preds = %29
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %11, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %12, align 4
  call void @_ZN7Array3dI5BrickED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %138

45:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #4
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = load i32, ptr %7, align 4, !tbaa !9
  call void @_ZN7Array3dIbEC2Eiii(ptr noundef nonnull align 8 dereferenceable(32) %13, i32 noundef %46, i32 noundef %47, i32 noundef %48)
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #4
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = load i32, ptr %7, align 4, !tbaa !9
  invoke void @_ZN7Array3dIfEC2Eiii(ptr noundef nonnull align 8 dereferenceable(36) %14, i32 noundef %49, i32 noundef %50, i32 noundef %51)
          to label %52 unwind label %59

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %132, %52
  %54 = load i32, ptr %16, align 4, !tbaa !9
  %55 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 9
  %56 = load i32, ptr %55, align 8, !tbaa !11
  %57 = icmp slt i32 %54, %56
  br i1 %57, label %63, label %58

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

59:                                               ; preds = %45
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %11, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %12, align 4
  br label %137

63:                                               ; preds = %53
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load i32, ptr %16, align 4, !tbaa !9
  invoke void @_ZN23FluidBrickGridSaveState20getBrickActivityGridER7Array3dIbEi(ptr noundef nonnull align 8 dereferenceable(625) %64, ptr noundef nonnull align 8 dereferenceable(32) %13, i32 noundef %65)
          to label %66 unwind label %75

66:                                               ; preds = %63
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = load i32, ptr %16, align 4, !tbaa !9
  invoke void @_ZN23FluidBrickGridSaveState21getBrickIntensityGridER7Array3dIfEi(ptr noundef nonnull align 8 dereferenceable(625) %67, ptr noundef nonnull align 8 dereferenceable(36) %14, i32 noundef %68)
          to label %69 unwind label %75

69:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %128, %69
  %71 = load i32, ptr %18, align 4, !tbaa !9
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %79, label %74

74:                                               ; preds = %70
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %131

75:                                               ; preds = %66, %63
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %11, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %12, align 4
  br label %135

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

80:                                               ; preds = %124, %79
  %81 = load i32, ptr %19, align 4, !tbaa !9
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %127

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

86:                                               ; preds = %116, %85
  %87 = load i32, ptr %20, align 4, !tbaa !9
  %88 = load i32, ptr %5, align 4, !tbaa !9
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 14, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %123

91:                                               ; preds = %86
  %92 = getelementptr inbounds %class.FluidBrickGrid, ptr %21, i32 0, i32 8
  %93 = load i32, ptr %16, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [3 x %class.Array3d.0], ptr %92, i64 0, i64 %94
  %96 = load i32, ptr %20, align 4, !tbaa !9
  %97 = load i32, ptr %19, align 4, !tbaa !9
  %98 = load i32, ptr %18, align 4, !tbaa !9
  %99 = invoke noundef ptr @_ZN7Array3dI5BrickE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(40) %95, i32 noundef %96, i32 noundef %97, i32 noundef %98)
          to label %100 unwind label %119

100:                                              ; preds = %91
  store ptr %99, ptr %15, align 8, !tbaa !5
  %101 = load i32, ptr %20, align 4, !tbaa !9
  %102 = load i32, ptr %19, align 4, !tbaa !9
  %103 = load i32, ptr %18, align 4, !tbaa !9
  %104 = invoke noundef zeroext i1 @_ZN7Array3dIbEclEiii(ptr noundef nonnull align 8 dereferenceable(32) %13, i32 noundef %101, i32 noundef %102, i32 noundef %103)
          to label %105 unwind label %119

105:                                              ; preds = %100
  %106 = load ptr, ptr %15, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.Brick, ptr %106, i32 0, i32 1
  %108 = zext i1 %104 to i8
  store i8 %108, ptr %107, align 4, !tbaa !24
  %109 = load i32, ptr %20, align 4, !tbaa !9
  %110 = load i32, ptr %19, align 4, !tbaa !9
  %111 = load i32, ptr %18, align 4, !tbaa !9
  %112 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %14, i32 noundef %109, i32 noundef %110, i32 noundef %111)
          to label %113 unwind label %119

113:                                              ; preds = %105
  %114 = load ptr, ptr %15, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.Brick, ptr %114, i32 0, i32 0
  store float %112, ptr %115, align 4, !tbaa !25
  br label %116

116:                                              ; preds = %113
  %117 = load i32, ptr %20, align 4, !tbaa !9
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %20, align 4, !tbaa !9
  br label %86, !llvm.loop !26

119:                                              ; preds = %105, %100, %91
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %11, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %135

123:                                              ; preds = %90
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %19, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %19, align 4, !tbaa !9
  br label %80, !llvm.loop !27

127:                                              ; preds = %84
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %18, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %18, align 4, !tbaa !9
  br label %70, !llvm.loop !28

131:                                              ; preds = %74
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %16, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %16, align 4, !tbaa !9
  br label %53, !llvm.loop !29

135:                                              ; preds = %119, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %14) #4
  br label %137

136:                                              ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %14) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #4
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void

137:                                              ; preds = %135, %59
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #4
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  br label %138

138:                                              ; preds = %137, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %139

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #0 align 2

declare void @_ZN23FluidBrickGridSaveState22getBrickGridDimensionsEPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef, ptr noundef, ptr noundef) #3

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

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

declare void @_ZN23FluidBrickGridSaveState20getBrickActivityGridER7Array3dIbEi(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #3

declare void @_ZN23FluidBrickGridSaveState21getBrickIntensityGridER7Array3dIfEi(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36), i32 noundef) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = !{!"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, !10, i64 272}
!12 = !{!"_ZTS14FluidBrickGrid", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !14, i64 24, !17, i64 64, !20, i64 112, !7, i64 152, !10, i64 272, !20, i64 280, !18, i64 320, !10, i64 324, !10, i64 328, !16, i64 332, !16, i64 336, !16, i64 340, !10, i64 344, !10, i64 348, !18, i64 352}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS4AABB", !15, i64 0, !13, i64 16, !13, i64 24, !13, i64 32}
!15 = !{!"_ZTSN5vmath4vec3E", !16, i64 0, !16, i64 4, !16, i64 8}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTS7Array3dIN14FluidBrickGrid11DensityNodeEE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !18, i64 24, !19, i64 28, !10, i64 40}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTSN14FluidBrickGrid11DensityNodeE", !16, i64 0, !16, i64 4, !16, i64 8}
!20 = !{!"_ZTS7Array3dI5BrickE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !18, i64 24, !21, i64 28, !10, i64 36}
!21 = !{!"_ZTS5Brick", !16, i64 0, !18, i64 4}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!21, !18, i64 4}
!25 = !{!21, !16, i64 0}
!26 = distinct !{!26, !23}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23}
!29 = distinct !{!29, !23}


; 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.Array3d.0 = type { i32, i32, i32, ptr, i8, [3 x i8], %struct.Brick, i32 }
%struct.Brick = type <{ float, i8, [3 x i8] }>
%class.Array3d.29 = type { i32, i32, i32, ptr, i8, i8, i32 }
%class.Array3d.27 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Array3dI5BrickED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0 align 2

; 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 @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIbEclEiii(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dI5BrickEaSERKS1_(ptr dead_on_unwind noalias writable sret(%class.Array3d.0) align 8, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14FluidBrickGrid38_initializeBrickGridQueueFromSaveStateER23FluidBrickGridSaveState(ptr noundef nonnull align 8 dereferenceable(353) %0, ptr noundef nonnull align 8 dereferenceable(625) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %class.Array3d.0, align 8
  %7 = alloca %class.Array3d.0, align 8
  %8 = alloca %class.Array3d.29, align 8
  %9 = alloca %class.Array3d.27, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  call void @_ZN23FluidBrickGridSaveState22getBrickGridDimensionsEPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(625) %1, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %10 = getelementptr inbounds i8, ptr %0, i64 272
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %13 = getelementptr inbounds i8, ptr %0, i64 152
  br label %23

._crit_edge:                                      ; preds = %28, %2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #4
  %14 = load i32, ptr %3, align 4, !tbaa !20
  %15 = load i32, ptr %4, align 4, !tbaa !20
  %16 = load i32, ptr %5, align 4, !tbaa !20
  call void @_ZN7Array3dIbEC2Eiii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %14, i32 noundef %15, i32 noundef %16)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #4
  %17 = load i32, ptr %3, align 4, !tbaa !20
  %18 = load i32, ptr %4, align 4, !tbaa !20
  %19 = load i32, ptr %5, align 4, !tbaa !20
  invoke void @_ZN7Array3dIfEC2Eiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %17, i32 noundef %18, i32 noundef %19)
          to label %.preheader44 unwind label %34

.preheader44:                                     ; preds = %._crit_edge
  %20 = load i32, ptr %10, align 8, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph56, label %._crit_edge57

.lr.ph56:                                         ; preds = %.preheader44
  %22 = getelementptr inbounds i8, ptr %0, i64 152
  br label %36

23:                                               ; preds = %.lr.ph, %28
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %28 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #4
  %24 = load i32, ptr %3, align 4, !tbaa !20
  %25 = load i32, ptr %4, align 4, !tbaa !20
  %26 = load i32, ptr %5, align 4, !tbaa !20
  call void @_ZN7Array3dI5BrickEC2Eiii(ptr noundef nonnull align 8 dereferenceable(40) %7, i32 noundef %24, i32 noundef %25, i32 noundef %26)
  %27 = getelementptr inbounds [3 x %class.Array3d.0], ptr %13, i64 0, i64 %indvars.iv
  invoke void @_ZN7Array3dI5BrickEaSERKS1_(ptr dead_on_unwind nonnull writable sret(%class.Array3d.0) align 8 %6, ptr noundef nonnull align 8 dereferenceable(40) %27, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %28 unwind label %32

28:                                               ; preds = %23
  call void @_ZN7Array3dI5BrickED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #4
  call void @_ZN7Array3dI5BrickED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %10, align 8, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %23, label %._crit_edge, !llvm.loop !21

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7Array3dI5BrickED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #4
  br label %82

._crit_edge57:                                    ; preds = %._crit_edge54, %.preheader44
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #4
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  ret void

34:                                               ; preds = %._crit_edge
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %81

36:                                               ; preds = %.lr.ph56, %._crit_edge54
  %indvars.iv61 = phi i64 [ 0, %.lr.ph56 ], [ %indvars.iv.next62, %._crit_edge54 ]
  %37 = trunc nuw nsw i64 %indvars.iv61 to i32
  invoke void @_ZN23FluidBrickGridSaveState20getBrickActivityGridER7Array3dIbEi(ptr noundef nonnull align 8 dereferenceable(625) %1, ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %37)
          to label %38 unwind label %53

38:                                               ; preds = %36
  invoke void @_ZN23FluidBrickGridSaveState21getBrickIntensityGridER7Array3dIfEi(ptr noundef nonnull align 8 dereferenceable(625) %1, ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %37)
          to label %.preheader43 unwind label %53

.preheader43:                                     ; preds = %38
  %39 = load i32, ptr %5, align 4, !tbaa !20
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.preheader42.lr.ph, label %._crit_edge54

.preheader42.lr.ph:                               ; preds = %.preheader43
  %41 = getelementptr inbounds [3 x %class.Array3d.0], ptr %22, i64 0, i64 %indvars.iv61
  %42 = load i32, ptr %4, align 4, !tbaa !20
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.preheader42, label %._crit_edge54

.preheader42:                                     ; preds = %.preheader42.lr.ph, %._crit_edge51
  %44 = phi i32 [ %58, %._crit_edge51 ], [ %39, %.preheader42.lr.ph ]
  %45 = phi i32 [ %59, %._crit_edge51 ], [ %42, %.preheader42.lr.ph ]
  %46 = phi i32 [ %60, %._crit_edge51 ], [ %42, %.preheader42.lr.ph ]
  %.03152 = phi i32 [ %61, %._crit_edge51 ], [ 0, %.preheader42.lr.ph ]
  %47 = icmp sgt i32 %46, 0
  %48 = load i32, ptr %3, align 4
  %49 = icmp sgt i32 %48, 0
  %or.cond = select i1 %47, i1 %49, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge51

._crit_edge54:                                    ; preds = %._crit_edge51, %.preheader42.lr.ph, %.preheader43
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %50 = load i32, ptr %10, align 8, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv.next62, %51
  br i1 %52, label %36, label %._crit_edge57, !llvm.loop !23

53:                                               ; preds = %38, %36
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %80

.preheader:                                       ; preds = %.preheader42, %._crit_edge49
  %55 = phi i32 [ %63, %._crit_edge49 ], [ %45, %.preheader42 ]
  %56 = phi i32 [ %64, %._crit_edge49 ], [ %48, %.preheader42 ]
  %.03050 = phi i32 [ %65, %._crit_edge49 ], [ 0, %.preheader42 ]
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph48, label %._crit_edge49

._crit_edge51.loopexit:                           ; preds = %._crit_edge49
  %.pre64 = load i32, ptr %5, align 4, !tbaa !20
  br label %._crit_edge51

._crit_edge51:                                    ; preds = %._crit_edge51.loopexit, %.preheader42
  %58 = phi i32 [ %.pre64, %._crit_edge51.loopexit ], [ %44, %.preheader42 ]
  %59 = phi i32 [ %63, %._crit_edge51.loopexit ], [ %45, %.preheader42 ]
  %60 = phi i32 [ %63, %._crit_edge51.loopexit ], [ %46, %.preheader42 ]
  %61 = add nuw nsw i32 %.03152, 1
  %62 = icmp slt i32 %61, %58
  br i1 %62, label %.preheader42, label %._crit_edge54, !llvm.loop !24

._crit_edge49.loopexit:                           ; preds = %74
  %.pre = load i32, ptr %4, align 4, !tbaa !20
  br label %._crit_edge49

._crit_edge49:                                    ; preds = %._crit_edge49.loopexit, %.preheader
  %63 = phi i32 [ %.pre, %._crit_edge49.loopexit ], [ %55, %.preheader ]
  %64 = phi i32 [ %76, %._crit_edge49.loopexit ], [ %56, %.preheader ]
  %65 = add nuw nsw i32 %.03050, 1
  %66 = icmp slt i32 %65, %63
  br i1 %66, label %.preheader, label %._crit_edge51.loopexit, !llvm.loop !26

.lr.ph48:                                         ; preds = %.preheader, %74
  %.047 = phi i32 [ %75, %74 ], [ 0, %.preheader ]
  %67 = invoke noundef ptr @_ZN7Array3dI5BrickE10getPointerEiii(ptr noundef nonnull align 8 dereferenceable(40) %41, i32 noundef %.047, i32 noundef %.03050, i32 noundef %.03152)
          to label %68 unwind label %78

68:                                               ; preds = %.lr.ph48
  %69 = invoke noundef zeroext i1 @_ZN7Array3dIbEclEiii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %.047, i32 noundef %.03050, i32 noundef %.03152)
          to label %70 unwind label %78

70:                                               ; preds = %68
  %71 = getelementptr inbounds i8, ptr %67, i64 4
  %72 = zext i1 %69 to i8
  store i8 %72, ptr %71, align 4, !tbaa !27
  %73 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %.047, i32 noundef %.03050, i32 noundef %.03152)
          to label %74 unwind label %78

74:                                               ; preds = %70
  store float %73, ptr %67, align 4, !tbaa !28
  %75 = add nuw nsw i32 %.047, 1
  %76 = load i32, ptr %3, align 4, !tbaa !20
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %.lr.ph48, label %._crit_edge49.loopexit, !llvm.loop !29

78:                                               ; preds = %70, %68, %.lr.ph48
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %80

80:                                               ; preds = %78, %53
  %.pn = phi { ptr, i32 } [ %79, %78 ], [ %54, %53 ]
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %9) #4
  br label %81

81:                                               ; preds = %80, %34
  %.pn.pn = phi { ptr, i32 } [ %.pn, %80 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #4
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #4
  br label %82

82:                                               ; preds = %81, %32
  %.pn40 = phi { ptr, i32 } [ %33, %32 ], [ %.pn.pn, %81 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn40
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #0 align 2

declare void @_ZN23FluidBrickGridSaveState22getBrickGridDimensionsEPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

declare void @_ZN23FluidBrickGridSaveState20getBrickActivityGridER7Array3dIbEi(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #3

declare void @_ZN23FluidBrickGridSaveState21getBrickIntensityGridER7Array3dIfEi(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36), i32 noundef) local_unnamed_addr #3

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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, !7, i64 272}
!6 = !{!"_ZTS14FluidBrickGrid", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !11, i64 24, !14, i64 64, !18, i64 112, !8, i64 152, !7, i64 272, !18, i64 280, !16, i64 320, !7, i64 324, !7, i64 328, !13, i64 332, !13, i64 336, !13, i64 340, !7, i64 344, !7, i64 348, !16, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"_ZTS4AABB", !12, i64 0, !10, i64 16, !10, i64 24, !10, i64 32}
!12 = !{!"_ZTSN5vmath4vec3E", !13, i64 0, !13, i64 4, !13, i64 8}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_ZTS7Array3dIN14FluidBrickGrid11DensityNodeEE", !7, i64 0, !7, i64 4, !7, i64 8, !15, i64 16, !16, i64 24, !17, i64 28, !7, i64 40}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"bool", !8, i64 0}
!17 = !{!"_ZTSN14FluidBrickGrid11DensityNodeE", !13, i64 0, !13, i64 4, !13, i64 8}
!18 = !{!"_ZTS7Array3dI5BrickE", !7, i64 0, !7, i64 4, !7, i64 8, !15, i64 16, !16, i64 24, !19, i64 28, !7, i64 36}
!19 = !{!"_ZTS5Brick", !13, i64 0, !16, i64 4}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22, !25}
!25 = !{!"llvm.loop.unswitch.partial.disable"}
!26 = distinct !{!26, !22, !25}
!27 = !{!19, !16, i64 4}
!28 = !{!19, !13, i64 0}
!29 = distinct !{!29, !22}


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