@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff))
    .for (var y=0; y<21; y++)
        .for (var x=0;x<3; x++)
            .byte pic.getSinglecolorByte(x,y)
 }}
  to:@2
@2: scope:[]  from @1
  [2] phi()
  [3] call main 
  to:@end
@end: scope:[]  from @2
  [4] phi()

(void()) main()
main: scope:[main]  from @2
  asm { sei  }
  [6] call init 
  to:main::@1
main::@1: scope:[main]  from main
  [7] phi()
  [8] call loop 
  to:main::@return
main::@return: scope:[main]  from main::@1
  [9] return 
  to:@return

(void()) loop()
loop: scope:[loop]  from main::@1
  [10] phi()
  to:loop::@1
loop::@1: scope:[loop]  from loop loop::@10
  [11] (byte) loop::sin_idx#6 ← phi( loop/(byte) 0 loop::@10/(byte) loop::sin_idx#1 )
  to:loop::@2
loop::@2: scope:[loop]  from loop::@1 loop::@2
  [12] if(*((const byte*) RASTER)!=(byte) $ff) goto loop::@2
  to:loop::@3
loop::@3: scope:[loop]  from loop::@2
  [13] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL)
  [14] (byte) loop::y_idx#4 ← (byte) loop::sin_idx#6
  to:loop::@4
loop::@4: scope:[loop]  from loop::@3 loop::@4
  [15] (byte) loop::sy#2 ← phi( loop::@4/(byte) loop::sy#1 loop::@3/(byte) 0 )
  [15] (byte) loop::y_idx#2 ← phi( loop::@4/(byte) loop::y_idx#1 loop::@3/(byte) loop::y_idx#4 )
  [16] *((const byte*) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte*) YSIN + (byte) loop::y_idx#2)
  [17] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8
  [18] (byte) loop::sy#1 ← ++ (byte) loop::sy#2
  [19] if((byte) loop::sy#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto loop::@4
  to:loop::@5
loop::@5: scope:[loop]  from loop::@4
  [20] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1
  [21] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL)
  [22] call plexSort 
  to:loop::@11
loop::@11: scope:[loop]  from loop::@5
  [23] *((const byte*) BORDERCOL) ← (const byte) BLACK
  to:loop::@6
loop::@6: scope:[loop]  from loop::@11 loop::@6
  [24] (byte~) loop::$5 ← *((const byte*) D011) & (const byte) VIC_RST8
  [25] if((byte~) loop::$5!=(byte) 0) goto loop::@6
  to:loop::@7
loop::@7: scope:[loop]  from loop::@12 loop::@6
  [26] (byte) loop::ss#5 ← phi( loop::@6/(byte) 0 loop::@12/(byte) loop::ss#1 )
  [26] (byte) plex_sprite_msb#42 ← phi( loop::@6/(byte) 1 loop::@12/(byte) plex_sprite_msb#16 )
  [26] (byte) plex_show_idx#42 ← phi( loop::@6/(byte) 0 loop::@12/(byte) plex_show_idx#15 )
  [26] (byte) plex_sprite_idx#42 ← phi( loop::@6/(byte) 0 loop::@12/(byte) plex_sprite_idx#15 )
  [26] (byte) plex_free_next#17 ← phi( loop::@6/(byte) 0 loop::@12/(byte) plex_free_next#13 )
  [27] *((const byte*) BORDERCOL) ← (const byte) BLACK
  to:loop::plexFreeNextYpos1
loop::plexFreeNextYpos1: scope:[loop]  from loop::@7
  [28] (byte) loop::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (byte) plex_free_next#17)
  to:loop::@8
loop::@8: scope:[loop]  from loop::@8 loop::plexFreeNextYpos1
  [29] if(*((const byte*) RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8
  to:loop::@9
loop::@9: scope:[loop]  from loop::@8
  [30] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL)
  [31] call plexShowSprite 
  to:loop::@12
loop::@12: scope:[loop]  from loop::@9
  [32] (byte) loop::ss#1 ← ++ (byte) loop::ss#5
  [33] if((byte) loop::ss#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto loop::@7
  to:loop::@10
loop::@10: scope:[loop]  from loop::@12
  [34] *((const byte*) BORDERCOL) ← (const byte) BLACK
  to:loop::@1

(void()) plexShowSprite()
plexShowSprite: scope:[plexShowSprite]  from loop::@9
  [35] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#42 << (byte) 1
  [36] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plex_show_idx#42))
  [37] *((const byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0
  to:plexShowSprite::plexFreeAdd1
plexShowSprite::plexFreeAdd1: scope:[plexShowSprite]  from plexShowSprite
  [38] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15
  [39] *((const byte*) PLEX_FREE_YPOS + (byte) plex_free_next#17) ← (byte~) plexShowSprite::plexFreeAdd1_$0
  [40] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (byte) plex_free_next#17 + (byte) 1
  [41] (byte) plex_free_next#13 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7
  to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite]  from plexShowSprite::plexFreeAdd1
  [42] *((const byte*) PLEX_SCREEN_PTR#1 + (byte) plex_sprite_idx#42) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (byte) plex_show_idx#42))
  [43] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (byte) plex_show_idx#42)
  [44] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1
  [45] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11)
  [46] *((const byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2
  [47] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11)
  [48] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1
  to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite]  from plexShowSprite::@4
  [49] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (byte) plex_sprite_msb#42
  [50] *((const byte*) SPRITES_XMSB) ← *((const byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9
  to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite]  from plexShowSprite::@1 plexShowSprite::@3
  [51] (byte~) plexShowSprite::$5 ← (byte) plex_sprite_idx#42 + (byte) 1
  [52] (byte) plex_sprite_idx#15 ← (byte~) plexShowSprite::$5 & (byte) 7
  [53] (byte) plex_show_idx#15 ← ++ (byte) plex_show_idx#42
  [54] (byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#42 << (byte) 1
  [55] if((byte) plex_sprite_msb#3!=(byte) 0) goto plexShowSprite::@5
  to:plexShowSprite::@return
plexShowSprite::@5: scope:[plexShowSprite]  from plexShowSprite::@2
  [56] phi()
  to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite]  from plexShowSprite::@2 plexShowSprite::@5
  [57] (byte) plex_sprite_msb#16 ← phi( plexShowSprite::@5/(byte) plex_sprite_msb#3 plexShowSprite::@2/(byte) 1 )
  [58] return 
  to:@return
plexShowSprite::@1: scope:[plexShowSprite]  from plexShowSprite::@4
  [59] *((const byte*) SPRITES_XMSB) ← *((const byte*) SPRITES_XMSB) | (byte) plex_sprite_msb#42
  to:plexShowSprite::@2

(void()) plexSort()
plexSort: scope:[plexSort]  from loop::@5
  [60] phi()
  to:plexSort::@1
plexSort::@1: scope:[plexSort]  from plexSort plexSort::@2
  [61] (byte) plexSort::m#2 ← phi( plexSort/(byte) 0 plexSort::@2/(byte) plexSort::m#1 )
  [62] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2)
  [63] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0)
  [64] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2
  to:plexSort::@5
plexSort::@5: scope:[plexSort]  from plexSort::@1
  [65] (byte) plexSort::s#6 ← (byte) plexSort::m#2
  to:plexSort::@3
plexSort::@3: scope:[plexSort]  from plexSort::@5 plexSort::@6
  [66] (byte) plexSort::s#3 ← phi( plexSort::@6/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#6 )
  [67] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3)
  [68] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3
  [69] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4
  to:plexSort::@6
plexSort::@6: scope:[plexSort]  from plexSort::@3
  [70] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3
  to:plexSort::@4
plexSort::@4: scope:[plexSort]  from plexSort::@3 plexSort::@6
  [71] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1
  [72] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0
  to:plexSort::@2
plexSort::@2: scope:[plexSort]  from plexSort::@1 plexSort::@4
  [73] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2
  [74] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1
  to:plexSort::plexFreePrepare1
plexSort::plexFreePrepare1: scope:[plexSort]  from plexSort::@2
  [75] phi()
  to:plexSort::plexFreePrepare1_@1
plexSort::plexFreePrepare1_@1: scope:[plexSort]  from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1
  [76] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 )
  [77] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0
  [78] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2
  [79] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1
  to:plexSort::@return
plexSort::@return: scope:[plexSort]  from plexSort::plexFreePrepare1_@1
  [80] return 
  to:@return

(void()) init()
init: scope:[init]  from main
  [81] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3
  [82] call plexInit 
  to:init::@1
init::@1: scope:[init]  from init init::@1
  [83] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(word) $20 )
  [83] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 )
  [84] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40
  [85] (byte~) init::$5 ← (byte) init::sx#2 << (byte) 1
  [86] *((const word*) PLEX_XPOS + (byte~) init::$5) ← (word) init::xp#2
  [87] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9
  [88] (byte) init::sx#1 ← ++ (byte) init::sx#2
  [89] if((byte) init::sx#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1
  to:init::@2
init::@2: scope:[init]  from init::@1
  [90] *((const byte*) SPRITES_ENABLE) ← (byte) $ff
  to:init::@3
init::@3: scope:[init]  from init::@2 init::@3
  [91] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 )
  [92] *((const byte*) SPRITES_COLS + (byte) init::ss#2) ← (const byte) GREEN
  [93] (byte) init::ss#1 ← ++ (byte) init::ss#2
  [94] if((byte) init::ss#1!=(byte) 8) goto init::@3
  to:init::@return
init::@return: scope:[init]  from init::@3
  [95] return 
  to:@return

(void()) plexInit((byte*) plexInit::screen)
plexInit: scope:[plexInit]  from init
  [96] phi()
  to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit]  from plexInit
  [97] phi()
  to:plexInit::@1
plexInit::@1: scope:[plexInit]  from plexInit::@1 plexInit::plexSetScreen1
  [98] (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::plexSetScreen1/(byte) 0 )
  [99] *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2
  [100] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2
  [101] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1
  to:plexInit::@return
plexInit::@return: scope:[plexInit]  from plexInit::@1
  [102] return 
  to:@return
