@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] (byte) plex_show_idx ← (byte) 0
  [2] (byte) plex_sprite_idx ← (byte) 0
  [3] (byte) plex_sprite_msb ← (byte) 1
  to:@2
@2: scope:[]  from @1
  [4] (byte) plex_free_next ← (byte) 0
  to:@3
@3: scope:[]  from @2
  [5] (bool) framedone ← true
  to:@4
@4: scope:[]  from @3
  [6] phi()
  [7] call main 
  to:@end
@end: scope:[]  from @4
  [8] phi()

(void()) main()
main: scope:[main]  from @4
  asm { sei  }
  [10] call init 
  to:main::@1
main::@1: scope:[main]  from main
  [11] phi()
  [12] call loop 
  to:main::@return
main::@return: scope:[main]  from main::@1
  [13] return 
  to:@return

(void()) loop()
loop: scope:[loop]  from main::@1
  [14] phi()
  to:loop::@1
loop::@1: scope:[loop]  from loop loop::@6
  [15] (byte) loop::sin_idx#6 ← phi( loop/(byte) 0 loop::@6/(byte) loop::sin_idx#1 )
  to:loop::@2
loop::@2: scope:[loop]  from loop::@1 loop::@2
  [16] if((bool) framedone) goto loop::@3
  to:loop::@2
loop::@3: scope:[loop]  from loop::@2
  [17] *((const byte*) BORDERCOL) ← (const byte) RED
  [18] (byte) loop::y_idx#4 ← (byte) loop::sin_idx#6
  to:loop::@4
loop::@4: scope:[loop]  from loop::@3 loop::@4
  [19] (byte) loop::sy#2 ← phi( loop::@4/(byte) loop::sy#1 loop::@3/(byte) 0 )
  [19] (byte) loop::y_idx#2 ← phi( loop::@4/(byte) loop::y_idx#1 loop::@3/(byte) loop::y_idx#4 )
  [20] *((const byte*) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte*) YSIN + (byte) loop::y_idx#2)
  [21] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8
  [22] (byte) loop::sy#1 ← ++ (byte) loop::sy#2
  [23] 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
  [24] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1
  [25] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL)
  [26] call plexSort 
  to:loop::@6
loop::@6: scope:[loop]  from loop::@5
  [27] *((const byte*) BORDERCOL) ← (const byte) GREEN
  [28] (bool) framedone ← false
  [29] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f
  [30] *((const byte*) RASTER) ← (byte) 0
  to:loop::@1

(void()) plexSort()
plexSort: scope:[plexSort]  from loop::@5
  [31] phi()
  to:plexSort::@1
plexSort::@1: scope:[plexSort]  from plexSort plexSort::@2
  [32] (byte) plexSort::m#2 ← phi( plexSort/(byte) 0 plexSort::@2/(byte) plexSort::m#1 )
  [33] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2)
  [34] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0)
  [35] 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
  [36] (byte) plexSort::s#6 ← (byte) plexSort::m#2
  to:plexSort::@3
plexSort::@3: scope:[plexSort]  from plexSort::@5 plexSort::@7
  [37] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#6 )
  [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3)
  [39] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3
  [40] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4
  to:plexSort::@7
plexSort::@7: scope:[plexSort]  from plexSort::@3
  [41] 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::@7
  [42] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1
  [43] *((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
  [44] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2
  [45] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1
  to:plexSort::@6
plexSort::@6: scope:[plexSort]  from plexSort::@2
  [46] (byte) plex_show_idx ← (byte) 0
  [47] (byte) plex_sprite_idx ← (byte) 0
  [48] (byte) plex_sprite_msb ← (byte) 1
  to:plexSort::plexFreePrepare1
plexSort::plexFreePrepare1: scope:[plexSort]  from plexSort::@6
  [49] phi()
  to:plexSort::plexFreePrepare1_@1
plexSort::plexFreePrepare1_@1: scope:[plexSort]  from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1
  [50] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 )
  [51] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0
  [52] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2
  [53] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1
  to:plexSort::plexFreePrepare1_@2
plexSort::plexFreePrepare1_@2: scope:[plexSort]  from plexSort::plexFreePrepare1_@1
  [54] (byte) plex_free_next ← (byte) 0
  to:plexSort::@return
plexSort::@return: scope:[plexSort]  from plexSort::plexFreePrepare1_@2
  [55] return 
  to:@return

(void()) init()
init: scope:[init]  from main
  [56] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3
  [57] call plexInit 
  to:init::@1
init::@1: scope:[init]  from init init::@1
  [58] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(word) $20 )
  [58] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 )
  [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40
  [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1
  [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2
  [62] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9
  [63] (byte) init::sx#1 ← ++ (byte) init::sx#2
  [64] 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
  [65] *((const byte*) SPRITES_ENABLE) ← (byte) $ff
  to:init::@3
init::@3: scope:[init]  from init::@2 init::@3
  [66] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 )
  [67] *((const byte*) SPRITES_COLS + (byte) init::ss#2) ← (const byte) GREEN
  [68] (byte) init::ss#1 ← ++ (byte) init::ss#2
  [69] if((byte) init::ss#1!=(byte) 8) goto init::@3
  to:init::@4
init::@4: scope:[init]  from init::@3
  asm { sei  }
  [71] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR
  [72] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER
  [73] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
  [74] *((const void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq()
  asm { cli  }
  to:init::@return
init::@return: scope:[init]  from init::@4
  [76] return 
  to:@return

(void()) plexInit((byte*) plexInit::screen)
plexInit: scope:[plexInit]  from init
  [77] phi()
  to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit]  from plexInit
  [78] phi()
  to:plexInit::@1
plexInit::@1: scope:[plexInit]  from plexInit::@1 plexInit::plexSetScreen1
  [79] (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::plexSetScreen1/(byte) 0 )
  [80] *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2
  [81] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2
  [82] 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
  [83] return 
  to:@return

interrupt(KERNEL_MIN)(void()) plex_irq()
plex_irq: scope:[plex_irq]  from
  [84] *((const byte*) BORDERCOL) ← (const byte) WHITE
  to:plex_irq::@3
plex_irq::@3: scope:[plex_irq]  from plex_irq plex_irq::@7
  [85] phi()
  [86] call plexShowSprite 
  to:plex_irq::plexFreeNextYpos1
plex_irq::plexFreeNextYpos1: scope:[plex_irq]  from plex_irq::@3
  [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (byte) plex_free_next)
  to:plex_irq::@6
plex_irq::@6: scope:[plex_irq]  from plex_irq::plexFreeNextYpos1
  [88] (byte~) plex_irq::$4 ← *((const byte*) RASTER) + (byte) 2
  [89] if((byte) plex_show_idx>=(const byte) PLEX_COUNT) goto plex_irq::@4
  to:plex_irq::@7
plex_irq::@7: scope:[plex_irq]  from plex_irq::@6
  [90] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3
  to:plex_irq::@4
plex_irq::@4: scope:[plex_irq]  from plex_irq::@6 plex_irq::@7
  [91] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
  [92] if((byte) plex_show_idx<(const byte) PLEX_COUNT) goto plex_irq::@1
  to:plex_irq::@5
plex_irq::@5: scope:[plex_irq]  from plex_irq::@4
  [93] (bool) framedone ← true
  to:plex_irq::@2
plex_irq::@2: scope:[plex_irq]  from plex_irq::@1 plex_irq::@5
  [94] *((const byte*) BORDERCOL) ← (byte) 0
  to:plex_irq::@return
plex_irq::@return: scope:[plex_irq]  from plex_irq::@2
  [95] return 
  to:@return
plex_irq::@1: scope:[plex_irq]  from plex_irq::@4
  [96] *((const byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0
  to:plex_irq::@2

(void()) plexShowSprite()
plexShowSprite: scope:[plexShowSprite]  from plex_irq::@3
  [97] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx << (byte) 1
  [98] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plex_show_idx))
  [99] *((const byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0
  to:plexShowSprite::plexFreeAdd1
plexShowSprite::plexFreeAdd1: scope:[plexShowSprite]  from plexShowSprite
  [100] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15
  [101] *((const byte*) PLEX_FREE_YPOS + (byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0
  [102] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (byte) plex_free_next + (byte) 1
  [103] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7
  [104] (byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2
  to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite]  from plexShowSprite::plexFreeAdd1
  [105] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (byte) plex_show_idx))
  [106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (byte) plex_show_idx)
  [107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1
  [108] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11)
  [109] *((const byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2
  [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11)
  [111] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1
  to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite]  from plexShowSprite::@5
  [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (byte) plex_sprite_msb
  [113] *((const byte*) SPRITES_XMSB) ← *((const byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9
  to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite]  from plexShowSprite::@1 plexShowSprite::@3
  [114] (byte~) plexShowSprite::$5 ← (byte) plex_sprite_idx + (byte) 1
  [115] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7
  [116] (byte) plex_sprite_idx ← (byte~) plexShowSprite::$6
  [117] (byte) plex_show_idx ← ++ (byte) plex_show_idx
  [118] (byte) plex_sprite_msb ← (byte) plex_sprite_msb << (byte) 1
  [119] if((byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return
  to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite]  from plexShowSprite::@2
  [120] (byte) plex_sprite_msb ← (byte) 1
  to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite]  from plexShowSprite::@2 plexShowSprite::@4
  [121] return 
  to:@return
plexShowSprite::@1: scope:[plexShowSprite]  from plexShowSprite::@5
  [122] *((const byte*) SPRITES_XMSB) ← *((const byte*) SPRITES_XMSB) | (byte) plex_sprite_msb
  to:plexShowSprite::@2
