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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN23FluidBrickGridSaveState20_writeBinaryArray3dfER7Array3dIfEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36), ptr noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23FluidBrickGridSaveState21_writeBinaryBrickGridEP7Array3dI5BrickEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625) %0, ptr noundef %1, ptr noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.Array3d.4, align 8
  %8 = alloca %class.Array3d.2, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.Brick, align 4
  %16 = alloca %struct.Brick, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #3
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %class.Array3d.1, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %class.Array3d.1, ptr %21, i32 0, i32 1
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.Array3d.1, ptr %24, i32 0, i32 2
  %26 = load i32, ptr %25, align 8, !tbaa !16
  call void @_ZN7Array3dIbEC2Eiii(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %20, i32 noundef %23, i32 noundef %26)
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #3
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.Array3d.1, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !9
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.Array3d.1, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !15
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.Array3d.1, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 8, !tbaa !16
  invoke void @_ZN7Array3dIfEC2Eiii(ptr noundef nonnull align 8 dereferenceable(36) %8, i32 noundef %29, i32 noundef %32, i32 noundef %35)
          to label %36 unwind label %44

36:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !17
  br label %37

37:                                               ; preds = %109, %36
  %38 = load i32, ptr %11, align 4, !tbaa !17
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %class.Array3d.1, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 8, !tbaa !16
  %42 = icmp slt i32 %38, %41
  br i1 %42, label %48, label %43

43:                                               ; preds = %37
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %112

44:                                               ; preds = %3
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  br label %122

48:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %49

49:                                               ; preds = %105, %48
  %50 = load i32, ptr %13, align 4, !tbaa !17
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %class.Array3d.1, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !15
  %54 = icmp slt i32 %50, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %49
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %108

56:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i32 0, ptr %14, align 4, !tbaa !17
  br label %57

57:                                               ; preds = %92, %56
  %58 = load i32, ptr %14, align 4, !tbaa !17
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %class.Array3d.1, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !9
  %62 = icmp slt i32 %58, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %57
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %104

64:                                               ; preds = %57
  %65 = load i32, ptr %14, align 4, !tbaa !17
  %66 = load i32, ptr %13, align 4, !tbaa !17
  %67 = load i32, ptr %11, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load i32, ptr %14, align 4, !tbaa !17
  %70 = load i32, ptr %13, align 4, !tbaa !17
  %71 = load i32, ptr %11, align 4, !tbaa !17
  %72 = invoke i64 @_ZN7Array3dI5BrickE3getEiii(ptr noundef nonnull align 8 dereferenceable(40) %68, i32 noundef %69, i32 noundef %70, i32 noundef %71)
          to label %73 unwind label %95

73:                                               ; preds = %64
  %74 = trunc i64 %72 to i40
  store i40 %74, ptr %15, align 4
  %75 = getelementptr inbounds %struct.Brick, ptr %15, i32 0, i32 1
  %76 = load i8, ptr %75, align 4, !tbaa !18, !range !19, !noundef !20
  %77 = trunc i8 %76 to i1
  invoke void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef %65, i32 noundef %66, i32 noundef %67, i1 noundef zeroext %77)
          to label %78 unwind label %95

78:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  %79 = load i32, ptr %14, align 4, !tbaa !17
  %80 = load i32, ptr %13, align 4, !tbaa !17
  %81 = load i32, ptr %11, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = load i32, ptr %14, align 4, !tbaa !17
  %84 = load i32, ptr %13, align 4, !tbaa !17
  %85 = load i32, ptr %11, align 4, !tbaa !17
  %86 = invoke i64 @_ZN7Array3dI5BrickE3getEiii(ptr noundef nonnull align 8 dereferenceable(40) %82, i32 noundef %83, i32 noundef %84, i32 noundef %85)
          to label %87 unwind label %99

87:                                               ; preds = %78
  %88 = trunc i64 %86 to i40
  store i40 %88, ptr %16, align 4
  %89 = getelementptr inbounds %struct.Brick, ptr %16, i32 0, i32 0
  %90 = load float, ptr %89, align 4, !tbaa !21
  invoke void @_ZN7Array3dIfE3setEiiif(ptr noundef nonnull align 8 dereferenceable(36) %8, i32 noundef %79, i32 noundef %80, i32 noundef %81, float noundef %90)
          to label %91 unwind label %99

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %14, align 4, !tbaa !17
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %14, align 4, !tbaa !17
  br label %57, !llvm.loop !22

95:                                               ; preds = %73, %64
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %9, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %103

99:                                               ; preds = %87, %78
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %9, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %103

103:                                              ; preds = %99, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %121

104:                                              ; preds = %63
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %13, align 4, !tbaa !17
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %13, align 4, !tbaa !17
  br label %49, !llvm.loop !24

108:                                              ; preds = %55
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %11, align 4, !tbaa !17
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %11, align 4, !tbaa !17
  br label %37, !llvm.loop !25

112:                                              ; preds = %43
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN23FluidBrickGridSaveState20_writeBinaryArray3dbER7Array3dIbEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625) %17, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef %113)
          to label %114 unwind label %117

114:                                              ; preds = %112
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN23FluidBrickGridSaveState20_writeBinaryArray3dfER7Array3dIfEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625) %17, ptr noundef nonnull align 8 dereferenceable(36) %8, ptr noundef %115)
          to label %116 unwind label %117

116:                                              ; preds = %114
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #3
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #3
  ret void

117:                                              ; preds = %114, %112
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %9, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %10, align 4
  br label %121

121:                                              ; preds = %117, %103
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #3
  br label %122

122:                                              ; preds = %121, %44
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #3
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #3
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr %9, align 8
  %125 = load i32, ptr %10, align 4
  %126 = insertvalue { ptr, i32 } poison, ptr %124, 0
  %127 = insertvalue { ptr, i32 } %126, i32 %125, 1
  resume { ptr, i32 } %127
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN23FluidBrickGridSaveState20_writeBinaryArray3dbER7Array3dIbEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #1 align 2

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

attributes #0 = { nocallback nofree nosync 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 = { 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 = { 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, !11, i64 0}
!10 = !{!"_ZTS7Array3dI5BrickE", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !12, i64 24, !13, i64 28, !11, i64 36}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTS5Brick", !14, i64 0, !12, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!10, !11, i64 4}
!16 = !{!10, !11, i64 8}
!17 = !{!11, !11, i64 0}
!18 = !{!13, !12, i64 4}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!13, !14, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !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.4 = type { i32, i32, i32, ptr, i8, i8, i32 }
%class.Array3d.2 = 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN23FluidBrickGridSaveState20_writeBinaryArray3dfER7Array3dIfEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(36), ptr noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23FluidBrickGridSaveState21_writeBinaryBrickGridEP7Array3dI5BrickEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.Array3d.4, align 8
  %5 = alloca %class.Array3d.2, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  %6 = load i32, ptr %1, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !15
  call void @_ZN7Array3dIbEC2Eiii(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %6, i32 noundef %8, i32 noundef %10)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #3
  %11 = load i32, ptr %1, align 8, !tbaa !5
  %12 = load i32, ptr %7, align 4, !tbaa !14
  %13 = load i32, ptr %9, align 8, !tbaa !15
  invoke void @_ZN7Array3dIfEC2Eiii(ptr noundef nonnull align 8 dereferenceable(36) %5, i32 noundef %11, i32 noundef %12, i32 noundef %13)
          to label %.preheader45 unwind label %24

.preheader45:                                     ; preds = %3
  %14 = load i32, ptr %9, align 8, !tbaa !15
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader44.lr.ph, label %._crit_edge51

.preheader44.lr.ph:                               ; preds = %.preheader45
  %16 = load i32, ptr %7, align 4, !tbaa !14
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader44, label %._crit_edge51

.preheader44:                                     ; preds = %.preheader44.lr.ph, %._crit_edge48
  %18 = phi i32 [ %29, %._crit_edge48 ], [ %14, %.preheader44.lr.ph ]
  %19 = phi i32 [ %30, %._crit_edge48 ], [ %16, %.preheader44.lr.ph ]
  %20 = phi i32 [ %31, %._crit_edge48 ], [ %16, %.preheader44.lr.ph ]
  %.03749 = phi i32 [ %32, %._crit_edge48 ], [ 0, %.preheader44.lr.ph ]
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.preheader.lr.ph, label %._crit_edge48

.preheader.lr.ph:                                 ; preds = %.preheader44
  %22 = load i32, ptr %1, align 8, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.preheader, label %._crit_edge48

._crit_edge51:                                    ; preds = %._crit_edge48, %.preheader44.lr.ph, %.preheader45
  invoke void @_ZN23FluidBrickGridSaveState20_writeBinaryArray3dbER7Array3dIbEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625) %0, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef %2)
          to label %54 unwind label %56

24:                                               ; preds = %3
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %59

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %26 = phi i32 [ %34, %._crit_edge ], [ %19, %.preheader.lr.ph ]
  %27 = phi i32 [ %35, %._crit_edge ], [ %22, %.preheader.lr.ph ]
  %.03847 = phi i32 [ %36, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge48.loopexit:                           ; preds = %._crit_edge
  %.pre54 = load i32, ptr %9, align 8, !tbaa !15
  br label %._crit_edge48

._crit_edge48:                                    ; preds = %.preheader.lr.ph, %._crit_edge48.loopexit, %.preheader44
  %29 = phi i32 [ %.pre54, %._crit_edge48.loopexit ], [ %18, %.preheader44 ], [ %18, %.preheader.lr.ph ]
  %30 = phi i32 [ %34, %._crit_edge48.loopexit ], [ %19, %.preheader44 ], [ %19, %.preheader.lr.ph ]
  %31 = phi i32 [ %34, %._crit_edge48.loopexit ], [ %20, %.preheader44 ], [ %20, %.preheader.lr.ph ]
  %32 = add nuw nsw i32 %.03749, 1
  %33 = icmp slt i32 %32, %29
  br i1 %33, label %.preheader44, label %._crit_edge51, !llvm.loop !16

._crit_edge.loopexit:                             ; preds = %46
  %.pre = load i32, ptr %7, align 4, !tbaa !14
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %34 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %26, %.preheader ]
  %35 = phi i32 [ %48, %._crit_edge.loopexit ], [ %27, %.preheader ]
  %36 = add nuw nsw i32 %.03847, 1
  %37 = icmp slt i32 %36, %34
  br i1 %37, label %.preheader, label %._crit_edge48.loopexit, !llvm.loop !19

.lr.ph:                                           ; preds = %.preheader, %46
  %.03946 = phi i32 [ %47, %46 ], [ 0, %.preheader ]
  %38 = invoke i64 @_ZN7Array3dI5BrickE3getEiii(ptr noundef nonnull align 8 dereferenceable(40) %1, i32 noundef %.03946, i32 noundef %.03847, i32 noundef %.03749)
          to label %39 unwind label %50

39:                                               ; preds = %.lr.ph
  %40 = and i64 %38, 4294967296
  %41 = icmp ne i64 %40, 0
  invoke void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %.03946, i32 noundef %.03847, i32 noundef %.03749, i1 noundef zeroext %41)
          to label %42 unwind label %50

42:                                               ; preds = %39
  %43 = invoke i64 @_ZN7Array3dI5BrickE3getEiii(ptr noundef nonnull align 8 dereferenceable(40) %1, i32 noundef %.03946, i32 noundef %.03847, i32 noundef %.03749)
          to label %44 unwind label %52

44:                                               ; preds = %42
  %.sroa.0.sroa.0.0.extract.trunc = trunc i64 %43 to i32
  %45 = bitcast i32 %.sroa.0.sroa.0.0.extract.trunc to float
  invoke void @_ZN7Array3dIfE3setEiiif(ptr noundef nonnull align 8 dereferenceable(36) %5, i32 noundef %.03946, i32 noundef %.03847, i32 noundef %.03749, float noundef %45)
          to label %46 unwind label %52

46:                                               ; preds = %44
  %47 = add nuw nsw i32 %.03946, 1
  %48 = load i32, ptr %1, align 8, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !20

50:                                               ; preds = %39, %.lr.ph
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %58

52:                                               ; preds = %44, %42
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %58

54:                                               ; preds = %._crit_edge51
  invoke void @_ZN23FluidBrickGridSaveState20_writeBinaryArray3dfER7Array3dIfEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625) %0, ptr noundef nonnull align 8 dereferenceable(36) %5, ptr noundef %2)
          to label %55 unwind label %56

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

56:                                               ; preds = %54, %._crit_edge51
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %58

58:                                               ; preds = %50, %52, %56
  %.pn.pn = phi { ptr, i32 } [ %57, %56 ], [ %53, %52 ], [ %51, %50 ]
  call void @_ZN7Array3dIfED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #3
  br label %59

59:                                               ; preds = %58, %24
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %58 ], [ %25, %24 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #3
  call void @_ZN7Array3dIbED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN23FluidBrickGridSaveState20_writeBinaryArray3dbER7Array3dIbEPSt14basic_ofstreamIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(625), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync 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 = { 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 = { 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 0}
!6 = !{!"_ZTS7Array3dI5BrickE", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !11, i64 24, !12, i64 28, !7, i64 36}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTS5Brick", !13, i64 0, !11, i64 4}
!13 = !{!"float", !8, i64 0}
!14 = !{!6, !7, i64 4}
!15 = !{!6, !7, i64 8}
!16 = distinct !{!16, !17, !18}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !17, !18}
!20 = distinct !{!20, !17}


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