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

; 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.int3 = type { i32, 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.float3 = type { float, float, float }
%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 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__._ZN14ParticleSystem6updateEf = external hidden unnamed_addr constant [35 x i8], align 1

; 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

declare void @setParameters(ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14ParticleSystem6updateEf(ptr noundef nonnull align 8 dereferenceable(412) %0, float noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.int3, align 4
  %9 = alloca %struct.int3, align 8
  %10 = alloca { i64, i32 }, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %11 = load ptr, ptr %3, align 8
  %12 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 0
  %13 = load i8, ptr %12, align 8, !tbaa !11, !range !33, !noundef !34
  %14 = trunc i8 %13 to i1
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  br label %18

16:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.2, i32 noundef 146, ptr noundef @__PRETTY_FUNCTION__._ZN14ParticleSystem6updateEf) #6
  unreachable

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store float 0x3FA99999A0000000, ptr %5, align 4, !tbaa !9
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %20 = load float, ptr %19, align 4, !tbaa !9
  store float %20, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  %21 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %22 = load i32, ptr %21, align 4, !tbaa !35
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %18
  call void @_ZN14ParticleSystem11addNewStuffEv(ptr noundef nonnull align 8 dereferenceable(412) %11)
  br label %129

25:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %26 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 14
  %27 = call ptr @mapGLBufferObject(ptr noundef %26)
  store ptr %27, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 15
  call void @setParameters(ptr noundef %28)
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load float, ptr %4, align 4, !tbaa !9
  %31 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %32 = load i32, ptr %31, align 4, !tbaa !35
  call void @integrateSystem(ptr noundef %29, float noundef %30, i32 noundef %32)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !36
  br label %33

33:                                               ; preds = %119, %25
  %34 = load i32, ptr %7, align 4, !tbaa !36
  %35 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 25
  %36 = load i32, ptr %35, align 8, !tbaa !37
  %37 = icmp ult i32 %34, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %122

39:                                               ; preds = %33
  %40 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 8
  %41 = load ptr, ptr %40, align 8, !tbaa !38
  %42 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 9
  %43 = load ptr, ptr %42, align 8, !tbaa !39
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %46 = load i32, ptr %45, align 4, !tbaa !35
  call void @calcHash(ptr noundef %41, ptr noundef %43, ptr noundef %44, i32 noundef %46)
  %47 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 8
  %48 = load ptr, ptr %47, align 8, !tbaa !38
  %49 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 9
  %50 = load ptr, ptr %49, align 8, !tbaa !39
  %51 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %52 = load i32, ptr %51, align 4, !tbaa !35
  call void @sortParticles(ptr noundef %48, ptr noundef %50, i32 noundef %52)
  %53 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 10
  %54 = load ptr, ptr %53, align 8, !tbaa !40
  %55 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 11
  %56 = load ptr, ptr %55, align 8, !tbaa !41
  %57 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 5
  %58 = load ptr, ptr %57, align 8, !tbaa !42
  %59 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 6
  %60 = load ptr, ptr %59, align 8, !tbaa !43
  %61 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 7
  %62 = load ptr, ptr %61, align 8, !tbaa !44
  %63 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 8
  %64 = load ptr, ptr %63, align 8, !tbaa !38
  %65 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 9
  %66 = load ptr, ptr %65, align 8, !tbaa !39
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %69 = load i32, ptr %68, align 4, !tbaa !35
  %70 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 17
  %71 = load i32, ptr %70, align 8, !tbaa !45
  call void @reorderDataAndFindCellStart(ptr noundef %54, ptr noundef %56, ptr noundef %58, ptr noundef %60, ptr noundef %62, ptr noundef %64, ptr noundef %66, ptr noundef %67, i32 noundef %69, i32 noundef %71)
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 5
  %74 = load ptr, ptr %73, align 8, !tbaa !42
  %75 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 6
  %76 = load ptr, ptr %75, align 8, !tbaa !43
  %77 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 7
  %78 = load ptr, ptr %77, align 8, !tbaa !44
  %79 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 9
  %80 = load ptr, ptr %79, align 8, !tbaa !39
  %81 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 10
  %82 = load ptr, ptr %81, align 8, !tbaa !40
  %83 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 11
  %84 = load ptr, ptr %83, align 8, !tbaa !41
  %85 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %86 = load i32, ptr %85, align 4, !tbaa !35
  %87 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 17
  %88 = load i32, ptr %87, align 8, !tbaa !45
  call void @collide(ptr noundef %72, ptr noundef %74, ptr noundef %76, ptr noundef %78, ptr noundef %80, ptr noundef %82, ptr noundef %84, i32 noundef %86, i32 noundef %88)
  %89 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 5
  %90 = load ptr, ptr %89, align 8, !tbaa !42
  %91 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 6
  %92 = load ptr, ptr %91, align 8, !tbaa !43
  %93 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 7
  %94 = load ptr, ptr %93, align 8, !tbaa !44
  %95 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 9
  %96 = load ptr, ptr %95, align 8, !tbaa !39
  %97 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 10
  %98 = load ptr, ptr %97, align 8, !tbaa !40
  %99 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 11
  %100 = load ptr, ptr %99, align 8, !tbaa !41
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %103 = load i32, ptr %102, align 4, !tbaa !35
  %104 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 17
  %105 = load i32, ptr %104, align 8, !tbaa !45
  call void @solveFluids(ptr noundef %90, ptr noundef %92, ptr noundef %94, ptr noundef %96, ptr noundef %98, ptr noundef %100, ptr noundef %101, i32 noundef %103, i32 noundef %105)
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 5
  %108 = load ptr, ptr %107, align 8, !tbaa !42
  %109 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %110 = load i32, ptr %109, align 4, !tbaa !35
  %111 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 23
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 8 %111, i64 12, i1 false), !tbaa.struct !46
  %112 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %112, i64 12, i1 false), !tbaa.struct !46
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %8, i64 12, i1 false)
  %113 = getelementptr inbounds { i64, i32 }, ptr %10, i32 0, i32 0
  %114 = load i64, ptr %113, align 4
  %115 = getelementptr inbounds { i64, i32 }, ptr %10, i32 0, i32 1
  %116 = load i32, ptr %115, align 4
  call void @collideWorld(ptr noundef %106, ptr noundef %108, i32 noundef %110, i64 %114, i32 %116, ptr noundef byval(%struct.int3) align 8 %9)
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  call void @solveDistanceConstraints(ptr noundef %117)
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  call void @solvePointConstraints(ptr noundef %118)
  br label %119

119:                                              ; preds = %39
  %120 = load i32, ptr %7, align 4, !tbaa !36
  %121 = add i32 %120, 1
  store i32 %121, ptr %7, align 4, !tbaa !36
  br label %33, !llvm.loop !47

122:                                              ; preds = %38
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load float, ptr %4, align 4, !tbaa !9
  %125 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 4
  %126 = load i32, ptr %125, align 4, !tbaa !35
  call void @calcVelocity(ptr noundef %123, float noundef %124, i32 noundef %126)
  %127 = getelementptr inbounds %class.ParticleSystem, ptr %11, i32 0, i32 14
  %128 = load ptr, ptr %127, align 8, !tbaa !49
  call void @unmapGLBufferObject(ptr noundef %128)
  call void @_ZN14ParticleSystem11addNewStuffEv(ptr noundef nonnull align 8 dereferenceable(412) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %129

129:                                              ; preds = %122, %24
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14ParticleSystem11addNewStuffEv(ptr noundef nonnull align 8 dereferenceable(412)) #4 align 2

declare ptr @mapGLBufferObject(ptr noundef) #2

declare void @integrateSystem(ptr noundef, float noundef, i32 noundef) #2

declare void @calcHash(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare void @sortParticles(ptr noundef, ptr noundef, i32 noundef) #2

declare void @reorderDataAndFindCellStart(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

declare void @collide(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

declare void @solveFluids(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

declare void @collideWorld(ptr noundef, ptr noundef, i32 noundef, i64, i32, ptr noundef byval(%struct.int3) align 8) #2

declare void @solveDistanceConstraints(ptr noundef) #2

declare void @solvePointConstraints(ptr noundef) #2

declare void @calcVelocity(ptr noundef, float noundef, i32 noundef) #2

declare void @unmapGLBufferObject(ptr noundef) #2

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


; 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.int3 = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__._ZN14ParticleSystem6updateEf = external hidden unnamed_addr constant [35 x i8], align 1

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

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

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

declare void @setParameters(ptr noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14ParticleSystem6updateEf(ptr noundef nonnull align 8 dereferenceable(412) %0, float noundef %1) local_unnamed_addr #4 align 2 {
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca %struct.int3, align 8
  store float %1, ptr %3, align 4, !tbaa !5
  %6 = load i8, ptr %0, align 8, !tbaa !9, !range !32, !noundef !33
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %9, label %8

8:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.2, i32 noundef 146, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14ParticleSystem6updateEf) #6
  unreachable

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store float 0x3FA99999A0000000, ptr %4, align 4, !tbaa !5
  %10 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %11 = load float, ptr %10, align 4, !tbaa !5
  store float %11, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  %13 = load i32, ptr %12, align 4, !tbaa !34
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %73, label %15

15:                                               ; preds = %9
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = call ptr @mapGLBufferObject(ptr noundef nonnull %16)
  %18 = getelementptr inbounds i8, ptr %0, i64 88
  call void @setParameters(ptr noundef nonnull %18)
  %19 = load float, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr %12, align 4, !tbaa !34
  call void @integrateSystem(ptr noundef %17, float noundef %19, i32 noundef %20)
  %21 = getelementptr inbounds i8, ptr %0, i64 408
  %22 = load i32, ptr %21, align 8, !tbaa !35
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %23 = getelementptr inbounds i8, ptr %0, i64 40
  %24 = getelementptr inbounds i8, ptr %0, i64 48
  %25 = getelementptr inbounds i8, ptr %0, i64 56
  %26 = getelementptr inbounds i8, ptr %0, i64 64
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = getelementptr inbounds i8, ptr %0, i64 24
  %29 = getelementptr inbounds i8, ptr %0, i64 32
  %30 = getelementptr inbounds i8, ptr %0, i64 168
  %31 = getelementptr inbounds i8, ptr %0, i64 384
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 392
  %32 = getelementptr inbounds i8, ptr %0, i64 396
  br label %36

._crit_edge:                                      ; preds = %36, %15
  %33 = load float, ptr %3, align 4, !tbaa !5
  %34 = load i32, ptr %12, align 4, !tbaa !34
  call void @calcVelocity(ptr noundef %17, float noundef %33, i32 noundef %34)
  %35 = load ptr, ptr %16, align 8, !tbaa !36
  call void @unmapGLBufferObject(ptr noundef %35)
  br label %73

36:                                               ; preds = %.lr.ph, %36
  %.013 = phi i32 [ 0, %.lr.ph ], [ %70, %36 ]
  %37 = load ptr, ptr %23, align 8, !tbaa !37
  %38 = load ptr, ptr %24, align 8, !tbaa !38
  %39 = load i32, ptr %12, align 4, !tbaa !34
  call void @calcHash(ptr noundef %37, ptr noundef %38, ptr noundef %17, i32 noundef %39)
  %40 = load ptr, ptr %23, align 8, !tbaa !37
  %41 = load ptr, ptr %24, align 8, !tbaa !38
  %42 = load i32, ptr %12, align 4, !tbaa !34
  call void @sortParticles(ptr noundef %40, ptr noundef %41, i32 noundef %42)
  %43 = load ptr, ptr %25, align 8, !tbaa !39
  %44 = load ptr, ptr %26, align 8, !tbaa !40
  %45 = load ptr, ptr %27, align 8, !tbaa !41
  %46 = load ptr, ptr %28, align 8, !tbaa !42
  %47 = load ptr, ptr %29, align 8, !tbaa !43
  %48 = load ptr, ptr %23, align 8, !tbaa !37
  %49 = load ptr, ptr %24, align 8, !tbaa !38
  %50 = load i32, ptr %12, align 4, !tbaa !34
  %51 = load i32, ptr %30, align 8, !tbaa !44
  call void @reorderDataAndFindCellStart(ptr noundef %43, ptr noundef %44, ptr noundef %45, ptr noundef %46, ptr noundef %47, ptr noundef %48, ptr noundef %49, ptr noundef %17, i32 noundef %50, i32 noundef %51)
  %52 = load ptr, ptr %27, align 8, !tbaa !41
  %53 = load ptr, ptr %28, align 8, !tbaa !42
  %54 = load ptr, ptr %29, align 8, !tbaa !43
  %55 = load ptr, ptr %24, align 8, !tbaa !38
  %56 = load ptr, ptr %25, align 8, !tbaa !39
  %57 = load ptr, ptr %26, align 8, !tbaa !40
  %58 = load i32, ptr %12, align 4, !tbaa !34
  %59 = load i32, ptr %30, align 8, !tbaa !44
  call void @collide(ptr noundef %17, ptr noundef %52, ptr noundef %53, ptr noundef %54, ptr noundef %55, ptr noundef %56, ptr noundef %57, i32 noundef %58, i32 noundef %59)
  %60 = load ptr, ptr %27, align 8, !tbaa !41
  %61 = load ptr, ptr %28, align 8, !tbaa !42
  %62 = load ptr, ptr %29, align 8, !tbaa !43
  %63 = load ptr, ptr %24, align 8, !tbaa !38
  %64 = load ptr, ptr %25, align 8, !tbaa !39
  %65 = load ptr, ptr %26, align 8, !tbaa !40
  %66 = load i32, ptr %12, align 4, !tbaa !34
  %67 = load i32, ptr %30, align 8, !tbaa !44
  call void @solveFluids(ptr noundef %60, ptr noundef %61, ptr noundef %62, ptr noundef %63, ptr noundef %64, ptr noundef %65, ptr noundef %17, i32 noundef %66, i32 noundef %67)
  %68 = load ptr, ptr %27, align 8, !tbaa !41
  %69 = load i32, ptr %12, align 4, !tbaa !34
  %.sroa.01.0.copyload = load i64, ptr %31, align 8
  %.sroa.22.0.copyload = load i32, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !45
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %32, i64 12, i1 false), !tbaa.struct !46
  call void @collideWorld(ptr noundef %17, ptr noundef %68, i32 noundef %69, i64 %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload, ptr noundef nonnull byval(%struct.int3) align 8 %5)
  call void @solveDistanceConstraints(ptr noundef %17)
  call void @solvePointConstraints(ptr noundef %17)
  %70 = add nuw i32 %.013, 1
  %71 = load i32, ptr %21, align 8, !tbaa !35
  %72 = icmp ult i32 %70, %71
  br i1 %72, label %36, label %._crit_edge, !llvm.loop !47

73:                                               ; preds = %9, %._crit_edge
  call void @_ZN14ParticleSystem11addNewStuffEv(ptr noundef nonnull align 8 dereferenceable(412) %0)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14ParticleSystem11addNewStuffEv(ptr noundef nonnull align 8 dereferenceable(412)) local_unnamed_addr #4 align 2

declare ptr @mapGLBufferObject(ptr noundef) local_unnamed_addr #2

declare void @integrateSystem(ptr noundef, float noundef, i32 noundef) local_unnamed_addr #2

declare void @calcHash(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @sortParticles(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @reorderDataAndFindCellStart(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @collide(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @solveFluids(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @collideWorld(ptr noundef, ptr noundef, i32 noundef, i64, i32, ptr noundef byval(%struct.int3) align 8) local_unnamed_addr #2

declare void @solveDistanceConstraints(ptr noundef) local_unnamed_addr #2

declare void @solvePointConstraints(ptr noundef) local_unnamed_addr #2

declare void @calcVelocity(ptr noundef, float noundef, i32 noundef) local_unnamed_addr #2

declare void @unmapGLBufferObject(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 #6 = { noreturn nounwind }
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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS14ParticleSystem", !11, i64 0, !6, i64 4, !12, i64 8, !12, i64 12, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !12, i64 72, !12, i64 76, !13, i64 80, !14, i64 88, !16, i64 156, !12, i64 168, !12, i64 172, !17, i64 176, !17, i64 256, !23, i64 336, !27, i64 360, !31, i64 384, !31, i64 396, !12, i64 408}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_ZTS9SimParams", !15, i64 0, !6, i64 12, !6, i64 16, !16, i64 20, !12, i64 32, !15, i64 36, !15, i64 48, !12, i64 60, !12, i64 64}
!15 = !{!"_ZTS6float3", !6, i64 0, !6, i64 4, !6, i64 8}
!16 = !{!"_ZTS5uint3", !12, i64 0, !12, i64 4, !12, 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", !13, i64 0, !21, i64 8, !22, i64 16, !22, i64 48}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSSt15_Deque_iteratorI6float4RS0_PS0_E", !13, i64 0, !13, i64 8, !13, i64 16, !13, 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", !13, i64 0, !13, i64 8, !13, 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", !13, i64 0, !13, i64 8, !13, i64 16}
!31 = !{!"_ZTS4int3", !12, i64 0, !12, i64 4, !12, i64 8}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!10, !12, i64 12}
!35 = !{!10, !12, i64 408}
!36 = !{!10, !13, i64 80}
!37 = !{!10, !13, i64 40}
!38 = !{!10, !13, i64 48}
!39 = !{!10, !13, i64 56}
!40 = !{!10, !13, i64 64}
!41 = !{!10, !13, i64 16}
!42 = !{!10, !13, i64 24}
!43 = !{!10, !13, i64 32}
!44 = !{!10, !12, i64 168}
!45 = !{!12, !12, i64 0}
!46 = !{i64 0, i64 4, !45, i64 4, i64 4, !45, i64 8, i64 4, !45}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass