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

; 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_tile_t = type { %union.anon.6, %union.anon.17, %union.anon.18 }
%union.anon.6 = type { %struct.anon.7 }
%struct.anon.7 = type { i8, %union.arm_2d_color_info_t, %union.anon.10 }
%union.arm_2d_color_info_t = type { %struct.anon.8 }
%struct.anon.8 = type { i8 }
%union.anon.10 = type { i16 }
%union.anon.17 = 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 }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.18 = type { ptr }
%struct.dynamic_nebula_cfg_t = type { i16, i16, i16, i16, i16, i16, float, ptr, %struct.dynamic_nebula_on_draw_particle_evt_t }
%struct.dynamic_nebula_on_draw_particle_evt_t = type { ptr, ptr }
%struct.cloudy_glass_t = type { %struct.anon }
%struct.anon = type { %struct.cloudy_glass_cfg_t, [1 x i64], %struct.arm_2d_helper_dirty_region_item_t, %struct.arm_2d_filter_iir_blur_descriptor_t, %struct.dynamic_nebula_t }
%struct.cloudy_glass_cfg_t = type { ptr, %struct.arm_2d_size_t, i16, float, ptr, i16, i16, i8 }
%struct.arm_2d_helper_dirty_region_item_t = type { [48 x i8], %struct.arm_2d_region_t }
%struct.arm_2d_filter_iir_blur_descriptor_t = type { [72 x i8], %struct.arm_2d_scratch_mem_t }
%struct.arm_2d_scratch_mem_t = type { %union.anon.1, i64 }
%union.anon.1 = type { %union.anon.2 }
%union.anon.2 = type { %struct.anon.3 }
%struct.anon.3 = type { i32 }
%struct.dynamic_nebula_t = type { [56 x i8], ptr }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@__PRETTY_FUNCTION__.cloudy_glass_init = external hidden unnamed_addr constant [63 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@c_tileRadialGradientMask = external constant %struct.arm_2d_tile_t, align 8

; Function Attrs: nounwind uwtable
define dso_local void @cloudy_glass_init(ptr noundef nonnull %0, ptr noundef nonnull %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.arm_2d_size_t, align 2
  %6 = alloca i16, align 2
  %7 = alloca %struct.dynamic_nebula_cfg_t, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = icmp ne ptr null, %8
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %12

11:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 85, ptr noundef @__PRETTY_FUNCTION__.cloudy_glass_init) #6
  unreachable

12:                                               ; preds = %10
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 256, i1 false)
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.cloudy_glass_t, ptr %14, i32 0, i32 0
  %16 = getelementptr inbounds %struct.anon, ptr %15, i32 0, i32 0
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %17, i64 40, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.cloudy_glass_t, ptr %18, i32 0, i32 0
  %20 = getelementptr inbounds %struct.anon, ptr %19, i32 0, i32 0
  %21 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %20, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %5, ptr align 8 %21, i64 4, i1 false), !tbaa.struct !16
  %22 = getelementptr inbounds %struct.arm_2d_size_t, ptr %5, i32 0, i32 1
  %23 = load i16, ptr %22, align 2, !tbaa !17
  %24 = sext i16 %23 to i32
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %12
  br label %28

27:                                               ; preds = %12
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 90, ptr noundef @__PRETTY_FUNCTION__.cloudy_glass_init) #6
  unreachable

28:                                               ; preds = %26
  %29 = getelementptr inbounds %struct.arm_2d_size_t, ptr %5, i32 0, i32 0
  %30 = load i16, ptr %29, align 2, !tbaa !19
  %31 = sext i16 %30 to i32
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %28
  br label %35

34:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 91, ptr noundef @__PRETTY_FUNCTION__.cloudy_glass_init) #6
  unreachable

35:                                               ; preds = %33
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.cloudy_glass_t, ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds %struct.anon, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %38, i32 0, i32 5
  %40 = load i16, ptr %39, align 8, !tbaa !20
  %41 = zext i16 %40 to i32
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %35
  br label %45

44:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 93, ptr noundef @__PRETTY_FUNCTION__.cloudy_glass_init) #6
  unreachable

45:                                               ; preds = %43
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.cloudy_glass_t, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %struct.anon, ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %48, i32 0, i32 4
  %50 = load ptr, ptr %49, align 8, !tbaa !30
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %45
  br label %54

53:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 94, ptr noundef @__PRETTY_FUNCTION__.cloudy_glass_init) #6
  unreachable

54:                                               ; preds = %52
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.cloudy_glass_t, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %struct.anon, ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %57, i32 0, i32 3
  %59 = load float, ptr %58, align 8, !tbaa !31
  %60 = fcmp oeq float %59, 0.000000e+00
  br i1 %60, label %61, label %66

61:                                               ; preds = %54
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.cloudy_glass_t, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.anon, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %64, i32 0, i32 3
  store float 0x3FD3333340000000, ptr %65, align 8, !tbaa !31
  br label %66

66:                                               ; preds = %61, %54
  br label %67

67:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #7
  %68 = getelementptr inbounds %struct.arm_2d_size_t, ptr %5, i32 0, i32 1
  %69 = load i16, ptr %68, align 2, !tbaa !17
  %70 = sext i16 %69 to i32
  %71 = getelementptr inbounds %struct.arm_2d_size_t, ptr %5, i32 0, i32 0
  %72 = load i16, ptr %71, align 2, !tbaa !19
  %73 = sext i16 %72 to i32
  %74 = icmp slt i32 %70, %73
  br i1 %74, label %75, label %79

75:                                               ; preds = %67
  %76 = getelementptr inbounds %struct.arm_2d_size_t, ptr %5, i32 0, i32 1
  %77 = load i16, ptr %76, align 2, !tbaa !17
  %78 = sext i16 %77 to i32
  br label %83

79:                                               ; preds = %67
  %80 = getelementptr inbounds %struct.arm_2d_size_t, ptr %5, i32 0, i32 0
  %81 = load i16, ptr %80, align 2, !tbaa !19
  %82 = sext i16 %81 to i32
  br label %83

83:                                               ; preds = %79, %75
  %84 = phi i32 [ %78, %75 ], [ %82, %79 ]
  %85 = sdiv i32 %84, 2
  %86 = trunc i32 %85 to i16
  store i16 %86, ptr %6, align 2, !tbaa !10
  %87 = load i16, ptr getelementptr inbounds (%struct.arm_2d_region_t, ptr getelementptr inbounds (%struct.arm_2d_tile_t, ptr @c_tileRadialGradientMask, i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !32
  %88 = sext i16 %87 to i32
  %89 = ashr i32 %88, 1
  %90 = load i16, ptr %6, align 2, !tbaa !10
  %91 = sext i16 %90 to i32
  %92 = sub nsw i32 %91, %89
  %93 = trunc i32 %92 to i16
  store i16 %93, ptr %6, align 2, !tbaa !10
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.cloudy_glass_t, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.anon, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %96, i32 0, i32 2
  %98 = load i16, ptr %97, align 4, !tbaa !33
  %99 = sext i16 %98 to i32
  %100 = icmp sle i32 %99, 0
  br i1 %100, label %101, label %107

101:                                              ; preds = %83
  %102 = load i16, ptr %6, align 2, !tbaa !10
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.cloudy_glass_t, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds %struct.anon, ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %105, i32 0, i32 2
  store i16 %102, ptr %106, align 4, !tbaa !33
  br label %107

107:                                              ; preds = %101, %83
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #7
  %108 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 0
  %109 = load i16, ptr %6, align 2, !tbaa !10
  store i16 %109, ptr %108, align 8, !tbaa !34
  %110 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 1
  %111 = load i16, ptr %6, align 2, !tbaa !10
  store i16 %111, ptr %110, align 2, !tbaa !37
  %112 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 2
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.cloudy_glass_t, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.anon, ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %115, i32 0, i32 5
  %117 = load i16, ptr %116, align 8, !tbaa !20
  store i16 %117, ptr %112, align 4, !tbaa !38
  %118 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 3
  %119 = load i16, ptr %118, align 2
  %120 = and i16 %119, -2
  %121 = or i16 %120, 0
  store i16 %121, ptr %118, align 2
  %122 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 3
  %123 = load i16, ptr %122, align 2
  %124 = and i16 %123, 255
  %125 = or i16 %124, 0
  store i16 %125, ptr %122, align 2
  %126 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 4
  store i16 0, ptr %126, align 8, !tbaa !39
  %127 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 5
  store i16 0, ptr %127, align 2, !tbaa !40
  %128 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 6
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.cloudy_glass_t, ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds %struct.anon, ptr %130, i32 0, i32 0
  %132 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %131, i32 0, i32 3
  %133 = load float, ptr %132, align 8, !tbaa !31
  store float %133, ptr %128, align 4, !tbaa !41
  %134 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 7
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.cloudy_glass_t, ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds %struct.anon, ptr %136, i32 0, i32 0
  %138 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %137, i32 0, i32 4
  %139 = load ptr, ptr %138, align 8, !tbaa !30
  store ptr %139, ptr %134, align 8, !tbaa !42
  %140 = getelementptr inbounds %struct.dynamic_nebula_cfg_t, ptr %7, i32 0, i32 8
  %141 = getelementptr inbounds %struct.dynamic_nebula_on_draw_particle_evt_t, ptr %140, i32 0, i32 0
  store ptr @__draw_bubble_handler, ptr %141, align 8, !tbaa !43
  %142 = getelementptr inbounds %struct.dynamic_nebula_on_draw_particle_evt_t, ptr %140, i32 0, i32 1
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %143, ptr %142, align 8, !tbaa !44
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.cloudy_glass_t, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.anon, ptr %145, i32 0, i32 4
  call void @dynamic_nebula_init(ptr noundef %146, ptr noundef %7)
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #7
  br label %147

147:                                              ; preds = %107
  br label %148

148:                                              ; preds = %147
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.cloudy_glass_t, ptr %149, i32 0, i32 0
  %151 = getelementptr inbounds %struct.anon, ptr %150, i32 0, i32 0
  %152 = getelementptr inbounds %struct.cloudy_glass_cfg_t, ptr %151, i32 0, i32 7
  %153 = load i8, ptr %152, align 4, !tbaa !45, !range !46, !noundef !47
  %154 = trunc i8 %153 to i1
  br i1 %154, label %155, label %160

155:                                              ; preds = %148
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.cloudy_glass_t, ptr %156, i32 0, i32 0
  %158 = getelementptr inbounds %struct.anon, ptr %157, i32 0, i32 3
  %159 = call ptr @arm_2d_op_init(ptr noundef %158, i64 noundef 88)
  br label %160

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #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

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

; Function Attrs: nounwind uwtable
declare hidden void @__draw_bubble_handler(ptr noundef, ptr noundef, ptr noundef, i32, i8 noundef zeroext, i16 noundef signext) #0

declare void @dynamic_nebula_init(ptr noundef, ptr noundef) #5

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

declare ptr @arm_2d_op_init(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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{i64 0, i64 8, !5, i64 8, i64 2, !10, i64 10, i64 2, !10, i64 12, i64 2, !10, i64 16, i64 4, !12, i64 24, i64 8, !5, i64 32, i64 2, !10, i64 34, i64 2, !10, i64 36, i64 1, !14}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{i64 0, i64 2, !10, i64 2, i64 2, !10}
!17 = !{!18, !11, i64 2}
!18 = !{!"arm_2d_size_t", !11, i64 0, !11, i64 2}
!19 = !{!18, !11, i64 0}
!20 = !{!21, !11, i64 32}
!21 = !{!"cloudy_glass_t", !22, i64 0}
!22 = !{!"", !23, i64 0, !7, i64 40, !24, i64 48, !26, i64 104, !29, i64 192}
!23 = !{!"cloudy_glass_cfg_t", !6, i64 0, !18, i64 8, !11, i64 12, !13, i64 16, !6, i64 24, !11, i64 32, !11, i64 34, !15, i64 36}
!24 = !{!"arm_2d_helper_dirty_region_item_t", !7, i64 0, !25, i64 48}
!25 = !{!"arm_2d_region_t", !7, i64 0, !7, i64 4}
!26 = !{!"arm_2d_filter_iir_blur_descriptor_t", !7, i64 0, !27, i64 72}
!27 = !{!"arm_2d_scratch_mem_t", !7, i64 0, !28, i64 8}
!28 = !{!"long", !7, i64 0}
!29 = !{!"dynamic_nebula_t", !7, i64 0, !6, i64 56}
!30 = !{!21, !6, i64 24}
!31 = !{!21, !13, i64 16}
!32 = !{!7, !7, i64 0}
!33 = !{!21, !11, i64 12}
!34 = !{!35, !11, i64 0}
!35 = !{!"dynamic_nebula_cfg_t", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !11, i64 7, !11, i64 8, !11, i64 10, !13, i64 12, !6, i64 16, !36, i64 24}
!36 = !{!"dynamic_nebula_on_draw_particle_evt_t", !6, i64 0, !6, i64 8}
!37 = !{!35, !11, i64 2}
!38 = !{!35, !11, i64 4}
!39 = !{!35, !11, i64 8}
!40 = !{!35, !11, i64 10}
!41 = !{!35, !13, i64 12}
!42 = !{!35, !6, i64 16}
!43 = !{!36, !6, i64 0}
!44 = !{!36, !6, i64 8}
!45 = !{!21, !15, i64 36}
!46 = !{i8 0, i8 2}
!47 = !{}


; 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_tile_t = type { %union.anon.6, %union.anon.17, %union.anon.18 }
%union.anon.6 = type { %struct.anon.7 }
%struct.anon.7 = type { i8, %union.arm_2d_color_info_t, %union.anon.10 }
%union.arm_2d_color_info_t = type { %struct.anon.8 }
%struct.anon.8 = type { i8 }
%union.anon.10 = type { i16 }
%union.anon.17 = 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 }
%struct.arm_2d_size_t = type { i16, i16 }
%union.anon.18 = type { ptr }
%struct.dynamic_nebula_cfg_t = type { i16, i16, i16, i16, i16, i16, float, ptr, %struct.dynamic_nebula_on_draw_particle_evt_t }
%struct.dynamic_nebula_on_draw_particle_evt_t = type { ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@__PRETTY_FUNCTION__.cloudy_glass_init = external hidden unnamed_addr constant [63 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@c_tileRadialGradientMask = external local_unnamed_addr constant %struct.arm_2d_tile_t, align 8

; Function Attrs: nounwind uwtable
define dso_local void @cloudy_glass_init(ptr noundef nonnull %0, ptr nocapture noundef nonnull readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.dynamic_nebula_cfg_t, align 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(256) %0, i8 0, i64 256, i1 false)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %1, i64 40, i1 false), !tbaa.struct !5
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 10
  %.sroa.6.0.copyload = load i16, ptr %.sroa.6.0..sroa_idx, align 2, !tbaa !10
  %4 = icmp sgt i16 %.sroa.6.0.copyload, 0
  br i1 %4, label %6, label %5

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

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.0.0.copyload = load i16, ptr %7, align 8, !tbaa !10
  %8 = icmp sgt i16 %.sroa.0.0.copyload, 0
  br i1 %8, label %10, label %9

9:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 91, ptr noundef nonnull @__PRETTY_FUNCTION__.cloudy_glass_init) #7
  unreachable

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = load i16, ptr %11, align 8, !tbaa !16
  %.not = icmp eq i16 %12, 0
  br i1 %.not, label %13, label %14

13:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 93, ptr noundef nonnull @__PRETTY_FUNCTION__.cloudy_glass_init) #7
  unreachable

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  %16 = load ptr, ptr %15, align 8, !tbaa !27
  %.not26 = icmp eq ptr %16, null
  br i1 %.not26, label %17, label %18

17:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 94, ptr noundef nonnull @__PRETTY_FUNCTION__.cloudy_glass_init) #7
  unreachable

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %20 = load float, ptr %19, align 8, !tbaa !28
  %21 = fcmp oeq float %20, 0.000000e+00
  br i1 %21, label %22, label %23

22:                                               ; preds = %18
  store float 0x3FD3333340000000, ptr %19, align 8, !tbaa !28
  br label %23

23:                                               ; preds = %18, %22
  %24 = phi float [ %20, %18 ], [ 0x3FD3333340000000, %22 ]
  %25 = tail call i16 @llvm.umin.i16(i16 %.sroa.6.0.copyload, i16 %.sroa.0.0.copyload)
  %26 = lshr i16 %25, 1
  %27 = load i16, ptr getelementptr inbounds (i8, ptr @c_tileRadialGradientMask, i64 8), align 8, !tbaa !29
  %28 = ashr i16 %27, 1
  %29 = sub nsw i16 %26, %28
  %30 = getelementptr inbounds i8, ptr %0, i64 12
  %31 = load i16, ptr %30, align 4, !tbaa !30
  %32 = icmp slt i16 %31, 1
  br i1 %32, label %33, label %34

33:                                               ; preds = %23
  store i16 %29, ptr %30, align 4, !tbaa !30
  br label %34

34:                                               ; preds = %33, %23
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #8
  store i16 %29, ptr %3, align 8, !tbaa !31
  %35 = getelementptr inbounds i8, ptr %3, i64 2
  store i16 %29, ptr %35, align 2, !tbaa !34
  %36 = getelementptr inbounds i8, ptr %3, i64 4
  store i16 %12, ptr %36, align 4, !tbaa !35
  %37 = getelementptr inbounds i8, ptr %3, i64 6
  store i16 0, ptr %37, align 2
  %38 = getelementptr inbounds i8, ptr %3, i64 8
  store i16 0, ptr %38, align 8, !tbaa !36
  %39 = getelementptr inbounds i8, ptr %3, i64 10
  store i16 0, ptr %39, align 2, !tbaa !37
  %40 = getelementptr inbounds i8, ptr %3, i64 12
  store float %24, ptr %40, align 4, !tbaa !38
  %41 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %16, ptr %41, align 8, !tbaa !39
  %42 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr @__draw_bubble_handler, ptr %42, align 8, !tbaa !40
  %43 = getelementptr inbounds i8, ptr %3, i64 32
  store ptr %0, ptr %43, align 8, !tbaa !41
  %44 = getelementptr inbounds i8, ptr %0, i64 192
  call void @dynamic_nebula_init(ptr noundef nonnull %44, ptr noundef nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #8
  %45 = getelementptr inbounds i8, ptr %0, i64 36
  %46 = load i8, ptr %45, align 4, !tbaa !42, !range !43, !noundef !44
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %48, label %51

48:                                               ; preds = %34
  %49 = getelementptr inbounds i8, ptr %0, i64 104
  %50 = call ptr @arm_2d_op_init(ptr noundef nonnull %49, i64 noundef 88) #8
  br label %51

51:                                               ; preds = %48, %34
  ret void
}

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @__draw_bubble_handler(ptr noundef, ptr noundef, ptr noundef, i32, i8 noundef zeroext, i16 noundef signext) #0

declare void @dynamic_nebula_init(ptr noundef, ptr noundef) local_unnamed_addr #5

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

declare ptr @arm_2d_op_init(ptr noundef, i64 noundef) local_unnamed_addr #5

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

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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nosync nounwind speculatable willreturn memory(none) }
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 = !{i64 0, i64 8, !6, i64 8, i64 2, !10, i64 10, i64 2, !10, i64 12, i64 2, !10, i64 16, i64 4, !12, i64 24, i64 8, !6, i64 32, i64 2, !10, i64 34, i64 2, !10, i64 36, i64 1, !14}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_Bool", !8, i64 0}
!16 = !{!17, !11, i64 32}
!17 = !{!"cloudy_glass_t", !18, i64 0}
!18 = !{!"", !19, i64 0, !8, i64 40, !21, i64 48, !23, i64 104, !26, i64 192}
!19 = !{!"cloudy_glass_cfg_t", !7, i64 0, !20, i64 8, !11, i64 12, !13, i64 16, !7, i64 24, !11, i64 32, !11, i64 34, !15, i64 36}
!20 = !{!"arm_2d_size_t", !11, i64 0, !11, i64 2}
!21 = !{!"arm_2d_helper_dirty_region_item_t", !8, i64 0, !22, i64 48}
!22 = !{!"arm_2d_region_t", !8, i64 0, !8, i64 4}
!23 = !{!"arm_2d_filter_iir_blur_descriptor_t", !8, i64 0, !24, i64 72}
!24 = !{!"arm_2d_scratch_mem_t", !8, i64 0, !25, i64 8}
!25 = !{!"long", !8, i64 0}
!26 = !{!"dynamic_nebula_t", !8, i64 0, !7, i64 56}
!27 = !{!17, !7, i64 24}
!28 = !{!17, !13, i64 16}
!29 = !{!8, !8, i64 0}
!30 = !{!17, !11, i64 12}
!31 = !{!32, !11, i64 0}
!32 = !{!"dynamic_nebula_cfg_t", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !11, i64 7, !11, i64 8, !11, i64 10, !13, i64 12, !7, i64 16, !33, i64 24}
!33 = !{!"dynamic_nebula_on_draw_particle_evt_t", !7, i64 0, !7, i64 8}
!34 = !{!32, !11, i64 2}
!35 = !{!32, !11, i64 4}
!36 = !{!32, !11, i64 8}
!37 = !{!32, !11, i64 10}
!38 = !{!32, !13, i64 12}
!39 = !{!32, !7, i64 16}
!40 = !{!33, !7, i64 0}
!41 = !{!33, !7, i64 8}
!42 = !{!17, !15, i64 36}
!43 = !{i8 0, i8 2}
!44 = !{}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass