unsafe fn decrement_and_get<T>(ptr: &mut *mut T) -> *mut T