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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.AABB_t = type { %struct.Vector3_t, float, float, float }
%struct.Vector3_t = type { float, float, float }
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.vmath::vec3" = type { float, float, float }

@_ZN9CBindings7SUCCESSE = external global i32, align 4
@_ZTISt9exception = external constant ptr
@_ZN9CBindings4FAILE = external global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local ptr @CuboidFluidSource_new(ptr noundef byval(%struct.AABB_t) align 8 %0, <2 x float> %1, float %2, ptr noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.Vector3_t, align 4
  %6 = alloca { <2 x float>, float }, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %class.AABB, align 8
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %class.AABB, align 8
  %14 = alloca %"class.vmath::vec3", align 4
  %15 = alloca i1, align 1
  %16 = alloca ptr, align 8
  %17 = getelementptr inbounds { <2 x float>, float }, ptr %6, i32 0, i32 0
  store <2 x float> %1, ptr %17, align 4
  %18 = getelementptr inbounds { <2 x float>, float }, ptr %6, i32 0, i32 1
  store float %2, ptr %18, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %6, i64 12, i1 false)
  store ptr %3, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #9
  %19 = getelementptr inbounds %struct.AABB_t, ptr %0, i32 0, i32 0
  %20 = getelementptr inbounds %struct.Vector3_t, ptr %19, i32 0, i32 0
  %21 = load float, ptr %20, align 8, !tbaa !9
  %22 = fpext float %21 to double
  %23 = getelementptr inbounds %struct.AABB_t, ptr %0, i32 0, i32 0
  %24 = getelementptr inbounds %struct.Vector3_t, ptr %23, i32 0, i32 1
  %25 = load float, ptr %24, align 4, !tbaa !13
  %26 = fpext float %25 to double
  %27 = getelementptr inbounds %struct.AABB_t, ptr %0, i32 0, i32 0
  %28 = getelementptr inbounds %struct.Vector3_t, ptr %27, i32 0, i32 2
  %29 = load float, ptr %28, align 8, !tbaa !14
  %30 = fpext float %29 to double
  %31 = getelementptr inbounds %struct.AABB_t, ptr %0, i32 0, i32 1
  %32 = load float, ptr %31, align 4, !tbaa !15
  %33 = fpext float %32 to double
  %34 = getelementptr inbounds %struct.AABB_t, ptr %0, i32 0, i32 2
  %35 = load float, ptr %34, align 8, !tbaa !16
  %36 = fpext float %35 to double
  %37 = getelementptr inbounds %struct.AABB_t, ptr %0, i32 0, i32 3
  %38 = load float, ptr %37, align 4, !tbaa !17
  %39 = fpext float %38 to double
  call void @_ZN4AABBC1Edddddd(ptr noundef nonnull align 8 dereferenceable(40) %8, double noundef %22, double noundef %26, double noundef %30, double noundef %33, double noundef %36, double noundef %39)
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #9
  %40 = getelementptr inbounds %struct.Vector3_t, ptr %5, i32 0, i32 0
  %41 = load float, ptr %40, align 4, !tbaa !18
  %42 = getelementptr inbounds %struct.Vector3_t, ptr %5, i32 0, i32 1
  %43 = load float, ptr %42, align 4, !tbaa !19
  %44 = getelementptr inbounds %struct.Vector3_t, ptr %5, i32 0, i32 2
  %45 = load float, ptr %44, align 4, !tbaa !20
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef %41, float noundef %43, float noundef %45)
          to label %46 unwind label %52

46:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  store ptr null, ptr %12, align 8, !tbaa !5
  %47 = load i32, ptr @_ZN9CBindings7SUCCESSE, align 4, !tbaa !21
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %47, ptr %48, align 4, !tbaa !21
  %49 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 80) #10
          to label %50 unwind label %56

50:                                               ; preds = %46
  store i1 true, ptr %15, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %8, i64 40, i1 false), !tbaa.struct !23
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !27
  invoke void @_ZN17CuboidFluidSourceC1E4AABBN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(80) %49, ptr noundef %13, ptr noundef %14)
          to label %51 unwind label %60

51:                                               ; preds = %50
  store i1 false, ptr %15, align 1
  store ptr %49, ptr %12, align 8, !tbaa !5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #9
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #9
  br label %79

52:                                               ; preds = %4
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %10, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %11, align 4
  br label %92

56:                                               ; preds = %46
  %57 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %10, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %11, align 4
  br label %67

60:                                               ; preds = %50
  %61 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %10, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %11, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #9
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #9
  %64 = load i1, ptr %15, align 1
  br i1 %64, label %65, label %66

65:                                               ; preds = %60
  call void @_ZdlPvm(ptr noundef %49, i64 noundef 80) #11
  br label %66

66:                                               ; preds = %65, %60
  br label %67

67:                                               ; preds = %66, %56
  %68 = load i32, ptr %11, align 4
  %69 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #9
  %70 = icmp eq i32 %68, %69
  br i1 %70, label %71, label %91

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %72 = load ptr, ptr %10, align 8
  %73 = call ptr @__cxa_begin_catch(ptr %72) #9
  store ptr %73, ptr %16, align 8
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @_ZN9CBindings17set_error_messageERSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %74)
          to label %75 unwind label %81

75:                                               ; preds = %71
  %76 = load i32, ptr @_ZN9CBindings4FAILE, align 4, !tbaa !21
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %76, ptr %77, align 4, !tbaa !21
  invoke void @__cxa_end_catch()
          to label %78 unwind label %85

78:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %79

79:                                               ; preds = %78, %51
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #9
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #9
  ret ptr %80

81:                                               ; preds = %71
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %10, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %11, align 4
  invoke void @__cxa_end_catch()
          to label %89 unwind label %98

85:                                               ; preds = %75
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %10, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %11, align 4
  br label %90

89:                                               ; preds = %81
  br label %90

90:                                               ; preds = %89, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %91

91:                                               ; preds = %90, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #9
  br label %92

92:                                               ; preds = %91, %52
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #9
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #9
  br label %93

93:                                               ; preds = %92
  %94 = load ptr, ptr %10, align 8
  %95 = load i32, ptr %11, align 4
  %96 = insertvalue { ptr, i32 } poison, ptr %94, 0
  %97 = insertvalue { ptr, i32 } %96, i32 %95, 1
  resume { ptr, i32 } %97

98:                                               ; preds = %81
  %99 = landingpad { ptr, i32 }
          catch ptr null
  %100 = extractvalue { ptr, i32 } %99, 0
  call void @__clang_call_terminate(ptr %100) #12
  unreachable
}

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

declare void @_ZN4AABBC1Edddddd(ptr noundef nonnull align 8 dereferenceable(40), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) unnamed_addr #3

declare void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #4

declare void @_ZN17CuboidFluidSourceC1E4AABBN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, ptr noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #5

; Function Attrs: nounwind
declare void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #6

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #7

declare ptr @__cxa_begin_catch(ptr)

declare void @_ZN9CBindings17set_error_messageERSt9exception(ptr noundef nonnull align 8 dereferenceable(8)) #3

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #8

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 = { nobuiltin 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 #7 = { nounwind memory(none) }
attributes #8 = { noinline noreturn nounwind uwtable "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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }
attributes #12 = { noreturn 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, !12, i64 0}
!10 = !{!"_ZTS6AABB_t", !11, i64 0, !12, i64 12, !12, i64 16, !12, i64 20}
!11 = !{!"_ZTS9Vector3_t", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !12, i64 4}
!14 = !{!10, !12, i64 8}
!15 = !{!10, !12, i64 12}
!16 = !{!10, !12, i64 16}
!17 = !{!10, !12, i64 20}
!18 = !{!11, !12, i64 0}
!19 = !{!11, !12, i64 4}
!20 = !{!11, !12, i64 8}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 16, i64 8, !25, i64 24, i64 8, !25, i64 32, i64 8, !25}
!24 = !{!12, !12, i64 0}
!25 = !{!26, !26, i64 0}
!26 = !{!"double", !7, i64 0}
!27 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 4, !24}


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

%struct.AABB_t = type { %struct.Vector3_t, float, float, float }
%struct.Vector3_t = type { float, float, float }
%class.AABB = type { %"class.vmath::vec3", double, double, double }
%"class.vmath::vec3" = type { float, float, float }

@_ZN9CBindings7SUCCESSE = external local_unnamed_addr global i32, align 4
@_ZTISt9exception = external constant ptr
@_ZN9CBindings4FAILE = external local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @CuboidFluidSource_new(ptr nocapture noundef readonly byval(%struct.AABB_t) align 8 %0, <2 x float> %1, float %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.AABB, align 8
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %class.AABB, align 8
  %8 = alloca %"class.vmath::vec3", align 4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #9
  %9 = load float, ptr %0, align 8, !tbaa !5
  %10 = fpext float %9 to double
  %11 = getelementptr inbounds i8, ptr %0, i64 4
  %12 = load float, ptr %11, align 4, !tbaa !11
  %13 = fpext float %12 to double
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load float, ptr %14, align 8, !tbaa !12
  %16 = fpext float %15 to double
  %17 = getelementptr inbounds i8, ptr %0, i64 12
  %18 = load float, ptr %17, align 4, !tbaa !13
  %19 = fpext float %18 to double
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  %21 = load float, ptr %20, align 8, !tbaa !14
  %22 = fpext float %21 to double
  %23 = getelementptr inbounds i8, ptr %0, i64 20
  %24 = load float, ptr %23, align 4, !tbaa !15
  %25 = fpext float %24 to double
  call void @_ZN4AABBC1Edddddd(ptr noundef nonnull align 8 dereferenceable(40) %5, double noundef %10, double noundef %13, double noundef %16, double noundef %19, double noundef %22, double noundef %25)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #9
  %.sroa.08.0.vec.extract = extractelement <2 x float> %1, i64 0
  %.sroa.08.4.vec.extract = extractelement <2 x float> %1, i64 1
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef %.sroa.08.0.vec.extract, float noundef %.sroa.08.4.vec.extract, float noundef %2)
          to label %26 unwind label %31

26:                                               ; preds = %4
  %27 = load i32, ptr @_ZN9CBindings7SUCCESSE, align 4, !tbaa !16
  store i32 %27, ptr %3, align 4, !tbaa !16
  %28 = invoke noalias noundef nonnull dereferenceable(80) ptr @_Znwm(i64 noundef 80) #10
          to label %29 unwind label %35

29:                                               ; preds = %26
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(40) %5, i64 40, i1 false), !tbaa.struct !18
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %6, i64 12, i1 false), !tbaa.struct !22
  invoke void @_ZN17CuboidFluidSourceC1E4AABBN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(80) %28, ptr noundef nonnull %7, ptr noundef nonnull %8)
          to label %30 unwind label %37

30:                                               ; preds = %29
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #9
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #9
  br label %46

31:                                               ; preds = %4
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  %34 = extractvalue { ptr, i32 } %32, 1
  br label %53

35:                                               ; preds = %26
  %36 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %39

37:                                               ; preds = %29
  %38 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #9
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #9
  call void @_ZdlPvm(ptr noundef nonnull %28, i64 noundef 80) #11
  br label %39

39:                                               ; preds = %37, %35
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  %.0 = extractvalue { ptr, i32 } %.pn, 0
  %.010 = extractvalue { ptr, i32 } %.pn, 1
  %40 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #9
  %41 = icmp eq i32 %.010, %40
  br i1 %41, label %42, label %52

42:                                               ; preds = %39
  %43 = call ptr @__cxa_begin_catch(ptr %.0) #9
  invoke void @_ZN9CBindings17set_error_messageERSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %43)
          to label %44 unwind label %47

44:                                               ; preds = %42
  %45 = load i32, ptr @_ZN9CBindings4FAILE, align 4, !tbaa !16
  store i32 %45, ptr %3, align 4, !tbaa !16
  invoke void @__cxa_end_catch()
          to label %46 unwind label %49

46:                                               ; preds = %44, %30
  %.09 = phi ptr [ %28, %30 ], [ null, %44 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #9
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #9
  ret ptr %.09

47:                                               ; preds = %42
  %48 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %51 unwind label %56

49:                                               ; preds = %44
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %51

51:                                               ; preds = %47, %49
  %.pn15 = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  %.1 = extractvalue { ptr, i32 } %.pn15, 0
  %.111 = extractvalue { ptr, i32 } %.pn15, 1
  br label %52

52:                                               ; preds = %51, %39
  %.212 = phi i32 [ %.111, %51 ], [ %.010, %39 ]
  %.2 = phi ptr [ %.1, %51 ], [ %.0, %39 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #9
  br label %53

53:                                               ; preds = %52, %31
  %.313 = phi i32 [ %.212, %52 ], [ %34, %31 ]
  %.3 = phi ptr [ %.2, %52 ], [ %33, %31 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #9
  call void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #9
  %54 = insertvalue { ptr, i32 } poison, ptr %.3, 0
  %55 = insertvalue { ptr, i32 } %54, i32 %.313, 1
  resume { ptr, i32 } %55

56:                                               ; preds = %47
  %57 = landingpad { ptr, i32 }
          catch ptr null
  %58 = extractvalue { ptr, i32 } %57, 0
  call void @__clang_call_terminate(ptr %58) #12
  unreachable
}

; Function Attrs: mustprogress 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

declare void @_ZN4AABBC1Edddddd(ptr noundef nonnull align 8 dereferenceable(40), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) unnamed_addr #3

declare void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #4

declare void @_ZN17CuboidFluidSourceC1E4AABBN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, ptr noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #5

; Function Attrs: nounwind
declare void @_ZN4AABBD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #7

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @_ZN9CBindings17set_error_messageERSt9exception(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #8

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 = { nobuiltin 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 #7 = { nofree nosync nounwind memory(none) }
attributes #8 = { noinline noreturn nounwind uwtable "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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }
attributes #12 = { noreturn 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, !8, i64 0}
!6 = !{!"_ZTS6AABB_t", !7, i64 0, !8, i64 12, !8, i64 16, !8, i64 20}
!7 = !{!"_ZTS9Vector3_t", !8, i64 0, !8, i64 4, !8, i64 8}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!6, !8, i64 4}
!12 = !{!6, !8, i64 8}
!13 = !{!6, !8, i64 12}
!14 = !{!6, !8, i64 16}
!15 = !{!6, !8, i64 20}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !9, i64 0}
!18 = !{i64 0, i64 4, !19, i64 4, i64 4, !19, i64 8, i64 4, !19, i64 16, i64 8, !20, i64 24, i64 8, !20, i64 32, i64 8, !20}
!19 = !{!8, !8, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !9, i64 0}
!22 = !{i64 0, i64 4, !19, i64 4, i64 4, !19, i64 8, i64 4, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass