#  from http://www.kmonos.net/alang/etc/brainfuck.php
### init: ##################################

>>++++++++[->++++++++<]>      # {3} = 0x40
>>>+++++++++[->++++++++++<]>  # {7} = 0x5A   ptr=7

### main: ##################################

[<<,                # {5} = getchar()

 ## 00 00 00 40 00 *ch 00 5A 00 00 00
  [->+<<+<<+>>>]    # {2:4:6} = !{5}
  <<<[->>>+<<<]>>>  # {5}     = !{2}
 ## 00 00 00 40 ch *ch ch 5A 00 00 00


  >>[->+>>+<<<]>    # {8:10}  = !{7}
 ## 00 00 00 40 ch ch ch 00 *5A 00 5A
  [                 # while( {8} ) do
    <<[->+>>+<<<]>> #   {7:9} = !{6}
    >[-<<<+>>>]<    #   {6}   = !{9}
    <[[-]<->]>      #   if({7}) then decr{6}
    -               #   decr {8}
  ]                 # end
  >>[-<<<+>>>]<<<<< # {7} = !{10}
 ## 00 00 00 40 ch *ch ans1 5A 00 00 00
 ##   ans1 = 0   iff   input le 5A


  <<[-<+<<+>>>]<    # {0:2}  = !{3}
 ## 40 00 *40 00 ch ch ans1 5A 00 00 00
  [                 # while( {2} ) do
    >>[-<+<<+>>>]<< #   {1:3} = !{4}
    <[->>>+<<<]>    #   {4}   = !{1}
    >[[-]>-<]<      #   if({3}) then decr{4}
    -               #   decr {2}
  ]                 # end
  <<[->>>+<<<]>>>>> # {3} = !{0}
 ## 00 00 00 40 ans2 *ch ans1 5A 00 00 00
 ##   ans2 = 0   iff   input le 40


 # if(ans2) if(not ans1) {5} add 0x20
  <[[-]                                  # if( {4} ) then do
    >++++++++++++++++++++++++++++++++    #   {5} add 0x20
    >[[-]                                #   if( !{6} ) then do
      <--------------------------------> #     {5} sub 0x20
    ]<<                                  #   end
  ]>>[-]<                                # end; !{6}

 ## 00 00 00 40 00 *ch 00 5A 00 00 00
.>>] # putchar {5}
