; 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_dirty_region_transform_t = type { float, %union.anon.38, float, %struct.arm_2d_helper_dirty_region_item_t, %struct.anon.39 }
%union.anon.38 = type { float }
%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.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.39 = type { ptr, ptr, %struct.anon.40, %struct.anon.41, %struct.anon.42, i8 }
%struct.anon.40 = type { float, float }
%struct.anon.41 = type { float, float }
%struct.anon.42 = 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
@__PRETTY_FUNCTION__.arm_2d_helper_dirty_region_transform_init = external hidden unnamed_addr constant [150 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [17 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_add_items(ptr noundef nonnull, ptr noundef nonnull, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @arm_2d_helper_dirty_region_transform_init(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, float noundef %3, float noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store float %3, ptr %9, align 4, !tbaa !9
  store float %4, ptr %10, align 4, !tbaa !9
  %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 4801, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_dirty_region_transform_init) #3
  unreachable

15:                                               ; preds = %13
  %16 = load ptr, ptr %8, 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 4802, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_dirty_region_transform_init) #3
  unreachable

20:                                               ; preds = %18
  %21 = load ptr, ptr %7, 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.22, ptr noundef @.str.1, i32 noundef 4803, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_dirty_region_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 120, i1 false)
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %28, i32 0, i32 4
  %30 = getelementptr inbounds %struct.anon.39, ptr %29, i32 0, i32 0
  store ptr %27, ptr %30, align 8, !tbaa !11
  %31 = load float, ptr %9, align 4, !tbaa !9
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %32, i32 0, i32 4
  %34 = getelementptr inbounds %struct.anon.39, ptr %33, i32 0, i32 2
  %35 = getelementptr inbounds %struct.anon.40, ptr %34, i32 0, i32 1
  store float %31, ptr %35, align 4, !tbaa !20
  %36 = load float, ptr %10, align 4, !tbaa !9
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %37, i32 0, i32 4
  %39 = getelementptr inbounds %struct.anon.39, ptr %38, i32 0, i32 3
  %40 = getelementptr inbounds %struct.anon.41, ptr %39, i32 0, i32 1
  store float %36, ptr %40, align 4, !tbaa !21
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %41, i32 0, i32 4
  %43 = getelementptr inbounds %struct.anon.39, ptr %42, i32 0, i32 3
  %44 = getelementptr inbounds %struct.anon.41, ptr %43, i32 0, i32 0
  store float 1.000000e+00, ptr %44, align 8, !tbaa !22
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %45, i32 0, i32 1
  store float 1.000000e+00, ptr %46, align 4, !tbaa !23
  %47 = load float, ptr %10, align 4, !tbaa !9
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %48, i32 0, i32 4
  %50 = getelementptr inbounds %struct.anon.39, ptr %49, i32 0, i32 4
  %51 = getelementptr inbounds %struct.anon.42, ptr %50, i32 0, i32 1
  store float %47, ptr %51, align 4, !tbaa !24
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %52, i32 0, i32 4
  %54 = getelementptr inbounds %struct.anon.39, ptr %53, i32 0, i32 4
  %55 = getelementptr inbounds %struct.anon.42, ptr %54, i32 0, i32 0
  store float 0.000000e+00, ptr %55, align 8, !tbaa !25
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %56, i32 0, i32 2
  store float 0.000000e+00, ptr %57, align 8, !tbaa !26
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %58, i32 0, i32 4
  %60 = getelementptr inbounds %struct.anon.39, ptr %59, i32 0, i32 5
  store i8 1, ptr %60, align 8, !tbaa !27
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %62, i32 0, i32 4
  %64 = getelementptr inbounds %struct.anon.39, ptr %63, i32 0, i32 1
  store ptr %61, ptr %64, align 8, !tbaa !28
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.arm_2d_helper_dirty_region_transform_t, ptr %66, i32 0, i32 3
  call void @arm_2d_helper_dirty_region_add_items(ptr noundef %65, ptr noundef %67, i64 noundef 1)
  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 72}
!12 = !{!"arm_2d_helper_dirty_region_transform_t", !10, i64 0, !7, i64 4, !10, i64 8, !13, i64 16, !17, i64 72}
!13 = !{!"arm_2d_helper_dirty_region_item_t", !14, i64 0, !15, i64 48}
!14 = !{!"", !6, i64 0, !6, i64 8, !7, i64 16, !15, i64 32, !7, i64 40, !7, i64 40, !7, i64 40, !7, i64 40, !7, i64 41, !16, i64 42}
!15 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!16 = !{!"short", !7, i64 0}
!17 = !{!"", !6, i64 0, !6, i64 8, !18, i64 16, !18, i64 24, !18, i64 32, !19, i64 40}
!18 = !{!"", !10, i64 0, !10, i64 4}
!19 = !{!"_Bool", !7, i64 0}
!20 = !{!12, !10, i64 92}
!21 = !{!12, !10, i64 100}
!22 = !{!12, !10, i64 96}
!23 = !{!7, !7, i64 0}
!24 = !{!12, !10, i64 108}
!25 = !{!12, !10, i64 104}
!26 = !{!12, !10, i64 8}
!27 = !{!12, !19, i64 112}
!28 = !{!12, !6, i64 80}


; 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_add_items(ptr noundef nonnull, ptr noundef nonnull, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @arm_2d_helper_dirty_region_transform_init(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, float noundef %3, float noundef %4) local_unnamed_addr #1 {
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %0, i8 0, i64 120, i1 false)
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  store ptr %2, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 92
  store float %3, ptr %7, align 4, !tbaa !18
  %8 = getelementptr inbounds i8, ptr %0, i64 96
  %9 = getelementptr inbounds i8, ptr %0, i64 100
  store float %4, ptr %9, align 4, !tbaa !19
  store float 1.000000e+00, ptr %8, align 8, !tbaa !20
  %10 = getelementptr inbounds i8, ptr %0, i64 4
  %11 = getelementptr inbounds i8, ptr %0, i64 108
  store float %4, ptr %11, align 4, !tbaa !21
  store <2 x float> <float 1.000000e+00, float 0.000000e+00>, ptr %10, align 4, !tbaa !22
  %12 = getelementptr inbounds i8, ptr %0, i64 112
  store i8 1, ptr %12, align 8, !tbaa !23
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  store ptr %1, ptr %13, align 8, !tbaa !24
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @arm_2d_helper_dirty_region_add_items(ptr noundef %1, ptr noundef %14, i64 noundef 1)
  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, !12, i64 72}
!6 = !{!"arm_2d_helper_dirty_region_transform_t", !7, i64 0, !8, i64 4, !7, i64 8, !10, i64 16, !15, i64 72}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"arm_2d_helper_dirty_region_item_t", !11, i64 0, !13, i64 48}
!11 = !{!"", !12, i64 0, !12, i64 8, !8, i64 16, !13, i64 32, !8, i64 40, !8, i64 40, !8, i64 40, !8, i64 40, !8, i64 41, !14, i64 42}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"arm_2d_region_t", !8, i64 0, !8, i64 4}
!14 = !{!"short", !8, i64 0}
!15 = !{!"", !12, i64 0, !12, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !17, i64 40}
!16 = !{!"", !7, i64 0, !7, i64 4}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!6, !7, i64 92}
!19 = !{!6, !7, i64 100}
!20 = !{!6, !7, i64 96}
!21 = !{!6, !7, i64 108}
!22 = !{!8, !8, i64 0}
!23 = !{!6, !17, i64 112}
!24 = !{!6, !12, i64 80}


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