Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src)
Identified constant variable (byte*) SCREEN
Identified constant variable (byte*) LOGO
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx 
Inlined call (byte~) main::$0 ← call toD018 (byte*) SCREEN (byte*) LOGO 
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) memset::@5
Culled Empty Block (label) memset::@3
Culled Empty Block (label) @7
Culled Empty Block (label) main::toD0181_@1
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::@8

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) BORDERCOL#0 ← ((byte*)) (number) $d020
  (byte*) BGCOL#0 ← ((byte*)) (number) $d021
  (byte*) BGCOL2#0 ← ((byte*)) (number) $d022
  (byte*) BGCOL3#0 ← ((byte*)) (number) $d023
  (byte*) D016#0 ← ((byte*)) (number) $d016
  (byte) VIC_MCM#0 ← (number) $10
  (byte) VIC_CSEL#0 ← (number) 8
  (byte*) D018#0 ← ((byte*)) (number) $d018
  (byte*) COLS#0 ← ((byte*)) (number) $d800
  (byte) BLACK#0 ← (number) 0
  (byte) WHITE#0 ← (number) 1
  (byte) DARK_GREY#0 ← (number) $b
  to:@8
memset: scope:[memset]  from main::@10 main::@9
  (byte) memset::c#4 ← phi( main::@10/(byte) memset::c#1 main::@9/(byte) memset::c#0 )
  (void*) memset::str#4 ← phi( main::@10/(void*) memset::str#1 main::@9/(void*) memset::str#0 )
  (word) memset::num#2 ← phi( main::@10/(word) memset::num#1 main::@9/(word) memset::num#0 )
  (bool~) memset::$0 ← (word) memset::num#2 > (number) 0
  (bool~) memset::$1 ← ! (bool~) memset::$0
  if((bool~) memset::$1) goto memset::@1
  to:memset::@2
memset::@1: scope:[memset]  from memset memset::@4
  (void*) memset::str#2 ← phi( memset/(void*) memset::str#4 memset::@4/(void*) memset::str#5 )
  (void*) memset::return#0 ← (void*) memset::str#2
  to:memset::@return
memset::@2: scope:[memset]  from memset
  (byte) memset::c#3 ← phi( memset/(byte) memset::c#4 )
  (word) memset::num#3 ← phi( memset/(word) memset::num#2 )
  (void*) memset::str#3 ← phi( memset/(void*) memset::str#4 )
  (byte*~) memset::$2 ← ((byte*)) (void*) memset::str#3
  (byte*~) memset::$3 ← (byte*~) memset::$2 + (word) memset::num#3
  (byte*) memset::end#0 ← (byte*~) memset::$3
  (byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#3
  to:memset::@4
memset::@4: scope:[memset]  from memset::@2 memset::@4
  (void*) memset::str#5 ← phi( memset::@2/(void*) memset::str#3 memset::@4/(void*) memset::str#5 )
  (byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@4/(byte*) memset::end#1 )
  (byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@4/(byte*) memset::dst#1 )
  (byte) memset::c#2 ← phi( memset::@2/(byte) memset::c#3 memset::@4/(byte) memset::c#2 )
  *((byte*) memset::dst#2) ← (byte) memset::c#2
  (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
  (bool~) memset::$4 ← (byte*) memset::dst#1 != (byte*) memset::end#1
  if((bool~) memset::$4) goto memset::@4
  to:memset::@1
memset::@return: scope:[memset]  from memset::@1
  (void*) memset::return#4 ← phi( memset::@1/(void*) memset::return#0 )
  (void*) memset::return#1 ← (void*) memset::return#4
  return 
  to:@return
@8: scope:[]  from @begin
  (byte*) SCREEN#0 ← ((byte*)) (number) $400
  (byte*) LOGO#0 ← ((byte*)) (number) $2000
  kickasm(location (byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))
    .for (var y=0; y<6	; y++)
        .for (var x=0;x<40; x++)
            .for(var cp=0; cp<8; cp++)
                .byte logoPic.getMulticolorByte(x,cp+y*8)
 }}
  to:@9
main: scope:[main]  from @9
  *((byte*) BORDERCOL#0) ← (byte) WHITE#0
  *((byte*) BGCOL2#0) ← (byte) DARK_GREY#0
  *((byte*) BGCOL#0) ← *((byte*) BGCOL2#0)
  *((byte*) BGCOL3#0) ← (byte) BLACK#0
  (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0
  (byte*) main::toD0181_gfx#0 ← (byte*) LOGO#0
  to:main::toD0181
main::toD0181: scope:[main]  from main
  (byte*) main::toD0181_gfx#1 ← phi( main/(byte*) main::toD0181_gfx#0 )
  (byte*) main::toD0181_screen#1 ← phi( main/(byte*) main::toD0181_screen#0 )
  (word~) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1
  (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff
  (number~) main::toD0181_$2#0 ← (number~) main::toD0181_$1#0 * (number) 4
  (number~) main::toD0181_$3#0 ← > (number~) main::toD0181_$2#0
  (word~) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1
  (byte~) main::toD0181_$5#0 ← > (word~) main::toD0181_$4#0
  (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (number) 4
  (number~) main::toD0181_$7#0 ← (number~) main::toD0181_$6#0 & (number) $f
  (number~) main::toD0181_$8#0 ← (number~) main::toD0181_$3#0 | (number~) main::toD0181_$7#0
  (byte) main::toD0181_return#0 ← (number~) main::toD0181_$8#0
  to:main::toD0181_@return
main::toD0181_@return: scope:[main]  from main::toD0181
  (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 )
  (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2
  to:main::@9
main::@9: scope:[main]  from main::toD0181_@return
  (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 )
  (byte~) main::$0 ← (byte) main::toD0181_return#3
  *((byte*) D018#0) ← (byte~) main::$0
  (byte~) main::$1 ← (byte) VIC_MCM#0 | (byte) VIC_CSEL#0
  *((byte*) D016#0) ← (byte~) main::$1
  (void*) memset::str#0 ← (void*)(byte*) SCREEN#0
  (byte) memset::c#0 ← (byte) BLACK#0
  (word) memset::num#0 ← (number) $28*(number) $19
  call memset 
  (void*) memset::return#2 ← (void*) memset::return#1
  to:main::@10
main::@10: scope:[main]  from main::@9
  (number~) main::$3 ← (byte) WHITE#0 | (number) 8
  (void*) memset::str#1 ← (void*)(byte*) COLS#0
  (byte) memset::c#1 ← (number~) main::$3
  (word) memset::num#1 ← (number) $28*(number) $19
  call memset 
  (void*) memset::return#3 ← (void*) memset::return#1
  to:main::@11
main::@11: scope:[main]  from main::@10
  (byte) main::ch#0 ← (byte) 0
  to:main::@1
main::@1: scope:[main]  from main::@1 main::@11
  (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@11/(byte) main::ch#0 )
  *((byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2
  (byte) main::ch#1 ← (byte) main::ch#2 + rangenext(0,$ef)
  (bool~) main::$5 ← (byte) main::ch#1 != rangelast(0,$ef)
  if((bool~) main::$5) goto main::@1
  to:main::@3
main::@3: scope:[main]  from main::@1 main::@4
  if(true) goto main::@4
  to:main::@return
main::@4: scope:[main]  from main::@3
  (byte*~) main::$8 ← (byte*) SCREEN#0 + (number) $3e7
  *((byte*~) main::$8) ← ++ *((byte*~) main::$8)
  kickasm() {{ inc $d020  }}
  to:main::@3
main::@return: scope:[main]  from main::@3
  return 
  to:@return
@9: scope:[]  from @8
  call main 
  to:@10
@10: scope:[]  from @9
  to:@end
@end: scope:[]  from @10

SYMBOL TABLE SSA
(label) @10
(label) @8
(label) @9
(label) @begin
(label) @end
(byte*) BGCOL
(byte*) BGCOL#0
(byte*) BGCOL2
(byte*) BGCOL2#0
(byte*) BGCOL3
(byte*) BGCOL3#0
(byte) BLACK
(byte) BLACK#0
(byte*) BORDERCOL
(byte*) BORDERCOL#0
(byte*) COLS
(byte*) COLS#0
(byte*) D016
(byte*) D016#0
(byte*) D018
(byte*) D018#0
(byte) DARK_GREY
(byte) DARK_GREY#0
(byte*) LOGO
(byte*) LOGO#0
(byte*) SCREEN
(byte*) SCREEN#0
(byte) VIC_CSEL
(byte) VIC_CSEL#0
(byte) VIC_MCM
(byte) VIC_MCM#0
(byte) WHITE
(byte) WHITE#0
(void()) main()
(byte~) main::$0
(byte~) main::$1
(number~) main::$3
(bool~) main::$5
(byte*~) main::$8
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@3
(label) main::@4
(label) main::@9
(label) main::@return
(byte) main::ch
(byte) main::ch#0
(byte) main::ch#1
(byte) main::ch#2
(label) main::toD0181
(word~) main::toD0181_$0
(word~) main::toD0181_$0#0
(number~) main::toD0181_$1
(number~) main::toD0181_$1#0
(number~) main::toD0181_$2
(number~) main::toD0181_$2#0
(number~) main::toD0181_$3
(number~) main::toD0181_$3#0
(word~) main::toD0181_$4
(word~) main::toD0181_$4#0
(byte~) main::toD0181_$5
(byte~) main::toD0181_$5#0
(number~) main::toD0181_$6
(number~) main::toD0181_$6#0
(number~) main::toD0181_$7
(number~) main::toD0181_$7#0
(number~) main::toD0181_$8
(number~) main::toD0181_$8#0
(label) main::toD0181_@return
(byte*) main::toD0181_gfx
(byte*) main::toD0181_gfx#0
(byte*) main::toD0181_gfx#1
(byte) main::toD0181_return
(byte) main::toD0181_return#0
(byte) main::toD0181_return#1
(byte) main::toD0181_return#2
(byte) main::toD0181_return#3
(byte*) main::toD0181_screen
(byte*) main::toD0181_screen#0
(byte*) main::toD0181_screen#1
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(bool~) memset::$0
(bool~) memset::$1
(byte*~) memset::$2
(byte*~) memset::$3
(bool~) memset::$4
(label) memset::@1
(label) memset::@2
(label) memset::@4
(label) memset::@return
(byte) memset::c
(byte) memset::c#0
(byte) memset::c#1
(byte) memset::c#2
(byte) memset::c#3
(byte) memset::c#4
(byte*) memset::dst
(byte*) memset::dst#0
(byte*) memset::dst#1
(byte*) memset::dst#2
(byte*) memset::end
(byte*) memset::end#0
(byte*) memset::end#1
(word) memset::num
(word) memset::num#0
(word) memset::num#1
(word) memset::num#2
(word) memset::num#3
(void*) memset::return
(void*) memset::return#0
(void*) memset::return#1
(void*) memset::return#2
(void*) memset::return#3
(void*) memset::return#4
(void*) memset::str
(void*) memset::str#0
(void*) memset::str#1
(void*) memset::str#2
(void*) memset::str#3
(void*) memset::str#4
(void*) memset::str#5

Adding number conversion cast (unumber) $10 in (byte) VIC_MCM#0 ← (number) $10
Adding number conversion cast (unumber) 8 in (byte) VIC_CSEL#0 ← (number) 8
Adding number conversion cast (unumber) 0 in (byte) BLACK#0 ← (number) 0
Adding number conversion cast (unumber) 1 in (byte) WHITE#0 ← (number) 1
Adding number conversion cast (unumber) $b in (byte) DARK_GREY#0 ← (number) $b
Adding number conversion cast (unumber) 0 in (bool~) memset::$0 ← (word) memset::num#2 > (number) 0
Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0181_$1#0 in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (unumber)(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (number) 4
Adding number conversion cast (unumber) main::toD0181_$2#0 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (unumber)(number) 4
Adding number conversion cast (unumber) main::toD0181_$3#0 in (number~) main::toD0181_$3#0 ← > (unumber~) main::toD0181_$2#0
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (number) 4
Adding number conversion cast (unumber) main::toD0181_$6#0 in (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (unumber)(number) 4
Adding number conversion cast (unumber) $f in (number~) main::toD0181_$7#0 ← (unumber~) main::toD0181_$6#0 & (number) $f
Adding number conversion cast (unumber) main::toD0181_$7#0 in (number~) main::toD0181_$7#0 ← (unumber~) main::toD0181_$6#0 & (unumber)(number) $f
Adding number conversion cast (unumber) main::toD0181_$8#0 in (number~) main::toD0181_$8#0 ← (unumber~) main::toD0181_$3#0 | (unumber~) main::toD0181_$7#0
Adding number conversion cast (unumber) $28*$19 in (word) memset::num#0 ← (number) $28*(number) $19
Adding number conversion cast (unumber) 8 in (number~) main::$3 ← (byte) WHITE#0 | (number) 8
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte) WHITE#0 | (unumber)(number) 8
Adding number conversion cast (unumber) $28*$19 in (word) memset::num#1 ← (number) $28*(number) $19
Adding number conversion cast (unumber) $3e7 in (byte*~) main::$8 ← (byte*) SCREEN#0 + (number) $3e7
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) BORDERCOL#0 ← (byte*)(number) $d020
Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d021
Inlining cast (byte*) BGCOL2#0 ← (byte*)(number) $d022
Inlining cast (byte*) BGCOL3#0 ← (byte*)(number) $d023
Inlining cast (byte*) D016#0 ← (byte*)(number) $d016
Inlining cast (byte) VIC_MCM#0 ← (unumber)(number) $10
Inlining cast (byte) VIC_CSEL#0 ← (unumber)(number) 8
Inlining cast (byte*) D018#0 ← (byte*)(number) $d018
Inlining cast (byte*) COLS#0 ← (byte*)(number) $d800
Inlining cast (byte) BLACK#0 ← (unumber)(number) 0
Inlining cast (byte) WHITE#0 ← (unumber)(number) 1
Inlining cast (byte) DARK_GREY#0 ← (unumber)(number) $b
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#3
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte*) LOGO#0 ← (byte*)(number) $2000
Inlining cast (word~) main::toD0181_$0#0 ← (word)(byte*) main::toD0181_screen#1
Inlining cast (word~) main::toD0181_$4#0 ← (word)(byte*) main::toD0181_gfx#1
Inlining cast (word) memset::num#0 ← (unumber)(number) $28*(number) $19
Inlining cast (word) memset::num#1 ← (unumber)(number) $28*(number) $19
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53282
Simplifying constant pointer cast (byte*) 53283
Simplifying constant pointer cast (byte*) 53270
Simplifying constant integer cast $10
Simplifying constant integer cast 8
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 55296
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast $b
Simplifying constant integer cast 0
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 8192
Simplifying constant integer cast $3fff
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 8
Simplifying constant integer cast $3e7
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $10
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $b
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $3fff
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) 8
Finalized unsigned number type (word) $3e7
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to word in (unumber~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (word) $3fff
Inferred type updated to word in (unumber~) main::toD0181_$2#0 ← (word~) main::toD0181_$1#0 * (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$3#0 ← > (word~) main::toD0181_$2#0
Inferred type updated to byte in (unumber~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$7#0 ← (byte~) main::toD0181_$6#0 & (byte) $f
Inferred type updated to byte in (unumber~) main::toD0181_$8#0 ← (byte~) main::toD0181_$3#0 | (byte~) main::toD0181_$7#0
Inferred type updated to byte in (unumber~) main::$3 ← (byte) WHITE#0 | (byte) 8
Inversing boolean not [14] (bool~) memset::$1 ← (word) memset::num#2 <= (byte) 0 from [13] (bool~) memset::$0 ← (word) memset::num#2 > (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (void*) memset::return#0 = (void*) memset::str#2 (void*) memset::return#4 (void*) memset::return#1 
Alias (void*) memset::str#3 = (void*) memset::str#4 
Alias (word) memset::num#2 = (word) memset::num#3 
Alias (byte) memset::c#3 = (byte) memset::c#4 
Alias (byte*) memset::end#0 = (byte*~) memset::$3 
Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 
Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 
Alias (byte) main::toD0181_return#0 = (byte~) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$0 
Alias (byte) memset::c#1 = (byte~) main::$3 
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) memset::c#2
Self Phi Eliminated (byte*) memset::end#1
Self Phi Eliminated (void*) memset::str#5
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte) memset::c#2 (byte) memset::c#3
Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0
Identical Phi Values (void*) memset::str#5 (void*) memset::str#3
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (void*) memset::return#0 (void*) memset::str#3
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) memset::$1 [15] if((word) memset::num#2<=(byte) 0) goto memset::@1
Simple Condition (bool~) memset::$4 [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@4
Simple Condition (bool~) main::$5 [74] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [60] (word) memset::num#0 ← (unumber)(number) $28*(number) $19
Constant right-side identified [66] (word) memset::num#1 ← (unumber)(number) $28*(number) $19
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) BORDERCOL#0 = (byte*) 53280
Constant (const byte*) BGCOL#0 = (byte*) 53281
Constant (const byte*) BGCOL2#0 = (byte*) 53282
Constant (const byte*) BGCOL3#0 = (byte*) 53283
Constant (const byte*) D016#0 = (byte*) 53270
Constant (const byte) VIC_MCM#0 = $10
Constant (const byte) VIC_CSEL#0 = 8
Constant (const byte*) D018#0 = (byte*) 53272
Constant (const byte*) COLS#0 = (byte*) 55296
Constant (const byte) BLACK#0 = 0
Constant (const byte) WHITE#0 = 1
Constant (const byte) DARK_GREY#0 = $b
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const byte*) LOGO#0 = (byte*) 8192
Constant (const word) memset::num#0 = (unumber)$28*$19
Constant (const word) memset::num#1 = (unumber)$28*$19
Constant (const byte) main::ch#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) main::toD0181_screen#0 = SCREEN#0
Constant (const byte*) main::toD0181_gfx#0 = LOGO#0
Constant (const byte) memset::c#0 = BLACK#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (word)main::toD0181_screen#0 in [41] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [45] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (void*)SCREEN#0 in [58] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0
Constant value identified (void*)COLS#0 in [64] (void*) memset::str#1 ← (void*)(const byte*) COLS#0
Successful SSA optimization Pass2ConstantValues
if() condition always true - replacing block destination [75] if(true) goto main::@4
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [72] main::ch#1 ← ++ main::ch#2 to ++
Resolved ranged comparison value [74] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0
Eliminating unused variable (void*) memset::return#2 and assignment [29] (void*) memset::return#2 ← (void*) memset::str#3
Eliminating unused variable (void*) memset::return#3 and assignment [33] (void*) memset::return#3 ← (void*) memset::str#3
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) $f0 in if((byte) main::ch#1!=(number) $f0) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $f0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $f0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [25] (byte~) main::$1 ← (const byte) VIC_MCM#0 | (const byte) VIC_CSEL#0
Constant right-side identified [29] (byte) memset::c#1 ← (const byte) WHITE#0 | (byte) 8
Constant right-side identified [36] (byte*~) main::$8 ← (const byte*) SCREEN#0 + (word) $3e7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$0#0 = (word)main::toD0181_screen#0
Constant (const word) main::toD0181_$4#0 = (word)main::toD0181_gfx#0
Constant (const byte) main::$1 = VIC_MCM#0|VIC_CSEL#0
Constant (const void*) memset::str#0 = (void*)SCREEN#0
Constant (const byte) memset::c#1 = WHITE#0|8
Constant (const void*) memset::str#1 = (void*)COLS#0
Constant (const byte*) main::$8 = SCREEN#0+$3e7
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [15] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [18] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff
Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [15] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4
Constant right-side identified [17] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0*4
Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0/4
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [15] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0
Constant right-side identified [16] (byte~) main::toD0181_$7#0 ← (const byte) main::toD0181_$6#0 & (byte) $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0
Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [15] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3#0 | (const byte) main::toD0181_$7#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [2] (byte*~) memset::$2 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Inlining Noop Cast [4] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#3 keeping memset::str#3
Successful SSA optimization Pass2NopCastInlining
Inlining constant with var siblings (const word) memset::num#0
Inlining constant with var siblings (const word) memset::num#1
Inlining constant with var siblings (const byte) memset::c#0
Inlining constant with var siblings (const void*) memset::str#0
Inlining constant with var siblings (const byte) memset::c#1
Inlining constant with var siblings (const void*) memset::str#1
Inlining constant with var siblings (const byte) main::ch#0
Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0
Constant inlined main::toD0181_gfx#0 = (const byte*) LOGO#0
Constant inlined memset::str#1 = (void*)(const byte*) COLS#0
Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0
Constant inlined main::toD0181_$0#0 = (word)(const byte*) SCREEN#0
Constant inlined memset::num#1 = (word)(number) $28*(number) $19
Constant inlined main::toD0181_$1#0 = (word)(const byte*) SCREEN#0&(word) $3fff
Constant inlined memset::num#0 = (word)(number) $28*(number) $19
Constant inlined main::toD0181_$6#0 = >(word)(const byte*) LOGO#0/(byte) 4
Constant inlined main::toD0181_$7#0 = >(word)(const byte*) LOGO#0/(byte) 4&(byte) $f
Constant inlined main::$1 = (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0
Constant inlined main::toD0181_$2#0 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$3#0 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$4#0 = (word)(const byte*) LOGO#0
Constant inlined main::toD0181_$5#0 = >(word)(const byte*) LOGO#0
Constant inlined memset::c#0 = (const byte) BLACK#0
Constant inlined memset::c#1 = (const byte) WHITE#0|(byte) 8
Constant inlined main::ch#0 = (byte) 0
Constant inlined main::$8 = (const byte*) SCREEN#0+(word) $3e7
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting memset::@6(between memset::@4 and memset::@4)
Added new block during phi lifting main::@12(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @9
Adding NOP phi() at start of @10
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toD0181_@return
Adding NOP phi() at start of main::@10
Adding NOP phi() at start of main::@11
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of memset::@1
CALL GRAPH
Calls in [] to main:3 
Calls in [main] to memset:14 memset:16 

Created 5 initial phi equivalence classes
Coalesced [25] main::ch#3 ← main::ch#1
Coalesced [36] memset::dst#4 ← memset::dst#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @10
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::@11
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@12
Culled Empty Block (label) memset::@1
Culled Empty Block (label) memset::@6
Renumbering block @8 to @1
Renumbering block @9 to @2
Renumbering block memset::@2 to memset::@1
Renumbering block memset::@4 to memset::@2
Renumbering block main::@4 to main::@2
Renumbering block main::@9 to main::@3
Renumbering block main::@10 to main::@4
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::@4

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))
    .for (var y=0; y<6	; y++)
        .for (var x=0;x<40; x++)
            .for(var cp=0; cp<8; cp++)
                .byte logoPic.getMulticolorByte(x,cp+y*8)
 }}
  to:@2
@2: scope:[]  from @1
  [2] phi()
  [3] call main 
  to:@end
@end: scope:[]  from @2
  [4] phi()
main: scope:[main]  from @2
  [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0
  [6] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0
  [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0)
  [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0
  to:main::toD0181
main::toD0181: scope:[main]  from main
  [9] phi()
  to:main::@3
main::@3: scope:[main]  from main::toD0181
  [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
  [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0
  [12] call memset 
  to:main::@4
main::@4: scope:[main]  from main::@3
  [13] phi()
  [14] call memset 
  to:main::@1
main::@1: scope:[main]  from main::@1 main::@4
  [15] (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@4/(byte) 0 )
  [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2
  [17] (byte) main::ch#1 ← ++ (byte) main::ch#2
  [18] if((byte) main::ch#1!=(byte) $f0) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@2
  [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7)
  kickasm() {{ inc $d020  }}
  to:main::@2
memset: scope:[memset]  from main::@3 main::@4
  [21] (byte) memset::c#3 ← phi( main::@4/(const byte) WHITE#0|(byte) 8 main::@3/(const byte) BLACK#0 )
  [21] (void*) memset::str#3 ← phi( main::@4/(void*)(const byte*) COLS#0 main::@3/(void*)(const byte*) SCREEN#0 )
  [21] (word) memset::num#2 ← phi( main::@4/(word)(number) $28*(number) $19 main::@3/(word)(number) $28*(number) $19 )
  [22] if((word) memset::num#2<=(byte) 0) goto memset::@return
  to:memset::@1
memset::@1: scope:[memset]  from memset
  [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
  [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
  to:memset::@2
memset::@2: scope:[memset]  from memset::@1 memset::@2
  [25] (byte*) memset::dst#2 ← phi( memset::@1/(byte*~) memset::dst#3 memset::@2/(byte*) memset::dst#1 )
  [26] *((byte*) memset::dst#2) ← (byte) memset::c#3
  [27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
  [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2
  to:memset::@return
memset::@return: scope:[memset]  from memset memset::@2
  [29] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte*) BGCOL
(byte*) BGCOL2
(byte*) BGCOL3
(byte) BLACK
(byte*) BORDERCOL
(byte*) COLS
(byte*) D016
(byte*) D018
(byte) DARK_GREY
(byte*) LOGO
(byte*) SCREEN
(byte) VIC_CSEL
(byte) VIC_MCM
(byte) WHITE
(void()) main()
(byte) main::ch
(byte) main::ch#1 16.5
(byte) main::ch#2 22.0
(word~) main::toD0181_$0
(number~) main::toD0181_$1
(number~) main::toD0181_$2
(number~) main::toD0181_$3
(word~) main::toD0181_$4
(byte~) main::toD0181_$5
(number~) main::toD0181_$6
(number~) main::toD0181_$7
(number~) main::toD0181_$8
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(byte*) main::toD0181_screen
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte) memset::c
(byte) memset::c#3 1.375
(byte*) memset::dst
(byte*) memset::dst#1 16.5
(byte*) memset::dst#2 17.5
(byte*~) memset::dst#3 4.0
(byte*) memset::end
(byte*) memset::end#0 2.1666666666666665
(word) memset::num
(word) memset::num#2 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#3

Initial phi equivalence classes
[ main::ch#2 main::ch#1 ]
[ memset::num#2 ]
[ memset::str#3 ]
[ memset::c#3 ]
[ memset::dst#2 memset::dst#3 memset::dst#1 ]
Added variable memset::end#0 to zero page equivalence class [ memset::end#0 ]
Complete equivalence classes
[ main::ch#2 main::ch#1 ]
[ memset::num#2 ]
[ memset::str#3 ]
[ memset::c#3 ]
[ memset::dst#2 memset::dst#3 memset::dst#1 ]
[ memset::end#0 ]
Allocated zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ]
Allocated zp ZP_WORD:3 [ memset::num#2 ]
Allocated zp ZP_WORD:5 [ memset::str#3 ]
Allocated zp ZP_BYTE:7 [ memset::c#3 ]
Allocated zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ]
Allocated zp ZP_WORD:10 [ memset::end#0 ]

INITIAL ASM
  // File Comments
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label BORDERCOL = $d020
  .label BGCOL = $d021
  .label BGCOL2 = $d022
  .label BGCOL3 = $d023
  .label D016 = $d016
  .const VIC_MCM = $10
  .const VIC_CSEL = 8
  .label D018 = $d018
  // Color Ram
  .label COLS = $d800
  // The colors of the C64
  .const BLACK = 0
  .const WHITE = 1
  .const DARK_GREY = $b
  .label SCREEN = $400
  .label LOGO = $2000
  // @begin
bbegin:
  jmp b1
  // @1
b1:
  // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))     .for (var y=0; y<6	; y++)         .for (var x=0;x<40; x++)             .for(var cp=0; cp<8; cp++)                 .byte logoPic.getMulticolorByte(x,cp+y*8)  }}
  // [2] phi from @1 to @2 [phi:@1->@2]
b2_from_b1:
  jmp b2
  // @2
b2:
  // [3] call main 
  jsr main
  // [4] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
  // @end
bend:
  // main
main: {
    .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f
    .label ch = 2
    // [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta BORDERCOL
    // [6] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2 
    lda #DARK_GREY
    sta BGCOL2
    // [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) -- _deref_pbuc1=_deref_pbuc2 
    lda BGCOL2
    sta BGCOL
    // [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BGCOL3
    // [9] phi from main to main::toD0181 [phi:main->main::toD0181]
  toD0181_from_main:
    jmp toD0181
    // main::toD0181
  toD0181:
    jmp b3
    // main::@3
  b3:
    // [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 -- _deref_pbuc1=vbuc2 
    lda #VIC_MCM|VIC_CSEL
    sta D016
    // [12] call memset 
    // [21] phi from main::@3 to memset [phi:main::@3->memset]
  memset_from_b3:
    // [21] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuz1=vbuc1 
    lda #BLACK
    sta memset.c
    // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 
    lda #<SCREEN
    sta memset.str
    lda #>SCREEN
    sta memset.str+1
    // [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#2] -- vwuz1=vwuc1 
    lda #<$28*$19
    sta memset.num
    lda #>$28*$19
    sta memset.num+1
    jsr memset
    // [13] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
  b4_from_b3:
    jmp b4
    // main::@4
  b4:
    // [14] call memset 
    // [21] phi from main::@4 to memset [phi:main::@4->memset]
  memset_from_b4:
    // [21] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuz1=vbuc1 
    lda #WHITE|8
    sta memset.c
    // [21] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1 
    lda #<COLS
    sta memset.str
    lda #>COLS
    sta memset.str+1
    // [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#2] -- vwuz1=vwuc1 
    lda #<$28*$19
    sta memset.num
    lda #>$28*$19
    sta memset.num+1
    jsr memset
    // [15] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
  b1_from_b4:
    // [15] phi (byte) main::ch#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta ch
    jmp b1
    // [15] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  b1_from_b1:
    // [15] phi (byte) main::ch#2 = (byte) main::ch#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuz1=vbuz1 
    ldy ch
    tya
    sta SCREEN,y
    // [17] (byte) main::ch#1 ← ++ (byte) main::ch#2 -- vbuz1=_inc_vbuz1 
    inc ch
    // [18] if((byte) main::ch#1!=(byte) $f0) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 
    lda #$f0
    cmp ch
    bne b1_from_b1
    jmp b2
    // main::@2
  b2:
    // [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc SCREEN+$3e7
    // kickasm() {{ inc $d020  }}
    inc $d020 
    jmp b2
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage(5) str, byte zeropage(7) c, word zeropage(3) num)
memset: {
    .label end = $a
    .label dst = 8
    .label num = 3
    .label str = 5
    .label c = 7
    // [22] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 
    lda num
    bne !+
    lda num+1
    beq breturn
  !:
    jmp b1
    // memset::@1
  b1:
    // [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz3 
    lda str
    clc
    adc num
    sta end
    lda str+1
    adc num+1
    sta end+1
    // [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 -- pbuz1=pbuz2 
    lda str
    sta dst
    lda str+1
    sta dst+1
    // [25] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
  b2_from_b1:
  b2_from_b2:
    // [25] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy 
    jmp b2
    // memset::@2
  b2:
    // [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuz2 
    lda c
    ldy #0
    sta (dst),y
    // [27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc dst
    bne !+
    inc dst+1
  !:
    // [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1 
    lda dst+1
    cmp end+1
    bne b2_from_b2
    lda dst
    cmp end
    bne b2_from_b2
    jmp breturn
    // memset::@return
  breturn:
    // [29] return 
    rts
}
  // File Data
.pc = LOGO "LOGO"
  .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))
    .for (var y=0; y<6	; y++)
        .for (var x=0;x<40; x++)
            .for(var cp=0; cp<8; cp++)
                .byte logoPic.getMulticolorByte(x,cp+y*8)


REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [22] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#3 ] ( main:3::memset:12 [ memset::num#2 memset::str#3 memset::c#3 ] main:3::memset:14 [ memset::num#2 memset::str#3 memset::c#3 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ memset::c#3 ]
Statement [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#3 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#3 memset::c#3 memset::end#0 ] ) always clobbers reg byte a 
Statement [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a 
Statement [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ memset::c#3 ]
Statement [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a 
Statement [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 [ ] ( main:3 [ ] ) always clobbers reg byte a 
Statement [22] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#3 ] ( main:3::memset:12 [ memset::num#2 memset::str#3 memset::c#3 ] main:3::memset:14 [ memset::num#2 memset::str#3 memset::c#3 ] ) always clobbers reg byte a 
Statement [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#3 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#3 memset::c#3 memset::end#0 ] ) always clobbers reg byte a 
Statement [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a 
Statement [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y 
Statement [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:3 [ memset::num#2 ] : zp ZP_WORD:3 , 
Potential registers zp ZP_WORD:5 [ memset::str#3 ] : zp ZP_WORD:5 , 
Potential registers zp ZP_BYTE:7 [ memset::c#3 ] : zp ZP_BYTE:7 , reg byte x , 
Potential registers zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] : zp ZP_WORD:8 , 
Potential registers zp ZP_WORD:10 [ memset::end#0 ] : zp ZP_WORD:10 , 

REGISTER UPLIFT SCOPES
Uplift Scope [memset] 38: zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:10 [ memset::end#0 ] 2: zp ZP_WORD:3 [ memset::num#2 ] 1.38: zp ZP_BYTE:7 [ memset::c#3 ] 0: zp ZP_WORD:5 [ memset::str#3 ] 
Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] 
Uplift Scope [] 

Uplifting [memset] best 6254 combination zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:10 [ memset::end#0 ] zp ZP_WORD:3 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:5 [ memset::str#3 ] 
Uplifting [main] best 6134 combination reg byte x [ main::ch#2 main::ch#1 ] 
Uplifting [] best 6134 combination 
Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ memset::num#2 ] ] with [ zp ZP_WORD:10 [ memset::end#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ memset::str#3 ] ] with [ zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ memset::num#2 memset::end#0 ]
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label BORDERCOL = $d020
  .label BGCOL = $d021
  .label BGCOL2 = $d022
  .label BGCOL3 = $d023
  .label D016 = $d016
  .const VIC_MCM = $10
  .const VIC_CSEL = 8
  .label D018 = $d018
  // Color Ram
  .label COLS = $d800
  // The colors of the C64
  .const BLACK = 0
  .const WHITE = 1
  .const DARK_GREY = $b
  .label SCREEN = $400
  .label LOGO = $2000
  // @begin
bbegin:
  jmp b1
  // @1
b1:
  // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))     .for (var y=0; y<6	; y++)         .for (var x=0;x<40; x++)             .for(var cp=0; cp<8; cp++)                 .byte logoPic.getMulticolorByte(x,cp+y*8)  }}
  // [2] phi from @1 to @2 [phi:@1->@2]
b2_from_b1:
  jmp b2
  // @2
b2:
  // [3] call main 
  jsr main
  // [4] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
  // @end
bend:
  // main
main: {
    .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f
    // [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta BORDERCOL
    // [6] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2 
    lda #DARK_GREY
    sta BGCOL2
    // [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) -- _deref_pbuc1=_deref_pbuc2 
    lda BGCOL2
    sta BGCOL
    // [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BGCOL3
    // [9] phi from main to main::toD0181 [phi:main->main::toD0181]
  toD0181_from_main:
    jmp toD0181
    // main::toD0181
  toD0181:
    jmp b3
    // main::@3
  b3:
    // [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 -- _deref_pbuc1=vbuc2 
    lda #VIC_MCM|VIC_CSEL
    sta D016
    // [12] call memset 
    // [21] phi from main::@3 to memset [phi:main::@3->memset]
  memset_from_b3:
    // [21] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuxx=vbuc1 
    ldx #BLACK
    // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 
    lda #<SCREEN
    sta memset.str
    lda #>SCREEN
    sta memset.str+1
    // [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#2] -- vwuz1=vwuc1 
    lda #<$28*$19
    sta memset.num
    lda #>$28*$19
    sta memset.num+1
    jsr memset
    // [13] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
  b4_from_b3:
    jmp b4
    // main::@4
  b4:
    // [14] call memset 
    // [21] phi from main::@4 to memset [phi:main::@4->memset]
  memset_from_b4:
    // [21] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuxx=vbuc1 
    ldx #WHITE|8
    // [21] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1 
    lda #<COLS
    sta memset.str
    lda #>COLS
    sta memset.str+1
    // [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#2] -- vwuz1=vwuc1 
    lda #<$28*$19
    sta memset.num
    lda #>$28*$19
    sta memset.num+1
    jsr memset
    // [15] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
  b1_from_b4:
    // [15] phi (byte) main::ch#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    jmp b1
    // [15] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
  b1_from_b1:
    // [15] phi (byte) main::ch#2 = (byte) main::ch#1 [phi:main::@1->main::@1#0] -- register_copy 
    jmp b1
    // main::@1
  b1:
    // [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx 
    txa
    sta SCREEN,x
    // [17] (byte) main::ch#1 ← ++ (byte) main::ch#2 -- vbuxx=_inc_vbuxx 
    inx
    // [18] if((byte) main::ch#1!=(byte) $f0) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$f0
    bne b1_from_b1
    jmp b2
    // main::@2
  b2:
    // [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc SCREEN+$3e7
    // kickasm() {{ inc $d020  }}
    inc $d020 
    jmp b2
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage(4) str, byte register(X) c, word zeropage(2) num)
memset: {
    .label end = 2
    .label dst = 4
    .label num = 2
    .label str = 4
    // [22] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 
    lda num
    bne !+
    lda num+1
    beq breturn
  !:
    jmp b1
    // memset::@1
  b1:
    // [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 
    lda end
    clc
    adc str
    sta end
    lda end+1
    adc str+1
    sta end+1
    // [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
    // [25] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
  b2_from_b1:
  b2_from_b2:
    // [25] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy 
    jmp b2
    // memset::@2
  b2:
    // [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (dst),y
    // [27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc dst
    bne !+
    inc dst+1
  !:
    // [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1 
    lda dst+1
    cmp end+1
    bne b2_from_b2
    lda dst
    cmp end
    bne b2_from_b2
    jmp breturn
    // memset::@return
  breturn:
    // [29] return 
    rts
}
  // File Data
.pc = LOGO "LOGO"
  .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))
    .for (var y=0; y<6	; y++)
        .for (var x=0;x<40; x++)
            .for(var cp=0; cp<8; cp++)
                .byte logoPic.getMulticolorByte(x,cp+y*8)


ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp bend
Removing instruction jmp toD0181
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda BGCOL2
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b1_from_b1 with b1
Replacing label b2_from_b2 with b2
Replacing label b2_from_b2 with b2
Removing instruction b1:
Removing instruction b2_from_b1:
Removing instruction b2:
Removing instruction bend_from_b2:
Removing instruction toD0181_from_main:
Removing instruction toD0181:
Removing instruction b4_from_b3:
Removing instruction memset_from_b4:
Removing instruction b1_from_b1:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b3:
Removing instruction memset_from_b3:
Removing instruction b4:
Removing instruction b1_from_b4:
Removing instruction b1:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @2
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = (byte*) 53281
(byte*) BGCOL2
(const byte*) BGCOL2#0 BGCOL2 = (byte*) 53282
(byte*) BGCOL3
(const byte*) BGCOL3#0 BGCOL3 = (byte*) 53283
(byte) BLACK
(const byte) BLACK#0 BLACK = (byte) 0
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280
(byte*) COLS
(const byte*) COLS#0 COLS = (byte*) 55296
(byte*) D016
(const byte*) D016#0 D016 = (byte*) 53270
(byte*) D018
(const byte*) D018#0 D018 = (byte*) 53272
(byte) DARK_GREY
(const byte) DARK_GREY#0 DARK_GREY = (byte) $b
(byte*) LOGO
(const byte*) LOGO#0 LOGO = (byte*) 8192
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(byte) VIC_CSEL
(const byte) VIC_CSEL#0 VIC_CSEL = (byte) 8
(byte) VIC_MCM
(const byte) VIC_MCM#0 VIC_MCM = (byte) $10
(byte) WHITE
(const byte) WHITE#0 WHITE = (byte) 1
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(byte) main::ch
(byte) main::ch#1 reg byte x 16.5
(byte) main::ch#2 reg byte x 22.0
(label) main::toD0181
(word~) main::toD0181_$0
(number~) main::toD0181_$1
(number~) main::toD0181_$2
(number~) main::toD0181_$3
(word~) main::toD0181_$4
(byte~) main::toD0181_$5
(number~) main::toD0181_$6
(number~) main::toD0181_$7
(number~) main::toD0181_$8
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO#0/(byte) 4&(byte) $f
(byte*) main::toD0181_screen
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(byte) memset::c#3 reg byte x 1.375
(byte*) memset::dst
(byte*) memset::dst#1 dst zp ZP_WORD:4 16.5
(byte*) memset::dst#2 dst zp ZP_WORD:4 17.5
(byte*~) memset::dst#3 dst zp ZP_WORD:4 4.0
(byte*) memset::end
(byte*) memset::end#0 end zp ZP_WORD:2 2.1666666666666665
(word) memset::num
(word) memset::num#2 num zp ZP_WORD:2 2.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#3 str zp ZP_WORD:4

reg byte x [ main::ch#2 main::ch#1 ]
zp ZP_WORD:2 [ memset::num#2 memset::end#0 ]
zp ZP_WORD:4 [ memset::str#3 memset::dst#2 memset::dst#3 memset::dst#1 ]
reg byte x [ memset::c#3 ]


FINAL ASSEMBLER
Score: 5887

  // File Comments
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label BORDERCOL = $d020
  .label BGCOL = $d021
  .label BGCOL2 = $d022
  .label BGCOL3 = $d023
  .label D016 = $d016
  .const VIC_MCM = $10
  .const VIC_CSEL = 8
  .label D018 = $d018
  // Color Ram
  .label COLS = $d800
  // The colors of the C64
  .const BLACK = 0
  .const WHITE = 1
  .const DARK_GREY = $b
  .label SCREEN = $400
  .label LOGO = $2000
  // @begin
  // @1
  // kickasm
  // kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))     .for (var y=0; y<6	; y++)         .for (var x=0;x<40; x++)             .for(var cp=0; cp<8; cp++)                 .byte logoPic.getMulticolorByte(x,cp+y*8)  }}
  // [2] phi from @1 to @2 [phi:@1->@2]
  // @2
  // [3] call main 
  // [4] phi from @2 to @end [phi:@2->@end]
  // @end
  // main
main: {
    .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f
    // *BORDERCOL = WHITE
    // [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 
    lda #WHITE
    sta BORDERCOL
    // *BGCOL2 = DARK_GREY
    // [6] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2 
    lda #DARK_GREY
    sta BGCOL2
    // *BGCOL = *BGCOL2 = DARK_GREY
    // [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) -- _deref_pbuc1=_deref_pbuc2 
    sta BGCOL
    // *BGCOL3 = BLACK
    // [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 
    lda #BLACK
    sta BGCOL3
    // [9] phi from main to main::toD0181 [phi:main->main::toD0181]
    // main::toD0181
    // main::@3
    // *D018 = toD018(SCREEN, LOGO)
    // [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
    // *D016 = VIC_MCM | VIC_CSEL
    // [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 -- _deref_pbuc1=vbuc2 
    lda #VIC_MCM|VIC_CSEL
    sta D016
    // memset(SCREEN, BLACK, 40*25)
    // [12] call memset 
    // [21] phi from main::@3 to memset [phi:main::@3->memset]
    // [21] phi (byte) memset::c#3 = (const byte) BLACK#0 [phi:main::@3->memset#0] -- vbuxx=vbuc1 
    ldx #BLACK
    // [21] phi (void*) memset::str#3 = (void*)(const byte*) SCREEN#0 [phi:main::@3->memset#1] -- pvoz1=pvoc1 
    lda #<SCREEN
    sta memset.str
    lda #>SCREEN
    sta memset.str+1
    // [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@3->memset#2] -- vwuz1=vwuc1 
    lda #<$28*$19
    sta memset.num
    lda #>$28*$19
    sta memset.num+1
    jsr memset
    // [13] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
    // main::@4
    // memset(COLS, WHITE|8, 40*25)
    // [14] call memset 
    // [21] phi from main::@4 to memset [phi:main::@4->memset]
    // [21] phi (byte) memset::c#3 = (const byte) WHITE#0|(byte) 8 [phi:main::@4->memset#0] -- vbuxx=vbuc1 
    ldx #WHITE|8
    // [21] phi (void*) memset::str#3 = (void*)(const byte*) COLS#0 [phi:main::@4->memset#1] -- pvoz1=pvoc1 
    lda #<COLS
    sta memset.str
    lda #>COLS
    sta memset.str+1
    // [21] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@4->memset#2] -- vwuz1=vwuc1 
    lda #<$28*$19
    sta memset.num
    lda #>$28*$19
    sta memset.num+1
    jsr memset
    // [15] phi from main::@4 to main::@1 [phi:main::@4->main::@1]
    // [15] phi (byte) main::ch#2 = (byte) 0 [phi:main::@4->main::@1#0] -- vbuxx=vbuc1 
    ldx #0
    // [15] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
    // [15] phi (byte) main::ch#2 = (byte) main::ch#1 [phi:main::@1->main::@1#0] -- register_copy 
    // main::@1
  b1:
    // SCREEN[ch] = ch
    // [16] *((const byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 -- pbuc1_derefidx_vbuxx=vbuxx 
    txa
    sta SCREEN,x
    // for(byte ch: 0..239)
    // [17] (byte) main::ch#1 ← ++ (byte) main::ch#2 -- vbuxx=_inc_vbuxx 
    inx
    // [18] if((byte) main::ch#1!=(byte) $f0) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 
    cpx #$f0
    bne b1
    // main::@2
  b2:
    // (*(SCREEN+999))++;
    // [19] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc SCREEN+$3e7
    // kickasm
    // kickasm() {{ inc $d020  }}
    inc $d020 
    jmp b2
}
  // memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zeropage(4) str, byte register(X) c, word zeropage(2) num)
memset: {
    .label end = 2
    .label dst = 4
    .label num = 2
    .label str = 4
    // if(num>0)
    // [22] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 
    lda num
    bne !+
    lda num+1
    beq breturn
  !:
    // memset::@1
    // end = (char*)str + num
    // [23] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 
    lda end
    clc
    adc str
    sta end
    lda end+1
    adc str+1
    sta end+1
    // [24] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#3
    // [25] phi from memset::@1 memset::@2 to memset::@2 [phi:memset::@1/memset::@2->memset::@2]
    // [25] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset::@1/memset::@2->memset::@2#0] -- register_copy 
    // memset::@2
  b2:
    // *dst = c
    // [26] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (dst),y
    // for(char* dst = str; dst!=end; dst++)
    // [27] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 
    inc dst
    bne !+
    inc dst+1
  !:
    // [28] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuz2_then_la1 
    lda dst+1
    cmp end+1
    bne b2
    lda dst
    cmp end
    bne b2
    // memset::@return
  breturn:
    // }
    // [29] return 
    rts
}
  // File Data
.pc = LOGO "LOGO"
  .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))
    .for (var y=0; y<6	; y++)
        .for (var x=0;x<40; x++)
            .for(var cp=0; cp<8; cp++)
                .byte logoPic.getMulticolorByte(x,cp+y*8)


