void check_aligned_anonymous_unfixed_colliding_mmaps(void)

{

	char *p1;

	char *p2;

	char *p3;

	uintptr_t p;

	int i;



	fprintf (stderr, "%s", __func__);

	for (i = 0; i < 0x2fff; i++)

	{

		int nlen;

		p1 = mmap(NULL, pagesize, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

		fail_unless (p1 != MAP_FAILED);

		p = (uintptr_t) p1;

		fail_unless ((p & pagemask) == 0);

		memcpy (dummybuf, p1, pagesize);



		p2 = mmap(NULL, pagesize, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

		fail_unless (p2 != MAP_FAILED);

		p = (uintptr_t) p2;

		fail_unless ((p & pagemask) == 0);

		memcpy (dummybuf, p2, pagesize);





		munmap (p1, pagesize);

		nlen = pagesize * 8;

		p3 = mmap(NULL, nlen, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);



		/* Check if the mmaped areas collide.  */

		if (p3 < p2 

		    && (p3 + nlen) > p2)

			fail_unless (0);



		memcpy (dummybuf, p3, pagesize);



		/* Make sure we get pages aligned with the pagesize. The

		   target expects this.  */

		fail_unless (p3 != MAP_FAILED);

		p = (uintptr_t) p3;

		fail_unless ((p & pagemask) == 0);

		munmap (p2, pagesize);

		munmap (p3, nlen);

	}

	fprintf (stderr, " passed\n");

}

void check_aligned_anonymous_unfixed_colliding_mmaps(void)

{

	char *p1;

	char *p2;

	char *p3;

	uintptr_t p;

	int i;



	fprintf (stderr, "%s", __func__);

	for (i = 0; i < 0x2fff; i++)

	{

		int nlen;

		p1 = mmap(NULL, pagesize, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

		fail_unless (p1 != MAP_FAILED);

		p = (uintptr_t) p1;

		fail_unless ((p & pagemask) == 0);

		memcpy (dummybuf, p1, pagesize);



		p2 = mmap(NULL, pagesize, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

		fail_unless (p2 != MAP_FAILED);

		p = (uintptr_t) p2;

		fail_unless ((p & pagemask) == 0);

		memcpy (dummybuf, p2, pagesize);





		munmap (p1, pagesize);

		nlen = pagesize * 8;

		p3 = mmap(NULL, nlen, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);



		

		if (p3 < p2 

		    && (p3 + nlen) > p2)

			fail_unless (0);



		memcpy (dummybuf, p3, pagesize);



		



		fail_unless (p3 != MAP_FAILED);

		p = (uintptr_t) p3;

		fail_unless ((p & pagemask) == 0);

		munmap (p2, pagesize);

		munmap (p3, nlen);

	}

	fprintf (stderr, " passed\n");

}

		fail_unless (p3 != MAP_FAILED);
void FUNC_0(void)

{

	char *VAR_0;

	char *VAR_1;

	char *VAR_2;

	uintptr_t p;

	int VAR_3;



	fprintf (stderr, "%s", __func__);

	for (VAR_3 = 0; VAR_3 < 0x2fff; VAR_3++)

	{

		int VAR_4;

		VAR_0 = mmap(NULL, pagesize, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

		fail_unless (VAR_0 != MAP_FAILED);

		p = (uintptr_t) VAR_0;

		fail_unless ((p & pagemask) == 0);

		memcpy (dummybuf, VAR_0, pagesize);



		VAR_1 = mmap(NULL, pagesize, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

		fail_unless (VAR_1 != MAP_FAILED);

		p = (uintptr_t) VAR_1;

		fail_unless ((p & pagemask) == 0);

		memcpy (dummybuf, VAR_1, pagesize);





		munmap (VAR_0, pagesize);

		VAR_4 = pagesize * 8;

		VAR_2 = mmap(NULL, VAR_4, PROT_READ, 

			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);



		

		if (VAR_2 < VAR_1 

		    && (VAR_2 + VAR_4) > VAR_1)

			fail_unless (0);



		memcpy (dummybuf, VAR_2, pagesize);



		



		fail_unless (VAR_2 != MAP_FAILED);

		p = (uintptr_t) VAR_2;

		fail_unless ((p & pagemask) == 0);

		munmap (VAR_1, pagesize);

		munmap (VAR_2, VAR_4);

	}

	fprintf (stderr, " passed\n");

}

void FUNC_0(void)
{ char *VAR_0; char *VAR_1; char *VAR_2; uintptr_t p; int VAR_3; fprintf (stderr, "%s", __func__); for (VAR_3 = 0; VAR_3 < 0x2fff; VAR_3++) { int VAR_4; VAR_0 = mmap(NULL, pagesize, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); fail_unless (VAR_0 != MAP_FAILED); p = (uintptr_t) VAR_0; fail_unless ((p & pagemask) == 0); memcpy (dummybuf, VAR_0, pagesize); VAR_1 = mmap(NULL, pagesize, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); fail_unless (VAR_1 != MAP_FAILED); p = (uintptr_t) VAR_1; fail_unless ((p & pagemask) == 0); memcpy (dummybuf, VAR_1, pagesize); munmap (VAR_0, pagesize); VAR_4 = pagesize * 8; VAR_2 = mmap(NULL, VAR_4, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (VAR_2 < VAR_1
&& (VAR_2 + VAR_4) > VAR_1)
fail_unless (0); memcpy (dummybuf, VAR_2, pagesize); fail_unless (VAR_2 != MAP_FAILED); p = (uintptr_t) VAR_2; fail_unless ((p & pagemask) == 0); munmap (VAR_1, pagesize); munmap (VAR_2, VAR_4); } fprintf (stderr, " passed\n"); }