; 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
@UnityStrGt = external hidden constant [21 x i8], align 16
@UnityStrLt = external hidden constant [18 x i8], align 16
@UnityStrOrEqual = external hidden constant [13 x i8], align 1
@UnityStrNotEqual = external hidden constant [21 x i8], align 16

; 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 @UnityPrintNumberByStyle(i64 noundef, i32 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
define dso_local void @UnityAssertGreaterOrLessOrEqualNumber(i64 noundef %0, i64 noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4, i32 noundef %5) #0 {
  %7 = alloca i64, align 8
  %8 = alloca i64, 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 i32, align 4
  store i64 %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !11
  store i64 %4, ptr %11, align 8, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  %15 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !13
  %16 = icmp ne i64 %15, 0
  br i1 %16, label %20, label %17

17:                                               ; preds = %6
  %18 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 9), align 8, !tbaa !15
  %19 = icmp ne i64 %18, 0
  br i1 %19, label %20, label %21

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

21:                                               ; preds = %17
  %22 = load i64, ptr %7, align 8, !tbaa !5
  %23 = load i64, ptr %8, align 8, !tbaa !5
  %24 = icmp eq i64 %22, %23
  br i1 %24, label %25, label %30

25:                                               ; preds = %21
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = and i32 %26, 1
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  store i32 1, ptr %14, align 4
  br label %107

30:                                               ; preds = %25, %21
  %31 = load i64, ptr %7, align 8, !tbaa !5
  %32 = load i64, ptr %8, align 8, !tbaa !5
  %33 = icmp eq i64 %31, %32
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %34, %30
  %36 = load i32, ptr %12, align 4, !tbaa !9
  %37 = and i32 %36, 16
  %38 = icmp eq i32 %37, 16
  br i1 %38, label %39, label %58

39:                                               ; preds = %35
  %40 = load i64, ptr %8, align 8, !tbaa !5
  %41 = load i64, ptr %7, align 8, !tbaa !5
  %42 = icmp sgt i64 %40, %41
  br i1 %42, label %43, label %48

43:                                               ; preds = %39
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = and i32 %44, 4
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %47, %43, %39
  %49 = load i64, ptr %8, align 8, !tbaa !5
  %50 = load i64, ptr %7, align 8, !tbaa !5
  %51 = icmp slt i64 %49, %50
  br i1 %51, label %52, label %57

52:                                               ; preds = %48
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = and i32 %53, 2
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %52
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %56, %52, %48
  br label %77

58:                                               ; preds = %35
  %59 = load i64, ptr %8, align 8, !tbaa !5
  %60 = load i64, ptr %7, align 8, !tbaa !5
  %61 = icmp ugt i64 %59, %60
  br i1 %61, label %62, label %67

62:                                               ; preds = %58
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = and i32 %63, 4
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %62
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %66, %62, %58
  %68 = load i64, ptr %8, align 8, !tbaa !5
  %69 = load i64, ptr %7, align 8, !tbaa !5
  %70 = icmp ult i64 %68, %69
  br i1 %70, label %71, label %76

71:                                               ; preds = %67
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = and i32 %72, 2
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %71
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %75, %71, %67
  br label %77

77:                                               ; preds = %76, %57
  %78 = load i32, ptr %13, align 4, !tbaa !9
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %106

80:                                               ; preds = %77
  %81 = load i64, ptr %11, align 8, !tbaa !5
  call void @UnityTestResultsFailBegin(i64 noundef %81)
  call void @UnityPrint(ptr noundef @UnityStrExpected)
  %82 = load i64, ptr %8, align 8, !tbaa !5
  %83 = load i32, ptr %12, align 4, !tbaa !9
  call void @UnityPrintNumberByStyle(i64 noundef %82, i32 noundef %83)
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = and i32 %84, 2
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %80
  call void @UnityPrint(ptr noundef @UnityStrGt)
  br label %88

88:                                               ; preds = %87, %80
  %89 = load i32, ptr %9, align 4, !tbaa !9
  %90 = and i32 %89, 4
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %88
  call void @UnityPrint(ptr noundef @UnityStrLt)
  br label %93

93:                                               ; preds = %92, %88
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = and i32 %94, 1
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %98

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

98:                                               ; preds = %97, %93
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %98
  call void @UnityPrint(ptr noundef @UnityStrNotEqual)
  br label %102

102:                                              ; preds = %101, %98
  %103 = load i64, ptr %7, align 8, !tbaa !5
  %104 = load i32, ptr %12, align 4, !tbaa !9
  call void @UnityPrintNumberByStyle(i64 noundef %103, i32 noundef %104)
  %105 = load ptr, ptr %10, align 8, !tbaa !11
  call void @UnityAddMsgIfSpecified(ptr noundef %105)
  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

106:                                              ; preds = %77
  store i32 0, ptr %14, align 4
  br label %107

107:                                              ; preds = %106, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  %108 = load i32, ptr %14, align 4
  switch i32 %108, label %110 [
    i32 0, label %109
    i32 1, label %109
  ]

109:                                              ; preds = %107, %107
  ret void

110:                                              ; preds = %107
  unreachable
}

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 = !{!"long", !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 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 64}
!14 = !{!"UNITY_STORAGE_T", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !7, i64 80}
!15 = !{!14, !6, 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
@UnityStrGt = external hidden constant [21 x i8], align 16
@UnityStrLt = external hidden constant [18 x i8], align 16
@UnityStrOrEqual = external hidden constant [13 x i8], align 1
@UnityStrNotEqual = external hidden constant [21 x i8], align 16

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

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrintNumberByStyle(i64 noundef, i32 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
define dso_local void @UnityAssertGreaterOrLessOrEqualNumber(i64 noundef %0, i64 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 ne i64 %0, %1
  %14 = and i32 %2, 1
  %.not = icmp eq i32 %14, 0
  %or.cond39 = or i1 %13, %.not
  br i1 %or.cond39, label %15, label %34

15:                                               ; preds = %12
  %not. = xor i1 %13, true
  %spec.select = zext i1 %not. to i32
  %16 = and i32 %5, 16
  %.not29 = icmp eq i32 %16, 0
  %17 = and i32 %2, 4
  %.not30 = icmp eq i32 %17, 0
  %18 = and i32 %2, 2
  %.not31 = icmp eq i32 %18, 0
  br i1 %.not29, label %22, label %19

19:                                               ; preds = %15
  %20 = icmp sle i64 %1, %0
  %or.cond40 = or i1 %20, %.not30
  %.1 = select i1 %or.cond40, i32 %spec.select, i32 1
  %21 = icmp sge i64 %1, %0
  %or.cond41 = or i1 %21, %.not31
  br i1 %or.cond41, label %select.unfold, label %.critedge

22:                                               ; preds = %15
  %23 = icmp ule i64 %1, %0
  %or.cond42 = or i1 %23, %.not30
  %.2 = select i1 %or.cond42, i32 %spec.select, i32 1
  %24 = icmp uge i64 %1, %0
  %or.cond43 = or i1 %24, %.not31
  br i1 %or.cond43, label %select.unfold, label %.critedge

select.unfold:                                    ; preds = %22, %19
  %.3 = phi i32 [ %.1, %19 ], [ %.2, %22 ]
  %.not34 = icmp eq i32 %.3, 0
  br i1 %.not34, label %34, label %select.unfold..thread_crit_edge

select.unfold..thread_crit_edge:                  ; preds = %select.unfold
  %.pre = and i32 %2, 2
  %25 = icmp eq i32 %.pre, 0
  tail call void @UnityTestResultsFailBegin(i64 noundef %4)
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrExpected)
  tail call void @UnityPrintNumberByStyle(i64 noundef %1, i32 noundef %5)
  br i1 %25, label %27, label %26

.critedge:                                        ; preds = %19, %22
  tail call void @UnityTestResultsFailBegin(i64 noundef %4)
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrExpected)
  tail call void @UnityPrintNumberByStyle(i64 noundef %1, i32 noundef %5)
  br label %26

26:                                               ; preds = %.critedge, %select.unfold..thread_crit_edge
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrGt)
  br label %27

27:                                               ; preds = %26, %select.unfold..thread_crit_edge
  %28 = and i32 %2, 4
  %.not36 = icmp eq i32 %28, 0
  br i1 %.not36, label %30, label %29

29:                                               ; preds = %27
  tail call void @UnityPrint(ptr noundef nonnull @UnityStrLt)
  br label %30

30:                                               ; preds = %29, %27
  br i1 %.not, label %31, label %.sink.split

31:                                               ; preds = %30
  %32 = icmp eq i32 %2, 0
  br i1 %32, label %.sink.split, label %33

.sink.split:                                      ; preds = %31, %30
  %UnityStrOrEqual.sink = phi ptr [ @UnityStrOrEqual, %30 ], [ @UnityStrNotEqual, %31 ]
  tail call void @UnityPrint(ptr noundef nonnull %UnityStrOrEqual.sink)
  br label %33

33:                                               ; preds = %.sink.split, %31
  tail call void @UnityPrintNumberByStyle(i64 noundef %0, i32 noundef %5)
  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

34:                                               ; preds = %select.unfold, %12
  ret void
}

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}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass