; 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"

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

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrintNumberHex(i64 noundef, i8 noundef signext) #1

; Function Attrs: nounwind uwtable
define dso_local void @UnityPrintNumberByStyle(i64 noundef %0, i32 noundef %1) #1 {
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  store i64 %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %5 = load i32, ptr %4, align 4, !tbaa !9
  %6 = and i32 %5, 16
  %7 = icmp eq i32 %6, 16
  br i1 %7, label %8, label %45

8:                                                ; preds = %2
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = icmp eq i32 %9, 145
  br i1 %10, label %11, label %42

11:                                               ; preds = %8
  %12 = call i32 @putchar(i32 noundef 39)
  %13 = load i64, ptr %3, align 8, !tbaa !5
  %14 = icmp sle i64 %13, 126
  br i1 %14, label %15, label %22

15:                                               ; preds = %11
  %16 = load i64, ptr %3, align 8, !tbaa !5
  %17 = icmp sge i64 %16, 32
  br i1 %17, label %18, label %22

18:                                               ; preds = %15
  %19 = load i64, ptr %3, align 8, !tbaa !5
  %20 = trunc i64 %19 to i32
  %21 = call i32 @putchar(i32 noundef %20)
  br label %40

22:                                               ; preds = %15, %11
  %23 = load i64, ptr %3, align 8, !tbaa !5
  %24 = icmp eq i64 %23, 13
  br i1 %24, label %25, label %28

25:                                               ; preds = %22
  %26 = call i32 @putchar(i32 noundef 92)
  %27 = call i32 @putchar(i32 noundef 114)
  br label %39

28:                                               ; preds = %22
  %29 = load i64, ptr %3, align 8, !tbaa !5
  %30 = icmp eq i64 %29, 10
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = call i32 @putchar(i32 noundef 92)
  %33 = call i32 @putchar(i32 noundef 110)
  br label %38

34:                                               ; preds = %28
  %35 = call i32 @putchar(i32 noundef 92)
  %36 = call i32 @putchar(i32 noundef 120)
  %37 = load i64, ptr %3, align 8, !tbaa !5
  call void @UnityPrintNumberHex(i64 noundef %37, i8 noundef signext 2)
  br label %38

38:                                               ; preds = %34, %31
  br label %39

39:                                               ; preds = %38, %25
  br label %40

40:                                               ; preds = %39, %18
  %41 = call i32 @putchar(i32 noundef 39)
  br label %44

42:                                               ; preds = %8
  %43 = load i64, ptr %3, align 8, !tbaa !5
  call void @UnityPrintNumber(i64 noundef %43)
  br label %44

44:                                               ; preds = %42, %40
  br label %60

45:                                               ; preds = %2
  %46 = load i32, ptr %4, align 4, !tbaa !9
  %47 = and i32 %46, 32
  %48 = icmp eq i32 %47, 32
  br i1 %48, label %49, label %51

49:                                               ; preds = %45
  %50 = load i64, ptr %3, align 8, !tbaa !5
  call void @UnityPrintNumberUnsigned(i64 noundef %50)
  br label %59

51:                                               ; preds = %45
  %52 = call i32 @putchar(i32 noundef 48)
  %53 = call i32 @putchar(i32 noundef 120)
  %54 = load i64, ptr %3, align 8, !tbaa !5
  %55 = load i32, ptr %4, align 4, !tbaa !9
  %56 = and i32 %55, 15
  %57 = mul i32 %56, 2
  %58 = trunc i32 %57 to i8
  call void @UnityPrintNumberHex(i64 noundef %54, i8 noundef signext %58)
  br label %59

59:                                               ; preds = %51, %49
  br label %60

60:                                               ; preds = %59, %44
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrintNumber(i64 noundef) #1

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

attributes #0 = { 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 #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" }

!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}


; 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"

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

; Function Attrs: nounwind uwtable
declare dso_local void @UnityPrintNumberHex(i64 noundef, i8 noundef signext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @UnityPrintNumberByStyle(i64 noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = and i32 %1, 16
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %23, label %4

4:                                                ; preds = %2
  %5 = icmp eq i32 %1, 145
  br i1 %5, label %6, label %22

6:                                                ; preds = %4
  %7 = tail call i32 @putchar(i32 noundef 39)
  %8 = add i64 %0, -32
  %or.cond = icmp ult i64 %8, 95
  br i1 %or.cond, label %9, label %12

9:                                                ; preds = %6
  %10 = trunc nuw nsw i64 %0 to i32
  %11 = tail call i32 @putchar(i32 noundef %10)
  br label %20

12:                                               ; preds = %6
  %13 = tail call i32 @putchar(i32 noundef 92)
  switch i64 %0, label %18 [
    i64 13, label %14
    i64 10, label %16
  ]

14:                                               ; preds = %12
  %15 = tail call i32 @putchar(i32 noundef 114)
  br label %20

16:                                               ; preds = %12
  %17 = tail call i32 @putchar(i32 noundef 110)
  br label %20

18:                                               ; preds = %12
  %19 = tail call i32 @putchar(i32 noundef 120)
  tail call void @UnityPrintNumberHex(i64 noundef %0, i8 noundef signext 2)
  br label %20

20:                                               ; preds = %14, %18, %16, %9
  %21 = tail call i32 @putchar(i32 noundef 39)
  br label %31

22:                                               ; preds = %4
  tail call void @UnityPrintNumber(i64 noundef %0)
  br label %31

23:                                               ; preds = %2
  %24 = and i32 %1, 32
  %.not14 = icmp eq i32 %24, 0
  br i1 %.not14, label %26, label %25

25:                                               ; preds = %23
  tail call void @UnityPrintNumberUnsigned(i64 noundef %0)
  br label %31

26:                                               ; preds = %23
  %27 = tail call i32 @putchar(i32 noundef 48)
  %28 = tail call i32 @putchar(i32 noundef 120)
  %.tr = trunc i32 %1 to i8
  %29 = shl i8 %.tr, 1
  %30 = and i8 %29, 30
  tail call void @UnityPrintNumberHex(i64 noundef %0, i8 noundef signext %30)
  br label %31

31:                                               ; preds = %25, %26, %20, %22
  ret void
}

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

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

attributes #0 = { 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 #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" }

!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)"}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass