; LLVM IR from CactiLab/Sherloc-Cortex-M-CFVD :: Sherloc_runtime/freertos (stream_buffer)

; 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.xTIME_OUT = type { i64, i32 }
%struct.StreamBufferDef_t = type { i64, i64, i64, i64, ptr, ptr, ptr, i8, i64 }

; 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

declare void @vPortEnterCritical() #1

declare void @vPortExitCritical() #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @xStreamBufferSpacesAvailable(ptr noundef) #2 section "privileged_functions"

; Function Attrs: nounwind uwtable
declare hidden i64 @prvBytesInBuffer(ptr noundef) #2 section "privileged_functions"

; Function Attrs: nounwind uwtable
define dso_local i64 @xStreamBufferSend(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) #2 section "privileged_functions" {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %struct.xTIME_OUT, align 8
  %14 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %15, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %16 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %16, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  store i64 0, ptr %14, align 8, !tbaa !9
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %21

19:                                               ; preds = %4
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !13
  br label %20

20:                                               ; preds = %20, %19
  br label %20

21:                                               ; preds = %4
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %26

24:                                               ; preds = %21
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !14
  br label %25

25:                                               ; preds = %25, %24
  br label %25

26:                                               ; preds = %21
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %27, i32 0, i32 2
  %29 = load i64, ptr %28, align 8, !tbaa !15
  %30 = sub i64 %29, 1
  store i64 %30, ptr %14, align 8, !tbaa !9
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %31, i32 0, i32 7
  %33 = load i8, ptr %32, align 8, !tbaa !17
  %34 = zext i8 %33 to i32
  %35 = and i32 %34, 1
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %54

37:                                               ; preds = %26
  %38 = load i64, ptr %12, align 8, !tbaa !9
  %39 = add i64 %38, 8
  store i64 %39, ptr %12, align 8, !tbaa !9
  %40 = load i64, ptr %12, align 8, !tbaa !9
  %41 = load i64, ptr %7, align 8, !tbaa !9
  %42 = icmp ugt i64 %40, %41
  %43 = zext i1 %42 to i32
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %45, label %47

45:                                               ; preds = %37
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !18
  br label %46

46:                                               ; preds = %46, %45
  br label %46

47:                                               ; preds = %37
  %48 = load i64, ptr %12, align 8, !tbaa !9
  %49 = load i64, ptr %14, align 8, !tbaa !9
  %50 = icmp ugt i64 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %53

52:                                               ; preds = %47
  br label %53

53:                                               ; preds = %52, %51
  br label %62

54:                                               ; preds = %26
  %55 = load i64, ptr %12, align 8, !tbaa !9
  %56 = load i64, ptr %14, align 8, !tbaa !9
  %57 = icmp ugt i64 %55, %56
  br i1 %57, label %58, label %60

58:                                               ; preds = %54
  %59 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %59, ptr %12, align 8, !tbaa !9
  br label %61

60:                                               ; preds = %54
  br label %61

61:                                               ; preds = %60, %58
  br label %62

62:                                               ; preds = %61, %53
  %63 = load i32, ptr %8, align 4, !tbaa !11
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %96

65:                                               ; preds = %62
  call void @vTaskSetTimeOutState(ptr noundef %13)
  br label %66

66:                                               ; preds = %92, %65
  call void @vPortEnterCritical()
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = call i64 @xStreamBufferSpacesAvailable(ptr noundef %67)
  store i64 %68, ptr %11, align 8, !tbaa !9
  %69 = load i64, ptr %11, align 8, !tbaa !9
  %70 = load i64, ptr %12, align 8, !tbaa !9
  %71 = icmp ult i64 %69, %70
  br i1 %71, label %72, label %86

72:                                               ; preds = %66
  %73 = call i64 @xTaskGenericNotifyStateClear(ptr noundef null, i64 noundef 0)
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %74, i32 0, i32 5
  %76 = load volatile ptr, ptr %75, align 8, !tbaa !19
  %77 = icmp eq ptr %76, null
  %78 = zext i1 %77 to i32
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %82

80:                                               ; preds = %72
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !20
  br label %81

81:                                               ; preds = %81, %80
  br label %81

82:                                               ; preds = %72
  %83 = call ptr @xTaskGetCurrentTaskHandle()
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %84, i32 0, i32 5
  store volatile ptr %83, ptr %85, align 8, !tbaa !19
  br label %87

86:                                               ; preds = %66
  call void @vPortExitCritical()
  br label %95

87:                                               ; preds = %82
  call void @vPortExitCritical()
  %88 = load i32, ptr %8, align 4, !tbaa !11
  %89 = call i64 @xTaskGenericNotifyWait(i64 noundef 0, i32 noundef 0, i32 noundef 0, ptr noundef null, i32 noundef %88)
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %90, i32 0, i32 5
  store volatile ptr null, ptr %91, align 8, !tbaa !19
  br label %92

92:                                               ; preds = %87
  %93 = call i64 @xTaskCheckForTimeOut(ptr noundef %13, ptr noundef %8)
  %94 = icmp eq i64 %93, 0
  br i1 %94, label %66, label %95, !llvm.loop !21

95:                                               ; preds = %92, %86
  br label %97

96:                                               ; preds = %62
  br label %97

97:                                               ; preds = %96, %95
  %98 = load i64, ptr %11, align 8, !tbaa !9
  %99 = icmp eq i64 %98, 0
  br i1 %99, label %100, label %103

100:                                              ; preds = %97
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = call i64 @xStreamBufferSpacesAvailable(ptr noundef %101)
  store i64 %102, ptr %11, align 8, !tbaa !9
  br label %104

103:                                              ; preds = %97
  br label %104

104:                                              ; preds = %103, %100
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = load i64, ptr %7, align 8, !tbaa !9
  %108 = load i64, ptr %11, align 8, !tbaa !9
  %109 = load i64, ptr %12, align 8, !tbaa !9
  %110 = call i64 @prvWriteMessageToBuffer(ptr noundef %105, ptr noundef %106, i64 noundef %107, i64 noundef %108, i64 noundef %109)
  store i64 %110, ptr %10, align 8, !tbaa !9
  %111 = load i64, ptr %10, align 8, !tbaa !9
  %112 = icmp ugt i64 %111, 0
  br i1 %112, label %113, label %136

113:                                              ; preds = %104
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = call i64 @prvBytesInBuffer(ptr noundef %114)
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %116, i32 0, i32 3
  %118 = load i64, ptr %117, align 8, !tbaa !23
  %119 = icmp uge i64 %115, %118
  br i1 %119, label %120, label %134

120:                                              ; preds = %113
  call void @vTaskSuspendAll()
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %121, i32 0, i32 4
  %123 = load volatile ptr, ptr %122, align 8, !tbaa !24
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %132

125:                                              ; preds = %120
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %126, i32 0, i32 4
  %128 = load volatile ptr, ptr %127, align 8, !tbaa !24
  %129 = call i64 @xTaskGenericNotify(ptr noundef %128, i64 noundef 0, i32 noundef 0, i32 noundef 0, ptr noundef null)
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.StreamBufferDef_t, ptr %130, i32 0, i32 4
  store volatile ptr null, ptr %131, align 8, !tbaa !24
  br label %132

132:                                              ; preds = %125, %120
  %133 = call i64 @xTaskResumeAll()
  br label %135

134:                                              ; preds = %113
  br label %135

135:                                              ; preds = %134, %132
  br label %137

136:                                              ; preds = %104
  br label %137

137:                                              ; preds = %136, %135
  %138 = load i64, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret i64 %138
}

declare void @vTaskSetTimeOutState(ptr noundef) #1 section "privileged_functions"

declare i64 @xTaskGenericNotifyStateClear(ptr noundef, i64 noundef) #1 section "privileged_functions"

declare ptr @xTaskGetCurrentTaskHandle() #1 section "privileged_functions"

declare i64 @xTaskGenericNotifyWait(i64 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #1 section "privileged_functions"

declare i64 @xTaskCheckForTimeOut(ptr noundef, ptr noundef) #1 section "privileged_functions"

; Function Attrs: nounwind uwtable
declare hidden i64 @prvWriteMessageToBuffer(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) #2 section "privileged_functions"

declare void @vTaskSuspendAll() #1 section "privileged_functions"

declare i64 @xTaskGenericNotify(ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef) #1 section "privileged_functions"

declare i64 @xTaskResumeAll() #1 section "privileged_functions"

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 2148087250}
!14 = !{i64 2148087392}
!15 = !{!16, !10, i64 16}
!16 = !{!"StreamBufferDef_t", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !10, i64 64}
!17 = !{!16, !7, i64 56}
!18 = !{i64 2148087625}
!19 = !{!16, !6, i64 40}
!20 = !{i64 2148087956}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!16, !10, i64 24}
!24 = !{!16, !6, i64 32}


; 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.xTIME_OUT = type { i64, i32 }

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

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

declare void @vPortEnterCritical() local_unnamed_addr #1

declare void @vPortExitCritical() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @xStreamBufferSpacesAvailable(ptr noundef) local_unnamed_addr #2 section "privileged_functions"

; Function Attrs: nounwind uwtable
declare hidden i64 @prvBytesInBuffer(ptr noundef) local_unnamed_addr #2 section "privileged_functions"

; Function Attrs: nounwind uwtable
define dso_local i64 @xStreamBufferSend(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) local_unnamed_addr #2 section "privileged_functions" {
  %5 = alloca i32, align 4
  %6 = alloca %struct.xTIME_OUT, align 8
  store i32 %3, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %7 = icmp eq ptr %1, null
  br i1 %7, label %8, label %10

8:                                                ; preds = %4
  tail call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !9
  br label %9

9:                                                ; preds = %9, %8
  br label %9

10:                                               ; preds = %4
  %11 = icmp eq ptr %0, null
  br i1 %11, label %12, label %14

12:                                               ; preds = %10
  tail call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !10
  br label %13

13:                                               ; preds = %13, %12
  br label %13

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load i64, ptr %15, align 8, !tbaa !11
  %17 = add i64 %16, -1
  %18 = getelementptr inbounds i8, ptr %0, i64 56
  %19 = load i8, ptr %18, align 8, !tbaa !15
  %20 = and i8 %19, 1
  %.not = icmp eq i8 %20, 0
  br i1 %.not, label %28, label %21

21:                                               ; preds = %14
  %22 = add i64 %2, 8
  %23 = icmp ugt i64 %2, -9
  br i1 %23, label %24, label %26

24:                                               ; preds = %21
  tail call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !16
  br label %25

25:                                               ; preds = %25, %24
  br label %25

26:                                               ; preds = %21
  %27 = icmp ugt i64 %22, %17
  br i1 %27, label %.thread, label %29

.thread:                                          ; preds = %26
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %.thread50

28:                                               ; preds = %14
  %spec.select = tail call i64 @llvm.umin.i64(i64 %17, i64 %2)
  br label %29

29:                                               ; preds = %28, %26
  %.0.ph = phi i64 [ %spec.select, %28 ], [ %22, %26 ]
  %.not42 = icmp eq i32 %3, 0
  br i1 %.not42, label %.thread50, label %30

30:                                               ; preds = %29
  call void @vTaskSetTimeOutState(ptr noundef nonnull %6) #4
  %31 = getelementptr inbounds i8, ptr %0, i64 40
  br label %32

32:                                               ; preds = %40, %30
  call void @vPortEnterCritical() #4
  %33 = call i64 @xStreamBufferSpacesAvailable(ptr noundef nonnull %0)
  %34 = icmp ult i64 %33, %.0.ph
  br i1 %34, label %35, label %46

35:                                               ; preds = %32
  %36 = call i64 @xTaskGenericNotifyStateClear(ptr noundef null, i64 noundef 0) #4
  %37 = load volatile ptr, ptr %31, align 8, !tbaa !17
  %.not43 = icmp eq ptr %37, null
  br i1 %.not43, label %40, label %38

38:                                               ; preds = %35
  call void asm sideeffect " cpsid i ", "~{memory},~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !18
  br label %39

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

40:                                               ; preds = %35
  %41 = call ptr @xTaskGetCurrentTaskHandle() #4
  store volatile ptr %41, ptr %31, align 8, !tbaa !17
  call void @vPortExitCritical() #4
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = call i64 @xTaskGenericNotifyWait(i64 noundef 0, i32 noundef 0, i32 noundef 0, ptr noundef null, i32 noundef %42) #4
  store volatile ptr null, ptr %31, align 8, !tbaa !17
  %44 = call i64 @xTaskCheckForTimeOut(ptr noundef nonnull %6, ptr noundef nonnull %5) #4
  %45 = icmp eq i64 %44, 0
  br i1 %45, label %32, label %.loopexit, !llvm.loop !19

46:                                               ; preds = %32
  call void @vPortExitCritical() #4
  br label %.loopexit

.loopexit:                                        ; preds = %40, %46
  %47 = icmp eq i64 %33, 0
  br i1 %47, label %.thread50, label %49

.thread50:                                        ; preds = %.thread, %29, %.loopexit
  %.04954 = phi i64 [ %.0.ph, %.loopexit ], [ %22, %.thread ], [ %.0.ph, %29 ]
  %48 = call i64 @xStreamBufferSpacesAvailable(ptr noundef nonnull %0)
  br label %49

49:                                               ; preds = %.loopexit, %.thread50
  %.04953 = phi i64 [ %.04954, %.thread50 ], [ %.0.ph, %.loopexit ]
  %.1 = phi i64 [ %48, %.thread50 ], [ %33, %.loopexit ]
  %50 = call i64 @prvWriteMessageToBuffer(ptr noundef nonnull %0, ptr noundef nonnull %1, i64 noundef %2, i64 noundef %.1, i64 noundef %.04953)
  %.not44 = icmp eq i64 %50, 0
  br i1 %.not44, label %63, label %51

51:                                               ; preds = %49
  %52 = call i64 @prvBytesInBuffer(ptr noundef nonnull %0)
  %53 = getelementptr inbounds i8, ptr %0, i64 24
  %54 = load i64, ptr %53, align 8, !tbaa !21
  %.not45 = icmp ult i64 %52, %54
  br i1 %.not45, label %63, label %55

55:                                               ; preds = %51
  call void @vTaskSuspendAll() #4
  %56 = getelementptr inbounds i8, ptr %0, i64 32
  %57 = load volatile ptr, ptr %56, align 8, !tbaa !22
  %.not46 = icmp eq ptr %57, null
  br i1 %.not46, label %61, label %58

58:                                               ; preds = %55
  %59 = load volatile ptr, ptr %56, align 8, !tbaa !22
  %60 = call i64 @xTaskGenericNotify(ptr noundef %59, i64 noundef 0, i32 noundef 0, i32 noundef 0, ptr noundef null) #4
  store volatile ptr null, ptr %56, align 8, !tbaa !22
  br label %61

61:                                               ; preds = %58, %55
  %62 = call i64 @xTaskResumeAll() #4
  br label %63

63:                                               ; preds = %49, %61, %51
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  ret i64 %50
}

declare void @vTaskSetTimeOutState(ptr noundef) local_unnamed_addr #1 section "privileged_functions"

declare i64 @xTaskGenericNotifyStateClear(ptr noundef, i64 noundef) local_unnamed_addr #1 section "privileged_functions"

declare ptr @xTaskGetCurrentTaskHandle() local_unnamed_addr #1 section "privileged_functions"

declare i64 @xTaskGenericNotifyWait(i64 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1 section "privileged_functions"

declare i64 @xTaskCheckForTimeOut(ptr noundef, ptr noundef) local_unnamed_addr #1 section "privileged_functions"

; Function Attrs: nounwind uwtable
declare hidden i64 @prvWriteMessageToBuffer(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2 section "privileged_functions"

declare void @vTaskSuspendAll() local_unnamed_addr #1 section "privileged_functions"

declare i64 @xTaskGenericNotify(ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1 section "privileged_functions"

declare i64 @xTaskResumeAll() local_unnamed_addr #1 section "privileged_functions"

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i64 2148087250}
!10 = !{i64 2148087392}
!11 = !{!12, !13, i64 16}
!12 = !{!"StreamBufferDef_t", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !7, i64 56, !13, i64 64}
!13 = !{!"long", !7, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!12, !7, i64 56}
!16 = !{i64 2148087625}
!17 = !{!12, !14, i64 40}
!18 = !{i64 2148087956}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!12, !13, i64 24}
!22 = !{!12, !14, i64 32}


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