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

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

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

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @_Z8vec4_sub4Vec4S_(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3) #1 {
  %5 = alloca %union.Vec4, align 4
  %6 = alloca %union.Vec4, align 4
  %7 = alloca %union.Vec4, align 4
  %8 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 0
  store <2 x float> %0, ptr %8, align 4
  %9 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 1
  store <2 x float> %1, ptr %9, align 4
  %10 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 0
  store <2 x float> %2, ptr %10, align 4
  %11 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 1
  store <2 x float> %3, ptr %11, align 4
  %12 = getelementptr inbounds %struct.anon.3, ptr %6, i32 0, i32 0
  %13 = load float, ptr %12, align 4, !tbaa !5
  %14 = getelementptr inbounds %struct.anon.3, ptr %7, i32 0, i32 0
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = fsub float %13, %15
  %17 = getelementptr inbounds %struct.anon.3, ptr %6, i32 0, i32 1
  %18 = load float, ptr %17, align 4, !tbaa !5
  %19 = getelementptr inbounds %struct.anon.3, ptr %7, i32 0, i32 1
  %20 = load float, ptr %19, align 4, !tbaa !5
  %21 = fsub float %18, %20
  %22 = getelementptr inbounds %struct.anon.3, ptr %6, i32 0, i32 2
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = getelementptr inbounds %struct.anon.3, ptr %7, i32 0, i32 2
  %25 = load float, ptr %24, align 4, !tbaa !5
  %26 = fsub float %23, %25
  %27 = getelementptr inbounds %struct.anon.3, ptr %6, i32 0, i32 3
  %28 = load float, ptr %27, align 4, !tbaa !5
  %29 = getelementptr inbounds %struct.anon.3, ptr %7, i32 0, i32 3
  %30 = load float, ptr %29, align 4, !tbaa !5
  %31 = fsub float %28, %30
  %32 = call { <2 x float>, <2 x float> } @_Z4vec4ffff(float noundef %16, float noundef %21, float noundef %26, float noundef %31)
  %33 = getelementptr inbounds %union.Vec4, ptr %5, i32 0, i32 0
  %34 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %33, i32 0, i32 0
  %35 = extractvalue { <2 x float>, <2 x float> } %32, 0
  store <2 x float> %35, ptr %34, align 4
  %36 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %33, i32 0, i32 1
  %37 = extractvalue { <2 x float>, <2 x float> } %32, 1
  store <2 x float> %37, ptr %36, align 4
  %38 = getelementptr inbounds %union.Vec4, ptr %5, i32 0, i32 0
  %39 = load { <2 x float>, <2 x float> }, ptr %38, align 4
  ret { <2 x float>, <2 x float> } %39
}

attributes #0 = { 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 #1 = { 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; 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: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @_Z4vec4ffff(float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local { <2 x float>, <2 x float> } @_Z8vec4_sub4Vec4S_(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3) local_unnamed_addr #1 {
  %5 = fsub <2 x float> %0, %2
  %6 = extractelement <2 x float> %5, i64 0
  %7 = fsub <2 x float> %0, %2
  %8 = extractelement <2 x float> %7, i64 1
  %9 = fsub <2 x float> %1, %3
  %10 = extractelement <2 x float> %9, i64 0
  %11 = fsub <2 x float> %1, %3
  %12 = extractelement <2 x float> %11, i64 1
  %13 = tail call { <2 x float>, <2 x float> } @_Z4vec4ffff(float noundef %6, float noundef %8, float noundef %10, float noundef %12)
  ret { <2 x float>, <2 x float> } %13
}

attributes #0 = { 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 #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" }

!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,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass,VectorCombinePass