#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA278_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef MEDIA265_S20E_S21E
overlay "start"
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
segment "start"
#endif

void F0414_SAVEUTIL_ReplaceTildeByDriveLetterInString(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0797_pc_DestinationString, P0798_pc_SourceString, P0799_i_DriveType)
#endif
char*   P0797_pc_DestinationString SEPARATOR
char*   P0798_pc_SourceString      SEPARATOR
int16_t P0799_i_DriveType          FINAL_SEPARATOR
{
#ifdef MEDIA273_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_A31E_A31M_A33M_F31E_F31J_X31J_P31J
        char* L1278_pc_TildeCharacter;
        unsigned int16_t L1279_ui_TildeCharacterPosition;
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        char* L3436_pc_ReplacementString;
#endif


#ifdef MEDIA273_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_A31E_A31M_A33M_F31E_F31J_X31J_P31J
        *P0797_pc_DestinationString = '\0';
        if ((L1278_pc_TildeCharacter = M549_STRCHR(P0798_pc_SourceString, '~')) != NULL) {
                M548_STRNCPY(P0797_pc_DestinationString, P0798_pc_SourceString, L1279_ui_TildeCharacterPosition = L1278_pc_TildeCharacter - P0798_pc_SourceString);
                P0797_pc_DestinationString[L1279_ui_TildeCharacterPosition] = '\0';
                if (G0567_B_GameAndSaveDiskUseSameDrive || (P0799_i_DriveType == C1_DRIVE_TYPE_GAME_DISK)) {
                        M545_STRCAT(P0797_pc_DestinationString, M772_CAST_PC(G0571_puc_GameDiskDriveName));
                } else {
                        M545_STRCAT(P0797_pc_DestinationString, M772_CAST_PC(G0572_puc_SavedGameDiskDriveName));
                }
                M545_STRCAT(P0797_pc_DestinationString, L1278_pc_TildeCharacter + 1);
        }
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        L3436_pc_ReplacementString = (G0567_B_GameAndSaveDiskUseSameDrive || (P0799_i_DriveType == C1_DRIVE_TYPE_GAME_DISK)) ? G0571_puc_GameDiskDriveName : G0572_puc_SavedGameDiskDriveName;
        F0670_ReplaceCharacterByString(P0798_pc_SourceString, L3436_pc_ReplacementString, '~', P0797_pc_DestinationString);
#endif
}
#endif
