; 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_3fb_cfg_t = type { %struct.arm_2d_size_t, i8, [3 x i64], %struct.arm_2d_helper_2d_copy_evt_t, %struct.arm_2d_helper_dma_copy_evt_t }
%struct.arm_2d_size_t = type { i16, i16 }
%struct.arm_2d_helper_2d_copy_evt_t = type { ptr, ptr }
%struct.arm_2d_helper_dma_copy_evt_t = type { ptr, ptr }
%struct.arm_2d_helper_3fb_t = type { %struct.anon.31 }
%struct.anon.31 = type { %struct.arm_2d_helper_3fb_cfg_t, %struct.anon.32 }
%struct.anon.32 = type { i8, [3 x i8], i64, i8 }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__.arm_2d_helper_3fb_init = external hidden unnamed_addr constant [84 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare i64 @arm_2d_port_new_semaphore() #4

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

8:                                                ; preds = %2
  br label %10

9:                                                ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 3208, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #6
  unreachable

10:                                               ; preds = %8
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = icmp ne ptr null, %11
  br i1 %12, label %13, label %14

13:                                               ; preds = %10
  br label %15

14:                                               ; preds = %10
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 3209, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #6
  unreachable

15:                                               ; preds = %13
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %16, i32 0, i32 2
  %18 = getelementptr inbounds [3 x i64], ptr %17, i64 0, i64 0
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = icmp ne i64 0, %19
  br i1 %20, label %21, label %22

21:                                               ; preds = %15
  br label %23

22:                                               ; preds = %15
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 3210, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #6
  unreachable

23:                                               ; preds = %21
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %24, i32 0, i32 2
  %26 = getelementptr inbounds [3 x i64], ptr %25, i64 0, i64 1
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = icmp ne i64 0, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %23
  br label %31

30:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 3211, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #6
  unreachable

31:                                               ; preds = %29
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %32, i32 0, i32 2
  %34 = getelementptr inbounds [3 x i64], ptr %33, i64 0, i64 2
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = icmp ne i64 0, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %31
  br label %39

38:                                               ; preds = %31
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 3212, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #6
  unreachable

39:                                               ; preds = %37
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %40, i32 0, i32 1
  %42 = load i8, ptr %41, align 4, !tbaa !11
  %43 = zext i8 %42 to i32
  %44 = and i32 %43, 7
  %45 = icmp eq i32 0, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %39
  br label %48

47:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 3213, ptr noundef @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #6
  unreachable

48:                                               ; preds = %46
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %49, i8 0, i64 88, i1 false)
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %50, i32 0, i32 0
  %52 = getelementptr inbounds %struct.anon.31, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %52, ptr align 8 %53, i64 64, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %54, i32 0, i32 0
  %56 = getelementptr inbounds %struct.anon.31, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %struct.arm_2d_size_t, ptr %57, i32 0, i32 1
  %59 = load i16, ptr %58, align 2, !tbaa !20
  %60 = sext i16 %59 to i32
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %struct.anon.31, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds %struct.arm_2d_size_t, ptr %64, i32 0, i32 0
  %66 = load i16, ptr %65, align 8, !tbaa !25
  %67 = sext i16 %66 to i32
  %68 = mul nsw i32 %60, %67
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds %struct.anon.31, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %71, i32 0, i32 1
  %73 = load i8, ptr %72, align 4, !tbaa !26
  %74 = zext i8 %73 to i32
  %75 = ashr i32 %74, 3
  %76 = mul nsw i32 %68, %75
  store i32 %76, ptr %5, align 4, !tbaa !27
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %77, i32 0, i32 0
  %79 = getelementptr inbounds %struct.anon.31, ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %79, i32 0, i32 2
  %81 = getelementptr inbounds [3 x i64], ptr %80, i64 0, i64 0
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = inttoptr i64 %82 to ptr
  %84 = load i32, ptr %5, align 4, !tbaa !27
  %85 = zext i32 %84 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %83, i8 0, i64 %85, i1 false)
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %struct.anon.31, ptr %87, i32 0, i32 0
  %89 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %88, i32 0, i32 2
  %90 = getelementptr inbounds [3 x i64], ptr %89, i64 0, i64 1
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = inttoptr i64 %91 to ptr
  %93 = load i32, ptr %5, align 4, !tbaa !27
  %94 = zext i32 %93 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %92, i8 0, i64 %94, i1 false)
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds %struct.anon.31, ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %97, i32 0, i32 2
  %99 = getelementptr inbounds [3 x i64], ptr %98, i64 0, i64 2
  %100 = load i64, ptr %99, align 8, !tbaa !9
  %101 = inttoptr i64 %100 to ptr
  %102 = load i32, ptr %5, align 4, !tbaa !27
  %103 = zext i32 %102 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %101, i8 0, i64 %103, i1 false)
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds %struct.anon.31, ptr %105, i32 0, i32 1
  %107 = getelementptr inbounds %struct.anon.32, ptr %106, i32 0, i32 1
  %108 = getelementptr inbounds [3 x i8], ptr %107, i64 0, i64 0
  store i8 2, ptr %108, align 1, !tbaa !19
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %109, i32 0, i32 0
  %111 = getelementptr inbounds %struct.anon.31, ptr %110, i32 0, i32 1
  %112 = load i8, ptr %111, align 8
  %113 = and i8 %112, 63
  %114 = or i8 %113, 0
  store i8 %114, ptr %111, align 8
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds %struct.anon.31, ptr %116, i32 0, i32 1
  %118 = getelementptr inbounds %struct.anon.32, ptr %117, i32 0, i32 1
  %119 = getelementptr inbounds [3 x i8], ptr %118, i64 0, i64 1
  store i8 3, ptr %119, align 1, !tbaa !19
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds %struct.anon.31, ptr %121, i32 0, i32 1
  %123 = load i8, ptr %122, align 8
  %124 = and i8 %123, -4
  %125 = or i8 %124, 1
  store i8 %125, ptr %122, align 8
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %126, i32 0, i32 0
  %128 = getelementptr inbounds %struct.anon.31, ptr %127, i32 0, i32 1
  %129 = getelementptr inbounds %struct.anon.32, ptr %128, i32 0, i32 1
  %130 = getelementptr inbounds [3 x i8], ptr %129, i64 0, i64 2
  store i8 6, ptr %130, align 1, !tbaa !19
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds %struct.anon.31, ptr %132, i32 0, i32 1
  %134 = load i8, ptr %133, align 8
  %135 = and i8 %134, -13
  %136 = or i8 %135, 8
  store i8 %136, ptr %133, align 8
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %137, i32 0, i32 0
  %139 = getelementptr inbounds %struct.anon.31, ptr %138, i32 0, i32 1
  %140 = load i8, ptr %139, align 8
  %141 = and i8 %140, -49
  %142 = or i8 %141, 48
  store i8 %142, ptr %139, align 8
  %143 = call i64 @arm_2d_port_new_semaphore()
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.anon.31, ptr %145, i32 0, i32 1
  %147 = getelementptr inbounds %struct.anon.32, ptr %146, i32 0, i32 2
  store i64 %143, ptr %147, align 8, !tbaa !29
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %148, i32 0, i32 0
  %150 = getelementptr inbounds %struct.anon.31, ptr %149, i32 0, i32 0
  %151 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %150, i32 0, i32 3
  %152 = getelementptr inbounds %struct.arm_2d_helper_2d_copy_evt_t, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !30
  %154 = icmp eq ptr null, %153
  br i1 %154, label %155, label %161

155:                                              ; preds = %48
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %156, i32 0, i32 0
  %158 = getelementptr inbounds %struct.anon.31, ptr %157, i32 0, i32 0
  %159 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %158, i32 0, i32 3
  %160 = getelementptr inbounds %struct.arm_2d_helper_2d_copy_evt_t, ptr %159, i32 0, i32 0
  store ptr @__arm_2d_helper_3fb_dma_2d_copy, ptr %160, align 8, !tbaa !30
  br label %161

161:                                              ; preds = %155, %48
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %162, i32 0, i32 0
  %164 = getelementptr inbounds %struct.anon.31, ptr %163, i32 0, i32 0
  %165 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %164, i32 0, i32 4
  %166 = getelementptr inbounds %struct.arm_2d_helper_dma_copy_evt_t, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !31
  %168 = icmp eq ptr null, %167
  br i1 %168, label %169, label %175

169:                                              ; preds = %161
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.arm_2d_helper_3fb_t, ptr %170, i32 0, i32 0
  %172 = getelementptr inbounds %struct.anon.31, ptr %171, i32 0, i32 0
  %173 = getelementptr inbounds %struct.arm_2d_helper_3fb_cfg_t, ptr %172, i32 0, i32 4
  %174 = getelementptr inbounds %struct.arm_2d_helper_dma_copy_evt_t, ptr %173, i32 0, i32 0
  store ptr @__arm_2d_helper_3fb_dma_copy, ptr %174, align 8, !tbaa !31
  br label %175

175:                                              ; preds = %169, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @__arm_2d_helper_3fb_dma_2d_copy(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i64 noundef, i32 noundef, i16 noundef signext, i16 noundef signext, i8 noundef zeroext) #5

; Function Attrs: nounwind uwtable
declare hidden void @__arm_2d_helper_3fb_dma_copy(ptr noundef nonnull, ptr noundef, i64 noundef, i64 noundef, i32 noundef, i8 noundef zeroext) #5

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 #5 = { 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 #6 = { noreturn nounwind }
attributes #7 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !7, i64 4}
!12 = !{!"arm_2d_helper_3fb_cfg_t", !13, i64 0, !7, i64 4, !7, i64 8, !15, i64 32, !16, i64 48}
!13 = !{!"arm_2d_size_t", !14, i64 0, !14, i64 2}
!14 = !{!"short", !7, i64 0}
!15 = !{!"arm_2d_helper_2d_copy_evt_t", !6, i64 0, !6, i64 8}
!16 = !{!"arm_2d_helper_dma_copy_evt_t", !6, i64 0, !6, i64 8}
!17 = !{i64 0, i64 2, !18, i64 2, i64 2, !18, i64 4, i64 1, !19, i64 8, i64 24, !19, i64 32, i64 8, !5, i64 40, i64 8, !5, i64 48, i64 8, !5, i64 56, i64 8, !5}
!18 = !{!14, !14, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !14, i64 2}
!21 = !{!"arm_2d_helper_3fb_t", !22, i64 0}
!22 = !{!"", !12, i64 0, !23, i64 64}
!23 = !{!"", !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 1, !10, i64 8, !24, i64 16}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{!21, !14, i64 0}
!26 = !{!21, !7, i64 4}
!27 = !{!28, !28, i64 0}
!28 = !{!"int", !7, i64 0}
!29 = !{!21, !10, i64 72}
!30 = !{!21, !6, i64 32}
!31 = !{!21, !6, i64 48}


; 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"

@.str.1 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__.arm_2d_helper_3fb_init = external hidden unnamed_addr constant [84 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare i64 @arm_2d_port_new_semaphore() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @arm_2d_helper_3fb_init(ptr nocapture noundef nonnull %0, ptr nocapture noundef nonnull readonly %1) local_unnamed_addr #4 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i64 %4, 0
  br i1 %.not, label %5, label %6

5:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 3210, ptr noundef nonnull @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #5
  unreachable

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %.not29 = icmp eq i64 %8, 0
  br i1 %.not29, label %9, label %10

9:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 3211, ptr noundef nonnull @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #5
  unreachable

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  %12 = load i64, ptr %11, align 8, !tbaa !5
  %.not30 = icmp eq i64 %12, 0
  br i1 %.not30, label %13, label %14

13:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 3212, ptr noundef nonnull @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #5
  unreachable

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %1, i64 4
  %16 = load i8, ptr %15, align 4, !tbaa !9
  %17 = and i8 %16, 7
  %18 = icmp eq i8 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 3213, ptr noundef nonnull @__PRETTY_FUNCTION__.arm_2d_helper_3fb_init) #5
  unreachable

20:                                               ; preds = %14
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %0, i8 0, i64 88, i1 false)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(64) %1, i64 64, i1 false), !tbaa.struct !16
  %21 = getelementptr inbounds i8, ptr %0, i64 2
  %22 = load i16, ptr %21, align 2, !tbaa !20
  %23 = sext i16 %22 to i64
  %24 = load i16, ptr %0, align 8, !tbaa !25
  %25 = sext i16 %24 to i64
  %26 = mul nsw i64 %25, %23
  %27 = getelementptr inbounds i8, ptr %0, i64 4
  %28 = load i8, ptr %27, align 4, !tbaa !26
  %29 = lshr i8 %28, 3
  %30 = zext nneg i8 %29 to i64
  %31 = mul nsw i64 %26, %30
  %32 = getelementptr inbounds i8, ptr %0, i64 8
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = inttoptr i64 %33 to ptr
  %35 = and i64 %31, 4294967295
  tail call void @llvm.memset.p0.i64(ptr align 1 %34, i8 0, i64 %35, i1 false)
  %36 = getelementptr inbounds i8, ptr %0, i64 16
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = inttoptr i64 %37 to ptr
  tail call void @llvm.memset.p0.i64(ptr align 1 %38, i8 0, i64 %35, i1 false)
  %39 = getelementptr inbounds i8, ptr %0, i64 24
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = inttoptr i64 %40 to ptr
  tail call void @llvm.memset.p0.i64(ptr align 1 %41, i8 0, i64 %35, i1 false)
  %42 = getelementptr inbounds i8, ptr %0, i64 64
  store <4 x i8> <i8 57, i8 2, i8 3, i8 6>, ptr %42, align 8
  %43 = tail call i64 @arm_2d_port_new_semaphore() #6
  %44 = getelementptr inbounds i8, ptr %0, i64 72
  store i64 %43, ptr %44, align 8, !tbaa !27
  %45 = getelementptr inbounds i8, ptr %0, i64 32
  %46 = load ptr, ptr %45, align 8, !tbaa !28
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %49

48:                                               ; preds = %20
  store ptr @__arm_2d_helper_3fb_dma_2d_copy, ptr %45, align 8, !tbaa !28
  br label %49

49:                                               ; preds = %48, %20
  %50 = getelementptr inbounds i8, ptr %0, i64 48
  %51 = load ptr, ptr %50, align 8, !tbaa !29
  %52 = icmp eq ptr %51, null
  br i1 %52, label %53, label %54

53:                                               ; preds = %49
  store ptr @__arm_2d_helper_3fb_dma_copy, ptr %50, align 8, !tbaa !29
  br label %54

54:                                               ; preds = %53, %49
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @__arm_2d_helper_3fb_dma_2d_copy(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i64 noundef, i32 noundef, i16 noundef signext, i16 noundef signext, i8 noundef zeroext) #4

; Function Attrs: nounwind uwtable
declare hidden void @__arm_2d_helper_3fb_dma_copy(ptr noundef nonnull, ptr noundef, i64 noundef, i64 noundef, i32 noundef, i8 noundef zeroext) #4

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 #4 = { 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 #5 = { noreturn nounwind }
attributes #6 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 4}
!10 = !{!"arm_2d_helper_3fb_cfg_t", !11, i64 0, !7, i64 4, !7, i64 8, !13, i64 32, !15, i64 48}
!11 = !{!"arm_2d_size_t", !12, i64 0, !12, i64 2}
!12 = !{!"short", !7, i64 0}
!13 = !{!"arm_2d_helper_2d_copy_evt_t", !14, i64 0, !14, i64 8}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"arm_2d_helper_dma_copy_evt_t", !14, i64 0, !14, i64 8}
!16 = !{i64 0, i64 2, !17, i64 2, i64 2, !17, i64 4, i64 1, !18, i64 8, i64 24, !18, i64 32, i64 8, !19, i64 40, i64 8, !19, i64 48, i64 8, !19, i64 56, i64 8, !19}
!17 = !{!12, !12, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!14, !14, i64 0}
!20 = !{!21, !12, i64 2}
!21 = !{!"arm_2d_helper_3fb_t", !22, i64 0}
!22 = !{!"", !10, i64 0, !23, i64 64}
!23 = !{!"", !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 0, !7, i64 1, !6, i64 8, !24, i64 16}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{!21, !12, i64 0}
!26 = !{!21, !7, i64 4}
!27 = !{!21, !6, i64 72}
!28 = !{!21, !14, i64 32}
!29 = !{!21, !14, i64 48}


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