Create a programming language that only appears to be unusable (Robbers' thread) See the cop thread for more information. Each answer to this question should crack an answer there. That is to say, it should be code to find the third-largest integer in the input when run in the interpreter given in that answer.
If you post a crack that turns out to be invalid, you should delete it and are ineligible to post another attempt against the same answer.
Scoring
The winner of this question is the robber who makes the highest number of successful cracks.
Shuffle, by Liam Noronha

cinpush

main:
    gte Hans 1s Leopold
    jnz Leopold done

    mov 1s Hans

    gte Gertrude Hans Leopold
    jnz Leopold done

    mov Gertrude ShabbySam
    mov Hans Gertrude
    mov ShabbySam Hans

    gte Alberto Gertrude Leopold
    jnz Leopold done

    mov Alberto ShabbySam
    mov Gertrude Alberto
    mov ShabbySam Gertrude

    done:

    mov 10 ShabbySam

    gte 1s ShabbySam Leopold
    jz Leopold undo_u

    mov 30 ShabbySam
    gte 1s ShabbySam Leopold
    jz Leopold undo_d

    undo_r:

        POP!! 1

        "shuffle" f
        "shuffle" f
        "shuffle" b
        "shuffle" b
        "shuffle" l
        "shuffle" f
        "shuffle" f
        "shuffle" b
        "shuffle" b

        jmp end

    undo_u:

        POP!! 1

        "shuffle" f
        "shuffle" f
        "shuffle" f
        "shuffle" b
        "shuffle" b
        "shuffle" b
        "shuffle" l
        "shuffle" l
        "shuffle" l
        "shuffle" f
        "shuffle" b

        jmp end

    undo_d:

        POP!! 1

        "shuffle" f
        "shuffle" b
        "shuffle" l
        "shuffle" f
        "shuffle" f
        "shuffle" f
        "shuffle" b
        "shuffle" b
        "shuffle" b

    end:
    jnz 1s main

print Hans
done!


This was really great fun, thank you Liam! :)

Thanks to Sp3000 for a slight but necessary nudge in the right direction.

How?

Two words: Pocket Cube.

It turns out that the stacks correspond to the faces of a 2x2x2 Rubik's cube as follows:

           ____ ____
          |    |    |
          | 19 | 17 |
          |____U____|
          |    |    |
          | 20 | 18 |
 _________|____|____|____ ____ ____ ____
|    |    |    |    |    |    |    |    |
| 13 | 14 |  1 |  2 |  9 | 10 |  6 |  5 |
|____L____|____F____|____R____|____B____|
|    |    |    |    |    |    |    |    |
| 15 | 16 |  3 |  4 | 11 | 12 |  8 |  7 |
|____|____|____|____|____|____|____|____|
          |    |    |
          | 22 | 24 |
          |____D____|
          |    |    |
          | 21 | 23 |
          |____|____|


Where ULFRBD indicate which face corresponds to up, left, front, right, back, down when the cube is folded properly.

The permutations correspond to rotating any one side by 90 degrees (where the names thankfully match up). It turns out that f, r and d are clockwise rotations (when viewing the face) and r, l and u are counter-clockwise rotations (when viewing the face).

Now the cinpush command operates such that it applies one of the rotations u, d or r (depending on the given value) and then pushes the input value onto the stack in position 1. (And then it repeats doing this for every element in the input.) That means we can reverse this process (to ensure we end up with the correct order of stacks without having to solve an arbitrary Rubik's cube) by repeatedly looking at the stack in position 1, undoing the corresponding permutation and popping the value of that stack (so that next time we see the stack, we get the value underneath).

How do we undo the rotations? Thankfully, we have both f and b at our disposal. If we apply both of them, we rotate the entire cube by 90 degrees. This means we can move the affected side (U, R or D) to L, undo the rotation using one or three ls (depending on the relative direction of l and the rotation performed during the input), and then rotate the cube back to its previous orientation using f and b again.

In particular, each of the rotations performed during input can be undone as follows:

u --&gt; fffbbblllfb
r --&gt; ffbblffbb
d --&gt; fblfffbbb


I'll see if I can come up with some animations to show that this works.

Now this gives us a way to iterate through the entire input once. But with 5 registers, that's all we need:


Alberto is the maximum value encountered so far.
Gertrude is the 2nd largest value encountered so far.
Hans is the 3rd largest value encountered so far.


When we encounter a new value, we bubble it up those three as far as necessary, where we can use ShabbySam as a temporary register for the swaps. That still leaves Leopold which we can use to hold a conditional when making the necessary comparisons.

At the end of the process, we simply print the contents of Hans, which will already hold the 3rd largest value.