def merge(d1, d2):
    """
    Merges two dictionaries, nested values are overwitten by d1

    >>> d = merge({'a': 1}, {'b': 2})
    >>> assert d == {'a': 1, 'b': 2}
    >>> d = merge({'a': {'b': 2}}, {'b': 2, 'a': {'c': 3}})
    >>> assert d == {'a': {'c': 3}, 'b': 2}
    """
    return dict(d1, **d2)
