; LLVM IR from lichen-community-systems/signaletic :: libsignaletic/tests/vendor/unity/test/tests (test_unity_arrays)

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

; 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

declare void @UnityAssertEqualIntArray(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) #1

declare ptr @UnityNumToPtr(i64 noundef, i8 noundef zeroext) #1

; Function Attrs: nounwind uwtable
define dso_local void @testEqualPtrEachEqual() #2 {
  %1 = alloca i8, align 1
  %2 = alloca i8, align 1
  %3 = alloca i8, align 1
  %4 = alloca [3 x ptr], align 16
  %5 = alloca [4 x ptr], align 16
  %6 = alloca [2 x ptr], align 16
  %7 = alloca [1 x ptr], align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %1) #3
  store i8 1, ptr %1, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #3
  store i8 2, ptr %2, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #3
  store i8 3, ptr %3, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #3
  store ptr %1, ptr %4, align 8, !tbaa !8
  %8 = getelementptr inbounds ptr, ptr %4, i64 1
  store ptr %1, ptr %8, align 8, !tbaa !8
  %9 = getelementptr inbounds ptr, ptr %4, i64 2
  store ptr %1, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #3
  store ptr %1, ptr %5, align 8, !tbaa !8
  %10 = getelementptr inbounds ptr, ptr %5, i64 1
  store ptr %2, ptr %10, align 8, !tbaa !8
  %11 = getelementptr inbounds ptr, ptr %5, i64 2
  store ptr %3, ptr %11, align 8, !tbaa !8
  %12 = getelementptr inbounds ptr, ptr %5, i64 3
  store ptr %1, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  store ptr %2, ptr %6, align 8, !tbaa !8
  %13 = getelementptr inbounds ptr, ptr %6, i64 1
  store ptr %2, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store ptr %3, ptr %7, align 8, !tbaa !8
  %14 = ptrtoint ptr %1 to i64
  %15 = call ptr @UnityNumToPtr(i64 noundef %14, i8 noundef zeroext 8)
  %16 = getelementptr inbounds [3 x ptr], ptr %4, i64 0, i64 0
  call void @UnityAssertEqualIntArray(ptr noundef %15, ptr noundef %16, i32 noundef 1, ptr noundef null, i64 noundef 1835, i32 noundef 72, i32 noundef 0)
  %17 = ptrtoint ptr %1 to i64
  %18 = call ptr @UnityNumToPtr(i64 noundef %17, i8 noundef zeroext 8)
  %19 = getelementptr inbounds [3 x ptr], ptr %4, i64 0, i64 0
  call void @UnityAssertEqualIntArray(ptr noundef %18, ptr noundef %19, i32 noundef 3, ptr noundef null, i64 noundef 1836, i32 noundef 72, i32 noundef 0)
  %20 = ptrtoint ptr %1 to i64
  %21 = call ptr @UnityNumToPtr(i64 noundef %20, i8 noundef zeroext 8)
  %22 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 0
  call void @UnityAssertEqualIntArray(ptr noundef %21, ptr noundef %22, i32 noundef 1, ptr noundef null, i64 noundef 1837, i32 noundef 72, i32 noundef 0)
  %23 = ptrtoint ptr %2 to i64
  %24 = call ptr @UnityNumToPtr(i64 noundef %23, i8 noundef zeroext 8)
  %25 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  call void @UnityAssertEqualIntArray(ptr noundef %24, ptr noundef %25, i32 noundef 2, ptr noundef null, i64 noundef 1838, i32 noundef 72, i32 noundef 0)
  %26 = ptrtoint ptr %3 to i64
  %27 = call ptr @UnityNumToPtr(i64 noundef %26, i8 noundef zeroext 8)
  %28 = getelementptr inbounds [1 x ptr], ptr %7, i64 0, i64 0
  call void @UnityAssertEqualIntArray(ptr noundef %27, ptr noundef %28, i32 noundef 1, ptr noundef null, i64 noundef 1839, i32 noundef 72, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %1) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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, !9, i64 0}
!9 = !{!"any pointer", !6, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

declare ptr @UnityNumToPtr(i64 noundef, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @testEqualPtrEachEqual() local_unnamed_addr #2 {
  %1 = alloca i8, align 1
  %2 = alloca i8, align 1
  %3 = alloca i8, align 1
  %4 = alloca [3 x ptr], align 16
  %5 = alloca [4 x ptr], align 16
  %6 = alloca [2 x ptr], align 16
  %7 = alloca [1 x ptr], align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #3
  store i8 1, ptr %1, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #3
  store i8 2, ptr %2, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #3
  store i8 3, ptr %3, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  store ptr %1, ptr %4, align 16, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %1, ptr %8, align 8, !tbaa !8
  %9 = getelementptr inbounds i8, ptr %4, i64 16
  store ptr %1, ptr %9, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  store ptr %1, ptr %5, align 16, !tbaa !8
  %10 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %2, ptr %10, align 8, !tbaa !8
  %11 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr %3, ptr %11, align 16, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr %1, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  store ptr %2, ptr %6, align 16, !tbaa !8
  %13 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %2, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  store ptr %3, ptr %7, align 8, !tbaa !8
  %14 = ptrtoint ptr %1 to i64
  %15 = call ptr @UnityNumToPtr(i64 noundef %14, i8 noundef zeroext 8) #3
  call void @UnityAssertEqualIntArray(ptr noundef %15, ptr noundef nonnull %4, i32 noundef 1, ptr noundef null, i64 noundef 1835, i32 noundef 72, i32 noundef 0) #3
  %16 = call ptr @UnityNumToPtr(i64 noundef %14, i8 noundef zeroext 8) #3
  call void @UnityAssertEqualIntArray(ptr noundef %16, ptr noundef nonnull %4, i32 noundef 3, ptr noundef null, i64 noundef 1836, i32 noundef 72, i32 noundef 0) #3
  %17 = call ptr @UnityNumToPtr(i64 noundef %14, i8 noundef zeroext 8) #3
  call void @UnityAssertEqualIntArray(ptr noundef %17, ptr noundef nonnull %5, i32 noundef 1, ptr noundef null, i64 noundef 1837, i32 noundef 72, i32 noundef 0) #3
  %18 = ptrtoint ptr %2 to i64
  %19 = call ptr @UnityNumToPtr(i64 noundef %18, i8 noundef zeroext 8) #3
  call void @UnityAssertEqualIntArray(ptr noundef %19, ptr noundef nonnull %6, i32 noundef 2, ptr noundef null, i64 noundef 1838, i32 noundef 72, i32 noundef 0) #3
  %20 = ptrtoint ptr %3 to i64
  %21 = call ptr @UnityNumToPtr(i64 noundef %20, i8 noundef zeroext 8) #3
  call void @UnityAssertEqualIntArray(ptr noundef %21, ptr noundef nonnull %7, i32 noundef 1, ptr noundef null, i64 noundef 1839, i32 noundef 72, i32 noundef 0) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #3
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass