; LLVM IR from erincatto/box2d :: src (types)

; 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.b2WorldDef = type { %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i8, i8, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2Vec2 = type { float, float }

@b2_lengthUnitsPerMeter = external global float, align 4

; Function Attrs: nounwind uwtable
define dso_local void @b2DefaultWorldDef(ptr dead_on_unwind noalias writable sret(%struct.b2WorldDef) align 8 %0) #0 {
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 104, i1 false)
  %2 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 0
  %3 = getelementptr inbounds %struct.b2Vec2, ptr %2, i32 0, i32 0
  store float 0.000000e+00, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 0
  %5 = getelementptr inbounds %struct.b2Vec2, ptr %4, i32 0, i32 1
  store float -1.000000e+01, ptr %5, align 4, !tbaa !14
  %6 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !15
  %7 = fmul float 1.000000e+00, %6
  %8 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 2
  store float %7, ptr %8, align 4, !tbaa !16
  %9 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !15
  %10 = fmul float 1.000000e+00, %9
  %11 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 1
  store float %10, ptr %11, align 8, !tbaa !17
  %12 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !15
  %13 = fmul float 3.000000e+00, %12
  %14 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 5
  store float %13, ptr %14, align 8, !tbaa !18
  %15 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 3
  store float 3.000000e+01, ptr %15, align 8, !tbaa !19
  %16 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 4
  store float 1.000000e+01, ptr %16, align 4, !tbaa !20
  %17 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 6
  store float 6.000000e+01, ptr %17, align 4, !tbaa !21
  %18 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 7
  store float 2.000000e+00, ptr %18, align 8, !tbaa !22
  %19 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !15
  %20 = fmul float 4.000000e+02, %19
  %21 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 8
  store float %20, ptr %21, align 4, !tbaa !23
  %22 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 11
  store i8 1, ptr %22, align 8, !tbaa !24
  %23 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 12
  store i8 1, ptr %23, align 1, !tbaa !25
  %24 = getelementptr inbounds %struct.b2WorldDef, ptr %0, i32 0, i32 18
  store i32 1152023, ptr %24, align 8, !tbaa !26
  ret void
}

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

attributes #0 = { 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 #1 = { 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, !8, i64 0}
!6 = !{!"b2WorldDef", !7, i64 0, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36, !11, i64 40, !11, i64 48, !12, i64 56, !12, i64 57, !13, i64 60, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !13, i64 96}
!7 = !{!"b2Vec2", !8, i64 0, !8, i64 4}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_Bool", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!6, !8, i64 4}
!15 = !{!8, !8, i64 0}
!16 = !{!6, !8, i64 12}
!17 = !{!6, !8, i64 8}
!18 = !{!6, !8, i64 24}
!19 = !{!6, !8, i64 16}
!20 = !{!6, !8, i64 20}
!21 = !{!6, !8, i64 28}
!22 = !{!6, !8, i64 32}
!23 = !{!6, !8, i64 36}
!24 = !{!6, !12, i64 56}
!25 = !{!6, !12, i64 57}
!26 = !{!6, !13, i64 96}


; 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.b2WorldDef = type { %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i8, i8, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2Vec2 = type { float, float }

@b2_lengthUnitsPerMeter = external local_unnamed_addr global float, align 4

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) uwtable
define dso_local void @b2DefaultWorldDef(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.b2WorldDef) align 8 %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %0, i8 0, i64 104, i1 false)
  store float -1.000000e+01, ptr %2, align 4, !tbaa !5
  %3 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !14
  %4 = getelementptr inbounds i8, ptr %0, i64 12
  store float %3, ptr %4, align 4, !tbaa !15
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store float %3, ptr %5, align 8, !tbaa !16
  %6 = fmul float %3, 3.000000e+00
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  store float %6, ptr %7, align 8, !tbaa !17
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  store <2 x float> <float 3.000000e+01, float 1.000000e+01>, ptr %8, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %0, i64 28
  store <2 x float> <float 6.000000e+01, float 2.000000e+00>, ptr %9, align 4, !tbaa !14
  %10 = fmul float %3, 4.000000e+02
  %11 = getelementptr inbounds i8, ptr %0, i64 36
  store float %10, ptr %11, align 4, !tbaa !18
  %12 = getelementptr inbounds i8, ptr %0, i64 56
  store i8 1, ptr %12, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %0, i64 57
  store i8 1, ptr %13, align 1, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 1152023, ptr %14, align 8, !tbaa !21
  ret void
}

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) 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 = { mustprogress 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, !8, i64 4}
!6 = !{!"b2WorldDef", !7, i64 0, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36, !11, i64 40, !11, i64 48, !12, i64 56, !12, i64 57, !13, i64 60, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !13, i64 96}
!7 = !{!"b2Vec2", !8, i64 0, !8, i64 4}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_Bool", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!8, !8, i64 0}
!15 = !{!6, !8, i64 12}
!16 = !{!6, !8, i64 8}
!17 = !{!6, !8, i64 24}
!18 = !{!6, !8, i64 36}
!19 = !{!6, !12, i64 56}
!20 = !{!6, !12, i64 57}
!21 = !{!6, !13, i64 96}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,TailCallElimPass