void throttle_account(ThrottleState *ts, bool is_write, uint64_t size)

{

    double units = 1.0;



    /* if cfg.op_size is defined and smaller than size we compute unit count */

    if (ts->cfg.op_size && size > ts->cfg.op_size) {

        units = (double) size / ts->cfg.op_size;

    }



    ts->cfg.buckets[THROTTLE_BPS_TOTAL].level += size;

    ts->cfg.buckets[THROTTLE_OPS_TOTAL].level += units;



    if (is_write) {

        ts->cfg.buckets[THROTTLE_BPS_WRITE].level += size;

        ts->cfg.buckets[THROTTLE_OPS_WRITE].level += units;

    } else {

        ts->cfg.buckets[THROTTLE_BPS_READ].level += size;

        ts->cfg.buckets[THROTTLE_OPS_READ].level += units;

    }

}

void throttle_account(ThrottleState *ts, bool is_write, uint64_t size)

{

    double units = 1.0;



    

    if (ts->cfg.op_size && size > ts->cfg.op_size) {

        units = (double) size / ts->cfg.op_size;

    }



    ts->cfg.buckets[THROTTLE_BPS_TOTAL].level += size;

    ts->cfg.buckets[THROTTLE_OPS_TOTAL].level += units;



    if (is_write) {

        ts->cfg.buckets[THROTTLE_BPS_WRITE].level += size;

        ts->cfg.buckets[THROTTLE_OPS_WRITE].level += units;

    } else {

        ts->cfg.buckets[THROTTLE_BPS_READ].level += size;

        ts->cfg.buckets[THROTTLE_OPS_READ].level += units;

    }

}

    ts->cfg.buckets[THROTTLE_BPS_TOTAL].level += size;     ts->cfg.buckets[THROTTLE_OPS_TOTAL].level += units;     if (is_write) {         ts->cfg.buckets[THROTTLE_BPS_WRITE].level += size;         ts->cfg.buckets[THROTTLE_OPS_WRITE].level += units;     } else {         ts->cfg.buckets[THROTTLE_BPS_READ].level += size;         ts->cfg.buckets[THROTTLE_OPS_READ].level += units;
void FUNC_0(ThrottleState *VAR_0, bool VAR_1, uint64_t VAR_2)

{

    double VAR_3 = 1.0;



    

    if (VAR_0->cfg.op_size && VAR_2 > VAR_0->cfg.op_size) {

        VAR_3 = (double) VAR_2 / VAR_0->cfg.op_size;

    }



    VAR_0->cfg.buckets[THROTTLE_BPS_TOTAL].level += VAR_2;

    VAR_0->cfg.buckets[THROTTLE_OPS_TOTAL].level += VAR_3;



    if (VAR_1) {

        VAR_0->cfg.buckets[THROTTLE_BPS_WRITE].level += VAR_2;

        VAR_0->cfg.buckets[THROTTLE_OPS_WRITE].level += VAR_3;

    } else {

        VAR_0->cfg.buckets[THROTTLE_BPS_READ].level += VAR_2;

        VAR_0->cfg.buckets[THROTTLE_OPS_READ].level += VAR_3;

    }

}

void FUNC_0(ThrottleState *VAR_0, bool VAR_1, uint64_t VAR_2)
{ double VAR_3 = 1.0; if (VAR_0->cfg.op_size && VAR_2 > VAR_0->cfg.op_size) { VAR_3 = (double) VAR_2 / VAR_0->cfg.op_size; } VAR_0->cfg.buckets[THROTTLE_BPS_TOTAL].level += VAR_2; VAR_0->cfg.buckets[THROTTLE_OPS_TOTAL].level += VAR_3; if (VAR_1) { VAR_0->cfg.buckets[THROTTLE_BPS_WRITE].level += VAR_2; VAR_0->cfg.buckets[THROTTLE_OPS_WRITE].level += VAR_3; } else { VAR_0->cfg.buckets[THROTTLE_BPS_READ].level += VAR_2; VAR_0->cfg.buckets[THROTTLE_OPS_READ].level += VAR_3; } }