static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str)

{

    uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

    unsigned int slot, fn, n;



    if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) {

        fn = 0;

        if (sscanf(str, "%x%n", &slot, &n) != 1) {

            return -EINVAL;

        }

    }

    if (str[n] != '\0')

        return -EINVAL;

    if (fn > 7)

        return -EINVAL;

    if (slot > 31)

        return -EINVAL;

    *ptr = slot << 3 | fn;

    return 0;

}

static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str)

{

    uint32_t *ptr = qdev_get_prop_ptr(dev, prop);

    unsigned int slot, fn, n;



    if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) {

        fn = 0;

        if (sscanf(str, "%x%n", &slot, &n) != 1) {

            return -EINVAL;

        }

    }

    if (str[n] != '\0')

        return -EINVAL;

    if (fn > 7)

        return -EINVAL;

    if (slot > 31)

        return -EINVAL;

    *ptr = slot << 3 | fn;

    return 0;

}

static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str)             return -EINVAL;     if (str[n] != '\0')         return -EINVAL;     if (fn > 7)         return -EINVAL;     if (slot > 31)         return -EINVAL;     return 0;
static int FUNC_0(DeviceState *VAR_0, Property *VAR_1, const char *VAR_2)

{

    uint32_t *ptr = qdev_get_prop_ptr(VAR_0, VAR_1);

    unsigned int VAR_3, VAR_4, VAR_5;



    if (sscanf(VAR_2, "%x.%x%VAR_5", &VAR_3, &VAR_4, &VAR_5) != 2) {

        VAR_4 = 0;

        if (sscanf(VAR_2, "%x%VAR_5", &VAR_3, &VAR_5) != 1) {

            return -EINVAL;

        }

    }

    if (VAR_2[VAR_5] != '\0')

        return -EINVAL;

    if (VAR_4 > 7)

        return -EINVAL;

    if (VAR_3 > 31)

        return -EINVAL;

    *ptr = VAR_3 << 3 | VAR_4;

    return 0;

}

static int FUNC_0(DeviceState *VAR_0, Property *VAR_1, const char *VAR_2)
{ uint32_t *ptr = qdev_get_prop_ptr(VAR_0, VAR_1); unsigned int VAR_3, VAR_4, VAR_5; if (sscanf(VAR_2, "%x.%x%VAR_5", &VAR_3, &VAR_4, &VAR_5) != 2) { VAR_4 = 0; if (sscanf(VAR_2, "%x%VAR_5", &VAR_3, &VAR_5) != 1) { return -EINVAL; } } if (VAR_2[VAR_5] != '\0')
return -EINVAL; if (VAR_4 > 7)
return -EINVAL; if (VAR_3 > 31)
return -EINVAL; *ptr = VAR_3 << 3 | VAR_4; return 0; }