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

; 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.UNITY_STORAGE_T = type { ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, [1 x %struct.__jmp_buf_tag] }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@SetToOneMeanWeAlreadyCheckedThisGuy = external hidden global i32, align 4
@Unity = external global %struct.UNITY_STORAGE_T, align 8
@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @startPutcharSpy() #0

; Function Attrs: nounwind uwtable
declare dso_local void @endPutcharSpy() #0

declare void @UnityPrint(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare i32 @putchar(i32 noundef) #2

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #3

declare void @UnityPrintNumberUnsigned(i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @testThatDetailsCanBeHandleSingleDetailClearingTwoDetails() #0 {
  store ptr @.str.23, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 2), align 8, !tbaa !5
  store ptr @.str.25, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 3), align 8, !tbaa !11
  store ptr @.str.27, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 2), align 8, !tbaa !5
  store ptr null, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 3), align 8, !tbaa !11
  call void @startPutcharSpy()
  %1 = call i32 @_setjmp(ptr noundef getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 10)) #4
  %2 = icmp eq i32 %1, 0
  br i1 %2, label %3, label %4

3:                                                ; preds = %0
  call void @UnityAssertEqualString(ptr noundef @.str.28, ptr noundef @.str.29, ptr noundef @.str.30, i64 noundef 368)
  br label %4

4:                                                ; preds = %3, %0
  call void @endPutcharSpy()
  %5 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !12
  %6 = icmp eq i64 %5, 1
  %7 = zext i1 %6 to i64
  %8 = select i1 %6, i32 0, i32 1
  %9 = sext i32 %8 to i64
  store i64 %9, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !12
  %10 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !12
  %11 = icmp eq i64 %10, 1
  br i1 %11, label %12, label %17

12:                                               ; preds = %4
  store i32 1, ptr @SetToOneMeanWeAlreadyCheckedThisGuy, align 4, !tbaa !13
  %13 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 4), align 8, !tbaa !15
  call void @UnityPrintNumberUnsigned(i64 noundef %13)
  %14 = call i32 @putchar(i32 noundef 58)
  %15 = load ptr, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 1), align 8, !tbaa !16
  call void @UnityPrint(ptr noundef %15)
  call void @UnityPrint(ptr noundef @.str.8)
  %16 = call i32 @putchar(i32 noundef 10)
  br label %17

17:                                               ; preds = %12, %4
  ret void
}

declare void @UnityAssertEqualString(ptr noundef, ptr noundef, 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 = { inlinehint 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 returns_twice "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 #4 = { nounwind returns_twice }

!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 16}
!6 = !{!"UNITY_STORAGE_T", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !8, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !7, i64 24}
!12 = !{!6, !10, i64 64}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!6, !10, i64 32}
!16 = !{!6, !7, i64 8}


; 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.UNITY_STORAGE_T = type { ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, [1 x %struct.__jmp_buf_tag] }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@SetToOneMeanWeAlreadyCheckedThisGuy = external hidden local_unnamed_addr global i32, align 4
@Unity = external global %struct.UNITY_STORAGE_T, align 8
@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @startPutcharSpy() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @endPutcharSpy() local_unnamed_addr #0

declare void @UnityPrint(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #3

declare void @UnityPrintNumberUnsigned(i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @testThatDetailsCanBeHandleSingleDetailClearingTwoDetails() local_unnamed_addr #0 {
  store ptr @.str.27, ptr getelementptr inbounds (i8, ptr @Unity, i64 16), align 8, !tbaa !5
  store ptr null, ptr getelementptr inbounds (i8, ptr @Unity, i64 24), align 8, !tbaa !11
  call void @startPutcharSpy()
  %1 = call i32 @_setjmp(ptr noundef nonnull getelementptr inbounds (i8, ptr @Unity, i64 80)) #4
  %2 = icmp eq i32 %1, 0
  br i1 %2, label %3, label %4

3:                                                ; preds = %0
  call void @UnityAssertEqualString(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str.29, ptr noundef nonnull @.str.30, i64 noundef 368) #5
  br label %4

4:                                                ; preds = %3, %0
  call void @endPutcharSpy()
  %5 = load i64, ptr getelementptr inbounds (i8, ptr @Unity, i64 64), align 8, !tbaa !12
  %6 = icmp ne i64 %5, 1
  %7 = zext i1 %6 to i64
  store i64 %7, ptr getelementptr inbounds (i8, ptr @Unity, i64 64), align 8, !tbaa !12
  br i1 %6, label %8, label %13

8:                                                ; preds = %4
  store i32 1, ptr @SetToOneMeanWeAlreadyCheckedThisGuy, align 4, !tbaa !13
  %9 = load i64, ptr getelementptr inbounds (i8, ptr @Unity, i64 32), align 8, !tbaa !15
  call void @UnityPrintNumberUnsigned(i64 noundef %9) #5
  %10 = call i32 @putchar(i32 noundef 58)
  %11 = load ptr, ptr getelementptr inbounds (i8, ptr @Unity, i64 8), align 8, !tbaa !16
  call void @UnityPrint(ptr noundef %11) #5
  call void @UnityPrint(ptr noundef nonnull @.str.8) #5
  %12 = call i32 @putchar(i32 noundef 10)
  br label %13

13:                                               ; preds = %8, %4
  ret void
}

declare void @UnityAssertEqualString(ptr noundef, ptr noundef, 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 = { inlinehint nofree 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 returns_twice "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 #4 = { nounwind returns_twice }
attributes #5 = { 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, !7, i64 16}
!6 = !{!"UNITY_STORAGE_T", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !8, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !7, i64 24}
!12 = !{!6, !10, i64 64}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!6, !10, i64 32}
!16 = !{!6, !7, i64 8}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass