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

; 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.b2CastOutput = type { %struct.b2Vec2, %struct.b2Vec2, float, i32, i8 }
%struct.b2Vec2 = type { float, float }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2AABB_RayCast(ptr dead_on_unwind noalias writable sret(%struct.b2CastOutput) align 4 %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, <2 x float> %4) #2 {
  %6 = alloca %struct.b2AABB, align 4
  %7 = alloca %struct.b2Vec2, align 4
  %8 = alloca %struct.b2Vec2, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca %struct.b2Vec2, align 4
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca %struct.b2Vec2, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca %struct.b2Vec2, align 4
  %27 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 0
  store <2 x float> %1, ptr %27, align 4
  %28 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 1
  store <2 x float> %2, ptr %28, align 4
  store <2 x float> %3, ptr %7, align 4
  store <2 x float> %4, ptr %8, align 4
  call void @llvm.memset.p0.i64(ptr align 4 %0, i8 0, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store float 0xC7EFFFFFE0000000, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store float 0x47EFFFFFE0000000, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %29 = load <2 x float>, ptr %8, align 4
  %30 = load <2 x float>, ptr %7, align 4
  %31 = call <2 x float> @b2Sub(<2 x float> %29, <2 x float> %30)
  store <2 x float> %31, ptr %12, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %32 = load <2 x float>, ptr %12, align 4
  %33 = call <2 x float> @b2Abs(<2 x float> %32)
  store <2 x float> %33, ptr %13, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.memset.p0.i64(ptr align 4 %14, i8 0, i64 8, i1 false)
  %34 = getelementptr inbounds %struct.b2Vec2, ptr %13, i32 0, i32 0
  %35 = load float, ptr %34, align 4, !tbaa !10
  %36 = fcmp olt float %35, 0x3E80000000000000
  br i1 %36, label %37, label %53

37:                                               ; preds = %5
  %38 = getelementptr inbounds %struct.b2Vec2, ptr %11, i32 0, i32 0
  %39 = load float, ptr %38, align 4, !tbaa !10
  %40 = getelementptr inbounds %struct.b2AABB, ptr %6, i32 0, i32 0
  %41 = getelementptr inbounds %struct.b2Vec2, ptr %40, i32 0, i32 0
  %42 = load float, ptr %41, align 4, !tbaa !12
  %43 = fcmp olt float %39, %42
  br i1 %43, label %51, label %44

44:                                               ; preds = %37
  %45 = getelementptr inbounds %struct.b2AABB, ptr %6, i32 0, i32 1
  %46 = getelementptr inbounds %struct.b2Vec2, ptr %45, i32 0, i32 0
  %47 = load float, ptr %46, align 4, !tbaa !14
  %48 = getelementptr inbounds %struct.b2Vec2, ptr %11, i32 0, i32 0
  %49 = load float, ptr %48, align 4, !tbaa !10
  %50 = fcmp olt float %47, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %44, %37
  store i32 1, ptr %15, align 4
  br label %186

52:                                               ; preds = %44
  br label %101

53:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %54 = getelementptr inbounds %struct.b2Vec2, ptr %12, i32 0, i32 0
  %55 = load float, ptr %54, align 4, !tbaa !10
  %56 = fdiv float 1.000000e+00, %55
  store float %56, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %57 = getelementptr inbounds %struct.b2AABB, ptr %6, i32 0, i32 0
  %58 = getelementptr inbounds %struct.b2Vec2, ptr %57, i32 0, i32 0
  %59 = load float, ptr %58, align 4, !tbaa !12
  %60 = getelementptr inbounds %struct.b2Vec2, ptr %11, i32 0, i32 0
  %61 = load float, ptr %60, align 4, !tbaa !10
  %62 = fsub float %59, %61
  %63 = load float, ptr %16, align 4, !tbaa !5
  %64 = fmul float %62, %63
  store float %64, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %65 = getelementptr inbounds %struct.b2AABB, ptr %6, i32 0, i32 1
  %66 = getelementptr inbounds %struct.b2Vec2, ptr %65, i32 0, i32 0
  %67 = load float, ptr %66, align 4, !tbaa !14
  %68 = getelementptr inbounds %struct.b2Vec2, ptr %11, i32 0, i32 0
  %69 = load float, ptr %68, align 4, !tbaa !10
  %70 = fsub float %67, %69
  %71 = load float, ptr %16, align 4, !tbaa !5
  %72 = fmul float %70, %71
  store float %72, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store float -1.000000e+00, ptr %19, align 4, !tbaa !5
  %73 = load float, ptr %17, align 4, !tbaa !5
  %74 = load float, ptr %18, align 4, !tbaa !5
  %75 = fcmp ogt float %73, %74
  br i1 %75, label %76, label %80

76:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %77 = load float, ptr %17, align 4, !tbaa !5
  store float %77, ptr %20, align 4, !tbaa !5
  %78 = load float, ptr %18, align 4, !tbaa !5
  store float %78, ptr %17, align 4, !tbaa !5
  %79 = load float, ptr %20, align 4, !tbaa !5
  store float %79, ptr %18, align 4, !tbaa !5
  store float 1.000000e+00, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %80

80:                                               ; preds = %76, %53
  %81 = load float, ptr %17, align 4, !tbaa !5
  %82 = load float, ptr %9, align 4, !tbaa !5
  %83 = fcmp ogt float %81, %82
  br i1 %83, label %84, label %89

84:                                               ; preds = %80
  %85 = getelementptr inbounds %struct.b2Vec2, ptr %14, i32 0, i32 1
  store float 0.000000e+00, ptr %85, align 4, !tbaa !15
  %86 = load float, ptr %19, align 4, !tbaa !5
  %87 = getelementptr inbounds %struct.b2Vec2, ptr %14, i32 0, i32 0
  store float %86, ptr %87, align 4, !tbaa !10
  %88 = load float, ptr %17, align 4, !tbaa !5
  store float %88, ptr %9, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %84, %80
  %90 = load float, ptr %10, align 4, !tbaa !5
  %91 = load float, ptr %18, align 4, !tbaa !5
  %92 = call float @b2MinFloat(float noundef %90, float noundef %91)
  store float %92, ptr %10, align 4, !tbaa !5
  %93 = load float, ptr %9, align 4, !tbaa !5
  %94 = load float, ptr %10, align 4, !tbaa !5
  %95 = fcmp ogt float %93, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %89
  store i32 1, ptr %15, align 4
  br label %98

97:                                               ; preds = %89
  store i32 0, ptr %15, align 4
  br label %98

98:                                               ; preds = %97, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %99 = load i32, ptr %15, align 4
  switch i32 %99, label %186 [
    i32 0, label %100
  ]

100:                                              ; preds = %98
  br label %101

101:                                              ; preds = %100, %52
  %102 = getelementptr inbounds %struct.b2Vec2, ptr %13, i32 0, i32 1
  %103 = load float, ptr %102, align 4, !tbaa !15
  %104 = fcmp olt float %103, 0x3E80000000000000
  br i1 %104, label %105, label %121

105:                                              ; preds = %101
  %106 = getelementptr inbounds %struct.b2Vec2, ptr %11, i32 0, i32 1
  %107 = load float, ptr %106, align 4, !tbaa !15
  %108 = getelementptr inbounds %struct.b2AABB, ptr %6, i32 0, i32 0
  %109 = getelementptr inbounds %struct.b2Vec2, ptr %108, i32 0, i32 1
  %110 = load float, ptr %109, align 4, !tbaa !16
  %111 = fcmp olt float %107, %110
  br i1 %111, label %119, label %112

112:                                              ; preds = %105
  %113 = getelementptr inbounds %struct.b2AABB, ptr %6, i32 0, i32 1
  %114 = getelementptr inbounds %struct.b2Vec2, ptr %113, i32 0, i32 1
  %115 = load float, ptr %114, align 4, !tbaa !17
  %116 = getelementptr inbounds %struct.b2Vec2, ptr %11, i32 0, i32 1
  %117 = load float, ptr %116, align 4, !tbaa !15
  %118 = fcmp olt float %115, %117
  br i1 %118, label %119, label %120

119:                                              ; preds = %112, %105
  store i32 1, ptr %15, align 4
  br label %186

120:                                              ; preds = %112
  br label %169

121:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %122 = getelementptr inbounds %struct.b2Vec2, ptr %12, i32 0, i32 1
  %123 = load float, ptr %122, align 4, !tbaa !15
  %124 = fdiv float 1.000000e+00, %123
  store float %124, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %125 = getelementptr inbounds %struct.b2AABB, ptr %6, i32 0, i32 0
  %126 = getelementptr inbounds %struct.b2Vec2, ptr %125, i32 0, i32 1
  %127 = load float, ptr %126, align 4, !tbaa !16
  %128 = getelementptr inbounds %struct.b2Vec2, ptr %11, i32 0, i32 1
  %129 = load float, ptr %128, align 4, !tbaa !15
  %130 = fsub float %127, %129
  %131 = load float, ptr %21, align 4, !tbaa !5
  %132 = fmul float %130, %131
  store float %132, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %133 = getelementptr inbounds %struct.b2AABB, ptr %6, i32 0, i32 1
  %134 = getelementptr inbounds %struct.b2Vec2, ptr %133, i32 0, i32 1
  %135 = load float, ptr %134, align 4, !tbaa !17
  %136 = getelementptr inbounds %struct.b2Vec2, ptr %11, i32 0, i32 1
  %137 = load float, ptr %136, align 4, !tbaa !15
  %138 = fsub float %135, %137
  %139 = load float, ptr %21, align 4, !tbaa !5
  %140 = fmul float %138, %139
  store float %140, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store float -1.000000e+00, ptr %24, align 4, !tbaa !5
  %141 = load float, ptr %22, align 4, !tbaa !5
  %142 = load float, ptr %23, align 4, !tbaa !5
  %143 = fcmp ogt float %141, %142
  br i1 %143, label %144, label %148

144:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %145 = load float, ptr %22, align 4, !tbaa !5
  store float %145, ptr %25, align 4, !tbaa !5
  %146 = load float, ptr %23, align 4, !tbaa !5
  store float %146, ptr %22, align 4, !tbaa !5
  %147 = load float, ptr %25, align 4, !tbaa !5
  store float %147, ptr %23, align 4, !tbaa !5
  store float 1.000000e+00, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %148

148:                                              ; preds = %144, %121
  %149 = load float, ptr %22, align 4, !tbaa !5
  %150 = load float, ptr %9, align 4, !tbaa !5
  %151 = fcmp ogt float %149, %150
  br i1 %151, label %152, label %157

152:                                              ; preds = %148
  %153 = getelementptr inbounds %struct.b2Vec2, ptr %14, i32 0, i32 0
  store float 0.000000e+00, ptr %153, align 4, !tbaa !10
  %154 = load float, ptr %24, align 4, !tbaa !5
  %155 = getelementptr inbounds %struct.b2Vec2, ptr %14, i32 0, i32 1
  store float %154, ptr %155, align 4, !tbaa !15
  %156 = load float, ptr %22, align 4, !tbaa !5
  store float %156, ptr %9, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %152, %148
  %158 = load float, ptr %10, align 4, !tbaa !5
  %159 = load float, ptr %23, align 4, !tbaa !5
  %160 = call float @b2MinFloat(float noundef %158, float noundef %159)
  store float %160, ptr %10, align 4, !tbaa !5
  %161 = load float, ptr %9, align 4, !tbaa !5
  %162 = load float, ptr %10, align 4, !tbaa !5
  %163 = fcmp ogt float %161, %162
  br i1 %163, label %164, label %165

164:                                              ; preds = %157
  store i32 1, ptr %15, align 4
  br label %166

165:                                              ; preds = %157
  store i32 0, ptr %15, align 4
  br label %166

166:                                              ; preds = %165, %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  %167 = load i32, ptr %15, align 4
  switch i32 %167, label %186 [
    i32 0, label %168
  ]

168:                                              ; preds = %166
  br label %169

169:                                              ; preds = %168, %120
  %170 = load float, ptr %9, align 4, !tbaa !5
  %171 = fcmp olt float %170, 0.000000e+00
  br i1 %171, label %175, label %172

172:                                              ; preds = %169
  %173 = load float, ptr %9, align 4, !tbaa !5
  %174 = fcmp olt float 1.000000e+00, %173
  br i1 %174, label %175, label %176

175:                                              ; preds = %172, %169
  store i32 1, ptr %15, align 4
  br label %186

176:                                              ; preds = %172
  %177 = load float, ptr %9, align 4, !tbaa !5
  %178 = getelementptr inbounds %struct.b2CastOutput, ptr %0, i32 0, i32 2
  store float %177, ptr %178, align 4, !tbaa !18
  %179 = getelementptr inbounds %struct.b2CastOutput, ptr %0, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %179, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !9
  %180 = getelementptr inbounds %struct.b2CastOutput, ptr %0, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %181 = load float, ptr %9, align 4, !tbaa !5
  %182 = load <2 x float>, ptr %7, align 4
  %183 = load <2 x float>, ptr %8, align 4
  %184 = call <2 x float> @b2Lerp(<2 x float> %182, <2 x float> %183, float noundef %181)
  store <2 x float> %184, ptr %26, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %180, ptr align 4 %26, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  %185 = getelementptr inbounds %struct.b2CastOutput, ptr %0, i32 0, i32 4
  store i8 1, ptr %185, align 4, !tbaa !22
  store i32 1, ptr %15, align 4
  br label %186

186:                                              ; preds = %176, %175, %166, %119, %98, %51
  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 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void
}

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!10 = !{!11, !6, i64 0}
!11 = !{!"b2Vec2", !6, i64 0, !6, i64 4}
!12 = !{!13, !6, i64 0}
!13 = !{!"b2AABB", !11, i64 0, !11, i64 8}
!14 = !{!13, !6, i64 8}
!15 = !{!11, !6, i64 4}
!16 = !{!13, !6, i64 4}
!17 = !{!13, !6, i64 12}
!18 = !{!19, !6, i64 16}
!19 = !{!"b2CastOutput", !11, i64 0, !11, i64 8, !6, i64 16, !20, i64 20, !21, i64 24}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_Bool", !7, i64 0}
!22 = !{!19, !21, i64 24}


; 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.b2CastOutput = type { %struct.b2Vec2, %struct.b2Vec2, float, i32, i8 }
%struct.b2Vec2 = type { float, float }

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

; Function Attrs: nounwind uwtable
define dso_local void @b2AABB_RayCast(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.b2CastOutput) align 4 %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, <2 x float> %4) local_unnamed_addr #1 {
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %0, i8 0, i64 28, i1 false)
  %.sroa.050.4.vec.extract = extractelement <2 x float> %3, i64 1
  %6 = tail call <2 x float> @b2Sub(<2 x float> %4, <2 x float> %3)
  %7 = tail call <2 x float> @b2Abs(<2 x float> %6)
  %.sroa.026.0.vec.extract = extractelement <2 x float> %7, i64 0
  %8 = fcmp olt float %.sroa.026.0.vec.extract, 0x3E80000000000000
  br i1 %8, label %9, label %12

9:                                                ; preds = %5
  %.sroa.050.0.vec.extract = extractelement <2 x float> %3, i64 0
  %.sroa.053.0.vec.extract = extractelement <2 x float> %1, i64 0
  %10 = fcmp olt float %.sroa.050.0.vec.extract, %.sroa.053.0.vec.extract
  %.sroa.5.8.vec.extract = extractelement <2 x float> %2, i64 0
  %11 = fcmp olt float %.sroa.5.8.vec.extract, %.sroa.050.0.vec.extract
  %or.cond79 = select i1 %10, i1 true, i1 %11
  br i1 %or.cond79, label %51, label %24

12:                                               ; preds = %5
  %.sroa.027.0.vec.extract = extractelement <2 x float> %6, i64 0
  %13 = fdiv float 1.000000e+00, %.sroa.027.0.vec.extract
  %14 = fsub <2 x float> %1, %3
  %15 = extractelement <2 x float> %14, i64 0
  %16 = fmul float %15, %13
  %17 = fsub <2 x float> %2, %3
  %18 = extractelement <2 x float> %17, i64 0
  %19 = fmul float %18, %13
  %20 = fcmp ogt float %16, %19
  %.068 = select i1 %20, float %19, float %16
  %.067 = select i1 %20, float %16, float %19
  %.066 = select i1 %20, float 1.000000e+00, float -1.000000e+00
  %21 = fcmp ogt float %.068, 0xC7EFFFFFE0000000
  %.sroa.025.0 = select i1 %21, float %.066, float 0.000000e+00
  %.0 = select i1 %21, float %.068, float 0xC7EFFFFFE0000000
  %22 = tail call float @b2MinFloat(float noundef 0x47EFFFFFE0000000, float noundef %.067)
  %23 = fcmp ule float %.0, %22
  br i1 %23, label %24, label %51

24:                                               ; preds = %9, %12
  %.sroa.025.1 = phi float [ %.sroa.025.0, %12 ], [ 0.000000e+00, %9 ]
  %.062 = phi float [ %22, %12 ], [ 0x47EFFFFFE0000000, %9 ]
  %.1 = phi float [ %.0, %12 ], [ 0xC7EFFFFFE0000000, %9 ]
  %.sroa.026.4.vec.extract = extractelement <2 x float> %7, i64 1
  %25 = fcmp olt float %.sroa.026.4.vec.extract, 0x3E80000000000000
  br i1 %25, label %26, label %29

26:                                               ; preds = %24
  %.sroa.053.4.vec.extract = extractelement <2 x float> %1, i64 1
  %27 = fcmp olt float %.sroa.050.4.vec.extract, %.sroa.053.4.vec.extract
  %.sroa.5.12.vec.extract = extractelement <2 x float> %2, i64 1
  %28 = fcmp olt float %.sroa.5.12.vec.extract, %.sroa.050.4.vec.extract
  %or.cond80 = select i1 %27, i1 true, i1 %28
  br i1 %or.cond80, label %51, label %43

29:                                               ; preds = %24
  %.sroa.027.4.vec.extract = extractelement <2 x float> %6, i64 1
  %30 = fdiv float 1.000000e+00, %.sroa.027.4.vec.extract
  %31 = shufflevector <2 x float> %1, <2 x float> %2, <2 x i32> <i32 1, i32 3>
  %32 = shufflevector <2 x float> %3, <2 x float> poison, <2 x i32> <i32 1, i32 1>
  %33 = fsub <2 x float> %31, %32
  %34 = insertelement <2 x float> poison, float %30, i64 0
  %35 = shufflevector <2 x float> %34, <2 x float> poison, <2 x i32> zeroinitializer
  %36 = fmul <2 x float> %33, %35
  %37 = extractelement <2 x float> %36, i64 0
  %38 = extractelement <2 x float> %36, i64 1
  %39 = fcmp ogt float %37, %38
  %.065 = select i1 %39, float %38, float %37
  %.064 = select i1 %39, float %37, float %38
  %.063 = select i1 %39, float 1.000000e+00, float -1.000000e+00
  %40 = fcmp ogt float %.065, %.1
  %.sroa.6.2 = select i1 %40, float %.063, float 0.000000e+00
  %.sroa.025.2 = select i1 %40, float 0.000000e+00, float %.sroa.025.1
  %.2 = select i1 %40, float %.065, float %.1
  %41 = tail call float @b2MinFloat(float noundef %.062, float noundef %.064)
  %42 = fcmp ule float %.2, %41
  br i1 %42, label %43, label %51

43:                                               ; preds = %26, %29
  %.sroa.6.3 = phi float [ %.sroa.6.2, %29 ], [ 0.000000e+00, %26 ]
  %.sroa.025.3 = phi float [ %.sroa.025.2, %29 ], [ %.sroa.025.1, %26 ]
  %.3 = phi float [ %.2, %29 ], [ %.1, %26 ]
  %44 = fcmp olt float %.3, 0.000000e+00
  %45 = fcmp ogt float %.3, 1.000000e+00
  %or.cond = or i1 %44, %45
  br i1 %or.cond, label %51, label %46

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %0, i64 16
  store float %.3, ptr %47, align 4, !tbaa !5
  store float %.sroa.025.3, ptr %0, align 4, !tbaa !13
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 4
  store float %.sroa.6.3, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !13
  %48 = getelementptr inbounds i8, ptr %0, i64 8
  %49 = tail call <2 x float> @b2Lerp(<2 x float> %3, <2 x float> %4, float noundef %.3)
  store <2 x float> %49, ptr %48, align 4
  %50 = getelementptr inbounds i8, ptr %0, i64 24
  store i8 1, ptr %50, align 4, !tbaa !14
  br label %51

51:                                               ; preds = %43, %26, %9, %29, %12, %46
  ret void
}

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

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

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

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

attributes #0 = { 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 #1 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 16}
!6 = !{!"b2CastOutput", !7, i64 0, !7, i64 8, !8, i64 16, !11, i64 20, !12, i64 24}
!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 = !{!"int", !9, i64 0}
!12 = !{!"_Bool", !9, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!6, !12, i64 24}


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