What are the pairing regulations for a single-elimination (knockout) tournament? Here are the pairings for the 2017 FIDE World Cup. The above pairings are for 128-player knockouts. I can't get the way the pairings were generated. I want to be able to generate pairings using the same criteria for knockouts with different numbers of players.

Are there any FIDE published rules for single-elimination tournaments, such as the World Cup? If not, what are the criteria they use for such pairings?

As it stands, there are no knockout, single-elimination or pairing tags. I couldn't find appropriate tags, so feel free to re-tag this question.
The participants were seeded by their FIDE rating: the highest rated player (Magnus Carlsen, 2822) got #1; Wesley So, rated 2810, got #2, all the way down to Oluwafemi Balogun (2255), seed #128.

In the first round, the player with number x plays against the opponent with number 129 - x. So 1 vs. 128, 2 vs. 127, and so on.

In the second round, assuming the stronger player (with the lower number) advances, the player with number x plays against the opponent with number 65 - x. So 1 vs. 64 (this actually happened) and 9 vs. 56 (but this became 9 vs. 73 since 73 beat 56).

The 'target sum' for the third round is 33, for the fourth round 17, and so on until the final where #1 is supposed to play against #2.

This all is a standard seeding mechanism used in many sports (sometimes with slight variations); actually, in most cases, only the top n% (25% is common) of the players is seeded and the rest are paired randomly. This tournament was 'completely' seeded, which is relatively rare.