; LLVM IR from erincatto/box2d :: src (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.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.b2JointSim = type { i32, i32, i32, i32, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, %union.anon }
%union.anon = type { %struct.b2PrismaticJoint }
%struct.b2PrismaticJoint = type { %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, %struct.b2Softness, i8, i8, i8 }
%struct.b2Softness = type { float, float, float }
%struct.b2DistanceJoint = type { float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Softness, float, i8, i8, i8 }
%struct.b2DebugDraw = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.b2AABB, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }

@b2_lengthUnitsPerMeter = external global float, align 4
@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1

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

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #2

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2DrawDistanceJoint(ptr noundef %0, ptr noundef %1, <2 x float> %2, <2 x float> %3, <2 x float> %4, <2 x float> %5) #4 {
  %7 = alloca %struct.b2Transform, align 4
  %8 = alloca %struct.b2Transform, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %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 %struct.b2Vec2, align 4
  %20 = alloca %struct.b2Vec2, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca %struct.b2Vec2, align 4
  %23 = alloca %struct.b2Vec2, align 4
  %24 = alloca %struct.b2Vec2, align 4
  %25 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 0
  store <2 x float> %2, ptr %25, align 4
  %26 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 1
  store <2 x float> %3, ptr %26, align 4
  %27 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  store <2 x float> %4, ptr %27, align 4
  %28 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  store <2 x float> %5, ptr %28, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %6
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.b2JointSim, ptr %30, i32 0, i32 3
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %38, label %34

34:                                               ; preds = %29
  %35 = call i32 @b2InternalAssertFcn(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 514)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  call void @llvm.trap()
  br label %38

38:                                               ; preds = %37, %34, %29
  br label %39

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.b2JointSim, ptr %40, i32 0, i32 10
  store ptr %41, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.b2JointSim, ptr %42, i32 0, i32 4
  %44 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 0
  %45 = load <2 x float>, ptr %44, align 4
  %46 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 1
  %47 = load <2 x float>, ptr %46, align 4
  %48 = load <2 x float>, ptr %43, align 4
  %49 = call <2 x float> @b2TransformPoint(<2 x float> %45, <2 x float> %47, <2 x float> %48)
  store <2 x float> %49, ptr %12, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.b2JointSim, ptr %50, i32 0, i32 5
  %52 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %53 = load <2 x float>, ptr %52, align 4
  %54 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %55 = load <2 x float>, ptr %54, align 4
  %56 = load <2 x float>, ptr %51, align 4
  %57 = call <2 x float> @b2TransformPoint(<2 x float> %53, <2 x float> %55, <2 x float> %56)
  store <2 x float> %57, ptr %13, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %58 = load <2 x float>, ptr %13, align 4
  %59 = load <2 x float>, ptr %12, align 4
  %60 = call <2 x float> @b2Sub(<2 x float> %58, <2 x float> %59)
  store <2 x float> %60, ptr %15, align 4
  %61 = load <2 x float>, ptr %15, align 4
  %62 = call <2 x float> @b2Normalize(<2 x float> %61)
  store <2 x float> %62, ptr %14, align 4
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b2DistanceJoint, ptr %63, i32 0, i32 3
  %65 = load float, ptr %64, align 4, !tbaa !14
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.b2DistanceJoint, ptr %66, i32 0, i32 4
  %68 = load float, ptr %67, align 4, !tbaa !18
  %69 = fcmp olt float %65, %68
  br i1 %69, label %70, label %161

70:                                               ; preds = %39
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.b2DistanceJoint, ptr %71, i32 0, i32 19
  %73 = load i8, ptr %72, align 1, !tbaa !19, !range !20, !noundef !21
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %161

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.b2DistanceJoint, ptr %76, i32 0, i32 3
  %78 = load float, ptr %77, align 4, !tbaa !14
  %79 = load <2 x float>, ptr %12, align 4
  %80 = load <2 x float>, ptr %14, align 4
  %81 = call <2 x float> @b2MulAdd(<2 x float> %79, float noundef %78, <2 x float> %80)
  store <2 x float> %81, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.b2DistanceJoint, ptr %82, i32 0, i32 4
  %84 = load float, ptr %83, align 4, !tbaa !18
  %85 = load <2 x float>, ptr %12, align 4
  %86 = load <2 x float>, ptr %14, align 4
  %87 = call <2 x float> @b2MulAdd(<2 x float> %85, float noundef %84, <2 x float> %86)
  store <2 x float> %87, ptr %17, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %88 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !22
  %89 = fmul float 0x3FA99999A0000000, %88
  %90 = load <2 x float>, ptr %14, align 4
  %91 = call <2 x float> @b2RightPerp(<2 x float> %90)
  store <2 x float> %91, ptr %19, align 4
  %92 = load <2 x float>, ptr %19, align 4
  %93 = call <2 x float> @b2MulSV(float noundef %89, <2 x float> %92)
  store <2 x float> %93, ptr %18, align 4
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.b2DistanceJoint, ptr %94, i32 0, i32 3
  %96 = load float, ptr %95, align 4, !tbaa !14
  %97 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !22
  %98 = fmul float 0x3F747AE140000000, %97
  %99 = fcmp ogt float %96, %98
  br i1 %99, label %100, label %115

100:                                              ; preds = %75
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.b2DebugDraw, ptr %101, i32 0, i32 5
  %103 = load ptr, ptr %102, align 8, !tbaa !23
  %104 = load <2 x float>, ptr %16, align 4
  %105 = load <2 x float>, ptr %18, align 4
  %106 = call <2 x float> @b2Sub(<2 x float> %104, <2 x float> %105)
  store <2 x float> %106, ptr %20, align 4
  %107 = load <2 x float>, ptr %16, align 4
  %108 = load <2 x float>, ptr %18, align 4
  %109 = call <2 x float> @b2Add(<2 x float> %107, <2 x float> %108)
  store <2 x float> %109, ptr %21, align 4
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.b2DebugDraw, ptr %110, i32 0, i32 24
  %112 = load ptr, ptr %111, align 8, !tbaa !26
  %113 = load <2 x float>, ptr %20, align 4
  %114 = load <2 x float>, ptr %21, align 4
  call void %103(<2 x float> %113, <2 x float> %114, i32 noundef 9498256, ptr noundef %112)
  br label %115

115:                                              ; preds = %100, %75
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.b2DistanceJoint, ptr %116, i32 0, i32 4
  %118 = load float, ptr %117, align 4, !tbaa !18
  %119 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !22
  %120 = fmul float 1.000000e+05, %119
  %121 = fcmp olt float %118, %120
  br i1 %121, label %122, label %137

122:                                              ; preds = %115
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.b2DebugDraw, ptr %123, i32 0, i32 5
  %125 = load ptr, ptr %124, align 8, !tbaa !23
  %126 = load <2 x float>, ptr %17, align 4
  %127 = load <2 x float>, ptr %18, align 4
  %128 = call <2 x float> @b2Sub(<2 x float> %126, <2 x float> %127)
  store <2 x float> %128, ptr %22, align 4
  %129 = load <2 x float>, ptr %17, align 4
  %130 = load <2 x float>, ptr %18, align 4
  %131 = call <2 x float> @b2Add(<2 x float> %129, <2 x float> %130)
  store <2 x float> %131, ptr %23, align 4
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.b2DebugDraw, ptr %132, i32 0, i32 24
  %134 = load ptr, ptr %133, align 8, !tbaa !26
  %135 = load <2 x float>, ptr %22, align 4
  %136 = load <2 x float>, ptr %23, align 4
  call void %125(<2 x float> %135, <2 x float> %136, i32 noundef 16711680, ptr noundef %134)
  br label %137

137:                                              ; preds = %122, %115
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.b2DistanceJoint, ptr %138, i32 0, i32 3
  %140 = load float, ptr %139, align 4, !tbaa !14
  %141 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !22
  %142 = fmul float 0x3F747AE140000000, %141
  %143 = fcmp ogt float %140, %142
  br i1 %143, label %144, label %160

144:                                              ; preds = %137
  %145 = load ptr, ptr %11, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.b2DistanceJoint, ptr %145, i32 0, i32 4
  %147 = load float, ptr %146, align 4, !tbaa !18
  %148 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !22
  %149 = fmul float 1.000000e+05, %148
  %150 = fcmp olt float %147, %149
  br i1 %150, label %151, label %160

151:                                              ; preds = %144
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.b2DebugDraw, ptr %152, i32 0, i32 5
  %154 = load ptr, ptr %153, align 8, !tbaa !23
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.b2DebugDraw, ptr %155, i32 0, i32 24
  %157 = load ptr, ptr %156, align 8, !tbaa !26
  %158 = load <2 x float>, ptr %16, align 4
  %159 = load <2 x float>, ptr %17, align 4
  call void %154(<2 x float> %158, <2 x float> %159, i32 noundef 8421504, ptr noundef %157)
  br label %160

160:                                              ; preds = %151, %144, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %161

161:                                              ; preds = %160, %70, %39
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.b2DebugDraw, ptr %162, i32 0, i32 5
  %164 = load ptr, ptr %163, align 8, !tbaa !23
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.b2DebugDraw, ptr %165, i32 0, i32 24
  %167 = load ptr, ptr %166, align 8, !tbaa !26
  %168 = load <2 x float>, ptr %12, align 4
  %169 = load <2 x float>, ptr %13, align 4
  call void %164(<2 x float> %168, <2 x float> %169, i32 noundef 16777215, ptr noundef %167)
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.b2DebugDraw, ptr %170, i32 0, i32 7
  %172 = load ptr, ptr %171, align 8, !tbaa !27
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.b2DebugDraw, ptr %173, i32 0, i32 24
  %175 = load ptr, ptr %174, align 8, !tbaa !26
  %176 = load <2 x float>, ptr %12, align 4
  call void %172(<2 x float> %176, float noundef 4.000000e+00, i32 noundef 16777215, ptr noundef %175)
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.b2DebugDraw, ptr %177, i32 0, i32 7
  %179 = load ptr, ptr %178, align 8, !tbaa !27
  %180 = load ptr, ptr %9, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.b2DebugDraw, ptr %180, i32 0, i32 24
  %182 = load ptr, ptr %181, align 8, !tbaa !26
  %183 = load <2 x float>, ptr %13, align 4
  call void %179(<2 x float> %183, float noundef 4.000000e+00, i32 noundef 16777215, ptr noundef %182)
  %184 = load ptr, ptr %11, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.b2DistanceJoint, ptr %184, i32 0, i32 1
  %186 = load float, ptr %185, align 4, !tbaa !28
  %187 = fcmp ogt float %186, 0.000000e+00
  br i1 %187, label %188, label %207

188:                                              ; preds = %161
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.b2DistanceJoint, ptr %189, i32 0, i32 18
  %191 = load i8, ptr %190, align 4, !tbaa !29, !range !20, !noundef !21
  %192 = trunc i8 %191 to i1
  br i1 %192, label %193, label %207

193:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.b2DistanceJoint, ptr %194, i32 0, i32 0
  %196 = load float, ptr %195, align 4, !tbaa !30
  %197 = load <2 x float>, ptr %12, align 4
  %198 = load <2 x float>, ptr %14, align 4
  %199 = call <2 x float> @b2MulAdd(<2 x float> %197, float noundef %196, <2 x float> %198)
  store <2 x float> %199, ptr %24, align 4
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.b2DebugDraw, ptr %200, i32 0, i32 7
  %202 = load ptr, ptr %201, align 8, !tbaa !27
  %203 = load ptr, ptr %9, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.b2DebugDraw, ptr %203, i32 0, i32 24
  %205 = load ptr, ptr %204, align 8, !tbaa !26
  %206 = load <2 x float>, ptr %24, align 4
  call void %202(<2 x float> %206, float noundef 4.000000e+00, i32 noundef 255, ptr noundef %205)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %207

207:                                              ; preds = %193, %188, %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #3 = { 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 #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" }
attributes #5 = { 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, !11, i64 12}
!10 = !{!"b2JointSim", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !7, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"b2Vec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!15, !13, i64 12}
!15 = !{!"b2DistanceJoint", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !11, i64 44, !11, i64 48, !12, i64 52, !12, i64 60, !12, i64 68, !16, i64 76, !13, i64 88, !17, i64 92, !17, i64 93, !17, i64 94}
!16 = !{!"b2Softness", !13, i64 0, !13, i64 4, !13, i64 8}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!15, !13, i64 16}
!19 = !{!15, !17, i64 93}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !6, i64 40}
!24 = !{!"b2DebugDraw", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !25, i64 72, !17, i64 88, !17, i64 89, !17, i64 90, !17, i64 91, !17, i64 92, !17, i64 93, !17, i64 94, !17, i64 95, !17, i64 96, !17, i64 97, !17, i64 98, !17, i64 99, !17, i64 100, !17, i64 101, !6, i64 104}
!25 = !{!"b2AABB", !12, i64 0, !12, i64 8}
!26 = !{!24, !6, i64 104}
!27 = !{!24, !6, i64 56}
!28 = !{!15, !13, i64 4}
!29 = !{!15, !17, i64 92}
!30 = !{!15, !13, i64 0}


; 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"

@b2_lengthUnitsPerMeter = external local_unnamed_addr global float, align 4
@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2DrawDistanceJoint(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, <2 x float> %2, <2 x float> %3, <2 x float> %4, <2 x float> %5) local_unnamed_addr #3 {
  %7 = getelementptr inbounds i8, ptr %1, i64 12
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %13, label %10

10:                                               ; preds = %6
  %11 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 514) #4
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %13, label %12

12:                                               ; preds = %10
  tail call void @llvm.trap()
  unreachable

13:                                               ; preds = %6, %10
  %14 = getelementptr inbounds i8, ptr %1, i64 48
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = load <2 x float>, ptr %15, align 4
  %17 = tail call <2 x float> @b2TransformPoint(<2 x float> %2, <2 x float> %3, <2 x float> %16)
  %18 = getelementptr inbounds i8, ptr %1, i64 24
  %19 = load <2 x float>, ptr %18, align 4
  %20 = tail call <2 x float> @b2TransformPoint(<2 x float> %4, <2 x float> %5, <2 x float> %19)
  %21 = tail call <2 x float> @b2Sub(<2 x float> %20, <2 x float> %17)
  %22 = tail call <2 x float> @b2Normalize(<2 x float> %21)
  %23 = getelementptr inbounds i8, ptr %1, i64 60
  %24 = load float, ptr %23, align 4, !tbaa !12
  %25 = getelementptr inbounds i8, ptr %1, i64 64
  %26 = load float, ptr %25, align 4, !tbaa !16
  %27 = fcmp olt float %24, %26
  br i1 %27, label %28, label %77

28:                                               ; preds = %13
  %29 = getelementptr inbounds i8, ptr %1, i64 141
  %30 = load i8, ptr %29, align 1, !tbaa !17, !range !18, !noundef !19
  %31 = trunc nuw i8 %30 to i1
  br i1 %31, label %32, label %77

32:                                               ; preds = %28
  %33 = tail call <2 x float> @b2MulAdd(<2 x float> %17, float noundef %24, <2 x float> %22)
  %34 = load float, ptr %25, align 4, !tbaa !16
  %35 = tail call <2 x float> @b2MulAdd(<2 x float> %17, float noundef %34, <2 x float> %22)
  %36 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !20
  %37 = fmul float %36, 0x3FA99999A0000000
  %38 = tail call <2 x float> @b2RightPerp(<2 x float> %22)
  %39 = tail call <2 x float> @b2MulSV(float noundef %37, <2 x float> %38)
  %40 = load float, ptr %23, align 4, !tbaa !12
  %41 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !20
  %42 = fmul float %41, 0x3F747AE140000000
  %43 = fcmp ogt float %40, %42
  br i1 %43, label %44, label %51

44:                                               ; preds = %32
  %45 = getelementptr inbounds i8, ptr %0, i64 40
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  %47 = tail call <2 x float> @b2Sub(<2 x float> %33, <2 x float> %39)
  %48 = tail call <2 x float> @b2Add(<2 x float> %33, <2 x float> %39)
  %49 = getelementptr inbounds i8, ptr %0, i64 104
  %50 = load ptr, ptr %49, align 8, !tbaa !25
  tail call void %46(<2 x float> %47, <2 x float> %48, i32 noundef 9498256, ptr noundef %50) #4
  %.pre = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !20
  br label %51

51:                                               ; preds = %44, %32
  %52 = phi float [ %.pre, %44 ], [ %41, %32 ]
  %53 = load float, ptr %25, align 4, !tbaa !16
  %54 = fmul float %52, 1.000000e+05
  %55 = fcmp olt float %53, %54
  br i1 %55, label %56, label %63

56:                                               ; preds = %51
  %57 = getelementptr inbounds i8, ptr %0, i64 40
  %58 = load ptr, ptr %57, align 8, !tbaa !21
  %59 = tail call <2 x float> @b2Sub(<2 x float> %35, <2 x float> %39)
  %60 = tail call <2 x float> @b2Add(<2 x float> %35, <2 x float> %39)
  %61 = getelementptr inbounds i8, ptr %0, i64 104
  %62 = load ptr, ptr %61, align 8, !tbaa !25
  tail call void %58(<2 x float> %59, <2 x float> %60, i32 noundef 16711680, ptr noundef %62) #4
  %.pre62 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !20
  br label %63

63:                                               ; preds = %56, %51
  %64 = phi float [ %.pre62, %56 ], [ %52, %51 ]
  %65 = load float, ptr %23, align 4, !tbaa !12
  %66 = fmul float %64, 0x3F747AE140000000
  %67 = fcmp ogt float %65, %66
  br i1 %67, label %68, label %77

68:                                               ; preds = %63
  %69 = load float, ptr %25, align 4, !tbaa !16
  %70 = fmul float %64, 1.000000e+05
  %71 = fcmp olt float %69, %70
  br i1 %71, label %72, label %77

72:                                               ; preds = %68
  %73 = getelementptr inbounds i8, ptr %0, i64 40
  %74 = load ptr, ptr %73, align 8, !tbaa !21
  %75 = getelementptr inbounds i8, ptr %0, i64 104
  %76 = load ptr, ptr %75, align 8, !tbaa !25
  tail call void %74(<2 x float> %33, <2 x float> %35, i32 noundef 8421504, ptr noundef %76) #4
  br label %77

77:                                               ; preds = %63, %68, %72, %28, %13
  %78 = getelementptr inbounds i8, ptr %0, i64 40
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = getelementptr inbounds i8, ptr %0, i64 104
  %81 = load ptr, ptr %80, align 8, !tbaa !25
  tail call void %79(<2 x float> %17, <2 x float> %20, i32 noundef 16777215, ptr noundef %81) #4
  %82 = getelementptr inbounds i8, ptr %0, i64 56
  %83 = load ptr, ptr %82, align 8, !tbaa !26
  %84 = load ptr, ptr %80, align 8, !tbaa !25
  tail call void %83(<2 x float> %17, float noundef 4.000000e+00, i32 noundef 16777215, ptr noundef %84) #4
  %85 = load ptr, ptr %82, align 8, !tbaa !26
  %86 = load ptr, ptr %80, align 8, !tbaa !25
  tail call void %85(<2 x float> %20, float noundef 4.000000e+00, i32 noundef 16777215, ptr noundef %86) #4
  %87 = getelementptr inbounds i8, ptr %1, i64 52
  %88 = load float, ptr %87, align 4, !tbaa !27
  %89 = fcmp ogt float %88, 0.000000e+00
  br i1 %89, label %90, label %99

90:                                               ; preds = %77
  %91 = getelementptr inbounds i8, ptr %1, i64 140
  %92 = load i8, ptr %91, align 4, !tbaa !28, !range !18, !noundef !19
  %93 = trunc nuw i8 %92 to i1
  br i1 %93, label %94, label %99

94:                                               ; preds = %90
  %95 = load float, ptr %14, align 4, !tbaa !29
  %96 = tail call <2 x float> @b2MulAdd(<2 x float> %17, float noundef %95, <2 x float> %22)
  %97 = load ptr, ptr %82, align 8, !tbaa !26
  %98 = load ptr, ptr %80, align 8, !tbaa !25
  tail call void %97(<2 x float> %96, float noundef 4.000000e+00, i32 noundef 255, ptr noundef %98) #4
  br label %99

99:                                               ; preds = %94, %90, %77
  ret void
}

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

attributes #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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
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 = { 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 #4 = { 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, !7, i64 12}
!6 = !{!"b2JointSim", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !8, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!11 = !{!"float", !8, i64 0}
!12 = !{!13, !11, i64 12}
!13 = !{!"b2DistanceJoint", !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, !7, i64 44, !7, i64 48, !10, i64 52, !10, i64 60, !10, i64 68, !14, i64 76, !11, i64 88, !15, i64 92, !15, i64 93, !15, i64 94}
!14 = !{!"b2Softness", !11, i64 0, !11, i64 4, !11, i64 8}
!15 = !{!"_Bool", !8, i64 0}
!16 = !{!13, !11, i64 16}
!17 = !{!13, !15, i64 93}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!11, !11, i64 0}
!21 = !{!22, !23, i64 40}
!22 = !{!"b2DebugDraw", !23, i64 0, !23, i64 8, !23, i64 16, !23, i64 24, !23, i64 32, !23, i64 40, !23, i64 48, !23, i64 56, !23, i64 64, !24, i64 72, !15, i64 88, !15, i64 89, !15, i64 90, !15, i64 91, !15, i64 92, !15, i64 93, !15, i64 94, !15, i64 95, !15, i64 96, !15, i64 97, !15, i64 98, !15, i64 99, !15, i64 100, !15, i64 101, !23, i64 104}
!23 = !{!"any pointer", !8, i64 0}
!24 = !{!"b2AABB", !10, i64 0, !10, i64 8}
!25 = !{!22, !23, i64 104}
!26 = !{!22, !23, i64 56}
!27 = !{!13, !11, i64 4}
!28 = !{!13, !15, i64 92}
!29 = !{!13, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass