@startuml
scale 820 width
top to bottom direction
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName Monospace
skinparam defaultFontSize 9
skinparam rectangleBorderColor #2c7794
skinparam rectangleBackgroundColor #edf6fa
skinparam ArrowColor #8095a1
title A5 FLOW — eight deterministic Hazard3 replay states

rectangle "01 E01 RESET\n1 block · free=4080\nraw header=8 · aligned=16" as S1
rectangle "02 E02 ALLOC A(24)\nconsumed=48\nfree=4032" as S2
rectangle "03 E03 ALLOC B(40)\nconsumed=64\nfree=3968" as S3
rectangle "04 E04 ALLOC C(16)\nconsumed=32\nfree=3936" as S4
rectangle "05 E05 FREE A\n2 free blocks\nfree=3984" as S5
rectangle "06 E06 FREE C\n2 blocks · fragmented\nfree=4016" as S6
rectangle "07 E07 FREE B\nmerge left + right\n1 block · free=4080" as S7
rectangle "08 E08 OOM / VERIFY\nNULL · hook=1\nasserts=0 · PASS=1" as S8

S1 -right-> S2 : pvPortMalloc
S2 -right-> S3 : split remainder
S3 -right-> S4 : split remainder
S4 -down-> S5 : vPortFree(A)
S5 -left-> S6 : vPortFree(C)
S6 -left-> S7 : vPortFree(B)
S7 -left-> S8 : oversized request
@enduml
