; LLVM IR from ARM-software/Arm-2D :: examples/common/benchmark (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_layer_t = type { ptr, %struct.arm_2d_region_t, i32, i8, i8, i16 }
%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.demo_gears_t = type { %struct.arm_2d_op_trans_msk_opa_t, ptr, ptr, float, float, %struct.arm_2d_location_t, ptr, ptr, i8, i8 }
%struct.arm_2d_op_trans_msk_opa_t = type { %struct.arm_2d_op_core_t, %struct.anon.13, %struct.anon.14, %union.anon.15, %struct.anon.17, %struct.anon.18, %struct.__arm_2d_transform_info_t, i8 }
%struct.arm_2d_op_core_t = type { [40 x i8], i64 }
%struct.anon.13 = type { ptr, ptr }
%struct.anon.14 = type { ptr }
%union.anon.15 = type { %struct.anon.16 }
%struct.anon.16 = type { i32 }
%struct.anon.17 = type { ptr, %struct.arm_2d_tile_t }
%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 }
%union.anon.12 = type { ptr }
%struct.anon.18 = type { ptr, ptr }
%struct.__arm_2d_transform_info_t = type { float, float, float, %struct.arm_2d_point_float_t, %union.anon.19, [40 x i8] }
%struct.arm_2d_point_float_t = type { float, float }
%union.anon.19 = type { i32 }

@s_ptRefreshLayers = external hidden global [1 x %struct.arm_2d_layer_t], align 16
@s_tGears = external hidden global [3 x %struct.demo_gears_t], align 16
@s_tStarOP = external hidden global %struct.arm_2d_op_trans_msk_opa_t, align 8

; Function Attrs: nounwind uwtable
define dso_local void @benchmark_watch_panel_init(i64 %0) #0 {
  %2 = alloca %struct.arm_2d_region_t, align 2
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca %struct.arm_2d_region_t, align 2
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca %struct.arm_2d_region_t, align 2
  %14 = alloca ptr, align 8
  %15 = alloca %struct.arm_2d_region_t, align 2
  %16 = alloca ptr, align 8
  %17 = alloca %struct.arm_2d_size_t, align 2
  %18 = alloca i16, align 2
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  store i64 %0, ptr %2, align 2
  call void @arm_extra_controls_init()
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store ptr @s_ptRefreshLayers, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store ptr null, ptr %4, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %74, %1
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.arm_2d_layer_t, ptr %25, i32 1
  store ptr %26, ptr %4, align 8, !tbaa !5
  %27 = icmp eq ptr %25, null
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %75

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store i64 1, ptr %6, align 8, !tbaa !9
  br label %30

30:                                               ; preds = %69, %29
  %31 = load i64, ptr %6, align 8, !tbaa !9
  %32 = icmp ugt i64 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  store i32 4, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %74

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.arm_2d_layer_t, ptr %35, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %7, ptr align 8 %36, i64 8, i1 false), !tbaa.struct !11
  %37 = getelementptr inbounds %struct.arm_2d_region_t, ptr %7, i32 0, i32 1
  %38 = getelementptr inbounds %struct.arm_2d_size_t, ptr %37, i32 0, i32 1
  %39 = load i16, ptr %38, align 2, !tbaa !12
  %40 = icmp ne i16 %39, 0
  br i1 %40, label %51, label %41

41:                                               ; preds = %34
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.arm_2d_layer_t, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  %45 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %44, i32 0, i32 1
  %46 = getelementptr inbounds %struct.arm_2d_region_t, ptr %45, i32 0, i32 1
  %47 = getelementptr inbounds %struct.arm_2d_size_t, ptr %46, i32 0, i32 1
  %48 = load i16, ptr %47, align 2, !tbaa !12
  %49 = getelementptr inbounds %struct.arm_2d_region_t, ptr %7, i32 0, i32 1
  %50 = getelementptr inbounds %struct.arm_2d_size_t, ptr %49, i32 0, i32 1
  store i16 %48, ptr %50, align 2, !tbaa !12
  br label %51

51:                                               ; preds = %41, %34
  %52 = getelementptr inbounds %struct.arm_2d_region_t, ptr %7, i32 0, i32 1
  %53 = getelementptr inbounds %struct.arm_2d_size_t, ptr %52, i32 0, i32 0
  %54 = load i16, ptr %53, align 2, !tbaa !12
  %55 = icmp ne i16 %54, 0
  br i1 %55, label %66, label %56

56:                                               ; preds = %51
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.arm_2d_layer_t, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !13
  %60 = getelementptr inbounds %struct.arm_2d_tile_t, ptr %59, i32 0, i32 1
  %61 = getelementptr inbounds %struct.arm_2d_region_t, ptr %60, i32 0, i32 1
  %62 = getelementptr inbounds %struct.arm_2d_size_t, ptr %61, i32 0, i32 0
  %63 = load i16, ptr %62, align 4, !tbaa !12
  %64 = getelementptr inbounds %struct.arm_2d_region_t, ptr %7, i32 0, i32 1
  %65 = getelementptr inbounds %struct.arm_2d_size_t, ptr %64, i32 0, i32 0
  store i16 %63, ptr %65, align 2, !tbaa !12
  br label %66

66:                                               ; preds = %56, %51
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.arm_2d_layer_t, ptr %67, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %68, ptr align 2 %7, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %69

69:                                               ; preds = %66
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.arm_2d_layer_t, ptr %70, i32 1
  store ptr %71, ptr %3, align 8, !tbaa !5
  %72 = load i64, ptr %6, align 8, !tbaa !9
  %73 = add i64 %72, -1
  store i64 %73, ptr %6, align 8, !tbaa !9
  br label %30, !llvm.loop !18

74:                                               ; preds = %33
  br label %24, !llvm.loop !20

75:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr @s_tGears, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %76, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %175, %75
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.demo_gears_t, ptr %78, i32 1
  store ptr %79, ptr %11, align 8, !tbaa !5
  %80 = icmp eq ptr %78, null
  br i1 %80, label %81, label %83

81:                                               ; preds = %77
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  br label %84

83:                                               ; preds = %77
  br label %84

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

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

88:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 3, ptr %12, align 8, !tbaa !9
  br label %89

89:                                               ; preds = %168, %88
  %90 = load i64, ptr %12, align 8, !tbaa !9
  %91 = icmp ugt i64 %90, 0
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %174

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %13, ptr align 2 %2, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store ptr null, ptr %14, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %166, %93
  %95 = load ptr, ptr %14, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.arm_2d_region_t, ptr %95, i32 1
  store ptr %96, ptr %14, align 8, !tbaa !5
  %97 = icmp eq ptr %95, null
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %167

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr null, ptr %16, align 8, !tbaa !5
  br label %100

100:                                              ; preds = %161, %99
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.arm_2d_region_t, ptr %101, i32 1
  store ptr %102, ptr %16, align 8, !tbaa !5
  %103 = icmp eq ptr %101, null
  br i1 %103, label %104, label %150

104:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.demo_gears_t, ptr %105, i32 0, i32 7
  %107 = load ptr, ptr %106, align 8, !tbaa !21
  %108 = getelementptr inbounds %struct.arm_2d_region_t, ptr %107, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %17, ptr align 2 %108, i64 4, i1 false), !tbaa.struct !34
  %109 = getelementptr inbounds %struct.arm_2d_size_t, ptr %17, i32 0, i32 0
  %110 = load i16, ptr %109, align 2, !tbaa !36
  %111 = getelementptr inbounds %struct.arm_2d_region_t, ptr %15, i32 0, i32 1
  %112 = getelementptr inbounds %struct.arm_2d_size_t, ptr %111, i32 0, i32 0
  store i16 %110, ptr %112, align 2, !tbaa !12
  %113 = getelementptr inbounds %struct.arm_2d_size_t, ptr %17, i32 0, i32 1
  %114 = load i16, ptr %113, align 2, !tbaa !38
  %115 = getelementptr inbounds %struct.arm_2d_region_t, ptr %15, i32 0, i32 1
  %116 = getelementptr inbounds %struct.arm_2d_size_t, ptr %115, i32 0, i32 1
  store i16 %114, ptr %116, align 2, !tbaa !12
  %117 = getelementptr inbounds %struct.arm_2d_region_t, ptr %15, i32 0, i32 0
  %118 = getelementptr inbounds %struct.arm_2d_region_t, ptr %13, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %117, ptr align 2 %118, i64 4, i1 false), !tbaa.struct !34
  %119 = getelementptr inbounds %struct.arm_2d_region_t, ptr %13, i32 0, i32 1
  %120 = getelementptr inbounds %struct.arm_2d_size_t, ptr %119, i32 0, i32 0
  %121 = load i16, ptr %120, align 2, !tbaa !12
  %122 = sext i16 %121 to i32
  %123 = getelementptr inbounds %struct.arm_2d_size_t, ptr %17, i32 0, i32 0
  %124 = load i16, ptr %123, align 2, !tbaa !36
  %125 = sext i16 %124 to i32
  %126 = sub nsw i32 %122, %125
  %127 = ashr i32 %126, 1
  %128 = getelementptr inbounds %struct.arm_2d_region_t, ptr %15, i32 0, i32 0
  %129 = getelementptr inbounds %struct.arm_2d_location_t, ptr %128, i32 0, i32 0
  %130 = load i16, ptr %129, align 2, !tbaa !12
  %131 = sext i16 %130 to i32
  %132 = add nsw i32 %131, %127
  %133 = trunc i32 %132 to i16
  store i16 %133, ptr %129, align 2, !tbaa !12
  %134 = getelementptr inbounds %struct.arm_2d_region_t, ptr %13, i32 0, i32 1
  %135 = getelementptr inbounds %struct.arm_2d_size_t, ptr %134, i32 0, i32 1
  %136 = load i16, ptr %135, align 2, !tbaa !12
  %137 = sext i16 %136 to i32
  %138 = getelementptr inbounds %struct.arm_2d_size_t, ptr %17, i32 0, i32 1
  %139 = load i16, ptr %138, align 2, !tbaa !38
  %140 = sext i16 %139 to i32
  %141 = sub nsw i32 %137, %140
  %142 = ashr i32 %141, 1
  %143 = getelementptr inbounds %struct.arm_2d_region_t, ptr %15, i32 0, i32 0
  %144 = getelementptr inbounds %struct.arm_2d_location_t, ptr %143, i32 0, i32 1
  %145 = load i16, ptr %144, align 2, !tbaa !12
  %146 = sext i16 %145 to i32
  %147 = add nsw i32 %146, %142
  %148 = trunc i32 %147 to i16
  store i16 %148, ptr %144, align 2, !tbaa !12
  store i16 %148, ptr %18, align 2, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %149 = load i16, ptr %18, align 2, !tbaa !35
  br label %151

150:                                              ; preds = %100
  br label %151

151:                                              ; preds = %150, %104
  %152 = phi i32 [ 1, %104 ], [ 0, %150 ]
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  store i32 15, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %166

155:                                              ; preds = %151
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.demo_gears_t, ptr %156, i32 0, i32 7
  %158 = load ptr, ptr %157, align 8, !tbaa !21
  %159 = getelementptr inbounds %struct.arm_2d_region_t, ptr %158, i32 0, i32 0
  %160 = getelementptr inbounds %struct.arm_2d_region_t, ptr %15, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %159, ptr align 2 %160, i64 4, i1 false), !tbaa.struct !34
  br label %161

161:                                              ; preds = %155
  %162 = call zeroext i1 @arm_2d_op_wait_async(ptr noundef null)
  %163 = zext i1 %162 to i8
  store i8 %163, ptr %19, align 1, !tbaa !39
  %164 = load i8, ptr %19, align 1, !tbaa !39, !range !40, !noundef !41
  %165 = trunc i8 %164 to i1
  br label %100, !llvm.loop !42

166:                                              ; preds = %154
  br label %94, !llvm.loop !43

167:                                              ; preds = %98
  br label %168

168:                                              ; preds = %167
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.demo_gears_t, ptr %169, i32 1
  store ptr %170, ptr %9, align 8, !tbaa !5
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %171, ptr %10, align 8, !tbaa !5
  %172 = load i64, ptr %12, align 8, !tbaa !9
  %173 = add i64 %172, -1
  store i64 %173, ptr %12, align 8, !tbaa !9
  br label %89, !llvm.loop !44

174:                                              ; preds = %92
  br label %175

175:                                              ; preds = %174
  br label %77, !llvm.loop !45

176:                                              ; preds = %87
  %177 = load ptr, ptr getelementptr inbounds (%struct.demo_gears_t, ptr @s_tGears, i32 0, i32 7), align 16, !tbaa !21
  %178 = getelementptr inbounds %struct.arm_2d_region_t, ptr %177, i32 0, i32 0
  %179 = getelementptr inbounds %struct.arm_2d_location_t, ptr %178, i32 0, i32 0
  %180 = load i16, ptr %179, align 2, !tbaa !12
  %181 = sext i16 %180 to i32
  %182 = add nsw i32 %181, 30
  %183 = trunc i32 %182 to i16
  store i16 %183, ptr %179, align 2, !tbaa !12
  %184 = load ptr, ptr getelementptr inbounds (%struct.demo_gears_t, ptr @s_tGears, i32 0, i32 7), align 16, !tbaa !21
  %185 = getelementptr inbounds %struct.arm_2d_region_t, ptr %184, i32 0, i32 0
  %186 = getelementptr inbounds %struct.arm_2d_location_t, ptr %185, i32 0, i32 1
  %187 = load i16, ptr %186, align 2, !tbaa !12
  %188 = sext i16 %187 to i32
  %189 = add nsw i32 %188, 30
  %190 = trunc i32 %189 to i16
  store i16 %190, ptr %186, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store ptr @s_tGears, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %191 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %191, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  store ptr null, ptr %22, align 8, !tbaa !5
  br label %192

192:                                              ; preds = %220, %176
  %193 = load ptr, ptr %22, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.demo_gears_t, ptr %193, i32 1
  store ptr %194, ptr %22, align 8, !tbaa !5
  %195 = icmp eq ptr %193, null
  br i1 %195, label %196, label %198

196:                                              ; preds = %192
  %197 = load ptr, ptr %20, align 8, !tbaa !5
  br label %199

198:                                              ; preds = %192
  br label %199

199:                                              ; preds = %198, %196
  %200 = phi i32 [ 1, %196 ], [ 0, %198 ]
  %201 = icmp ne i32 %200, 0
  br i1 %201, label %203, label %202

202:                                              ; preds = %199
  store i32 18, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %221

203:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  store i64 3, ptr %23, align 8, !tbaa !9
  br label %204

204:                                              ; preds = %213, %203
  %205 = load i64, ptr %23, align 8, !tbaa !9
  %206 = icmp ugt i64 %205, 0
  br i1 %206, label %208, label %207

207:                                              ; preds = %204
  store i32 21, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  br label %219

208:                                              ; preds = %204
  %209 = load ptr, ptr %21, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.demo_gears_t, ptr %209, i32 0, i32 0
  %211 = getelementptr inbounds %struct.arm_2d_op_trans_msk_opa_t, ptr %210, i32 0, i32 0
  %212 = call ptr @arm_2d_op_init(ptr noundef %211, i64 noundef 48)
  br label %213

213:                                              ; preds = %208
  %214 = load ptr, ptr %20, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.demo_gears_t, ptr %214, i32 1
  store ptr %215, ptr %20, align 8, !tbaa !5
  %216 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %216, ptr %21, align 8, !tbaa !5
  %217 = load i64, ptr %23, align 8, !tbaa !9
  %218 = add i64 %217, -1
  store i64 %218, ptr %23, align 8, !tbaa !9
  br label %204, !llvm.loop !46

219:                                              ; preds = %207
  br label %220

220:                                              ; preds = %219
  br label %192, !llvm.loop !47

221:                                              ; preds = %202
  %222 = call ptr @arm_2d_op_init(ptr noundef @s_tStarOP, i64 noundef 200)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  ret void
}

declare void @arm_extra_controls_init() #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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

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

declare zeroext i1 @arm_2d_op_wait_async(ptr noundef) #1

declare ptr @arm_2d_op_init(ptr noundef, i64 noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{i64 0, i64 4, !12, i64 4, i64 4, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"arm_2d_layer_t", !6, i64 0, !15, i64 8, !16, i64 16, !7, i64 20, !7, i64 21, !17, i64 22}
!15 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!16 = !{!"int", !7, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!22, !6, i64 240}
!22 = !{!"", !23, i64 0, !6, i64 200, !6, i64 208, !30, i64 216, !30, i64 220, !32, i64 224, !6, i64 232, !6, i64 240, !7, i64 248, !33, i64 249}
!23 = !{!"arm_2d_op_trans_msk_opa_t", !24, i64 0, !25, i64 48, !26, i64 64, !7, i64 72, !27, i64 80, !25, i64 112, !29, i64 128, !7, i64 192}
!24 = !{!"arm_2d_op_core_t", !7, i64 0, !10, i64 40}
!25 = !{!"", !6, i64 0, !6, i64 8}
!26 = !{!"", !6, i64 0}
!27 = !{!"", !6, i64 0, !28, i64 8}
!28 = !{!"arm_2d_tile_t", !7, i64 0, !7, i64 4, !7, i64 16}
!29 = !{!"__arm_2d_transform_info_t", !30, i64 0, !30, i64 4, !30, i64 8, !31, i64 12, !7, i64 20, !7, i64 24}
!30 = !{!"float", !7, i64 0}
!31 = !{!"arm_2d_point_float_t", !30, i64 0, !30, i64 4}
!32 = !{!"arm_2d_location_t", !17, i64 0, !17, i64 2}
!33 = !{!"_Bool", !7, i64 0}
!34 = !{i64 0, i64 2, !35, i64 2, i64 2, !35}
!35 = !{!17, !17, i64 0}
!36 = !{!37, !17, i64 0}
!37 = !{!"arm_2d_size_t", !17, i64 0, !17, i64 2}
!38 = !{!37, !17, i64 2}
!39 = !{!33, !33, i64 0}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = distinct !{!42, !19}
!43 = distinct !{!43, !19}
!44 = distinct !{!44, !19}
!45 = distinct !{!45, !19}
!46 = distinct !{!46, !19}
!47 = distinct !{!47, !19}


; 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_layer_t = type { ptr, %struct.arm_2d_region_t, i32, i8, i8, i16 }
%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.demo_gears_t = type { %struct.arm_2d_op_trans_msk_opa_t, ptr, ptr, float, float, %struct.arm_2d_location_t, ptr, ptr, i8, i8 }
%struct.arm_2d_op_trans_msk_opa_t = type { %struct.arm_2d_op_core_t, %struct.anon.13, %struct.anon.14, %union.anon.15, %struct.anon.17, %struct.anon.18, %struct.__arm_2d_transform_info_t, i8 }
%struct.arm_2d_op_core_t = type { [40 x i8], i64 }
%struct.anon.13 = type { ptr, ptr }
%struct.anon.14 = type { ptr }
%union.anon.15 = type { %struct.anon.16 }
%struct.anon.16 = type { i32 }
%struct.anon.17 = type { ptr, %struct.arm_2d_tile_t }
%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 }
%union.anon.12 = type { ptr }
%struct.anon.18 = type { ptr, ptr }
%struct.__arm_2d_transform_info_t = type { float, float, float, %struct.arm_2d_point_float_t, %union.anon.19, [40 x i8] }
%struct.arm_2d_point_float_t = type { float, float }
%union.anon.19 = type { i32 }

@s_ptRefreshLayers = external hidden local_unnamed_addr global [1 x %struct.arm_2d_layer_t], align 16
@s_tGears = external hidden global [3 x %struct.demo_gears_t], align 16
@s_tStarOP = external hidden global %struct.arm_2d_op_trans_msk_opa_t, align 8

; Function Attrs: nounwind uwtable
define dso_local void @benchmark_watch_panel_init(i64 %0) local_unnamed_addr #0 {
.preheader78:
  tail call void @arm_extra_controls_init() #2
  %.sroa.429.0.copyload = load i16, ptr getelementptr inbounds (i8, ptr @s_ptRefreshLayers, i64 12), align 4
  %.sroa.632.0.copyload = load i16, ptr getelementptr inbounds (i8, ptr @s_ptRefreshLayers, i64 14), align 2, !tbaa !5
  %.not66 = icmp eq i16 %.sroa.632.0.copyload, 0
  br i1 %.not66, label %1, label %5

1:                                                ; preds = %.preheader78
  %2 = load ptr, ptr @s_ptRefreshLayers, align 16, !tbaa !8
  %3 = getelementptr inbounds i8, ptr %2, i64 10
  %4 = load i16, ptr %3, align 2, !tbaa !5
  br label %5

5:                                                ; preds = %1, %.preheader78
  %.sroa.632.0 = phi i16 [ %.sroa.632.0.copyload, %.preheader78 ], [ %4, %1 ]
  %.not67 = icmp eq i16 %.sroa.429.0.copyload, 0
  br i1 %.not67, label %6, label %.loopexit79

6:                                                ; preds = %5
  %7 = load ptr, ptr @s_ptRefreshLayers, align 16, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  %9 = load i16, ptr %8, align 4, !tbaa !5
  br label %.loopexit79

.loopexit79:                                      ; preds = %6, %5
  %.sroa.429.0 = phi i16 [ %.sroa.429.0.copyload, %5 ], [ %9, %6 ]
  store i16 %.sroa.429.0, ptr getelementptr inbounds (i8, ptr @s_ptRefreshLayers, i64 12), align 4
  store i16 %.sroa.632.0, ptr getelementptr inbounds (i8, ptr @s_ptRefreshLayers, i64 14), align 2, !tbaa !5
  %.sroa.043.0.extract.trunc = trunc i64 %0 to i32
  %sh.diff = lshr i64 %0, 16
  %tr.sh.diff = trunc i64 %sh.diff to i32
  %10 = ashr i32 %tr.sh.diff, 16
  %sh.diff62 = lshr i64 %0, 32
  %tr.sh.diff63 = trunc nuw i64 %sh.diff62 to i32
  %11 = ashr i32 %tr.sh.diff63, 16
  %12 = lshr i32 %.sroa.043.0.extract.trunc, 16
  %13 = load ptr, ptr getelementptr inbounds (i8, ptr @s_tGears, i64 240), align 16, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %13, i64 4
  %.sroa.0.0.copyload = load i16, ptr %14, align 2, !tbaa !28
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 6
  %.sroa.5.0.copyload = load i16, ptr %.sroa.5.0..sroa_idx, align 2, !tbaa !28
  %15 = sext i16 %.sroa.0.0.copyload to i32
  %16 = sub nsw i32 %10, %15
  %17 = lshr i32 %16, 1
  %18 = add i32 %17, %.sroa.043.0.extract.trunc
  %19 = trunc i32 %18 to i16
  %20 = sext i16 %.sroa.5.0.copyload to i32
  %21 = sub nsw i32 %11, %20
  %22 = lshr i32 %21, 1
  %23 = add nuw i32 %22, %12
  %24 = trunc i32 %23 to i16
  store i16 %19, ptr %13, align 2, !tbaa !28
  %.sroa.6.0..sroa_idx14 = getelementptr inbounds i8, ptr %13, i64 2
  store i16 %24, ptr %.sroa.6.0..sroa_idx14, align 2, !tbaa !28
  %25 = tail call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #2
  %26 = load ptr, ptr getelementptr inbounds (i8, ptr @s_tGears, i64 496), align 16, !tbaa !14
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %.sroa.0.0.copyload.1 = load i16, ptr %27, align 2, !tbaa !28
  %.sroa.5.0..sroa_idx.1 = getelementptr inbounds i8, ptr %26, i64 6
  %.sroa.5.0.copyload.1 = load i16, ptr %.sroa.5.0..sroa_idx.1, align 2, !tbaa !28
  %28 = sext i16 %.sroa.0.0.copyload.1 to i32
  %29 = sub nsw i32 %10, %28
  %30 = lshr i32 %29, 1
  %31 = add i32 %30, %.sroa.043.0.extract.trunc
  %32 = trunc i32 %31 to i16
  %33 = sext i16 %.sroa.5.0.copyload.1 to i32
  %34 = sub nsw i32 %11, %33
  %35 = lshr i32 %34, 1
  %36 = add nuw i32 %35, %12
  %37 = trunc i32 %36 to i16
  store i16 %32, ptr %26, align 2, !tbaa !28
  %.sroa.6.0..sroa_idx14.1 = getelementptr inbounds i8, ptr %26, i64 2
  store i16 %37, ptr %.sroa.6.0..sroa_idx14.1, align 2, !tbaa !28
  %38 = tail call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #2
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @s_tGears, i64 752), align 16, !tbaa !14
  %40 = getelementptr inbounds i8, ptr %39, i64 4
  %.sroa.0.0.copyload.2 = load i16, ptr %40, align 2, !tbaa !28
  %.sroa.5.0..sroa_idx.2 = getelementptr inbounds i8, ptr %39, i64 6
  %.sroa.5.0.copyload.2 = load i16, ptr %.sroa.5.0..sroa_idx.2, align 2, !tbaa !28
  %41 = sext i16 %.sroa.0.0.copyload.2 to i32
  %42 = sub nsw i32 %10, %41
  %43 = lshr i32 %42, 1
  %44 = add i32 %43, %.sroa.043.0.extract.trunc
  %45 = trunc i32 %44 to i16
  %46 = sext i16 %.sroa.5.0.copyload.2 to i32
  %47 = sub nsw i32 %11, %46
  %48 = lshr i32 %47, 1
  %49 = add nuw i32 %48, %12
  %50 = trunc i32 %49 to i16
  store i16 %45, ptr %39, align 2, !tbaa !28
  %.sroa.6.0..sroa_idx14.2 = getelementptr inbounds i8, ptr %39, i64 2
  store i16 %50, ptr %.sroa.6.0..sroa_idx14.2, align 2, !tbaa !28
  %51 = tail call zeroext i1 @arm_2d_op_wait_async(ptr noundef null) #2
  %52 = load ptr, ptr getelementptr inbounds (i8, ptr @s_tGears, i64 240), align 16, !tbaa !14
  %53 = load i16, ptr %52, align 2, !tbaa !5
  %54 = add i16 %53, 30
  store i16 %54, ptr %52, align 2, !tbaa !5
  %55 = load ptr, ptr getelementptr inbounds (i8, ptr @s_tGears, i64 240), align 16, !tbaa !14
  %56 = getelementptr inbounds i8, ptr %55, i64 2
  %57 = load i16, ptr %56, align 2, !tbaa !5
  %58 = add i16 %57, 30
  store i16 %58, ptr %56, align 2, !tbaa !5
  %59 = tail call ptr @arm_2d_op_init(ptr noundef nonnull @s_tGears, i64 noundef 48) #2
  %60 = tail call ptr @arm_2d_op_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @s_tGears, i64 256), i64 noundef 48) #2
  %61 = tail call ptr @arm_2d_op_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @s_tGears, i64 512), i64 noundef 48) #2
  %62 = tail call ptr @arm_2d_op_init(ptr noundef nonnull @s_tStarOP, i64 noundef 200) #2
  ret void
}

declare void @arm_extra_controls_init() local_unnamed_addr #1

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

declare ptr @arm_2d_op_init(ptr noundef, 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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"arm_2d_layer_t", !10, i64 0, !11, i64 8, !12, i64 16, !6, i64 20, !6, i64 21, !13, i64 22}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"arm_2d_region_t", !6, i64 0, !6, i64 4}
!12 = !{!"int", !6, i64 0}
!13 = !{!"short", !6, i64 0}
!14 = !{!15, !10, i64 240}
!15 = !{!"", !16, i64 0, !10, i64 200, !10, i64 208, !24, i64 216, !24, i64 220, !26, i64 224, !10, i64 232, !10, i64 240, !6, i64 248, !27, i64 249}
!16 = !{!"arm_2d_op_trans_msk_opa_t", !17, i64 0, !19, i64 48, !20, i64 64, !6, i64 72, !21, i64 80, !19, i64 112, !23, i64 128, !6, i64 192}
!17 = !{!"arm_2d_op_core_t", !6, i64 0, !18, i64 40}
!18 = !{!"long", !6, i64 0}
!19 = !{!"", !10, i64 0, !10, i64 8}
!20 = !{!"", !10, i64 0}
!21 = !{!"", !10, i64 0, !22, i64 8}
!22 = !{!"arm_2d_tile_t", !6, i64 0, !6, i64 4, !6, i64 16}
!23 = !{!"__arm_2d_transform_info_t", !24, i64 0, !24, i64 4, !24, i64 8, !25, i64 12, !6, i64 20, !6, i64 24}
!24 = !{!"float", !6, i64 0}
!25 = !{!"arm_2d_point_float_t", !24, i64 0, !24, i64 4}
!26 = !{!"arm_2d_location_t", !13, i64 0, !13, i64 2}
!27 = !{!"_Bool", !6, i64 0}
!28 = !{!13, !13, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass