def sum_htcl_branches(nested_dict, adj_frac, sum_val):
    """Sum all leaf node values under a given nested dict level.

    Args:
        nested_dict (dict): The nested dict with values to sum.
        adj_frac (dict): Adjustment fraction to apply to values.
        sum_val (dict): Summed values.

    Returns:
        Summed total values, each adjusted by the input fraction.
    """
    for (k, i) in sorted(nested_dict.items()):
        # Restrict summation of all values under the 'stock' key
        if k == "stock":
            continue
        elif isinstance(i, dict):
            sum_htcl_branches(i, adj_frac, sum_val)
        elif k in sum_val.keys():
            sum_val[k] = sum_val[k] + nested_dict[k] * adj_frac[k]

    return sum_val