#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA773_SU1E_AU1E
BOOLEAN F1995_(REGISTER int16_t P5908_) {
        REGISTER int16_t L5766_;
        REGISTER int16_t L5767_;
#ifdef MEDIA762_AU1E
        register int16_t L6153_;
#endif


#ifdef MEDIA772_SU1E
        if ((P5908_ == 2) && F0530_FLOPPY_DirectoryExists(G3769_pc_PortraitsDirectory, 0)) {
#endif
#ifdef MEDIA762_AU1E
        if ((P5908_ == 2) && F0530_FLOPPY_DirectoryExists(G3769_pc_PortraitsDirectory, 0)) {
#endif
                G3770_ = 0;
                G3771_ = G3769_pc_PortraitsDirectory;
                return C1_TRUE;
        }
        L5767_ = 1;
#ifdef MEDIA772_SU1E
        while ((P5908_ & MASK0x8000_UNKNOWN) || F1991_(1)) {
                P5908_ &= 0x7FFF;
                if (L5767_ == 0) {
                        F7072_GetDialogChoiceOrdinal(G3764_THAT_S_THE_CHAOS_STRIKES_BACK_UTILITY_DISK, C08_COLOR_RED | MASK0x8000_INVERT_BOX, G7060_OK, &G2263_s_Input_Dialog1Choice);
#endif
#ifdef MEDIA762_AU1E
        while ((P5908_ & MASK0x8000_UNKNOWN) || (L6153_ = F1991_(1))) {
                P5908_ &= ~MASK0x8000_UNKNOWN;
                if (!L5767_) {
                        F7074_DrawDialogErrorMessage((L6153_ < 0) ? G3903_COULDN_T_FIND_DISK_IN : G3764_THAT_S_THE_CHAOS_STRIKES_BACK_UTILITY_DISK, MASK0x8000_UNKNOWN | C08_COLOR_RED);
#endif
                }
                L5767_ = 0;
                if (P5908_ == 0) {
#ifdef MEDIA772_SU1E
                        L5766_ = F7072_GetDialogChoiceOrdinal(G3761_PLEASE_PUT_A_SAVE_GAME_DISK_IN, C15_COLOR_WHITE | MASK0x8000_INVERT_BOX, G7060_OK, &G2263_s_Input_Dialog1Choice);
                        continue;
                }
                        L5766_ = F7072_GetDialogChoiceOrdinal((P5908_ == 1) ? G3761_PLEASE_PUT_A_SAVE_GAME_DISK_IN : G3762_PUT_PORTRAIT_DISK_IN, C15_COLOR_WHITE | MASK0x8000_INVERT_BOX, G7061_OK_CANCEL, &G2264_s_Input_Dialog2Choices);
#endif
#ifdef MEDIA762_AU1E
                        L5766_ = F7074_DrawDialogErrorMessage(G3761_PLEASE_PUT_A_SAVE_GAME_DISK_IN, MASK0x8000_UNKNOWN | C15_COLOR_WHITE);
                } else {
                        L5766_ = F7072_GetDialogChoiceOrdinal((P5908_ == 1) ? G3761_PLEASE_PUT_A_SAVE_GAME_DISK_IN : G3762_PUT_PORTRAIT_DISK_IN, MASK0x8000_INVERT_BOX | C15_COLOR_WHITE, G7061_OK_CANCEL, &G2264_s_Input_Dialog2Choices);
#endif
                        if (L5766_ == 2) {
                                return C0_FALSE;
                        }
#ifdef MEDIA762_AU1E
                }
#endif
        }
        return C1_TRUE;
}
#endif
