Here is code from Escape from Zol, 6776 hex offset subroutine

A quick note is that some of the global variables have been named by me. The functions have also been named by me. Other than that, this is all automated decompilation.

As another note: RevEngE (all platforms) automatically finds inputs to a function (see DrawBorderTile) and even outputs from a function (see 4635): Where the argument is in a register. No user input is needed. This applies to any CPU that uses registers.

void zol.usub_6776.txt() {
usub_E0A6();
if (*TileBeingDrawn[0] >= 140) {
        SelectedCreatureYPos = CurrentDrawingTileY;
        SelectedCreatureXPos = CurrentDrawingTileX;
        usub_4635();
        CreatureUnderCursor-HealthEtcAttributes-lo = CreatureUnderCursorMapInfo-lo;
        CreatureUnderCursor-HealthEtcAttributes-hi = CreatureUnderCursorMapInfo-hi;
        if (Global_206 != 0) {
                if (*CreatureUnderCursor-HealthEtcAttributes[1] | 128) || (*CreatureUnderCursor-HealthEtcAttributes[4] !
= Global_2307) {
                        BLocal1 = *CreatureUnderCursor-HealthEtcAttributes[4];
                        if (*Global_46[1] & 128) {
                                CreatureUnderCursor-HealthEtcAttributes-lo = Global_46;
                                CreatureUnderCursor-HealthEtcAttributes-hi = Global_47;
                        }//EndIF; 67B7
                }//EndIF; 67B7
        }//EndIF; 67B7
        usub_E5B0();
        BorderDrawParamColour = Global_26600[(*CurrentlySelectedCreatureHealthEtcAttributes[4] & 7)];
        if (*CreatureUnderCursor-HealthEtcAttributes[2] < 144) {
                BLocal1 = 1;
        } else {
                if (*CreatureUnderCursor-HealthEtcAttributes[4] == 255) {
                        BLocal1 = 2;
                } else {
                        BLocal1 = 3;
                }//EndIF; 67E2
        }//EndIF; 67E2
        DrawBorderTile(BLocal1);
}//EndIF; 67E4
return();// 67E7
};