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

; 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] }

@Unity = external dso_local global %struct.UNITY_STORAGE_T, align 8
@UnityStrExpected = external hidden constant [11 x i8], align 1
@UnityStrWas = external hidden constant [6 x i8], align 1
@UnityStrPointless = external hidden constant [55 x i8], align 16
@UnityStrElement = external hidden constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrint(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrintNumberUnsigned(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrintFloat(float noundef) #0

; Function Attrs: noreturn nounwind
declare void @longjmp(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @UnityTestResultsFailBegin(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @UnityAddMsgIfSpecified(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @UnityIsOneArrayNull(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @UnityAssertEqualFloatArray(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4, i32 noundef %5) #0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !11
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %17 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %17, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %18, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %19, ptr %15, align 8, !tbaa !5
  %20 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !13
  %21 = icmp ne i64 %20, 0
  br i1 %21, label %25, label %22

22:                                               ; preds = %6
  %23 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 9), align 8, !tbaa !15
  %24 = icmp ne i64 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %22, %6
  call void @longjmp(ptr noundef getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 10), i32 noundef 1) #4
  unreachable

26:                                               ; preds = %22
  %27 = load i32, ptr %13, align 4, !tbaa !9
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %26
  %30 = load i64, ptr %11, align 8, !tbaa !11
  call void @UnityTestResultsFailBegin(i64 noundef %30)
  call void @UnityPrint(ptr noundef @UnityStrPointless)
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  call void @UnityAddMsgIfSpecified(ptr noundef %31)
  store i64 1, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !13
  call void @longjmp(ptr noundef getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 10), i32 noundef 1) #4
  unreachable

32:                                               ; preds = %26
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = icmp eq ptr %33, %34
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  store i32 1, ptr %16, align 4
  br label %82

37:                                               ; preds = %32
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load i64, ptr %11, align 8, !tbaa !11
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = call i32 @UnityIsOneArrayNull(ptr noundef %38, ptr noundef %39, i64 noundef %40, ptr noundef %41)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %37
  store i64 1, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !13
  call void @longjmp(ptr noundef getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 10), i32 noundef 1) #4
  unreachable

45:                                               ; preds = %37
  br label %46

46:                                               ; preds = %78, %45
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = add i32 %47, -1
  store i32 %48, ptr %13, align 4, !tbaa !9
  %49 = icmp ne i32 %47, 0
  br i1 %49, label %50, label %81

50:                                               ; preds = %46
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = load float, ptr %51, align 4, !tbaa !16
  %53 = fmul float %52, 0x3EE4F8B580000000
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = load float, ptr %54, align 4, !tbaa !16
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = load float, ptr %56, align 4, !tbaa !16
  %58 = call i32 @UnityFloatsWithin(float noundef %53, float noundef %55, float noundef %57)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %72, label %60

60:                                               ; preds = %50
  %61 = load i64, ptr %11, align 8, !tbaa !11
  call void @UnityTestResultsFailBegin(i64 noundef %61)
  call void @UnityPrint(ptr noundef @UnityStrElement)
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = load i32, ptr %13, align 4, !tbaa !9
  %64 = sub i32 %62, %63
  %65 = sub i32 %64, 1
  %66 = zext i32 %65 to i64
  call void @UnityPrintNumberUnsigned(i64 noundef %66)
  call void @UnityPrint(ptr noundef @UnityStrExpected)
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = load float, ptr %67, align 4, !tbaa !16
  call void @UnityPrintFloat(float noundef %68)
  call void @UnityPrint(ptr noundef @UnityStrWas)
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  %70 = load float, ptr %69, align 4, !tbaa !16
  call void @UnityPrintFloat(float noundef %70)
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  call void @UnityAddMsgIfSpecified(ptr noundef %71)
  store i64 1, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !13
  call void @longjmp(ptr noundef getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 10), i32 noundef 1) #4
  unreachable

72:                                               ; preds = %50
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %78

75:                                               ; preds = %72
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = getelementptr inbounds float, ptr %76, i32 1
  store ptr %77, ptr %14, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %75, %72
  %79 = load ptr, ptr %15, align 8, !tbaa !5
  %80 = getelementptr inbounds float, ptr %79, i32 1
  store ptr %80, ptr %15, align 8, !tbaa !5
  br label %46, !llvm.loop !18

81:                                               ; preds = %46
  store i32 0, ptr %16, align 4
  br label %82

82:                                               ; preds = %81, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  %83 = load i32, ptr %16, align 4
  switch i32 %83, label %85 [
    i32 0, label %84
    i32 1, label %84
  ]

84:                                               ; preds = %82, %82
  ret void

85:                                               ; preds = %82
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden i32 @UnityFloatsWithin(float noundef, float noundef, float noundef) #0

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind }
attributes #4 = { noreturn 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 64}
!14 = !{!"UNITY_STORAGE_T", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !7, i64 80}
!15 = !{!14, !12, i64 72}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; 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] }

@Unity = external dso_local global %struct.UNITY_STORAGE_T, align 8
@UnityStrExpected = external hidden constant [11 x i8], align 1
@UnityStrWas = external hidden constant [6 x i8], align 1
@UnityStrPointless = external hidden constant [55 x i8], align 16
@UnityStrElement = external hidden constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrint(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrintNumberUnsigned(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrintFloat(float noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden void @UnityTestResultsFailBegin(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @UnityAddMsgIfSpecified(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @UnityIsOneArrayNull(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @UnityAssertEqualFloatArray(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = load i64, ptr getelementptr inbounds (i8, ptr @Unity, i64 64), align 8, !tbaa !5
  %8 = icmp ne i64 %7, 0
  %9 = load i64, ptr getelementptr inbounds (i8, ptr @Unity, i64 72), align 8
  %10 = icmp ne i64 %9, 0
  %or.cond = select i1 %8, i1 true, i1 %10
  br i1 %or.cond, label %11, label %12

11:                                               ; preds = %6
  tail call void @longjmp(ptr noundef nonnull getelementptr inbounds (i8, ptr @Unity, i64 80), i32 noundef 1) #2
  unreachable

12:                                               ; preds = %6
  %13 = icmp eq i32 %2, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %12
  tail call void @UnityTestResultsFailBegin(i64 noundef %4)
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrPointless)
  tail call void @UnityAddMsgIfSpecified(ptr noundef %3)
  store i64 1, ptr getelementptr inbounds (i8, ptr @Unity, i64 64), align 8, !tbaa !5
  tail call void @longjmp(ptr noundef nonnull getelementptr inbounds (i8, ptr @Unity, i64 80), i32 noundef 1) #2
  unreachable

15:                                               ; preds = %12
  %16 = icmp eq ptr %0, %1
  br i1 %16, label %.loopexit, label %17

17:                                               ; preds = %15
  %18 = tail call i32 @UnityIsOneArrayNull(ptr noundef %0, ptr noundef %1, i64 noundef %4, ptr noundef %3)
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %.preheader, label %20

.preheader:                                       ; preds = %17
  %19 = icmp eq i32 %5, 1
  %spec.select.idx = select i1 %19, i64 4, i64 0
  br label %21

20:                                               ; preds = %17
  store i64 1, ptr getelementptr inbounds (i8, ptr @Unity, i64 64), align 8, !tbaa !5
  tail call void @longjmp(ptr noundef nonnull getelementptr inbounds (i8, ptr @Unity, i64 80), i32 noundef 1) #2
  unreachable

21:                                               ; preds = %.preheader, %31
  %.037 = phi ptr [ %1, %.preheader ], [ %33, %31 ]
  %.02536 = phi ptr [ %0, %.preheader ], [ %spec.select, %31 ]
  %.02635 = phi i32 [ %2, %.preheader ], [ %32, %31 ]
  %22 = load float, ptr %.02536, align 4, !tbaa !11
  %23 = fmul float %22, 0x3EE4F8B580000000
  %24 = load float, ptr %.037, align 4, !tbaa !11
  %25 = tail call i32 @UnityFloatsWithin(float noundef %23, float noundef %22, float noundef %24)
  %.not31 = icmp eq i32 %25, 0
  br i1 %.not31, label %26, label %31

26:                                               ; preds = %21
  tail call void @UnityTestResultsFailBegin(i64 noundef %4)
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrElement)
  %27 = sub i32 %2, %.02635
  %28 = zext i32 %27 to i64
  tail call void @UnityPrintNumberUnsigned(i64 noundef %28)
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrExpected)
  %29 = load float, ptr %.02536, align 4, !tbaa !11
  tail call void @UnityPrintFloat(float noundef %29)
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrWas)
  %30 = load float, ptr %.037, align 4, !tbaa !11
  tail call void @UnityPrintFloat(float noundef %30)
  tail call void @UnityAddMsgIfSpecified(ptr noundef %3)
  store i64 1, ptr getelementptr inbounds (i8, ptr @Unity, i64 64), align 8, !tbaa !5
  tail call void @longjmp(ptr noundef nonnull getelementptr inbounds (i8, ptr @Unity, i64 80), i32 noundef 1) #2
  unreachable

31:                                               ; preds = %21
  %32 = add i32 %.02635, -1
  %spec.select = getelementptr inbounds i8, ptr %.02536, i64 %spec.select.idx
  %33 = getelementptr inbounds i8, ptr %.037, i64 4
  %.not30 = icmp eq i32 %32, 0
  br i1 %.not30, label %.loopexit, label %21, !llvm.loop !13

.loopexit:                                        ; preds = %31, %15
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden i32 @UnityFloatsWithin(float noundef, float noundef, float noundef) local_unnamed_addr #0

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 = { noreturn 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, !10, i64 64}
!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 = !{!12, !12, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass