def local_var_is_sender(local_variable):
    """
    Returns True if the passed local variable's value is the msg.sender address,
    recursively checking for previous assignments. Returns False otherwise.

    Parameters
    ----------
    local_variable : slither.core.declarations.solidity_variables.SolidityVariableComposed

    Returns
    -------
    bool
    """
    
    if local_variable.name == 'msg.sender':
        return True
    else:
        try:
            # Recursively check for msg.sender assignment
            return local_var_is_sender(local_variable.expression.value)
        except AttributeError:
            return False