def disco_loop_asm_format(opc, version, co, real_out,<EOL>fn_name_map, all_fns):
if version < <NUM_LIT>:<EOL><INDENT>co = code2compat(co)<EOL><DEDENT>else:<EOL><INDENT>co = code3compat(co)<EOL><DEDENT>co_name = co.co_name<EOL>mapped_name = fn_name_map.get(co_name, co_name)<EOL>new_consts = []<EOL>for c in co.co_consts:<EOL><INDENT>if iscode(c):<EOL><INDENT>if version < <NUM_LIT>:<EOL><INDENT>c_compat = code2compat(c)<EOL><DEDENT>else:<EOL><INDENT>c_compat = code3compat(c)<EOL><DEDENT>disco_loop_asm_format(opc, version, c_compat, real_out,<EOL>fn_name_map, all_fns)<EOL>m = re.match("<STR_LIT>", str(c))<EOL>if m:<EOL><INDENT>basename = m.group(<NUM_LIT:1>)<EOL>if basename != '<STR_LIT>':<EOL><INDENT>mapped_name = code_uniquify(basename, c.co_code)<EOL>c_compat.co_name = mapped_name<EOL><DEDENT><DEDENT>c_compat.freeze()<EOL>new_consts.append(c_compat)<EOL><DEDENT>else:<EOL><INDENT>new_consts.append(c)<EOL><DEDENT>pass<EOL><DEDENT>co.co_consts = new_consts<EOL>m = re.match("<STR_LIT>", co.co_name)<EOL>if m or co_name in all_fns:<EOL><INDENT>if co_name in all_fns:<EOL><INDENT>basename = co_name<EOL><DEDENT>else:<EOL><INDENT>basename = m.group(<NUM_LIT:1>)<EOL><DEDENT>if basename != '<STR_LIT>':<EOL><INDENT>mapped_name = code_uniquify(basename, co.co_code)<EOL>co_name = mapped_name<EOL>assert mapped_name not in fn_name_map<EOL><DEDENT>fn_name_map[mapped_name] = basename<EOL>co.co_name = mapped_name<EOL>pass<EOL><DEDENT>elif co_name in fn_name_map:<EOL><INDENT>mapped_name = code_uniquify(co_name, co.co_code)<EOL>fn_name_map[mapped_name] = co_name<EOL>co.co_name = mapped_name<EOL>pass<EOL><DEDENT>co = co.freeze()<EOL>all_fns.add(co_name)<EOL>if co.co_name != '<STR_LIT>' or co.co_filename:<EOL><INDENT>real_out.write("<STR_LIT:\n>" + format_code_info(co, version, mapped_name) + "<STR_LIT:\n>")<EOL><DEDENT>bytecode = Bytecode(co, opc, dup_lines=True)<EOL>real_out.write(bytecode.dis(asm_format=True) + "<STR_LIT:\n>")<EOL>
Produces disassembly in a format more conducive to
    automatic assembly by producing inner modules before they are
    used by outer ones. Since this is recusive, we'll
    use more stack space at runtime.