; LLVM IR from ARM-software/Arm-2D :: Library/Source (arm_2d_transform)

; 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.arm_2d_location_t = type { i16, i16 }
%struct.arm_2d_point_float_t = type { float, float }

; Function Attrs: nounwind uwtable
declare dso_local i32 @arm_2dp_cccn888_fill_colour_with_mask_opacity_and_transform_xy_prepare(ptr noundef, ptr noundef nonnull, <2 x float>, float noundef, float noundef, float noundef, i32 noundef, i8 noundef zeroext) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @arm_2dp_cccn888_fill_colour_with_mask_opacity_and_transform_prepare(ptr noundef %0, ptr noundef nonnull %1, i32 %2, float noundef %3, float noundef %4, i32 noundef %5, i8 noundef zeroext %6) #0 {
  %8 = alloca %struct.arm_2d_location_t, align 2
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca %struct.arm_2d_point_float_t, align 4
  store i32 %2, ptr %8, align 2
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store float %3, ptr %11, align 4, !tbaa !9
  store float %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !11
  store i8 %6, ptr %14, align 1, !tbaa !13
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.arm_2d_point_float_t, ptr %15, i32 0, i32 0
  %19 = getelementptr inbounds %struct.arm_2d_location_t, ptr %8, i32 0, i32 0
  %20 = load i16, ptr %19, align 2, !tbaa !14
  %21 = sitofp i16 %20 to float
  store float %21, ptr %18, align 4, !tbaa !17
  %22 = getelementptr inbounds %struct.arm_2d_point_float_t, ptr %15, i32 0, i32 1
  %23 = getelementptr inbounds %struct.arm_2d_location_t, ptr %8, i32 0, i32 1
  %24 = load i16, ptr %23, align 2, !tbaa !19
  %25 = sitofp i16 %24 to float
  store float %25, ptr %22, align 4, !tbaa !20
  %26 = load float, ptr %11, align 4, !tbaa !9
  %27 = load float, ptr %12, align 4, !tbaa !9
  %28 = load float, ptr %12, align 4, !tbaa !9
  %29 = load i32, ptr %13, align 4, !tbaa !11
  %30 = load i8, ptr %14, align 1, !tbaa !13
  %31 = load <2 x float>, ptr %15, align 4
  %32 = call i32 @arm_2dp_cccn888_fill_colour_with_mask_opacity_and_transform_xy_prepare(ptr noundef %16, ptr noundef %17, <2 x float> %31, float noundef %26, float noundef %27, float noundef %28, i32 noundef %29, i8 noundef zeroext %30)
  ret i32 %32
}

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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"arm_2d_location_t", !16, i64 0, !16, i64 2}
!16 = !{!"short", !7, i64 0}
!17 = !{!18, !10, i64 0}
!18 = !{!"arm_2d_point_float_t", !10, i64 0, !10, i64 4}
!19 = !{!15, !16, i64 2}
!20 = !{!18, !10, i64 4}


; 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: nounwind uwtable
declare dso_local i32 @arm_2dp_cccn888_fill_colour_with_mask_opacity_and_transform_xy_prepare(ptr noundef, ptr noundef nonnull, <2 x float>, float noundef, float noundef, float noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @arm_2dp_cccn888_fill_colour_with_mask_opacity_and_transform_prepare(ptr noundef %0, ptr noundef nonnull %1, i32 %2, float noundef %3, float noundef %4, i32 noundef %5, i8 noundef zeroext %6) local_unnamed_addr #0 {
  %.sroa.2.0.extract.shift = lshr i32 %2, 16
  %8 = insertelement <2 x i32> poison, i32 %2, i64 0
  %9 = insertelement <2 x i32> %8, i32 %.sroa.2.0.extract.shift, i64 1
  %10 = trunc <2 x i32> %9 to <2 x i16>
  %11 = sitofp <2 x i16> %10 to <2 x float>
  %12 = tail call i32 @arm_2dp_cccn888_fill_colour_with_mask_opacity_and_transform_xy_prepare(ptr noundef %0, ptr noundef %1, <2 x float> %11, float noundef %3, float noundef %4, float noundef %4, i32 noundef %5, i8 noundef zeroext %6)
  ret i32 %12
}

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


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass