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

; 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.b2Vec2 = type { float, float }
%struct.b2TimeStep = type { float, float, float, i32, i32, i32, i8 }
%class.b2Body = type { i32, i16, i32, %struct.b2Transform, %struct.b2Transform, %struct.b2Sweep, %struct.b2Vec2, float, %struct.b2Vec2, float, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, float, float, float, float, float, float, float, float, %struct.b2BodyUserData }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%struct.b2Sweep = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float }
%struct.b2BodyUserData = type { i64 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8b2Island11SolveOrphanEP6b2BodyRK10b2TimeStepRK6b2Vec2b(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(28) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, i1 noundef zeroext %4) #0 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca float, align 4
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca float, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca %struct.b2Vec2, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca %struct.b2Vec2, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %24 = zext i1 %4 to i8
  store i8 %24, ptr %10, align 1, !tbaa !9
  %25 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.b2TimeStep, ptr %26, i32 0, i32 0
  %28 = load float, ptr %27, align 4, !tbaa !11
  store float %28, ptr %11, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.b2Body, ptr %29, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %30, i64 8, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %class.b2Body, ptr %31, i32 0, i32 7
  %33 = load float, ptr %32, align 8, !tbaa !17
  store float %33, ptr %13, align 4, !tbaa !15
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %class.b2Body, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !27
  %37 = icmp eq i32 %36, 2
  br i1 %37, label %38, label %79

38:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %39 = load float, ptr %11, align 4, !tbaa !15
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %class.b2Body, ptr %40, i32 0, i32 20
  %42 = load float, ptr %41, align 4, !tbaa !28
  %43 = fmul float %39, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.b2Body, ptr %44, i32 0, i32 25
  %46 = load float, ptr %45, align 8, !tbaa !29
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %class.b2Body, ptr %47, i32 0, i32 19
  %49 = load float, ptr %48, align 8, !tbaa !30
  %50 = fmul float %46, %49
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %50, ptr noundef nonnull align 4 dereferenceable(8) %51)
  store <2 x float> %52, ptr %16, align 4
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %class.b2Body, ptr %53, i32 0, i32 8
  %55 = call <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %54)
  store <2 x float> %55, ptr %15, align 4
  %56 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %43, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store <2 x float> %56, ptr %14, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  %57 = load float, ptr %11, align 4, !tbaa !15
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.b2Body, ptr %58, i32 0, i32 22
  %60 = load float, ptr %59, align 4, !tbaa !31
  %61 = fmul float %57, %60
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %class.b2Body, ptr %62, i32 0, i32 9
  %64 = load float, ptr %63, align 4, !tbaa !32
  %65 = load float, ptr %13, align 4, !tbaa !15
  %66 = call float @llvm.fmuladd.f32(float %61, float %64, float %65)
  store float %66, ptr %13, align 4, !tbaa !15
  %67 = load float, ptr %11, align 4, !tbaa !15
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %class.b2Body, ptr %68, i32 0, i32 23
  %70 = load float, ptr %69, align 8, !tbaa !33
  %71 = call float @llvm.fmuladd.f32(float %67, float %70, float 1.000000e+00)
  call void @_ZN6b2Vec2dVEf(ptr noundef nonnull align 4 dereferenceable(8) %12, float noundef %71)
  %72 = load float, ptr %11, align 4, !tbaa !15
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %class.b2Body, ptr %73, i32 0, i32 24
  %75 = load float, ptr %74, align 4, !tbaa !34
  %76 = call float @llvm.fmuladd.f32(float %72, float %75, float 1.000000e+00)
  %77 = load float, ptr %13, align 4, !tbaa !15
  %78 = fdiv float %77, %76
  store float %78, ptr %13, align 4, !tbaa !15
  br label %79

79:                                               ; preds = %38, %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %80 = load float, ptr %11, align 4, !tbaa !15
  %81 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %80, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %81, ptr %17, align 4
  %82 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %17)
  %83 = fcmp ogt float %82, 4.000000e+00
  br i1 %83, label %84, label %88

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %85 = call noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %17)
  %86 = fdiv float 2.000000e+00, %85
  store float %86, ptr %18, align 4, !tbaa !15
  %87 = load float, ptr %18, align 4, !tbaa !15
  call void @_ZN6b2Vec2mLEf(ptr noundef nonnull align 4 dereferenceable(8) %12, float noundef %87)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %88

88:                                               ; preds = %84, %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %89 = load float, ptr %11, align 4, !tbaa !15
  %90 = load float, ptr %13, align 4, !tbaa !15
  %91 = fmul float %89, %90
  store float %91, ptr %19, align 4, !tbaa !15
  %92 = load float, ptr %19, align 4, !tbaa !15
  %93 = load float, ptr %19, align 4, !tbaa !15
  %94 = fmul float %92, %93
  %95 = fcmp ogt float %94, 0x4003BD3CE0000000
  br i1 %95, label %96, label %103

96:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %97 = load float, ptr %19, align 4, !tbaa !15
  %98 = call noundef float @_Z5b2AbsIfET_S0_(float noundef %97)
  %99 = fdiv float 0x3FF921FB60000000, %98
  store float %99, ptr %20, align 4, !tbaa !15
  %100 = load float, ptr %20, align 4, !tbaa !15
  %101 = load float, ptr %13, align 4, !tbaa !15
  %102 = fmul float %101, %100
  store float %102, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %103

103:                                              ; preds = %96, %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %104 = load float, ptr %11, align 4, !tbaa !15
  %105 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %104, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %105, ptr %21, align 4
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.b2Body, ptr %106, i32 0, i32 5
  %108 = getelementptr inbounds %struct.b2Sweep, ptr %107, i32 0, i32 2
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %108, ptr noundef nonnull align 4 dereferenceable(8) %21)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  %109 = load float, ptr %11, align 4, !tbaa !15
  %110 = load float, ptr %13, align 4, !tbaa !15
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %class.b2Body, ptr %111, i32 0, i32 5
  %113 = getelementptr inbounds %struct.b2Sweep, ptr %112, i32 0, i32 4
  %114 = load float, ptr %113, align 4, !tbaa !35
  %115 = call float @llvm.fmuladd.f32(float %109, float %110, float %114)
  store float %115, ptr %113, align 4, !tbaa !35
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %class.b2Body, ptr %116, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %117, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !16
  %118 = load float, ptr %13, align 4, !tbaa !15
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %class.b2Body, ptr %119, i32 0, i32 7
  store float %118, ptr %120, align 8, !tbaa !17
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6b2Body20SynchronizeTransformEv(ptr noundef nonnull align 8 dereferenceable(208) %121)
  %122 = load i8, ptr %10, align 1, !tbaa !9, !range !36, !noundef !37
  %123 = trunc i8 %122 to i1
  br i1 %123, label %124, label %164

124:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store float 0x3F1A36E2E0000000, ptr %22, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store float 0x3F53F6A220000000, ptr %23, align 4, !tbaa !15
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %class.b2Body, ptr %125, i32 0, i32 1
  %127 = load i16, ptr %126, align 4, !tbaa !38
  %128 = zext i16 %127 to i32
  %129 = and i32 %128, 4
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %147, label %131

131:                                              ; preds = %124
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %class.b2Body, ptr %132, i32 0, i32 7
  %134 = load float, ptr %133, align 8, !tbaa !17
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %class.b2Body, ptr %135, i32 0, i32 7
  %137 = load float, ptr %136, align 8, !tbaa !17
  %138 = fmul float %134, %137
  %139 = fcmp ogt float %138, 0x3F53F6A220000000
  br i1 %139, label %147, label %140

140:                                              ; preds = %131
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %class.b2Body, ptr %141, i32 0, i32 6
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %class.b2Body, ptr %143, i32 0, i32 6
  %145 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %142, ptr noundef nonnull align 4 dereferenceable(8) %144)
  %146 = fcmp ogt float %145, 0x3F1A36E2E0000000
  br i1 %146, label %147, label %150

147:                                              ; preds = %140, %131, %124
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %class.b2Body, ptr %148, i32 0, i32 26
  store float 0.000000e+00, ptr %149, align 4, !tbaa !39
  br label %163

150:                                              ; preds = %140
  %151 = load float, ptr %11, align 4, !tbaa !15
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = getelementptr inbounds %class.b2Body, ptr %152, i32 0, i32 26
  %154 = load float, ptr %153, align 4, !tbaa !39
  %155 = fadd float %154, %151
  store float %155, ptr %153, align 4, !tbaa !39
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %class.b2Body, ptr %156, i32 0, i32 26
  %158 = load float, ptr %157, align 4, !tbaa !39
  %159 = fcmp oge float %158, 5.000000e-01
  br i1 %159, label %160, label %162

160:                                              ; preds = %150
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6b2Body8SetAwakeEb(ptr noundef nonnull align 8 dereferenceable(208) %161, i1 noundef zeroext false)
  br label %162

162:                                              ; preds = %160, %150
  br label %163

163:                                              ; preds = %162, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %164

164:                                              ; preds = %163, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmlfRK6b2Vec2(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2dVEf(ptr noundef nonnull align 4 dereferenceable(8), float noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2mLEf(ptr noundef nonnull align 4 dereferenceable(8), float noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2AbsIfET_S0_(float noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6b2Body20SynchronizeTransformEv(ptr noundef nonnull align 8 dereferenceable(208)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6b2Body8SetAwakeEb(ptr noundef nonnull align 8 dereferenceable(208), i1 noundef zeroext) #7 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS10b2TimeStep", !13, i64 0, !13, i64 4, !13, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !10, i64 24}
!13 = !{!"float", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{i64 0, i64 4, !15, i64 4, i64 4, !15}
!17 = !{!18, !13, i64 88}
!18 = !{!"_ZTS6b2Body", !19, i64 0, !20, i64 4, !14, i64 8, !21, i64 12, !21, i64 28, !24, i64 44, !22, i64 80, !13, i64 88, !22, i64 92, !13, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !6, i64 144, !6, i64 152, !14, i64 160, !14, i64 164, !13, i64 168, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !13, i64 192, !13, i64 196, !25, i64 200}
!19 = !{!"_ZTS10b2BodyType", !7, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = !{!"_ZTS11b2Transform", !22, i64 0, !23, i64 8}
!22 = !{!"_ZTS6b2Vec2", !13, i64 0, !13, i64 4}
!23 = !{!"_ZTS5b2Rot", !13, i64 0, !13, i64 4}
!24 = !{!"_ZTS7b2Sweep", !22, i64 0, !22, i64 8, !22, i64 16, !13, i64 24, !13, i64 28, !13, i64 32}
!25 = !{!"_ZTS14b2BodyUserData", !26, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = !{!18, !19, i64 0}
!28 = !{!18, !13, i64 172}
!29 = !{!18, !13, i64 192}
!30 = !{!18, !13, i64 168}
!31 = !{!18, !13, i64 180}
!32 = !{!18, !13, i64 100}
!33 = !{!18, !13, i64 184}
!34 = !{!18, !13, i64 188}
!35 = !{!18, !13, i64 72}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = !{!18, !20, i64 4}
!39 = !{!18, !13, i64 196}


; 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.b2Vec2 = type { float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8b2Island11SolveOrphanEP6b2BodyRK10b2TimeStepRK6b2Vec2b(ptr nocapture noundef nonnull readnone align 8 dereferenceable(80) %0, ptr noundef %1, ptr nocapture noundef nonnull readonly align 4 dereferenceable(28) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, i1 noundef zeroext %4) local_unnamed_addr #0 align 2 {
  %6 = alloca %struct.b2Vec2, align 8
  %7 = alloca %struct.b2Vec2, align 8
  %8 = alloca %struct.b2Vec2, align 8
  %9 = alloca %struct.b2Vec2, align 8
  %10 = alloca %struct.b2Vec2, align 8
  %11 = alloca %struct.b2Vec2, align 8
  %12 = load float, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %13 = getelementptr inbounds i8, ptr %1, i64 80
  %14 = load i64, ptr %13, align 8
  store i64 %14, ptr %6, align 8
  %15 = getelementptr inbounds i8, ptr %1, i64 88
  %16 = load float, ptr %15, align 8, !tbaa !12
  %17 = load i32, ptr %1, align 8, !tbaa !23
  %18 = icmp eq i32 %17, 2
  br i1 %18, label %19, label %45

19:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %20 = getelementptr inbounds i8, ptr %1, i64 172
  %21 = load float, ptr %20, align 4, !tbaa !24
  %22 = fmul float %12, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %23 = getelementptr inbounds i8, ptr %1, i64 192
  %24 = load float, ptr %23, align 8, !tbaa !25
  %25 = getelementptr inbounds i8, ptr %1, i64 168
  %26 = load float, ptr %25, align 8, !tbaa !26
  %27 = fmul float %24, %26
  %28 = tail call <2 x float> @_ZmlfRK6b2Vec2(float noundef %27, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %28, ptr %9, align 8
  %29 = getelementptr inbounds i8, ptr %1, i64 92
  %30 = call <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %29)
  store <2 x float> %30, ptr %8, align 8
  %31 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %22, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %31, ptr %7, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %32 = getelementptr inbounds i8, ptr %1, i64 180
  %33 = load float, ptr %32, align 4, !tbaa !27
  %34 = fmul float %12, %33
  %35 = getelementptr inbounds i8, ptr %1, i64 100
  %36 = load float, ptr %35, align 4, !tbaa !28
  %37 = call float @llvm.fmuladd.f32(float %34, float %36, float %16)
  %38 = getelementptr inbounds i8, ptr %1, i64 184
  %39 = load float, ptr %38, align 8, !tbaa !29
  %40 = call float @llvm.fmuladd.f32(float %12, float %39, float 1.000000e+00)
  call void @_ZN6b2Vec2dVEf(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef %40)
  %41 = getelementptr inbounds i8, ptr %1, i64 188
  %42 = load float, ptr %41, align 4, !tbaa !30
  %43 = call float @llvm.fmuladd.f32(float %12, float %42, float 1.000000e+00)
  %44 = fdiv float %37, %43
  br label %45

45:                                               ; preds = %19, %5
  %.0 = phi float [ %44, %19 ], [ %16, %5 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %46 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %12, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %46, ptr %10, align 8
  %47 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %48 = fcmp ogt float %47, 4.000000e+00
  br i1 %48, label %49, label %52

49:                                               ; preds = %45
  %50 = call noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %51 = fdiv float 2.000000e+00, %50
  call void @_ZN6b2Vec2mLEf(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef %51)
  br label %52

52:                                               ; preds = %49, %45
  %53 = fmul float %12, %.0
  %54 = fmul float %53, %53
  %55 = fcmp ogt float %54, 0x4003BD3CE0000000
  br i1 %55, label %56, label %60

56:                                               ; preds = %52
  %57 = call noundef float @_Z5b2AbsIfET_S0_(float noundef %53)
  %58 = fdiv float 0x3FF921FB60000000, %57
  %59 = fmul float %.0, %58
  br label %60

60:                                               ; preds = %56, %52
  %.1 = phi float [ %59, %56 ], [ %.0, %52 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %61 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %12, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %61, ptr %11, align 8
  %62 = getelementptr inbounds i8, ptr %1, i64 60
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %62, ptr noundef nonnull align 4 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  %63 = getelementptr inbounds i8, ptr %1, i64 72
  %64 = load float, ptr %63, align 4, !tbaa !31
  %65 = call float @llvm.fmuladd.f32(float %12, float %.1, float %64)
  store float %65, ptr %63, align 4, !tbaa !31
  %66 = load i64, ptr %6, align 8
  store i64 %66, ptr %13, align 8
  store float %.1, ptr %15, align 8, !tbaa !12
  call void @_ZN6b2Body20SynchronizeTransformEv(ptr noundef nonnull align 8 dereferenceable(208) %1)
  br i1 %4, label %67, label %87

67:                                               ; preds = %60
  %68 = getelementptr inbounds i8, ptr %1, i64 4
  %69 = load i16, ptr %68, align 4, !tbaa !32
  %70 = and i16 %69, 4
  %71 = icmp eq i16 %70, 0
  br i1 %71, label %79, label %72

72:                                               ; preds = %67
  %73 = load float, ptr %15, align 8, !tbaa !12
  %74 = fmul float %73, %73
  %75 = fcmp ogt float %74, 0x3F53F6A220000000
  br i1 %75, label %79, label %76

76:                                               ; preds = %72
  %77 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %78 = fcmp ogt float %77, 0x3F1A36E2E0000000
  br i1 %78, label %79, label %81

79:                                               ; preds = %76, %72, %67
  %80 = getelementptr inbounds i8, ptr %1, i64 196
  store float 0.000000e+00, ptr %80, align 4, !tbaa !33
  br label %87

81:                                               ; preds = %76
  %82 = getelementptr inbounds i8, ptr %1, i64 196
  %83 = load float, ptr %82, align 4, !tbaa !33
  %84 = fadd float %12, %83
  store float %84, ptr %82, align 4, !tbaa !33
  %85 = fcmp ult float %84, 5.000000e-01
  br i1 %85, label %87, label %86

86:                                               ; preds = %81
  call void @_ZN6b2Body8SetAwakeEb(ptr noundef nonnull align 8 dereferenceable(208) %1, i1 noundef zeroext false)
  br label %87

87:                                               ; preds = %79, %86, %81, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmlfRK6b2Vec2(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2dVEf(ptr noundef nonnull align 4 dereferenceable(8), float noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2mLEf(ptr noundef nonnull align 4 dereferenceable(8), float noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2AbsIfET_S0_(float noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6b2Body20SynchronizeTransformEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6b2Body8SetAwakeEb(ptr noundef nonnull align 8 dereferenceable(208), i1 noundef zeroext) local_unnamed_addr #6 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !7, i64 0}
!6 = !{!"_ZTS10b2TimeStep", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !11, i64 24}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!13, !7, i64 88}
!13 = !{!"_ZTS6b2Body", !14, i64 0, !15, i64 4, !10, i64 8, !16, i64 12, !16, i64 28, !19, i64 44, !17, i64 80, !7, i64 88, !17, i64 92, !7, i64 100, !20, i64 104, !20, i64 112, !20, i64 120, !20, i64 128, !10, i64 136, !20, i64 144, !20, i64 152, !10, i64 160, !10, i64 164, !7, i64 168, !7, i64 172, !7, i64 176, !7, i64 180, !7, i64 184, !7, i64 188, !7, i64 192, !7, i64 196, !21, i64 200}
!14 = !{!"_ZTS10b2BodyType", !8, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!"_ZTS11b2Transform", !17, i64 0, !18, i64 8}
!17 = !{!"_ZTS6b2Vec2", !7, i64 0, !7, i64 4}
!18 = !{!"_ZTS5b2Rot", !7, i64 0, !7, i64 4}
!19 = !{!"_ZTS7b2Sweep", !17, i64 0, !17, i64 8, !17, i64 16, !7, i64 24, !7, i64 28, !7, i64 32}
!20 = !{!"any pointer", !8, i64 0}
!21 = !{!"_ZTS14b2BodyUserData", !22, i64 0}
!22 = !{!"long", !8, i64 0}
!23 = !{!13, !14, i64 0}
!24 = !{!13, !7, i64 172}
!25 = !{!13, !7, i64 192}
!26 = !{!13, !7, i64 168}
!27 = !{!13, !7, i64 180}
!28 = !{!13, !7, i64 100}
!29 = !{!13, !7, i64 184}
!30 = !{!13, !7, i64 188}
!31 = !{!13, !7, i64 72}
!32 = !{!13, !15, i64 4}
!33 = !{!13, !7, i64 196}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass