-- HUMAN RESOURCE MACHINE PROGRAM --
-- 28-Three-Sort - SIZE 28/34 - SPEED 117/78 --

-- Based on solution by Eirik0
-- This solution compares positions 1 with 2 and then 0 with 1, swapping 
-- them if they are out of order. If 0 and 1 are swapped, we start again.

a:
    INBOX   
    COPYTO   0
    COPYTO   5
    INBOX   
    COPYTO   2
    INBOX   
b:
    COPYTO   1
    SUB      2
    JUMPN    c
    COMMENT  1
    COMMENT  2
    COPYTO   3
    COPYFROM 2
    COPYTO   1
    ADD      3
    COPYTO   2
c:
    COMMENT  0
    COPYFROM 1
    SUB      0
    JUMPN    d
    COMMENT  5
    COPYFROM 0
    OUTBOX  
    COPYFROM 1
    OUTBOX  
    COPYFROM 2
    OUTBOX  
    JUMP     a
d:
    COMMENT  3
    COMMENT  4
    COPYFROM 1
    COPYTO   0
    COPYFROM 5
    JUMP     b


DEFINE COMMENT 0
eJxTYGBgeG/BG2PvuNqn2eW5Q7PLjtDNrtIV091Mupw9T6wCSjP8qzvvOC3na8yklILsR/WXe4UaL/eC
xE8lve45VNG1GMR+Nz0ssm2GrfusWecdf84JdVs6f0fox/nVibzzw3MS57yqZJrF3xQ3ZVdf2sTISZ96
0mbP6zedW7rRdw7DKBgFo2BAAQBbcjko;

DEFINE COMMENT 1
eJxTYGBgaLc878hszeCw3pbB4bpjmwu782qf3U68MadtjMu5Lda1OpvVtlebMPe0W+7qiw4unAjUwhDV
0+ZSlauW55R/tFCsTLoire5706KW1z0gOa+c1I6s4q4JXvW7F4L4iXMYg68uqPLTXZbnunK5hP3K5Xmu
G5eo5UkugZg1CkbBKBg4AAB77S8O;

DEFINE COMMENT 2
eJyzZ2BgCJb1LjM3rCkBMhnmGyQnFZsvyJxtfbfA2GZKcb2Ncfl2q4j6frPXPcKmu/pAauQSDAOLYiWD
vkVfCBGKbg8/FnU3dlGcWh5f2tS2a+kaU+qSjk9viz8+HaR2VoldVFTlgkyzWvXGafVTirlajFJOdeys
Xtf5qjKv724sW/+OUJC6wpXJSZ5L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