; LLVM IR from octu0/blurry :: buffer (init_rgba_dim)

; 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.halide_dimension_t = type { i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local void @init_rgba_dim(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.halide_dimension_t, ptr %7, i64 0
  %9 = getelementptr inbounds %struct.halide_dimension_t, ptr %8, i32 0, i32 0
  store i32 0, ptr %9, align 4, !tbaa !11
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.halide_dimension_t, ptr %11, i64 0
  %13 = getelementptr inbounds %struct.halide_dimension_t, ptr %12, i32 0, i32 1
  store i32 %10, ptr %13, align 4, !tbaa !13
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.halide_dimension_t, ptr %14, i64 0
  %16 = getelementptr inbounds %struct.halide_dimension_t, ptr %15, i32 0, i32 2
  store i32 4, ptr %16, align 4, !tbaa !14
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.halide_dimension_t, ptr %17, i64 0
  %19 = getelementptr inbounds %struct.halide_dimension_t, ptr %18, i32 0, i32 3
  store i32 0, ptr %19, align 4, !tbaa !15
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.halide_dimension_t, ptr %20, i64 1
  %22 = getelementptr inbounds %struct.halide_dimension_t, ptr %21, i32 0, i32 0
  store i32 0, ptr %22, align 4, !tbaa !11
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.halide_dimension_t, ptr %24, i64 1
  %26 = getelementptr inbounds %struct.halide_dimension_t, ptr %25, i32 0, i32 1
  store i32 %23, ptr %26, align 4, !tbaa !13
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = mul nsw i32 %27, 4
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.halide_dimension_t, ptr %29, i64 1
  %31 = getelementptr inbounds %struct.halide_dimension_t, ptr %30, i32 0, i32 2
  store i32 %28, ptr %31, align 4, !tbaa !14
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.halide_dimension_t, ptr %32, i64 1
  %34 = getelementptr inbounds %struct.halide_dimension_t, ptr %33, i32 0, i32 3
  store i32 0, ptr %34, align 4, !tbaa !15
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.halide_dimension_t, ptr %35, i64 2
  %37 = getelementptr inbounds %struct.halide_dimension_t, ptr %36, i32 0, i32 0
  store i32 0, ptr %37, align 4, !tbaa !11
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.halide_dimension_t, ptr %38, i64 2
  %40 = getelementptr inbounds %struct.halide_dimension_t, ptr %39, i32 0, i32 1
  store i32 4, ptr %40, align 4, !tbaa !13
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.halide_dimension_t, ptr %41, i64 2
  %43 = getelementptr inbounds %struct.halide_dimension_t, ptr %42, i32 0, i32 2
  store i32 1, ptr %43, align 4, !tbaa !14
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.halide_dimension_t, ptr %44, i64 2
  %46 = getelementptr inbounds %struct.halide_dimension_t, ptr %45, i32 0, i32 3
  store i32 0, ptr %46, align 4, !tbaa !15
  ret void
}

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"halide_dimension_t", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 12}


; 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @init_rgba_dim(ptr nocapture noundef writeonly %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  store i32 0, ptr %0, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %1, ptr %4, align 4, !tbaa !10
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 4, ptr %5, align 4, !tbaa !11
  %6 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 0, ptr %6, align 4, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 0, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %2, ptr %8, align 4, !tbaa !10
  %9 = shl nsw i32 %1, 2
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %9, ptr %10, align 4, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %0, i64 28
  store <4 x i32> <i32 0, i32 0, i32 4, i32 1>, ptr %11, align 4, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 0, ptr %12, align 4, !tbaa !12
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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" }

!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 = !{!"halide_dimension_t", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !7, i64 12}
!13 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass