private void generateComparison(LocalVariable lvar, LocalVariable rvar,
                                        Type type) {
            Label endLocation = mBuilder.createLabel();
            Label ltLocation = mBuilder.createLabel();
            Label gtLocation = mBuilder.createLabel();

            mBuilder.loadLocal(lvar);
            mBuilder.loadLocal(rvar);
            generateComparison(ltLocation, "!=", type);
            mBuilder.loadConstant(0);
            mBuilder.branch(endLocation);

            ltLocation.setLocation();
            mBuilder.loadLocal(lvar);
            mBuilder.loadLocal(rvar);
            generateComparison(gtLocation, "<", type);
            mBuilder.loadConstant(1);
            mBuilder.branch(endLocation);

            gtLocation.setLocation();
            mBuilder.loadConstant(-1);

            endLocation.setLocation();
        }