#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char *argv[])
{
char *ptr;
if (argc < 3)
{
printf ("Usage: %s <env var> <target prog>\n", argv[0]);
exit(0);
}
ptr = getenv (argv[1]);
ptr += (strlen(argv[0]) - strlen(argv[2])) * 2;
printf ("%s will be at %p\n", argv[1], ptr);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgoKaW50IG1haW4gKGludCBhcmdjLCBjaGFyICphcmd2W10pCnsKCWNoYXIgKnB0cjsKCWlmIChhcmdjIDwgMykKCXsKCQlwcmludGYgKCJVc2FnZTogJXMgPGVudiB2YXI+IDx0YXJnZXQgcHJvZz5cbiIsIGFyZ3ZbMF0pOwoJCWV4aXQoMCk7Cgl9CglwdHIgPSBnZXRlbnYgKGFyZ3ZbMV0pOwoJcHRyICs9IChzdHJsZW4oYXJndlswXSkgLSBzdHJsZW4oYXJndlsyXSkpICogMjsKCXByaW50ZiAoIiVzIHdpbGwgYmUgYXQgJXBcbiIsIGFyZ3ZbMV0sIHB0cik7Cn0=