; LLVM IR from mtsamis/box2d-optimized :: testbed/test.ll (ZN4TestC2Ev)

; 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.DebugDraw = type { %class.b2Draw.base, i8, ptr, ptr, ptr }
%class.b2Draw.base = type <{ ptr, i32 }>
%struct.b2Vec2 = type { float, float }
%struct.b2ParticleSystemDef = type { i8, float, float, float, i32, float, float, float, float, float, float, float, float, float, float, float, float, i32, float, i8, float }
%struct.b2BodyDef = type <{ i32, %struct.b2Vec2, float, %struct.b2Vec2, float, float, float, i8, i8, i8, i8, i8, [7 x i8], %struct.b2BodyUserData, float, [4 x i8] }>
%struct.b2BodyUserData = type { i64 }
%class.Test = type { %class.b2ContactListener, ptr, %struct.b2AABB, [2048 x %struct.ContactPoint], i32, %class.DestructionListener, i32, ptr, ptr, ptr, ptr, i8, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, i8, %struct.b2Vec2, i32, i32, %struct.b2Profile, %struct.b2Profile }
%class.b2ContactListener = type { ptr }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.ContactPoint = type { ptr, ptr, %struct.b2Vec2, %struct.b2Vec2, i32, float, float, float }
%class.DestructionListener = type { %class.b2DestructionListener, ptr }
%class.b2DestructionListener = type { ptr }
%struct.b2Profile = type { float, float, float, float, float }

@_ZTV4Test = external dso_local unnamed_addr constant { [20 x ptr] }, align 8
@g_debugDraw = external global %class.DebugDraw, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4TestC2Ev(ptr noundef nonnull align 8 dereferenceable(98488) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %struct.b2Vec2, align 4
  %6 = alloca %struct.b2ParticleSystemDef, align 4
  %7 = alloca %struct.b2BodyDef, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8
  call void @_ZN17b2ContactListenerC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  store ptr getelementptr inbounds inrange(-16, 144) ({ [20 x ptr] }, ptr @_ZTV4Test, i32 0, i32 0, i32 2), ptr %8, align 8, !tbaa !9
  %9 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 2
  invoke void @_ZN6b2AABBC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %9)
          to label %10 unwind label %77

10:                                               ; preds = %1
  %11 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 3
  %12 = getelementptr inbounds [2048 x %struct.ContactPoint], ptr %11, i32 0, i32 0
  %13 = getelementptr inbounds %struct.ContactPoint, ptr %12, i64 2048
  br label %14

14:                                               ; preds = %16, %10
  %15 = phi ptr [ %12, %10 ], [ %17, %16 ]
  invoke void @_ZN12ContactPointC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15)
          to label %16 unwind label %77

16:                                               ; preds = %14
  %17 = getelementptr inbounds %struct.ContactPoint, ptr %15, i64 1
  %18 = icmp eq ptr %17, %13
  br i1 %18, label %19, label %14

19:                                               ; preds = %16
  %20 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 5
  call void @_ZN19DestructionListenerC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #9
  %21 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 12
  invoke void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %21)
          to label %22 unwind label %81

22:                                               ; preds = %19
  %23 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 13
  invoke void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %23)
          to label %24 unwind label %81

24:                                               ; preds = %22
  %25 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 14
  invoke void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %25)
          to label %26 unwind label %81

26:                                               ; preds = %24
  %27 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 16
  invoke void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %27)
          to label %28 unwind label %81

28:                                               ; preds = %26
  %29 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 19
  %30 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 20
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  invoke void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %5)
          to label %31 unwind label %85

31:                                               ; preds = %28
  invoke void @_ZN6b2Vec23SetEff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef 0.000000e+00, float noundef -1.000000e+01)
          to label %32 unwind label %85

32:                                               ; preds = %31
  %33 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 103352) #10
          to label %34 unwind label %85

34:                                               ; preds = %32
  invoke void @_ZN7b2WorldC1ERK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(103352) %33, ptr noundef nonnull align 4 dereferenceable(8) %5)
          to label %35 unwind label %89

35:                                               ; preds = %34
  %36 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 7
  store ptr %33, ptr %36, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 84, ptr %6) #9
  invoke void @_ZN19b2ParticleSystemDefC2Ev(ptr noundef nonnull align 4 dereferenceable(84) %6)
          to label %37 unwind label %93

37:                                               ; preds = %35
  %38 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 7
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = invoke noundef ptr @_ZN7b2World20CreateParticleSystemEPK19b2ParticleSystemDef(ptr noundef nonnull align 8 dereferenceable(103352) %39, ptr noundef %6)
          to label %41 unwind label %93

41:                                               ; preds = %37
  %42 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 8
  store ptr %40, ptr %42, align 8, !tbaa !22
  %43 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 8
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  invoke void @_ZN16b2ParticleSystem15SetGravityScaleEf(ptr noundef nonnull align 8 dereferenceable(632) %44, float noundef 0x3FD99999A0000000)
          to label %45 unwind label %93

45:                                               ; preds = %41
  %46 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 8
  %47 = load ptr, ptr %46, align 8, !tbaa !22
  invoke void @_ZN16b2ParticleSystem10SetDensityEf(ptr noundef nonnull align 8 dereferenceable(632) %47, float noundef 0x3FF3333340000000)
          to label %48 unwind label %93

48:                                               ; preds = %45
  %49 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 9
  store ptr null, ptr %49, align 8, !tbaa !23
  %50 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 6
  store i32 30, ptr %50, align 8, !tbaa !24
  %51 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 18
  store i32 13, ptr %51, align 4, !tbaa !25
  %52 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 10
  store ptr null, ptr %52, align 8, !tbaa !26
  %53 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 4
  store i32 0, ptr %53, align 8, !tbaa !27
  %54 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 5
  %55 = getelementptr inbounds %class.DestructionListener, ptr %54, i32 0, i32 1
  store ptr %8, ptr %55, align 8, !tbaa !28
  %56 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 7
  %57 = load ptr, ptr %56, align 8, !tbaa !11
  %58 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 5
  invoke void @_ZN7b2World22SetDestructionListenerEP21b2DestructionListener(ptr noundef nonnull align 8 dereferenceable(103352) %57, ptr noundef %58)
          to label %59 unwind label %93

59:                                               ; preds = %48
  %60 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 7
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  invoke void @_ZN7b2World18SetContactListenerEP17b2ContactListener(ptr noundef nonnull align 8 dereferenceable(103352) %61, ptr noundef %8)
          to label %62 unwind label %93

62:                                               ; preds = %59
  %63 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 7
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  invoke void @_ZN7b2World12SetDebugDrawEP6b2Draw(ptr noundef nonnull align 8 dereferenceable(103352) %64, ptr noundef @g_debugDraw)
          to label %65 unwind label %93

65:                                               ; preds = %62
  %66 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 11
  store i8 0, ptr %66, align 8, !tbaa !29
  %67 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 15
  store i8 0, ptr %67, align 4, !tbaa !30
  %68 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 17
  store i32 0, ptr %68, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #9
  invoke void @_ZN9b2BodyDefC2Ev(ptr noundef nonnull align 8 dereferenceable(60) %7)
          to label %69 unwind label %97

69:                                               ; preds = %65
  %70 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 7
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = invoke noundef ptr @_ZN7b2World10CreateBodyEPK9b2BodyDef(ptr noundef nonnull align 8 dereferenceable(103352) %71, ptr noundef %7)
          to label %73 unwind label %97

73:                                               ; preds = %69
  %74 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 1
  store ptr %72, ptr %74, align 8, !tbaa !32
  %75 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 19
  call void @llvm.memset.p0.i64(ptr align 8 %75, i8 0, i64 20, i1 false)
  %76 = getelementptr inbounds %class.Test, ptr %8, i32 0, i32 20
  call void @llvm.memset.p0.i64(ptr align 4 %76, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 84, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  ret void

77:                                               ; preds = %14, %1
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %3, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %4, align 4
  br label %104

81:                                               ; preds = %26, %24, %22, %19
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %3, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %4, align 4
  br label %103

85:                                               ; preds = %32, %31, %28
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %3, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %4, align 4
  br label %102

89:                                               ; preds = %34
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %3, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %33, i64 noundef 103352) #11
  br label %102

93:                                               ; preds = %62, %59, %48, %45, %41, %37, %35
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %3, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %4, align 4
  br label %101

97:                                               ; preds = %69, %65
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %3, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #9
  br label %101

101:                                              ; preds = %97, %93
  call void @llvm.lifetime.end.p0(i64 84, ptr %6) #9
  br label %102

102:                                              ; preds = %101, %89, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  br label %103

103:                                              ; preds = %102, %81
  call void @_ZN21b2DestructionListenerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #9
  br label %104

104:                                              ; preds = %103, %77
  call void @_ZN17b2ContactListenerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  br label %105

105:                                              ; preds = %104
  %106 = load ptr, ptr %3, align 8
  %107 = load i32, ptr %4, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #5

declare void @_ZN7b2WorldC1ERK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #6

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN19b2ParticleSystemDefC2Ev(ptr noundef nonnull align 4 dereferenceable(84)) unnamed_addr #3 align 2

declare noundef ptr @_ZN7b2World20CreateParticleSystemEPK19b2ParticleSystemDef(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16b2ParticleSystem15SetGravityScaleEf(ptr noundef nonnull align 8 dereferenceable(632), float noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16b2ParticleSystem10SetDensityEf(ptr noundef nonnull align 8 dereferenceable(632), float noundef) #1 align 2

declare void @_ZN7b2World22SetDestructionListenerEP21b2DestructionListener(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) #6

declare void @_ZN7b2World18SetContactListenerEP17b2ContactListener(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) #6

declare void @_ZN7b2World12SetDebugDrawEP6b2Draw(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) #6

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

declare noundef ptr @_ZN7b2World10CreateBodyEPK9b2BodyDef(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) #6

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17b2ContactListenerD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nobuiltin allocsize(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 = { "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 = { nobuiltin 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 #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 98368}
!12 = !{!"_ZTS4Test", !13, i64 0, !6, i64 8, !14, i64 16, !7, i64 32, !17, i64 98336, !18, i64 98344, !17, i64 98360, !6, i64 98368, !6, i64 98376, !6, i64 98384, !6, i64 98392, !20, i64 98400, !15, i64 98404, !15, i64 98412, !15, i64 98420, !20, i64 98428, !15, i64 98432, !17, i64 98440, !17, i64 98444, !21, i64 98448, !21, i64 98468}
!13 = !{!"_ZTS17b2ContactListener"}
!14 = !{!"_ZTS6b2AABB", !15, i64 0, !15, i64 8}
!15 = !{!"_ZTS6b2Vec2", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTS19DestructionListener", !19, i64 0, !6, i64 8}
!19 = !{!"_ZTS21b2DestructionListener"}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTS9b2Profile", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16}
!22 = !{!12, !6, i64 98376}
!23 = !{!12, !6, i64 98384}
!24 = !{!12, !17, i64 98360}
!25 = !{!12, !17, i64 98444}
!26 = !{!12, !6, i64 98392}
!27 = !{!12, !17, i64 98336}
!28 = !{!12, !6, i64 98352}
!29 = !{!12, !20, i64 98400}
!30 = !{!12, !20, i64 98428}
!31 = !{!12, !17, i64 98440}
!32 = !{!12, !6, i64 8}


; 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.DebugDraw = type { %class.b2Draw.base, i8, ptr, ptr, ptr }
%class.b2Draw.base = type <{ ptr, i32 }>
%struct.b2Vec2 = type { float, float }
%struct.b2ParticleSystemDef = type { i8, float, float, float, i32, float, float, float, float, float, float, float, float, float, float, float, float, i32, float, i8, float }
%struct.b2BodyDef = type <{ i32, %struct.b2Vec2, float, %struct.b2Vec2, float, float, float, i8, i8, i8, i8, i8, [7 x i8], %struct.b2BodyUserData, float, [4 x i8] }>
%struct.b2BodyUserData = type { i64 }

@_ZTV4Test = external dso_local unnamed_addr constant { [20 x ptr] }, align 8
@g_debugDraw = external global %class.DebugDraw, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4TestC2Ev(ptr noundef nonnull align 8 dereferenceable(98488) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.b2Vec2, align 4
  %3 = alloca %struct.b2ParticleSystemDef, align 4
  %4 = alloca %struct.b2BodyDef, align 8
  tail call void @_ZN17b2ContactListenerC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #9
  store ptr getelementptr inbounds inrange(-16, 144) (i8, ptr @_ZTV4Test, i64 16), ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  invoke void @_ZN6b2AABBC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %5)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %1, %6
  %.idx = phi i64 [ %.add, %6 ], [ 32, %1 ]
  %.ptr = getelementptr inbounds i8, ptr %0, i64 %.idx
  invoke void @_ZN12ContactPointC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %.ptr)
          to label %6 unwind label %.loopexit

6:                                                ; preds = %.preheader
  %.add = add nuw nsw i64 %.idx, 48
  %7 = icmp eq i64 %.add, 98336
  br i1 %7, label %8, label %.preheader

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 98344
  tail call void @_ZN19DestructionListenerC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #9
  %10 = getelementptr inbounds i8, ptr %0, i64 98404
  tail call void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 98412
  tail call void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %11)
  %12 = getelementptr inbounds i8, ptr %0, i64 98420
  tail call void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %12)
  %13 = getelementptr inbounds i8, ptr %0, i64 98432
  tail call void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  call void @_ZN6b2Vec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @_ZN6b2Vec23SetEff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef 0.000000e+00, float noundef -1.000000e+01)
  %14 = invoke noalias noundef nonnull dereferenceable(103352) ptr @_Znwm(i64 noundef 103352) #10
          to label %15 unwind label %44

15:                                               ; preds = %8
  invoke void @_ZN7b2WorldC1ERK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(103352) %14, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %16 unwind label %46

16:                                               ; preds = %15
  %17 = getelementptr inbounds i8, ptr %0, i64 98368
  store ptr %14, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %3) #9
  call void @_ZN19b2ParticleSystemDefC2Ev(ptr noundef nonnull align 4 dereferenceable(84) %3)
  %18 = load ptr, ptr %17, align 8, !tbaa !8
  %19 = invoke noundef ptr @_ZN7b2World20CreateParticleSystemEPK19b2ParticleSystemDef(ptr noundef nonnull align 8 dereferenceable(103352) %18, ptr noundef nonnull %3)
          to label %20 unwind label %48

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %0, i64 98376
  store ptr %19, ptr %21, align 8, !tbaa !21
  call void @_ZN16b2ParticleSystem15SetGravityScaleEf(ptr noundef nonnull align 8 dereferenceable(632) %19, float noundef 0x3FD99999A0000000)
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  call void @_ZN16b2ParticleSystem10SetDensityEf(ptr noundef nonnull align 8 dereferenceable(632) %22, float noundef 0x3FF3333340000000)
  %23 = getelementptr inbounds i8, ptr %0, i64 98384
  store ptr null, ptr %23, align 8, !tbaa !22
  %24 = getelementptr inbounds i8, ptr %0, i64 98360
  store i32 30, ptr %24, align 8, !tbaa !23
  %25 = getelementptr inbounds i8, ptr %0, i64 98444
  store i32 13, ptr %25, align 4, !tbaa !24
  %26 = getelementptr inbounds i8, ptr %0, i64 98392
  store ptr null, ptr %26, align 8, !tbaa !25
  %27 = getelementptr inbounds i8, ptr %0, i64 98336
  store i32 0, ptr %27, align 8, !tbaa !26
  %28 = getelementptr inbounds i8, ptr %0, i64 98352
  store ptr %0, ptr %28, align 8, !tbaa !27
  %29 = load ptr, ptr %17, align 8, !tbaa !8
  invoke void @_ZN7b2World22SetDestructionListenerEP21b2DestructionListener(ptr noundef nonnull align 8 dereferenceable(103352) %29, ptr noundef nonnull %9)
          to label %30 unwind label %48

30:                                               ; preds = %20
  %31 = load ptr, ptr %17, align 8, !tbaa !8
  invoke void @_ZN7b2World18SetContactListenerEP17b2ContactListener(ptr noundef nonnull align 8 dereferenceable(103352) %31, ptr noundef nonnull %0)
          to label %32 unwind label %48

32:                                               ; preds = %30
  %33 = load ptr, ptr %17, align 8, !tbaa !8
  invoke void @_ZN7b2World12SetDebugDrawEP6b2Draw(ptr noundef nonnull align 8 dereferenceable(103352) %33, ptr noundef nonnull @g_debugDraw)
          to label %34 unwind label %48

34:                                               ; preds = %32
  %35 = getelementptr inbounds i8, ptr %0, i64 98400
  store i8 0, ptr %35, align 8, !tbaa !28
  %36 = getelementptr inbounds i8, ptr %0, i64 98428
  store i8 0, ptr %36, align 4, !tbaa !29
  %37 = getelementptr inbounds i8, ptr %0, i64 98440
  store i32 0, ptr %37, align 8, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #9
  invoke void @_ZN9b2BodyDefC2Ev(ptr noundef nonnull align 8 dereferenceable(60) %4)
          to label %38 unwind label %50

38:                                               ; preds = %34
  %39 = load ptr, ptr %17, align 8, !tbaa !8
  %40 = invoke noundef ptr @_ZN7b2World10CreateBodyEPK9b2BodyDef(ptr noundef nonnull align 8 dereferenceable(103352) %39, ptr noundef nonnull %4)
          to label %41 unwind label %50

41:                                               ; preds = %38
  %42 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %40, ptr %42, align 8, !tbaa !31
  %43 = getelementptr inbounds i8, ptr %0, i64 98448
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %43, i8 0, i64 40, i1 false)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  ret void

.loopexit:                                        ; preds = %.preheader
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %54

.loopexit.split-lp:                               ; preds = %1
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %54

44:                                               ; preds = %8
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %53

46:                                               ; preds = %15
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %14, i64 noundef 103352) #11
  br label %53

48:                                               ; preds = %32, %30, %20, %16
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %38, %34
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #9
  br label %52

52:                                               ; preds = %50, %48
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %3) #9
  br label %53

53:                                               ; preds = %52, %46, %44
  %.pn.pn = phi { ptr, i32 } [ %.pn, %52 ], [ %47, %46 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @_ZN21b2DestructionListenerD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #9
  br label %54

54:                                               ; preds = %.loopexit, %.loopexit.split-lp, %53
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %53 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN17b2ContactListenerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #9
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #5

declare void @_ZN7b2WorldC1ERK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #6

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN19b2ParticleSystemDefC2Ev(ptr noundef nonnull align 4 dereferenceable(84)) unnamed_addr #3 align 2

declare noundef ptr @_ZN7b2World20CreateParticleSystemEPK19b2ParticleSystemDef(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16b2ParticleSystem15SetGravityScaleEf(ptr noundef nonnull align 8 dereferenceable(632), float noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16b2ParticleSystem10SetDensityEf(ptr noundef nonnull align 8 dereferenceable(632), float noundef) local_unnamed_addr #1 align 2

declare void @_ZN7b2World22SetDestructionListenerEP21b2DestructionListener(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) local_unnamed_addr #6

declare void @_ZN7b2World18SetContactListenerEP17b2ContactListener(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) local_unnamed_addr #6

declare void @_ZN7b2World12SetDebugDrawEP6b2Draw(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) local_unnamed_addr #6

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

declare noundef ptr @_ZN7b2World10CreateBodyEPK9b2BodyDef(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef) local_unnamed_addr #6

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17b2ContactListenerD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 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 = { 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 #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 willreturn memory(argmem: readwrite) }
attributes #5 = { nobuiltin allocsize(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 = { "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 = { nobuiltin 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 #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 98368}
!9 = !{!"_ZTS4Test", !10, i64 0, !11, i64 8, !13, i64 16, !12, i64 32, !16, i64 98336, !17, i64 98344, !16, i64 98360, !11, i64 98368, !11, i64 98376, !11, i64 98384, !11, i64 98392, !19, i64 98400, !14, i64 98404, !14, i64 98412, !14, i64 98420, !19, i64 98428, !14, i64 98432, !16, i64 98440, !16, i64 98444, !20, i64 98448, !20, i64 98468}
!10 = !{!"_ZTS17b2ContactListener"}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"_ZTS6b2AABB", !14, i64 0, !14, i64 8}
!14 = !{!"_ZTS6b2Vec2", !15, i64 0, !15, i64 4}
!15 = !{!"float", !12, i64 0}
!16 = !{!"int", !12, i64 0}
!17 = !{!"_ZTS19DestructionListener", !18, i64 0, !11, i64 8}
!18 = !{!"_ZTS21b2DestructionListener"}
!19 = !{!"bool", !12, i64 0}
!20 = !{!"_ZTS9b2Profile", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16}
!21 = !{!9, !11, i64 98376}
!22 = !{!9, !11, i64 98384}
!23 = !{!9, !16, i64 98360}
!24 = !{!9, !16, i64 98444}
!25 = !{!9, !11, i64 98392}
!26 = !{!9, !16, i64 98336}
!27 = !{!9, !11, i64 98352}
!28 = !{!9, !19, i64 98400}
!29 = !{!9, !19, i64 98428}
!30 = !{!9, !16, i64 98440}
!31 = !{!9, !11, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass