This could be
```
if (stack == stackbuf)
{
    malloc
    memcpy
}
else
    realloc
```