; 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_tile_transform_xy_with_src_mask_and_opacity_prepare(ptr noundef, ptr noundef nonnull, ptr noundef nonnull, <2 x float>, float noundef, float noundef, float noundef, i8 noundef zeroext) #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare(ptr noundef %0, ptr noundef nonnull %1, ptr noundef nonnull %2, i32 %3, float noundef %4, float noundef %5, i8 noundef zeroext %6) local_unnamed_addr #0 {
  %.sroa.2.0.extract.shift = lshr i32 %3, 16
  %8 = insertelement <2 x i32> poison, i32 %3, 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_tile_transform_xy_with_src_mask_and_opacity_prepare(ptr noundef %0, ptr noundef %1, ptr noundef %2, <2 x float> %11, float noundef %4, float noundef %5, float 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