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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @CgmVec4_eq(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3) #0 {
  %5 = alloca %union.CgmVec4, align 4
  %6 = alloca %union.CgmVec4, align 4
  %7 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  store <2 x float> %0, ptr %7, align 4
  %8 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  store <2 x float> %1, ptr %8, align 4
  %9 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 0
  store <2 x float> %2, ptr %9, align 4
  %10 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 1
  store <2 x float> %3, ptr %10, align 4
  %11 = getelementptr inbounds %struct.anon.1, ptr %5, i32 0, i32 0
  %12 = load float, ptr %11, align 4, !tbaa !5
  %13 = getelementptr inbounds %struct.anon.1, ptr %6, i32 0, i32 0
  %14 = load float, ptr %13, align 4, !tbaa !5
  %15 = fcmp oeq float %12, %14
  br i1 %15, label %16, label %34

16:                                               ; preds = %4
  %17 = getelementptr inbounds %struct.anon.1, ptr %5, i32 0, i32 1
  %18 = load float, ptr %17, align 4, !tbaa !5
  %19 = getelementptr inbounds %struct.anon.1, ptr %6, i32 0, i32 1
  %20 = load float, ptr %19, align 4, !tbaa !5
  %21 = fcmp oeq float %18, %20
  br i1 %21, label %22, label %34

22:                                               ; preds = %16
  %23 = getelementptr inbounds %struct.anon.1, ptr %5, i32 0, i32 2
  %24 = load float, ptr %23, align 4, !tbaa !5
  %25 = getelementptr inbounds %struct.anon.1, ptr %6, i32 0, i32 2
  %26 = load float, ptr %25, align 4, !tbaa !5
  %27 = fcmp oeq float %24, %26
  br i1 %27, label %28, label %34

28:                                               ; preds = %22
  %29 = getelementptr inbounds %struct.anon.1, ptr %5, i32 0, i32 3
  %30 = load float, ptr %29, align 4, !tbaa !5
  %31 = getelementptr inbounds %struct.anon.1, ptr %6, i32 0, i32 3
  %32 = load float, ptr %31, align 4, !tbaa !5
  %33 = fcmp oeq float %30, %32
  br label %34

34:                                               ; preds = %28, %22, %16, %4
  %35 = phi i1 [ false, %22 ], [ false, %16 ], [ false, %4 ], [ %33, %28 ]
  %36 = zext i1 %35 to i32
  %37 = trunc i32 %36 to i8
  ret i8 %37
}

attributes #0 = { 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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext range(i8 0, 2) i8 @CgmVec4_eq(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3) local_unnamed_addr #0 {
  %5 = shufflevector <2 x float> %0, <2 x float> %1, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  %6 = shufflevector <2 x float> %2, <2 x float> %3, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  %7 = fcmp oeq <4 x float> %5, %6
  %8 = freeze <4 x i1> %7
  %9 = bitcast <4 x i1> %8 to i4
  %10 = icmp eq i4 %9, -1
  %11 = zext i1 %10 to i8
  ret i8 %11
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) 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: GlobalDCEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass