c
#include <limits.h>

static void
ble_hs_timer_sched(int32_t ticks_from_now)
{
    ble_npl_time_t abs_time;
    if (ticks_from_now == BLE_HS_FOREVER) {
        return;
    }
    ble_npl_time_t current_time = ble_npl_time_get();
    if (ticks_from_now > 0 && current_time > UINT32_MAX - ticks_from_now) {
        abs_time = UINT32_MAX;
    } else if (ticks_from_now < 0 && current_time < (ble_npl_time_t)(-ticks_from_now)) {
        abs_time = 0;
    } else {
        abs_time = current_time + ticks_from_now;
    }
    // ... rest of the function
}
