
void __start()
__start: scope:[__start]  from
  [0] phi()
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  [1] PLEX_SCREEN_PTR = (char *) 1024+$3f8
  [2] plex_show_idx = 0
  [3] plex_sprite_idx = 0
  [4] plex_sprite_msb = 1
  [5] plex_free_next = 0
  [6] framedone = true
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  [7] phi()
  [8] call main
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  [9] return 
  to:@return

__interrupt(rom_min_c64) void plex_irq()
plex_irq: scope:[plex_irq]  from
  asm { sei  }
  [11] *BORDER_COLOR = WHITE
  to:plex_irq::@3
plex_irq::@3: scope:[plex_irq]  from plex_irq plex_irq::@7
  [12] phi()
  [13] call plexShowSprite
  to:plex_irq::plexFreeNextYpos1
plex_irq::plexFreeNextYpos1: scope:[plex_irq]  from plex_irq::@3
  [14] plex_irq::plexFreeNextYpos1_return#0 = PLEX_FREE_YPOS[plex_free_next]
  to:plex_irq::@6
plex_irq::@6: scope:[plex_irq]  from plex_irq::plexFreeNextYpos1
  [15] plex_irq::$4 = *RASTER + 2
  [16] if(plex_show_idx>=PLEX_COUNT) goto plex_irq::@4
  to:plex_irq::@7
plex_irq::@7: scope:[plex_irq]  from plex_irq::@6
  [17] if(plex_irq::plexFreeNextYpos1_return#0<plex_irq::$4) goto plex_irq::@3
  to:plex_irq::@4
plex_irq::@4: scope:[plex_irq]  from plex_irq::@6 plex_irq::@7
  [18] *IRQ_STATUS = IRQ_RASTER
  [19] if(plex_show_idx<PLEX_COUNT) goto plex_irq::@1
  to:plex_irq::@5
plex_irq::@5: scope:[plex_irq]  from plex_irq::@4
  [20] *RASTER = 0
  [21] framedone = true
  to:plex_irq::@2
plex_irq::@2: scope:[plex_irq]  from plex_irq::@1 plex_irq::@5
  [22] *BORDER_COLOR = 0
  asm { cli  }
  to:plex_irq::@return
plex_irq::@return: scope:[plex_irq]  from plex_irq::@2
  [24] return 
  to:@return
plex_irq::@1: scope:[plex_irq]  from plex_irq::@4
  [25] *RASTER = plex_irq::plexFreeNextYpos1_return#0
  to:plex_irq::@2

void main()
main: scope:[main]  from __start::@1
  asm { sei  }
  [27] call init
  to:main::@1
main::@1: scope:[main]  from main
  [28] phi()
  [29] call loop
  to:main::@return
main::@return: scope:[main]  from main::@1
  [30] return 
  to:@return

void plexShowSprite()
plexShowSprite: scope:[plexShowSprite]  from plex_irq::@3
  [31] plexShowSprite::plex_sprite_idx2#0 = plex_sprite_idx << 1
  [32] plexShowSprite::plexFreeAdd1_ypos#0 = PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]]
  [33] SPRITES_YPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::plexFreeAdd1_ypos#0
  to:plexShowSprite::plexFreeAdd1
plexShowSprite::plexFreeAdd1: scope:[plexShowSprite]  from plexShowSprite
  [34] plexShowSprite::plexFreeAdd1_$0 = plexShowSprite::plexFreeAdd1_ypos#0 + $16
  [35] PLEX_FREE_YPOS[plex_free_next] = plexShowSprite::plexFreeAdd1_$0
  [36] plexShowSprite::plexFreeAdd1_$1 = plex_free_next + 1
  [37] plexShowSprite::plexFreeAdd1_$2 = plexShowSprite::plexFreeAdd1_$1 & 7
  [38] plex_free_next = plexShowSprite::plexFreeAdd1_$2
  to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite]  from plexShowSprite::plexFreeAdd1
  [39] PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
  [40] plexShowSprite::xpos_idx#0 = PLEX_SORTED_IDX[plex_show_idx]
  [41] plexShowSprite::$10 = plexShowSprite::xpos_idx#0 << 1
  [42] SPRITES_XPOS[plexShowSprite::plex_sprite_idx2#0] = (char)PLEX_XPOS[plexShowSprite::$10]
  [43] plexShowSprite::$2 = byte1  PLEX_XPOS[plexShowSprite::$10]
  [44] if(plexShowSprite::$2!=0) goto plexShowSprite::@1
  to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite]  from plexShowSprite::@5
  [45] plexShowSprite::$8 = $ff ^ plex_sprite_msb
  [46] *SPRITES_XMSB = *SPRITES_XMSB & plexShowSprite::$8
  to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite]  from plexShowSprite::@1 plexShowSprite::@3
  [47] plexShowSprite::$4 = plex_sprite_idx + 1
  [48] plexShowSprite::$5 = plexShowSprite::$4 & 7
  [49] plex_sprite_idx = plexShowSprite::$5
  [50] plex_show_idx = ++ plex_show_idx
  [51] plex_sprite_msb = plex_sprite_msb << 1
  [52] if(plex_sprite_msb!=0) goto plexShowSprite::@return
  to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite]  from plexShowSprite::@2
  [53] plex_sprite_msb = 1
  to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite]  from plexShowSprite::@2 plexShowSprite::@4
  [54] return 
  to:@return
plexShowSprite::@1: scope:[plexShowSprite]  from plexShowSprite::@5
  [55] *SPRITES_XMSB = *SPRITES_XMSB | plex_sprite_msb
  to:plexShowSprite::@2

void init()
init: scope:[init]  from main
  [56] *D011 = VICII_DEN|VICII_RSEL|3
  [57] call plexInit
  to:init::@1
init::@1: scope:[init]  from init init::@1
  [58] init::xp#2 = phi( init::@1/init::xp#1, init/$20 )
  [58] init::sx#2 = phi( init::@1/init::sx#1, init/0 )
  [59] PLEX_PTR[init::sx#2] = (char)SPRITE/$40
  [60] init::$3 = init::sx#2 << 1
  [61] PLEX_XPOS[init::$3] = init::xp#2
  [62] init::xp#1 = init::xp#2 + 9
  [63] init::sx#1 = ++ init::sx#2
  [64] if(init::sx#1!=PLEX_COUNT-1+1) goto init::@1
  to:init::@2
init::@2: scope:[init]  from init::@1
  [65] *SPRITES_ENABLE = $ff
  to:init::@3
init::@3: scope:[init]  from init::@2 init::@3
  [66] init::ss#2 = phi( init::@2/0, init::@3/init::ss#1 )
  [67] SPRITES_COLOR[init::ss#2] = GREEN
  [68] init::ss#1 = ++ init::ss#2
  [69] if(init::ss#1!=8) goto init::@3
  to:init::@4
init::@4: scope:[init]  from init::@3
  asm { sei  }
  [71] *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) = CIA_INTERRUPT_CLEAR
  [72] *IRQ_ENABLE = IRQ_RASTER
  [73] *IRQ_STATUS = IRQ_RASTER
  [74] *KERNEL_IRQ = &plex_irq
  [75] *VICII_CONTROL1 = *VICII_CONTROL1 & $7f
  [76] *RASTER = 0
  asm { cli  }
  to:init::@return
init::@return: scope:[init]  from init::@4
  [78] return 
  to:@return

void loop()
loop: scope:[loop]  from main::@1
  [79] phi()
  to:loop::@1
loop::@1: scope:[loop]  from loop loop::@6
  [80] loop::sin_idx#6 = phi( loop/0, loop::@6/loop::sin_idx#1 )
  to:loop::@2
loop::@2: scope:[loop]  from loop::@1 loop::@2
  [81] if(framedone) goto loop::@3
  to:loop::@2
loop::@3: scope:[loop]  from loop::@2
  [82] *BORDER_COLOR = RED
  [83] loop::y_idx#3 = loop::sin_idx#6
  to:loop::@4
loop::@4: scope:[loop]  from loop::@3 loop::@4
  [84] loop::sy#2 = phi( loop::@3/0, loop::@4/loop::sy#1 )
  [84] loop::y_idx#2 = phi( loop::@3/loop::y_idx#3, loop::@4/loop::y_idx#1 )
  [85] PLEX_YPOS[loop::sy#2] = YSIN[loop::y_idx#2]
  [86] loop::y_idx#1 = loop::y_idx#2 + 8
  [87] loop::sy#1 = ++ loop::sy#2
  [88] if(loop::sy#1!=PLEX_COUNT-1+1) goto loop::@4
  to:loop::@5
loop::@5: scope:[loop]  from loop::@4
  [89] loop::sin_idx#1 = loop::sin_idx#6 + 1
  [90] *BORDER_COLOR = ++ *BORDER_COLOR
  [91] call plexSort
  to:loop::@6
loop::@6: scope:[loop]  from loop::@5
  [92] *BORDER_COLOR = GREEN
  [93] framedone = false
  to:loop::@1

void plexInit(char *screen)
plexInit: scope:[plexInit]  from init
  [94] phi()
  to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit]  from plexInit
  [95] PLEX_SCREEN_PTR = SCREEN+$3f8
  to:plexInit::@1
plexInit::@1: scope:[plexInit]  from plexInit::@1 plexInit::plexSetScreen1
  [96] plexInit::i#2 = phi( plexInit::@1/plexInit::i#1, plexInit::plexSetScreen1/0 )
  [97] PLEX_SORTED_IDX[plexInit::i#2] = plexInit::i#2
  [98] plexInit::i#1 = ++ plexInit::i#2
  [99] if(plexInit::i#1!=PLEX_COUNT-1+1) goto plexInit::@1
  to:plexInit::@return
plexInit::@return: scope:[plexInit]  from plexInit::@1
  [100] return 
  to:@return

void plexSort()
plexSort: scope:[plexSort]  from loop::@5
  [101] phi()
  to:plexSort::@1
plexSort::@1: scope:[plexSort]  from plexSort plexSort::@2
  [102] plexSort::m#2 = phi( plexSort/0, plexSort::@2/plexSort::m#1 )
  [103] plexSort::nxt_idx#0 = (PLEX_SORTED_IDX+1)[plexSort::m#2]
  [104] plexSort::nxt_y#0 = PLEX_YPOS[plexSort::nxt_idx#0]
  [105] if(plexSort::nxt_y#0>=PLEX_YPOS[PLEX_SORTED_IDX[plexSort::m#2]]) goto plexSort::@2
  to:plexSort::@5
plexSort::@5: scope:[plexSort]  from plexSort::@1
  [106] plexSort::s#6 = plexSort::m#2
  to:plexSort::@3
plexSort::@3: scope:[plexSort]  from plexSort::@5 plexSort::@7
  [107] plexSort::s#3 = phi( plexSort::@7/plexSort::s#1, plexSort::@5/plexSort::s#6 )
  [108] (PLEX_SORTED_IDX+1)[plexSort::s#3] = PLEX_SORTED_IDX[plexSort::s#3]
  [109] plexSort::s#1 = -- plexSort::s#3
  [110] if(plexSort::s#1==$ff) goto plexSort::@4
  to:plexSort::@7
plexSort::@7: scope:[plexSort]  from plexSort::@3
  [111] if(plexSort::nxt_y#0<PLEX_YPOS[PLEX_SORTED_IDX[plexSort::s#1]]) goto plexSort::@3
  to:plexSort::@4
plexSort::@4: scope:[plexSort]  from plexSort::@3 plexSort::@7
  [112] plexSort::s#2 = ++ plexSort::s#1
  [113] PLEX_SORTED_IDX[plexSort::s#2] = plexSort::nxt_idx#0
  to:plexSort::@2
plexSort::@2: scope:[plexSort]  from plexSort::@1 plexSort::@4
  [114] plexSort::m#1 = ++ plexSort::m#2
  [115] if(plexSort::m#1!=PLEX_COUNT-2+1) goto plexSort::@1
  to:plexSort::@6
plexSort::@6: scope:[plexSort]  from plexSort::@2
  [116] plex_show_idx = 0
  [117] plex_sprite_idx = 0
  [118] plex_sprite_msb = 1
  to:plexSort::plexFreePrepare1
plexSort::plexFreePrepare1: scope:[plexSort]  from plexSort::@6
  [119] phi()
  to:plexSort::plexFreePrepare1_@1
plexSort::plexFreePrepare1_@1: scope:[plexSort]  from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1
  [120] plexSort::plexFreePrepare1_s#2 = phi( plexSort::plexFreePrepare1/0, plexSort::plexFreePrepare1_@1/plexSort::plexFreePrepare1_s#1 )
  [121] PLEX_FREE_YPOS[plexSort::plexFreePrepare1_s#2] = 0
  [122] plexSort::plexFreePrepare1_s#1 = ++ plexSort::plexFreePrepare1_s#2
  [123] if(plexSort::plexFreePrepare1_s#1!=8) goto plexSort::plexFreePrepare1_@1
  to:plexSort::plexFreePrepare1_@2
plexSort::plexFreePrepare1_@2: scope:[plexSort]  from plexSort::plexFreePrepare1_@1
  [124] plex_free_next = 0
  to:plexSort::@return
plexSort::@return: scope:[plexSort]  from plexSort::plexFreePrepare1_@2
  [125] return 
  to:@return
