; LLVM IR from ARM-software/Arm-2D :: Helper/Source (arm_2d_helper_pfb)

; 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_helper_transform_t = type { %union.anon.44, float, float, %struct.anon.45 }
%union.anon.44 = type { %struct.arm_2d_helper_dirty_region_t }
%struct.arm_2d_helper_dirty_region_t = type { %struct.anon.33, %struct.arm_2d_helper_dirty_region_item_t }
%struct.anon.33 = type <{ %struct.arm_2d_region_list_item_t, ptr, ptr, i8, i32, [3 x i8] }>
%struct.arm_2d_region_list_item_t = type { ptr, %struct.anon.6, %struct.arm_2d_region_t, %struct.anon.7 }
%struct.anon.6 = type { ptr }
%struct.arm_2d_region_t = type { %union.anon, %union.anon.0 }
%union.anon = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.0 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%struct.anon.7 = type { i8, i8, i16 }
%struct.arm_2d_helper_dirty_region_item_t = type { %struct.anon.34, %struct.arm_2d_region_t }
%struct.anon.34 = type { ptr, ptr, %union.anon.35, %struct.arm_2d_region_t, i8, i8, i16 }
%union.anon.35 = type { [2 x %struct.arm_2d_region_t] }
%struct.anon.45 = type { ptr, %struct.anon.46, %struct.anon.47, i8 }
%struct.anon.46 = type { float, float }
%struct.anon.47 = type { float, float }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [22 x i8], align 1
@__PRETTY_FUNCTION__.arm_2d_helper_transform_init = external hidden unnamed_addr constant [122 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
declare dso_local void @arm_2d_helper_dirty_region_init(ptr noundef nonnull, ptr noundef nonnull) #2

; Function Attrs: nounwind uwtable
define dso_local void @arm_2d_helper_transform_init(ptr noundef nonnull %0, ptr noundef nonnull %1, float noundef %2, float noundef %3, ptr noundef nonnull %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store float %2, ptr %8, align 4, !tbaa !9
  store float %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = icmp ne ptr null, %11
  br i1 %12, label %13, label %14

13:                                               ; preds = %5
  br label %15

14:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 5009, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_transform_init) #3
  unreachable

15:                                               ; preds = %13
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = icmp ne ptr null, %16
  br i1 %17, label %18, label %19

18:                                               ; preds = %15
  br label %20

19:                                               ; preds = %15
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.1, i32 noundef 5010, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_transform_init) #3
  unreachable

20:                                               ; preds = %18
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = icmp ne ptr null, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %20
  br label %25

24:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.1, i32 noundef 5011, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_transform_init) #3
  unreachable

25:                                               ; preds = %23
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %26, i8 0, i64 152, i1 false)
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.arm_2d_helper_transform_t, ptr %28, i32 0, i32 3
  %30 = getelementptr inbounds %struct.anon.45, ptr %29, i32 0, i32 0
  store ptr %27, ptr %30, align 8, !tbaa !11
  %31 = load float, ptr %8, align 4, !tbaa !9
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.arm_2d_helper_transform_t, ptr %32, i32 0, i32 3
  %34 = getelementptr inbounds %struct.anon.45, ptr %33, i32 0, i32 1
  %35 = getelementptr inbounds %struct.anon.46, ptr %34, i32 0, i32 1
  store float %31, ptr %35, align 4, !tbaa !16
  %36 = load float, ptr %9, align 4, !tbaa !9
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.arm_2d_helper_transform_t, ptr %37, i32 0, i32 3
  %39 = getelementptr inbounds %struct.anon.45, ptr %38, i32 0, i32 2
  %40 = getelementptr inbounds %struct.anon.47, ptr %39, i32 0, i32 1
  store float %36, ptr %40, align 4, !tbaa !17
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.arm_2d_helper_transform_t, ptr %41, i32 0, i32 3
  %43 = getelementptr inbounds %struct.anon.45, ptr %42, i32 0, i32 2
  %44 = getelementptr inbounds %struct.anon.47, ptr %43, i32 0, i32 0
  store float 1.000000e+00, ptr %44, align 8, !tbaa !18
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.arm_2d_helper_transform_t, ptr %45, i32 0, i32 2
  store float 1.000000e+00, ptr %46, align 4, !tbaa !19
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.arm_2d_helper_transform_t, ptr %47, i32 0, i32 3
  %49 = getelementptr inbounds %struct.anon.45, ptr %48, i32 0, i32 3
  store i8 1, ptr %49, align 8, !tbaa !20
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.arm_2d_helper_transform_t, ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  call void @arm_2d_helper_dirty_region_init(ptr noundef %51, ptr noundef %52)
  ret void
}

attributes #0 = { noreturn nounwind "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 #3 = { noreturn 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 = !{!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, !6, i64 120}
!12 = !{!"", !7, i64 0, !10, i64 112, !10, i64 116, !13, i64 120}
!13 = !{!"", !6, i64 0, !14, i64 8, !14, i64 16, !15, i64 24}
!14 = !{!"", !10, i64 0, !10, i64 4}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!12, !10, i64 132}
!17 = !{!12, !10, i64 140}
!18 = !{!12, !10, i64 136}
!19 = !{!12, !10, i64 116}
!20 = !{!12, !15, i64 144}


; 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
declare dso_local void @arm_2d_helper_dirty_region_init(ptr noundef nonnull, ptr noundef nonnull) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @arm_2d_helper_transform_init(ptr noundef nonnull %0, ptr noundef nonnull %1, float noundef %2, float noundef %3, ptr noundef nonnull %4) local_unnamed_addr #1 {
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(152) %0, i8 0, i64 152, i1 false)
  %6 = getelementptr inbounds i8, ptr %0, i64 120
  store ptr %1, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 132
  store float %2, ptr %7, align 4, !tbaa !14
  %8 = getelementptr inbounds i8, ptr %0, i64 136
  %9 = getelementptr inbounds i8, ptr %0, i64 140
  store float %3, ptr %9, align 4, !tbaa !15
  store float 1.000000e+00, ptr %8, align 8, !tbaa !16
  %10 = getelementptr inbounds i8, ptr %0, i64 116
  store float 1.000000e+00, ptr %10, align 4, !tbaa !17
  %11 = getelementptr inbounds i8, ptr %0, i64 144
  store i8 1, ptr %11, align 8, !tbaa !18
  tail call void @arm_2d_helper_dirty_region_init(ptr noundef %0, ptr noundef %4)
  ret void
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { 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" }

!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, !11, i64 120}
!6 = !{!"", !7, i64 0, !9, i64 112, !9, i64 116, !10, i64 120}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"float", !7, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 8, !12, i64 16, !13, i64 24}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"", !9, i64 0, !9, i64 4}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!6, !9, i64 132}
!15 = !{!6, !9, i64 140}
!16 = !{!6, !9, i64 136}
!17 = !{!6, !9, i64 116}
!18 = !{!6, !13, i64 144}


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