private Operand generateCall(CallNode node)
            throws IRException {

        try {
            List<Operand> args = new LinkedList<Operand>();

            for(ExpressionNode arg : node.arguments) {
                args.add(generate(arg));
            }

            VariableOperand function = (VariableOperand) generate(node.function);

            for(Operand arg : args) {
                code.addStatement(new ParamStatement(arg));
            }

            if (!node.realType().is(PrimitiveType.Type.VOID)) {
                TmpVariableOperand result =
                    new TmpVariableOperand(node.realType(), varTable);

                code.addStatement(
                    new CallStatement(function, args.size(), result)
                );

                return result;
            } else {
                code.addStatement(new CallStatement(function, args.size()));

                return null;
            }
        } catch(IRException ex) {
            throw ex;
        } catch(Exception ex) {
            throw (NonGenerationException)new NonGenerationException(ex)
                    .Log("ru.bmstu.iu9.compiler.ir");
        }
    }