static int raw_fd_pool_get(BDRVRawState *s)

{

    int i;



    for (i = 0; i < RAW_FD_POOL_SIZE; i++) {

        /* already in use */

        if (s->fd_pool[i] != -1)

            continue;



        /* try to dup file descriptor */

        s->fd_pool[i] = dup(s->fd);

        if (s->fd_pool[i] != -1)

            return s->fd_pool[i];

    }



    /* we couldn't dup the file descriptor so just use the main one */

    return s->fd;

}

static int raw_fd_pool_get(BDRVRawState *s)

{

    int i;



    for (i = 0; i < RAW_FD_POOL_SIZE; i++) {

        

        if (s->fd_pool[i] != -1)

            continue;



        

        s->fd_pool[i] = dup(s->fd);

        if (s->fd_pool[i] != -1)

            return s->fd_pool[i];

    }



    

    return s->fd;

}

static int FUNC_0(BDRVRawState *VAR_0)

{

    int VAR_1;



    for (VAR_1 = 0; VAR_1 < RAW_FD_POOL_SIZE; VAR_1++) {

        

        if (VAR_0->fd_pool[VAR_1] != -1)

            continue;



        

        VAR_0->fd_pool[VAR_1] = dup(VAR_0->fd);

        if (VAR_0->fd_pool[VAR_1] != -1)

            return VAR_0->fd_pool[VAR_1];

    }



    

    return VAR_0->fd;

}

static int FUNC_0(BDRVRawState *VAR_0)
{ int VAR_1; for (VAR_1 = 0; VAR_1 < RAW_FD_POOL_SIZE; VAR_1++) { if (VAR_0->fd_pool[VAR_1] != -1)
continue; VAR_0->fd_pool[VAR_1] = dup(VAR_0->fd); if (VAR_0->fd_pool[VAR_1] != -1)
return VAR_0->fd_pool[VAR_1]; } return VAR_0->fd; }