import stdio;

int
main(int argc, char **argv)
{
    int i = 3;

    printf("%d", i);    // 3
    i += 1;
    printf(";%d", i);   // 4
    i -= 1;
    printf(";%d", i);   // 3
    i *= 4;
    printf(";%d", i);   // 12
    i /= 3;
    printf(";%d", i);   // 4
    i %= 3;
    printf(";%d", i);   // 1
    i &= 7;
    printf(";%d", i);   // 1
    i |= 6;
    printf(";%d", i);   // 7
    i ^= 2;
    printf(";%d", i);   // 5
    i >>= 2;
    printf(";%d", i);   // 1
    i <<= 2;
    printf(";%d", i);   // 4

    // pointer diff arithmetic (size=1)
    {
        char *string = "Hello, World!";
        char *p;

        p = string;
        p += 1;
        printf(";%c", *p);

        p -= 1;
        printf(";%c", *p);
    }

    // pointer diff arithmetic (size=4)
    {
        int[4] xs;
        int* p;

        xs[0] = 75;
        xs[1] = 76;
        xs[2] = 77;
        xs[3] = 78;

        p = xs;
        p += 1;
        printf(";%d", *p);

        p -= 1;
        printf(";%d", *p);
    }

    // complex LHS
    {
        int x = 0;
        int *p = &x;

        *p += 1;
        printf(";%d", *p);

        p[0] += 2;
        printf(";%d", *p);

        *&*p += 3;
        printf(";%d", *p);
    }

    // complex LHS #2
    {
        int[2] a;

        a[0] = 77;
        a[1] = 78;

        a[0] += 5;
        printf(";%d", a[0]);

        *(a + 1) += 3;
        printf(";%d", a[1]);
    }

    puts("");
    return 0;
}
