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

; 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.b2Manifold = type { %struct.b2Vec2, float, [2 x %struct.b2ManifoldPoint], i32 }
%struct.b2Vec2 = type { float, float }
%struct.b2ManifoldPoint = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, i16, i8 }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%struct.b2Circle = type { %struct.b2Vec2, float }
%struct.b2ChainSegment = type { %struct.b2Vec2, %struct.b2Segment, %struct.b2Vec2, i32 }
%struct.b2Segment = type { %struct.b2Vec2, %struct.b2Vec2 }

@b2_lengthUnitsPerMeter = external global float, align 4

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

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

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

; 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) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2GetLengthAndNormalize(ptr noundef, <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 <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) #2

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

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

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

; 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 float @b2Dot(<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) #4

; Function Attrs: nounwind uwtable
define dso_local void @b2CollideChainSegmentAndCircle(ptr dead_on_unwind noalias writable sret(%struct.b2Manifold) align 4 %0, ptr noundef %1, <2 x float> %2, <2 x float> %3, ptr noundef %4, <2 x float> %5, <2 x float> %6) #5 {
  %8 = alloca %struct.b2Transform, align 4
  %9 = alloca %struct.b2Transform, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.b2Transform, 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 float, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca %struct.b2Vec2, align 4
  %20 = alloca i32, align 4
  %21 = alloca float, align 4
  %22 = alloca %struct.b2Vec2, align 4
  %23 = alloca float, align 4
  %24 = alloca %struct.b2Vec2, align 4
  %25 = alloca %struct.b2Vec2, align 4
  %26 = alloca %struct.b2Vec2, align 4
  %27 = alloca float, align 4
  %28 = alloca %struct.b2Vec2, align 4
  %29 = alloca %struct.b2Vec2, align 4
  %30 = alloca float, align 4
  %31 = alloca %struct.b2Vec2, align 4
  %32 = alloca float, align 4
  %33 = alloca %struct.b2Vec2, align 4
  %34 = alloca %struct.b2Vec2, align 4
  %35 = alloca i1, align 1
  %36 = alloca float, align 4
  %37 = alloca %struct.b2Vec2, align 4
  %38 = alloca %struct.b2Vec2, align 4
  %39 = alloca float, align 4
  %40 = alloca float, align 4
  %41 = alloca %struct.b2Vec2, align 4
  %42 = alloca %struct.b2Vec2, align 4
  %43 = alloca %struct.b2Vec2, align 4
  %44 = alloca %struct.b2Vec2, align 4
  %45 = alloca ptr, align 8
  %46 = alloca %struct.b2Vec2, align 4
  %47 = alloca %struct.b2Vec2, align 4
  %48 = alloca %struct.b2Vec2, align 4
  %49 = alloca %struct.b2Vec2, align 4
  %50 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  store <2 x float> %2, ptr %50, align 4
  %51 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  store <2 x float> %3, ptr %51, align 4
  %52 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  store <2 x float> %5, ptr %52, align 4
  %53 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  store <2 x float> %6, ptr %53, align 4
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %0, i8 0, i64 112, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %54 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %55 = load <2 x float>, ptr %54, align 4
  %56 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %57 = load <2 x float>, ptr %56, align 4
  %58 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %59 = load <2 x float>, ptr %58, align 4
  %60 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %61 = load <2 x float>, ptr %60, align 4
  %62 = call { <2 x float>, <2 x float> } @b2InvMulTransforms(<2 x float> %55, <2 x float> %57, <2 x float> %59, <2 x float> %61)
  %63 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 0
  %64 = extractvalue { <2 x float>, <2 x float> } %62, 0
  store <2 x float> %64, ptr %63, align 4
  %65 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 1
  %66 = extractvalue { <2 x float>, <2 x float> } %62, 1
  store <2 x float> %66, ptr %65, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.b2Circle, ptr %67, i32 0, i32 0
  %69 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 0
  %70 = load <2 x float>, ptr %69, align 4
  %71 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 1
  %72 = load <2 x float>, ptr %71, align 4
  %73 = load <2 x float>, ptr %68, align 4
  %74 = call <2 x float> @b2TransformPoint(<2 x float> %70, <2 x float> %72, <2 x float> %73)
  store <2 x float> %74, ptr %13, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.b2ChainSegment, ptr %75, i32 0, i32 1
  %77 = getelementptr inbounds %struct.b2Segment, ptr %76, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %77, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.b2ChainSegment, ptr %78, i32 0, i32 1
  %80 = getelementptr inbounds %struct.b2Segment, ptr %79, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %80, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %81 = load <2 x float>, ptr %15, align 4
  %82 = load <2 x float>, ptr %14, align 4
  %83 = call <2 x float> @b2Sub(<2 x float> %81, <2 x float> %82)
  store <2 x float> %83, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %84 = load <2 x float>, ptr %16, align 4
  %85 = call <2 x float> @b2RightPerp(<2 x float> %84)
  store <2 x float> %85, ptr %18, align 4
  %86 = load <2 x float>, ptr %13, align 4
  %87 = load <2 x float>, ptr %14, align 4
  %88 = call <2 x float> @b2Sub(<2 x float> %86, <2 x float> %87)
  store <2 x float> %88, ptr %19, align 4
  %89 = load <2 x float>, ptr %18, align 4
  %90 = load <2 x float>, ptr %19, align 4
  %91 = call float @b2Dot(<2 x float> %89, <2 x float> %90)
  store float %91, ptr %17, align 4, !tbaa !10
  %92 = load float, ptr %17, align 4, !tbaa !10
  %93 = fcmp olt float %92, 0.000000e+00
  br i1 %93, label %94, label %95

94:                                               ; preds = %7
  store i32 1, ptr %20, align 4
  br label %252

95:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %96 = load <2 x float>, ptr %15, align 4
  %97 = load <2 x float>, ptr %13, align 4
  %98 = call <2 x float> @b2Sub(<2 x float> %96, <2 x float> %97)
  store <2 x float> %98, ptr %22, align 4
  %99 = load <2 x float>, ptr %16, align 4
  %100 = load <2 x float>, ptr %22, align 4
  %101 = call float @b2Dot(<2 x float> %99, <2 x float> %100)
  store float %101, ptr %21, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %102 = load <2 x float>, ptr %13, align 4
  %103 = load <2 x float>, ptr %14, align 4
  %104 = call <2 x float> @b2Sub(<2 x float> %102, <2 x float> %103)
  store <2 x float> %104, ptr %24, align 4
  %105 = load <2 x float>, ptr %16, align 4
  %106 = load <2 x float>, ptr %24, align 4
  %107 = call float @b2Dot(<2 x float> %105, <2 x float> %106)
  store float %107, ptr %23, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %108 = load float, ptr %23, align 4, !tbaa !10
  %109 = fcmp ole float %108, 0.000000e+00
  br i1 %109, label %110, label %129

110:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %111 = load ptr, ptr %10, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.b2ChainSegment, ptr %111, i32 0, i32 0
  %113 = load <2 x float>, ptr %14, align 4
  %114 = load <2 x float>, ptr %112, align 4
  %115 = call <2 x float> @b2Sub(<2 x float> %113, <2 x float> %114)
  store <2 x float> %115, ptr %26, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %116 = load <2 x float>, ptr %13, align 4
  %117 = load <2 x float>, ptr %14, align 4
  %118 = call <2 x float> @b2Sub(<2 x float> %116, <2 x float> %117)
  store <2 x float> %118, ptr %28, align 4
  %119 = load <2 x float>, ptr %26, align 4
  %120 = load <2 x float>, ptr %28, align 4
  %121 = call float @b2Dot(<2 x float> %119, <2 x float> %120)
  store float %121, ptr %27, align 4, !tbaa !10
  %122 = load float, ptr %27, align 4, !tbaa !10
  %123 = fcmp ole float %122, 0.000000e+00
  br i1 %123, label %124, label %125

124:                                              ; preds = %110
  store i32 1, ptr %20, align 4
  br label %126

125:                                              ; preds = %110
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !9
  store i32 0, ptr %20, align 4
  br label %126

126:                                              ; preds = %125, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  %127 = load i32, ptr %20, align 4
  switch i32 %127, label %251 [
    i32 0, label %128
  ]

128:                                              ; preds = %126
  br label %183

129:                                              ; preds = %95
  %130 = load float, ptr %21, align 4, !tbaa !10
  %131 = fcmp ole float %130, 0.000000e+00
  br i1 %131, label %132, label %151

132:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.b2ChainSegment, ptr %133, i32 0, i32 2
  %135 = load <2 x float>, ptr %134, align 4
  %136 = load <2 x float>, ptr %15, align 4
  %137 = call <2 x float> @b2Sub(<2 x float> %135, <2 x float> %136)
  store <2 x float> %137, ptr %29, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %138 = load <2 x float>, ptr %13, align 4
  %139 = load <2 x float>, ptr %15, align 4
  %140 = call <2 x float> @b2Sub(<2 x float> %138, <2 x float> %139)
  store <2 x float> %140, ptr %31, align 4
  %141 = load <2 x float>, ptr %29, align 4
  %142 = load <2 x float>, ptr %31, align 4
  %143 = call float @b2Dot(<2 x float> %141, <2 x float> %142)
  store float %143, ptr %30, align 4, !tbaa !10
  %144 = load float, ptr %30, align 4, !tbaa !10
  %145 = fcmp ogt float %144, 0.000000e+00
  br i1 %145, label %146, label %147

146:                                              ; preds = %132
  store i32 1, ptr %20, align 4
  br label %148

147:                                              ; preds = %132
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !9
  store i32 0, ptr %20, align 4
  br label %148

148:                                              ; preds = %147, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  %149 = load i32, ptr %20, align 4
  switch i32 %149, label %251 [
    i32 0, label %150
  ]

150:                                              ; preds = %148
  br label %182

151:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  %152 = load <2 x float>, ptr %16, align 4
  %153 = load <2 x float>, ptr %16, align 4
  %154 = call float @b2Dot(<2 x float> %152, <2 x float> %153)
  store float %154, ptr %32, align 4, !tbaa !10
  %155 = getelementptr inbounds %struct.b2Vec2, ptr %33, i32 0, i32 0
  %156 = load float, ptr %21, align 4, !tbaa !10
  %157 = getelementptr inbounds %struct.b2Vec2, ptr %14, i32 0, i32 0
  %158 = load float, ptr %157, align 4, !tbaa !12
  %159 = load float, ptr %23, align 4, !tbaa !10
  %160 = getelementptr inbounds %struct.b2Vec2, ptr %15, i32 0, i32 0
  %161 = load float, ptr %160, align 4, !tbaa !12
  %162 = fmul float %159, %161
  %163 = call float @llvm.fmuladd.f32(float %156, float %158, float %162)
  store float %163, ptr %155, align 4, !tbaa !12
  %164 = getelementptr inbounds %struct.b2Vec2, ptr %33, i32 0, i32 1
  %165 = load float, ptr %21, align 4, !tbaa !10
  %166 = getelementptr inbounds %struct.b2Vec2, ptr %14, i32 0, i32 1
  %167 = load float, ptr %166, align 4, !tbaa !14
  %168 = load float, ptr %23, align 4, !tbaa !10
  %169 = getelementptr inbounds %struct.b2Vec2, ptr %15, i32 0, i32 1
  %170 = load float, ptr %169, align 4, !tbaa !14
  %171 = fmul float %168, %170
  %172 = call float @llvm.fmuladd.f32(float %165, float %167, float %171)
  store float %172, ptr %164, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %33, i64 8, i1 false), !tbaa.struct !9
  %173 = load float, ptr %32, align 4, !tbaa !10
  %174 = fcmp ogt float %173, 0.000000e+00
  store i1 false, ptr %35, align 1
  br i1 %174, label %175, label %180

175:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  store i1 true, ptr %35, align 1
  %176 = load float, ptr %32, align 4, !tbaa !10
  %177 = fdiv float 1.000000e+00, %176
  %178 = load <2 x float>, ptr %25, align 4
  %179 = call <2 x float> @b2MulSV(float noundef %177, <2 x float> %178)
  store <2 x float> %179, ptr %34, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %34, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  br label %181

180:                                              ; preds = %151
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !9
  br label %181

181:                                              ; preds = %180, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %182

182:                                              ; preds = %181, %150
  br label %183

183:                                              ; preds = %182, %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %184 = load <2 x float>, ptr %13, align 4
  %185 = load <2 x float>, ptr %25, align 4
  %186 = call <2 x float> @b2Sub(<2 x float> %184, <2 x float> %185)
  store <2 x float> %186, ptr %38, align 4
  %187 = load <2 x float>, ptr %38, align 4
  %188 = call <2 x float> @b2GetLengthAndNormalize(ptr noundef %36, <2 x float> %187)
  store <2 x float> %188, ptr %37, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.b2Circle, ptr %189, i32 0, i32 1
  %191 = load float, ptr %190, align 4, !tbaa !15
  store float %191, ptr %39, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #6
  %192 = load float, ptr %36, align 4, !tbaa !10
  %193 = load float, ptr %39, align 4, !tbaa !10
  %194 = fsub float %192, %193
  store float %194, ptr %40, align 4, !tbaa !10
  %195 = load float, ptr %40, align 4, !tbaa !10
  %196 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !10
  %197 = fmul float 0x3F747AE140000000, %196
  %198 = fmul float 4.000000e+00, %197
  %199 = fcmp ogt float %195, %198
  br i1 %199, label %200, label %201

200:                                              ; preds = %183
  store i32 1, ptr %20, align 4
  br label %250

201:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 4 %25, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  %202 = load float, ptr %39, align 4, !tbaa !10
  %203 = fneg float %202
  %204 = load <2 x float>, ptr %13, align 4
  %205 = load <2 x float>, ptr %37, align 4
  %206 = call <2 x float> @b2MulAdd(<2 x float> %204, float noundef %203, <2 x float> %205)
  store <2 x float> %206, ptr %42, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #6
  %207 = load <2 x float>, ptr %41, align 4
  %208 = load <2 x float>, ptr %42, align 4
  %209 = call <2 x float> @b2Lerp(<2 x float> %207, <2 x float> %208, float noundef 5.000000e-01)
  store <2 x float> %209, ptr %43, align 4
  %210 = getelementptr inbounds %struct.b2Manifold, ptr %0, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #6
  %211 = getelementptr inbounds %struct.b2Transform, ptr %8, i32 0, i32 1
  %212 = load <2 x float>, ptr %211, align 4
  %213 = load <2 x float>, ptr %37, align 4
  %214 = call <2 x float> @b2RotateVector(<2 x float> %212, <2 x float> %213)
  store <2 x float> %214, ptr %44, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %210, ptr align 4 %44, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #6
  %215 = getelementptr inbounds %struct.b2Manifold, ptr %0, i32 0, i32 2
  %216 = getelementptr inbounds [2 x %struct.b2ManifoldPoint], ptr %215, i64 0, i64 0
  %217 = getelementptr inbounds %struct.b2ManifoldPoint, ptr %216, i64 0
  store ptr %217, ptr %45, align 8, !tbaa !5
  %218 = load ptr, ptr %45, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.b2ManifoldPoint, ptr %218, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #6
  %220 = getelementptr inbounds %struct.b2Transform, ptr %8, i32 0, i32 1
  %221 = load <2 x float>, ptr %220, align 4
  %222 = load <2 x float>, ptr %43, align 4
  %223 = call <2 x float> @b2RotateVector(<2 x float> %221, <2 x float> %222)
  store <2 x float> %223, ptr %46, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %219, ptr align 4 %46, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #6
  %224 = load ptr, ptr %45, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.b2ManifoldPoint, ptr %224, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #6
  %226 = load ptr, ptr %45, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.b2ManifoldPoint, ptr %226, i32 0, i32 1
  %228 = getelementptr inbounds %struct.b2Transform, ptr %8, i32 0, i32 0
  %229 = getelementptr inbounds %struct.b2Transform, ptr %9, i32 0, i32 0
  %230 = load <2 x float>, ptr %228, align 4
  %231 = load <2 x float>, ptr %229, align 4
  %232 = call <2 x float> @b2Sub(<2 x float> %230, <2 x float> %231)
  store <2 x float> %232, ptr %48, align 4
  %233 = load <2 x float>, ptr %227, align 4
  %234 = load <2 x float>, ptr %48, align 4
  %235 = call <2 x float> @b2Add(<2 x float> %233, <2 x float> %234)
  store <2 x float> %235, ptr %47, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %225, ptr align 4 %47, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #6
  %236 = load ptr, ptr %45, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.b2ManifoldPoint, ptr %236, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #6
  %238 = getelementptr inbounds %struct.b2Transform, ptr %8, i32 0, i32 0
  %239 = load ptr, ptr %45, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.b2ManifoldPoint, ptr %239, i32 0, i32 1
  %241 = load <2 x float>, ptr %238, align 4
  %242 = load <2 x float>, ptr %240, align 4
  %243 = call <2 x float> @b2Add(<2 x float> %241, <2 x float> %242)
  store <2 x float> %243, ptr %49, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %237, ptr align 4 %49, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #6
  %244 = load float, ptr %40, align 4, !tbaa !10
  %245 = load ptr, ptr %45, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.b2ManifoldPoint, ptr %245, i32 0, i32 3
  store float %244, ptr %246, align 4, !tbaa !17
  %247 = load ptr, ptr %45, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.b2ManifoldPoint, ptr %247, i32 0, i32 8
  store i16 0, ptr %248, align 4, !tbaa !21
  %249 = getelementptr inbounds %struct.b2Manifold, ptr %0, i32 0, i32 3
  store i32 1, ptr %249, align 4, !tbaa !22
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  br label %250

250:                                              ; preds = %201, %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  br label %251

251:                                              ; preds = %250, %148, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %252

252:                                              ; preds = %251, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  ret void
}

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

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync 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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{i64 0, i64 4, !10, i64 4, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!14 = !{!13, !11, i64 4}
!15 = !{!16, !11, i64 8}
!16 = !{!"b2Circle", !13, i64 0, !11, i64 8}
!17 = !{!18, !11, i64 24}
!18 = !{!"b2ManifoldPoint", !13, i64 0, !13, i64 8, !13, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !19, i64 44, !20, i64 46}
!19 = !{!"short", !7, i64 0}
!20 = !{!"_Bool", !7, i64 0}
!21 = !{!18, !19, i64 44}
!22 = !{!23, !24, i64 108}
!23 = !{!"b2Manifold", !13, i64 0, !11, i64 8, !7, i64 12, !24, i64 108}
!24 = !{!"int", !7, 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"

%struct.b2Manifold = type { %struct.b2Vec2, float, [2 x %struct.b2ManifoldPoint], i32 }
%struct.b2Vec2 = type { float, float }
%struct.b2ManifoldPoint = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, i16, i8 }

@b2_lengthUnitsPerMeter = external local_unnamed_addr global float, align 4

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

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

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

; 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> @b2GetLengthAndNormalize(ptr noundef, <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> @b2MulAdd(<2 x float>, float noundef, <2 x float>) local_unnamed_addr #2

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

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

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

; 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 float @b2Dot(<2 x float>, <2 x float>) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @b2CollideChainSegmentAndCircle(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.b2Manifold) align 4 %0, ptr nocapture noundef readonly %1, <2 x float> %2, <2 x float> %3, ptr nocapture noundef readonly %4, <2 x float> %5, <2 x float> %6) local_unnamed_addr #3 {
  %8 = alloca float, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(112) %0, i8 0, i64 112, i1 false)
  %9 = tail call { <2 x float>, <2 x float> } @b2InvMulTransforms(<2 x float> %2, <2 x float> %3, <2 x float> %5, <2 x float> %6)
  %10 = extractvalue { <2 x float>, <2 x float> } %9, 0
  %11 = extractvalue { <2 x float>, <2 x float> } %9, 1
  %12 = load <2 x float>, ptr %4, align 4
  %13 = tail call <2 x float> @b2TransformPoint(<2 x float> %10, <2 x float> %11, <2 x float> %12)
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.061.0.copyload = load <2 x float>, ptr %14, align 4
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.055.0.copyload = load <2 x float>, ptr %15, align 4
  %16 = tail call <2 x float> @b2Sub(<2 x float> %.sroa.055.0.copyload, <2 x float> %.sroa.061.0.copyload)
  %17 = tail call <2 x float> @b2RightPerp(<2 x float> %16)
  %18 = tail call <2 x float> @b2Sub(<2 x float> %13, <2 x float> %.sroa.061.0.copyload)
  %19 = tail call float @b2Dot(<2 x float> %17, <2 x float> %18)
  %20 = fcmp olt float %19, 0.000000e+00
  br i1 %20, label %81, label %21

21:                                               ; preds = %7
  %22 = tail call <2 x float> @b2Sub(<2 x float> %.sroa.055.0.copyload, <2 x float> %13)
  %23 = tail call float @b2Dot(<2 x float> %16, <2 x float> %22)
  %24 = tail call <2 x float> @b2Sub(<2 x float> %13, <2 x float> %.sroa.061.0.copyload)
  %25 = tail call float @b2Dot(<2 x float> %16, <2 x float> %24)
  %26 = fcmp ugt float %25, 0.000000e+00
  br i1 %26, label %33, label %27

27:                                               ; preds = %21
  %28 = load <2 x float>, ptr %1, align 4
  %29 = tail call <2 x float> @b2Sub(<2 x float> %.sroa.061.0.copyload, <2 x float> %28)
  %30 = tail call <2 x float> @b2Sub(<2 x float> %13, <2 x float> %.sroa.061.0.copyload)
  %31 = tail call float @b2Dot(<2 x float> %29, <2 x float> %30)
  %32 = fcmp ugt float %31, 0.000000e+00
  br i1 %32, label %54, label %81

33:                                               ; preds = %21
  %34 = fcmp ugt float %23, 0.000000e+00
  br i1 %34, label %42, label %35

35:                                               ; preds = %33
  %36 = getelementptr inbounds i8, ptr %1, i64 24
  %37 = load <2 x float>, ptr %36, align 4
  %38 = tail call <2 x float> @b2Sub(<2 x float> %37, <2 x float> %.sroa.055.0.copyload)
  %39 = tail call <2 x float> @b2Sub(<2 x float> %13, <2 x float> %.sroa.055.0.copyload)
  %40 = tail call float @b2Dot(<2 x float> %38, <2 x float> %39)
  %41 = fcmp ule float %40, 0.000000e+00
  br i1 %41, label %54, label %81

42:                                               ; preds = %33
  %43 = tail call float @b2Dot(<2 x float> %16, <2 x float> %16)
  %44 = fcmp ogt float %43, 0.000000e+00
  br i1 %44, label %45, label %54

45:                                               ; preds = %42
  %46 = insertelement <2 x float> poison, float %25, i64 0
  %47 = shufflevector <2 x float> %46, <2 x float> poison, <2 x i32> zeroinitializer
  %48 = fmul <2 x float> %.sroa.055.0.copyload, %47
  %49 = insertelement <2 x float> poison, float %23, i64 0
  %50 = shufflevector <2 x float> %49, <2 x float> poison, <2 x i32> zeroinitializer
  %51 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %50, <2 x float> %.sroa.061.0.copyload, <2 x float> %48)
  %52 = fdiv float 1.000000e+00, %43
  %53 = tail call <2 x float> @b2MulSV(float noundef %52, <2 x float> %51)
  br label %54

54:                                               ; preds = %45, %42, %35, %27
  %.sroa.032.3 = phi <2 x float> [ %.sroa.061.0.copyload, %27 ], [ %.sroa.055.0.copyload, %35 ], [ %53, %45 ], [ %.sroa.061.0.copyload, %42 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %55 = tail call <2 x float> @b2Sub(<2 x float> %13, <2 x float> %.sroa.032.3)
  %56 = call <2 x float> @b2GetLengthAndNormalize(ptr noundef nonnull %8, <2 x float> %55)
  %57 = getelementptr inbounds i8, ptr %4, i64 8
  %58 = load float, ptr %57, align 4, !tbaa !5
  %59 = load float, ptr %8, align 4, !tbaa !11
  %60 = fsub float %59, %58
  %61 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !11
  %62 = fmul float %61, 0x3F747AE140000000
  %63 = fmul float %62, 4.000000e+00
  %64 = fcmp ogt float %60, %63
  br i1 %64, label %80, label %65

65:                                               ; preds = %54
  %66 = fneg float %58
  %67 = call <2 x float> @b2MulAdd(<2 x float> %13, float noundef %66, <2 x float> %56)
  %68 = call <2 x float> @b2Lerp(<2 x float> %.sroa.032.3, <2 x float> %67, float noundef 5.000000e-01)
  %69 = call <2 x float> @b2RotateVector(<2 x float> %3, <2 x float> %56)
  store <2 x float> %69, ptr %0, align 4
  %70 = getelementptr inbounds i8, ptr %0, i64 12
  %71 = getelementptr inbounds i8, ptr %0, i64 20
  %72 = call <2 x float> @b2RotateVector(<2 x float> %3, <2 x float> %68)
  store <2 x float> %72, ptr %71, align 4
  %73 = getelementptr inbounds i8, ptr %0, i64 28
  %74 = call <2 x float> @b2Sub(<2 x float> %2, <2 x float> %5)
  %75 = call <2 x float> @b2Add(<2 x float> %72, <2 x float> %74)
  store <2 x float> %75, ptr %73, align 4
  %76 = call <2 x float> @b2Add(<2 x float> %2, <2 x float> %72)
  store <2 x float> %76, ptr %70, align 4
  %77 = getelementptr inbounds i8, ptr %0, i64 36
  store float %60, ptr %77, align 4, !tbaa !12
  %78 = getelementptr inbounds i8, ptr %0, i64 56
  store i16 0, ptr %78, align 4, !tbaa !16
  %79 = getelementptr inbounds i8, ptr %0, i64 108
  store i32 1, ptr %79, align 4, !tbaa !17
  br label %80

80:                                               ; preds = %54, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br label %81

81:                                               ; preds = %80, %35, %27, %7
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2RightPerp(<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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #4

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nosync 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !8, i64 8}
!6 = !{!"b2Circle", !7, i64 0, !8, i64 8}
!7 = !{!"b2Vec2", !8, i64 0, !8, i64 4}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !8, i64 24}
!13 = !{!"b2ManifoldPoint", !7, i64 0, !7, i64 8, !7, i64 16, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36, !8, i64 40, !14, i64 44, !15, i64 46}
!14 = !{!"short", !9, i64 0}
!15 = !{!"_Bool", !9, i64 0}
!16 = !{!13, !14, i64 44}
!17 = !{!18, !19, i64 108}
!18 = !{!"b2Manifold", !7, i64 0, !8, i64 8, !9, i64 12, !19, i64 108}
!19 = !{!"int", !9, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass