static int no_run_out (HWVoiceOut *hw, int live)

{

    NoVoiceOut *no = (NoVoiceOut *) hw;

    int decr, samples;

    int64_t now;

    int64_t ticks;

    int64_t bytes;



    now = qemu_get_clock (vm_clock);

    ticks = now - no->old_ticks;

    bytes = muldiv64 (ticks, hw->info.bytes_per_second, get_ticks_per_sec ());

    bytes = audio_MIN (bytes, INT_MAX);

    samples = bytes >> hw->info.shift;



    no->old_ticks = now;

    decr = audio_MIN (live, samples);

    hw->rpos = (hw->rpos + decr) % hw->samples;

    return decr;

}

static int no_run_out (HWVoiceOut *hw, int live)

{

    NoVoiceOut *no = (NoVoiceOut *) hw;

    int decr, samples;

    int64_t now;

    int64_t ticks;

    int64_t bytes;



    now = qemu_get_clock (vm_clock);

    ticks = now - no->old_ticks;

    bytes = muldiv64 (ticks, hw->info.bytes_per_second, get_ticks_per_sec ());

    bytes = audio_MIN (bytes, INT_MAX);

    samples = bytes >> hw->info.shift;



    no->old_ticks = now;

    decr = audio_MIN (live, samples);

    hw->rpos = (hw->rpos + decr) % hw->samples;

    return decr;

}

static int FUNC_0 (HWVoiceOut *VAR_0, int VAR_1)

{

    NoVoiceOut *no = (NoVoiceOut *) VAR_0;

    int VAR_2, VAR_3;

    int64_t now;

    int64_t ticks;

    int64_t bytes;



    now = qemu_get_clock (vm_clock);

    ticks = now - no->old_ticks;

    bytes = muldiv64 (ticks, VAR_0->info.bytes_per_second, get_ticks_per_sec ());

    bytes = audio_MIN (bytes, INT_MAX);

    VAR_3 = bytes >> VAR_0->info.shift;



    no->old_ticks = now;

    VAR_2 = audio_MIN (VAR_1, VAR_3);

    VAR_0->rpos = (VAR_0->rpos + VAR_2) % VAR_0->VAR_3;

    return VAR_2;

}

static int FUNC_0 (HWVoiceOut *VAR_0, int VAR_1)
{ NoVoiceOut *no = (NoVoiceOut *) VAR_0; int VAR_2, VAR_3; int64_t now; int64_t ticks; int64_t bytes; now = qemu_get_clock (vm_clock); ticks = now - no->old_ticks; bytes = muldiv64 (ticks, VAR_0->info.bytes_per_second, get_ticks_per_sec ()); bytes = audio_MIN (bytes, INT_MAX); VAR_3 = bytes >> VAR_0->info.shift; no->old_ticks = now; VAR_2 = audio_MIN (VAR_1, VAR_3); VAR_0->rpos = (VAR_0->rpos + VAR_2) % VAR_0->VAR_3; return VAR_2; }