; 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
@__const.UnityAssertFloatSpecial.trait_names = external hidden unnamed_addr constant [4 x ptr], align 16
@UnityStrInvalidFloatTrait = external hidden constant [20 x i8], align 16
@UnityStrNot = external hidden constant [5 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 @UnityPrintFloat(float noundef) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i1 @llvm.is.fpclass.f32(float, i32 immarg) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #2

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

; 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
define dso_local void @UnityAssertFloatSpecial(float noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) #0 {
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca [4 x ptr], align 16
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store float %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !11
  store i32 %3, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 @__const.UnityAssertFloatSpecial.trait_names, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %13 = load i32, ptr %8, align 4, !tbaa !13
  %14 = zext i32 %13 to i64
  %15 = and i64 %14, 1
  store i64 %15, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %16 = load i64, ptr %10, align 8, !tbaa !11
  %17 = icmp ne i64 %16, 0
  %18 = xor i1 %17, true
  %19 = zext i1 %18 to i32
  %20 = sext i32 %19 to i64
  store i64 %20, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %21 = load i32, ptr %8, align 4, !tbaa !13
  %22 = lshr i32 %21, 1
  %23 = zext i32 %22 to i64
  store i64 %23, ptr %12, align 8, !tbaa !11
  %24 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !15
  %25 = icmp ne i64 %24, 0
  br i1 %25, label %29, label %26

26:                                               ; preds = %4
  %27 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 9), align 8, !tbaa !17
  %28 = icmp ne i64 %27, 0
  br i1 %28, label %29, label %30

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

30:                                               ; preds = %26
  %31 = load i32, ptr %8, align 4, !tbaa !13
  switch i32 %31, label %87 [
    i32 1, label %32
    i32 0, label %32
    i32 3, label %48
    i32 2, label %48
    i32 5, label %64
    i32 4, label %64
    i32 7, label %70
    i32 6, label %70
  ]

32:                                               ; preds = %30, %30
  %33 = load float, ptr %5, align 4, !tbaa !5
  %34 = call float @llvm.fabs.f32(float %33) #7
  %35 = fcmp oeq float %34, 0x7FF0000000000000
  %36 = bitcast float %33 to i32
  %37 = icmp slt i32 %36, 0
  %38 = select i1 %37, i32 -1, i32 1
  %39 = select i1 %35, i32 %38, i32 0
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %32
  %42 = load float, ptr %5, align 4, !tbaa !5
  %43 = fcmp ogt float %42, 0.000000e+00
  br label %44

44:                                               ; preds = %41, %32
  %45 = phi i1 [ false, %32 ], [ %43, %41 ]
  %46 = zext i1 %45 to i32
  %47 = sext i32 %46 to i64
  store i64 %47, ptr %11, align 8, !tbaa !11
  br label %89

48:                                               ; preds = %30, %30
  %49 = load float, ptr %5, align 4, !tbaa !5
  %50 = call float @llvm.fabs.f32(float %49) #7
  %51 = fcmp oeq float %50, 0x7FF0000000000000
  %52 = bitcast float %49 to i32
  %53 = icmp slt i32 %52, 0
  %54 = select i1 %53, i32 -1, i32 1
  %55 = select i1 %51, i32 %54, i32 0
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %48
  %58 = load float, ptr %5, align 4, !tbaa !5
  %59 = fcmp olt float %58, 0.000000e+00
  br label %60

60:                                               ; preds = %57, %48
  %61 = phi i1 [ false, %48 ], [ %59, %57 ]
  %62 = zext i1 %61 to i32
  %63 = sext i32 %62 to i64
  store i64 %63, ptr %11, align 8, !tbaa !11
  br label %89

64:                                               ; preds = %30, %30
  %65 = load float, ptr %5, align 4, !tbaa !5
  %66 = call i1 @llvm.is.fpclass.f32(float %65, i32 3)
  %67 = zext i1 %66 to i64
  %68 = select i1 %66, i32 1, i32 0
  %69 = sext i32 %68 to i64
  store i64 %69, ptr %11, align 8, !tbaa !11
  br label %89

70:                                               ; preds = %30, %30
  %71 = load float, ptr %5, align 4, !tbaa !5
  %72 = call float @llvm.fabs.f32(float %71) #7
  %73 = fcmp oeq float %72, 0x7FF0000000000000
  %74 = bitcast float %71 to i32
  %75 = icmp slt i32 %74, 0
  %76 = select i1 %75, i32 -1, i32 1
  %77 = select i1 %73, i32 %76, i32 0
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %83, label %79

79:                                               ; preds = %70
  %80 = load float, ptr %5, align 4, !tbaa !5
  %81 = call i1 @llvm.is.fpclass.f32(float %80, i32 3)
  %82 = xor i1 %81, true
  br label %83

83:                                               ; preds = %79, %70
  %84 = phi i1 [ false, %70 ], [ %82, %79 ]
  %85 = zext i1 %84 to i32
  %86 = sext i32 %85 to i64
  store i64 %86, ptr %11, align 8, !tbaa !11
  br label %89

87:                                               ; preds = %30
  store i64 0, ptr %12, align 8, !tbaa !11
  %88 = getelementptr inbounds [4 x ptr], ptr %9, i64 0, i64 0
  store ptr @UnityStrInvalidFloatTrait, ptr %88, align 16, !tbaa !9
  br label %89

89:                                               ; preds = %87, %83, %64, %60, %44
  %90 = load i64, ptr %11, align 8, !tbaa !11
  %91 = load i64, ptr %10, align 8, !tbaa !11
  %92 = icmp ne i64 %90, %91
  br i1 %92, label %93, label %104

93:                                               ; preds = %89
  %94 = load i64, ptr %7, align 8, !tbaa !11
  call void @UnityTestResultsFailBegin(i64 noundef %94)
  call void @UnityPrint(ptr noundef @UnityStrExpected)
  %95 = load i64, ptr %10, align 8, !tbaa !11
  %96 = icmp ne i64 %95, 0
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @UnityPrint(ptr noundef @UnityStrNot)
  br label %98

98:                                               ; preds = %97, %93
  %99 = load i64, ptr %12, align 8, !tbaa !11
  %100 = getelementptr inbounds [4 x ptr], ptr %9, i64 0, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  call void @UnityPrint(ptr noundef %101)
  call void @UnityPrint(ptr noundef @UnityStrWas)
  %102 = load float, ptr %5, align 4, !tbaa !5
  call void @UnityPrintFloat(float noundef %102)
  %103 = load ptr, ptr %6, align 8, !tbaa !9
  call void @UnityAddMsgIfSpecified(ptr noundef %103)
  store i64 1, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !15
  call void @longjmp(ptr noundef getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 10), i32 noundef 1) #6
  unreachable

104:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  ret void
}

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }
attributes #7 = { memory(none) }

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


; 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
@__const.UnityAssertFloatSpecial.trait_names = external hidden unnamed_addr constant [4 x ptr], align 16
@UnityStrInvalidFloatTrait = external hidden constant [20 x i8], align 16
@UnityStrNot = external hidden constant [5 x i8], align 1

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

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

; Function Attrs: mustprogress 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 @UnityPrintFloat(float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #2

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

; 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
define dso_local void @UnityAssertFloatSpecial(float noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca [4 x ptr], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef nonnull align 16 dereferenceable(32) @__const.UnityAssertFloatSpecial.trait_names, i64 32, i1 false)
  %6 = and i32 %3, 1
  %.not = icmp eq i32 %6, 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 = %4
  tail call void @longjmp(ptr noundef nonnull getelementptr inbounds (i8, ptr @Unity, i64 80), i32 noundef 1) #6
  unreachable

12:                                               ; preds = %4
  switch i32 %3, label %.thread [
    i32 1, label %13
    i32 0, label %13
    i32 3, label %15
    i32 2, label %15
    i32 5, label %17
    i32 4, label %17
    i32 7, label %19
    i32 6, label %19
  ]

13:                                               ; preds = %12, %12
  %14 = fcmp oeq float %0, 0x7FF0000000000000
  br label %22

15:                                               ; preds = %12, %12
  %16 = fcmp oeq float %0, 0xFFF0000000000000
  br label %22

17:                                               ; preds = %12, %12
  %18 = fcmp uno float %0, 0.000000e+00
  br label %22

19:                                               ; preds = %12, %12
  %20 = tail call float @llvm.fabs.f32(float %0) #7
  %21 = fcmp one float %20, 0x7FF0000000000000
  br label %22

.thread:                                          ; preds = %12
  store ptr @UnityStrInvalidFloatTrait, ptr %5, align 16, !tbaa !11
  br label %25

22:                                               ; preds = %19, %17, %15, %13
  %.018.in = phi i1 [ %21, %19 ], [ %18, %17 ], [ %16, %15 ], [ %14, %13 ]
  %.0.shrunk = phi i64 [ 3, %19 ], [ 2, %17 ], [ 1, %15 ], [ 0, %13 ]
  %23 = trunc i32 %3 to i1
  %24 = xor i1 %.018.in, %23
  br i1 %24, label %25, label %30

25:                                               ; preds = %.thread, %22
  %.0.shrunk23 = phi i64 [ 0, %.thread ], [ %.0.shrunk, %22 ]
  tail call void @UnityTestResultsFailBegin(i64 noundef %2)
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrExpected)
  br i1 %.not, label %26, label %27

26:                                               ; preds = %25
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrNot)
  br label %27

27:                                               ; preds = %26, %25
  %28 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 %.0.shrunk23
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  tail call void @UnityPrint(ptr noundef %29)
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrWas)
  tail call void @UnityPrintFloat(float noundef %0)
  tail call void @UnityAddMsgIfSpecified(ptr noundef %1)
  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) #6
  unreachable

30:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  ret void
}

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }
attributes #7 = { memory(none) }

!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 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass