def decompile_charstrings(td, fds):
    for cs in td.GlobalSubrs:
        cs.subr_cost = cs.subr_saving = len(cs.bytecode)
    for fd in fds:
        try:
            for cs in fd.Private.Subrs:
                cs.subr_cost = cs.subr_saving = len(cs.bytecode)
        except AttributeError:
            pass
    for g in td.charset:
        cs, sel = td.CharStrings.getItemAndSelector(g)
        cs.decompile()
    for cs in td.GlobalSubrs:
        if cs.program and cs.program[-1] == 'return':
            cs.subr_saving -= 1
    for fd in fds:
        try:
            for cs in fd.Private.Subrs:
                if cs.program and cs.program[-1] == 'return':
                    cs.subr_saving -= 1
        except __HOLE__:
            pass
dataset/ETHPy150Open googlei18n/compreffor/tools/subr_grapher.py/decompile_charstrings