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

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%struct.GridIndex = type { i32, i32, i32 }
%class.ScalarField = type { i32, i32, i32, double, double, double, double, double, double, double, double, i8, [7 x i8], %class.Array3d, %class.Array3d.0, %class.Array3d, %class.Array3d.0, i8, %"class.vmath::vec3" }
%class.Array3d = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, i32, [4 x i8] }>
%class.Array3d.0 = type { i32, i32, i32, ptr, i8, i8, i32 }
%"class.vmath::vec3" = type { float, float, float }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__._ZN11ScalarField18addCellFieldValuesEiiid = external hidden unnamed_addr constant [19 x i8], align 1

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: noreturn nounwind
declare void @abort() #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeEiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #7

; 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) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11ScalarField18addCellFieldValuesEiiid(ptr noundef nonnull align 8 dereferenceable(248) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4) #4 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca [8 x %struct.GridIndex], align 16
  %12 = alloca i32, align 4
  %13 = alloca %struct.GridIndex, align 4
  %14 = alloca { i64, i32 }, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store double %4, ptr %10, align 8, !tbaa !11
  %15 = load ptr, ptr %6, align 8
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = getelementptr inbounds %class.ScalarField, ptr %15, i32 0, i32 13
  %20 = getelementptr inbounds %class.Array3d, ptr %19, i32 0, i32 0
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = sub nsw i32 %21, 1
  %23 = getelementptr inbounds %class.ScalarField, ptr %15, i32 0, i32 13
  %24 = getelementptr inbounds %class.Array3d, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !20
  %26 = sub nsw i32 %25, 1
  %27 = getelementptr inbounds %class.ScalarField, ptr %15, i32 0, i32 13
  %28 = getelementptr inbounds %class.Array3d, ptr %27, i32 0, i32 2
  %29 = load i32, ptr %28, align 8, !tbaa !21
  %30 = sub nsw i32 %29, 1
  %31 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeEiiiiii(i32 noundef %16, i32 noundef %17, i32 noundef %18, i32 noundef %22, i32 noundef %26, i32 noundef %30)
  br i1 %31, label %42, label %32

32:                                               ; preds = %5
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef @.str.12)
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef @.str.2)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef @.str.3)
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef @.str.4)
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef @__FUNCTION__._ZN11ScalarField18addCellFieldValuesEiiid)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef @.str.5)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %39, i32 noundef 484)
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @abort() #8
  unreachable

42:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 96, ptr %11) #9
  %43 = getelementptr inbounds [8 x %struct.GridIndex], ptr %11, i32 0, i32 0
  %44 = getelementptr inbounds %struct.GridIndex, ptr %43, i64 8
  br label %45

45:                                               ; preds = %45, %42
  %46 = phi ptr [ %43, %42 ], [ %47, %45 ]
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %46)
  %47 = getelementptr inbounds %struct.GridIndex, ptr %46, i64 1
  %48 = icmp eq ptr %47, %44
  br i1 %48, label %49, label %45

49:                                               ; preds = %45
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = getelementptr inbounds [8 x %struct.GridIndex], ptr %11, i64 0, i64 0
  call void @_ZN6Grid3d20getGridIndexVerticesEiiiP9GridIndex(i32 noundef %50, i32 noundef %51, i32 noundef %52, ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %73, %49
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = icmp slt i32 %55, 8
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %76

58:                                               ; preds = %54
  %59 = getelementptr inbounds %class.ScalarField, ptr %15, i32 0, i32 13
  %60 = load i32, ptr %12, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [8 x %struct.GridIndex], ptr %11, i64 0, i64 %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %62, i64 12, i1 false), !tbaa.struct !22
  %63 = load double, ptr %10, align 8, !tbaa !11
  %64 = fptrunc double %63 to float
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %13, i64 12, i1 false)
  %65 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 0
  %66 = load i64, ptr %65, align 4
  %67 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 1
  %68 = load i32, ptr %67, align 4
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %59, i64 %66, i32 %68, float noundef %64)
  %69 = getelementptr inbounds %class.ScalarField, ptr %15, i32 0, i32 16
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %69, i32 noundef %70, i32 noundef %71, i32 noundef %72, i1 noundef zeroext true)
  br label %73

73:                                               ; preds = %58
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %12, align 4, !tbaa !9
  br label %54, !llvm.loop !23

76:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 96, ptr %11) #9
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 88}
!14 = !{!"_ZTS11ScalarField", !10, i64 0, !10, i64 4, !10, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !15, i64 80, !16, i64 88, !18, i64 128, !16, i64 160, !18, i64 200, !15, i64 232, !19, i64 236}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTS7Array3dIfE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !15, i64 24, !17, i64 28, !10, i64 32}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTS7Array3dIbE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !15, i64 24, !15, i64 25, !10, i64 28}
!19 = !{!"_ZTSN5vmath4vec3E", !17, i64 0, !17, i64 4, !17, i64 8}
!20 = !{!14, !10, i64 92}
!21 = !{!14, !10, i64 96}
!22 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%struct.GridIndex = type { i32, i32, i32 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__._ZN11ScalarField18addCellFieldValuesEiiid = external hidden unnamed_addr constant [19 x i8], align 1

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

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

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

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

; 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 #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11ScalarField18addCellFieldValuesEiiid(ptr noundef nonnull align 8 dereferenceable(248) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4) local_unnamed_addr #3 align 2 {
  %6 = alloca [8 x %struct.GridIndex], align 16
  %7 = getelementptr inbounds i8, ptr %0, i64 88
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = add nsw i32 %8, -1
  %10 = getelementptr inbounds i8, ptr %0, i64 92
  %11 = load i32, ptr %10, align 4, !tbaa !17
  %12 = add nsw i32 %11, -1
  %13 = getelementptr inbounds i8, ptr %0, i64 96
  %14 = load i32, ptr %13, align 8, !tbaa !18
  %15 = add nsw i32 %14, -1
  %16 = tail call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeEiiiiii(i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %9, i32 noundef %12, i32 noundef %15)
  br i1 %16, label %27, label %17

17:                                               ; preds = %5
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @.str.12)
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull @.str.2)
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull @.str.3)
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @.str.4)
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull @__FUNCTION__._ZN11ScalarField18addCellFieldValuesEiiid)
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @.str.5)
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef 484)
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  tail call void @abort() #7
  unreachable

27:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %6) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6)
  %.ptr.1 = getelementptr inbounds i8, ptr %6, i64 12
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %6, i64 24
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %6, i64 36
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %6, i64 48
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %6, i64 60
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5)
  %.ptr.6 = getelementptr inbounds i8, ptr %6, i64 72
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.6)
  %.ptr.7 = getelementptr inbounds i8, ptr %6, i64 84
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.7)
  call void @_ZN6Grid3d20getGridIndexVerticesEiiiP9GridIndex(i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %6)
  %28 = fptrunc double %4 to float
  %29 = getelementptr inbounds i8, ptr %0, i64 200
  %.sroa.01.0.copyload = load i64, ptr %6, align 16
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.22.0.copyload = load i32, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !19
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %7, i64 %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload, float noundef %28)
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef 0, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
  %.sroa.01.0.copyload.1 = load i64, ptr %.ptr.1, align 4
  %.sroa.22.0..sroa_idx.1 = getelementptr inbounds i8, ptr %6, i64 20
  %.sroa.22.0.copyload.1 = load i32, ptr %.sroa.22.0..sroa_idx.1, align 4, !tbaa !19
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %7, i64 %.sroa.01.0.copyload.1, i32 %.sroa.22.0.copyload.1, float noundef %28)
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef 1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
  %.sroa.01.0.copyload.2 = load i64, ptr %.ptr.2, align 8
  %.sroa.22.0..sroa_idx.2 = getelementptr inbounds i8, ptr %6, i64 32
  %.sroa.22.0.copyload.2 = load i32, ptr %.sroa.22.0..sroa_idx.2, align 16, !tbaa !19
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %7, i64 %.sroa.01.0.copyload.2, i32 %.sroa.22.0.copyload.2, float noundef %28)
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef 2, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
  %.sroa.01.0.copyload.3 = load i64, ptr %.ptr.3, align 4
  %.sroa.22.0..sroa_idx.3 = getelementptr inbounds i8, ptr %6, i64 44
  %.sroa.22.0.copyload.3 = load i32, ptr %.sroa.22.0..sroa_idx.3, align 4, !tbaa !19
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %7, i64 %.sroa.01.0.copyload.3, i32 %.sroa.22.0.copyload.3, float noundef %28)
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef 3, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
  %.sroa.01.0.copyload.4 = load i64, ptr %.ptr.4, align 16
  %.sroa.22.0..sroa_idx.4 = getelementptr inbounds i8, ptr %6, i64 56
  %.sroa.22.0.copyload.4 = load i32, ptr %.sroa.22.0..sroa_idx.4, align 8, !tbaa !19
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %7, i64 %.sroa.01.0.copyload.4, i32 %.sroa.22.0.copyload.4, float noundef %28)
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef 4, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
  %.sroa.01.0.copyload.5 = load i64, ptr %.ptr.5, align 4
  %.sroa.22.0..sroa_idx.5 = getelementptr inbounds i8, ptr %6, i64 68
  %.sroa.22.0.copyload.5 = load i32, ptr %.sroa.22.0..sroa_idx.5, align 4, !tbaa !19
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %7, i64 %.sroa.01.0.copyload.5, i32 %.sroa.22.0.copyload.5, float noundef %28)
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef 5, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
  %.sroa.01.0.copyload.6 = load i64, ptr %.ptr.6, align 8
  %.sroa.22.0..sroa_idx.6 = getelementptr inbounds i8, ptr %6, i64 80
  %.sroa.22.0.copyload.6 = load i32, ptr %.sroa.22.0..sroa_idx.6, align 16, !tbaa !19
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %7, i64 %.sroa.01.0.copyload.6, i32 %.sroa.22.0.copyload.6, float noundef %28)
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef 6, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
  %.sroa.01.0.copyload.7 = load i64, ptr %.ptr.7, align 4
  %.sroa.22.0..sroa_idx.7 = getelementptr inbounds i8, ptr %6, i64 92
  %.sroa.22.0.copyload.7 = load i32, ptr %.sroa.22.0..sroa_idx.7, align 4, !tbaa !19
  call void @_ZN7Array3dIfE3setE9GridIndexf(ptr noundef nonnull align 8 dereferenceable(36) %7, i64 %.sroa.01.0.copyload.7, i32 %.sroa.22.0.copyload.7, float noundef %28)
  call void @_ZN7Array3dIbE3setEiiib(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef 7, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %6) #8
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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 88}
!6 = !{!"_ZTS11ScalarField", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !11, i64 80, !12, i64 88, !15, i64 128, !12, i64 160, !15, i64 200, !11, i64 232, !16, i64 236}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTS7Array3dIfE", !7, i64 0, !7, i64 4, !7, i64 8, !13, i64 16, !11, i64 24, !14, i64 28, !7, i64 32}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = !{!"_ZTS7Array3dIbE", !7, i64 0, !7, i64 4, !7, i64 8, !13, i64 16, !11, i64 24, !11, i64 25, !7, i64 28}
!16 = !{!"_ZTSN5vmath4vec3E", !14, i64 0, !14, i64 4, !14, i64 8}
!17 = !{!6, !7, i64 92}
!18 = !{!6, !7, i64 96}
!19 = !{!7, !7, i64 0}


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