; LLVM IR from ashishzero/karma :: src/modules/core/lin_maths.ll (Z11barycentric4Vec3S_S_S_)

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_Zmi4Vec3S_(<2 x float>, float, <2 x float>, float) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z18signed_area_doubleffffff(float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, float } @_Z11barycentric4Vec3S_S_S_(<2 x float> %0, float %1, <2 x float> %2, float %3, <2 x float> %4, float %5, <2 x float> %6, float %7) #6 {
  %9 = alloca %union.Vec3, align 4
  %10 = alloca %union.Vec3, align 4
  %11 = alloca { <2 x float>, float }, align 4
  %12 = alloca %union.Vec3, align 4
  %13 = alloca { <2 x float>, float }, align 4
  %14 = alloca %union.Vec3, align 4
  %15 = alloca { <2 x float>, float }, align 4
  %16 = alloca %union.Vec3, align 4
  %17 = alloca { <2 x float>, float }, align 4
  %18 = alloca %union.Vec3, align 4
  %19 = alloca %union.Vec3, align 4
  %20 = alloca %union.Vec3, align 4
  %21 = alloca %union.Vec3, align 4
  %22 = alloca { <2 x float>, float }, align 4
  %23 = alloca { <2 x float>, float }, align 4
  %24 = alloca { <2 x float>, float }, align 8
  %25 = alloca %union.Vec3, align 4
  %26 = alloca %union.Vec3, align 4
  %27 = alloca %union.Vec3, align 4
  %28 = alloca { <2 x float>, float }, align 4
  %29 = alloca { <2 x float>, float }, align 4
  %30 = alloca { <2 x float>, float }, align 8
  %31 = alloca { <2 x float>, float }, align 4
  %32 = alloca { <2 x float>, float }, align 4
  %33 = alloca { <2 x float>, float }, align 8
  %34 = alloca float, align 4
  %35 = alloca float, align 4
  %36 = alloca float, align 4
  %37 = alloca float, align 4
  %38 = alloca float, align 4
  %39 = alloca float, align 4
  %40 = alloca { <2 x float>, float }, align 8
  %41 = getelementptr inbounds { <2 x float>, float }, ptr %11, i32 0, i32 0
  store <2 x float> %0, ptr %41, align 4
  %42 = getelementptr inbounds { <2 x float>, float }, ptr %11, i32 0, i32 1
  store float %1, ptr %42, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %11, i64 12, i1 false)
  %43 = getelementptr inbounds { <2 x float>, float }, ptr %13, i32 0, i32 0
  store <2 x float> %2, ptr %43, align 4
  %44 = getelementptr inbounds { <2 x float>, float }, ptr %13, i32 0, i32 1
  store float %3, ptr %44, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %13, i64 12, i1 false)
  %45 = getelementptr inbounds { <2 x float>, float }, ptr %15, i32 0, i32 0
  store <2 x float> %4, ptr %45, align 4
  %46 = getelementptr inbounds { <2 x float>, float }, ptr %15, i32 0, i32 1
  store float %5, ptr %46, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %15, i64 12, i1 false)
  %47 = getelementptr inbounds { <2 x float>, float }, ptr %17, i32 0, i32 0
  store <2 x float> %6, ptr %47, align 4
  %48 = getelementptr inbounds { <2 x float>, float }, ptr %17, i32 0, i32 1
  store float %7, ptr %48, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %17, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %12, i64 12, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %20, i64 12, i1 false)
  %49 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 0
  %50 = load <2 x float>, ptr %49, align 4
  %51 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 1
  %52 = load float, ptr %51, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %21, i64 12, i1 false)
  %53 = getelementptr inbounds { <2 x float>, float }, ptr %23, i32 0, i32 0
  %54 = load <2 x float>, ptr %53, align 4
  %55 = getelementptr inbounds { <2 x float>, float }, ptr %23, i32 0, i32 1
  %56 = load float, ptr %55, align 4
  %57 = call { <2 x float>, float } @_Zmi4Vec3S_(<2 x float> %50, float %52, <2 x float> %54, float %56)
  %58 = getelementptr inbounds %union.Vec3, ptr %19, i32 0, i32 0
  store { <2 x float>, float } %57, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %58, ptr align 8 %24, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %26, i64 12, i1 false)
  %59 = getelementptr inbounds { <2 x float>, float }, ptr %28, i32 0, i32 0
  %60 = load <2 x float>, ptr %59, align 4
  %61 = getelementptr inbounds { <2 x float>, float }, ptr %28, i32 0, i32 1
  %62 = load float, ptr %61, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %27, i64 12, i1 false)
  %63 = getelementptr inbounds { <2 x float>, float }, ptr %29, i32 0, i32 0
  %64 = load <2 x float>, ptr %63, align 4
  %65 = getelementptr inbounds { <2 x float>, float }, ptr %29, i32 0, i32 1
  %66 = load float, ptr %65, align 4
  %67 = call { <2 x float>, float } @_Zmi4Vec3S_(<2 x float> %60, float %62, <2 x float> %64, float %66)
  %68 = getelementptr inbounds %union.Vec3, ptr %25, i32 0, i32 0
  store { <2 x float>, float } %67, ptr %30, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %68, ptr align 8 %30, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %19, i64 12, i1 false)
  %69 = getelementptr inbounds { <2 x float>, float }, ptr %31, i32 0, i32 0
  %70 = load <2 x float>, ptr %69, align 4
  %71 = getelementptr inbounds { <2 x float>, float }, ptr %31, i32 0, i32 1
  %72 = load float, ptr %71, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %25, i64 12, i1 false)
  %73 = getelementptr inbounds { <2 x float>, float }, ptr %32, i32 0, i32 0
  %74 = load <2 x float>, ptr %73, align 4
  %75 = getelementptr inbounds { <2 x float>, float }, ptr %32, i32 0, i32 1
  %76 = load float, ptr %75, align 4
  %77 = call { <2 x float>, float } @_Z10vec3_cross4Vec3S_(<2 x float> %70, float %72, <2 x float> %74, float %76)
  %78 = getelementptr inbounds %union.Vec3, ptr %18, i32 0, i32 0
  store { <2 x float>, float } %77, ptr %33, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 8 %33, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  %79 = getelementptr inbounds %struct.anon, ptr %18, i32 0, i32 0
  %80 = load float, ptr %79, align 4, !tbaa !6
  %81 = call float @llvm.fabs.f32(float %80)
  store float %81, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  %82 = getelementptr inbounds %struct.anon, ptr %18, i32 0, i32 1
  %83 = load float, ptr %82, align 4, !tbaa !6
  %84 = call float @llvm.fabs.f32(float %83)
  store float %84, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  %85 = getelementptr inbounds %struct.anon, ptr %18, i32 0, i32 2
  %86 = load float, ptr %85, align 4, !tbaa !6
  %87 = call float @llvm.fabs.f32(float %86)
  store float %87, ptr %39, align 4, !tbaa !9
  %88 = load float, ptr %37, align 4, !tbaa !9
  %89 = load float, ptr %38, align 4, !tbaa !9
  %90 = fcmp oge float %88, %89
  br i1 %90, label %91, label %125

91:                                               ; preds = %8
  %92 = load float, ptr %37, align 4, !tbaa !9
  %93 = load float, ptr %39, align 4, !tbaa !9
  %94 = fcmp oge float %92, %93
  br i1 %94, label %95, label %125

95:                                               ; preds = %91
  %96 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 1
  %97 = load float, ptr %96, align 4, !tbaa !6
  %98 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 2
  %99 = load float, ptr %98, align 4, !tbaa !6
  %100 = getelementptr inbounds %struct.anon, ptr %12, i32 0, i32 1
  %101 = load float, ptr %100, align 4, !tbaa !6
  %102 = getelementptr inbounds %struct.anon, ptr %12, i32 0, i32 2
  %103 = load float, ptr %102, align 4, !tbaa !6
  %104 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 1
  %105 = load float, ptr %104, align 4, !tbaa !6
  %106 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 2
  %107 = load float, ptr %106, align 4, !tbaa !6
  %108 = call noundef float @_Z18signed_area_doubleffffff(float noundef %97, float noundef %99, float noundef %101, float noundef %103, float noundef %105, float noundef %107)
  store float %108, ptr %34, align 4, !tbaa !9
  %109 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 1
  %110 = load float, ptr %109, align 4, !tbaa !6
  %111 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 2
  %112 = load float, ptr %111, align 4, !tbaa !6
  %113 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 1
  %114 = load float, ptr %113, align 4, !tbaa !6
  %115 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 2
  %116 = load float, ptr %115, align 4, !tbaa !6
  %117 = getelementptr inbounds %struct.anon, ptr %10, i32 0, i32 1
  %118 = load float, ptr %117, align 4, !tbaa !6
  %119 = getelementptr inbounds %struct.anon, ptr %10, i32 0, i32 2
  %120 = load float, ptr %119, align 4, !tbaa !6
  %121 = call noundef float @_Z18signed_area_doubleffffff(float noundef %110, float noundef %112, float noundef %114, float noundef %116, float noundef %118, float noundef %120)
  store float %121, ptr %35, align 4, !tbaa !9
  %122 = getelementptr inbounds %struct.anon, ptr %18, i32 0, i32 0
  %123 = load float, ptr %122, align 4, !tbaa !6
  %124 = fdiv float 1.000000e+00, %123
  store float %124, ptr %36, align 4, !tbaa !9
  br label %195

125:                                              ; preds = %91, %8
  %126 = load float, ptr %38, align 4, !tbaa !9
  %127 = load float, ptr %37, align 4, !tbaa !9
  %128 = fcmp oge float %126, %127
  br i1 %128, label %129, label %164

129:                                              ; preds = %125
  %130 = load float, ptr %38, align 4, !tbaa !9
  %131 = load float, ptr %39, align 4, !tbaa !9
  %132 = fcmp oge float %130, %131
  br i1 %132, label %133, label %164

133:                                              ; preds = %129
  %134 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 0
  %135 = load float, ptr %134, align 4, !tbaa !6
  %136 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 2
  %137 = load float, ptr %136, align 4, !tbaa !6
  %138 = getelementptr inbounds %struct.anon, ptr %12, i32 0, i32 0
  %139 = load float, ptr %138, align 4, !tbaa !6
  %140 = getelementptr inbounds %struct.anon, ptr %12, i32 0, i32 2
  %141 = load float, ptr %140, align 4, !tbaa !6
  %142 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 0
  %143 = load float, ptr %142, align 4, !tbaa !6
  %144 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 2
  %145 = load float, ptr %144, align 4, !tbaa !6
  %146 = call noundef float @_Z18signed_area_doubleffffff(float noundef %135, float noundef %137, float noundef %139, float noundef %141, float noundef %143, float noundef %145)
  store float %146, ptr %34, align 4, !tbaa !9
  %147 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 0
  %148 = load float, ptr %147, align 4, !tbaa !6
  %149 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 2
  %150 = load float, ptr %149, align 4, !tbaa !6
  %151 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 0
  %152 = load float, ptr %151, align 4, !tbaa !6
  %153 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 2
  %154 = load float, ptr %153, align 4, !tbaa !6
  %155 = getelementptr inbounds %struct.anon, ptr %10, i32 0, i32 0
  %156 = load float, ptr %155, align 4, !tbaa !6
  %157 = getelementptr inbounds %struct.anon, ptr %10, i32 0, i32 2
  %158 = load float, ptr %157, align 4, !tbaa !6
  %159 = call noundef float @_Z18signed_area_doubleffffff(float noundef %148, float noundef %150, float noundef %152, float noundef %154, float noundef %156, float noundef %158)
  store float %159, ptr %35, align 4, !tbaa !9
  %160 = getelementptr inbounds %struct.anon, ptr %18, i32 0, i32 1
  %161 = load float, ptr %160, align 4, !tbaa !6
  %162 = fneg float %161
  %163 = fdiv float 1.000000e+00, %162
  store float %163, ptr %36, align 4, !tbaa !9
  br label %194

164:                                              ; preds = %129, %125
  %165 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 0
  %166 = load float, ptr %165, align 4, !tbaa !6
  %167 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 1
  %168 = load float, ptr %167, align 4, !tbaa !6
  %169 = getelementptr inbounds %struct.anon, ptr %12, i32 0, i32 0
  %170 = load float, ptr %169, align 4, !tbaa !6
  %171 = getelementptr inbounds %struct.anon, ptr %12, i32 0, i32 1
  %172 = load float, ptr %171, align 4, !tbaa !6
  %173 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 0
  %174 = load float, ptr %173, align 4, !tbaa !6
  %175 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 1
  %176 = load float, ptr %175, align 4, !tbaa !6
  %177 = call noundef float @_Z18signed_area_doubleffffff(float noundef %166, float noundef %168, float noundef %170, float noundef %172, float noundef %174, float noundef %176)
  store float %177, ptr %34, align 4, !tbaa !9
  %178 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 0
  %179 = load float, ptr %178, align 4, !tbaa !6
  %180 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 1
  %181 = load float, ptr %180, align 4, !tbaa !6
  %182 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 0
  %183 = load float, ptr %182, align 4, !tbaa !6
  %184 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 1
  %185 = load float, ptr %184, align 4, !tbaa !6
  %186 = getelementptr inbounds %struct.anon, ptr %10, i32 0, i32 0
  %187 = load float, ptr %186, align 4, !tbaa !6
  %188 = getelementptr inbounds %struct.anon, ptr %10, i32 0, i32 1
  %189 = load float, ptr %188, align 4, !tbaa !6
  %190 = call noundef float @_Z18signed_area_doubleffffff(float noundef %179, float noundef %181, float noundef %183, float noundef %185, float noundef %187, float noundef %189)
  store float %190, ptr %35, align 4, !tbaa !9
  %191 = getelementptr inbounds %struct.anon, ptr %18, i32 0, i32 2
  %192 = load float, ptr %191, align 4, !tbaa !6
  %193 = fdiv float 1.000000e+00, %192
  store float %193, ptr %36, align 4, !tbaa !9
  br label %194

194:                                              ; preds = %164, %133
  br label %195

195:                                              ; preds = %194, %95
  %196 = load float, ptr %34, align 4, !tbaa !9
  %197 = load float, ptr %36, align 4, !tbaa !9
  %198 = fmul float %196, %197
  %199 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 0
  store float %198, ptr %199, align 4, !tbaa !6
  %200 = load float, ptr %35, align 4, !tbaa !9
  %201 = load float, ptr %36, align 4, !tbaa !9
  %202 = fmul float %200, %201
  %203 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 1
  store float %202, ptr %203, align 4, !tbaa !6
  %204 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 0
  %205 = load float, ptr %204, align 4, !tbaa !6
  %206 = fsub float 1.000000e+00, %205
  %207 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 1
  %208 = load float, ptr %207, align 4, !tbaa !6
  %209 = fsub float %206, %208
  %210 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 2
  store float %209, ptr %210, align 4, !tbaa !6
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #7
  %211 = getelementptr inbounds %union.Vec3, ptr %9, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %40, ptr align 4 %211, i64 12, i1 false)
  %212 = load { <2 x float>, float }, ptr %40, align 8
  ret { <2 x float>, float } %212
}

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 0, i64 12, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !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"

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_Zmi4Vec3S_(<2 x float>, float, <2 x float>, float) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, float } @_Z11barycentric4Vec3S_S_S_(<2 x float> %0, float %1, <2 x float> %2, float %3, <2 x float> %4, float %5, <2 x float> %6, float %7) local_unnamed_addr #4 {
  %9 = tail call { <2 x float>, float } @_Zmi4Vec3S_(<2 x float> %2, float %3, <2 x float> %0, float %1)
  %.fca.0.extract32 = extractvalue { <2 x float>, float } %9, 0
  %.fca.1.extract33 = extractvalue { <2 x float>, float } %9, 1
  %10 = tail call { <2 x float>, float } @_Zmi4Vec3S_(<2 x float> %4, float %5, <2 x float> %0, float %1)
  %.fca.0.extract18 = extractvalue { <2 x float>, float } %10, 0
  %.fca.1.extract19 = extractvalue { <2 x float>, float } %10, 1
  %11 = tail call { <2 x float>, float } @_Z10vec3_cross4Vec3S_(<2 x float> %.fca.0.extract32, float %.fca.1.extract33, <2 x float> %.fca.0.extract18, float %.fca.1.extract19)
  %.fca.0.extract = extractvalue { <2 x float>, float } %11, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %11, 1
  %12 = tail call <2 x float> @llvm.fabs.v2f32(<2 x float> %.fca.0.extract)
  %13 = tail call float @llvm.fabs.f32(float %.fca.1.extract)
  %14 = extractelement <2 x float> %12, i64 0
  %15 = extractelement <2 x float> %12, i64 1
  %16 = fcmp ult float %14, %15
  %17 = fcmp ult float %14, %13
  %or.cond = select i1 %16, i1 true, i1 %17
  br i1 %or.cond, label %23, label %18

18:                                               ; preds = %8
  %.sroa.054.4.vec.extract = extractelement <2 x float> %6, i64 1
  %.sroa.091.4.vec.extract = extractelement <2 x float> %2, i64 1
  %.sroa.072.4.vec.extract = extractelement <2 x float> %4, i64 1
  %19 = tail call noundef float @_Z18signed_area_doubleffffff(float noundef %.sroa.054.4.vec.extract, float noundef %7, float noundef %.sroa.091.4.vec.extract, float noundef %3, float noundef %.sroa.072.4.vec.extract, float noundef %5)
  %.sroa.0100.4.vec.extract = extractelement <2 x float> %0, i64 1
  %20 = tail call noundef float @_Z18signed_area_doubleffffff(float noundef %.sroa.054.4.vec.extract, float noundef %7, float noundef %.sroa.072.4.vec.extract, float noundef %5, float noundef %.sroa.0100.4.vec.extract, float noundef %1)
  %21 = extractelement <2 x float> %.fca.0.extract, i64 0
  %22 = fdiv float 1.000000e+00, %21
  br label %35

23:                                               ; preds = %8
  %24 = fcmp ult float %15, %14
  %25 = fcmp ult float %15, %13
  %or.cond117 = select i1 %24, i1 true, i1 %25
  %.sroa.054.0.vec.extract58 = extractelement <2 x float> %6, i64 0
  br i1 %or.cond117, label %31, label %26

26:                                               ; preds = %23
  %.sroa.091.0.vec.extract = extractelement <2 x float> %2, i64 0
  %.sroa.072.0.vec.extract = extractelement <2 x float> %4, i64 0
  %27 = tail call noundef float @_Z18signed_area_doubleffffff(float noundef %.sroa.054.0.vec.extract58, float noundef %7, float noundef %.sroa.091.0.vec.extract, float noundef %3, float noundef %.sroa.072.0.vec.extract, float noundef %5)
  %.sroa.0100.0.vec.extract = extractelement <2 x float> %0, i64 0
  %28 = tail call noundef float @_Z18signed_area_doubleffffff(float noundef %.sroa.054.0.vec.extract58, float noundef %7, float noundef %.sroa.072.0.vec.extract, float noundef %5, float noundef %.sroa.0100.0.vec.extract, float noundef %1)
  %29 = extractelement <2 x float> %.fca.0.extract, i64 1
  %30 = fdiv float -1.000000e+00, %29
  br label %35

31:                                               ; preds = %23
  %.sroa.054.4.vec.extract64 = extractelement <2 x float> %6, i64 1
  %.sroa.091.0.vec.extract94 = extractelement <2 x float> %2, i64 0
  %.sroa.091.4.vec.extract96 = extractelement <2 x float> %2, i64 1
  %.sroa.072.0.vec.extract77 = extractelement <2 x float> %4, i64 0
  %.sroa.072.4.vec.extract83 = extractelement <2 x float> %4, i64 1
  %32 = tail call noundef float @_Z18signed_area_doubleffffff(float noundef %.sroa.054.0.vec.extract58, float noundef %.sroa.054.4.vec.extract64, float noundef %.sroa.091.0.vec.extract94, float noundef %.sroa.091.4.vec.extract96, float noundef %.sroa.072.0.vec.extract77, float noundef %.sroa.072.4.vec.extract83)
  %.sroa.0100.0.vec.extract104 = extractelement <2 x float> %0, i64 0
  %.sroa.0100.4.vec.extract106 = extractelement <2 x float> %0, i64 1
  %33 = tail call noundef float @_Z18signed_area_doubleffffff(float noundef %.sroa.054.0.vec.extract58, float noundef %.sroa.054.4.vec.extract64, float noundef %.sroa.072.0.vec.extract77, float noundef %.sroa.072.4.vec.extract83, float noundef %.sroa.0100.0.vec.extract104, float noundef %.sroa.0100.4.vec.extract106)
  %34 = fdiv float 1.000000e+00, %.fca.1.extract
  br label %35

35:                                               ; preds = %26, %31, %18
  %.0114 = phi float [ %22, %18 ], [ %30, %26 ], [ %34, %31 ]
  %.0113 = phi float [ %20, %18 ], [ %28, %26 ], [ %33, %31 ]
  %.0 = phi float [ %19, %18 ], [ %27, %26 ], [ %32, %31 ]
  %36 = fmul float %.0114, %.0
  %.sroa.0109.0.vec.insert = insertelement <2 x float> poison, float %36, i64 0
  %37 = fmul float %.0114, %.0113
  %.sroa.0109.4.vec.insert = insertelement <2 x float> %.sroa.0109.0.vec.insert, float %37, i64 1
  %38 = fsub float 1.000000e+00, %36
  %39 = fsub float %38, %37
  %.fca.0.insert = insertvalue { <2 x float>, float } poison, <2 x float> %.sroa.0109.4.vec.insert, 0
  %.fca.1.insert = insertvalue { <2 x float>, float } %.fca.0.insert, float %39, 1
  ret { <2 x float>, float } %.fca.1.insert
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fabs.v2f32(<2 x float>) #5

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

!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)"}


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