; LLVM IR from ARM-software/Arm-2D :: examples/common/controls//simple_list.ll_ (simple_list_on_frame_start)

; 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.__simple_list_t = type { %union.anon.13, %struct.anon.23, %struct.anon.26 }
%union.anon.13 = type { %struct.__arm_2d_list_core_t }
%struct.__arm_2d_list_core_t = type { %struct.anon.14, %struct.anon.16, %struct.anon.20 }
%struct.anon.14 = type { %struct.__arm_2d_list_core_cfg_t }
%struct.__arm_2d_list_core_cfg_t = type { %struct.arm_2d_size_t, ptr, %union.anon.15, ptr, ptr, ptr, i32, ptr, i16, i16, i16, i16, ptr }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.15 = type { ptr }
%struct.anon.16 = type { %struct.anon.17, [112 x i8] }
%struct.anon.17 = type { %struct.arm_2d_tile_t, %struct.arm_2d_tile_t, %struct.__arm_2d_list_work_area_t, i8, %union.anon.18 }
%struct.arm_2d_tile_t = type { %union.anon.1, %union.anon.11, %union.anon.12 }
%union.anon.1 = type { %struct.anon }
%struct.anon = type { i8, %union.arm_2d_color_info_t, %union.anon.4 }
%union.arm_2d_color_info_t = type { %struct.anon.2 }
%struct.anon.2 = type { i8 }
%union.anon.4 = type { i16 }
%union.anon.11 = type { %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 }
%union.anon.12 = type { ptr }
%struct.__arm_2d_list_work_area_t = type { ptr, %struct.arm_2d_region_t, %struct.arm_2d_list_item_param_t, i32 }
%struct.arm_2d_list_item_param_t = type { i8, i8, i16 }
%union.anon.18 = type { %struct.anon.19 }
%struct.anon.19 = type { i16 }
%struct.anon.20 = type { i8, i8, i16, i32, %union.anon.21 }
%union.anon.21 = type { %struct.anon.22 }
%struct.anon.22 = type { i16, i16, i16, i16 }
%struct.anon.23 = type { %struct.__simple_list_cfg_t }
%struct.__simple_list_cfg_t = type { i16, i8, i8, i8, %union.anon.24, %union.anon.25, %union.COLOUR_TYPE_T, %struct.arm_2d_size_t, %struct.arm_2d_size_t, i8, i8, i16, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr }
%union.anon.24 = type { %union.COLOUR_TYPE_T }
%union.anon.25 = type { %union.COLOUR_TYPE_T }
%union.COLOUR_TYPE_T = type { i32 }
%struct.anon.26 = type { %struct.arm_2d_list_item_t, i16, i8, i8, %struct.arm_2d_region_t, i64, [2 x %struct.arm_2d_helper_dirty_region_item_t] }
%struct.arm_2d_list_item_t = type { %struct.anon.27, i16, %union.anon.28, ptr, ptr, %struct.anon.30, %struct.arm_2d_margin_t, %struct.arm_2d_size_t, i64 }
%struct.anon.27 = type { ptr }
%union.anon.28 = type { i16 }
%struct.anon.30 = type { i8, i8 }
%struct.arm_2d_margin_t = type { i8, i8, i8, i8 }
%struct.arm_2d_helper_dirty_region_item_t = type { [48 x i8], %struct.arm_2d_region_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.39, [7 x i8], %struct.arm_2d_helper_dirty_region_t }
%union.arm_2d_colour_t = type { i32 }
%struct.anon.39 = type { i8 }
%struct.arm_2d_helper_dirty_region_t = type { [56 x i8], %struct.arm_2d_helper_dirty_region_item_t }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__.__simple_list_on_frame_start = external hidden unnamed_addr constant [53 x i8], align 1

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

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

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

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

9:                                                ; preds = %1
  br label %11

10:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 744, ptr noundef @__PRETTY_FUNCTION__.__simple_list_on_frame_start) #4
  unreachable

11:                                               ; preds = %9
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.__simple_list_t, ptr %12, i32 0, i32 1
  %14 = getelementptr inbounds %struct.anon.23, ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds %struct.__simple_list_cfg_t, ptr %14, i32 0, i32 1
  %16 = load i8, ptr %15, align 2
  %17 = lshr i8 %16, 1
  %18 = and i8 %17, 1
  %19 = icmp ne i8 %18, 0
  br i1 %19, label %20, label %50

20:                                               ; preds = %11
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.__simple_list_t, ptr %21, i32 0, i32 2
  %23 = getelementptr inbounds %struct.anon.26, ptr %22, i32 0, i32 2
  %24 = load i8, ptr %23, align 2
  %25 = and i8 %24, 1
  %26 = icmp ne i8 %25, 0
  br i1 %26, label %27, label %49

27:                                               ; preds = %20
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.__simple_list_t, ptr %28, i32 0, i32 2
  %30 = getelementptr inbounds %struct.anon.26, ptr %29, i32 0, i32 2
  %31 = load i8, ptr %30, align 2
  %32 = and i8 %31, -2
  %33 = or i8 %32, 0
  store i8 %33, ptr %30, align 2
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.__simple_list_t, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds %struct.anon.23, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %struct.__simple_list_cfg_t, ptr %36, i32 0, i32 19
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.arm_2d_scene_t, ptr %38, i32 0, i32 16
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.__simple_list_t, ptr %40, i32 0, i32 2
  %42 = getelementptr inbounds %struct.anon.26, ptr %41, i32 0, i32 6
  %43 = getelementptr inbounds [2 x %struct.arm_2d_helper_dirty_region_item_t], ptr %42, i64 0, i64 0
  call void @arm_2d_helper_dirty_region_add_items(ptr noundef %39, ptr noundef %43, i64 noundef 2)
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.__simple_list_t, ptr %44, i32 0, i32 2
  %46 = getelementptr inbounds %struct.anon.26, ptr %45, i32 0, i32 6
  %47 = getelementptr inbounds [2 x %struct.arm_2d_helper_dirty_region_item_t], ptr %46, i64 0, i64 0
  %48 = call zeroext i1 @arm_2d_helper_dirty_region_item_force_to_use_minimal_enclosure(ptr noundef %47, i1 noundef zeroext true)
  br label %49

49:                                               ; preds = %27, %20
  br label %50

50:                                               ; preds = %49, %11
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.__simple_list_t, ptr %51, i32 0, i32 0
  %53 = call zeroext i1 @__arm_2d_list_core_is_list_moving(ptr noundef %52)
  %54 = zext i1 %53 to i8
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.__simple_list_t, ptr %55, i32 0, i32 2
  %57 = getelementptr inbounds %struct.anon.26, ptr %56, i32 0, i32 2
  %58 = load i8, ptr %57, align 2
  %59 = and i8 %54, 1
  %60 = shl i8 %59, 4
  %61 = and i8 %58, -17
  %62 = or i8 %61, %60
  store i8 %62, ptr %57, align 2
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.__simple_list_t, ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds %struct.anon.23, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.__simple_list_cfg_t, ptr %65, i32 0, i32 1
  %67 = load i8, ptr %66, align 2
  %68 = lshr i8 %67, 5
  %69 = and i8 %68, 1
  %70 = icmp ne i8 %69, 0
  br i1 %70, label %71, label %183

71:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %72 = call i64 @arm_2d_helper_get_system_timestamp()
  store i64 %72, ptr %3, align 8, !tbaa !23
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.__simple_list_t, ptr %73, i32 0, i32 2
  %75 = getelementptr inbounds %struct.anon.26, ptr %74, i32 0, i32 2
  %76 = load i8, ptr %75, align 2
  %77 = lshr i8 %76, 4
  %78 = and i8 %77, 1
  %79 = icmp ne i8 %78, 0
  br i1 %79, label %80, label %94

80:                                               ; preds = %71
  %81 = load i64, ptr %3, align 8, !tbaa !23
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.__simple_list_t, ptr %82, i32 0, i32 2
  %84 = getelementptr inbounds %struct.anon.26, ptr %83, i32 0, i32 5
  store i64 %81, ptr %84, align 8, !tbaa !24
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.__simple_list_t, ptr %85, i32 0, i32 2
  %87 = getelementptr inbounds %struct.anon.26, ptr %86, i32 0, i32 3
  store i8 -1, ptr %87, align 1, !tbaa !25
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.__simple_list_t, ptr %88, i32 0, i32 2
  %90 = getelementptr inbounds %struct.anon.26, ptr %89, i32 0, i32 2
  %91 = load i8, ptr %90, align 2
  %92 = and i8 %91, -9
  %93 = or i8 %92, 8
  store i8 %93, ptr %90, align 2
  br label %182

94:                                               ; preds = %71
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.__simple_list_t, ptr %95, i32 0, i32 1
  %97 = getelementptr inbounds %struct.anon.23, ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds %struct.__simple_list_cfg_t, ptr %97, i32 0, i32 2
  %99 = load i8, ptr %98, align 1, !tbaa !26
  %100 = zext i8 %99 to i32
  %101 = icmp sgt i32 %100, 0
  br i1 %101, label %102, label %181

102:                                              ; preds = %94
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.__simple_list_t, ptr %103, i32 0, i32 2
  %105 = getelementptr inbounds %struct.anon.26, ptr %104, i32 0, i32 3
  %106 = load i8, ptr %105, align 1, !tbaa !25
  %107 = zext i8 %106 to i32
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %109, label %181

109:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.__simple_list_t, ptr %110, i32 0, i32 1
  %112 = getelementptr inbounds %struct.anon.23, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.__simple_list_cfg_t, ptr %112, i32 0, i32 2
  %114 = load i8, ptr %113, align 1, !tbaa !26
  %115 = zext i8 %114 to i64
  %116 = mul i64 %115, 100
  %117 = trunc i64 %116 to i32
  store i32 %117, ptr %4, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %118 = load i64, ptr %3, align 8, !tbaa !23
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.__simple_list_t, ptr %119, i32 0, i32 2
  %121 = getelementptr inbounds %struct.anon.26, ptr %120, i32 0, i32 5
  %122 = load i64, ptr %121, align 8, !tbaa !24
  %123 = sub nsw i64 %118, %122
  %124 = call i64 @arm_2d_helper_convert_ticks_to_ms(i64 noundef %123)
  %125 = trunc i64 %124 to i32
  store i32 %125, ptr %5, align 4, !tbaa !27
  %126 = load i32, ptr %5, align 4, !tbaa !27
  %127 = load i32, ptr %4, align 4, !tbaa !27
  %128 = icmp sgt i32 %126, %127
  br i1 %128, label %129, label %180

129:                                              ; preds = %109
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.__simple_list_t, ptr %130, i32 0, i32 1
  %132 = getelementptr inbounds %struct.anon.23, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds %struct.__simple_list_cfg_t, ptr %132, i32 0, i32 1
  %134 = load i8, ptr %133, align 2
  %135 = lshr i8 %134, 4
  %136 = and i8 %135, 1
  %137 = icmp ne i8 %136, 0
  br i1 %137, label %138, label %148

138:                                              ; preds = %129
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.__simple_list_t, ptr %139, i32 0, i32 2
  %141 = getelementptr inbounds %struct.anon.26, ptr %140, i32 0, i32 3
  store i8 0, ptr %141, align 1, !tbaa !25
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.__simple_list_t, ptr %142, i32 0, i32 2
  %144 = getelementptr inbounds %struct.anon.26, ptr %143, i32 0, i32 2
  %145 = load i8, ptr %144, align 2
  %146 = and i8 %145, -9
  %147 = or i8 %146, 8
  store i8 %147, ptr %144, align 2
  br label %179

148:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %149 = load i32, ptr %5, align 4, !tbaa !27
  %150 = load i32, ptr %4, align 4, !tbaa !27
  %151 = sub nsw i32 %149, %150
  %152 = ashr i32 %151, 1
  %153 = sub nsw i32 255, %152
  store i32 %153, ptr %6, align 4, !tbaa !27
  %154 = load i32, ptr %6, align 4, !tbaa !27
  %155 = icmp sgt i32 %154, 0
  br i1 %155, label %156, label %168

156:                                              ; preds = %148
  %157 = load i32, ptr %6, align 4, !tbaa !27
  %158 = trunc i32 %157 to i8
  %159 = load ptr, ptr %2, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.__simple_list_t, ptr %159, i32 0, i32 2
  %161 = getelementptr inbounds %struct.anon.26, ptr %160, i32 0, i32 3
  store i8 %158, ptr %161, align 1, !tbaa !25
  %162 = load ptr, ptr %2, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.__simple_list_t, ptr %162, i32 0, i32 2
  %164 = getelementptr inbounds %struct.anon.26, ptr %163, i32 0, i32 2
  %165 = load i8, ptr %164, align 2
  %166 = and i8 %165, -9
  %167 = or i8 %166, 8
  store i8 %167, ptr %164, align 2
  br label %178

168:                                              ; preds = %148
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.__simple_list_t, ptr %169, i32 0, i32 2
  %171 = getelementptr inbounds %struct.anon.26, ptr %170, i32 0, i32 3
  store i8 0, ptr %171, align 1, !tbaa !25
  %172 = load ptr, ptr %2, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.__simple_list_t, ptr %172, i32 0, i32 2
  %174 = getelementptr inbounds %struct.anon.26, ptr %173, i32 0, i32 2
  %175 = load i8, ptr %174, align 2
  %176 = and i8 %175, -9
  %177 = or i8 %176, 8
  store i8 %177, ptr %174, align 2
  br label %178

178:                                              ; preds = %168, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %179

179:                                              ; preds = %178, %138
  br label %180

180:                                              ; preds = %179, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %181

181:                                              ; preds = %180, %102, %94
  br label %182

182:                                              ; preds = %181, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %183

183:                                              ; preds = %182, %50
  ret void
}

declare void @arm_2d_helper_dirty_region_add_items(ptr noundef, ptr noundef, i64 noundef) #3

declare zeroext i1 @arm_2d_helper_dirty_region_item_force_to_use_minimal_enclosure(ptr noundef, i1 noundef zeroext) #3

declare zeroext i1 @__arm_2d_list_core_is_list_moving(ptr noundef) #3

declare i64 @arm_2d_helper_get_system_timestamp() #3

declare i64 @arm_2d_helper_convert_ticks_to_ms(i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { "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 = { noreturn nounwind }
attributes #5 = { 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, !6, i64 376}
!10 = !{!"__simple_list_t", !7, i64 0, !11, i64 288, !16, i64 384}
!11 = !{!"", !12, i64 0}
!12 = !{!"__simple_list_cfg_t", !13, i64 0, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !14, i64 20, !14, i64 24, !7, i64 28, !7, i64 29, !13, i64 30, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !15, i64 72, !6, i64 80, !6, i64 88}
!13 = !{!"short", !7, i64 0}
!14 = !{!"arm_2d_size_t", !13, i64 0, !13, i64 2}
!15 = !{!"int", !7, i64 0}
!16 = !{!"", !17, i64 0, !13, i64 56, !7, i64 58, !7, i64 58, !7, i64 58, !7, i64 58, !7, i64 58, !7, i64 59, !22, i64 60, !21, i64 72, !7, i64 80}
!17 = !{!"arm_2d_list_item_t", !18, i64 0, !13, i64 8, !7, i64 10, !6, i64 16, !6, i64 24, !19, i64 32, !20, i64 34, !14, i64 38, !21, i64 48}
!18 = !{!"", !6, i64 0}
!19 = !{!"", !7, i64 0, !7, i64 1}
!20 = !{!"arm_2d_margin_t", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!21 = !{!"long", !7, i64 0}
!22 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!23 = !{!21, !21, i64 0}
!24 = !{!10, !21, i64 456}
!25 = !{!10, !7, i64 443}
!26 = !{!10, !7, i64 291}
!27 = !{!15, !15, i64 0}


; 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
define dso_local void @__simple_list_on_frame_start(ptr noundef nonnull %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 290
  %3 = load i8, ptr %2, align 2
  %4 = and i8 %3, 2
  %.not = icmp eq i8 %4, 0
  br i1 %.not, label %16, label %5

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

9:                                                ; preds = %5
  %10 = and i8 %7, -2
  store i8 %10, ptr %6, align 2
  %11 = getelementptr inbounds i8, ptr %0, i64 376
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 128
  %14 = getelementptr inbounds i8, ptr %0, i64 464
  tail call void @arm_2d_helper_dirty_region_add_items(ptr noundef nonnull %13, ptr noundef nonnull %14, i64 noundef 2) #2
  %15 = tail call zeroext i1 @arm_2d_helper_dirty_region_item_force_to_use_minimal_enclosure(ptr noundef nonnull %14, i1 noundef zeroext true) #2
  br label %16

16:                                               ; preds = %5, %9, %1
  %17 = tail call zeroext i1 @__arm_2d_list_core_is_list_moving(ptr noundef nonnull %0) #2
  %18 = getelementptr inbounds i8, ptr %0, i64 442
  %19 = load i8, ptr %18, align 2
  %20 = select i1 %17, i8 16, i8 0
  %21 = and i8 %19, -17
  %22 = or disjoint i8 %21, %20
  store i8 %22, ptr %18, align 2
  %23 = load i8, ptr %2, align 2
  %24 = and i8 %23, 32
  %.not35 = icmp eq i8 %24, 0
  br i1 %.not35, label %59, label %25

25:                                               ; preds = %16
  %26 = tail call i64 @arm_2d_helper_get_system_timestamp() #2
  %27 = load i8, ptr %18, align 2
  %28 = and i8 %27, 16
  %.not36 = icmp eq i8 %28, 0
  br i1 %.not36, label %32, label %29

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %0, i64 456
  store i64 %26, ptr %30, align 8, !tbaa !22
  %31 = getelementptr inbounds i8, ptr %0, i64 443
  store i8 -1, ptr %31, align 1, !tbaa !23
  br label %.sink.split

32:                                               ; preds = %25
  %33 = getelementptr inbounds i8, ptr %0, i64 291
  %34 = load i8, ptr %33, align 1, !tbaa !24
  %.not37 = icmp eq i8 %34, 0
  br i1 %.not37, label %59, label %35

35:                                               ; preds = %32
  %36 = getelementptr inbounds i8, ptr %0, i64 443
  %37 = load i8, ptr %36, align 1, !tbaa !23
  %.not38 = icmp eq i8 %37, 0
  br i1 %.not38, label %59, label %38

38:                                               ; preds = %35
  %39 = zext i8 %34 to i32
  %40 = mul nuw nsw i32 %39, 100
  %41 = getelementptr inbounds i8, ptr %0, i64 456
  %42 = load i64, ptr %41, align 8, !tbaa !22
  %43 = sub nsw i64 %26, %42
  %44 = tail call i64 @arm_2d_helper_convert_ticks_to_ms(i64 noundef %43) #2
  %45 = trunc i64 %44 to i32
  %46 = icmp slt i32 %40, %45
  br i1 %46, label %47, label %59

47:                                               ; preds = %38
  %48 = load i8, ptr %2, align 2
  %49 = and i8 %48, 16
  %.not39 = icmp eq i8 %49, 0
  br i1 %.not39, label %52, label %50

50:                                               ; preds = %47
  store i8 0, ptr %36, align 1, !tbaa !23
  %51 = load i8, ptr %18, align 2
  br label %.sink.split

52:                                               ; preds = %47
  %53 = sub nsw i32 %45, %40
  %54 = ashr i32 %53, 1
  %55 = icmp slt i32 %54, 255
  %56 = trunc i32 %54 to i8
  %57 = xor i8 %56, -1
  %.sink = select i1 %55, i8 %57, i8 0
  %storemerge.in = load i8, ptr %18, align 2
  store i8 %.sink, ptr %36, align 1
  br label %.sink.split

.sink.split:                                      ; preds = %52, %50, %29
  %.sink41 = phi i8 [ %27, %29 ], [ %51, %50 ], [ %storemerge.in, %52 ]
  %58 = or i8 %.sink41, 8
  store i8 %58, ptr %18, align 2
  br label %59

59:                                               ; preds = %.sink.split, %35, %32, %38, %16
  ret void
}

declare void @arm_2d_helper_dirty_region_add_items(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare zeroext i1 @arm_2d_helper_dirty_region_item_force_to_use_minimal_enclosure(ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

declare zeroext i1 @__arm_2d_list_core_is_list_moving(ptr noundef) local_unnamed_addr #1

declare i64 @arm_2d_helper_get_system_timestamp() local_unnamed_addr #1

declare i64 @arm_2d_helper_convert_ticks_to_ms(i64 noundef) local_unnamed_addr #1

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 = { "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 = { 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, !13, i64 376}
!6 = !{!"__simple_list_t", !7, i64 0, !9, i64 288, !15, i64 384}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"", !10, i64 0}
!10 = !{!"__simple_list_cfg_t", !11, i64 0, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !12, i64 20, !12, i64 24, !7, i64 28, !7, i64 29, !11, i64 30, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !14, i64 72, !13, i64 80, !13, i64 88}
!11 = !{!"short", !7, i64 0}
!12 = !{!"arm_2d_size_t", !11, i64 0, !11, i64 2}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"", !16, i64 0, !11, i64 56, !7, i64 58, !7, i64 58, !7, i64 58, !7, i64 58, !7, i64 58, !7, i64 59, !21, i64 60, !20, i64 72, !7, i64 80}
!16 = !{!"arm_2d_list_item_t", !17, i64 0, !11, i64 8, !7, i64 10, !13, i64 16, !13, i64 24, !18, i64 32, !19, i64 34, !12, i64 38, !20, i64 48}
!17 = !{!"", !13, i64 0}
!18 = !{!"", !7, i64 0, !7, i64 1}
!19 = !{!"arm_2d_margin_t", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!20 = !{!"long", !7, i64 0}
!21 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!22 = !{!6, !20, i64 456}
!23 = !{!6, !7, i64 443}
!24 = !{!6, !7, i64 291}


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