__sync_branch_idx
p = __sync_child(p)[__sync_branch_idx(p, id)];
idx = __sync_branch_idx(p->parent, id);
idx = __sync_branch_idx(p, id);