fn catch_panic_state<F: FnOnce() -> *mut BrotliDecoderState + UnwindSafe>(
    f: F
) -> Result<*mut BrotliDecoderState>