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

; 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.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.b2StepContext = type { float, float, float, float, i32, %struct.b2Softness, %struct.b2Softness, %struct.b2Softness, float, float, ptr, ptr, ptr, ptr, ptr, i32, ptr, %struct.b2AtomicInt, ptr, ptr, ptr, i32, i32, ptr, i32, i8, [64 x i8], %struct.b2AtomicU32, [64 x i8] }
%struct.b2Softness = type { float, float, float }
%struct.b2AtomicInt = type { i32 }
%struct.b2AtomicU32 = type { i32 }
%struct.b2ConstraintGraph = type { [12 x %struct.b2GraphColor] }
%struct.b2GraphColor = type { %struct.b2BitSet, %struct.b2ContactSimArray, %struct.b2JointSimArray, %union.anon }
%struct.b2BitSet = type { ptr, i32, i32 }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon = type { ptr }
%struct.b2World = type { %struct.b2ArenaAllocator, %struct.b2BroadPhase, %struct.b2ConstraintGraph, %struct.b2IdPool, %struct.b2BodyArray, %struct.b2IdPool, %struct.b2SolverSetArray, %struct.b2IdPool, %struct.b2JointArray, %struct.b2IdPool, %struct.b2ContactArray, %struct.b2IdPool, %struct.b2IslandArray, %struct.b2IdPool, %struct.b2IdPool, %struct.b2ShapeArray, %struct.b2ChainShapeArray, %struct.b2SensorArray, %struct.b2TaskContextArray, %struct.b2SensorTaskContextArray, %struct.b2BodyMoveEventArray, %struct.b2SensorBeginTouchEventArray, %struct.b2ContactBeginTouchEventArray, [2 x %struct.b2SensorEndTouchEventArray], [2 x %struct.b2ContactEndTouchEventArray], i32, %struct.b2ContactHitEventArray, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, i64, i32, %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i16, %struct.b2Profile, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, float, i32, i32, i16, i8, i8, i8, i8, i8, i8 }
%struct.b2ArenaAllocator = type { ptr, i32, i32, i32, i32, %struct.b2ArenaEntryArray }
%struct.b2ArenaEntryArray = type { ptr, i32, i32 }
%struct.b2BroadPhase = type { [3 x %struct.b2DynamicTree], i32, %struct.b2HashSet, %struct.b2IntArray, ptr, ptr, i32, %struct.b2AtomicInt, %struct.b2HashSet }
%struct.b2DynamicTree = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2IntArray = type { ptr, i32, i32 }
%struct.b2HashSet = type { ptr, i32, i32 }
%struct.b2BodyArray = type { ptr, i32, i32 }
%struct.b2SolverSetArray = type { ptr, i32, i32 }
%struct.b2JointArray = type { ptr, i32, i32 }
%struct.b2ContactArray = type { ptr, i32, i32 }
%struct.b2IslandArray = type { ptr, i32, i32 }
%struct.b2IdPool = type { %struct.b2IntArray, i32 }
%struct.b2ShapeArray = type { ptr, i32, i32 }
%struct.b2ChainShapeArray = type { ptr, i32, i32 }
%struct.b2SensorArray = type { ptr, i32, i32 }
%struct.b2TaskContextArray = type { ptr, i32, i32 }
%struct.b2SensorTaskContextArray = type { ptr, i32, i32 }
%struct.b2BodyMoveEventArray = type { ptr, i32, i32 }
%struct.b2SensorBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2SensorEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactHitEventArray = type { ptr, i32, i32 }
%struct.b2Profile = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
%struct.b2SolverSet = type { %struct.b2BodySimArray, %struct.b2BodyStateArray, %struct.b2JointSimArray, %struct.b2ContactSimArray, %struct.b2IslandSimArray, i32 }
%struct.b2BodySimArray = type { ptr, i32, i32 }
%struct.b2BodyStateArray = type { ptr, i32, i32 }
%struct.b2IslandSimArray = type { ptr, i32, i32 }
%struct.b2ContactConstraint = type { i32, i32, [2 x %struct.b2ContactConstraintPoint], %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, %struct.b2Softness, i32 }
%struct.b2ContactConstraintPoint = type { %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float }

@__const.b2ApplyOverflowRestitution.dummyState = external hidden unnamed_addr constant %struct.b2BodyState, align 4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Dot(<2 x float>, <2 x float>) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Sub(<2 x float>, <2 x float>) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Cross(<2 x float>, <2 x float>) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Add(<2 x float>, <2 x float>) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2CrossSV(float noundef, <2 x float>) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2SolverSetArray_Get(ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSV(float noundef, <2 x float>) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2MaxFloat(float noundef, float noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSub(<2 x float>, float noundef, <2 x float>) #2

; Function Attrs: nounwind uwtable
define dso_local void @b2ApplyOverflowRestitution(ptr noundef %0) #5 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca %struct.b2BodyState, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca ptr, align 8
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca float, align 4
  %23 = alloca ptr, align 8
  %24 = alloca %struct.b2Vec2, align 4
  %25 = alloca float, align 4
  %26 = alloca %struct.b2Vec2, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca %struct.b2Vec2, align 4
  %31 = alloca %struct.b2Vec2, align 4
  %32 = alloca %struct.b2Vec2, align 4
  %33 = alloca %struct.b2Vec2, align 4
  %34 = alloca %struct.b2Vec2, align 4
  %35 = alloca %struct.b2Vec2, align 4
  %36 = alloca float, align 4
  %37 = alloca %struct.b2Vec2, align 4
  %38 = alloca float, align 4
  %39 = alloca float, align 4
  %40 = alloca %struct.b2Vec2, align 4
  %41 = alloca %struct.b2Vec2, align 4
  %42 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.b2StepContext, ptr %43, i32 0, i32 11
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  store ptr %45, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.b2ConstraintGraph, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds [12 x %struct.b2GraphColor], ptr %47, i64 0, i64 0
  %49 = getelementptr inbounds %struct.b2GraphColor, ptr %48, i64 11
  store ptr %49, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.b2GraphColor, ptr %50, i32 0, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !17
  store ptr %52, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.b2GraphColor, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds %struct.b2ContactSimArray, ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 8, !tbaa !18
  store i32 %56, ptr %6, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.b2StepContext, ptr %57, i32 0, i32 10
  %59 = load ptr, ptr %58, align 8, !tbaa !23
  store ptr %59, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.b2World, ptr %60, i32 0, i32 6
  %62 = call ptr @b2SolverSetArray_Get(ptr noundef %61, i32 noundef 2)
  store ptr %62, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b2SolverSet, ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds %struct.b2BodyStateArray, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !24
  store ptr %66, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.b2StepContext, ptr %67, i32 0, i32 10
  %69 = load ptr, ptr %68, align 8, !tbaa !23
  %70 = getelementptr inbounds %struct.b2World, ptr %69, i32 0, i32 35
  %71 = load float, ptr %70, align 8, !tbaa !26
  store float %71, ptr %10, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 @__const.b2ApplyOverflowRestitution.dummyState, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !22
  br label %72

72:                                               ; preds = %265, %1
  %73 = load i32, ptr %12, align 4, !tbaa !22
  %74 = load i32, ptr %6, align 4, !tbaa !22
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %268

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = load i32, ptr %12, align 4, !tbaa !22
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds %struct.b2ContactConstraint, ptr %78, i64 %80
  store ptr %81, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.b2ContactConstraint, ptr %82, i32 0, i32 9
  %84 = load float, ptr %83, align 4, !tbaa !38
  store float %84, ptr %15, align 4, !tbaa !37
  %85 = load float, ptr %15, align 4, !tbaa !37
  %86 = fcmp oeq float %85, 0.000000e+00
  br i1 %86, label %87, label %88

87:                                               ; preds = %77
  store i32 4, ptr %13, align 4
  br label %262

88:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b2ContactConstraint, ptr %89, i32 0, i32 4
  %91 = load float, ptr %90, align 4, !tbaa !40
  store float %91, ptr %16, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.b2ContactConstraint, ptr %92, i32 0, i32 6
  %94 = load float, ptr %93, align 4, !tbaa !41
  store float %94, ptr %17, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %95 = load ptr, ptr %14, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.b2ContactConstraint, ptr %95, i32 0, i32 5
  %97 = load float, ptr %96, align 4, !tbaa !42
  store float %97, ptr %18, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %98 = load ptr, ptr %14, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.b2ContactConstraint, ptr %98, i32 0, i32 7
  %100 = load float, ptr %99, align 4, !tbaa !43
  store float %100, ptr %19, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.b2ContactConstraint, ptr %101, i32 0, i32 0
  %103 = load i32, ptr %102, align 4, !tbaa !44
  %104 = icmp eq i32 %103, -1
  br i1 %104, label %105, label %106

105:                                              ; preds = %88
  br label %113

106:                                              ; preds = %88
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.b2ContactConstraint, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 4, !tbaa !44
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds %struct.b2BodyState, ptr %107, i64 %111
  br label %113

113:                                              ; preds = %106, %105
  %114 = phi ptr [ %11, %105 ], [ %112, %106 ]
  store ptr %114, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %115 = load ptr, ptr %20, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.b2BodyState, ptr %115, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %116, i64 8, i1 false), !tbaa.struct !45
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %117 = load ptr, ptr %20, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.b2BodyState, ptr %117, i32 0, i32 1
  %119 = load float, ptr %118, align 4, !tbaa !46
  store float %119, ptr %22, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.b2ContactConstraint, ptr %120, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !49
  %123 = icmp eq i32 %122, -1
  br i1 %123, label %124, label %125

124:                                              ; preds = %113
  br label %132

125:                                              ; preds = %113
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.b2ContactConstraint, ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !49
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds %struct.b2BodyState, ptr %126, i64 %130
  br label %132

132:                                              ; preds = %125, %124
  %133 = phi ptr [ %11, %124 ], [ %131, %125 ]
  store ptr %133, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %134 = load ptr, ptr %23, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.b2BodyState, ptr %134, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %135, i64 8, i1 false), !tbaa.struct !45
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %136 = load ptr, ptr %23, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.b2BodyState, ptr %136, i32 0, i32 1
  %138 = load float, ptr %137, align 4, !tbaa !46
  store float %138, ptr %25, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %139 = load ptr, ptr %14, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.b2ContactConstraint, ptr %139, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %140, i64 8, i1 false), !tbaa.struct !45
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.b2ContactConstraint, ptr %141, i32 0, i32 15
  %143 = load i32, ptr %142, align 4, !tbaa !50
  store i32 %143, ptr %27, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 0, ptr %28, align 4, !tbaa !22
  br label %144

144:                                              ; preds = %248, %132
  %145 = load i32, ptr %28, align 4, !tbaa !22
  %146 = load i32, ptr %27, align 4, !tbaa !22
  %147 = icmp slt i32 %145, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %144
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %251

149:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %150 = load ptr, ptr %14, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.b2ContactConstraint, ptr %150, i32 0, i32 2
  %152 = getelementptr inbounds [2 x %struct.b2ContactConstraintPoint], ptr %151, i64 0, i64 0
  %153 = load i32, ptr %28, align 4, !tbaa !22
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %152, i64 %154
  store ptr %155, ptr %29, align 8, !tbaa !5
  %156 = load ptr, ptr %29, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %156, i32 0, i32 3
  %158 = load float, ptr %157, align 4, !tbaa !51
  %159 = load float, ptr %10, align 4, !tbaa !37
  %160 = fneg float %159
  %161 = fcmp ogt float %158, %160
  br i1 %161, label %167, label %162

162:                                              ; preds = %149
  %163 = load ptr, ptr %29, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %163, i32 0, i32 6
  %165 = load float, ptr %164, align 4, !tbaa !53
  %166 = fcmp oeq float %165, 0.000000e+00
  br i1 %166, label %167, label %168

167:                                              ; preds = %162, %149
  store i32 7, ptr %13, align 4
  br label %245

168:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %169 = load ptr, ptr %29, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %169, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %170, i64 8, i1 false), !tbaa.struct !45
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %171 = load ptr, ptr %29, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %171, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %172, i64 8, i1 false), !tbaa.struct !45
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %173 = load float, ptr %25, align 4, !tbaa !37
  %174 = load <2 x float>, ptr %31, align 4
  %175 = call <2 x float> @b2CrossSV(float noundef %173, <2 x float> %174)
  store <2 x float> %175, ptr %33, align 4
  %176 = load <2 x float>, ptr %24, align 4
  %177 = load <2 x float>, ptr %33, align 4
  %178 = call <2 x float> @b2Add(<2 x float> %176, <2 x float> %177)
  store <2 x float> %178, ptr %32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %179 = load float, ptr %22, align 4, !tbaa !37
  %180 = load <2 x float>, ptr %30, align 4
  %181 = call <2 x float> @b2CrossSV(float noundef %179, <2 x float> %180)
  store <2 x float> %181, ptr %35, align 4
  %182 = load <2 x float>, ptr %21, align 4
  %183 = load <2 x float>, ptr %35, align 4
  %184 = call <2 x float> @b2Add(<2 x float> %182, <2 x float> %183)
  store <2 x float> %184, ptr %34, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  %185 = load <2 x float>, ptr %32, align 4
  %186 = load <2 x float>, ptr %34, align 4
  %187 = call <2 x float> @b2Sub(<2 x float> %185, <2 x float> %186)
  store <2 x float> %187, ptr %37, align 4
  %188 = load <2 x float>, ptr %37, align 4
  %189 = load <2 x float>, ptr %26, align 4
  %190 = call float @b2Dot(<2 x float> %188, <2 x float> %189)
  store float %190, ptr %36, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #6
  %191 = load ptr, ptr %29, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %191, i32 0, i32 7
  %193 = load float, ptr %192, align 4, !tbaa !54
  %194 = fneg float %193
  %195 = load float, ptr %36, align 4, !tbaa !37
  %196 = load float, ptr %15, align 4, !tbaa !37
  %197 = load ptr, ptr %29, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %197, i32 0, i32 3
  %199 = load float, ptr %198, align 4, !tbaa !51
  %200 = call float @llvm.fmuladd.f32(float %196, float %199, float %195)
  %201 = fmul float %194, %200
  store float %201, ptr %38, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  %202 = load ptr, ptr %29, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %202, i32 0, i32 4
  %204 = load float, ptr %203, align 4, !tbaa !55
  %205 = load float, ptr %38, align 4, !tbaa !37
  %206 = fadd float %204, %205
  %207 = call float @b2MaxFloat(float noundef %206, float noundef 0.000000e+00)
  store float %207, ptr %39, align 4, !tbaa !37
  %208 = load float, ptr %39, align 4, !tbaa !37
  %209 = load ptr, ptr %29, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %209, i32 0, i32 4
  %211 = load float, ptr %210, align 4, !tbaa !55
  %212 = fsub float %208, %211
  store float %212, ptr %38, align 4, !tbaa !37
  %213 = load float, ptr %39, align 4, !tbaa !37
  %214 = load ptr, ptr %29, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %214, i32 0, i32 4
  store float %213, ptr %215, align 4, !tbaa !55
  %216 = load float, ptr %38, align 4, !tbaa !37
  %217 = load ptr, ptr %29, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %217, i32 0, i32 6
  %219 = load float, ptr %218, align 4, !tbaa !53
  %220 = fadd float %219, %216
  store float %220, ptr %218, align 4, !tbaa !53
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  %221 = load float, ptr %38, align 4, !tbaa !37
  %222 = load <2 x float>, ptr %26, align 4
  %223 = call <2 x float> @b2MulSV(float noundef %221, <2 x float> %222)
  store <2 x float> %223, ptr %40, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #6
  %224 = load float, ptr %16, align 4, !tbaa !37
  %225 = load <2 x float>, ptr %21, align 4
  %226 = load <2 x float>, ptr %40, align 4
  %227 = call <2 x float> @b2MulSub(<2 x float> %225, float noundef %224, <2 x float> %226)
  store <2 x float> %227, ptr %41, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %41, i64 8, i1 false), !tbaa.struct !45
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  %228 = load float, ptr %17, align 4, !tbaa !37
  %229 = load <2 x float>, ptr %30, align 4
  %230 = load <2 x float>, ptr %40, align 4
  %231 = call float @b2Cross(<2 x float> %229, <2 x float> %230)
  %232 = load float, ptr %22, align 4, !tbaa !37
  %233 = fneg float %228
  %234 = call float @llvm.fmuladd.f32(float %233, float %231, float %232)
  store float %234, ptr %22, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  %235 = load float, ptr %18, align 4, !tbaa !37
  %236 = load <2 x float>, ptr %24, align 4
  %237 = load <2 x float>, ptr %40, align 4
  %238 = call <2 x float> @b2MulAdd(<2 x float> %236, float noundef %235, <2 x float> %237)
  store <2 x float> %238, ptr %42, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %42, i64 8, i1 false), !tbaa.struct !45
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  %239 = load float, ptr %19, align 4, !tbaa !37
  %240 = load <2 x float>, ptr %31, align 4
  %241 = load <2 x float>, ptr %40, align 4
  %242 = call float @b2Cross(<2 x float> %240, <2 x float> %241)
  %243 = load float, ptr %25, align 4, !tbaa !37
  %244 = call float @llvm.fmuladd.f32(float %239, float %242, float %243)
  store float %244, ptr %25, align 4, !tbaa !37
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  store i32 0, ptr %13, align 4
  br label %245

245:                                              ; preds = %168, %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  %246 = load i32, ptr %13, align 4
  switch i32 %246, label %269 [
    i32 0, label %247
    i32 7, label %248
  ]

247:                                              ; preds = %245
  br label %248

248:                                              ; preds = %247, %245
  %249 = load i32, ptr %28, align 4, !tbaa !22
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %28, align 4, !tbaa !22
  br label %144, !llvm.loop !56

251:                                              ; preds = %148
  %252 = load ptr, ptr %20, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.b2BodyState, ptr %252, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %253, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !45
  %254 = load float, ptr %22, align 4, !tbaa !37
  %255 = load ptr, ptr %20, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.b2BodyState, ptr %255, i32 0, i32 1
  store float %254, ptr %256, align 4, !tbaa !46
  %257 = load ptr, ptr %23, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.b2BodyState, ptr %257, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %258, ptr align 4 %24, i64 8, i1 false), !tbaa.struct !45
  %259 = load float, ptr %25, align 4, !tbaa !37
  %260 = load ptr, ptr %23, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.b2BodyState, ptr %260, i32 0, i32 1
  store float %259, ptr %261, align 4, !tbaa !46
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  store i32 0, ptr %13, align 4
  br label %262

262:                                              ; preds = %251, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %263 = load i32, ptr %13, align 4
  switch i32 %263, label %269 [
    i32 0, label %264
    i32 4, label %265
  ]

264:                                              ; preds = %262
  br label %265

265:                                              ; preds = %264, %262
  %266 = load i32, ptr %12, align 4, !tbaa !22
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %12, align 4, !tbaa !22
  br label %72, !llvm.loop !58

268:                                              ; preds = %76
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void

269:                                              ; preds = %262, %245
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint nounwind 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { inlinehint 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 = { nounwind 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 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 72}
!10 = !{!"b2StepContext", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !13, i64 20, !13, i64 32, !13, i64 44, !11, i64 56, !11, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !12, i64 104, !6, i64 112, !14, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !12, i64 152, !12, i64 156, !6, i64 160, !12, i64 168, !15, i64 172, !7, i64 173, !16, i64 240, !7, i64 244}
!11 = !{!"float", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"b2Softness", !11, i64 0, !11, i64 4, !11, i64 8}
!14 = !{!"b2AtomicInt", !12, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!"b2AtomicU32", !12, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !12, i64 24}
!19 = !{!"b2GraphColor", !20, i64 0, !21, i64 16, !21, i64 32, !7, i64 48}
!20 = !{!"b2BitSet", !6, i64 0, !12, i64 8, !12, i64 12}
!21 = !{!"", !6, i64 0, !12, i64 8, !12, i64 12}
!22 = !{!12, !12, i64 0}
!23 = !{!10, !6, i64 64}
!24 = !{!25, !6, i64 16}
!25 = !{!"b2SolverSet", !21, i64 0, !21, i64 16, !21, i64 32, !21, i64 48, !21, i64 64, !12, i64 80}
!26 = !{!27, !11, i64 1560}
!27 = !{!"b2World", !28, i64 0, !29, i64 40, !31, i64 336, !32, i64 1008, !21, i64 1032, !32, i64 1048, !21, i64 1072, !32, i64 1088, !21, i64 1112, !32, i64 1128, !21, i64 1152, !32, i64 1168, !21, i64 1192, !32, i64 1208, !32, i64 1232, !21, i64 1256, !21, i64 1272, !21, i64 1288, !21, i64 1304, !21, i64 1320, !21, i64 1336, !21, i64 1352, !21, i64 1368, !7, i64 1384, !7, i64 1416, !12, i64 1448, !21, i64 1456, !20, i64 1472, !20, i64 1488, !20, i64 1504, !20, i64 1520, !33, i64 1536, !12, i64 1544, !34, i64 1548, !11, i64 1556, !11, i64 1560, !11, i64 1564, !11, i64 1568, !11, i64 1572, !11, i64 1576, !11, i64 1580, !11, i64 1584, !6, i64 1592, !6, i64 1600, !35, i64 1608, !36, i64 1612, !6, i64 1704, !6, i64 1712, !6, i64 1720, !6, i64 1728, !12, i64 1736, !6, i64 1744, !6, i64 1752, !6, i64 1760, !6, i64 1768, !6, i64 1776, !11, i64 1784, !12, i64 1788, !12, i64 1792, !35, i64 1796, !15, i64 1798, !15, i64 1799, !15, i64 1800, !15, i64 1801, !15, i64 1802, !15, i64 1803}
!28 = !{!"b2ArenaAllocator", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !21, i64 24}
!29 = !{!"b2BroadPhase", !7, i64 0, !12, i64 216, !30, i64 224, !21, i64 240, !6, i64 256, !6, i64 264, !12, i64 272, !14, i64 276, !30, i64 280}
!30 = !{!"b2HashSet", !6, i64 0, !12, i64 8, !12, i64 12}
!31 = !{!"b2ConstraintGraph", !7, i64 0}
!32 = !{!"b2IdPool", !21, i64 0, !12, i64 16}
!33 = !{!"long", !7, i64 0}
!34 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!35 = !{!"short", !7, i64 0}
!36 = !{!"b2Profile", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84}
!37 = !{!11, !11, i64 0}
!38 = !{!39, !11, i64 124}
!39 = !{!"b2ContactConstraint", !12, i64 0, !12, i64 4, !7, i64 8, !34, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !13, i64 144, !12, i64 156}
!40 = !{!39, !11, i64 104}
!41 = !{!39, !11, i64 112}
!42 = !{!39, !11, i64 108}
!43 = !{!39, !11, i64 116}
!44 = !{!39, !12, i64 0}
!45 = !{i64 0, i64 4, !37, i64 4, i64 4, !37}
!46 = !{!47, !11, i64 8}
!47 = !{!"b2BodyState", !34, i64 0, !11, i64 8, !12, i64 12, !34, i64 16, !48, i64 24}
!48 = !{!"b2Rot", !11, i64 0, !11, i64 4}
!49 = !{!39, !12, i64 4}
!50 = !{!39, !12, i64 156}
!51 = !{!52, !11, i64 20}
!52 = !{!"b2ContactConstraintPoint", !34, i64 0, !34, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40}
!53 = !{!52, !11, i64 32}
!54 = !{!52, !11, i64 36}
!55 = !{!52, !11, i64 24}
!56 = distinct !{!56, !57}
!57 = !{!"llvm.loop.mustprogress"}
!58 = distinct !{!58, !57}


; 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.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.b2ContactConstraint = type { i32, i32, [2 x %struct.b2ContactConstraintPoint], %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, %struct.b2Softness, i32 }
%struct.b2ContactConstraintPoint = type { %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float }
%struct.b2Softness = type { float, float, float }

@__const.b2ApplyOverflowRestitution.dummyState = external hidden unnamed_addr constant %struct.b2BodyState, align 4

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Dot(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Sub(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Cross(<2 x float>, <2 x float>) local_unnamed_addr #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Add(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2CrossSV(float noundef, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2SolverSetArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSV(float noundef, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2MaxFloat(float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSub(<2 x float>, float noundef, <2 x float>) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @b2ApplyOverflowRestitution(ptr nocapture noundef readonly %0) local_unnamed_addr #4 {
  %.sroa.0 = alloca %struct.b2Vec2, align 8
  %2 = getelementptr inbounds i8, ptr %0, i64 72
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 664
  %5 = load ptr, ptr %4, align 8, !tbaa !16
  %6 = getelementptr inbounds i8, ptr %3, i64 640
  %7 = load i32, ptr %6, align 8, !tbaa !17
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  %9 = load ptr, ptr %8, align 8, !tbaa !21
  %10 = getelementptr inbounds i8, ptr %9, i64 1072
  %11 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %10, i32 noundef 2)
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !22
  %14 = load ptr, ptr %8, align 8, !tbaa !21
  %15 = getelementptr inbounds i8, ptr %14, i64 1560
  %16 = load float, ptr %15, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %.sroa.0)
  %17 = load i64, ptr @__const.b2ApplyOverflowRestitution.dummyState, align 4
  store i64 %17, ptr %.sroa.0, align 8
  %18 = icmp sgt i32 %7, 0
  br i1 %18, label %.lr.ph120, label %._crit_edge121

.lr.ph120:                                        ; preds = %1
  %.sroa.5.0.copyload = load float, ptr getelementptr inbounds (i8, ptr @__const.b2ApplyOverflowRestitution.dummyState, i64 8), align 4
  %19 = fneg float %16
  %wide.trip.count126 = zext nneg i32 %7 to i64
  br label %20

._crit_edge121:                                   ; preds = %.cont, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %.sroa.0)
  ret void

20:                                               ; preds = %.lr.ph120, %.cont
  %indvars.iv123 = phi i64 [ 0, %.lr.ph120 ], [ %indvars.iv.next124, %.cont ]
  %.sroa.5.0117 = phi float [ %.sroa.5.0.copyload, %.lr.ph120 ], [ %.sroa.5.3, %.cont ]
  %21 = getelementptr inbounds %struct.b2ContactConstraint, ptr %5, i64 %indvars.iv123
  %22 = getelementptr inbounds i8, ptr %21, i64 124
  %23 = load float, ptr %22, align 4, !tbaa !35
  %24 = fcmp oeq float %23, 0.000000e+00
  br i1 %24, label %.cont, label %25

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %21, i64 104
  %27 = load float, ptr %26, align 4, !tbaa !37
  %28 = getelementptr inbounds i8, ptr %21, i64 112
  %29 = load float, ptr %28, align 4, !tbaa !38
  %30 = getelementptr inbounds i8, ptr %21, i64 108
  %31 = load float, ptr %30, align 4, !tbaa !39
  %32 = getelementptr inbounds i8, ptr %21, i64 116
  %33 = load float, ptr %32, align 4, !tbaa !40
  %34 = load i32, ptr %21, align 4, !tbaa !41
  %35 = icmp eq i32 %34, -1
  %36 = sext i32 %34 to i64
  %37 = getelementptr inbounds %struct.b2BodyState, ptr %13, i64 %36
  %38 = select i1 %35, ptr %.sroa.0, ptr %37
  %.sroa.048.0.copyload = load <2 x float>, ptr %38, align 4
  %.sroa.gep96 = getelementptr inbounds i8, ptr %37, i64 8
  br i1 %35, label %.cont105, label %.else107

.else107:                                         ; preds = %25
  %.else.val108 = load float, ptr %.sroa.gep96, align 4, !tbaa !42
  br label %.cont105

.cont105:                                         ; preds = %25, %.else107
  %39 = phi float [ %.sroa.5.0117, %25 ], [ %.else.val108, %.else107 ]
  %40 = getelementptr inbounds i8, ptr %21, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !45
  %42 = icmp eq i32 %41, -1
  %43 = sext i32 %41 to i64
  %44 = getelementptr inbounds %struct.b2BodyState, ptr %13, i64 %43
  %45 = select i1 %42, ptr %.sroa.0, ptr %44
  %.sroa.038.0.copyload = load <2 x float>, ptr %45, align 4
  %.sroa.gep98 = getelementptr inbounds i8, ptr %44, i64 8
  br i1 %42, label %.cont100, label %.else101

.else101:                                         ; preds = %.cont105
  %.else.val = load float, ptr %.sroa.gep98, align 4, !tbaa !42
  br label %.cont100

.cont100:                                         ; preds = %.cont105, %.else101
  %46 = phi float [ %.sroa.5.0117, %.cont105 ], [ %.else.val, %.else101 ]
  %47 = getelementptr inbounds i8, ptr %21, i64 96
  %.sroa.033.0.copyload = load <2 x float>, ptr %47, align 4
  %48 = getelementptr inbounds i8, ptr %21, i64 156
  %49 = load i32, ptr %48, align 4, !tbaa !46
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.cont100
  %51 = getelementptr inbounds i8, ptr %21, i64 8
  %52 = fneg float %29
  %wide.trip.count = zext nneg i32 %49 to i64
  br label %53

._crit_edge:                                      ; preds = %90, %.cont100
  %.090.lcssa = phi float [ %46, %.cont100 ], [ %.191, %90 ]
  %.sroa.038.0.lcssa = phi <2 x float> [ %.sroa.038.0.copyload, %.cont100 ], [ %.sroa.038.1, %90 ]
  %.089.lcssa = phi float [ %39, %.cont100 ], [ %.1, %90 ]
  %.sroa.048.0.lcssa = phi <2 x float> [ %.sroa.048.0.copyload, %.cont100 ], [ %.sroa.048.1, %90 ]
  store <2 x float> %.sroa.048.0.lcssa, ptr %38, align 4
  br i1 %35, label %.cont102, label %.else104

.else104:                                         ; preds = %._crit_edge
  store float %.089.lcssa, ptr %.sroa.gep96, align 4, !tbaa !42
  br label %.cont102

.cont102:                                         ; preds = %._crit_edge, %.else104
  %.sroa.5.1 = phi float [ %.sroa.5.0117, %.else104 ], [ %.089.lcssa, %._crit_edge ]
  store <2 x float> %.sroa.038.0.lcssa, ptr %45, align 4
  br i1 %42, label %.cont, label %.else

.else:                                            ; preds = %.cont102
  store float %.090.lcssa, ptr %.sroa.gep98, align 4, !tbaa !42
  br label %.cont

53:                                               ; preds = %.lr.ph, %90
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %90 ]
  %.sroa.048.0113 = phi <2 x float> [ %.sroa.048.0.copyload, %.lr.ph ], [ %.sroa.048.1, %90 ]
  %.089112 = phi float [ %39, %.lr.ph ], [ %.1, %90 ]
  %.sroa.038.0111 = phi <2 x float> [ %.sroa.038.0.copyload, %.lr.ph ], [ %.sroa.038.1, %90 ]
  %.090110 = phi float [ %46, %.lr.ph ], [ %.191, %90 ]
  %54 = getelementptr inbounds %struct.b2ContactConstraintPoint, ptr %51, i64 %indvars.iv
  %55 = getelementptr inbounds i8, ptr %54, i64 20
  %56 = load float, ptr %55, align 4, !tbaa !47
  %57 = fcmp ogt float %56, %19
  br i1 %57, label %90, label %58

58:                                               ; preds = %53
  %59 = getelementptr inbounds i8, ptr %54, i64 32
  %60 = load float, ptr %59, align 4, !tbaa !49
  %61 = fcmp oeq float %60, 0.000000e+00
  br i1 %61, label %90, label %62

62:                                               ; preds = %58
  %.sroa.018.0.copyload = load <2 x float>, ptr %54, align 4
  %63 = getelementptr inbounds i8, ptr %54, i64 8
  %.sroa.016.0.copyload = load <2 x float>, ptr %63, align 4
  %64 = tail call <2 x float> @b2CrossSV(float noundef %.090110, <2 x float> %.sroa.016.0.copyload)
  %65 = tail call <2 x float> @b2Add(<2 x float> %.sroa.038.0111, <2 x float> %64)
  %66 = tail call <2 x float> @b2CrossSV(float noundef %.089112, <2 x float> %.sroa.018.0.copyload)
  %67 = tail call <2 x float> @b2Add(<2 x float> %.sroa.048.0113, <2 x float> %66)
  %68 = tail call <2 x float> @b2Sub(<2 x float> %65, <2 x float> %67)
  %69 = tail call float @b2Dot(<2 x float> %68, <2 x float> %.sroa.033.0.copyload)
  %70 = getelementptr inbounds i8, ptr %54, i64 36
  %71 = load float, ptr %70, align 4, !tbaa !50
  %72 = load float, ptr %55, align 4, !tbaa !47
  %73 = tail call float @llvm.fmuladd.f32(float %23, float %72, float %69)
  %74 = getelementptr inbounds i8, ptr %54, i64 24
  %75 = load float, ptr %74, align 4, !tbaa !51
  %76 = fmul float %71, %73
  %77 = fsub float %75, %76
  %78 = tail call float @b2MaxFloat(float noundef %77, float noundef 0.000000e+00)
  %79 = load float, ptr %74, align 4, !tbaa !51
  %80 = fsub float %78, %79
  store float %78, ptr %74, align 4, !tbaa !51
  %81 = load float, ptr %59, align 4, !tbaa !49
  %82 = fadd float %80, %81
  store float %82, ptr %59, align 4, !tbaa !49
  %83 = tail call <2 x float> @b2MulSV(float noundef %80, <2 x float> %.sroa.033.0.copyload)
  %84 = tail call <2 x float> @b2MulSub(<2 x float> %.sroa.048.0113, float noundef %27, <2 x float> %83)
  %85 = tail call float @b2Cross(<2 x float> %.sroa.018.0.copyload, <2 x float> %83)
  %86 = tail call float @llvm.fmuladd.f32(float %52, float %85, float %.089112)
  %87 = tail call <2 x float> @b2MulAdd(<2 x float> %.sroa.038.0111, float noundef %31, <2 x float> %83)
  %88 = tail call float @b2Cross(<2 x float> %.sroa.016.0.copyload, <2 x float> %83)
  %89 = tail call float @llvm.fmuladd.f32(float %33, float %88, float %.090110)
  br label %90

90:                                               ; preds = %53, %58, %62
  %.191 = phi float [ %89, %62 ], [ %.090110, %58 ], [ %.090110, %53 ]
  %.sroa.038.1 = phi <2 x float> [ %87, %62 ], [ %.sroa.038.0111, %58 ], [ %.sroa.038.0111, %53 ]
  %.1 = phi float [ %86, %62 ], [ %.089112, %58 ], [ %.089112, %53 ]
  %.sroa.048.1 = phi <2 x float> [ %84, %62 ], [ %.sroa.048.0113, %58 ], [ %.sroa.048.0113, %53 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %53, !llvm.loop !52

.cont:                                            ; preds = %.else, %.cont102, %20
  %.sroa.5.3 = phi float [ %.sroa.5.0117, %20 ], [ %.sroa.5.1, %.else ], [ %.090.lcssa, %.cont102 ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
  br i1 %exitcond127.not, label %._crit_edge121, label %20, !llvm.loop !54
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint nounwind 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { inlinehint 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 = { nounwind 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" }

!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, !12, i64 72}
!6 = !{!"b2StepContext", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !11, i64 20, !11, i64 32, !11, i64 44, !7, i64 56, !7, i64 60, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !10, i64 104, !12, i64 112, !13, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !10, i64 152, !10, i64 156, !12, i64 160, !10, i64 168, !14, i64 172, !8, i64 173, !15, i64 240, !8, i64 244}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"b2Softness", !7, i64 0, !7, i64 4, !7, i64 8}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"b2AtomicInt", !10, i64 0}
!14 = !{!"_Bool", !8, i64 0}
!15 = !{!"b2AtomicU32", !10, i64 0}
!16 = !{!8, !8, i64 0}
!17 = !{!18, !10, i64 24}
!18 = !{!"b2GraphColor", !19, i64 0, !20, i64 16, !20, i64 32, !8, i64 48}
!19 = !{!"b2BitSet", !12, i64 0, !10, i64 8, !10, i64 12}
!20 = !{!"", !12, i64 0, !10, i64 8, !10, i64 12}
!21 = !{!6, !12, i64 64}
!22 = !{!23, !12, i64 16}
!23 = !{!"b2SolverSet", !20, i64 0, !20, i64 16, !20, i64 32, !20, i64 48, !20, i64 64, !10, i64 80}
!24 = !{!25, !7, i64 1560}
!25 = !{!"b2World", !26, i64 0, !27, i64 40, !29, i64 336, !30, i64 1008, !20, i64 1032, !30, i64 1048, !20, i64 1072, !30, i64 1088, !20, i64 1112, !30, i64 1128, !20, i64 1152, !30, i64 1168, !20, i64 1192, !30, i64 1208, !30, i64 1232, !20, i64 1256, !20, i64 1272, !20, i64 1288, !20, i64 1304, !20, i64 1320, !20, i64 1336, !20, i64 1352, !20, i64 1368, !8, i64 1384, !8, i64 1416, !10, i64 1448, !20, i64 1456, !19, i64 1472, !19, i64 1488, !19, i64 1504, !19, i64 1520, !31, i64 1536, !10, i64 1544, !32, i64 1548, !7, i64 1556, !7, i64 1560, !7, i64 1564, !7, i64 1568, !7, i64 1572, !7, i64 1576, !7, i64 1580, !7, i64 1584, !12, i64 1592, !12, i64 1600, !33, i64 1608, !34, i64 1612, !12, i64 1704, !12, i64 1712, !12, i64 1720, !12, i64 1728, !10, i64 1736, !12, i64 1744, !12, i64 1752, !12, i64 1760, !12, i64 1768, !12, i64 1776, !7, i64 1784, !10, i64 1788, !10, i64 1792, !33, i64 1796, !14, i64 1798, !14, i64 1799, !14, i64 1800, !14, i64 1801, !14, i64 1802, !14, i64 1803}
!26 = !{!"b2ArenaAllocator", !12, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !20, i64 24}
!27 = !{!"b2BroadPhase", !8, i64 0, !10, i64 216, !28, i64 224, !20, i64 240, !12, i64 256, !12, i64 264, !10, i64 272, !13, i64 276, !28, i64 280}
!28 = !{!"b2HashSet", !12, i64 0, !10, i64 8, !10, i64 12}
!29 = !{!"b2ConstraintGraph", !8, i64 0}
!30 = !{!"b2IdPool", !20, i64 0, !10, i64 16}
!31 = !{!"long", !8, i64 0}
!32 = !{!"b2Vec2", !7, i64 0, !7, i64 4}
!33 = !{!"short", !8, i64 0}
!34 = !{!"b2Profile", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84}
!35 = !{!36, !7, i64 124}
!36 = !{!"b2ContactConstraint", !10, i64 0, !10, i64 4, !8, i64 8, !32, i64 96, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !11, i64 144, !10, i64 156}
!37 = !{!36, !7, i64 104}
!38 = !{!36, !7, i64 112}
!39 = !{!36, !7, i64 108}
!40 = !{!36, !7, i64 116}
!41 = !{!36, !10, i64 0}
!42 = !{!43, !7, i64 8}
!43 = !{!"b2BodyState", !32, i64 0, !7, i64 8, !10, i64 12, !32, i64 16, !44, i64 24}
!44 = !{!"b2Rot", !7, i64 0, !7, i64 4}
!45 = !{!36, !10, i64 4}
!46 = !{!36, !10, i64 156}
!47 = !{!48, !7, i64 20}
!48 = !{!"b2ContactConstraintPoint", !32, i64 0, !32, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40}
!49 = !{!48, !7, i64 32}
!50 = !{!48, !7, i64 36}
!51 = !{!48, !7, i64 24}
!52 = distinct !{!52, !53}
!53 = !{!"llvm.loop.mustprogress"}
!54 = distinct !{!54, !53}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass