1. A computer-implemented method of arranging atomic units of binary code, an affinity between each atomic unit being described by edges in a weighted control flow graph representing the binary code, the computer-implemented method comprising: ranking the edges by weight to create a ranked edge list; assigning an edge to an appropriate partition in a list of partitions based on the ranking of the edge, the appropriate partition for the edge being the partition that represents a contiguous flow of control including the edge; repeating the assigning step for each possible edge in the ranked edge list; and arranging the atomic units in accordance with the partitioning of the edges.