
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
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  [6] phi()
  [7] call main
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  [8] return 
  to:@return

void main()
main: scope:[main]  from __start::@1
  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 init()
init: scope:[init]  from main
  [14] *D011 = VICII_DEN|VICII_RSEL|3
  [15] call plexInit
  to:init::@1
init::@1: scope:[init]  from init init::@1
  [16] init::xp#2 = phi( init::@1/init::xp#1, init/$20 )
  [16] init::sx#2 = phi( init::@1/init::sx#1, init/0 )
  [17] PLEX_PTR[init::sx#2] = (char)SPRITE/$40
  [18] init::$3 = init::sx#2 << 1
  [19] PLEX_XPOS[init::$3] = init::xp#2
  [20] init::xp#1 = init::xp#2 + 9
  [21] init::sx#1 = ++ init::sx#2
  [22] if(init::sx#1!=PLEX_COUNT-1+1) goto init::@1
  to:init::@2
init::@2: scope:[init]  from init::@1
  [23] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff
  to:init::@3
init::@3: scope:[init]  from init::@2 init::@3
  [24] init::ss#2 = phi( init::@2/0, init::@3/init::ss#1 )
  [25] SPRITES_COLOR[init::ss#2] = GREEN
  [26] init::ss#1 = ++ init::ss#2
  [27] if(init::ss#1!=8) goto init::@3
  to:init::@return
init::@return: scope:[init]  from init::@3
  [28] return 
  to:@return

void loop()
loop: scope:[loop]  from main::@1
  [29] phi()
  to:loop::@1
loop::@1: scope:[loop]  from loop loop::@10
  [30] loop::sin_idx#6 = phi( loop/0, loop::@10/loop::sin_idx#1 )
  to:loop::@2
loop::@2: scope:[loop]  from loop::@1 loop::@2
  [31] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto loop::@2
  to:loop::@3
loop::@3: scope:[loop]  from loop::@2
  [32] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
  [33] loop::y_idx#3 = loop::sin_idx#6
  to:loop::@4
loop::@4: scope:[loop]  from loop::@3 loop::@4
  [34] loop::sy#2 = phi( loop::@3/0, loop::@4/loop::sy#1 )
  [34] loop::y_idx#2 = phi( loop::@3/loop::y_idx#3, loop::@4/loop::y_idx#1 )
  [35] PLEX_YPOS[loop::sy#2] = YSIN[loop::y_idx#2]
  [36] loop::y_idx#1 = loop::y_idx#2 + 8
  [37] loop::sy#1 = ++ loop::sy#2
  [38] if(loop::sy#1!=PLEX_COUNT-1+1) goto loop::@4
  to:loop::@5
loop::@5: scope:[loop]  from loop::@4
  [39] loop::sin_idx#1 = loop::sin_idx#6 + 1
  [40] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
  [41] call plexSort
  to:loop::@11
loop::@11: scope:[loop]  from loop::@5
  [42] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
  to:loop::@6
loop::@6: scope:[loop]  from loop::@11 loop::@6
  [43] loop::$5 = *D011 & VICII_RST8
  [44] if(loop::$5!=0) goto loop::@6
  to:loop::@7
loop::@7: scope:[loop]  from loop::@12 loop::@6
  [45] loop::ss#5 = phi( loop::@12/loop::ss#1, loop::@6/0 )
  [46] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
  to:loop::plexFreeNextYpos1
loop::plexFreeNextYpos1: scope:[loop]  from loop::@7
  [47] loop::plexFreeNextYpos1_return#0 = PLEX_FREE_YPOS[plex_free_next]
  to:loop::@8
loop::@8: scope:[loop]  from loop::@8 loop::plexFreeNextYpos1
  [48] if(*((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)<loop::plexFreeNextYpos1_return#0) goto loop::@8
  to:loop::@9
loop::@9: scope:[loop]  from loop::@8
  [49] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
  [50] call plexShowSprite
  to:loop::@12
loop::@12: scope:[loop]  from loop::@9
  [51] loop::ss#1 = ++ loop::ss#5
  [52] if(loop::ss#1!=PLEX_COUNT-1+1) goto loop::@7
  to:loop::@10
loop::@10: scope:[loop]  from loop::@12
  [53] *((char *)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK
  to:loop::@1

void plexInit(char *screen)
plexInit: scope:[plexInit]  from init
  [54] phi()
  to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit]  from plexInit
  [55] PLEX_SCREEN_PTR = SCREEN+$3f8
  to:plexInit::@1
plexInit::@1: scope:[plexInit]  from plexInit::@1 plexInit::plexSetScreen1
  [56] plexInit::i#2 = phi( plexInit::@1/plexInit::i#1, plexInit::plexSetScreen1/0 )
  [57] PLEX_SORTED_IDX[plexInit::i#2] = plexInit::i#2
  [58] plexInit::i#1 = ++ plexInit::i#2
  [59] if(plexInit::i#1!=PLEX_COUNT-1+1) goto plexInit::@1
  to:plexInit::@return
plexInit::@return: scope:[plexInit]  from plexInit::@1
  [60] return 
  to:@return

void plexSort()
plexSort: scope:[plexSort]  from loop::@5
  [61] phi()
  to:plexSort::@1
plexSort::@1: scope:[plexSort]  from plexSort plexSort::@2
  [62] plexSort::m#2 = phi( plexSort/0, plexSort::@2/plexSort::m#1 )
  [63] plexSort::nxt_idx#0 = (PLEX_SORTED_IDX+1)[plexSort::m#2]
  [64] plexSort::nxt_y#0 = PLEX_YPOS[plexSort::nxt_idx#0]
  [65] 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
  [66] plexSort::s#6 = plexSort::m#2
  to:plexSort::@3
plexSort::@3: scope:[plexSort]  from plexSort::@5 plexSort::@7
  [67] plexSort::s#3 = phi( plexSort::@7/plexSort::s#1, plexSort::@5/plexSort::s#6 )
  [68] (PLEX_SORTED_IDX+1)[plexSort::s#3] = PLEX_SORTED_IDX[plexSort::s#3]
  [69] plexSort::s#1 = -- plexSort::s#3
  [70] if(plexSort::s#1==$ff) goto plexSort::@4
  to:plexSort::@7
plexSort::@7: scope:[plexSort]  from plexSort::@3
  [71] 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
  [72] plexSort::s#2 = ++ plexSort::s#1
  [73] PLEX_SORTED_IDX[plexSort::s#2] = plexSort::nxt_idx#0
  to:plexSort::@2
plexSort::@2: scope:[plexSort]  from plexSort::@1 plexSort::@4
  [74] plexSort::m#1 = ++ plexSort::m#2
  [75] if(plexSort::m#1!=PLEX_COUNT-2+1) goto plexSort::@1
  to:plexSort::@6
plexSort::@6: scope:[plexSort]  from plexSort::@2
  [76] plex_show_idx = 0
  [77] plex_sprite_idx = 0
  [78] plex_sprite_msb = 1
  to:plexSort::plexFreePrepare1
plexSort::plexFreePrepare1: scope:[plexSort]  from plexSort::@6
  [79] phi()
  to:plexSort::plexFreePrepare1_@1
plexSort::plexFreePrepare1_@1: scope:[plexSort]  from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1
  [80] plexSort::plexFreePrepare1_s#2 = phi( plexSort::plexFreePrepare1/0, plexSort::plexFreePrepare1_@1/plexSort::plexFreePrepare1_s#1 )
  [81] PLEX_FREE_YPOS[plexSort::plexFreePrepare1_s#2] = 0
  [82] plexSort::plexFreePrepare1_s#1 = ++ plexSort::plexFreePrepare1_s#2
  [83] if(plexSort::plexFreePrepare1_s#1!=8) goto plexSort::plexFreePrepare1_@1
  to:plexSort::plexFreePrepare1_@2
plexSort::plexFreePrepare1_@2: scope:[plexSort]  from plexSort::plexFreePrepare1_@1
  [84] plex_free_next = 0
  to:plexSort::@return
plexSort::@return: scope:[plexSort]  from plexSort::plexFreePrepare1_@2
  [85] return 
  to:@return

void plexShowSprite()
plexShowSprite: scope:[plexShowSprite]  from loop::@9
  [86] plexShowSprite::plex_sprite_idx2#0 = plex_sprite_idx << 1
  [87] plexShowSprite::plexFreeAdd1_ypos#0 = PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]]
  [88] SPRITES_YPOS[plexShowSprite::plex_sprite_idx2#0] = plexShowSprite::plexFreeAdd1_ypos#0
  to:plexShowSprite::plexFreeAdd1
plexShowSprite::plexFreeAdd1: scope:[plexShowSprite]  from plexShowSprite
  [89] plexShowSprite::plexFreeAdd1_$0 = plexShowSprite::plexFreeAdd1_ypos#0 + $16
  [90] PLEX_FREE_YPOS[plex_free_next] = plexShowSprite::plexFreeAdd1_$0
  [91] plexShowSprite::plexFreeAdd1_$1 = plex_free_next + 1
  [92] plexShowSprite::plexFreeAdd1_$2 = plexShowSprite::plexFreeAdd1_$1 & 7
  [93] plex_free_next = plexShowSprite::plexFreeAdd1_$2
  to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite]  from plexShowSprite::plexFreeAdd1
  [94] PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]]
  [95] plexShowSprite::xpos_idx#0 = PLEX_SORTED_IDX[plex_show_idx]
  [96] plexShowSprite::$10 = plexShowSprite::xpos_idx#0 << 1
  [97] SPRITES_XPOS[plexShowSprite::plex_sprite_idx2#0] = (char)PLEX_XPOS[plexShowSprite::$10]
  [98] plexShowSprite::$2 = byte1  PLEX_XPOS[plexShowSprite::$10]
  [99] if(plexShowSprite::$2!=0) goto plexShowSprite::@1
  to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite]  from plexShowSprite::@5
  [100] plexShowSprite::$8 = $ff ^ plex_sprite_msb
  [101] *SPRITES_XMSB = *SPRITES_XMSB & plexShowSprite::$8
  to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite]  from plexShowSprite::@1 plexShowSprite::@3
  [102] plexShowSprite::$4 = plex_sprite_idx + 1
  [103] plexShowSprite::$5 = plexShowSprite::$4 & 7
  [104] plex_sprite_idx = plexShowSprite::$5
  [105] plex_show_idx = ++ plex_show_idx
  [106] plex_sprite_msb = plex_sprite_msb << 1
  [107] if(plex_sprite_msb!=0) goto plexShowSprite::@return
  to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite]  from plexShowSprite::@2
  [108] plex_sprite_msb = 1
  to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite]  from plexShowSprite::@2 plexShowSprite::@4
  [109] return 
  to:@return
plexShowSprite::@1: scope:[plexShowSprite]  from plexShowSprite::@5
  [110] *SPRITES_XMSB = *SPRITES_XMSB | plex_sprite_msb
  to:plexShowSprite::@2
