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

; 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.b2MassData = type { float, %struct.b2Vec2, float }
%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 }
%class.b2Fixture = type <{ float, [4 x i8], ptr, ptr, ptr, %struct.b2AABB, float, float, float, %struct.b2Filter, i8, [5 x i8], %struct.b2FixtureUserData, i32, [4 x i8] }>
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Filter = type { i16, i16, i16 }
%struct.b2FixtureUserData = type { i64 }

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@__PRETTY_FUNCTION__._ZN6b2Body13ResetMassDataEv = external hidden unnamed_addr constant [29 x i8], align 1
@b2Vec2_zero = external global %struct.b2Vec2, align 4
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Body13ResetMassDataEv(ptr noundef nonnull align 8 dereferenceable(208) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.b2Vec2, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %struct.b2MassData, align 4
  %6 = alloca %struct.b2Vec2, align 4
  %7 = alloca %struct.b2Vec2, align 4
  %8 = alloca %struct.b2Vec2, align 4
  %9 = alloca %struct.b2Vec2, align 4
  %10 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  %12 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 19
  store float 0.000000e+00, ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 20
  store float 0.000000e+00, ptr %13, align 4, !tbaa !21
  %14 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 21
  store float 0.000000e+00, ptr %14, align 8, !tbaa !22
  %15 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 22
  store float 0.000000e+00, ptr %15, align 4, !tbaa !23
  %16 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %17 = getelementptr inbounds %struct.b2Sweep, ptr %16, i32 0, i32 0
  call void @_ZN6b2Vec27SetZeroEv(ptr noundef nonnull align 4 dereferenceable(8) %17)
  %18 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 0
  %19 = load i32, ptr %18, align 8, !tbaa !24
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %25, label %21

21:                                               ; preds = %1
  %22 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !24
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %39

25:                                               ; preds = %21, %1
  %26 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 3
  %27 = getelementptr inbounds %struct.b2Transform, ptr %26, i32 0, i32 0
  %28 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %29 = getelementptr inbounds %struct.b2Sweep, ptr %28, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %27, i64 8, i1 false), !tbaa.struct !25
  %30 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 3
  %31 = getelementptr inbounds %struct.b2Transform, ptr %30, i32 0, i32 0
  %32 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %33 = getelementptr inbounds %struct.b2Sweep, ptr %32, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %31, i64 8, i1 false), !tbaa.struct !25
  %34 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %35 = getelementptr inbounds %struct.b2Sweep, ptr %34, i32 0, i32 4
  %36 = load float, ptr %35, align 4, !tbaa !27
  %37 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %38 = getelementptr inbounds %struct.b2Sweep, ptr %37, i32 0, i32 3
  store float %36, ptr %38, align 4, !tbaa !28
  br label %142

39:                                               ; preds = %21
  %40 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !24
  %42 = icmp eq i32 %41, 2
  br i1 %42, label %43, label %44

43:                                               ; preds = %39
  br label %46

44:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 370, ptr noundef @__PRETTY_FUNCTION__._ZN6b2Body13ResetMassDataEv) #9
  unreachable

45:                                               ; No predecessors!
  br label %46

46:                                               ; preds = %45, %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 @b2Vec2_zero, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #10
  %47 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 13
  %48 = load ptr, ptr %47, align 8, !tbaa !29
  store ptr %48, ptr %4, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %75, %46
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %53, label %52

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

53:                                               ; preds = %49
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %class.b2Fixture, ptr %54, i32 0, i32 0
  %56 = load float, ptr %55, align 8, !tbaa !30
  %57 = fcmp oeq float %56, 0.000000e+00
  br i1 %57, label %58, label %59

58:                                               ; preds = %53
  br label %75

59:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #10
  call void @_ZN10b2MassDataC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %5)
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK9b2Fixture11GetMassDataEP10b2MassData(ptr noundef nonnull align 8 dereferenceable(84) %60, ptr noundef %5)
  %61 = getelementptr inbounds %struct.b2MassData, ptr %5, i32 0, i32 0
  %62 = load float, ptr %61, align 4, !tbaa !36
  %63 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 19
  %64 = load float, ptr %63, align 8, !tbaa !9
  %65 = fadd float %64, %62
  store float %65, ptr %63, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  %66 = getelementptr inbounds %struct.b2MassData, ptr %5, i32 0, i32 0
  %67 = load float, ptr %66, align 4, !tbaa !36
  %68 = getelementptr inbounds %struct.b2MassData, ptr %5, i32 0, i32 1
  %69 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %67, ptr noundef nonnull align 4 dereferenceable(8) %68)
  store <2 x float> %69, ptr %6, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  %70 = getelementptr inbounds %struct.b2MassData, ptr %5, i32 0, i32 2
  %71 = load float, ptr %70, align 4, !tbaa !38
  %72 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 21
  %73 = load float, ptr %72, align 8, !tbaa !22
  %74 = fadd float %73, %71
  store float %74, ptr %72, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #10
  br label %75

75:                                               ; preds = %59, %58
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %class.b2Fixture, ptr %76, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !39
  store ptr %78, ptr %4, align 8, !tbaa !5
  br label %49, !llvm.loop !40

79:                                               ; preds = %52
  %80 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 19
  %81 = load float, ptr %80, align 8, !tbaa !9
  %82 = fcmp ogt float %81, 0.000000e+00
  br i1 %82, label %83, label %90

83:                                               ; preds = %79
  %84 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 19
  %85 = load float, ptr %84, align 8, !tbaa !9
  %86 = fdiv float 1.000000e+00, %85
  %87 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 20
  store float %86, ptr %87, align 4, !tbaa !21
  %88 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 20
  %89 = load float, ptr %88, align 4, !tbaa !21
  call void @_ZN6b2Vec2mLEf(ptr noundef nonnull align 4 dereferenceable(8) %3, float noundef %89)
  br label %90

90:                                               ; preds = %83, %79
  %91 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 21
  %92 = load float, ptr %91, align 8, !tbaa !22
  %93 = fcmp ogt float %92, 0.000000e+00
  br i1 %93, label %94, label %119

94:                                               ; preds = %90
  %95 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 1
  %96 = load i16, ptr %95, align 4, !tbaa !42
  %97 = zext i16 %96 to i32
  %98 = and i32 %97, 16
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %100, label %119

100:                                              ; preds = %94
  %101 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 19
  %102 = load float, ptr %101, align 8, !tbaa !9
  %103 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %104 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 21
  %105 = load float, ptr %104, align 8, !tbaa !22
  %106 = fneg float %102
  %107 = call float @llvm.fmuladd.f32(float %106, float %103, float %105)
  store float %107, ptr %104, align 8, !tbaa !22
  %108 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 21
  %109 = load float, ptr %108, align 8, !tbaa !22
  %110 = fcmp ogt float %109, 0.000000e+00
  br i1 %110, label %111, label %112

111:                                              ; preds = %100
  br label %114

112:                                              ; preds = %100
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 399, ptr noundef @__PRETTY_FUNCTION__._ZN6b2Body13ResetMassDataEv) #9
  unreachable

113:                                              ; No predecessors!
  br label %114

114:                                              ; preds = %113, %111
  %115 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 21
  %116 = load float, ptr %115, align 8, !tbaa !22
  %117 = fdiv float 1.000000e+00, %116
  %118 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 22
  store float %117, ptr %118, align 4, !tbaa !23
  br label %122

119:                                              ; preds = %94, %90
  %120 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 21
  store float 0.000000e+00, ptr %120, align 8, !tbaa !22
  %121 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 22
  store float 0.000000e+00, ptr %121, align 4, !tbaa !23
  br label %122

122:                                              ; preds = %119, %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  %123 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %124 = getelementptr inbounds %struct.b2Sweep, ptr %123, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %124, i64 8, i1 false), !tbaa.struct !25
  %125 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %126 = getelementptr inbounds %struct.b2Sweep, ptr %125, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %126, ptr align 4 %3, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  %127 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 3
  %128 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %129 = getelementptr inbounds %struct.b2Sweep, ptr %128, i32 0, i32 0
  %130 = call <2 x float> @_Z5b2MulRK11b2TransformRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(16) %127, ptr noundef nonnull align 4 dereferenceable(8) %129)
  store <2 x float> %130, ptr %8, align 4
  %131 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %132 = getelementptr inbounds %struct.b2Sweep, ptr %131, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %132, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !25
  %133 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %134 = getelementptr inbounds %struct.b2Sweep, ptr %133, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %134, ptr align 4 %132, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  %135 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 7
  %136 = load float, ptr %135, align 8, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  %137 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 5
  %138 = getelementptr inbounds %struct.b2Sweep, ptr %137, i32 0, i32 2
  %139 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %138, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %139, ptr %10, align 4
  %140 = call <2 x float> @_Z7b2CrossfRK6b2Vec2(float noundef %136, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %140, ptr %9, align 4
  %141 = getelementptr inbounds %class.b2Body, ptr %11, i32 0, i32 6
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %141, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #10
  br label %142

142:                                              ; preds = %122, %25
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10b2MassDataC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK9b2Fixture11GetMassDataEP10b2MassData(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef) #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2mLEf(ptr noundef nonnull align 4 dereferenceable(8), float noundef) #2 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)) #7

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { noreturn nounwind }
attributes #10 = { 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, !16, i64 168}
!10 = !{!"_ZTS6b2Body", !11, i64 0, !12, i64 4, !13, i64 8, !14, i64 12, !14, i64 28, !18, i64 44, !15, i64 80, !16, i64 88, !15, i64 92, !16, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !13, i64 136, !6, i64 144, !6, i64 152, !13, i64 160, !13, i64 164, !16, i64 168, !16, i64 172, !16, i64 176, !16, i64 180, !16, i64 184, !16, i64 188, !16, i64 192, !16, i64 196, !19, i64 200}
!11 = !{!"_ZTS10b2BodyType", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS11b2Transform", !15, i64 0, !17, i64 8}
!15 = !{!"_ZTS6b2Vec2", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTS5b2Rot", !16, i64 0, !16, i64 4}
!18 = !{!"_ZTS7b2Sweep", !15, i64 0, !15, i64 8, !15, i64 16, !16, i64 24, !16, i64 28, !16, i64 32}
!19 = !{!"_ZTS14b2BodyUserData", !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!10, !16, i64 172}
!22 = !{!10, !16, i64 176}
!23 = !{!10, !16, i64 180}
!24 = !{!10, !11, i64 0}
!25 = !{i64 0, i64 4, !26, i64 4, i64 4, !26}
!26 = !{!16, !16, i64 0}
!27 = !{!10, !16, i64 72}
!28 = !{!10, !16, i64 68}
!29 = !{!10, !6, i64 128}
!30 = !{!31, !16, i64 0}
!31 = !{!"_ZTS9b2Fixture", !16, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !32, i64 32, !16, i64 48, !16, i64 52, !16, i64 56, !33, i64 60, !34, i64 66, !35, i64 72, !13, i64 80}
!32 = !{!"_ZTS6b2AABB", !15, i64 0, !15, i64 8}
!33 = !{!"_ZTS8b2Filter", !12, i64 0, !12, i64 2, !12, i64 4}
!34 = !{!"bool", !7, i64 0}
!35 = !{!"_ZTS17b2FixtureUserData", !20, i64 0}
!36 = !{!37, !16, i64 0}
!37 = !{!"_ZTS10b2MassData", !16, i64 0, !15, i64 4, !16, i64 12}
!38 = !{!37, !16, i64 12}
!39 = !{!31, !6, i64 8}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!10, !12, i64 4}
!43 = !{!10, !16, i64 88}


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

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@__PRETTY_FUNCTION__._ZN6b2Body13ResetMassDataEv = external hidden unnamed_addr constant [29 x i8], align 1
@b2Vec2_zero = external local_unnamed_addr global %struct.b2Vec2, align 4
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Body13ResetMassDataEv(ptr noundef nonnull align 8 dereferenceable(208) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %struct.b2Vec2, align 8
  %3 = alloca %struct.b2MassData, align 4
  %4 = alloca %struct.b2Vec2, align 8
  %5 = alloca %struct.b2Vec2, align 8
  %6 = alloca %struct.b2Vec2, align 8
  %7 = alloca %struct.b2Vec2, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 168
  %9 = getelementptr inbounds i8, ptr %0, i64 172
  %10 = getelementptr inbounds i8, ptr %0, i64 176
  %11 = getelementptr inbounds i8, ptr %0, i64 180
  %12 = getelementptr inbounds i8, ptr %0, i64 44
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, i8 0, i64 16, i1 false)
  tail call void @_ZN6b2Vec27SetZeroEv(ptr noundef nonnull align 4 dereferenceable(8) %12)
  %13 = load i32, ptr %0, align 8, !tbaa !5
  switch i32 %13, label %22 [
    i32 0, label %14
    i32 1, label %14
    i32 2, label %23
  ]

14:                                               ; preds = %1, %1
  %15 = getelementptr inbounds i8, ptr %0, i64 12
  %16 = getelementptr inbounds i8, ptr %0, i64 52
  %17 = load i64, ptr %15, align 4
  store i64 %17, ptr %16, align 4
  %18 = getelementptr inbounds i8, ptr %0, i64 60
  store i64 %17, ptr %18, align 4
  %19 = getelementptr inbounds i8, ptr %0, i64 72
  %20 = load float, ptr %19, align 8, !tbaa !20
  %21 = getelementptr inbounds i8, ptr %0, i64 68
  store float %20, ptr %21, align 4, !tbaa !21
  br label %76

22:                                               ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 370, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6b2Body13ResetMassDataEv) #9
  unreachable

23:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #10
  %24 = load i64, ptr @b2Vec2_zero, align 4
  store i64 %24, ptr %2, align 8
  %25 = getelementptr inbounds i8, ptr %0, i64 128
  %.08 = load ptr, ptr %25, align 8, !tbaa !22
  %.not9 = icmp eq ptr %.08, null
  br i1 %.not9, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %23
  %26 = getelementptr inbounds i8, ptr %3, i64 4
  %27 = getelementptr inbounds i8, ptr %3, i64 12
  br label %30

._crit_edge:                                      ; preds = %41, %23
  %28 = load float, ptr %8, align 8, !tbaa !23
  %29 = fcmp ogt float %28, 0.000000e+00
  br i1 %29, label %43, label %45

30:                                               ; preds = %.lr.ph, %41
  %.010 = phi ptr [ %.08, %.lr.ph ], [ %.0, %41 ]
  %31 = load float, ptr %.010, align 8, !tbaa !24
  %32 = fcmp oeq float %31, 0.000000e+00
  br i1 %32, label %41, label %33

33:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #10
  call void @_ZN10b2MassDataC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %3)
  call void @_ZNK9b2Fixture11GetMassDataEP10b2MassData(ptr noundef nonnull align 8 dereferenceable(84) %.010, ptr noundef nonnull %3)
  %34 = load float, ptr %3, align 4, !tbaa !30
  %35 = load float, ptr %8, align 8, !tbaa !23
  %36 = fadd float %34, %35
  store float %36, ptr %8, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #10
  %37 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %34, ptr noundef nonnull align 4 dereferenceable(8) %26)
  store <2 x float> %37, ptr %4, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  %38 = load float, ptr %27, align 4, !tbaa !32
  %39 = load float, ptr %10, align 8, !tbaa !33
  %40 = fadd float %38, %39
  store float %40, ptr %10, align 8, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #10
  br label %41

41:                                               ; preds = %30, %33
  %42 = getelementptr inbounds i8, ptr %.010, i64 8
  %.0 = load ptr, ptr %42, align 8, !tbaa !22
  %.not = icmp eq ptr %.0, null
  br i1 %.not, label %._crit_edge, label %30, !llvm.loop !34

43:                                               ; preds = %._crit_edge
  %44 = fdiv float 1.000000e+00, %28
  store float %44, ptr %9, align 4, !tbaa !36
  call void @_ZN6b2Vec2mLEf(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef %44)
  br label %45

45:                                               ; preds = %43, %._crit_edge
  %46 = load float, ptr %10, align 8, !tbaa !33
  %47 = fcmp ogt float %46, 0.000000e+00
  br i1 %47, label %48, label %63

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %0, i64 4
  %50 = load i16, ptr %49, align 4, !tbaa !37
  %51 = and i16 %50, 16
  %52 = icmp eq i16 %51, 0
  br i1 %52, label %53, label %63

53:                                               ; preds = %48
  %54 = load float, ptr %8, align 8, !tbaa !23
  %55 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %2)
  %56 = load float, ptr %10, align 8, !tbaa !33
  %57 = fneg float %54
  %58 = call float @llvm.fmuladd.f32(float %57, float %55, float %56)
  store float %58, ptr %10, align 8, !tbaa !33
  %59 = fcmp ogt float %58, 0.000000e+00
  br i1 %59, label %61, label %60

60:                                               ; preds = %53
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 399, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6b2Body13ResetMassDataEv) #9
  unreachable

61:                                               ; preds = %53
  %62 = fdiv float 1.000000e+00, %58
  br label %64

63:                                               ; preds = %48, %45
  store float 0.000000e+00, ptr %10, align 8, !tbaa !33
  br label %64

64:                                               ; preds = %63, %61
  %storemerge = phi float [ 0.000000e+00, %63 ], [ %62, %61 ]
  store float %storemerge, ptr %11, align 4, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #10
  %65 = getelementptr inbounds i8, ptr %0, i64 60
  %66 = load i64, ptr %65, align 4
  store i64 %66, ptr %5, align 8
  %67 = load i64, ptr %2, align 8
  store i64 %67, ptr %12, align 4
  %68 = getelementptr inbounds i8, ptr %0, i64 12
  %69 = call <2 x float> @_Z5b2MulRK11b2TransformRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(16) %68, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %69, ptr %65, align 4
  %70 = getelementptr inbounds i8, ptr %0, i64 52
  store <2 x float> %69, ptr %70, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #10
  %71 = getelementptr inbounds i8, ptr %0, i64 88
  %72 = load float, ptr %71, align 8, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #10
  %73 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %65, ptr noundef nonnull align 4 dereferenceable(8) %5)
  store <2 x float> %73, ptr %7, align 8
  %74 = call <2 x float> @_Z7b2CrossfRK6b2Vec2(float noundef %72, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %74, ptr %6, align 8
  %75 = getelementptr inbounds i8, ptr %0, i64 80
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %75, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #10
  br label %76

76:                                               ; preds = %64, %14
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10b2MassDataC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK9b2Fixture11GetMassDataEP10b2MassData(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef) local_unnamed_addr #4 align 2

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

; 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 #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2mLEf(ptr noundef nonnull align 4 dereferenceable(8), float noundef) local_unnamed_addr #1 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 #6

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass