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

; 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.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.b2Vec2 = type { float, float }
%struct.b2Filter = type { i16, i16, i16 }
%struct.b2FixtureUserData = type { i64 }

@_ZZN9b2FixtureC1EvE11idGenerator = external hidden global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9b2FixtureC2Ev(ptr noundef nonnull align 8 dereferenceable(84) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %class.b2Fixture, ptr %3, i32 0, i32 5
  call void @_ZN6b2AABBC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %4)
  %5 = getelementptr inbounds %class.b2Fixture, ptr %3, i32 0, i32 9
  call void @_ZN8b2FilterC2Ev(ptr noundef nonnull align 2 dereferenceable(6) %5)
  %6 = getelementptr inbounds %class.b2Fixture, ptr %3, i32 0, i32 12
  call void @_ZN17b2FixtureUserDataC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %7 = getelementptr inbounds %class.b2Fixture, ptr %3, i32 0, i32 3
  store ptr null, ptr %7, align 8, !tbaa !9
  %8 = getelementptr inbounds %class.b2Fixture, ptr %3, i32 0, i32 2
  store ptr null, ptr %8, align 8, !tbaa !20
  %9 = getelementptr inbounds %class.b2Fixture, ptr %3, i32 0, i32 4
  store ptr null, ptr %9, align 8, !tbaa !21
  %10 = getelementptr inbounds %class.b2Fixture, ptr %3, i32 0, i32 0
  store float 0.000000e+00, ptr %10, align 8, !tbaa !22
  %11 = load i32, ptr @_ZZN9b2FixtureC1EvE11idGenerator, align 4, !tbaa !23
  %12 = add i32 %11, 1
  store i32 %12, ptr @_ZZN9b2FixtureC1EvE11idGenerator, align 4, !tbaa !23
  %13 = getelementptr inbounds %class.b2Fixture, ptr %3, i32 0, i32 13
  store i32 %11, ptr %13, align 8, !tbaa !24
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8b2FilterC2Ev(ptr noundef nonnull align 2 dereferenceable(6)) unnamed_addr #2 align 2

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

attributes #0 = { 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 #1 = { 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 #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" }

!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, !6, i64 16}
!10 = !{!"_ZTS9b2Fixture", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !11, i64 48, !11, i64 52, !11, i64 56, !14, i64 60, !16, i64 66, !17, i64 72, !19, i64 80}
!11 = !{!"float", !7, i64 0}
!12 = !{!"_ZTS6b2AABB", !13, i64 0, !13, i64 8}
!13 = !{!"_ZTS6b2Vec2", !11, i64 0, !11, i64 4}
!14 = !{!"_ZTS8b2Filter", !15, i64 0, !15, i64 2, !15, i64 4}
!15 = !{!"short", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTS17b2FixtureUserData", !18, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!10, !6, i64 8}
!21 = !{!10, !6, i64 24}
!22 = !{!10, !11, i64 0}
!23 = !{!19, !19, i64 0}
!24 = !{!10, !19, i64 80}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@_ZZN9b2FixtureC1EvE11idGenerator = external hidden local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9b2FixtureC2Ev(ptr noundef nonnull align 8 dereferenceable(84) %0) unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @_ZN6b2AABBC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %2)
  %3 = getelementptr inbounds i8, ptr %0, i64 60
  tail call void @_ZN8b2FilterC2Ev(ptr noundef nonnull align 2 dereferenceable(6) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @_ZN17b2FixtureUserDataC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store float 0.000000e+00, ptr %0, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, i8 0, i64 24, i1 false)
  %6 = load i32, ptr @_ZZN9b2FixtureC1EvE11idGenerator, align 4, !tbaa !19
  %7 = add i32 %6, 1
  store i32 %7, ptr @_ZZN9b2FixtureC1EvE11idGenerator, align 4, !tbaa !19
  %8 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 %6, ptr %8, align 8, !tbaa !20
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8b2FilterC2Ev(ptr noundef nonnull align 2 dereferenceable(6)) unnamed_addr #2 align 2

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

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

attributes #0 = { 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 #1 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = !{!"_ZTS9b2Fixture", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !7, i64 48, !7, i64 52, !7, i64 56, !13, i64 60, !15, i64 66, !16, i64 72, !18, i64 80}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTS6b2AABB", !12, i64 0, !12, i64 8}
!12 = !{!"_ZTS6b2Vec2", !7, i64 0, !7, i64 4}
!13 = !{!"_ZTS8b2Filter", !14, i64 0, !14, i64 2, !14, i64 4}
!14 = !{!"short", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"_ZTS17b2FixtureUserData", !17, i64 0}
!17 = !{!"long", !8, i64 0}
!18 = !{!"int", !8, i64 0}
!19 = !{!18, !18, i64 0}
!20 = !{!6, !18, i64 80}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass