private VariableOperand generateArrayIndex(BinaryOperationNode node)
            throws IRException {

        VariableOperand array = (VariableOperand) generate(node.leftChild());
        Operand index = generate(node.rightChild());

        long elementSize =
            ((ArrayType) node.leftChild().realType()).element.size();

        TmpVariableOperand offset =
            new TmpVariableOperand(
                new PrimitiveType(PrimitiveType.Type.LONG),
                varTable
            );

        code.addStatement(
            new BinaryOperationStatement(
                index,
                new ConstantOperand<Long>(
                    new PrimitiveType(PrimitiveType.Type.LONG),
                    elementSize
                ),
                offset,
                BinaryOperationStatement.Operation.MUL
            )
        );

        TmpVariableOperand address =
            new TmpVariableOperand(new PointerType(node.realType()), varTable);

        code.addStatement(
            new BinaryOperationStatement(
                array,
                offset,
                address,
                BinaryOperationStatement.Operation.PLUS
            )
        );

        return address;
    }