static abi_ulong copy_elf_strings(int argc,char ** argv, void **page,

                                  abi_ulong p)

{

    char *tmp, *tmp1, *pag = NULL;

    int len, offset = 0;



    if (!p) {

        return 0;       /* bullet-proofing */

    }

    while (argc-- > 0) {

        tmp = argv[argc];

        if (!tmp) {

            fprintf(stderr, "VFS: argc is wrong");

            exit(-1);

        }

        tmp1 = tmp;

        while (*tmp++);

        len = tmp - tmp1;

        if (p < len) {  /* this shouldn't happen - 128kB */

            return 0;

        }

        while (len) {

            --p; --tmp; --len;

            if (--offset < 0) {

                offset = p % TARGET_PAGE_SIZE;

                pag = (char *)page[p/TARGET_PAGE_SIZE];

                if (!pag) {

                    pag = (char *)malloc(TARGET_PAGE_SIZE);

                    memset(pag, 0, TARGET_PAGE_SIZE);

                    page[p/TARGET_PAGE_SIZE] = pag;

                    if (!pag)

                        return 0;

                }

            }

            if (len == 0 || offset == 0) {

                *(pag + offset) = *tmp;

            }

            else {

                int bytes_to_copy = (len > offset) ? offset : len;

                tmp -= bytes_to_copy;

                p -= bytes_to_copy;

                offset -= bytes_to_copy;

                len -= bytes_to_copy;

                memcpy_fromfs(pag + offset, tmp, bytes_to_copy + 1);

            }

        }

    }

    return p;

}

static abi_ulong copy_elf_strings(int argc,char ** argv, void **page,

                                  abi_ulong p)

{

    char *tmp, *tmp1, *pag = NULL;

    int len, offset = 0;



    if (!p) {

        return 0;       

    }

    while (argc-- > 0) {

        tmp = argv[argc];

        if (!tmp) {

            fprintf(stderr, "VFS: argc is wrong");

            exit(-1);

        }

        tmp1 = tmp;

        while (*tmp++);

        len = tmp - tmp1;

        if (p < len) {  

            return 0;

        }

        while (len) {

            --p; --tmp; --len;

            if (--offset < 0) {

                offset = p % TARGET_PAGE_SIZE;

                pag = (char *)page[p/TARGET_PAGE_SIZE];

                if (!pag) {

                    pag = (char *)malloc(TARGET_PAGE_SIZE);

                    memset(pag, 0, TARGET_PAGE_SIZE);

                    page[p/TARGET_PAGE_SIZE] = pag;

                    if (!pag)

                        return 0;

                }

            }

            if (len == 0 || offset == 0) {

                *(pag + offset) = *tmp;

            }

            else {

                int bytes_to_copy = (len > offset) ? offset : len;

                tmp -= bytes_to_copy;

                p -= bytes_to_copy;

                offset -= bytes_to_copy;

                len -= bytes_to_copy;

                memcpy_fromfs(pag + offset, tmp, bytes_to_copy + 1);

            }

        }

    }

    return p;

}

                    pag = (char *)malloc(TARGET_PAGE_SIZE);                     memset(pag, 0, TARGET_PAGE_SIZE);
static abi_ulong FUNC_0(int argc,char ** argv, void **page,

                                  abi_ulong p)

{

    char *VAR_0, *VAR_1, *VAR_2 = NULL;

    int VAR_3, VAR_4 = 0;



    if (!p) {

        return 0;       

    }

    while (argc-- > 0) {

        VAR_0 = argv[argc];

        if (!VAR_0) {

            fprintf(stderr, "VFS: argc is wrong");

            exit(-1);

        }

        VAR_1 = VAR_0;

        while (*VAR_0++);

        VAR_3 = VAR_0 - VAR_1;

        if (p < VAR_3) {  

            return 0;

        }

        while (VAR_3) {

            --p; --VAR_0; --VAR_3;

            if (--VAR_4 < 0) {

                VAR_4 = p % TARGET_PAGE_SIZE;

                VAR_2 = (char *)page[p/TARGET_PAGE_SIZE];

                if (!VAR_2) {

                    VAR_2 = (char *)malloc(TARGET_PAGE_SIZE);

                    memset(VAR_2, 0, TARGET_PAGE_SIZE);

                    page[p/TARGET_PAGE_SIZE] = VAR_2;

                    if (!VAR_2)

                        return 0;

                }

            }

            if (VAR_3 == 0 || VAR_4 == 0) {

                *(VAR_2 + VAR_4) = *VAR_0;

            }

            else {

                int VAR_5 = (VAR_3 > VAR_4) ? VAR_4 : VAR_3;

                VAR_0 -= VAR_5;

                p -= VAR_5;

                VAR_4 -= VAR_5;

                VAR_3 -= VAR_5;

                memcpy_fromfs(VAR_2 + VAR_4, VAR_0, VAR_5 + 1);

            }

        }

    }

    return p;

}

static abi_ulong FUNC_0(int argc,char ** argv, void **page,
abi_ulong p)
{ char *VAR_0, *VAR_1, *VAR_2 = NULL; int VAR_3, VAR_4 = 0; if (!p) { return 0; } while (argc-- > 0) { VAR_0 = argv[argc]; if (!VAR_0) { fprintf(stderr, "VFS: argc is wrong"); exit(-1); } VAR_1 = VAR_0; while (*VAR_0++); VAR_3 = VAR_0 - VAR_1; if (p < VAR_3) { return 0; } while (VAR_3) { --p; --VAR_0; --VAR_3; if (--VAR_4 < 0) { VAR_4 = p % TARGET_PAGE_SIZE; VAR_2 = (char *)page[p/TARGET_PAGE_SIZE]; if (!VAR_2) { VAR_2 = (char *)malloc(TARGET_PAGE_SIZE); memset(VAR_2, 0, TARGET_PAGE_SIZE); page[p/TARGET_PAGE_SIZE] = VAR_2; if (!VAR_2)
return 0; } } if (VAR_3 == 0 || VAR_4 == 0) { *(VAR_2 + VAR_4) = *VAR_0; } else { int VAR_5 = (VAR_3 > VAR_4) ? VAR_4 : VAR_3; VAR_0 -= VAR_5; p -= VAR_5; VAR_4 -= VAR_5; VAR_3 -= VAR_5; memcpy_fromfs(VAR_2 + VAR_4, VAR_0, VAR_5 + 1); } } } return p; }