; LLVM IR from ebirenbaum/ParticleSolver :: gpu/src/particlesystem.ll (ZN14ParticleSystem9addFluidsEv)

; 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.float4 = type { float, float, float, float }
%struct.float3 = type { float, float, float }
%struct.int2 = type { i32, i32 }
%class.ParticleSystem = type <{ i8, [3 x i8], float, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, %struct.SimParams, %struct.uint3, i32, i32, %"class.std::deque", %"class.std::deque", %"class.std::vector", %"class.std::vector.3", %struct.int3, %struct.int3, i32, [4 x i8] }>
%struct.SimParams = type { %struct.float3, float, float, %struct.uint3, i32, %struct.float3, %struct.float3, i32, i32 }
%struct.uint3 = type { i32, i32, i32 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<float4, std::allocator<float4>>::_Deque_impl" }
%"struct.std::_Deque_base<float4, std::allocator<float4>>::_Deque_impl" = type { %"struct.std::_Deque_base<float4, std::allocator<float4>>::_Deque_impl_data" }
%"struct.std::_Deque_base<float4, std::allocator<float4>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int2, std::allocator<int2>>::_Vector_impl" }
%"struct.std::_Vector_base<int2, std::allocator<int2>>::_Vector_impl" = type { %"struct.std::_Vector_base<int2, std::allocator<int2>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int2, std::allocator<int2>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<float4, std::allocator<float4>>::_Vector_impl" }
%"struct.std::_Vector_base<float4, std::allocator<float4>>::_Vector_impl" = type { %"struct.std::_Vector_base<float4, std::allocator<float4>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float4, std::allocator<float4>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.int3 = type { i32, i32, i32 }

; 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) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14ParticleSystem9addFluidsEv(ptr noundef nonnull align 8 dereferenceable(412) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.float4, align 16
  %6 = alloca %struct.float4, align 16
  %7 = alloca i32, align 4
  %8 = alloca %struct.float4, align 16
  %9 = alloca %struct.float3, align 4
  %10 = alloca %struct.float4, align 16
  %11 = alloca { <2 x float>, float }, align 8
  %12 = alloca { <2 x float>, float }, align 4
  %13 = alloca %struct.float4, align 16
  %14 = alloca %struct.int2, align 8
  %15 = alloca %struct.float4, align 16
  %16 = alloca %struct.float3, align 4
  %17 = alloca %struct.float4, align 16
  %18 = alloca { <2 x float>, float }, align 8
  %19 = alloca { <2 x float>, float }, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %20 = load ptr, ptr %2, align 8
  %21 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 20
  %22 = call noundef zeroext i1 @_ZNKSt5dequeI6float4SaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %21) #7
  br i1 %22, label %23, label %24

23:                                               ; preds = %1
  br label %98

24:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %25 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 4
  %26 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %26, ptr %3, align 4, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %27 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 20
  %28 = call noundef i64 @_ZNKSt5dequeI6float4SaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %27) #7
  %29 = udiv i64 %28, 2
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %4, align 4, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !32
  br label %31

31:                                               ; preds = %74, %24
  %32 = load i32, ptr %7, align 4, !tbaa !32
  %33 = load i32, ptr %4, align 4, !tbaa !32
  %34 = icmp ult i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %77

36:                                               ; preds = %31
  %37 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 20
  %38 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZNSt5dequeI6float4SaIS0_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %37) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 %38, i64 16, i1 false), !tbaa.struct !33
  %39 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 20
  call void @_ZNSt5dequeI6float4SaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %39) #7
  %40 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 20
  %41 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZNSt5dequeI6float4SaIS0_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %40) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 %41, i64 16, i1 false), !tbaa.struct !33
  %42 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 20
  call void @_ZNSt5dequeI6float4SaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %42) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %5, i64 16, i1 false), !tbaa.struct !33
  %43 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 0
  %44 = load <2 x float>, ptr %43, align 16
  %45 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 1
  %46 = load <2 x float>, ptr %45, align 8
  %47 = call { <2 x float>, float } @_Z11make_float36float4(<2 x float> %44, <2 x float> %46)
  store { <2 x float>, float } %47, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %11, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %9, i64 12, i1 false)
  %48 = getelementptr inbounds { <2 x float>, float }, ptr %12, i32 0, i32 0
  %49 = load <2 x float>, ptr %48, align 4
  %50 = getelementptr inbounds { <2 x float>, float }, ptr %12, i32 0, i32 1
  %51 = load float, ptr %50, align 4
  %52 = call { <2 x float>, <2 x float> } @_Z11make_float46float3f(<2 x float> %49, float %51, float noundef 1.000000e+00)
  %53 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %54 = extractvalue { <2 x float>, <2 x float> } %52, 0
  store <2 x float> %54, ptr %53, align 16
  %55 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %56 = extractvalue { <2 x float>, <2 x float> } %52, 1
  store <2 x float> %56, ptr %55, align 8
  %57 = call { <2 x float>, <2 x float> } @_ZL11make_float4ffff(float noundef 0.000000e+00, float noundef -1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %58 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 0
  %59 = extractvalue { <2 x float>, <2 x float> } %57, 0
  store <2 x float> %59, ptr %58, align 16
  %60 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 1
  %61 = extractvalue { <2 x float>, <2 x float> } %57, 1
  store <2 x float> %61, ptr %60, align 8
  %62 = getelementptr inbounds %struct.float4, ptr %5, i32 0, i32 3
  %63 = load float, ptr %62, align 4, !tbaa !35
  %64 = getelementptr inbounds %struct.float4, ptr %6, i32 0, i32 3
  %65 = load float, ptr %64, align 4, !tbaa !35
  %66 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %67 = load <2 x float>, ptr %66, align 16
  %68 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %69 = load <2 x float>, ptr %68, align 8
  %70 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 0
  %71 = load <2 x float>, ptr %70, align 16
  %72 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 1
  %73 = load <2 x float>, ptr %72, align 8
  call void @_ZN14ParticleSystem11addParticleE6float4S0_ffi(ptr noundef nonnull align 8 dereferenceable(412) %20, <2 x float> %67, <2 x float> %69, <2 x float> %71, <2 x float> %73, float noundef %63, float noundef %65, i32 noundef 0)
  br label %74

74:                                               ; preds = %36
  %75 = load i32, ptr %7, align 4, !tbaa !32
  %76 = add i32 %75, 1
  store i32 %76, ptr %7, align 4, !tbaa !32
  br label %31, !llvm.loop !37

77:                                               ; preds = %35
  %78 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 21
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %79 = load i32, ptr %3, align 4, !tbaa !32
  %80 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 4
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = call i64 @_ZL9make_int2ii(i32 noundef %79, i32 noundef %81)
  store i64 %82, ptr %14, align 8
  call void @_ZNSt6vectorI4int2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %83 = getelementptr inbounds %class.ParticleSystem, ptr %20, i32 0, i32 22
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 %6, i64 16, i1 false), !tbaa.struct !33
  %84 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %17, i32 0, i32 0
  %85 = load <2 x float>, ptr %84, align 16
  %86 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %17, i32 0, i32 1
  %87 = load <2 x float>, ptr %86, align 8
  %88 = call { <2 x float>, float } @_Z11make_float36float4(<2 x float> %85, <2 x float> %87)
  store { <2 x float>, float } %88, ptr %18, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %18, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %16, i64 12, i1 false)
  %89 = getelementptr inbounds { <2 x float>, float }, ptr %19, i32 0, i32 0
  %90 = load <2 x float>, ptr %89, align 4
  %91 = getelementptr inbounds { <2 x float>, float }, ptr %19, i32 0, i32 1
  %92 = load float, ptr %91, align 4
  %93 = call { <2 x float>, <2 x float> } @_Z11make_float46float3f(<2 x float> %90, float %92, float noundef 1.000000e+00)
  %94 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %15, i32 0, i32 0
  %95 = extractvalue { <2 x float>, <2 x float> } %93, 0
  store <2 x float> %95, ptr %94, align 16
  %96 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %15, i32 0, i32 1
  %97 = extractvalue { <2 x float>, <2 x float> } %93, 1
  store <2 x float> %97, ptr %96, align 8
  call void @_ZNSt6vectorI6float4SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %83, ptr noundef nonnull align 16 dereferenceable(16) %15)
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %98

98:                                               ; preds = %77, %23
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5dequeI6float4SaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5dequeI6float4SaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZNSt5dequeI6float4SaIS0_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeI6float4SaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14ParticleSystem11addParticleE6float4S0_ffi(ptr noundef nonnull align 8 dereferenceable(412), <2 x float>, <2 x float>, <2 x float>, <2 x float>, float noundef, float noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden { <2 x float>, <2 x float> } @_ZL11make_float4ffff(float noundef, float noundef, float noundef, float noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @_Z11make_float46float3f(<2 x float>, float, float noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_Z11make_float36float4(<2 x float>, <2 x float>) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI4int2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden i64 @_ZL9make_int2ii(i32 noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI6float4SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(16)) #6 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { inlinehint mustprogress nounwind 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 #6 = { 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 #7 = { 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, !13, i64 12}
!10 = !{!"_ZTS14ParticleSystem", !11, i64 0, !12, i64 4, !13, i64 8, !13, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !13, i64 72, !13, i64 76, !6, i64 80, !14, i64 88, !16, i64 156, !13, i64 168, !13, i64 172, !17, i64 176, !17, i64 256, !23, i64 336, !27, i64 360, !31, i64 384, !31, i64 396, !13, i64 408}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS9SimParams", !15, i64 0, !12, i64 12, !12, i64 16, !16, i64 20, !13, i64 32, !15, i64 36, !15, i64 48, !13, i64 60, !13, i64 64}
!15 = !{!"_ZTS6float3", !12, i64 0, !12, i64 4, !12, i64 8}
!16 = !{!"_ZTS5uint3", !13, i64 0, !13, i64 4, !13, i64 8}
!17 = !{!"_ZTSSt5dequeI6float4SaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt11_Deque_baseI6float4SaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseI6float4SaIS0_EE11_Deque_implE", !20, i64 0}
!20 = !{!"_ZTSNSt11_Deque_baseI6float4SaIS0_EE16_Deque_impl_dataE", !6, i64 0, !21, i64 8, !22, i64 16, !22, i64 48}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSSt15_Deque_iteratorI6float4RS0_PS0_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!"_ZTSSt6vectorI4int2SaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseI4int2SaIS0_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseI4int2SaIS0_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseI4int2SaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSSt6vectorI6float4SaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseI6float4SaIS0_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseI6float4SaIS0_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseI6float4SaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTS4int3", !13, i64 0, !13, i64 4, !13, i64 8}
!32 = !{!13, !13, i64 0}
!33 = !{i64 0, i64 4, !34, i64 4, i64 4, !34, i64 8, i64 4, !34, i64 12, i64 4, !34}
!34 = !{!12, !12, i64 0}
!35 = !{!36, !12, i64 12}
!36 = !{!"_ZTS6float4", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!37 = distinct !{!37, !38}
!38 = !{!"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"

%struct.int2 = type { i32, i32 }
%struct.float4 = type { float, float, float, float }

; 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
define dso_local void @_ZN14ParticleSystem9addFluidsEv(ptr noundef nonnull align 8 dereferenceable(412) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %struct.int2, align 8
  %3 = alloca %struct.float4, align 16
  %4 = getelementptr inbounds i8, ptr %0, i64 256
  %5 = tail call noundef zeroext i1 @_ZNKSt5dequeI6float4SaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  br i1 %5, label %31, label %6

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = tail call noundef i64 @_ZNKSt5dequeI6float4SaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  %10 = lshr i64 %9, 1
  %11 = trunc i64 %10 to i32
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %6
  %.sroa.022.0.lcssa = phi <2 x float> [ undef, %6 ], [ %.sroa.022.0.copyload, %.lr.ph ]
  %.sroa.4.0.lcssa = phi <2 x float> [ undef, %6 ], [ %.sroa.4.0.copyload, %.lr.ph ]
  %12 = getelementptr inbounds i8, ptr %0, i64 336
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %13 = load i32, ptr %7, align 4, !tbaa !5
  %14 = tail call i64 @_ZL9make_int2ii(i32 noundef %8, i32 noundef %13)
  store i64 %14, ptr %2, align 8
  call void @_ZNSt6vectorI4int2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %15 = getelementptr inbounds i8, ptr %0, i64 360
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %16 = call { <2 x float>, float } @_Z11make_float36float4(<2 x float> %.sroa.022.0.lcssa, <2 x float> %.sroa.4.0.lcssa)
  %.fca.0.extract = extractvalue { <2 x float>, float } %16, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %16, 1
  %17 = call { <2 x float>, <2 x float> } @_Z11make_float46float3f(<2 x float> %.fca.0.extract, float %.fca.1.extract, float noundef 1.000000e+00)
  %18 = extractvalue { <2 x float>, <2 x float> } %17, 0
  store <2 x float> %18, ptr %3, align 16
  %19 = getelementptr inbounds i8, ptr %3, i64 8
  %20 = extractvalue { <2 x float>, <2 x float> } %17, 1
  store <2 x float> %20, ptr %19, align 8
  call void @_ZNSt6vectorI6float4SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 16 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br label %31

.lr.ph:                                           ; preds = %6, %.lr.ph
  %.027 = phi i32 [ %30, %.lr.ph ], [ 0, %6 ]
  %21 = tail call noundef nonnull align 16 dereferenceable(16) ptr @_ZNSt5dequeI6float4SaIS0_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  %.sroa.023.0.copyload = load <2 x float>, ptr %21, align 16
  %.sroa.424.0..sroa_idx = getelementptr inbounds i8, ptr %21, i64 8
  %.sroa.424.0.copyload = load <2 x float>, ptr %.sroa.424.0..sroa_idx, align 8
  tail call void @_ZNSt5dequeI6float4SaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  %22 = tail call noundef nonnull align 16 dereferenceable(16) ptr @_ZNSt5dequeI6float4SaIS0_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  %.sroa.022.0.copyload = load <2 x float>, ptr %22, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  %.sroa.4.0.copyload = load <2 x float>, ptr %.sroa.4.0..sroa_idx, align 8
  tail call void @_ZNSt5dequeI6float4SaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  %23 = tail call { <2 x float>, float } @_Z11make_float36float4(<2 x float> %.sroa.023.0.copyload, <2 x float> %.sroa.424.0.copyload)
  %.fca.0.extract11 = extractvalue { <2 x float>, float } %23, 0
  %.fca.1.extract12 = extractvalue { <2 x float>, float } %23, 1
  %24 = tail call { <2 x float>, <2 x float> } @_Z11make_float46float3f(<2 x float> %.fca.0.extract11, float %.fca.1.extract12, float noundef 1.000000e+00)
  %25 = extractvalue { <2 x float>, <2 x float> } %24, 0
  %26 = extractvalue { <2 x float>, <2 x float> } %24, 1
  %27 = tail call { <2 x float>, <2 x float> } @_ZL11make_float4ffff(float noundef 0.000000e+00, float noundef -1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %28 = extractvalue { <2 x float>, <2 x float> } %27, 0
  %29 = extractvalue { <2 x float>, <2 x float> } %27, 1
  %.sroa.424.12.vec.extract = extractelement <2 x float> %.sroa.424.0.copyload, i64 1
  %.sroa.4.12.vec.extract = extractelement <2 x float> %.sroa.4.0.copyload, i64 1
  tail call void @_ZN14ParticleSystem11addParticleE6float4S0_ffi(ptr noundef nonnull align 8 dereferenceable(412) %0, <2 x float> %25, <2 x float> %26, <2 x float> %28, <2 x float> %29, float noundef %.sroa.424.12.vec.extract, float noundef %.sroa.4.12.vec.extract, i32 noundef 0)
  %30 = add nuw i32 %.027, 1
  %exitcond.not = icmp eq i32 %30, %11
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !31

31:                                               ; preds = %1, %._crit_edge
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5dequeI6float4SaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5dequeI6float4SaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZNSt5dequeI6float4SaIS0_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeI6float4SaIS0_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14ParticleSystem11addParticleE6float4S0_ffi(ptr noundef nonnull align 8 dereferenceable(412), <2 x float>, <2 x float>, <2 x float>, <2 x float>, float noundef, float noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden { <2 x float>, <2 x float> } @_ZL11make_float4ffff(float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @_Z11make_float46float3f(<2 x float>, float, float noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_Z11make_float36float4(<2 x float>, <2 x float>) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI4int2SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden i64 @_ZL9make_int2ii(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI6float4SaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { inlinehint mustprogress nounwind 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 #5 = { 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 #6 = { 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, !11, i64 12}
!6 = !{!"_ZTS14ParticleSystem", !7, i64 0, !10, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !11, i64 72, !11, i64 76, !12, i64 80, !13, i64 88, !15, i64 156, !11, i64 168, !11, i64 172, !16, i64 176, !16, i64 256, !22, i64 336, !26, i64 360, !30, i64 384, !30, i64 396, !11, i64 408}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTS9SimParams", !14, i64 0, !10, i64 12, !10, i64 16, !15, i64 20, !11, i64 32, !14, i64 36, !14, i64 48, !11, i64 60, !11, i64 64}
!14 = !{!"_ZTS6float3", !10, i64 0, !10, i64 4, !10, i64 8}
!15 = !{!"_ZTS5uint3", !11, i64 0, !11, i64 4, !11, i64 8}
!16 = !{!"_ZTSSt5dequeI6float4SaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt11_Deque_baseI6float4SaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseI6float4SaIS0_EE11_Deque_implE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseI6float4SaIS0_EE16_Deque_impl_dataE", !12, i64 0, !20, i64 8, !21, i64 16, !21, i64 48}
!20 = !{!"long", !8, i64 0}
!21 = !{!"_ZTSSt15_Deque_iteratorI6float4RS0_PS0_E", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!22 = !{!"_ZTSSt6vectorI4int2SaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseI4int2SaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI4int2SaIS0_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseI4int2SaIS0_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!26 = !{!"_ZTSSt6vectorI6float4SaIS0_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseI6float4SaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseI6float4SaIS0_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseI6float4SaIS0_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!30 = !{!"_ZTS4int3", !11, i64 0, !11, i64 4, !11, i64 8}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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