def add(field a, field b) -> field {
    field v = a + b;
    return v + a;
}

def main(field a, field b, field c, field d) -> field {
    field mut g = a + b;
    field x = add(a, b);
    field y = add(c, d);
    g = add(x, g);
    g = add(x, g);
    field f = c + d + a;
    g = add(g + a, add(x, b));
    return x + y + g + f;
}