; LLVM IR from ARM-software/Arm-2D :: examples/common/benchmark (arm_2d_scene_benchmark_watch_panel)

; 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_region_list_item_t = type { ptr, [8 x i8], %struct.arm_2d_region_t, [4 x i8] }
%struct.arm_2d_region_t = type { %union.anon.7, %union.anon.8 }
%union.anon.7 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.8 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }
%struct.user_scene_benchmark_watch_panel_t = type { %union.anon, %struct.anon.9 }
%union.anon = type { %struct.arm_2d_scene_t }
%struct.arm_2d_scene_t = type { [16 x i8], ptr, %union.arm_2d_colour_t, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.anon.6, [7 x i8], %struct.arm_2d_helper_dirty_region_t }
%union.arm_2d_colour_t = type { i32 }
%struct.anon.6 = type { i8 }
%struct.arm_2d_helper_dirty_region_t = type { [56 x i8], %struct.arm_2d_helper_dirty_region_item_t }
%struct.arm_2d_helper_dirty_region_item_t = type { [48 x i8], %struct.arm_2d_region_t }
%struct.anon.9 = type { i8 }
%struct.arm_2d_scene_player_t = type { %struct.arm_2d_helper_pfb_t, %struct.anon.11, [208 x i8] }
%struct.arm_2d_helper_pfb_t = type { [344 x i8], %struct.anon.10 }
%struct.anon.10 = type { i64, i32, i32 }
%struct.anon.11 = type { i32, i32, i64, i64, i32, float, i16, i16, i32, i64 }

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [116 x i8], align 1
@__PRETTY_FUNCTION__.__arm_2d_scene_benchmark_watch_panel_init = external hidden unnamed_addr constant [141 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions = external hidden global [2 x %struct.arm_2d_region_list_item_t], align 16

; Function Attrs: nounwind uwtable
define dso_local ptr @__arm_2d_scene_benchmark_watch_panel_init(ptr noundef nonnull %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca %struct.arm_2d_region_t, align 2
  %9 = alloca %struct.arm_2d_region_t, align 2
  %10 = alloca ptr, align 8
  %11 = alloca %struct.arm_2d_region_t, align 2
  %12 = alloca ptr, align 8
  %13 = alloca i16, align 2
  %14 = alloca i8, align 1
  %15 = alloca %struct.user_scene_benchmark_watch_panel_t, align 8
  %16 = alloca %struct.arm_2d_region_t, align 2
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  store i8 0, ptr %6, align 1, !tbaa !9
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = icmp ne ptr null, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  br label %21

20:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 352, ptr noundef @__PRETTY_FUNCTION__.__arm_2d_scene_benchmark_watch_panel_init) #8
  unreachable

21:                                               ; preds = %19
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = icmp eq ptr null, %22
  br i1 %23, label %24, label %35

24:                                               ; preds = %21
  %25 = call noalias ptr @malloc(i64 noundef 248) #9
  store ptr %25, ptr %5, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp ne ptr null, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  br label %30

29:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 356, ptr noundef @__PRETTY_FUNCTION__.__arm_2d_scene_benchmark_watch_panel_init) #8
  unreachable

30:                                               ; preds = %28
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = icmp eq ptr null, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %153

34:                                               ; preds = %30
  br label %36

35:                                               ; preds = %21
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %36

36:                                               ; preds = %35, %34
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %37, i8 0, i64 248, i1 false)
  store ptr null, ptr getelementptr inbounds ([2 x %struct.arm_2d_region_list_item_t], ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 0, i64 1), align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.arm_2d_scene_player_t, ptr %38, i32 0, i32 0
  %40 = call i64 @arm_2d_helper_pfb_get_display_area(ptr noundef %39)
  store i64 %40, ptr %8, align 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %9, ptr align 2 %8, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr null, ptr %10, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %94, %36
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.arm_2d_region_t, ptr %42, i32 1
  store ptr %43, ptr %10, align 8, !tbaa !5
  %44 = icmp eq ptr %42, null
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %95

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store ptr null, ptr %12, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %89, %46
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.arm_2d_region_t, ptr %48, i32 1
  store ptr %49, ptr %12, align 8, !tbaa !5
  %50 = icmp eq ptr %48, null
  br i1 %50, label %51, label %83

51:                                               ; preds = %47
  %52 = getelementptr inbounds %struct.arm_2d_region_t, ptr %11, i32 0, i32 1
  %53 = getelementptr inbounds %struct.arm_2d_size_t, ptr %52, i32 0, i32 0
  store i16 240, ptr %53, align 2, !tbaa !15
  %54 = getelementptr inbounds %struct.arm_2d_region_t, ptr %11, i32 0, i32 1
  %55 = getelementptr inbounds %struct.arm_2d_size_t, ptr %54, i32 0, i32 1
  store i16 240, ptr %55, align 2, !tbaa !15
  %56 = getelementptr inbounds %struct.arm_2d_region_t, ptr %11, i32 0, i32 0
  %57 = getelementptr inbounds %struct.arm_2d_region_t, ptr %9, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %56, ptr align 2 %57, i64 4, i1 false), !tbaa.struct !16
  %58 = getelementptr inbounds %struct.arm_2d_region_t, ptr %9, i32 0, i32 1
  %59 = getelementptr inbounds %struct.arm_2d_size_t, ptr %58, i32 0, i32 0
  %60 = load i16, ptr %59, align 2, !tbaa !15
  %61 = sext i16 %60 to i32
  %62 = sub nsw i32 %61, 240
  %63 = ashr i32 %62, 1
  %64 = getelementptr inbounds %struct.arm_2d_region_t, ptr %11, i32 0, i32 0
  %65 = getelementptr inbounds %struct.arm_2d_location_t, ptr %64, i32 0, i32 0
  %66 = load i16, ptr %65, align 2, !tbaa !15
  %67 = sext i16 %66 to i32
  %68 = add nsw i32 %67, %63
  %69 = trunc i32 %68 to i16
  store i16 %69, ptr %65, align 2, !tbaa !15
  %70 = getelementptr inbounds %struct.arm_2d_region_t, ptr %9, i32 0, i32 1
  %71 = getelementptr inbounds %struct.arm_2d_size_t, ptr %70, i32 0, i32 1
  %72 = load i16, ptr %71, align 2, !tbaa !15
  %73 = sext i16 %72 to i32
  %74 = sub nsw i32 %73, 240
  %75 = ashr i32 %74, 1
  %76 = getelementptr inbounds %struct.arm_2d_region_t, ptr %11, i32 0, i32 0
  %77 = getelementptr inbounds %struct.arm_2d_location_t, ptr %76, i32 0, i32 1
  %78 = load i16, ptr %77, align 2, !tbaa !15
  %79 = sext i16 %78 to i32
  %80 = add nsw i32 %79, %75
  %81 = trunc i32 %80 to i16
  store i16 %81, ptr %77, align 2, !tbaa !15
  store i16 %81, ptr %13, align 2, !tbaa !17
  %82 = load i16, ptr %13, align 2, !tbaa !17
  br label %84

83:                                               ; preds = %47
  br label %84

84:                                               ; preds = %83, %51
  %85 = phi i32 [ 1, %51 ], [ 0, %83 ]
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  store i32 4, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %94

88:                                               ; preds = %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 getelementptr inbounds (%struct.arm_2d_region_list_item_t, ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i32 0, i32 2), ptr align 2 %11, i64 8, i1 false), !tbaa.struct !14
  br label %89

89:                                               ; preds = %88
  %90 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %91 = zext i1 %90 to i8
  store i8 %91, ptr %14, align 1, !tbaa !9
  %92 = load i8, ptr %14, align 1, !tbaa !9, !range !19, !noundef !20
  %93 = trunc i8 %92 to i1
  br label %47, !llvm.loop !21

94:                                               ; preds = %87
  br label %41, !llvm.loop !23

95:                                               ; preds = %45
  %96 = getelementptr inbounds %struct.arm_2d_region_t, ptr %8, i32 0, i32 1
  %97 = getelementptr inbounds %struct.arm_2d_size_t, ptr %96, i32 0, i32 1
  %98 = load i16, ptr %97, align 2, !tbaa !15
  %99 = sext i16 %98 to i32
  %100 = add nsw i32 %99, 7
  %101 = sdiv i32 %100, 8
  %102 = sub nsw i32 %101, 2
  %103 = mul nsw i32 %102, 8
  %104 = trunc i32 %103 to i16
  store i16 %104, ptr getelementptr inbounds (%struct.arm_2d_location_t, ptr getelementptr inbounds (%struct.arm_2d_region_list_item_t, ptr getelementptr inbounds ([2 x %struct.arm_2d_region_list_item_t], ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 0, i64 1), i32 0, i32 2), i32 0, i32 1), align 2, !tbaa !15
  %105 = getelementptr inbounds %struct.arm_2d_region_t, ptr %8, i32 0, i32 1
  %106 = getelementptr inbounds %struct.arm_2d_size_t, ptr %105, i32 0, i32 0
  %107 = load i16, ptr %106, align 2, !tbaa !15
  %108 = sext i16 %107 to i32
  %109 = icmp slt i32 240, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %95
  br label %116

111:                                              ; preds = %95
  %112 = getelementptr inbounds %struct.arm_2d_region_t, ptr %8, i32 0, i32 1
  %113 = getelementptr inbounds %struct.arm_2d_size_t, ptr %112, i32 0, i32 0
  %114 = load i16, ptr %113, align 2, !tbaa !15
  %115 = sext i16 %114 to i32
  br label %116

116:                                              ; preds = %111, %110
  %117 = phi i32 [ 240, %110 ], [ %115, %111 ]
  %118 = trunc i32 %117 to i16
  store i16 %118, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_region_list_item_t, ptr getelementptr inbounds ([2 x %struct.arm_2d_region_list_item_t], ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 0, i64 1), i32 0, i32 2), i32 0, i32 1), align 4, !tbaa !15
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 248, i1 false)
  %120 = getelementptr inbounds %struct.user_scene_benchmark_watch_panel_t, ptr %15, i32 0, i32 0
  %121 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 1
  %123 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 2
  %124 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 3
  %125 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 4
  store ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, ptr %125, align 8, !tbaa !24
  %126 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 5
  store ptr @__pfb_draw_scene_benchmark_watch_panel_handler, ptr %126, align 8, !tbaa !29
  %127 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 6
  %128 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 7
  store ptr @__after_scene_benchmark_watch_panel_switching, ptr %128, align 8, !tbaa !30
  %129 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 8
  %130 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 9
  %131 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 10
  store ptr @__on_scene_benchmark_watch_panel_frame_start, ptr %131, align 8, !tbaa !31
  %132 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 11
  store ptr @__on_scene_benchmark_watch_panel_frame_complete, ptr %132, align 8, !tbaa !32
  %133 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 12
  %134 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 13
  store ptr @__on_scene_benchmark_watch_panel_depose, ptr %134, align 8, !tbaa !33
  %135 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 14
  %136 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %120, i32 0, i32 16
  %137 = getelementptr inbounds %struct.user_scene_benchmark_watch_panel_t, ptr %15, i32 0, i32 1
  %138 = getelementptr inbounds %struct.anon.9, ptr %137, i32 0, i32 0
  %139 = load i8, ptr %6, align 1, !tbaa !9, !range !19, !noundef !20
  %140 = trunc i8 %139 to i1
  %141 = zext i1 %140 to i8
  store i8 %141, ptr %138, align 8, !tbaa !34
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %119, ptr align 8 %15, i64 248, i1 false), !tbaa.struct !36
  br label %142

142:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.arm_2d_scene_player_t, ptr %143, i32 0, i32 0
  %145 = call i64 @arm_2d_helper_pfb_get_display_area(ptr noundef %144)
  store i64 %145, ptr %16, align 2
  %146 = load i64, ptr %16, align 2
  call void @benchmark_watch_panel_init(i64 %146)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %147

147:                                              ; preds = %142
  br label %148

148:                                              ; preds = %147
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.user_scene_benchmark_watch_panel_t, ptr %150, i32 0, i32 0
  call void @arm_2d_scene_player_append_scenes(ptr noundef %149, ptr noundef %151, i64 noundef 1)
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %152, ptr %3, align 8
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %153

153:                                              ; preds = %148, %33
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  %154 = load ptr, ptr %3, align 8
  ret ptr %154
}

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

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

declare i64 @arm_2d_helper_pfb_get_display_area(ptr noundef) #5

; 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) #6

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) #5

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

; Function Attrs: nounwind uwtable
declare hidden i32 @__pfb_draw_scene_benchmark_watch_panel_handler(ptr noundef, ptr noundef, i1 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare hidden void @__after_scene_benchmark_watch_panel_switching(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @__on_scene_benchmark_watch_panel_frame_start(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @__on_scene_benchmark_watch_panel_frame_complete(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @__on_scene_benchmark_watch_panel_depose(ptr noundef) #0

declare void @benchmark_watch_panel_init(i64) #5

declare void @arm_2d_scene_player_append_scenes(ptr noundef, ptr noundef, i64 noundef) #5

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind allocsize(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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind allocsize(0) }

!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 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"arm_2d_region_list_item_t", !6, i64 0, !7, i64 8, !13, i64 16, !7, i64 24}
!13 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!14 = !{i64 0, i64 4, !15, i64 4, i64 4, !15}
!15 = !{!7, !7, i64 0}
!16 = !{i64 0, i64 2, !17, i64 2, i64 2, !17}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!25, !6, i64 40}
!25 = !{!"arm_2d_scene_t", !7, i64 0, !6, i64 16, !7, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !26, i64 120, !27, i64 128}
!26 = !{!"", !7, i64 0, !7, i64 0, !7, i64 0}
!27 = !{!"arm_2d_helper_dirty_region_t", !7, i64 0, !28, i64 56}
!28 = !{!"arm_2d_helper_dirty_region_item_t", !7, i64 0, !13, i64 48}
!29 = !{!25, !6, i64 48}
!30 = !{!25, !6, i64 64}
!31 = !{!25, !6, i64 88}
!32 = !{!25, !6, i64 96}
!33 = !{!25, !6, i64 112}
!34 = !{!35, !10, i64 0}
!35 = !{!"", !10, i64 0}
!36 = !{i64 0, i64 240, !15, i64 240, i64 1, !9}


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

%struct.arm_2d_region_list_item_t = type { ptr, [8 x i8], %struct.arm_2d_region_t, [4 x i8] }
%struct.arm_2d_region_t = type { %union.anon.7, %union.anon.8 }
%union.anon.7 = type { %struct.arm_2d_location_t }
%struct.arm_2d_location_t = type { i16, i16 }
%union.anon.8 = type { %struct.arm_2d_size_t }
%struct.arm_2d_size_t = type { i16, i16 }

@.str.1 = external hidden unnamed_addr constant [116 x i8], align 1
@__PRETTY_FUNCTION__.__arm_2d_scene_benchmark_watch_panel_init = external hidden unnamed_addr constant [141 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions = external hidden global [2 x %struct.arm_2d_region_list_item_t], align 16

; Function Attrs: nounwind uwtable
define dso_local noundef nonnull ptr @__arm_2d_scene_benchmark_watch_panel_init(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = icmp ne ptr %1, null
  br i1 %3, label %.preheader, label %4

4:                                                ; preds = %2
  %5 = tail call noalias dereferenceable_or_null(248) ptr @malloc(i64 noundef 248) #6
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %6, label %.preheader

6:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 356, ptr noundef nonnull @__PRETTY_FUNCTION__.__arm_2d_scene_benchmark_watch_panel_init) #7
  unreachable

.preheader:                                       ; preds = %2, %4
  %.036 = phi ptr [ %5, %4 ], [ %1, %2 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(248) %.036, i8 0, i64 248, i1 false)
  store ptr null, ptr getelementptr inbounds (i8, ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 32), align 16, !tbaa !5
  %7 = tail call i64 @arm_2d_helper_pfb_get_display_area(ptr noundef nonnull %0) #8
  %.sroa.018.0.extract.trunc = trunc i64 %7 to i32
  %.sroa.520.0.extract.shift = lshr i64 %7, 32
  %.sroa.520.0.extract.trunc = trunc i64 %.sroa.520.0.extract.shift to i16
  %8 = sext i16 %.sroa.520.0.extract.trunc to i32
  %9 = add nsw i32 %8, 130832
  %10 = lshr i32 %9, 1
  %11 = add i32 %10, %.sroa.018.0.extract.trunc
  %12 = trunc i32 %11 to i16
  %sh.diff = lshr i64 %7, 32
  %tr.sh.diff = trunc nuw i64 %sh.diff to i32
  %13 = ashr i32 %tr.sh.diff, 16
  %14 = add nsw i32 %13, 130832
  %15 = lshr i32 %14, 1
  %16 = lshr i32 %.sroa.018.0.extract.trunc, 16
  %17 = add nuw nsw i32 %15, %16
  %18 = trunc i32 %17 to i16
  store i16 %12, ptr getelementptr inbounds (i8, ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 16), align 16
  store i16 %18, ptr getelementptr inbounds (i8, ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 18), align 2, !tbaa !11
  store i16 240, ptr getelementptr inbounds (i8, ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 20), align 4
  store i16 240, ptr getelementptr inbounds (i8, ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 22), align 2, !tbaa !11
  %19 = tail call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #8
  %20 = add nsw i32 %13, 7
  %21 = sdiv i32 %20, 8
  %.tr = trunc nsw i32 %21 to i16
  %22 = shl i16 %.tr, 3
  %23 = add i16 %22, -16
  store i16 %23, ptr getelementptr inbounds (i8, ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 50), align 2, !tbaa !11
  %24 = tail call i16 @llvm.smin.i16(i16 %.sroa.520.0.extract.trunc, i16 240)
  store i16 %24, ptr getelementptr inbounds (i8, ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, i64 52), align 4, !tbaa !11
  %25 = zext i1 %3 to i8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %.036, i8 0, i64 40, i1 false)
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 40
  store ptr @__arm_2d_scene_benchmark_watch_panel_init.s_tDirtyRegions, ptr %.sroa.2.0..sroa_idx, align 8
  %.sroa.3.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 48
  store ptr @__pfb_draw_scene_benchmark_watch_panel_handler, ptr %.sroa.3.0..sroa_idx, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 56
  store ptr null, ptr %.sroa.4.0..sroa_idx, align 8
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 64
  store ptr @__after_scene_benchmark_watch_panel_switching, ptr %.sroa.42.0..sroa_idx, align 8
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 72
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.5.0..sroa_idx, i8 0, i64 16, i1 false)
  %.sroa.53.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 88
  store ptr @__on_scene_benchmark_watch_panel_frame_start, ptr %.sroa.53.0..sroa_idx, align 8
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 96
  store ptr @__on_scene_benchmark_watch_panel_frame_complete, ptr %.sroa.6.0..sroa_idx, align 8
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 104
  store ptr null, ptr %.sroa.7.0..sroa_idx, align 8
  %.sroa.74.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 112
  store ptr @__on_scene_benchmark_watch_panel_depose, ptr %.sroa.74.0..sroa_idx, align 8
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 120
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %.sroa.8.0..sroa_idx, i8 0, i64 120, i1 false)
  %.sroa.85.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 240
  store i8 %25, ptr %.sroa.85.0..sroa_idx, align 8, !tbaa !12
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %.036, i64 241
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %.sroa.9.0..sroa_idx, i8 0, i64 7, i1 false)
  %26 = tail call i64 @arm_2d_helper_pfb_get_display_area(ptr noundef nonnull %0) #8
  tail call void @benchmark_watch_panel_init(i64 %26) #8
  tail call void @arm_2d_scene_player_append_scenes(ptr noundef nonnull %0, ptr noundef nonnull %.036, i64 noundef 1) #8
  ret ptr %.036
}

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

declare i64 @arm_2d_helper_pfb_get_display_area(ptr noundef) local_unnamed_addr #4

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i32 @__pfb_draw_scene_benchmark_watch_panel_handler(ptr noundef, ptr noundef, i1 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare hidden void @__after_scene_benchmark_watch_panel_switching(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @__on_scene_benchmark_watch_panel_frame_start(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @__on_scene_benchmark_watch_panel_frame_complete(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @__on_scene_benchmark_watch_panel_depose(ptr noundef) #0

declare void @benchmark_watch_panel_init(i64) local_unnamed_addr #4

declare void @arm_2d_scene_player_append_scenes(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.smin.i16(i16, i16) #5

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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, !7, i64 0}
!6 = !{!"arm_2d_region_list_item_t", !7, i64 0, !8, i64 8, !10, i64 16, !8, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"arm_2d_region_t", !8, i64 0, !8, i64 4}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_Bool", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass