/* Found in the Linux kernel. */
static void cpuhp_bp_sync_dead(unsigned int cpu)
{
    atomic_t *st = per_cpu_ptr(&cpuhp_state.ap_sync_state, cpu);
    int sync = atomic_read(st);
    do {
        /* CPU can have reported dead already. Don't overwrite that! */
        if (sync == SYNC_STATE_DEAD)
            break;
    } while (!atomic_try_cmpxchg(st, &sync, SYNC_STATE_SHOULD_DIE));
}

void more_ugly_do_issues(int *ptr) {
    // Indented.
    do
        while (*ptr--);
    while (*ptr--);
    // Not indented!
    do {}
    while (*ptr--);
    while (*ptr--);
}
