I find this test really, really, really confusing.

The test is:

```
if first_live != last_live (there's more than one live child) or
    first_live != 0 (the first live child isn't the first ref), or
    first_live != refcnt - 1 (the first live child isn't the last reference)
```

How is it possible for the first live child to be both the first and last reference, unless there's only a single reference in total?

Should this have been:

```
if ((split = visit_state.first_live) != visit_state.last_live || (split != 0 && split != refcnt - 1))
```

If so, I'd write it as:

```
if (visit_state.first_live == visit_state.last_live &&
    (visit_state.first_live == 0 || visit_state.first_live == refcnt -1)) {
        split = special;
else
        split = (refcnt + 1) / 2;
```