; 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

; 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

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

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

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

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

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

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

18:                                               ; preds = %14
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %69

21:                                               ; preds = %18
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %69

24:                                               ; preds = %21
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %65, %24
  %26 = load i32, ptr %11, align 4, !tbaa !9
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = icmp ult i32 %26, %27
  br i1 %28, label %29, label %47

29:                                               ; preds = %25
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = load i32, ptr %11, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds i8, ptr %30, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !16
  %35 = sext i8 %34 to i32
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %45, label %37

37:                                               ; preds = %29
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load i32, ptr %11, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %38, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !16
  %43 = sext i8 %42 to i32
  %44 = icmp ne i32 %43, 0
  br label %45

45:                                               ; preds = %37, %29
  %46 = phi i1 [ true, %29 ], [ %44, %37 ]
  br label %47

47:                                               ; preds = %45, %25
  %48 = phi i1 [ false, %25 ], [ %46, %45 ]
  br i1 %48, label %49, label %68

49:                                               ; preds = %47
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %50, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !16
  %55 = sext i8 %54 to i32
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds i8, ptr %56, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !16
  %61 = sext i8 %60 to i32
  %62 = icmp ne i32 %55, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %49
  store i64 1, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !13
  br label %68

64:                                               ; preds = %49
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = add i32 %66, 1
  store i32 %67, ptr %11, align 4, !tbaa !9
  br label %25, !llvm.loop !17

68:                                               ; preds = %63, %47
  br label %75

69:                                               ; preds = %21, %18
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = icmp ne ptr %70, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %69
  store i64 1, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !13
  br label %74

74:                                               ; preds = %73, %69
  br label %75

75:                                               ; preds = %74, %68
  %76 = load i64, ptr getelementptr inbounds (%struct.UNITY_STORAGE_T, ptr @Unity, i32 0, i32 8), align 8, !tbaa !13
  %77 = icmp ne i64 %76, 0
  br i1 %77, label %78, label %84

78:                                               ; preds = %75
  %79 = load i64, ptr %10, align 8, !tbaa !11
  call void @UnityTestResultsFailBegin(i64 noundef %79)
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !9
  call void @UnityPrintExpectedAndActualStringsLen(ptr noundef %80, ptr noundef %81, i32 noundef %82)
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  call void @UnityAddMsgIfSpecified(ptr noundef %83)
  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

84:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @UnityPrintExpectedAndActualStringsLen(ptr noundef, ptr noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 }
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 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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

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

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

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

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

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

11:                                               ; preds = %5
  %12 = icmp ne ptr %0, null
  %13 = icmp ne ptr %1, null
  %or.cond3 = and i1 %12, %13
  br i1 %or.cond3, label %.preheader, label %19

.preheader:                                       ; preds = %11
  %.not33 = icmp eq i32 %2, 0
  br i1 %.not33, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext i32 %2 to i64
  br label %.lr.ph

14:                                               ; preds = %.critedge5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph.preheader, %14
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %14 ]
  %15 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv
  %16 = load i8, ptr %15, align 1, !tbaa !13
  %.not26 = icmp eq i8 %16, 0
  %17 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv
  %18 = load i8, ptr %17, align 1, !tbaa !13
  %.not27 = icmp eq i8 %18, 0
  %or.cond35 = select i1 %.not26, i1 %.not27, i1 false
  br i1 %or.cond35, label %.critedge, label %.critedge5

.critedge5:                                       ; preds = %.lr.ph
  %.not28 = icmp eq i8 %16, %18
  br i1 %.not28, label %14, label %.critedge.thread

19:                                               ; preds = %11
  %.not = icmp eq ptr %0, %1
  br i1 %.not, label %.critedge, label %.critedge.thread

.critedge.thread:                                 ; preds = %.critedge5, %19
  store i64 1, ptr getelementptr inbounds (i8, ptr @Unity, i64 64), align 8, !tbaa !5
  tail call void @UnityTestResultsFailBegin(i64 noundef %4)
  tail call void @UnityPrintExpectedAndActualStringsLen(ptr noundef %0, ptr noundef %1, i32 noundef %2)
  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

.critedge:                                        ; preds = %14, %.lr.ph, %19, %.preheader
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @UnityPrintExpectedAndActualStringsLen(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { 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 #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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!8, !8, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass