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

struct a1 {
	char *a;
	char *b;
	int filler1;
	int filler2;
	int filler3;
	int filler4;
};

struct a2 {
	int *a;
	int *b;
	int filler1;
	int filler2;
	int filler3;
	int filler4;
};

void fill_it (struct a1 *foo) {
	struct a2 *bar = (struct a2 *) foo;
	bar->a = malloc(sizeof (int));
	bar->b = malloc(sizeof (int));
	*bar->a = *bar->b = 100;
}

void blah (struct a1 *ick) {
	struct a2 *tmp = (struct a2 *) ick;
	printf("%p %p\n", tmp->a, tmp->b);
	printf("%d %d\n", *tmp->a, *tmp->b);
}

void crash_me (struct a1 *foo) {
	struct a1 ick = *foo;
	blah (&ick);
}

int main() {
	struct a1 foo;
	fill_it (&foo);
	crash_me (&foo);
	return 0;
}
