; LLVM IR from mtsamis/box2d-optimized :: src/dynamics (b2_distance_joint)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.b2SolverData = type { %struct.b2TimeStep, ptr, ptr }
%struct.b2TimeStep = type { float, float, float, i32, i32, i32, i8 }
%class.b2DistanceJoint = type <{ %class.b2Joint, float, float, float, float, float, float, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float, [4 x i8] }>
%class.b2Joint = type { ptr, i32, ptr, ptr, %struct.b2JointEdge, %struct.b2JointEdge, ptr, ptr, i32, i8, i8, %struct.b2JointUserData }
%struct.b2JointEdge = type { ptr, ptr, ptr, ptr }
%struct.b2JointUserData = type { i64 }
%struct.b2Position = type { %struct.b2Vec2, float }

; 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 mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z7b2CrossRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN15b2DistanceJoint24SolvePositionConstraintsERK12b2SolverData(ptr noundef nonnull align 8 dereferenceable(260) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) unnamed_addr #6 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.b2Vec2, align 4
  %7 = alloca float, align 4
  %8 = alloca %struct.b2Vec2, align 4
  %9 = alloca float, align 4
  %10 = alloca %struct.b2Rot, align 4
  %11 = alloca %struct.b2Rot, align 4
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca %struct.b2Vec2, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca %struct.b2Vec2, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca %struct.b2Vec2, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca %struct.b2Vec2, align 4
  %24 = alloca %struct.b2Vec2, align 4
  %25 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %26 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.b2SolverData, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 13
  %31 = load i32, ptr %30, align 8, !tbaa !15
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %struct.b2Position, ptr %29, i64 %32
  %34 = getelementptr inbounds %struct.b2Position, ptr %33, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %34, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.b2SolverData, ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 13
  %39 = load i32, ptr %38, align 8, !tbaa !15
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.b2Position, ptr %37, i64 %40
  %42 = getelementptr inbounds %struct.b2Position, ptr %41, i32 0, i32 1
  %43 = load float, ptr %42, align 4, !tbaa !25
  store float %43, ptr %7, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.b2SolverData, ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 14
  %48 = load i32, ptr %47, align 4, !tbaa !27
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds %struct.b2Position, ptr %46, i64 %49
  %51 = getelementptr inbounds %struct.b2Position, ptr %50, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %51, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2SolverData, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 14
  %56 = load i32, ptr %55, align 4, !tbaa !27
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %struct.b2Position, ptr %54, i64 %57
  %59 = getelementptr inbounds %struct.b2Position, ptr %58, i32 0, i32 1
  %60 = load float, ptr %59, align 4, !tbaa !25
  store float %60, ptr %9, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %61 = load float, ptr %7, align 4, !tbaa !24
  call void @_ZN5b2RotC2Ef(ptr noundef nonnull align 4 dereferenceable(8) %10, float noundef %61)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %62 = load float, ptr %9, align 4, !tbaa !24
  call void @_ZN5b2RotC2Ef(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef %62)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %63 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 7
  %64 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 18
  %65 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %63, ptr noundef nonnull align 4 dereferenceable(8) %64)
  store <2 x float> %65, ptr %13, align 4
  %66 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %13)
  store <2 x float> %66, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %67 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 8
  %68 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 19
  %69 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %67, ptr noundef nonnull align 4 dereferenceable(8) %68)
  store <2 x float> %69, ptr %15, align 4
  %70 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store <2 x float> %70, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %71 = call <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %71, ptr %18, align 4
  %72 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %72, ptr %17, align 4
  %73 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %73, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %74 = call noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8) %16)
  store float %74, ptr %19, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %75 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 5
  %76 = load float, ptr %75, align 8, !tbaa !28
  %77 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 6
  %78 = load float, ptr %77, align 4, !tbaa !29
  %79 = fcmp oeq float %76, %78
  br i1 %79, label %80, label %85

80:                                               ; preds = %2
  %81 = load float, ptr %19, align 4, !tbaa !24
  %82 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 5
  %83 = load float, ptr %82, align 8, !tbaa !28
  %84 = fsub float %81, %83
  store float %84, ptr %20, align 4, !tbaa !24
  br label %108

85:                                               ; preds = %2
  %86 = load float, ptr %19, align 4, !tbaa !24
  %87 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 5
  %88 = load float, ptr %87, align 8, !tbaa !28
  %89 = fcmp olt float %86, %88
  br i1 %89, label %90, label %95

90:                                               ; preds = %85
  %91 = load float, ptr %19, align 4, !tbaa !24
  %92 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 5
  %93 = load float, ptr %92, align 8, !tbaa !28
  %94 = fsub float %91, %93
  store float %94, ptr %20, align 4, !tbaa !24
  br label %107

95:                                               ; preds = %85
  %96 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 6
  %97 = load float, ptr %96, align 4, !tbaa !29
  %98 = load float, ptr %19, align 4, !tbaa !24
  %99 = fcmp olt float %97, %98
  br i1 %99, label %100, label %105

100:                                              ; preds = %95
  %101 = load float, ptr %19, align 4, !tbaa !24
  %102 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 6
  %103 = load float, ptr %102, align 4, !tbaa !29
  %104 = fsub float %101, %103
  store float %104, ptr %20, align 4, !tbaa !24
  br label %106

105:                                              ; preds = %95
  store i1 true, ptr %3, align 1
  store i32 1, ptr %21, align 4
  br label %170

106:                                              ; preds = %100
  br label %107

107:                                              ; preds = %106, %90
  br label %108

108:                                              ; preds = %107, %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %109 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 26
  %110 = load float, ptr %109, align 8, !tbaa !30
  %111 = fneg float %110
  %112 = load float, ptr %20, align 4, !tbaa !24
  %113 = fmul float %111, %112
  store float %113, ptr %22, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %114 = load float, ptr %22, align 4, !tbaa !24
  %115 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %114, ptr noundef nonnull align 4 dereferenceable(8) %16)
  store <2 x float> %115, ptr %23, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %116 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 21
  %117 = load float, ptr %116, align 4, !tbaa !31
  %118 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %117, ptr noundef nonnull align 4 dereferenceable(8) %23)
  store <2 x float> %118, ptr %24, align 4
  call void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %24)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  %119 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 23
  %120 = load float, ptr %119, align 4, !tbaa !32
  %121 = call noundef float @_Z7b2CrossRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %23)
  %122 = load float, ptr %7, align 4, !tbaa !24
  %123 = fneg float %120
  %124 = call float @llvm.fmuladd.f32(float %123, float %121, float %122)
  store float %124, ptr %7, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %125 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 22
  %126 = load float, ptr %125, align 8, !tbaa !33
  %127 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %126, ptr noundef nonnull align 4 dereferenceable(8) %23)
  store <2 x float> %127, ptr %25, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %25)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  %128 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 24
  %129 = load float, ptr %128, align 8, !tbaa !34
  %130 = call noundef float @_Z7b2CrossRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %23)
  %131 = load float, ptr %9, align 4, !tbaa !24
  %132 = call float @llvm.fmuladd.f32(float %129, float %130, float %131)
  store float %132, ptr %9, align 4, !tbaa !24
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.b2SolverData, ptr %133, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !9
  %136 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 13
  %137 = load i32, ptr %136, align 8, !tbaa !15
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds %struct.b2Position, ptr %135, i64 %138
  %140 = getelementptr inbounds %struct.b2Position, ptr %139, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %140, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !23
  %141 = load float, ptr %7, align 4, !tbaa !24
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.b2SolverData, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 13
  %146 = load i32, ptr %145, align 8, !tbaa !15
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds %struct.b2Position, ptr %144, i64 %147
  %149 = getelementptr inbounds %struct.b2Position, ptr %148, i32 0, i32 1
  store float %141, ptr %149, align 4, !tbaa !25
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.b2SolverData, ptr %150, i32 0, i32 1
  %152 = load ptr, ptr %151, align 8, !tbaa !9
  %153 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 14
  %154 = load i32, ptr %153, align 4, !tbaa !27
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds %struct.b2Position, ptr %152, i64 %155
  %157 = getelementptr inbounds %struct.b2Position, ptr %156, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %157, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !23
  %158 = load float, ptr %9, align 4, !tbaa !24
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.b2SolverData, ptr %159, i32 0, i32 1
  %161 = load ptr, ptr %160, align 8, !tbaa !9
  %162 = getelementptr inbounds %class.b2DistanceJoint, ptr %26, i32 0, i32 14
  %163 = load i32, ptr %162, align 4, !tbaa !27
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds %struct.b2Position, ptr %161, i64 %164
  %166 = getelementptr inbounds %struct.b2Position, ptr %165, i32 0, i32 1
  store float %158, ptr %166, align 4, !tbaa !25
  %167 = load float, ptr %20, align 4, !tbaa !24
  %168 = call noundef float @_Z5b2AbsIfET_S0_(float noundef %167)
  %169 = fcmp olt float %168, 0x3F747AE140000000
  store i1 %169, ptr %3, align 1
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %170

170:                                              ; preds = %108, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %171 = load i1, ptr %3, align 1
  ret i1 %171
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2AbsIfET_S0_(float noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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, !6, i64 32}
!10 = !{!"_ZTS12b2SolverData", !11, i64 0, !6, i64 32, !6, i64 40}
!11 = !{!"_ZTS10b2TimeStep", !12, i64 0, !12, i64 4, !12, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !14, i64 24}
!12 = !{!"float", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !13, i64 184}
!16 = !{!"_ZTS15b2DistanceJoint", !17, i64 0, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !22, i64 152, !22, i64 160, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !13, i64 184, !13, i64 188, !22, i64 192, !22, i64 200, !22, i64 208, !22, i64 216, !22, i64 224, !12, i64 232, !12, i64 236, !12, i64 240, !12, i64 244, !12, i64 248, !12, i64 252, !12, i64 256}
!17 = !{!"_ZTS7b2Joint", !18, i64 8, !6, i64 16, !6, i64 24, !19, i64 32, !19, i64 64, !6, i64 96, !6, i64 104, !13, i64 112, !14, i64 116, !14, i64 117, !20, i64 120}
!18 = !{!"_ZTS11b2JointType", !7, i64 0}
!19 = !{!"_ZTS11b2JointEdge", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTS15b2JointUserData", !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTS6b2Vec2", !12, i64 0, !12, i64 4}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24}
!24 = !{!12, !12, i64 0}
!25 = !{!26, !12, i64 8}
!26 = !{!"_ZTS10b2Position", !22, i64 0, !12, i64 8}
!27 = !{!16, !13, i64 188}
!28 = !{!16, !12, i64 144}
!29 = !{!16, !12, i64 148}
!30 = !{!16, !12, i64 256}
!31 = !{!16, !12, i64 236}
!32 = !{!16, !12, i64 244}
!33 = !{!16, !12, i64 240}
!34 = !{!16, !12, i64 248}


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

%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.b2Position = type { %struct.b2Vec2, float }

; 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 mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN15b2DistanceJoint24SolvePositionConstraintsERK12b2SolverData(ptr noundef nonnull align 8 dereferenceable(260) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(48) %1) unnamed_addr #5 align 2 {
  %3 = alloca %struct.b2Vec2, align 8
  %4 = alloca %struct.b2Vec2, align 8
  %5 = alloca %struct.b2Rot, align 4
  %6 = alloca %struct.b2Rot, align 4
  %7 = alloca %struct.b2Vec2, align 8
  %8 = alloca %struct.b2Vec2, align 8
  %9 = alloca %struct.b2Vec2, align 8
  %10 = alloca %struct.b2Vec2, align 8
  %11 = alloca %struct.b2Vec2, align 8
  %12 = alloca %struct.b2Vec2, align 8
  %13 = alloca %struct.b2Vec2, align 8
  %14 = alloca %struct.b2Vec2, align 8
  %15 = alloca %struct.b2Vec2, align 8
  %16 = alloca %struct.b2Vec2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %17 = getelementptr inbounds i8, ptr %1, i64 32
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 184
  %20 = load i32, ptr %19, align 8, !tbaa !14
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds %struct.b2Position, ptr %18, i64 %21
  %23 = load i64, ptr %22, align 4
  store i64 %23, ptr %3, align 8
  %24 = getelementptr inbounds %struct.b2Position, ptr %18, i64 %21, i32 1
  %25 = load float, ptr %24, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %26 = getelementptr inbounds i8, ptr %0, i64 188
  %27 = load i32, ptr %26, align 4, !tbaa !24
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %struct.b2Position, ptr %18, i64 %28
  %30 = load i64, ptr %29, align 4
  store i64 %30, ptr %4, align 8
  %31 = getelementptr inbounds %struct.b2Position, ptr %18, i64 %28, i32 1
  %32 = load float, ptr %31, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN5b2RotC2Ef(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %25)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN5b2RotC2Ef(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef %32)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %33 = getelementptr inbounds i8, ptr %0, i64 152
  %34 = getelementptr inbounds i8, ptr %0, i64 216
  %35 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %33, ptr noundef nonnull align 4 dereferenceable(8) %34)
  store <2 x float> %35, ptr %8, align 8
  %36 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %36, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %37 = getelementptr inbounds i8, ptr %0, i64 160
  %38 = getelementptr inbounds i8, ptr %0, i64 224
  %39 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(8) %38)
  store <2 x float> %39, ptr %10, align 8
  %40 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %40, ptr %9, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %41 = call <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %41, ptr %13, align 8
  %42 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %42, ptr %12, align 8
  %43 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %43, ptr %11, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %44 = call noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8) %11)
  %45 = getelementptr inbounds i8, ptr %0, i64 144
  %46 = load float, ptr %45, align 8, !tbaa !25
  %47 = getelementptr inbounds i8, ptr %0, i64 148
  %48 = load float, ptr %47, align 4, !tbaa !26
  %49 = fcmp oeq float %46, %48
  %50 = fcmp olt float %44, %46
  %or.cond = or i1 %50, %49
  br i1 %or.cond, label %53, label %51

51:                                               ; preds = %2
  %52 = fcmp olt float %48, %44
  br i1 %52, label %53, label %93

53:                                               ; preds = %51, %2
  %.pn = phi float [ %46, %2 ], [ %48, %51 ]
  %.024 = fsub float %44, %.pn
  %54 = getelementptr inbounds i8, ptr %0, i64 256
  %55 = load float, ptr %54, align 8, !tbaa !27
  %56 = fneg float %55
  %57 = fmul float %.024, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %58 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %57, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %58, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %59 = getelementptr inbounds i8, ptr %0, i64 236
  %60 = load float, ptr %59, align 4, !tbaa !28
  %61 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %60, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %61, ptr %15, align 8
  call void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  %62 = getelementptr inbounds i8, ptr %0, i64 244
  %63 = load float, ptr %62, align 4, !tbaa !29
  %64 = call noundef float @_Z7b2CrossRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %65 = fneg float %63
  %66 = call float @llvm.fmuladd.f32(float %65, float %64, float %25)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %67 = getelementptr inbounds i8, ptr %0, i64 240
  %68 = load float, ptr %67, align 8, !tbaa !30
  %69 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %68, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %69, ptr %16, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  %70 = getelementptr inbounds i8, ptr %0, i64 248
  %71 = load float, ptr %70, align 8, !tbaa !31
  %72 = call noundef float @_Z7b2CrossRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %73 = call float @llvm.fmuladd.f32(float %71, float %72, float %32)
  %74 = load ptr, ptr %17, align 8, !tbaa !5
  %75 = load i32, ptr %19, align 8, !tbaa !14
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds %struct.b2Position, ptr %74, i64 %76
  %78 = load i64, ptr %3, align 8
  store i64 %78, ptr %77, align 4
  %79 = load ptr, ptr %17, align 8, !tbaa !5
  %80 = load i32, ptr %19, align 8, !tbaa !14
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds %struct.b2Position, ptr %79, i64 %81, i32 1
  store float %66, ptr %82, align 4, !tbaa !22
  %83 = load i32, ptr %26, align 4, !tbaa !24
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds %struct.b2Position, ptr %79, i64 %84
  %86 = load i64, ptr %4, align 8
  store i64 %86, ptr %85, align 4
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  %88 = load i32, ptr %26, align 4, !tbaa !24
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %struct.b2Position, ptr %87, i64 %89, i32 1
  store float %73, ptr %90, align 4, !tbaa !22
  %91 = call noundef float @_Z5b2AbsIfET_S0_(float noundef %.024)
  %92 = fcmp olt float %91, 0x3F747AE140000000
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  br label %93

93:                                               ; preds = %51, %53
  %.0 = phi i1 [ %92, %53 ], [ true, %51 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i1 %.0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2AbsIfET_S0_(float noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !13, i64 32}
!6 = !{!"_ZTS12b2SolverData", !7, i64 0, !13, i64 32, !13, i64 40}
!7 = !{!"_ZTS10b2TimeStep", !8, i64 0, !8, i64 4, !8, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !12, i64 24}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!15, !11, i64 184}
!15 = !{!"_ZTS15b2DistanceJoint", !16, i64 0, !8, i64 128, !8, i64 132, !8, i64 136, !8, i64 140, !8, i64 144, !8, i64 148, !21, i64 152, !21, i64 160, !8, i64 168, !8, i64 172, !8, i64 176, !8, i64 180, !11, i64 184, !11, i64 188, !21, i64 192, !21, i64 200, !21, i64 208, !21, i64 216, !21, i64 224, !8, i64 232, !8, i64 236, !8, i64 240, !8, i64 244, !8, i64 248, !8, i64 252, !8, i64 256}
!16 = !{!"_ZTS7b2Joint", !17, i64 8, !13, i64 16, !13, i64 24, !18, i64 32, !18, i64 64, !13, i64 96, !13, i64 104, !11, i64 112, !12, i64 116, !12, i64 117, !19, i64 120}
!17 = !{!"_ZTS11b2JointType", !9, i64 0}
!18 = !{!"_ZTS11b2JointEdge", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!19 = !{!"_ZTS15b2JointUserData", !20, i64 0}
!20 = !{!"long", !9, i64 0}
!21 = !{!"_ZTS6b2Vec2", !8, i64 0, !8, i64 4}
!22 = !{!23, !8, i64 8}
!23 = !{!"_ZTS10b2Position", !21, i64 0, !8, i64 8}
!24 = !{!15, !11, i64 188}
!25 = !{!15, !8, i64 144}
!26 = !{!15, !8, i64 148}
!27 = !{!15, !8, i64 256}
!28 = !{!15, !8, i64 236}
!29 = !{!15, !8, i64 244}
!30 = !{!15, !8, i64 240}
!31 = !{!15, !8, i64 248}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass