Essentially, I'm looking for a tool that could reconstruct pseudocode with conditional operators, loops, break/continue, etc. from assembly language code for an arbitrary CPU, given only a limited understanding of the assembly constructs related to control flow, and taking anything that it doesn't understand as opaque blobs. Alternatively, it wouldn't need to understand any assembly if it could take pseudocode if (condition) goto label and goto label as basic block boundaries.For example,    blob1    CMP A, B    BLE L1    blob2    CMP C, D    BEQ L2L1:     blob3    CMP E, F    BGT L3L2:     blob4    ...    B L4L3:     blob5L4:     blob6Could become either something likeblob1;if ( A > B && { blob2; C == D } || {blob3; E <= F} ) {     blob4;} else {    blob5;}blob6;or a conventional tree of ifs, if blob2 and blob3 are too large.Also, the variables A to F don't have to follow any addressing mode conventions, they can be arbitrary strings, reproduced literally in the output.The tool doesn't need to know anything but how the labels look like, and the style of the comparison operators and the branches (one comparison instruction produces condition codes consumed by various branch instructions, vs. various comparison instructions produce a true/false value in a register, consumed by branch if true and branch if false instructions, etc).Things become somewhat nontrivial when these structures are nested, labels are reused, break/continue were used in the source code, incidental non-structured control transfers may occur, and so on.Switch/case statements are separate story. To recognize them adequately, a deeper understanding of the underlying ISA is needed.It appears that what I need is an implementation of the basic DREAM decompilation algorithm; I was unable to find a straightforward implementation that takes a CFG in a text format as input. 
Is there a tool capable of reconstructing structured code from arbitrary assembly code?
decompilation