; LLVM IR from mtsamis/box2d-optimized :: src/dynamics/b2_world.ll (ZN7b2World4StepEfiii)

; 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.b2Timer = type { i64, i64 }
%struct.b2TimeStep = type { float, float, float, i32, i32, i32, i8 }
%class.b2World = type { %class.b2BlockAllocator, %class.b2StackAllocator, %class.b2ContactManager, ptr, ptr, ptr, ptr, i32, i32, %struct.b2Vec2, i8, ptr, ptr, float, i8, i8, i8, i8, i8, i8, i8, i8, %struct.b2Profile }
%class.b2BlockAllocator = type { ptr, i32, i32, [14 x ptr] }
%class.b2StackAllocator = type <{ [102400 x i8], i32, i32, i32, [4 x i8], [32 x %struct.b2StackEntry], i32, [4 x i8] }>
%struct.b2StackEntry = type { ptr, i32, i8 }
%class.b2ContactManager = type { %class.b2BroadPhase, i32, ptr, ptr, ptr, ptr }
%class.b2BroadPhase = type <{ ptr, ptr, ptr, ptr, %struct.b2TreeNode, ptr, ptr, ptr, i32, i32, %class.b2IntHashTable, i32, i32, i8, [7 x i8] }>
%struct.b2TreeNode = type { ptr, ptr, ptr, ptr, %struct.b2AABB }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%class.b2IntHashTable = type <{ ptr, i32, [4 x i8] }>
%struct.b2Vec2 = type { float, float }
%struct.b2Profile = type { float, float, float, float, float }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7b2World18RemoveDeadContactsEv(ptr noundef nonnull align 8 dereferenceable(103352)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7b2World5SolveERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef nonnull align 4 dereferenceable(28)) #1 align 2

declare void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare void @_ZN16b2ContactManager15FindNewContactsEv(ptr noundef nonnull align 8 dereferenceable(184)) #2

declare noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7b2World8SolveTOIERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef nonnull align 4 dereferenceable(28)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7b2World4StepEfiii(ptr noundef nonnull align 8 dereferenceable(103352) %0, float noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #1 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %class.b2Timer, align 8
  %12 = alloca %struct.b2TimeStep, align 4
  %13 = alloca %class.b2Timer, align 8
  %14 = alloca %class.b2Timer, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %class.b2Timer, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store float %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !11
  store i32 %3, ptr %9, align 4, !tbaa !11
  store i32 %4, ptr %10, align 4, !tbaa !11
  %17 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  call void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %18 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 16
  store i8 1, ptr %18, align 2, !tbaa !13
  %19 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 14
  %20 = load i8, ptr %19, align 4, !tbaa !25, !range !26, !noundef !27
  %21 = trunc i8 %20 to i1
  br i1 %21, label %22, label %24

22:                                               ; preds = %5
  %23 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 2
  call void @_ZN16b2ContactManager15FindNewContactsEv(ptr noundef nonnull align 8 dereferenceable(184) %23)
  br label %24

24:                                               ; preds = %22, %5
  %25 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 14
  %26 = load i8, ptr %25, align 4, !tbaa !25, !range !26, !noundef !27
  %27 = trunc i8 %26 to i1
  br i1 %27, label %32, label %28

28:                                               ; preds = %24
  %29 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 15
  %30 = load i8, ptr %29, align 1, !tbaa !28, !range !26, !noundef !27
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %35

32:                                               ; preds = %28, %24
  call void @_ZN7b2World18RemoveDeadContactsEv(ptr noundef nonnull align 8 dereferenceable(103352) %17)
  %33 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 14
  store i8 0, ptr %33, align 4, !tbaa !25
  %34 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 15
  store i8 0, ptr %34, align 1, !tbaa !28
  br label %35

35:                                               ; preds = %32, %28
  call void @llvm.lifetime.start.p0(i64 28, ptr %12) #4
  %36 = load float, ptr %7, align 4, !tbaa !9
  %37 = getelementptr inbounds %struct.b2TimeStep, ptr %12, i32 0, i32 0
  store float %36, ptr %37, align 4, !tbaa !29
  %38 = load float, ptr %7, align 4, !tbaa !9
  %39 = fcmp ogt float %38, 0.000000e+00
  br i1 %39, label %40, label %43

40:                                               ; preds = %35
  %41 = load float, ptr %7, align 4, !tbaa !9
  %42 = fdiv float 1.000000e+00, %41
  br label %44

43:                                               ; preds = %35
  br label %44

44:                                               ; preds = %43, %40
  %45 = phi float [ %42, %40 ], [ 0.000000e+00, %43 ]
  %46 = getelementptr inbounds %struct.b2TimeStep, ptr %12, i32 0, i32 1
  store float %45, ptr %46, align 4, !tbaa !31
  %47 = load i32, ptr %8, align 4, !tbaa !11
  %48 = getelementptr inbounds %struct.b2TimeStep, ptr %12, i32 0, i32 3
  store i32 %47, ptr %48, align 4, !tbaa !32
  %49 = load i32, ptr %9, align 4, !tbaa !11
  %50 = getelementptr inbounds %struct.b2TimeStep, ptr %12, i32 0, i32 4
  store i32 %49, ptr %50, align 4, !tbaa !33
  %51 = load i32, ptr %10, align 4, !tbaa !11
  %52 = getelementptr inbounds %struct.b2TimeStep, ptr %12, i32 0, i32 5
  store i32 %51, ptr %52, align 4, !tbaa !34
  %53 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 13
  %54 = load float, ptr %53, align 8, !tbaa !35
  %55 = load float, ptr %7, align 4, !tbaa !9
  %56 = fmul float %54, %55
  %57 = getelementptr inbounds %struct.b2TimeStep, ptr %12, i32 0, i32 2
  store float %56, ptr %57, align 4, !tbaa !36
  %58 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 18
  %59 = load i8, ptr %58, align 8, !tbaa !37, !range !26, !noundef !27
  %60 = trunc i8 %59 to i1
  %61 = getelementptr inbounds %struct.b2TimeStep, ptr %12, i32 0, i32 6
  %62 = zext i1 %60 to i8
  store i8 %62, ptr %61, align 4, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  call void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %63 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 2
  call void @_ZN16b2ContactManager7CollideEv(ptr noundef nonnull align 8 dereferenceable(184) %63)
  %64 = call noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %65 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 22
  %66 = getelementptr inbounds %struct.b2Profile, ptr %65, i32 0, i32 1
  store float %64, ptr %66, align 4, !tbaa !39
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  %67 = load float, ptr %7, align 4, !tbaa !9
  %68 = fcmp ogt float %67, 0.000000e+00
  br i1 %68, label %69, label %101

69:                                               ; preds = %44
  %70 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 21
  %71 = load i8, ptr %70, align 1, !tbaa !40, !range !26, !noundef !27
  %72 = trunc i8 %71 to i1
  br i1 %72, label %73, label %89

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #4
  call void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %74 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 6
  %75 = load ptr, ptr %74, align 8, !tbaa !41
  store ptr %75, ptr %15, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %82, %73
  %77 = load ptr, ptr %15, align 8, !tbaa !5
  %78 = icmp ne ptr %77, null
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %85

80:                                               ; preds = %76
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZN16b2ParticleSystem5SolveERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %81, ptr noundef nonnull align 4 dereferenceable(28) %12)
  br label %82

82:                                               ; preds = %80
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = call noundef ptr @_ZN16b2ParticleSystem7GetNextEv(ptr noundef nonnull align 8 dereferenceable(632) %83)
  store ptr %84, ptr %15, align 8, !tbaa !5
  br label %76, !llvm.loop !42

85:                                               ; preds = %79
  call void @_ZN7b2World5SolveERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(103352) %17, ptr noundef nonnull align 4 dereferenceable(28) %12)
  %86 = call noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %87 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 22
  %88 = getelementptr inbounds %struct.b2Profile, ptr %87, i32 0, i32 2
  store float %86, ptr %88, align 4, !tbaa !44
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #4
  br label %89

89:                                               ; preds = %85, %69
  %90 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 19
  %91 = load i8, ptr %90, align 1, !tbaa !45, !range !26, !noundef !27
  %92 = trunc i8 %91 to i1
  br i1 %92, label %93, label %97

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #4
  call void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @_ZN7b2World8SolveTOIERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(103352) %17, ptr noundef nonnull align 4 dereferenceable(28) %12)
  %94 = call noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %95 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 22
  %96 = getelementptr inbounds %struct.b2Profile, ptr %95, i32 0, i32 4
  store float %94, ptr %96, align 4, !tbaa !46
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #4
  br label %97

97:                                               ; preds = %93, %89
  %98 = getelementptr inbounds %struct.b2TimeStep, ptr %12, i32 0, i32 1
  %99 = load float, ptr %98, align 4, !tbaa !31
  %100 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 13
  store float %99, ptr %100, align 8, !tbaa !35
  br label %101

101:                                              ; preds = %97, %44
  %102 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 17
  %103 = load i8, ptr %102, align 1, !tbaa !47, !range !26, !noundef !27
  %104 = trunc i8 %103 to i1
  br i1 %104, label %105, label %106

105:                                              ; preds = %101
  call void @_ZN7b2World11ClearForcesEv(ptr noundef nonnull align 8 dereferenceable(103352) %17)
  br label %106

106:                                              ; preds = %105, %101
  %107 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 16
  store i8 0, ptr %107, align 2, !tbaa !13
  %108 = call noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %109 = getelementptr inbounds %class.b2World, ptr %17, i32 0, i32 22
  %110 = getelementptr inbounds %struct.b2Profile, ptr %109, i32 0, i32 0
  store float %108, ptr %110, align 4, !tbaa !48
  call void @llvm.lifetime.end.p0(i64 28, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  ret void
}

declare void @_ZN16b2ContactManager7CollideEv(ptr noundef nonnull align 8 dereferenceable(184)) #2

declare void @_ZN16b2ParticleSystem5SolveERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef nonnull align 4 dereferenceable(28)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN16b2ParticleSystem7GetNextEv(ptr noundef nonnull align 8 dereferenceable(632)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7b2World11ClearForcesEv(ptr noundef nonnull align 8 dereferenceable(103352)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !23, i64 103326}
!14 = !{!"_ZTS7b2World", !15, i64 0, !16, i64 128, !17, i64 103064, !6, i64 103248, !6, i64 103256, !6, i64 103264, !6, i64 103272, !12, i64 103280, !12, i64 103284, !21, i64 103288, !23, i64 103296, !6, i64 103304, !6, i64 103312, !10, i64 103320, !23, i64 103324, !23, i64 103325, !23, i64 103326, !23, i64 103327, !23, i64 103328, !23, i64 103329, !23, i64 103330, !23, i64 103331, !24, i64 103332}
!15 = !{!"_ZTS16b2BlockAllocator", !6, i64 0, !12, i64 8, !12, i64 12, !7, i64 16}
!16 = !{!"_ZTS16b2StackAllocator", !7, i64 0, !12, i64 102400, !12, i64 102404, !12, i64 102408, !7, i64 102416, !12, i64 102928}
!17 = !{!"_ZTS16b2ContactManager", !18, i64 0, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!18 = !{!"_ZTS12b2BroadPhase", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !19, i64 32, !6, i64 80, !6, i64 88, !6, i64 96, !12, i64 104, !12, i64 108, !22, i64 112, !12, i64 128, !12, i64 132, !23, i64 136}
!19 = !{!"_ZTS10b2TreeNode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !20, i64 32}
!20 = !{!"_ZTS6b2AABB", !21, i64 0, !21, i64 8}
!21 = !{!"_ZTS6b2Vec2", !10, i64 0, !10, i64 4}
!22 = !{!"_ZTS14b2IntHashTable", !6, i64 0, !12, i64 8}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTS9b2Profile", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!25 = !{!14, !23, i64 103324}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!14, !23, i64 103325}
!29 = !{!30, !10, i64 0}
!30 = !{!"_ZTS10b2TimeStep", !10, i64 0, !10, i64 4, !10, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !23, i64 24}
!31 = !{!30, !10, i64 4}
!32 = !{!30, !12, i64 12}
!33 = !{!30, !12, i64 16}
!34 = !{!30, !12, i64 20}
!35 = !{!14, !10, i64 103320}
!36 = !{!30, !10, i64 8}
!37 = !{!14, !23, i64 103328}
!38 = !{!30, !23, i64 24}
!39 = !{!14, !10, i64 103336}
!40 = !{!14, !23, i64 103331}
!41 = !{!14, !6, i64 103272}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!14, !10, i64 103340}
!45 = !{!14, !23, i64 103329}
!46 = !{!14, !10, i64 103348}
!47 = !{!14, !23, i64 103327}
!48 = !{!14, !10, i64 103332}


; 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.b2Timer = type { i64, i64 }
%struct.b2TimeStep = type { float, float, float, i32, i32, i32, i8 }

; 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
declare dso_local void @_ZN7b2World18RemoveDeadContactsEv(ptr noundef nonnull align 8 dereferenceable(103352)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7b2World5SolveERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #1 align 2

declare void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare void @_ZN16b2ContactManager15FindNewContactsEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #2

declare noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7b2World8SolveTOIERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7b2World4StepEfiii(ptr noundef nonnull align 8 dereferenceable(103352) %0, float noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #1 align 2 {
  %6 = alloca %class.b2Timer, align 8
  %7 = alloca %struct.b2TimeStep, align 4
  %8 = alloca %class.b2Timer, align 8
  %9 = alloca %class.b2Timer, align 8
  %10 = alloca %class.b2Timer, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  call void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %11 = getelementptr inbounds i8, ptr %0, i64 103326
  store i8 1, ptr %11, align 2, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 103324
  %13 = load i8, ptr %12, align 4, !tbaa !22, !range !23, !noundef !24
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %15, label %17

15:                                               ; preds = %5
  %16 = getelementptr inbounds i8, ptr %0, i64 103064
  call void @_ZN16b2ContactManager15FindNewContactsEv(ptr noundef nonnull align 8 dereferenceable(184) %16)
  %.pre = load i8, ptr %12, align 4, !tbaa !22, !range !23
  br label %17

17:                                               ; preds = %15, %5
  %18 = phi i8 [ %.pre, %15 ], [ %13, %5 ]
  %19 = trunc nuw i8 %18 to i1
  br i1 %19, label %24, label %20

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %0, i64 103325
  %22 = load i8, ptr %21, align 1, !tbaa !25, !range !23, !noundef !24
  %23 = trunc nuw i8 %22 to i1
  br i1 %23, label %24, label %26

24:                                               ; preds = %20, %17
  call void @_ZN7b2World18RemoveDeadContactsEv(ptr noundef nonnull align 8 dereferenceable(103352) %0)
  store i8 0, ptr %12, align 4, !tbaa !22
  %25 = getelementptr inbounds i8, ptr %0, i64 103325
  store i8 0, ptr %25, align 1, !tbaa !25
  br label %26

26:                                               ; preds = %24, %20
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %7) #4
  store float %1, ptr %7, align 4, !tbaa !26
  %27 = fcmp ogt float %1, 0.000000e+00
  %28 = fdiv float 1.000000e+00, %1
  %29 = select i1 %27, float %28, float 0.000000e+00
  %30 = getelementptr inbounds i8, ptr %7, i64 4
  store float %29, ptr %30, align 4, !tbaa !28
  %31 = getelementptr inbounds i8, ptr %7, i64 12
  store i32 %2, ptr %31, align 4, !tbaa !29
  %32 = getelementptr inbounds i8, ptr %7, i64 16
  store i32 %3, ptr %32, align 4, !tbaa !30
  %33 = getelementptr inbounds i8, ptr %7, i64 20
  store i32 %4, ptr %33, align 4, !tbaa !31
  %34 = getelementptr inbounds i8, ptr %0, i64 103320
  %35 = load float, ptr %34, align 8, !tbaa !32
  %36 = fmul float %35, %1
  %37 = getelementptr inbounds i8, ptr %7, i64 8
  store float %36, ptr %37, align 4, !tbaa !33
  %38 = getelementptr inbounds i8, ptr %0, i64 103328
  %39 = load i8, ptr %38, align 8, !tbaa !34, !range !23, !noundef !24
  %40 = getelementptr inbounds i8, ptr %7, i64 24
  store i8 %39, ptr %40, align 4, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  call void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %8)
  %41 = getelementptr inbounds i8, ptr %0, i64 103064
  call void @_ZN16b2ContactManager7CollideEv(ptr noundef nonnull align 8 dereferenceable(184) %41)
  %42 = call noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16) %8)
  %43 = getelementptr inbounds i8, ptr %0, i64 103336
  store float %42, ptr %43, align 8, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  br i1 %27, label %44, label %63

44:                                               ; preds = %26
  %45 = getelementptr inbounds i8, ptr %0, i64 103331
  %46 = load i8, ptr %45, align 1, !tbaa !37, !range !23, !noundef !24
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %48, label %54

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  call void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %49 = getelementptr inbounds i8, ptr %0, i64 103272
  %50 = load ptr, ptr %49, align 8, !tbaa !38
  %.not11 = icmp eq ptr %50, null
  br i1 %.not11, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %48
  call void @_ZN7b2World5SolveERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(103352) %0, ptr noundef nonnull align 4 dereferenceable(28) %7)
  %51 = call noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %52 = getelementptr inbounds i8, ptr %0, i64 103340
  store float %51, ptr %52, align 4, !tbaa !39
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  br label %54

.lr.ph:                                           ; preds = %48, %.lr.ph
  %.012 = phi ptr [ %53, %.lr.ph ], [ %50, %48 ]
  call void @_ZN16b2ParticleSystem5SolveERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %.012, ptr noundef nonnull align 4 dereferenceable(28) %7)
  %53 = call noundef ptr @_ZN16b2ParticleSystem7GetNextEv(ptr noundef nonnull align 8 dereferenceable(632) %.012)
  %.not = icmp eq ptr %53, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !40

54:                                               ; preds = %._crit_edge, %44
  %55 = getelementptr inbounds i8, ptr %0, i64 103329
  %56 = load i8, ptr %55, align 1, !tbaa !42, !range !23, !noundef !24
  %57 = trunc nuw i8 %56 to i1
  br i1 %57, label %58, label %61

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @_ZN7b2TimerC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @_ZN7b2World8SolveTOIERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(103352) %0, ptr noundef nonnull align 4 dereferenceable(28) %7)
  %59 = call noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %60 = getelementptr inbounds i8, ptr %0, i64 103348
  store float %59, ptr %60, align 4, !tbaa !43
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  br label %61

61:                                               ; preds = %58, %54
  %62 = load float, ptr %30, align 4, !tbaa !28
  store float %62, ptr %34, align 8, !tbaa !32
  br label %63

63:                                               ; preds = %61, %26
  %64 = getelementptr inbounds i8, ptr %0, i64 103327
  %65 = load i8, ptr %64, align 1, !tbaa !44, !range !23, !noundef !24
  %66 = trunc nuw i8 %65 to i1
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  call void @_ZN7b2World11ClearForcesEv(ptr noundef nonnull align 8 dereferenceable(103352) %0)
  br label %68

68:                                               ; preds = %67, %63
  %69 = getelementptr inbounds i8, ptr %0, i64 103332
  store i8 0, ptr %11, align 2, !tbaa !5
  %70 = call noundef float @_ZNK7b2Timer15GetMillisecondsEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  store float %70, ptr %69, align 4, !tbaa !45
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  ret void
}

declare void @_ZN16b2ContactManager7CollideEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #2

declare void @_ZN16b2ParticleSystem5SolveERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN16b2ParticleSystem7GetNextEv(ptr noundef nonnull align 8 dereferenceable(632)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7b2World11ClearForcesEv(ptr noundef nonnull align 8 dereferenceable(103352)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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, !20, i64 103326}
!6 = !{!"_ZTS7b2World", !7, i64 0, !12, i64 128, !13, i64 103064, !8, i64 103248, !8, i64 103256, !8, i64 103264, !8, i64 103272, !11, i64 103280, !11, i64 103284, !17, i64 103288, !20, i64 103296, !8, i64 103304, !8, i64 103312, !18, i64 103320, !20, i64 103324, !20, i64 103325, !20, i64 103326, !20, i64 103327, !20, i64 103328, !20, i64 103329, !20, i64 103330, !20, i64 103331, !21, i64 103332}
!7 = !{!"_ZTS16b2BlockAllocator", !8, i64 0, !11, i64 8, !11, i64 12, !9, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"_ZTS16b2StackAllocator", !9, i64 0, !11, i64 102400, !11, i64 102404, !11, i64 102408, !9, i64 102416, !11, i64 102928}
!13 = !{!"_ZTS16b2ContactManager", !14, i64 0, !11, i64 144, !8, i64 152, !8, i64 160, !8, i64 168, !8, i64 176}
!14 = !{!"_ZTS12b2BroadPhase", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !15, i64 32, !8, i64 80, !8, i64 88, !8, i64 96, !11, i64 104, !11, i64 108, !19, i64 112, !11, i64 128, !11, i64 132, !20, i64 136}
!15 = !{!"_ZTS10b2TreeNode", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !16, i64 32}
!16 = !{!"_ZTS6b2AABB", !17, i64 0, !17, i64 8}
!17 = !{!"_ZTS6b2Vec2", !18, i64 0, !18, i64 4}
!18 = !{!"float", !9, i64 0}
!19 = !{!"_ZTS14b2IntHashTable", !8, i64 0, !11, i64 8}
!20 = !{!"bool", !9, i64 0}
!21 = !{!"_ZTS9b2Profile", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12, !18, i64 16}
!22 = !{!6, !20, i64 103324}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!6, !20, i64 103325}
!26 = !{!27, !18, i64 0}
!27 = !{!"_ZTS10b2TimeStep", !18, i64 0, !18, i64 4, !18, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !20, i64 24}
!28 = !{!27, !18, i64 4}
!29 = !{!27, !11, i64 12}
!30 = !{!27, !11, i64 16}
!31 = !{!27, !11, i64 20}
!32 = !{!6, !18, i64 103320}
!33 = !{!27, !18, i64 8}
!34 = !{!6, !20, i64 103328}
!35 = !{!27, !20, i64 24}
!36 = !{!6, !18, i64 103336}
!37 = !{!6, !20, i64 103331}
!38 = !{!6, !8, i64 103272}
!39 = !{!6, !18, i64 103340}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!6, !20, i64 103329}
!43 = !{!6, !18, i64 103348}
!44 = !{!6, !20, i64 103327}
!45 = !{!6, !18, i64 103332}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass