def getStackPointer(registerMap):
    """
        Return the stack pointer value from the given register map

        @type registerMap: map
        @param registerMap: Map of register names to value

        @rtype: int
        @return: The value of the stack pointer
    """
    for reg in ['rsp', 'esp', 'sp']:
        if reg in registerMap:
            return registerMap[reg]
    raise RuntimeError('Register map does not contain a usable stack pointer!')
