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

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

; 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 @_ZN16MACVelocityField4setUEiiid(ptr noundef nonnull align 8 dereferenceable(148), i32 noundef, i32 noundef, i32 noundef, double noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16MACVelocityField4setVEiiid(ptr noundef nonnull align 8 dereferenceable(148), i32 noundef, i32 noundef, i32 noundef, double noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16MACVelocityField4setWEiiid(ptr noundef nonnull align 8 dereferenceable(148), i32 noundef, i32 noundef, i32 noundef, double noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16MACVelocityField33_resetExtrapolatedFluidVelocitiesER17FluidMaterialGrid(ptr noundef nonnull align 8 dereferenceable(148) %0, ptr noundef nonnull align 8 dereferenceable(88) %1) #1 align 2 {
  %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 i32, align 4
  %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
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %56, %2
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 3
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = icmp slt i32 %17, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %59

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %52, %22
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 2
  %26 = load i32, ptr %25, align 8, !tbaa !17
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %55

29:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %48, %29
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !18
  %34 = add nsw i32 %33, 1
  %35 = icmp slt i32 %31, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %30
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %51

37:                                               ; preds = %30
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = call noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidUEiii(ptr noundef nonnull align 8 dereferenceable(88) %38, i32 noundef %39, i32 noundef %40, i32 noundef %41)
  br i1 %42, label %47, label %43

43:                                               ; preds = %37
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN16MACVelocityField4setUEiiid(ptr noundef nonnull align 8 dereferenceable(148) %15, i32 noundef %44, i32 noundef %45, i32 noundef %46, double noundef 0.000000e+00)
  br label %47

47:                                               ; preds = %43, %37
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %8, align 4, !tbaa !9
  br label %30, !llvm.loop !19

51:                                               ; preds = %36
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %7, align 4, !tbaa !9
  br label %23, !llvm.loop !21

55:                                               ; preds = %28
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %5, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !9
  br label %16, !llvm.loop !22

59:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %100, %59
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 3
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = icmp slt i32 %61, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %60
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %103

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

67:                                               ; preds = %96, %66
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 2
  %70 = load i32, ptr %69, align 8, !tbaa !17
  %71 = add nsw i32 %70, 1
  %72 = icmp slt i32 %68, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %67
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %99

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

75:                                               ; preds = %92, %74
  %76 = load i32, ptr %11, align 4, !tbaa !9
  %77 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !18
  %79 = icmp slt i32 %76, %78
  br i1 %79, label %81, label %80

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

81:                                               ; preds = %75
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = load i32, ptr %9, align 4, !tbaa !9
  %86 = call noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidVEiii(ptr noundef nonnull align 8 dereferenceable(88) %82, i32 noundef %83, i32 noundef %84, i32 noundef %85)
  br i1 %86, label %91, label %87

87:                                               ; preds = %81
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN16MACVelocityField4setVEiiid(ptr noundef nonnull align 8 dereferenceable(148) %15, i32 noundef %88, i32 noundef %89, i32 noundef %90, double noundef 0.000000e+00)
  br label %91

91:                                               ; preds = %87, %81
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %11, align 4, !tbaa !9
  br label %75, !llvm.loop !23

95:                                               ; preds = %80
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %10, align 4, !tbaa !9
  br label %67, !llvm.loop !24

99:                                               ; preds = %73
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %9, align 4, !tbaa !9
  br label %60, !llvm.loop !25

103:                                              ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %144, %103
  %105 = load i32, ptr %12, align 4, !tbaa !9
  %106 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 3
  %107 = load i32, ptr %106, align 4, !tbaa !11
  %108 = add nsw i32 %107, 1
  %109 = icmp slt i32 %105, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %104
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %147

111:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %112

112:                                              ; preds = %140, %111
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 2
  %115 = load i32, ptr %114, align 8, !tbaa !17
  %116 = icmp slt i32 %113, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %112
  store i32 23, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %143

118:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %136, %118
  %120 = load i32, ptr %14, align 4, !tbaa !9
  %121 = getelementptr inbounds %class.MACVelocityField, ptr %15, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !18
  %123 = icmp slt i32 %120, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  store i32 26, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %139

125:                                              ; preds = %119
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = load i32, ptr %13, align 4, !tbaa !9
  %129 = load i32, ptr %12, align 4, !tbaa !9
  %130 = call noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidWEiii(ptr noundef nonnull align 8 dereferenceable(88) %126, i32 noundef %127, i32 noundef %128, i32 noundef %129)
  br i1 %130, label %135, label %131

131:                                              ; preds = %125
  %132 = load i32, ptr %14, align 4, !tbaa !9
  %133 = load i32, ptr %13, align 4, !tbaa !9
  %134 = load i32, ptr %12, align 4, !tbaa !9
  call void @_ZN16MACVelocityField4setWEiiid(ptr noundef nonnull align 8 dereferenceable(148) %15, i32 noundef %132, i32 noundef %133, i32 noundef %134, double noundef 0.000000e+00)
  br label %135

135:                                              ; preds = %131, %125
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %14, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %14, align 4, !tbaa !9
  br label %119, !llvm.loop !26

139:                                              ; preds = %124
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %13, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %13, align 4, !tbaa !9
  br label %112, !llvm.loop !27

143:                                              ; preds = %117
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %12, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %12, align 4, !tbaa !9
  br label %104, !llvm.loop !28

147:                                              ; preds = %110
  ret void
}

declare noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidUEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) #2

declare noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidVEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) #2

declare noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidWEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) #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 = { "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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"_ZTS16MACVelocityField", !13, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !14, i64 16, !15, i64 24, !15, i64 64, !15, i64 104, !10, i64 144}
!13 = !{!"float", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTS7Array3dIfE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !16, i64 24, !13, i64 28, !10, i64 32}
!16 = !{!"bool", !7, i64 0}
!17 = !{!12, !10, i64 8}
!18 = !{!12, !10, i64 4}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !20}
!27 = distinct !{!27, !20}
!28 = distinct !{!28, !20}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16MACVelocityField4setUEiiid(ptr noundef nonnull align 8 dereferenceable(148), i32 noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16MACVelocityField4setVEiiid(ptr noundef nonnull align 8 dereferenceable(148), i32 noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16MACVelocityField4setWEiiid(ptr noundef nonnull align 8 dereferenceable(148), i32 noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16MACVelocityField33_resetExtrapolatedFluidVelocitiesER17FluidMaterialGrid(ptr noundef nonnull align 8 dereferenceable(148) %0, ptr noundef nonnull align 8 dereferenceable(88) %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 12
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.preheader55.lr.ph, label %.preheader50

.preheader55.lr.ph:                               ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %6, align 8, !tbaa !15
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.preheader55, label %.preheader52.lr.ph

.preheader55:                                     ; preds = %.preheader55.lr.ph, %._crit_edge59
  %10 = phi i32 [ %24, %._crit_edge59 ], [ %4, %.preheader55.lr.ph ]
  %11 = phi i32 [ %25, %._crit_edge59 ], [ %8, %.preheader55.lr.ph ]
  %12 = phi i32 [ %26, %._crit_edge59 ], [ %8, %.preheader55.lr.ph ]
  %.04660 = phi i32 [ %27, %._crit_edge59 ], [ 0, %.preheader55.lr.ph ]
  %13 = icmp slt i32 %12, 1
  %14 = load i32, ptr %7, align 4
  %15 = icmp slt i32 %14, 0
  %or.cond = select i1 %13, i1 true, i1 %15
  br i1 %or.cond, label %._crit_edge59, label %.preheader54

.preheader53:                                     ; preds = %._crit_edge59
  %16 = icmp sgt i32 %24, 0
  br i1 %16, label %.preheader52.lr.ph, label %.preheader50

.preheader52.lr.ph:                               ; preds = %.preheader55.lr.ph, %.preheader53
  %17 = phi i32 [ %24, %.preheader53 ], [ %4, %.preheader55.lr.ph ]
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = getelementptr inbounds i8, ptr %0, i64 4
  %20 = load i32, ptr %18, align 8, !tbaa !15
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %.preheader49.lr.ph, label %.preheader52

.preheader54:                                     ; preds = %.preheader55, %._crit_edge
  %22 = phi i32 [ %29, %._crit_edge ], [ %11, %.preheader55 ]
  %23 = phi i32 [ %30, %._crit_edge ], [ %14, %.preheader55 ]
  %.04558 = phi i32 [ %31, %._crit_edge ], [ 0, %.preheader55 ]
  %.not4856 = icmp slt i32 %23, 0
  br i1 %.not4856, label %._crit_edge, label %.lr.ph

._crit_edge59.loopexit83:                         ; preds = %._crit_edge
  %.pre85 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge59

._crit_edge59:                                    ; preds = %._crit_edge59.loopexit83, %.preheader55
  %24 = phi i32 [ %.pre85, %._crit_edge59.loopexit83 ], [ %10, %.preheader55 ]
  %25 = phi i32 [ %29, %._crit_edge59.loopexit83 ], [ %11, %.preheader55 ]
  %26 = phi i32 [ %29, %._crit_edge59.loopexit83 ], [ %12, %.preheader55 ]
  %27 = add nuw nsw i32 %.04660, 1
  %28 = icmp slt i32 %27, %24
  br i1 %28, label %.preheader55, label %.preheader53, !llvm.loop !16

._crit_edge.loopexit:                             ; preds = %35
  %.pre = load i32, ptr %6, align 8, !tbaa !15
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader54
  %29 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %22, %.preheader54 ]
  %30 = phi i32 [ %37, %._crit_edge.loopexit ], [ %23, %.preheader54 ]
  %31 = add nuw nsw i32 %.04558, 1
  %32 = icmp slt i32 %31, %29
  br i1 %32, label %.preheader54, label %._crit_edge59.loopexit83, !llvm.loop !19

.lr.ph:                                           ; preds = %.preheader54, %35
  %.04457 = phi i32 [ %36, %35 ], [ 0, %.preheader54 ]
  %33 = tail call noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidUEiii(ptr noundef nonnull align 8 dereferenceable(88) %1, i32 noundef %.04457, i32 noundef %.04558, i32 noundef %.04660)
  br i1 %33, label %35, label %34

34:                                               ; preds = %.lr.ph
  tail call void @_ZN16MACVelocityField4setUEiiid(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %.04457, i32 noundef %.04558, i32 noundef %.04660, double noundef 0.000000e+00)
  br label %35

35:                                               ; preds = %.lr.ph, %34
  %36 = add nuw nsw i32 %.04457, 1
  %37 = load i32, ptr %7, align 4, !tbaa !20
  %.not48.not = icmp slt i32 %.04457, %37
  br i1 %.not48.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !21

.preheader52:                                     ; preds = %.preheader52.lr.ph, %._crit_edge67
  %38 = phi i32 [ %52, %._crit_edge67 ], [ %17, %.preheader52.lr.ph ]
  %39 = phi i32 [ %53, %._crit_edge67 ], [ %20, %.preheader52.lr.ph ]
  %40 = phi i32 [ %54, %._crit_edge67 ], [ %20, %.preheader52.lr.ph ]
  %.04368 = phi i32 [ %55, %._crit_edge67 ], [ 0, %.preheader52.lr.ph ]
  %.not4765 = icmp sgt i32 %40, -1
  %41 = load i32, ptr %19, align 4
  %42 = icmp sgt i32 %41, 0
  %or.cond101 = select i1 %.not4765, i1 %42, i1 false
  br i1 %or.cond101, label %.preheader51, label %._crit_edge67

.preheader50:                                     ; preds = %._crit_edge67, %2, %.preheader53
  %43 = phi i32 [ %24, %.preheader53 ], [ %4, %2 ], [ %52, %._crit_edge67 ]
  %.not75 = icmp slt i32 %43, 0
  br i1 %.not75, label %._crit_edge78, label %.preheader49.lr.ph

.preheader49.lr.ph:                               ; preds = %.preheader52.lr.ph, %.preheader50
  %44 = phi i32 [ %43, %.preheader50 ], [ %17, %.preheader52.lr.ph ]
  %45 = getelementptr inbounds i8, ptr %0, i64 8
  %46 = getelementptr inbounds i8, ptr %0, i64 4
  %47 = load i32, ptr %45, align 8, !tbaa !15
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.preheader49, label %._crit_edge78

.preheader51:                                     ; preds = %.preheader52, %._crit_edge64
  %49 = phi i32 [ %57, %._crit_edge64 ], [ %39, %.preheader52 ]
  %50 = phi i32 [ %58, %._crit_edge64 ], [ %41, %.preheader52 ]
  %.04266 = phi i32 [ %59, %._crit_edge64 ], [ 0, %.preheader52 ]
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph63, label %._crit_edge64

._crit_edge67.loopexit:                           ; preds = %._crit_edge64
  %.pre87 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge67

._crit_edge67:                                    ; preds = %._crit_edge67.loopexit, %.preheader52
  %52 = phi i32 [ %.pre87, %._crit_edge67.loopexit ], [ %38, %.preheader52 ]
  %53 = phi i32 [ %57, %._crit_edge67.loopexit ], [ %39, %.preheader52 ]
  %54 = phi i32 [ %57, %._crit_edge67.loopexit ], [ %40, %.preheader52 ]
  %55 = add nuw nsw i32 %.04368, 1
  %56 = icmp slt i32 %55, %52
  br i1 %56, label %.preheader52, label %.preheader50, !llvm.loop !22

._crit_edge64.loopexit:                           ; preds = %62
  %.pre86 = load i32, ptr %18, align 8, !tbaa !15
  br label %._crit_edge64

._crit_edge64:                                    ; preds = %._crit_edge64.loopexit, %.preheader51
  %57 = phi i32 [ %.pre86, %._crit_edge64.loopexit ], [ %49, %.preheader51 ]
  %58 = phi i32 [ %64, %._crit_edge64.loopexit ], [ %50, %.preheader51 ]
  %59 = add nuw nsw i32 %.04266, 1
  %.not47.not = icmp slt i32 %.04266, %57
  br i1 %.not47.not, label %.preheader51, label %._crit_edge67.loopexit, !llvm.loop !23

.lr.ph63:                                         ; preds = %.preheader51, %62
  %.04162 = phi i32 [ %63, %62 ], [ 0, %.preheader51 ]
  %60 = tail call noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidVEiii(ptr noundef nonnull align 8 dereferenceable(88) %1, i32 noundef %.04162, i32 noundef %.04266, i32 noundef %.04368)
  br i1 %60, label %62, label %61

61:                                               ; preds = %.lr.ph63
  tail call void @_ZN16MACVelocityField4setVEiiid(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %.04162, i32 noundef %.04266, i32 noundef %.04368, double noundef 0.000000e+00)
  br label %62

62:                                               ; preds = %.lr.ph63, %61
  %63 = add nuw nsw i32 %.04162, 1
  %64 = load i32, ptr %19, align 4, !tbaa !20
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %.lr.ph63, label %._crit_edge64.loopexit, !llvm.loop !24

.preheader49:                                     ; preds = %.preheader49.lr.ph, %._crit_edge74
  %66 = phi i32 [ %75, %._crit_edge74 ], [ %44, %.preheader49.lr.ph ]
  %67 = phi i32 [ %76, %._crit_edge74 ], [ %47, %.preheader49.lr.ph ]
  %68 = phi i32 [ %77, %._crit_edge74 ], [ %47, %.preheader49.lr.ph ]
  %.04076 = phi i32 [ %78, %._crit_edge74 ], [ 0, %.preheader49.lr.ph ]
  %69 = icmp sgt i32 %68, 0
  %70 = load i32, ptr %46, align 4
  %71 = icmp sgt i32 %70, 0
  %or.cond103 = select i1 %69, i1 %71, i1 false
  br i1 %or.cond103, label %.preheader, label %._crit_edge74

._crit_edge78:                                    ; preds = %._crit_edge74, %.preheader49.lr.ph, %.preheader50
  ret void

.preheader:                                       ; preds = %.preheader49, %._crit_edge72
  %72 = phi i32 [ %79, %._crit_edge72 ], [ %67, %.preheader49 ]
  %73 = phi i32 [ %80, %._crit_edge72 ], [ %70, %.preheader49 ]
  %.03973 = phi i32 [ %81, %._crit_edge72 ], [ 0, %.preheader49 ]
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %.lr.ph71, label %._crit_edge72

._crit_edge74.loopexit:                           ; preds = %._crit_edge72
  %.pre89 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge74

._crit_edge74:                                    ; preds = %._crit_edge74.loopexit, %.preheader49
  %75 = phi i32 [ %.pre89, %._crit_edge74.loopexit ], [ %66, %.preheader49 ]
  %76 = phi i32 [ %79, %._crit_edge74.loopexit ], [ %67, %.preheader49 ]
  %77 = phi i32 [ %79, %._crit_edge74.loopexit ], [ %68, %.preheader49 ]
  %78 = add nuw nsw i32 %.04076, 1
  %.not.not = icmp slt i32 %.04076, %75
  br i1 %.not.not, label %.preheader49, label %._crit_edge78, !llvm.loop !25

._crit_edge72.loopexit:                           ; preds = %85
  %.pre88 = load i32, ptr %45, align 8, !tbaa !15
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit, %.preheader
  %79 = phi i32 [ %.pre88, %._crit_edge72.loopexit ], [ %72, %.preheader ]
  %80 = phi i32 [ %87, %._crit_edge72.loopexit ], [ %73, %.preheader ]
  %81 = add nuw nsw i32 %.03973, 1
  %82 = icmp slt i32 %81, %79
  br i1 %82, label %.preheader, label %._crit_edge74.loopexit, !llvm.loop !26

.lr.ph71:                                         ; preds = %.preheader, %85
  %.070 = phi i32 [ %86, %85 ], [ 0, %.preheader ]
  %83 = tail call noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidWEiii(ptr noundef nonnull align 8 dereferenceable(88) %1, i32 noundef %.070, i32 noundef %.03973, i32 noundef %.04076)
  br i1 %83, label %85, label %84

84:                                               ; preds = %.lr.ph71
  tail call void @_ZN16MACVelocityField4setWEiiid(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %.070, i32 noundef %.03973, i32 noundef %.04076, double noundef 0.000000e+00)
  br label %85

85:                                               ; preds = %.lr.ph71, %84
  %86 = add nuw nsw i32 %.070, 1
  %87 = load i32, ptr %46, align 4, !tbaa !20
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %.lr.ph71, label %._crit_edge72.loopexit, !llvm.loop !27
}

declare noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidUEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidVEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN17FluidMaterialGrid21isFaceBorderingFluidWEiii(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #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 = { "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" }

!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, !10, i64 12}
!6 = !{!"_ZTS16MACVelocityField", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !11, i64 16, !12, i64 24, !12, i64 64, !12, i64 104, !10, i64 144}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"_ZTS7Array3dIfE", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !14, i64 24, !7, i64 28, !10, i64 32}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!6, !10, i64 8}
!16 = distinct !{!16, !17, !18}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !17, !18}
!20 = !{!6, !10, i64 4}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17, !18}
!23 = distinct !{!23, !17, !18}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17, !18}
!26 = distinct !{!26, !17, !18}
!27 = distinct !{!27, !17}


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