def disassemble_scripts(input_script, output_script, signature_for_hash_type_f):

    input_annotations_f, output_annotations_f = annotation_f_for_scripts(
        input_script, output_script, signature_for_hash_type_f)
    pc = 0
    while pc < len(input_script):
        opcode, data, new_pc = get_opcode(input_script, pc)
        pre_annotations, post_annotations = input_annotations_f(pc, opcode, data)
        yield pre_annotations, pc, opcode, instruction_for_opcode(opcode, data), post_annotations
        pc = new_pc

    pc = 0
    while pc < len(output_script):
        opcode, data, new_pc = get_opcode(output_script, pc)
        pre_annotations, post_annotations = output_annotations_f(pc, opcode, data)
        yield pre_annotations, pc, opcode, instruction_for_opcode(opcode, data), post_annotations
        pc = new_pc

    if not is_pay_to_script_hash(output_script):
        return

    stack = []
    eval_script(input_script, signature_for_hash_type_f, expected_hash_type=None, stack=stack)
    if stack:
        signatures, new_output_script = stack[:-1], stack[-1]
        new_input_script = bin_script(signatures)
    else:
        signatures, new_output_script, new_input_script = [], b'', b''

    for r in disassemble_scripts(new_input_script, new_output_script, signature_for_hash_type_f):
        yield r
yield pre_annotations, pc, opcode, instruction, post_annotations
dataset/ETHPy150Open richardkiss/pycoin/pycoin/tx/script/disassemble.py/disassemble_scripts