4-rings or 4-squares puzzle

You are encouraged to solve this task according to the task description, using any language you may know.
Task

Replace       a, b, c, d, e, f,   and
  g        with the decimal
digits   LOW   ───►   HIGH

such that the sum of the letters inside of each of the four large squares add up to
the same sum.

            ╔══════════════╗      ╔══════════════╗
            ║              ║      ║              ║
            ║      a       ║      ║      e       ║
            ║              ║      ║              ║
            ║          ┌───╫──────╫───┐      ┌───╫─────────┐
            ║          │   ║      ║   │      │   ║         │
            ║          │ b ║      ║ d │      │ f ║         │
            ║          │   ║      ║   │      │   ║         │
            ║          │   ║      ║   │      │   ║         │
            ╚══════════╪═══╝      ╚═══╪══════╪═══╝         │
                       │       c      │      │      g      │
                       │              │      │             │
                       │              │      │             │
                       └──────────────┘      └─────────────┘

Show all output here.



   Show all solutions for each letter being unique with
        LOW=1     HIGH=7

   Show all solutions for each letter being unique with
        LOW=3     HIGH=9

   Show only the   number   of solutions when each letter can be non-unique
        LOW=0     HIGH=9



Related task

 Solve the no connection puzzle


BEGIN
 
    INTEGER PROCEDURE GETCOMBS(LOW, HIGH, UNIQUE, COMBS);
        INTEGER LOW, HIGH;
        INTEGER ARRAY COMBS;
        BOOLEAN UNIQUE;
    BEGIN
        INTEGER A, B, C, D, E, F, G;
        INTEGER NUM;
 
        BOOLEAN PROCEDURE ISUNIQUE(A, B, C, D, E, F, G);
            INTEGER A, B, C, D, E, F, G;
        BEGIN
            INTEGER ARRAY DATA(LOW:HIGH);
            INTEGER I;
 
            FOR I := LOW STEP 1 UNTIL HIGH DO
                DATA(I) := -1;
 
            FOR I := A, B, C, D, E, F, G DO
              IF DATA(I) = -1
                  THEN DATA(I) := 1
                  ELSE GOTO L;
 
            ISUNIQUE := TRUE;
        L:
        END;
 
        PROCEDURE ADDCOMB;
        BEGIN
            NUM := NUM + 1;
            COMBS(NUM, LOW + 0) := A;
            COMBS(NUM, LOW + 1) := B;
            COMBS(NUM, LOW + 2) := C;
            COMBS(NUM, LOW + 3) := D;
            COMBS(NUM, LOW + 4) := E;
            COMBS(NUM, LOW + 5) := F;
            COMBS(NUM, LOW + 6) := G;
        END;
 
        FOR A := LOW STEP 1 UNTIL HIGH DO
        FOR B := LOW STEP 1 UNTIL HIGH DO
        FOR C := LOW STEP 1 UNTIL HIGH DO
        FOR D := LOW STEP 1 UNTIL HIGH DO
        FOR E := LOW STEP 1 UNTIL HIGH DO
        FOR F := LOW STEP 1 UNTIL HIGH DO
        FOR G := LOW STEP 1 UNTIL HIGH DO
        BEGIN
            IF VALIDCOMB(A, B, C, D, E, F, G) THEN
            BEGIN
                IF UNIQUE THEN
                    BEGIN IF ISUNIQUE(A, B, C, D, E, F, G) THEN ADDCOMB END
                ELSE ADDCOMB;
            END;
        END;
        GETCOMBS := NUM;
    END;
 
 
    BOOLEAN PROCEDURE VALIDCOMB(A, B, C, D, E, F, G);
        INTEGER A, B, C, D, E, F, G;
    BEGIN
        INTEGER SQUARE1, SQUARE2, SQUARE3, SQUARE4;
 
        SQUARE1 := A + B;
        SQUARE2 := B + C + D;
        SQUARE3 := D + E + F;
        SQUARE4 := F + G;
        VALIDCOMB := SQUARE1 = SQUARE2 AND SQUARE2 = SQUARE3 AND SQUARE3 = SQUARE4
    END;
 
    COMMENT ----- MAIN PROGRAM ----- ;
 
    INTEGER ARRAY LO(1:3);
    INTEGER ARRAY HI(1:3);
    BOOLEAN ARRAY UQ(1:3);
    INTEGER I;
 
    LO(1) := 1; HI(1) := 7; UQ(1) := TRUE;
    LO(2) := 3; HI(2) := 9; UQ(2) := TRUE;
    LO(3) := 0; HI(3) := 9; UQ(3) := FALSE;
 
    FOR I := 1 STEP 1 UNTIL 3 DO
    BEGIN
        INTEGER LOW, HIGH;
        BOOLEAN UNIQ;
 
        LOW := LO(I); HIGH := HI(I); UNIQ := UQ(I);
        BEGIN
            INTEGER ARRAY VALIDCOMBS(1:8000, LOW:HIGH);
            INTEGER N;
 
            N := GETCOMBS(LOW, HIGH, UNIQ, VALIDCOMBS);
            OUTINT(N, 0);
            IF UNIQ THEN OUTTEXT(" UNIQUE");
            OUTTEXT(" SOLUTIONS IN ");
            OUTINT(LOW, 0); OUTTEXT(" TO ");
            OUTINT(HIGH, 0);
            OUTIMAGE;
            IF I < 3 THEN
            BEGIN INTEGER I, J;
                FOR I := 1 STEP 1 UNTIL N DO
                BEGIN
                    OUTTEXT("[");
                    FOR J := LOW STEP 1 UNTIL HIGH DO
                        OUTINT(VALIDCOMBS(I, J), 2);
                    OUTTEXT(" ]");
                    OUTIMAGE;
                END;
            END;
        END;
    END;
 
END.
 