def METHOD_NAME(tid1, tid2, ignore_categories: set = None) -> dict:
    if ignore_categories is None:
        ignore_categories = {"misc"}
    counts = {}
    for tid in (tid1, tid2):
        counts[tid] = {}
        pids_calls = mongo_find_one(
            "analysis", {"info.id": int(tid)}, {"behavior.processes.process_id": 1, "behavior.processes.calls": 1}
        )
        if not pids_calls:
            continue
        for pdoc in pids_calls["behavior"]["processes"]:
            pid = pdoc["process_id"]
            counts[tid][pid] = {}
            for coid in pdoc["calls"]:
                chunk = mongo_find_one("calls", {"_id": coid}, {"calls.category": 1})
                category_counts = behavior_categories_percent(chunk["calls"])
                for cat, count in category_counts.items():
                    if cat in ignore_categories:
                        continue
                    counts[tid][pid][cat] = counts[tid][pid].get(cat, 0) + count
    return combine_behavior_percentages(counts)