#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
int main() {
printf("%d: Common code1\n", getpid
()); if (fork() != 0) {
printf("%d: Parent code\n", getpid
()); } else {
printf("%d: Child code\n", getpid
()); }
printf("%d: Common code\n", getpid
()); }
I2luY2x1ZGUgPHVuaXN0ZC5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN5cy90eXBlcy5oPgppbnQgbWFpbigpIHsKICBwcmludGYoIiVkOiBDb21tb24gY29kZTFcbiIsIGdldHBpZCgpKTsKICBpZiAoZm9yaygpICE9IDApIHsKICAgIHByaW50ZigiJWQ6IFBhcmVudCBjb2RlXG4iLCBnZXRwaWQoKSk7CiAgfSBlbHNlIHsKICAJcHJpbnRmKCIlZDogQ2hpbGQgY29kZVxuIiwgZ2V0cGlkKCkpOwogIH0KICBwcmludGYoIiVkOiBDb21tb24gY29kZVxuIiwgZ2V0cGlkKCkpOwp9