#include <stdio.h>
#include <stdlib.h>

typedef signed int int32;
typedef int Size;

#define INT_ALIGN_MASK	(sizeof(int)-1)
#define MEMSET_LOOP_LIMIT  1024

#define MemSetAligned(start, val, len) \
	do \
	{ \
		int32 * _start = (int32 *) (start); \
		int		_val = (val); \
		Size	_len = (len); \
\
		if ((_len & INT_ALIGN_MASK) == 0 && \
			_val == 0 && \
			_len <= MEMSET_LOOP_LIMIT) \
		{ \
			Size    offset; \
			_len = _len/sizeof(int); \
			for (offset=0;offset<_len;offset++) \
				_start[offset] = 0; \
		} \
		else \
			memset_is_this_function_optimized_away_question_mark((char *) _start, _val, _len); \
	} while (0)

void test2(void)
{
	double x;

	x = 2.0;

	MemSetAligned(&x, 0, sizeof(double));

	x = x*x;

	printf("square is %f.\n", x);
}

int main(void)
{
	test2();
	return 1;
}
