; LLVM IR from heroseh/cgm :: cgm (cgm_3d_capsule_vs_hoop)

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

%union.CgmVec3 = type { %struct.anon.0 }
%struct.anon.0 = type { float, float, float }
%struct.CgmSphere = type { %union.anon.7, float }
%union.anon.7 = type { %struct.anon.8 }
%struct.anon.8 = type { float, float, float }
%struct.CgmHoop3d = type { %union.CgmVec3, %union.CgmVec3, %union.CgmVec3, float, float }
%struct.CgmCapsule3d = type { %union.CgmVec3, %union.CgmVec3, float, float }

; Function Attrs: nounwind uwtable
declare dso_local float @cgm_clamp(float noundef, float noundef, float noundef) #0

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmVec3_add(<2 x float>, float, <2 x float>, float) #4

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmVec3_sub(<2 x float>, float, <2 x float>, float) #4

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmVec3_mul_scalar(<2 x float>, float, float noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local float @CgmVec3_len(<2 x float>, float) #4

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmVec3_norm(<2 x float>, float) #4

; Function Attrs: nounwind uwtable
declare dso_local float @CgmVec3_dot(<2 x float>, float, <2 x float>, float) #4

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmHoop3d_closest_pt(ptr noundef, <2 x float>, float) #4

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @cgm_3d_pt_vs_sphere(<2 x float>, float, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @cgm_3d_sphere_vs_sphere(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @cgm_3d_capsule_vs_hoop(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #4 {
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca %union.CgmVec3, align 4
  %13 = alloca { <2 x float>, float }, align 4
  %14 = alloca { <2 x float>, float }, align 4
  %15 = alloca { <2 x float>, float }, align 8
  %16 = alloca { <2 x float>, float }, align 4
  %17 = alloca { <2 x float>, float }, align 4
  %18 = alloca float, align 4
  %19 = alloca { <2 x float>, float }, align 4
  %20 = alloca { <2 x float>, float }, align 4
  %21 = alloca float, align 4
  %22 = alloca { <2 x float>, float }, align 4
  %23 = alloca { <2 x float>, float }, align 4
  %24 = alloca [5 x float], align 16
  %25 = alloca float, align 4
  %26 = alloca %union.CgmVec3, align 4
  %27 = alloca %union.CgmVec3, align 4
  %28 = alloca i32, align 4
  %29 = alloca float, align 4
  %30 = alloca %union.CgmVec3, align 4
  %31 = alloca %union.CgmVec3, align 4
  %32 = alloca { <2 x float>, float }, align 4
  %33 = alloca { <2 x float>, float }, align 8
  %34 = alloca { <2 x float>, float }, align 4
  %35 = alloca { <2 x float>, float }, align 4
  %36 = alloca { <2 x float>, float }, align 8
  %37 = alloca %union.CgmVec3, align 4
  %38 = alloca { <2 x float>, float }, align 4
  %39 = alloca { <2 x float>, float }, align 8
  %40 = alloca %union.CgmVec3, align 4
  %41 = alloca { <2 x float>, float }, align 4
  %42 = alloca { <2 x float>, float }, align 4
  %43 = alloca { <2 x float>, float }, align 8
  %44 = alloca float, align 4
  %45 = alloca { <2 x float>, float }, align 4
  %46 = alloca { <2 x float>, float }, align 4
  %47 = alloca %struct.CgmSphere, align 4
  %48 = alloca { <2 x float>, float }, align 4
  %49 = alloca i32, align 4
  %50 = alloca %union.CgmVec3, align 4
  %51 = alloca { <2 x float>, float }, align 4
  %52 = alloca { <2 x float>, float }, align 4
  %53 = alloca { <2 x float>, float }, align 8
  %54 = alloca float, align 4
  %55 = alloca { <2 x float>, float }, align 4
  %56 = alloca %union.CgmVec3, align 4
  %57 = alloca { <2 x float>, float }, align 4
  %58 = alloca { <2 x float>, float }, align 8
  %59 = alloca %struct.CgmSphere, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.CgmHoop3d, ptr %60, i32 0, i32 3
  %62 = load float, ptr %61, align 4, !tbaa !9
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.CgmHoop3d, ptr %63, i32 0, i32 4
  %65 = load float, ptr %64, align 4, !tbaa !12
  %66 = fadd float %62, %65
  store float %66, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.CgmHoop3d, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.CgmCapsule3d, ptr %69, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %68, i64 12, i1 false)
  %71 = getelementptr inbounds { <2 x float>, float }, ptr %13, i32 0, i32 0
  %72 = load <2 x float>, ptr %71, align 4
  %73 = getelementptr inbounds { <2 x float>, float }, ptr %13, i32 0, i32 1
  %74 = load float, ptr %73, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %70, i64 12, i1 false)
  %75 = getelementptr inbounds { <2 x float>, float }, ptr %14, i32 0, i32 0
  %76 = load <2 x float>, ptr %75, align 4
  %77 = getelementptr inbounds { <2 x float>, float }, ptr %14, i32 0, i32 1
  %78 = load float, ptr %77, align 4
  %79 = call { <2 x float>, float } @CgmVec3_sub(<2 x float> %72, float %74, <2 x float> %76, float %78)
  %80 = getelementptr inbounds %union.CgmVec3, ptr %12, i32 0, i32 0
  store { <2 x float>, float } %79, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %80, ptr align 8 %15, i64 12, i1 false)
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.CgmCapsule3d, ptr %81, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %12, i64 12, i1 false)
  %83 = getelementptr inbounds { <2 x float>, float }, ptr %16, i32 0, i32 0
  %84 = load <2 x float>, ptr %83, align 4
  %85 = getelementptr inbounds { <2 x float>, float }, ptr %16, i32 0, i32 1
  %86 = load float, ptr %85, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %82, i64 12, i1 false)
  %87 = getelementptr inbounds { <2 x float>, float }, ptr %17, i32 0, i32 0
  %88 = load <2 x float>, ptr %87, align 4
  %89 = getelementptr inbounds { <2 x float>, float }, ptr %17, i32 0, i32 1
  %90 = load float, ptr %89, align 4
  %91 = call float @CgmVec3_dot(<2 x float> %84, float %86, <2 x float> %88, float %90)
  store float %91, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.CgmHoop3d, ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.CgmCapsule3d, ptr %94, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %93, i64 12, i1 false)
  %96 = getelementptr inbounds { <2 x float>, float }, ptr %19, i32 0, i32 0
  %97 = load <2 x float>, ptr %96, align 4
  %98 = getelementptr inbounds { <2 x float>, float }, ptr %19, i32 0, i32 1
  %99 = load float, ptr %98, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %95, i64 12, i1 false)
  %100 = getelementptr inbounds { <2 x float>, float }, ptr %20, i32 0, i32 0
  %101 = load <2 x float>, ptr %100, align 4
  %102 = getelementptr inbounds { <2 x float>, float }, ptr %20, i32 0, i32 1
  %103 = load float, ptr %102, align 4
  %104 = call float @CgmVec3_dot(<2 x float> %97, float %99, <2 x float> %101, float %103)
  %105 = load float, ptr %10, align 4, !tbaa !13
  %106 = fmul float %104, %105
  %107 = call float @llvm.fabs.f32(float %106)
  store float %107, ptr %18, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.CgmHoop3d, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.CgmCapsule3d, ptr %110, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %109, i64 12, i1 false)
  %112 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 0
  %113 = load <2 x float>, ptr %112, align 4
  %114 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 1
  %115 = load float, ptr %114, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %111, i64 12, i1 false)
  %116 = getelementptr inbounds { <2 x float>, float }, ptr %23, i32 0, i32 0
  %117 = load <2 x float>, ptr %116, align 4
  %118 = getelementptr inbounds { <2 x float>, float }, ptr %23, i32 0, i32 1
  %119 = load float, ptr %118, align 4
  %120 = call float @CgmVec3_dot(<2 x float> %113, float %115, <2 x float> %117, float %119)
  %121 = load float, ptr %10, align 4, !tbaa !13
  %122 = fmul float %120, %121
  %123 = call float @llvm.fabs.f32(float %122)
  store float %123, ptr %21, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 20, ptr %24) #5
  %124 = load float, ptr %18, align 4, !tbaa !13
  store float %124, ptr %24, align 4, !tbaa !13
  %125 = getelementptr inbounds float, ptr %24, i64 1
  %126 = load float, ptr %21, align 4, !tbaa !13
  store float %126, ptr %125, align 4, !tbaa !13
  %127 = getelementptr inbounds float, ptr %24, i64 2
  %128 = load float, ptr %18, align 4, !tbaa !13
  %129 = fneg float %128
  store float %129, ptr %127, align 4, !tbaa !13
  %130 = getelementptr inbounds float, ptr %24, i64 3
  %131 = load float, ptr %21, align 4, !tbaa !13
  %132 = fneg float %131
  store float %132, ptr %130, align 4, !tbaa !13
  %133 = getelementptr inbounds float, ptr %24, i64 4
  store float 0.000000e+00, ptr %133, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store float 0x7FF0000000000000, ptr %25, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !14
  br label %134

134:                                              ; preds = %206, %4
  %135 = load i32, ptr %28, align 4, !tbaa !14
  %136 = icmp slt i32 %135, 5
  br i1 %136, label %138, label %137

137:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %209

138:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %139 = load float, ptr %11, align 4, !tbaa !13
  %140 = load i32, ptr %28, align 4, !tbaa !14
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [5 x float], ptr %24, i64 0, i64 %141
  %143 = load float, ptr %142, align 4, !tbaa !13
  %144 = fadd float %139, %143
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.CgmCapsule3d, ptr %145, i32 0, i32 2
  %147 = load float, ptr %146, align 4, !tbaa !16
  %148 = fneg float %147
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.CgmCapsule3d, ptr %149, i32 0, i32 2
  %151 = load float, ptr %150, align 4, !tbaa !16
  %152 = call float @cgm_clamp(float noundef %144, float noundef %148, float noundef %151)
  store float %152, ptr %29, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #5
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.CgmCapsule3d, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.CgmCapsule3d, ptr %155, i32 0, i32 1
  %157 = load float, ptr %29, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %156, i64 12, i1 false)
  %158 = getelementptr inbounds { <2 x float>, float }, ptr %32, i32 0, i32 0
  %159 = load <2 x float>, ptr %158, align 4
  %160 = getelementptr inbounds { <2 x float>, float }, ptr %32, i32 0, i32 1
  %161 = load float, ptr %160, align 4
  %162 = call { <2 x float>, float } @CgmVec3_mul_scalar(<2 x float> %159, float %161, float noundef %157)
  %163 = getelementptr inbounds %union.CgmVec3, ptr %31, i32 0, i32 0
  store { <2 x float>, float } %162, ptr %33, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %163, ptr align 8 %33, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %154, i64 12, i1 false)
  %164 = getelementptr inbounds { <2 x float>, float }, ptr %34, i32 0, i32 0
  %165 = load <2 x float>, ptr %164, align 4
  %166 = getelementptr inbounds { <2 x float>, float }, ptr %34, i32 0, i32 1
  %167 = load float, ptr %166, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %31, i64 12, i1 false)
  %168 = getelementptr inbounds { <2 x float>, float }, ptr %35, i32 0, i32 0
  %169 = load <2 x float>, ptr %168, align 4
  %170 = getelementptr inbounds { <2 x float>, float }, ptr %35, i32 0, i32 1
  %171 = load float, ptr %170, align 4
  %172 = call { <2 x float>, float } @CgmVec3_add(<2 x float> %165, float %167, <2 x float> %169, float %171)
  %173 = getelementptr inbounds %union.CgmVec3, ptr %30, i32 0, i32 0
  store { <2 x float>, float } %172, ptr %36, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %173, ptr align 8 %36, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %37) #5
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %30, i64 12, i1 false)
  %175 = getelementptr inbounds { <2 x float>, float }, ptr %38, i32 0, i32 0
  %176 = load <2 x float>, ptr %175, align 4
  %177 = getelementptr inbounds { <2 x float>, float }, ptr %38, i32 0, i32 1
  %178 = load float, ptr %177, align 4
  %179 = call { <2 x float>, float } @CgmHoop3d_closest_pt(ptr noundef %174, <2 x float> %176, float %178)
  %180 = getelementptr inbounds %union.CgmVec3, ptr %37, i32 0, i32 0
  store { <2 x float>, float } %179, ptr %39, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %180, ptr align 8 %39, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %40) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 4 %37, i64 12, i1 false)
  %181 = getelementptr inbounds { <2 x float>, float }, ptr %41, i32 0, i32 0
  %182 = load <2 x float>, ptr %181, align 4
  %183 = getelementptr inbounds { <2 x float>, float }, ptr %41, i32 0, i32 1
  %184 = load float, ptr %183, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %30, i64 12, i1 false)
  %185 = getelementptr inbounds { <2 x float>, float }, ptr %42, i32 0, i32 0
  %186 = load <2 x float>, ptr %185, align 4
  %187 = getelementptr inbounds { <2 x float>, float }, ptr %42, i32 0, i32 1
  %188 = load float, ptr %187, align 4
  %189 = call { <2 x float>, float } @CgmVec3_sub(<2 x float> %182, float %184, <2 x float> %186, float %188)
  %190 = getelementptr inbounds %union.CgmVec3, ptr %40, i32 0, i32 0
  store { <2 x float>, float } %189, ptr %43, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %190, ptr align 8 %43, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 4 %40, i64 12, i1 false)
  %191 = getelementptr inbounds { <2 x float>, float }, ptr %45, i32 0, i32 0
  %192 = load <2 x float>, ptr %191, align 4
  %193 = getelementptr inbounds { <2 x float>, float }, ptr %45, i32 0, i32 1
  %194 = load float, ptr %193, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 4 %40, i64 12, i1 false)
  %195 = getelementptr inbounds { <2 x float>, float }, ptr %46, i32 0, i32 0
  %196 = load <2 x float>, ptr %195, align 4
  %197 = getelementptr inbounds { <2 x float>, float }, ptr %46, i32 0, i32 1
  %198 = load float, ptr %197, align 4
  %199 = call float @CgmVec3_dot(<2 x float> %192, float %194, <2 x float> %196, float %198)
  store float %199, ptr %44, align 4, !tbaa !13
  %200 = load float, ptr %44, align 4, !tbaa !13
  %201 = load float, ptr %25, align 4, !tbaa !13
  %202 = fcmp olt float %200, %201
  br i1 %202, label %203, label %205

203:                                              ; preds = %138
  %204 = load float, ptr %44, align 4, !tbaa !13
  store float %204, ptr %25, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %37, i64 12, i1 false), !tbaa.struct !18
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %30, i64 12, i1 false), !tbaa.struct !18
  br label %205

205:                                              ; preds = %203, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %40) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %28, align 4, !tbaa !14
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %28, align 4, !tbaa !14
  br label %134, !llvm.loop !20

209:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 16, ptr %47) #5
  %210 = getelementptr inbounds %struct.CgmSphere, ptr %47, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %210, ptr align 4 %26, i64 12, i1 false), !tbaa.struct !18
  %211 = getelementptr inbounds %struct.CgmSphere, ptr %47, i32 0, i32 1
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.CgmHoop3d, ptr %212, i32 0, i32 4
  %214 = load float, ptr %213, align 4, !tbaa !12
  store float %214, ptr %211, align 4, !tbaa !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %48, ptr align 4 %27, i64 12, i1 false)
  %215 = getelementptr inbounds { <2 x float>, float }, ptr %48, i32 0, i32 0
  %216 = load <2 x float>, ptr %215, align 4
  %217 = getelementptr inbounds { <2 x float>, float }, ptr %48, i32 0, i32 1
  %218 = load float, ptr %217, align 4
  %219 = call zeroext i8 @cgm_3d_pt_vs_sphere(<2 x float> %216, float %218, ptr noundef %47, ptr noundef null, ptr noundef null)
  %220 = icmp ne i8 %219, 0
  br i1 %220, label %221, label %269

221:                                              ; preds = %209
  %222 = load ptr, ptr %8, align 8, !tbaa !5
  %223 = icmp ne ptr %222, null
  br i1 %223, label %228, label %224

224:                                              ; preds = %221
  %225 = load ptr, ptr %9, align 8, !tbaa !5
  %226 = icmp ne ptr %225, null
  br i1 %226, label %228, label %227

227:                                              ; preds = %224
  store i8 1, ptr %5, align 1
  store i32 1, ptr %49, align 4
  br label %282

228:                                              ; preds = %224, %221
  call void @llvm.lifetime.start.p0(i64 12, ptr %50) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %51, ptr align 4 %27, i64 12, i1 false)
  %229 = getelementptr inbounds { <2 x float>, float }, ptr %51, i32 0, i32 0
  %230 = load <2 x float>, ptr %229, align 4
  %231 = getelementptr inbounds { <2 x float>, float }, ptr %51, i32 0, i32 1
  %232 = load float, ptr %231, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %52, ptr align 4 %26, i64 12, i1 false)
  %233 = getelementptr inbounds { <2 x float>, float }, ptr %52, i32 0, i32 0
  %234 = load <2 x float>, ptr %233, align 4
  %235 = getelementptr inbounds { <2 x float>, float }, ptr %52, i32 0, i32 1
  %236 = load float, ptr %235, align 4
  %237 = call { <2 x float>, float } @CgmVec3_sub(<2 x float> %230, float %232, <2 x float> %234, float %236)
  %238 = getelementptr inbounds %union.CgmVec3, ptr %50, i32 0, i32 0
  store { <2 x float>, float } %237, ptr %53, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %238, ptr align 8 %53, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %55, ptr align 4 %50, i64 12, i1 false)
  %239 = getelementptr inbounds { <2 x float>, float }, ptr %55, i32 0, i32 0
  %240 = load <2 x float>, ptr %239, align 4
  %241 = getelementptr inbounds { <2 x float>, float }, ptr %55, i32 0, i32 1
  %242 = load float, ptr %241, align 4
  %243 = call float @CgmVec3_len(<2 x float> %240, float %242)
  store float %243, ptr %54, align 4, !tbaa !13
  %244 = load ptr, ptr %8, align 8, !tbaa !5
  %245 = icmp ne ptr %244, null
  br i1 %245, label %246, label %254

246:                                              ; preds = %228
  %247 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %56) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %57, ptr align 4 %50, i64 12, i1 false)
  %248 = getelementptr inbounds { <2 x float>, float }, ptr %57, i32 0, i32 0
  %249 = load <2 x float>, ptr %248, align 4
  %250 = getelementptr inbounds { <2 x float>, float }, ptr %57, i32 0, i32 1
  %251 = load float, ptr %250, align 4
  %252 = call { <2 x float>, float } @CgmVec3_norm(<2 x float> %249, float %251)
  %253 = getelementptr inbounds %union.CgmVec3, ptr %56, i32 0, i32 0
  store { <2 x float>, float } %252, ptr %58, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %253, ptr align 8 %58, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %247, ptr align 4 %56, i64 12, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 12, ptr %56) #5
  br label %254

254:                                              ; preds = %246, %228
  %255 = load ptr, ptr %9, align 8, !tbaa !5
  %256 = icmp ne ptr %255, null
  br i1 %256, label %257, label %268

257:                                              ; preds = %254
  %258 = load ptr, ptr %7, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.CgmHoop3d, ptr %258, i32 0, i32 4
  %260 = load float, ptr %259, align 4, !tbaa !12
  %261 = load float, ptr %54, align 4, !tbaa !13
  %262 = fsub float %260, %261
  %263 = load ptr, ptr %6, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.CgmCapsule3d, ptr %263, i32 0, i32 3
  %265 = load float, ptr %264, align 4, !tbaa !24
  %266 = fadd float %262, %265
  %267 = load ptr, ptr %9, align 8, !tbaa !5
  store float %266, ptr %267, align 4, !tbaa !13
  br label %268

268:                                              ; preds = %257, %254
  store i8 1, ptr %5, align 1
  store i32 1, ptr %49, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %50) #5
  br label %282

269:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 16, ptr %59) #5
  %270 = getelementptr inbounds %struct.CgmSphere, ptr %59, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %270, ptr align 4 %27, i64 12, i1 false), !tbaa.struct !18
  %271 = getelementptr inbounds %struct.CgmSphere, ptr %59, i32 0, i32 1
  %272 = load ptr, ptr %6, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.CgmCapsule3d, ptr %272, i32 0, i32 3
  %274 = load float, ptr %273, align 4, !tbaa !24
  store float %274, ptr %271, align 4, !tbaa !22
  %275 = load ptr, ptr %8, align 8, !tbaa !5
  %276 = load ptr, ptr %9, align 8, !tbaa !5
  %277 = call zeroext i8 @cgm_3d_sphere_vs_sphere(ptr noundef %59, ptr noundef %47, ptr noundef %275, ptr noundef %276)
  %278 = icmp ne i8 %277, 0
  br i1 %278, label %279, label %280

279:                                              ; preds = %269
  store i8 1, ptr %5, align 1
  store i32 1, ptr %49, align 4
  br label %281

280:                                              ; preds = %269
  store i8 0, ptr %5, align 1
  store i32 1, ptr %49, align 4
  br label %281

281:                                              ; preds = %280, %279
  call void @llvm.lifetime.end.p0(i64 16, ptr %59) #5
  br label %282

282:                                              ; preds = %281, %268, %227
  call void @llvm.lifetime.end.p0(i64 16, ptr %47) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %283 = load i8, ptr %5, align 1
  ret i8 %283
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 36}
!10 = !{!"CgmHoop3d", !7, i64 0, !7, i64 12, !7, i64 24, !11, i64 36, !11, i64 40}
!11 = !{!"float", !7, i64 0}
!12 = !{!10, !11, i64 40}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !11, i64 24}
!17 = !{!"CgmCapsule3d", !7, i64 0, !7, i64 12, !11, i64 24, !11, i64 28}
!18 = !{i64 0, i64 12, !19}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !11, i64 12}
!23 = !{!"CgmSphere", !7, i64 0, !11, i64 12}
!24 = !{!17, !11, i64 28}


; 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.CgmSphere = type { %union.anon.7, float }
%union.anon.7 = type { %struct.anon.8 }
%struct.anon.8 = type { float, float, float }

; Function Attrs: nounwind uwtable
declare dso_local float @cgm_clamp(float noundef, float noundef, float noundef) local_unnamed_addr #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmVec3_add(<2 x float>, float, <2 x float>, float) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmVec3_sub(<2 x float>, float, <2 x float>, float) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmVec3_mul_scalar(<2 x float>, float, float noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local float @CgmVec3_len(<2 x float>, float) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmVec3_norm(<2 x float>, float) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local float @CgmVec3_dot(<2 x float>, float, <2 x float>, float) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @CgmHoop3d_closest_pt(ptr noundef, <2 x float>, float) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @cgm_3d_pt_vs_sphere(<2 x float>, float, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @cgm_3d_sphere_vs_sphere(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local zeroext range(i8 0, 2) i8 @cgm_3d_capsule_vs_hoop(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca %struct.CgmSphere, align 8
  %6 = alloca %struct.CgmSphere, align 8
  %7 = getelementptr inbounds i8, ptr %1, i64 36
  %8 = load float, ptr %7, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 40
  %10 = load float, ptr %9, align 4, !tbaa !10
  %11 = fadd float %8, %10
  %.sroa.093.0.copyload = load <2 x float>, ptr %1, align 4
  %.sroa.294.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.294.0.copyload = load float, ptr %.sroa.294.0..sroa_idx, align 4
  %.sroa.091.0.copyload = load <2 x float>, ptr %0, align 4
  %.sroa.292.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.292.0.copyload = load float, ptr %.sroa.292.0..sroa_idx, align 4
  %12 = tail call { <2 x float>, float } @CgmVec3_sub(<2 x float> %.sroa.093.0.copyload, float %.sroa.294.0.copyload, <2 x float> %.sroa.091.0.copyload, float %.sroa.292.0.copyload)
  %.fca.0.extract87 = extractvalue { <2 x float>, float } %12, 0
  %.fca.1.extract88 = extractvalue { <2 x float>, float } %12, 1
  %13 = getelementptr inbounds i8, ptr %0, i64 12
  %.sroa.083.0.copyload = load <2 x float>, ptr %13, align 4
  %.sroa.284.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 20
  %.sroa.284.0.copyload = load float, ptr %.sroa.284.0..sroa_idx, align 4
  %14 = tail call float @CgmVec3_dot(<2 x float> %.fca.0.extract87, float %.fca.1.extract88, <2 x float> %.sroa.083.0.copyload, float %.sroa.284.0.copyload)
  %15 = getelementptr inbounds i8, ptr %1, i64 12
  %.sroa.079.0.copyload = load <2 x float>, ptr %15, align 4
  %.sroa.280.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 20
  %.sroa.280.0.copyload = load float, ptr %.sroa.280.0..sroa_idx, align 4
  %.sroa.077.0.copyload = load <2 x float>, ptr %13, align 4
  %.sroa.278.0.copyload = load float, ptr %.sroa.284.0..sroa_idx, align 4
  %16 = tail call float @CgmVec3_dot(<2 x float> %.sroa.079.0.copyload, float %.sroa.280.0.copyload, <2 x float> %.sroa.077.0.copyload, float %.sroa.278.0.copyload)
  %17 = fmul float %11, %16
  %18 = tail call float @llvm.fabs.f32(float %17)
  %19 = getelementptr inbounds i8, ptr %1, i64 24
  %.sroa.073.0.copyload = load <2 x float>, ptr %19, align 4
  %.sroa.274.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 32
  %.sroa.274.0.copyload = load float, ptr %.sroa.274.0..sroa_idx, align 4
  %.sroa.071.0.copyload = load <2 x float>, ptr %13, align 4
  %.sroa.272.0.copyload = load float, ptr %.sroa.284.0..sroa_idx, align 4
  %20 = tail call float @CgmVec3_dot(<2 x float> %.sroa.073.0.copyload, float %.sroa.274.0.copyload, <2 x float> %.sroa.071.0.copyload, float %.sroa.272.0.copyload)
  %21 = fmul float %11, %20
  %22 = tail call float @llvm.fabs.f32(float %21)
  %23 = getelementptr inbounds i8, ptr %0, i64 24
  %24 = fadd float %14, %18
  %25 = load float, ptr %23, align 4, !tbaa !11
  %26 = fneg float %25
  %27 = tail call float @cgm_clamp(float noundef %24, float noundef %26, float noundef %25)
  %.sroa.056.0.copyload = load <2 x float>, ptr %13, align 4
  %.sroa.257.0.copyload = load float, ptr %.sroa.284.0..sroa_idx, align 4
  %28 = tail call { <2 x float>, float } @CgmVec3_mul_scalar(<2 x float> %.sroa.056.0.copyload, float %.sroa.257.0.copyload, float noundef %27)
  %.fca.0.extract52 = extractvalue { <2 x float>, float } %28, 0
  %.fca.1.extract53 = extractvalue { <2 x float>, float } %28, 1
  %.sroa.050.0.copyload = load <2 x float>, ptr %0, align 4
  %.sroa.251.0.copyload = load float, ptr %.sroa.292.0..sroa_idx, align 4
  %29 = tail call { <2 x float>, float } @CgmVec3_add(<2 x float> %.sroa.050.0.copyload, float %.sroa.251.0.copyload, <2 x float> %.fca.0.extract52, float %.fca.1.extract53)
  %.fca.0.extract44 = extractvalue { <2 x float>, float } %29, 0
  %.fca.1.extract45 = extractvalue { <2 x float>, float } %29, 1
  %30 = tail call { <2 x float>, float } @CgmHoop3d_closest_pt(ptr noundef nonnull %1, <2 x float> %.fca.0.extract44, float %.fca.1.extract45)
  %.fca.0.extract36 = extractvalue { <2 x float>, float } %30, 0
  %.fca.1.extract37 = extractvalue { <2 x float>, float } %30, 1
  %31 = tail call { <2 x float>, float } @CgmVec3_sub(<2 x float> %.fca.0.extract36, float %.fca.1.extract37, <2 x float> %.fca.0.extract44, float %.fca.1.extract45)
  %.fca.0.extract25 = extractvalue { <2 x float>, float } %31, 0
  %.fca.1.extract26 = extractvalue { <2 x float>, float } %31, 1
  %32 = tail call float @CgmVec3_dot(<2 x float> %.fca.0.extract25, float %.fca.1.extract26, <2 x float> %.fca.0.extract25, float %.fca.1.extract26)
  %.inv = fcmp one float %32, 0x7FF0000000000000
  %.1128 = select i1 %.inv, float %32, float 0x7FF0000000000000
  %33 = fadd float %14, %22
  %34 = load float, ptr %23, align 4, !tbaa !11
  %35 = fneg float %34
  %36 = tail call float @cgm_clamp(float noundef %33, float noundef %35, float noundef %34)
  %.sroa.056.0.copyload.1 = load <2 x float>, ptr %13, align 4
  %.sroa.257.0.copyload.1 = load float, ptr %.sroa.284.0..sroa_idx, align 4
  %37 = tail call { <2 x float>, float } @CgmVec3_mul_scalar(<2 x float> %.sroa.056.0.copyload.1, float %.sroa.257.0.copyload.1, float noundef %36)
  %.fca.0.extract52.1 = extractvalue { <2 x float>, float } %37, 0
  %.fca.1.extract53.1 = extractvalue { <2 x float>, float } %37, 1
  %.sroa.050.0.copyload.1 = load <2 x float>, ptr %0, align 4
  %.sroa.251.0.copyload.1 = load float, ptr %.sroa.292.0..sroa_idx, align 4
  %38 = tail call { <2 x float>, float } @CgmVec3_add(<2 x float> %.sroa.050.0.copyload.1, float %.sroa.251.0.copyload.1, <2 x float> %.fca.0.extract52.1, float %.fca.1.extract53.1)
  %.fca.0.extract44.1 = extractvalue { <2 x float>, float } %38, 0
  %.fca.1.extract45.1 = extractvalue { <2 x float>, float } %38, 1
  %39 = tail call { <2 x float>, float } @CgmHoop3d_closest_pt(ptr noundef nonnull %1, <2 x float> %.fca.0.extract44.1, float %.fca.1.extract45.1)
  %.fca.0.extract36.1 = extractvalue { <2 x float>, float } %39, 0
  %.fca.1.extract37.1 = extractvalue { <2 x float>, float } %39, 1
  %40 = tail call { <2 x float>, float } @CgmVec3_sub(<2 x float> %.fca.0.extract36.1, float %.fca.1.extract37.1, <2 x float> %.fca.0.extract44.1, float %.fca.1.extract45.1)
  %.fca.0.extract25.1 = extractvalue { <2 x float>, float } %40, 0
  %.fca.1.extract26.1 = extractvalue { <2 x float>, float } %40, 1
  %41 = tail call float @CgmVec3_dot(<2 x float> %.fca.0.extract25.1, float %.fca.1.extract26.1, <2 x float> %.fca.0.extract25.1, float %.fca.1.extract26.1)
  %42 = fcmp olt float %41, %.1128
  br i1 %42, label %43, label %44

43:                                               ; preds = %4
  br label %44

44:                                               ; preds = %43, %4
  %.sroa.065.1.1 = phi <2 x float> [ %.fca.0.extract44.1, %43 ], [ %.fca.0.extract44, %4 ]
  %.sroa.667.1.1 = phi float [ %.fca.1.extract45.1, %43 ], [ %.fca.1.extract45, %4 ]
  %.sroa.068.1.1 = phi <2 x float> [ %.fca.0.extract36.1, %43 ], [ %.fca.0.extract36, %4 ]
  %.sroa.569.1.1 = phi float [ %.fca.1.extract37.1, %43 ], [ %.fca.1.extract37, %4 ]
  %.1128.1 = phi float [ %41, %43 ], [ %.1128, %4 ]
  %45 = fsub float %14, %18
  %46 = load float, ptr %23, align 4, !tbaa !11
  %47 = fneg float %46
  %48 = tail call float @cgm_clamp(float noundef %45, float noundef %47, float noundef %46)
  %.sroa.056.0.copyload.2 = load <2 x float>, ptr %13, align 4
  %.sroa.257.0.copyload.2 = load float, ptr %.sroa.284.0..sroa_idx, align 4
  %49 = tail call { <2 x float>, float } @CgmVec3_mul_scalar(<2 x float> %.sroa.056.0.copyload.2, float %.sroa.257.0.copyload.2, float noundef %48)
  %.fca.0.extract52.2 = extractvalue { <2 x float>, float } %49, 0
  %.fca.1.extract53.2 = extractvalue { <2 x float>, float } %49, 1
  %.sroa.050.0.copyload.2 = load <2 x float>, ptr %0, align 4
  %.sroa.251.0.copyload.2 = load float, ptr %.sroa.292.0..sroa_idx, align 4
  %50 = tail call { <2 x float>, float } @CgmVec3_add(<2 x float> %.sroa.050.0.copyload.2, float %.sroa.251.0.copyload.2, <2 x float> %.fca.0.extract52.2, float %.fca.1.extract53.2)
  %.fca.0.extract44.2 = extractvalue { <2 x float>, float } %50, 0
  %.fca.1.extract45.2 = extractvalue { <2 x float>, float } %50, 1
  %51 = tail call { <2 x float>, float } @CgmHoop3d_closest_pt(ptr noundef nonnull %1, <2 x float> %.fca.0.extract44.2, float %.fca.1.extract45.2)
  %.fca.0.extract36.2 = extractvalue { <2 x float>, float } %51, 0
  %.fca.1.extract37.2 = extractvalue { <2 x float>, float } %51, 1
  %52 = tail call { <2 x float>, float } @CgmVec3_sub(<2 x float> %.fca.0.extract36.2, float %.fca.1.extract37.2, <2 x float> %.fca.0.extract44.2, float %.fca.1.extract45.2)
  %.fca.0.extract25.2 = extractvalue { <2 x float>, float } %52, 0
  %.fca.1.extract26.2 = extractvalue { <2 x float>, float } %52, 1
  %53 = tail call float @CgmVec3_dot(<2 x float> %.fca.0.extract25.2, float %.fca.1.extract26.2, <2 x float> %.fca.0.extract25.2, float %.fca.1.extract26.2)
  %54 = fcmp olt float %53, %.1128.1
  br i1 %54, label %55, label %56

55:                                               ; preds = %44
  br label %56

56:                                               ; preds = %55, %44
  %.sroa.065.1.2 = phi <2 x float> [ %.fca.0.extract44.2, %55 ], [ %.sroa.065.1.1, %44 ]
  %.sroa.667.1.2 = phi float [ %.fca.1.extract45.2, %55 ], [ %.sroa.667.1.1, %44 ]
  %.sroa.068.1.2 = phi <2 x float> [ %.fca.0.extract36.2, %55 ], [ %.sroa.068.1.1, %44 ]
  %.sroa.569.1.2 = phi float [ %.fca.1.extract37.2, %55 ], [ %.sroa.569.1.1, %44 ]
  %.1128.2 = phi float [ %53, %55 ], [ %.1128.1, %44 ]
  %57 = fsub float %14, %22
  %58 = load float, ptr %23, align 4, !tbaa !11
  %59 = fneg float %58
  %60 = tail call float @cgm_clamp(float noundef %57, float noundef %59, float noundef %58)
  %.sroa.056.0.copyload.3 = load <2 x float>, ptr %13, align 4
  %.sroa.257.0.copyload.3 = load float, ptr %.sroa.284.0..sroa_idx, align 4
  %61 = tail call { <2 x float>, float } @CgmVec3_mul_scalar(<2 x float> %.sroa.056.0.copyload.3, float %.sroa.257.0.copyload.3, float noundef %60)
  %.fca.0.extract52.3 = extractvalue { <2 x float>, float } %61, 0
  %.fca.1.extract53.3 = extractvalue { <2 x float>, float } %61, 1
  %.sroa.050.0.copyload.3 = load <2 x float>, ptr %0, align 4
  %.sroa.251.0.copyload.3 = load float, ptr %.sroa.292.0..sroa_idx, align 4
  %62 = tail call { <2 x float>, float } @CgmVec3_add(<2 x float> %.sroa.050.0.copyload.3, float %.sroa.251.0.copyload.3, <2 x float> %.fca.0.extract52.3, float %.fca.1.extract53.3)
  %.fca.0.extract44.3 = extractvalue { <2 x float>, float } %62, 0
  %.fca.1.extract45.3 = extractvalue { <2 x float>, float } %62, 1
  %63 = tail call { <2 x float>, float } @CgmHoop3d_closest_pt(ptr noundef nonnull %1, <2 x float> %.fca.0.extract44.3, float %.fca.1.extract45.3)
  %.fca.0.extract36.3 = extractvalue { <2 x float>, float } %63, 0
  %.fca.1.extract37.3 = extractvalue { <2 x float>, float } %63, 1
  %64 = tail call { <2 x float>, float } @CgmVec3_sub(<2 x float> %.fca.0.extract36.3, float %.fca.1.extract37.3, <2 x float> %.fca.0.extract44.3, float %.fca.1.extract45.3)
  %.fca.0.extract25.3 = extractvalue { <2 x float>, float } %64, 0
  %.fca.1.extract26.3 = extractvalue { <2 x float>, float } %64, 1
  %65 = tail call float @CgmVec3_dot(<2 x float> %.fca.0.extract25.3, float %.fca.1.extract26.3, <2 x float> %.fca.0.extract25.3, float %.fca.1.extract26.3)
  %66 = fcmp olt float %65, %.1128.2
  br i1 %66, label %67, label %68

67:                                               ; preds = %56
  br label %68

68:                                               ; preds = %67, %56
  %.sroa.065.1.3 = phi <2 x float> [ %.fca.0.extract44.3, %67 ], [ %.sroa.065.1.2, %56 ]
  %.sroa.667.1.3 = phi float [ %.fca.1.extract45.3, %67 ], [ %.sroa.667.1.2, %56 ]
  %.sroa.068.1.3 = phi <2 x float> [ %.fca.0.extract36.3, %67 ], [ %.sroa.068.1.2, %56 ]
  %.sroa.569.1.3 = phi float [ %.fca.1.extract37.3, %67 ], [ %.sroa.569.1.2, %56 ]
  %.1128.3 = phi float [ %65, %67 ], [ %.1128.2, %56 ]
  %69 = fadd float %14, 0.000000e+00
  %70 = load float, ptr %23, align 4, !tbaa !11
  %71 = fneg float %70
  %72 = tail call float @cgm_clamp(float noundef %69, float noundef %71, float noundef %70)
  %.sroa.056.0.copyload.4 = load <2 x float>, ptr %13, align 4
  %.sroa.257.0.copyload.4 = load float, ptr %.sroa.284.0..sroa_idx, align 4
  %73 = tail call { <2 x float>, float } @CgmVec3_mul_scalar(<2 x float> %.sroa.056.0.copyload.4, float %.sroa.257.0.copyload.4, float noundef %72)
  %.fca.0.extract52.4 = extractvalue { <2 x float>, float } %73, 0
  %.fca.1.extract53.4 = extractvalue { <2 x float>, float } %73, 1
  %.sroa.050.0.copyload.4 = load <2 x float>, ptr %0, align 4
  %.sroa.251.0.copyload.4 = load float, ptr %.sroa.292.0..sroa_idx, align 4
  %74 = tail call { <2 x float>, float } @CgmVec3_add(<2 x float> %.sroa.050.0.copyload.4, float %.sroa.251.0.copyload.4, <2 x float> %.fca.0.extract52.4, float %.fca.1.extract53.4)
  %.fca.0.extract44.4 = extractvalue { <2 x float>, float } %74, 0
  %.fca.1.extract45.4 = extractvalue { <2 x float>, float } %74, 1
  %75 = tail call { <2 x float>, float } @CgmHoop3d_closest_pt(ptr noundef nonnull %1, <2 x float> %.fca.0.extract44.4, float %.fca.1.extract45.4)
  %.fca.0.extract36.4 = extractvalue { <2 x float>, float } %75, 0
  %.fca.1.extract37.4 = extractvalue { <2 x float>, float } %75, 1
  %76 = tail call { <2 x float>, float } @CgmVec3_sub(<2 x float> %.fca.0.extract36.4, float %.fca.1.extract37.4, <2 x float> %.fca.0.extract44.4, float %.fca.1.extract45.4)
  %.fca.0.extract25.4 = extractvalue { <2 x float>, float } %76, 0
  %.fca.1.extract26.4 = extractvalue { <2 x float>, float } %76, 1
  %77 = tail call float @CgmVec3_dot(<2 x float> %.fca.0.extract25.4, float %.fca.1.extract26.4, <2 x float> %.fca.0.extract25.4, float %.fca.1.extract26.4)
  %78 = fcmp olt float %77, %.1128.3
  br i1 %78, label %79, label %80

79:                                               ; preds = %68
  br label %80

80:                                               ; preds = %79, %68
  %.sroa.065.1.4 = phi <2 x float> [ %.fca.0.extract44.4, %79 ], [ %.sroa.065.1.3, %68 ]
  %.sroa.667.1.4 = phi float [ %.fca.1.extract45.4, %79 ], [ %.sroa.667.1.3, %68 ]
  %.sroa.068.1.4 = phi <2 x float> [ %.fca.0.extract36.4, %79 ], [ %.sroa.068.1.3, %68 ]
  %.sroa.569.1.4 = phi float [ %.fca.1.extract37.4, %79 ], [ %.sroa.569.1.3, %68 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  store <2 x float> %.sroa.068.1.4, ptr %5, align 8
  %.sroa.569.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  store float %.sroa.569.1.4, ptr %.sroa.569.0..sroa_idx, align 8, !tbaa !13
  %81 = getelementptr inbounds i8, ptr %5, i64 12
  %82 = load float, ptr %9, align 4, !tbaa !10
  store float %82, ptr %81, align 4, !tbaa !14
  %83 = call zeroext i8 @cgm_3d_pt_vs_sphere(<2 x float> %.sroa.065.1.4, float %.sroa.667.1.4, ptr noundef nonnull %5, ptr noundef null, ptr noundef null)
  %.not = icmp eq i8 %83, 0
  br i1 %.not, label %99, label %84

84:                                               ; preds = %80
  %85 = icmp ne ptr %2, null
  %86 = icmp ne ptr %3, null
  %or.cond = or i1 %85, %86
  br i1 %or.cond, label %87, label %104

87:                                               ; preds = %84
  %88 = call { <2 x float>, float } @CgmVec3_sub(<2 x float> %.sroa.065.1.4, float %.sroa.667.1.4, <2 x float> %.sroa.068.1.4, float %.sroa.569.1.4)
  %.fca.0.extract7 = extractvalue { <2 x float>, float } %88, 0
  %.fca.1.extract8 = extractvalue { <2 x float>, float } %88, 1
  %89 = call float @CgmVec3_len(<2 x float> %.fca.0.extract7, float %.fca.1.extract8)
  br i1 %85, label %90, label %92

90:                                               ; preds = %87
  %91 = call { <2 x float>, float } @CgmVec3_norm(<2 x float> %.fca.0.extract7, float %.fca.1.extract8)
  %.fca.0.extract = extractvalue { <2 x float>, float } %91, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %91, 1
  store <2 x float> %.fca.0.extract, ptr %2, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  store float %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !13
  br label %92

92:                                               ; preds = %90, %87
  br i1 %86, label %93, label %104

93:                                               ; preds = %92
  %94 = load float, ptr %9, align 4, !tbaa !10
  %95 = fsub float %94, %89
  %96 = getelementptr inbounds i8, ptr %0, i64 28
  %97 = load float, ptr %96, align 4, !tbaa !16
  %98 = fadd float %95, %97
  store float %98, ptr %3, align 4, !tbaa !17
  br label %104

99:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  store <2 x float> %.sroa.065.1.4, ptr %6, align 8
  %.sroa.667.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  store float %.sroa.667.1.4, ptr %.sroa.667.0..sroa_idx, align 8, !tbaa !13
  %100 = getelementptr inbounds i8, ptr %6, i64 12
  %101 = getelementptr inbounds i8, ptr %0, i64 28
  %102 = load float, ptr %101, align 4, !tbaa !16
  store float %102, ptr %100, align 4, !tbaa !14
  %103 = call zeroext i8 @cgm_3d_sphere_vs_sphere(ptr noundef nonnull %6, ptr noundef nonnull %5, ptr noundef %2, ptr noundef %3)
  %.not133 = icmp ne i8 %103, 0
  %. = zext i1 %.not133 to i8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br label %104

104:                                              ; preds = %92, %93, %84, %99
  %.1 = phi i8 [ %., %99 ], [ 1, %84 ], [ 1, %93 ], [ 1, %92 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  ret i8 %.1
}

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !9, i64 36}
!6 = !{!"CgmHoop3d", !7, i64 0, !7, i64 12, !7, i64 24, !9, i64 36, !9, i64 40}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"float", !7, i64 0}
!10 = !{!6, !9, i64 40}
!11 = !{!12, !9, i64 24}
!12 = !{!"CgmCapsule3d", !7, i64 0, !7, i64 12, !9, i64 24, !9, i64 28}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !9, i64 12}
!15 = !{!"CgmSphere", !7, i64 0, !9, i64 12}
!16 = !{!12, !9, i64 28}
!17 = !{!9, !9, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass