; LLVM IR from awawa-dev/HyperHDR :: sources/base/SoundCaptureResult.ll (ZN18SoundCaptureResult8GetStatsERjS0_R8ColorRgbPS1_S3_)

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

%class.SoundCaptureResult = type { i32, i8, i32, [8 x i32], [8 x i32], [8 x i32], [8 x i8], [8 x i8], [8 x i8], [8 x %struct.ColorRgb], i32, %struct.ColorRgb, i32, i32, i32, %struct.MovingTarget, %struct.MovingTarget }
%struct.ColorRgb = type { i8, i8, i8 }
%struct.MovingTarget = type { %struct.ColorRgb, %struct.ColorRgb, %struct.ColorRgb, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN18SoundCaptureResult8GetStatsERjS0_R8ColorRgbPS1_S3_(ptr noundef nonnull align 4 dereferenceable(296) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 1 dereferenceable(3) %3, ptr noundef %4, ptr noundef %5) #1 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %13 = load ptr, ptr %7, align 8
  %14 = getelementptr inbounds %class.SoundCaptureResult, ptr %13, i32 0, i32 12
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %15, ptr %16, align 4, !tbaa !15
  %17 = getelementptr inbounds %class.SoundCaptureResult, ptr %13, i32 0, i32 15
  %18 = getelementptr inbounds %struct.MovingTarget, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %19, ptr align 4 %18, i64 3, i1 false), !tbaa.struct !16
  %20 = getelementptr inbounds %class.SoundCaptureResult, ptr %13, i32 0, i32 14
  %21 = load i32, ptr %20, align 4, !tbaa !18
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %21, ptr %22, align 4, !tbaa !15
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %29

25:                                               ; preds = %6
  %26 = getelementptr inbounds %class.SoundCaptureResult, ptr %13, i32 0, i32 15
  %27 = getelementptr inbounds %struct.MovingTarget, ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %28, ptr align 1 %27, i64 3, i1 false), !tbaa.struct !16
  br label %29

29:                                               ; preds = %25, %6
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %36

32:                                               ; preds = %29
  %33 = getelementptr inbounds %class.SoundCaptureResult, ptr %13, i32 0, i32 15
  %34 = getelementptr inbounds %struct.MovingTarget, ptr %33, i32 0, i32 2
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %35, ptr align 2 %34, i64 3, i1 false), !tbaa.struct !16
  br label %36

36:                                               ; preds = %32, %29
  %37 = getelementptr inbounds %class.SoundCaptureResult, ptr %13, i32 0, i32 1
  %38 = load i8, ptr %37, align 4, !tbaa !19, !range !20, !noundef !21
  %39 = trunc i8 %38 to i1
  ret i1 %39
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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++ TBAA"}
!9 = !{!10, !11, i64 164}
!10 = !{!"_ZTS18SoundCaptureResult", !11, i64 0, !12, i64 4, !11, i64 8, !7, i64 12, !7, i64 44, !7, i64 76, !7, i64 108, !7, i64 116, !7, i64 124, !7, i64 132, !11, i64 156, !13, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !14, i64 176, !14, i64 236}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTS8ColorRgb", !7, i64 0, !7, i64 1, !7, i64 2}
!14 = !{!"_ZTS12MovingTarget", !13, i64 0, !13, i64 3, !13, i64 6, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56}
!15 = !{!11, !11, i64 0}
!16 = !{i64 0, i64 1, !17, i64 1, i64 1, !17, i64 2, i64 1, !17}
!17 = !{!7, !7, i64 0}
!18 = !{!10, !11, i64 172}
!19 = !{!10, !12, i64 4}
!20 = !{i8 0, i8 2}
!21 = !{}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local noundef zeroext i1 @_ZN18SoundCaptureResult8GetStatsERjS0_R8ColorRgbPS1_S3_(ptr nocapture noundef nonnull readonly align 4 dereferenceable(296) %0, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %1, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %2, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(3) %3, ptr noundef writeonly %4, ptr noundef writeonly %5) local_unnamed_addr #1 align 2 {
  %7 = getelementptr inbounds i8, ptr %0, i64 164
  %8 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %8, ptr %1, align 4, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %0, i64 176
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %3, ptr noundef nonnull align 4 dereferenceable(3) %9, i64 3, i1 false), !tbaa.struct !14
  %10 = getelementptr inbounds i8, ptr %0, i64 172
  %11 = load i32, ptr %10, align 4, !tbaa !16
  store i32 %11, ptr %2, align 4, !tbaa !13
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %14, label %12

12:                                               ; preds = %6
  %13 = getelementptr inbounds i8, ptr %0, i64 179
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %4, ptr noundef nonnull align 1 dereferenceable(3) %13, i64 3, i1 false), !tbaa.struct !14
  br label %14

14:                                               ; preds = %12, %6
  %.not9 = icmp eq ptr %5, null
  br i1 %.not9, label %17, label %15

15:                                               ; preds = %14
  %16 = getelementptr inbounds i8, ptr %0, i64 182
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %5, ptr noundef nonnull align 2 dereferenceable(3) %16, i64 3, i1 false), !tbaa.struct !14
  br label %17

17:                                               ; preds = %15, %14
  %18 = getelementptr inbounds i8, ptr %0, i64 4
  %19 = load i8, ptr %18, align 4, !tbaa !17, !range !18, !noundef !19
  %20 = trunc nuw i8 %19 to i1
  ret i1 %20
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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 164}
!6 = !{!"_ZTS18SoundCaptureResult", !7, i64 0, !10, i64 4, !7, i64 8, !8, i64 12, !8, i64 44, !8, i64 76, !8, i64 108, !8, i64 116, !8, i64 124, !8, i64 132, !7, i64 156, !11, i64 160, !7, i64 164, !7, i64 168, !7, i64 172, !12, i64 176, !12, i64 236}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTS8ColorRgb", !8, i64 0, !8, i64 1, !8, i64 2}
!12 = !{!"_ZTS12MovingTarget", !11, i64 0, !11, i64 3, !11, i64 6, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56}
!13 = !{!7, !7, i64 0}
!14 = !{i64 0, i64 1, !15, i64 1, i64 1, !15, i64 2, i64 1, !15}
!15 = !{!8, !8, i64 0}
!16 = !{!6, !7, i64 172}
!17 = !{!6, !10, i64 4}
!18 = !{i8 0, i8 2}
!19 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass