1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-04-13 03:39:12 +00:00

Readded cfg/log/sym-files to tests

This commit is contained in:
jespergravgaard 2019-05-30 22:29:04 +02:00
parent 036724c92d
commit b755cd448f
1024 changed files with 166211 additions and 130394 deletions
src/test
java/dk/camelot64/kickc/test
ref
array-length-symbolic-min.cfgarray-length-symbolic-min.logarray-length-symbolic-min.symarray-length-symbolic.cfgarray-length-symbolic.logarray-length-symbolic.symarrays-init.cfgarrays-init.logarrays-init.symassignment-chained.cfgassignment-chained.logassignment-chained.symassignment-compound.cfgassignment-compound.logassignment-compound.symbgblack.logbgblack.symbitmap-plotter.cfgbitmap-plotter.logbitmap-plotter.symbitwise-not.cfgbitwise-not.logbitwise-not.symbool-const.cfgbool-const.logbool-const.symbool-function.cfgbool-function.logbool-function.symbool-ifs.cfgbool-ifs.logbool-ifs.symbool-nullpointer-exception.logbool-nullpointer-exception.symbool-pointer.cfgbool-pointer.logbool-pointer.symbool-vars.cfgbool-vars.logbool-vars.symbresenham.cfgbresenham.logbresenham.symbresenhamarr.cfgbresenhamarr.logbresenhamarr.symc-types.cfgc-types.logc-types.symc64dtv-8bppcharstretch.cfgc64dtv-8bppcharstretch.logc64dtv-8bppcharstretch.symc64dtv-8bppchunkystretch.cfgc64dtv-8bppchunkystretch.logc64dtv-8bppchunkystretch.symc64dtv-blitter-box.cfgc64dtv-blitter-box.logc64dtv-blitter-box.symc64dtv-blittermin.cfgc64dtv-blittermin.logc64dtv-blittermin.symc64dtv-color.cfgc64dtv-color.logc64dtv-color.symc64dtv-gfxexplorer.cfgc64dtv-gfxexplorer.logc64dtv-gfxexplorer.symc64dtv-gfxmodes.cfgc64dtv-gfxmodes.logc64dtv-gfxmodes.symcallconstparam.cfgcallconstparam.logcallconstparam.symcast-deref.cfgcast-deref.logcast-deref.symcast-not-needed-2.cfgcast-not-needed-2.logcast-not-needed-2.symcast-not-needed-3.cfgcast-not-needed-3.logcast-not-needed-3.symcast-not-needed.cfgcast-not-needed.logcast-not-needed.symcast-precedence-problem.cfgcast-precedence-problem.logcast-precedence-problem.symcasting.cfgcasting.logcasting.symchargen.cfgchargen.logchargen.symchessboard.cfgchessboard.logchessboard.symclobber-a-problem.cfgclobber-a-problem.log

@ -2069,9 +2069,9 @@ public class TestPrograms {
boolean success = true;
ReferenceHelper helper = new ReferenceHelperFolder(refPath);
success &= helper.testOutput(fileName, ".asm", program.getAsm().toString(false));
//success &= helper.testOutput(fileName, ".sym", program.getScope().getSymbolTableContents(program));
//success &= helper.testOutput(fileName, ".cfg", program.getGraph().toString(program));
//success &= helper.testOutput(fileName, ".log", program.getLog().toString());
success &= helper.testOutput(fileName, ".sym", program.getScope().toString(program));
success &= helper.testOutput(fileName, ".cfg", program.getGraph().toString(program));
success &= helper.testOutput(fileName, ".log", program.getLog().toString());
if(!success) {
//System.out.println("\nCOMPILE LOG");
//System.out.println(program.getLog().toString());

@ -11,10 +11,10 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::sub#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::sub#1 )
[5] (byte) main::sub#2 ← phi( main/(byte) 0 main::@1/(byte) main::sub#1 )
[6] *((const byte[SZ#0]) items#0 + (byte) main::sub#2) ← (byte) main::sub#2
[7] (byte) main::sub#1 ← ++ (byte) main::sub#2
[8] if((byte) main::sub#1!=(const byte) SZ#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
[8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[9] return

@ -1,13 +1,14 @@
Identified constant variable (byte) SZ
Culled Empty Block (label) main::@2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte) SZ#0 ← (byte/signed byte/word/signed word/dword/signed dword) $f
(byte) SZ#0 ← (number) $f
(byte[SZ#0]) items#0 ← { fill( SZ#0, 0) }
to:@1
main: scope:[main] from @1
(byte*) main::cur_item#0 ← (byte[SZ#0]) items#0
(byte) main::sub#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::sub#0 ← (number) 0
to:main::@1
main::@1: scope:[main] from main main::@1
(byte*) main::cur_item#1 ← phi( main/(byte*) main::cur_item#0 main::@1/(byte*) main::cur_item#1 )
@ -48,38 +49,60 @@ SYMBOL TABLE SSA
(byte) main::sub#1
(byte) main::sub#2
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) $f in (byte) SZ#0 ← (number) $f
Adding number conversion cast (unumber) 0 in (byte) main::sub#0 ← (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) SZ#0 ← (unumber)(number) $f
Inlining cast (byte) main::sub#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast $f
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Self Phi Eliminated (byte*) main::cur_item#1
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) main::cur_item#1 (byte*) main::cur_item#0
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte*) main::cur_item#1 (byte*) main::cur_item#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$0 [8] if((byte) main::sub#1!=rangelast(0,SZ#0)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte) SZ#0 = $f
Constant (const byte) main::sub#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified { fill( SZ#0, 0) } in [1] (byte[SZ#0]) items#0 ← { fill( SZ#0, 0) }
Successful SSA optimization Pass2ConstantValues
Resolved ranged next value [6] main::sub#1 ← ++ main::sub#2 to ++
Resolved ranged comparison value [8] if(main::sub#1!=rangelast(0,SZ#0)) goto main::@1 to (const byte) SZ#0+(number) 1
Adding number conversion cast (unumber) SZ#0+1 in if((byte) main::sub#1!=(const byte) SZ#0+(number) 1) goto main::@1
Adding number conversion cast (unumber) 1 in if((byte) main::sub#1!=(unumber)(const byte) SZ#0+(number) 1) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte) SZ#0+(unumber)(number) 1
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant (const byte[SZ#0]) items#0 = { fill( SZ#0, 0) }
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) main::cur_item#0 = items#0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value main::sub#1 ← ++ main::sub#2 to ++
Resolved ranged comparison value if(main::sub#1!=rangelast(0,SZ#0)) goto main::@1 to (const byte) SZ#0+(byte/signed byte/word/signed word/dword/signed dword) 1
Inlining constant with var siblings (const byte) main::sub#0
Constant inlined main::sub#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::sub#0 = (byte) 0
Constant inlined main::cur_item#0 = (const byte[SZ#0]) items#0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Created 1 initial phi equivalence classes
Coalesced [10] main::sub#3 ← main::sub#1
Coalesced [11] main::sub#3 ← main::sub#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
@ -100,10 +123,10 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::sub#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::sub#1 )
[5] (byte) main::sub#2 ← phi( main/(byte) 0 main::@1/(byte) main::sub#1 )
[6] *((const byte[SZ#0]) items#0 + (byte) main::sub#2) ← (byte) main::sub#2
[7] (byte) main::sub#1 ← ++ (byte) main::sub#2
[8] if((byte) main::sub#1!=(const byte) SZ#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
[8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[9] return
@ -156,7 +179,7 @@ main: {
.label sub = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::sub#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG12 [5] phi (byte) main::sub#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta sub
jmp b1
@ -172,7 +195,7 @@ main: {
sta items,y
//SEG17 [7] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuz1=_inc_vbuz1
inc sub
//SEG18 [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG18 [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #SZ+1
cmp sub
bne b1_from_b1
@ -224,7 +247,7 @@ bend:
main: {
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::sub#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::sub#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
@ -238,7 +261,7 @@ main: {
sta items,x
//SEG17 [7] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuxx=_inc_vbuxx
inx
//SEG18 [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG18 [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #SZ+1
bne b1_from_b1
jmp breturn
@ -279,7 +302,7 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte) SZ
(const byte) SZ#0 SZ = (byte/signed byte/word/signed word/dword/signed dword) $f
(const byte) SZ#0 SZ = (byte) $f
(byte[SZ#0]) items
(const byte[SZ#0]) items#0 items = { fill( SZ#0, 0) }
(void()) main()
@ -315,7 +338,7 @@ Score: 161
// Fills the array item by item with $is, where i is the item# and s is the sub#
main: {
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::sub#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::sub#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG14 [5] phi (byte) main::sub#2 = (byte) main::sub#1 [phi:main::@1->main::@1#0] -- register_copy
@ -326,7 +349,7 @@ main: {
sta items,x
//SEG17 [7] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuxx=_inc_vbuxx
inx
//SEG18 [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG18 [8] if((byte) main::sub#1!=(const byte) SZ#0+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #SZ+1
bne b1
//SEG19 main::@return

@ -1,16 +1 @@
(label) @1
(label) @begin
(label) @end
(byte) SZ
(const byte) SZ#0 SZ = (byte/signed byte/word/signed word/dword/signed dword) $f
(byte[SZ#0]) items
(const byte[SZ#0]) items#0 items = { fill( SZ#0, 0) }
(void()) main()
(label) main::@1
(label) main::@return
(byte*) main::cur_item
(byte) main::sub
(byte) main::sub#1 reg byte x 16.5
(byte) main::sub#2 reg byte x 22.0
reg byte x [ main::sub#2 main::sub#1 ]
program

@ -12,20 +12,20 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte*) main::cur_item#4 ← phi( main/(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items#0 main::@3/(byte*) main::cur_item#1 )
[5] (byte) main::item#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::item#1 )
[5] (byte) main::item#4 ← phi( main/(byte) 0 main::@3/(byte) main::item#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[6] (byte) main::sub#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::sub#1 )
[7] (byte~) main::$2 ← (byte) main::item#4 << (byte/signed byte/word/signed word/dword/signed dword) 4
[6] (byte) main::sub#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::sub#1 )
[7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4
[8] (byte~) main::$3 ← (byte~) main::$2 | (byte) main::sub#2
[9] *((byte*) main::cur_item#4 + (byte) main::sub#2) ← (byte~) main::$3
[10] (byte) main::sub#1 ← ++ (byte) main::sub#2
[11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@2
[11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0
[13] (byte) main::item#1 ← ++ (byte) main::item#4
[14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
[14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
[15] return

@ -1,31 +1,32 @@
Identified constant variable (byte) ITEM_COUNT
Identified constant variable (byte) ITEM_SIZE
Culled Empty Block (label) main::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte) ITEM_COUNT#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) ITEM_SIZE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5
(byte) ITEM_COUNT#0 ← (number) 3
(byte) ITEM_SIZE#0 ← (number) 5
(byte~) $0 ← (byte) ITEM_COUNT#0 * (byte) ITEM_SIZE#0
(byte[$0]) items#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(byte[$0]) items#0 ← { (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0, (number) 0 }
to:@1
main: scope:[main] from @1
(byte*) main::cur_item#0 ← (byte[$0]) items#0
(byte/signed word/word/dword/signed dword~) main::$0 ← (byte) ITEM_COUNT#0 - (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::item#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(number~) main::$0 ← (byte) ITEM_COUNT#0 - (number) 1
(byte) main::item#0 ← (number) 0
to:main::@1
main::@1: scope:[main] from main main::@3
(byte*) main::cur_item#4 ← phi( main/(byte*) main::cur_item#0 main::@3/(byte*) main::cur_item#1 )
(byte) main::item#4 ← phi( main/(byte) main::item#0 main::@3/(byte) main::item#1 )
(byte/signed word/word/dword/signed dword~) main::$1 ← (byte) ITEM_SIZE#0 - (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::sub#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(number~) main::$1 ← (byte) ITEM_SIZE#0 - (number) 1
(byte) main::sub#0 ← (number) 0
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
(byte*) main::cur_item#2 ← phi( main::@1/(byte*) main::cur_item#4 main::@2/(byte*) main::cur_item#2 )
(byte) main::sub#2 ← phi( main::@1/(byte) main::sub#0 main::@2/(byte) main::sub#1 )
(byte) main::item#2 ← phi( main::@1/(byte) main::item#4 main::@2/(byte) main::item#2 )
(byte/signed word/word/dword/signed dword~) main::$2 ← (byte) main::item#2 * (byte/signed byte/word/signed word/dword/signed dword) $10
(byte/word/dword~) main::$3 ← (byte/signed word/word/dword/signed dword~) main::$2 | (byte) main::sub#2
*((byte*) main::cur_item#2 + (byte) main::sub#2) ← (byte/word/dword~) main::$3
(number~) main::$2 ← (byte) main::item#2 * (number) $10
(number~) main::$3 ← (number~) main::$2 | (byte) main::sub#2
*((byte*) main::cur_item#2 + (byte) main::sub#2) ← (number~) main::$3
(byte) main::sub#1 ← (byte) main::sub#2 + rangenext(0,main::$1)
(bool~) main::$4 ← (byte) main::sub#1 != rangelast(0,main::$1)
if((bool~) main::$4) goto main::@2
@ -61,10 +62,10 @@ SYMBOL TABLE SSA
(byte[$0]) items
(byte[$0]) items#0
(void()) main()
(byte/signed word/word/dword/signed dword~) main::$0
(byte/signed word/word/dword/signed dword~) main::$1
(byte/signed word/word/dword/signed dword~) main::$2
(byte/word/dword~) main::$3
(number~) main::$0
(number~) main::$1
(number~) main::$2
(number~) main::$3
(bool~) main::$4
(bool~) main::$5
(label) main::@1
@ -88,63 +89,135 @@ SYMBOL TABLE SSA
(byte) main::sub#1
(byte) main::sub#2
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) 3 in (byte) ITEM_COUNT#0 ← (number) 3
Adding number conversion cast (unumber) 5 in (byte) ITEM_SIZE#0 ← (number) 5
Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) ITEM_COUNT#0 - (number) 1
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) ITEM_COUNT#0 - (unumber)(number) 1
Adding number conversion cast (unumber) 0 in (byte) main::item#0 ← (number) 0
Adding number conversion cast (unumber) 1 in (number~) main::$1 ← (byte) ITEM_SIZE#0 - (number) 1
Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) ITEM_SIZE#0 - (unumber)(number) 1
Adding number conversion cast (unumber) 0 in (byte) main::sub#0 ← (number) 0
Adding number conversion cast (unumber) $10 in (number~) main::$2 ← (byte) main::item#2 * (number) $10
Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte) main::item#2 * (unumber)(number) $10
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (unumber~) main::$2 | (byte) main::sub#2
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (byte) to elements in (byte[$0]) items#0 ← { (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0, (byte)(number) 0 }
Successful SSA optimization PassNAddArrayNumberTypeConversions
Inlining cast (byte) ITEM_COUNT#0 ← (unumber)(number) 3
Inlining cast (byte) ITEM_SIZE#0 ← (unumber)(number) 5
Inlining cast (byte) main::item#0 ← (unumber)(number) 0
Inlining cast (byte) main::sub#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast 3
Simplifying constant integer cast 5
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast $10
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $10
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) ITEM_COUNT#0 - (byte) 1
Inferred type updated to byte in (unumber~) main::$1 ← (byte) ITEM_SIZE#0 - (byte) 1
Inferred type updated to byte in (unumber~) main::$2 ← (byte) main::item#2 * (byte) $10
Inferred type updated to byte in (unumber~) main::$3 ← (byte~) main::$2 | (byte) main::sub#2
Alias (byte*) main::cur_item#2 = (byte*) main::cur_item#3
Alias (byte) main::item#2 = (byte) main::item#3
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) main::item#2
Self Phi Eliminated (byte*) main::cur_item#2
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte) main::item#2 (byte) main::item#4
Redundant Phi (byte*) main::cur_item#2 (byte*) main::cur_item#4
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte) main::item#2 (byte) main::item#4
Identical Phi Values (byte*) main::cur_item#2 (byte*) main::cur_item#4
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$4 [16] if((byte) main::sub#1!=rangelast(0,main::$1)) goto main::@2
Simple Condition (bool~) main::$5 [21] if((byte) main::item#1!=rangelast(0,main::$0)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [3] (byte[$0]) items#0 ← { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 }
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) ITEM_COUNT#0 = 3
Constant (const byte) ITEM_SIZE#0 = 5
Constant (const byte[$0]) items#0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
Constant (const byte) main::item#0 = 0
Constant (const byte) main::sub#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) $0 = ITEM_COUNT#0*ITEM_SIZE#0
Constant (const byte*) main::cur_item#0 = items#0
Constant (const byte/signed word/word/dword/signed dword) main::$0 = ITEM_COUNT#0-1
Constant (const byte/signed word/word/dword/signed dword) main::$1 = ITEM_SIZE#0-1
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value main::sub#1 ← ++ main::sub#2 to ++
Resolved ranged comparison value if(main::sub#1!=rangelast(0,main::$1)) goto main::@2 to (const byte/signed word/word/dword/signed dword) main::$1+(byte/signed byte/word/signed word/dword/signed dword) 1
Resolved ranged next value main::item#1 ← ++ main::item#4 to ++
Resolved ranged comparison value if(main::item#1!=rangelast(0,main::$0)) goto main::@1 to (const byte/signed word/word/dword/signed dword) main::$0+(byte/signed byte/word/signed word/dword/signed dword) 1
Rewriting multiplication to use shift (byte/signed word/word/dword/signed dword~) main::$2 ← (byte) main::item#4 * (byte/signed byte/word/signed word/dword/signed dword) $10
Constant right-side identified [0] (byte~) $0 ← (const byte) ITEM_COUNT#0 * (const byte) ITEM_SIZE#0
Constant right-side identified [1] (byte~) main::$0 ← (const byte) ITEM_COUNT#0 - (byte) 1
Constant right-side identified [3] (byte~) main::$1 ← (const byte) ITEM_SIZE#0 - (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) $0 = ITEM_COUNT#0*ITEM_SIZE#0
Constant (const byte) main::$0 = ITEM_COUNT#0-1
Constant (const byte) main::$1 = ITEM_SIZE#0-1
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [8] main::sub#1 ← ++ main::sub#2 to ++
Resolved ranged comparison value [9] if(main::sub#1!=rangelast(0,main::$1)) goto main::@2 to (const byte) main::$1+(number) 1
Resolved ranged next value [11] main::item#1 ← ++ main::item#4 to ++
Resolved ranged comparison value [12] if(main::item#1!=rangelast(0,main::$0)) goto main::@1 to (const byte) main::$0+(number) 1
Adding number conversion cast (unumber) main::$1+1 in if((byte) main::sub#1!=(const byte) main::$1+(number) 1) goto main::@2
Adding number conversion cast (unumber) 1 in if((byte) main::sub#1!=(unumber)(const byte) main::$1+(number) 1) goto main::@2
Adding number conversion cast (unumber) main::$0+1 in if((byte) main::item#1!=(const byte) main::$0+(number) 1) goto main::@1
Adding number conversion cast (unumber) 1 in if((byte) main::item#1!=(unumber)(const byte) main::$0+(number) 1) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte) main::$1+(unumber)(number) 1
Simplifying constant integer cast 1
Simplifying constant integer cast (const byte) main::$0+(unumber)(number) 1
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Rewriting multiplication to use shift [2] (byte~) main::$2 ← (byte) main::item#4 * (byte) $10
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inferred type updated to byte in [2] (byte/signed word/word/dword/signed dword~) main::$2 ← (byte) main::item#4 << (byte/signed byte/word/signed word/dword/signed dword) 4
Inferred type updated to byte in [3] (byte/word/dword~) main::$3 ← (byte~) main::$2 | (byte) main::sub#2
Inlining constant with var siblings (const byte) main::item#0
Inlining constant with var siblings (const byte) main::sub#0
Inlining constant with var siblings (const byte*) main::cur_item#0
Constant inlined main::sub#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::$1 = (const byte) ITEM_SIZE#0-(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::sub#0 = (byte) 0
Constant inlined main::$1 = (const byte) ITEM_SIZE#0-(byte) 1
Constant inlined $0 = (const byte) ITEM_COUNT#0*(const byte) ITEM_SIZE#0
Constant inlined main::cur_item#0 = (const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items#0
Constant inlined main::$0 = (const byte) ITEM_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::item#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::$0 = (const byte) ITEM_COUNT#0-(byte) 1
Constant inlined main::item#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@5(between main::@3 and main::@1)
Added new block during phi lifting main::@6(between main::@2 and main::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Created 3 initial phi equivalence classes
Coalesced [16] main::item#5 ← main::item#1
Coalesced [17] main::cur_item#5 ← main::cur_item#1
Coalesced [18] main::sub#3 ← main::sub#1
Coalesced [17] main::item#5 ← main::item#1
Coalesced [18] main::cur_item#5 ← main::cur_item#1
Coalesced [19] main::sub#3 ← main::sub#1
Coalesced down to 3 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Adding NOP phi() at start of @begin
@ -167,20 +240,20 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte*) main::cur_item#4 ← phi( main/(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items#0 main::@3/(byte*) main::cur_item#1 )
[5] (byte) main::item#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::item#1 )
[5] (byte) main::item#4 ← phi( main/(byte) 0 main::@3/(byte) main::item#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[6] (byte) main::sub#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::sub#1 )
[7] (byte~) main::$2 ← (byte) main::item#4 << (byte/signed byte/word/signed word/dword/signed dword) 4
[6] (byte) main::sub#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::sub#1 )
[7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4
[8] (byte~) main::$3 ← (byte~) main::$2 | (byte) main::sub#2
[9] *((byte*) main::cur_item#4 + (byte) main::sub#2) ← (byte~) main::$3
[10] (byte) main::sub#1 ← ++ (byte) main::sub#2
[11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@2
[11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0
[13] (byte) main::item#1 ← ++ (byte) main::item#4
[14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
[14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
[15] return
@ -263,7 +336,7 @@ main: {
sta cur_item
lda #>items
sta cur_item+1
//SEG13 [5] phi (byte) main::item#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
//SEG13 [5] phi (byte) main::item#4 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
lda #0
sta item
jmp b1
@ -276,7 +349,7 @@ main: {
b1:
//SEG18 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
//SEG19 [6] phi (byte) main::sub#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1
//SEG19 [6] phi (byte) main::sub#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1
lda #0
sta sub
jmp b2
@ -286,7 +359,7 @@ main: {
jmp b2
//SEG22 main::@2
b2:
//SEG23 [7] (byte~) main::$2 ← (byte) main::item#4 << (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuz1=vbuz2_rol_4
//SEG23 [7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4 -- vbuz1=vbuz2_rol_4
lda item
asl
asl
@ -303,7 +376,7 @@ main: {
sta (cur_item),y
//SEG26 [10] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuz1=_inc_vbuz1
inc sub
//SEG27 [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@2 -- vbuz1_neq_vbuc1_then_la1
//SEG27 [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2 -- vbuz1_neq_vbuc1_then_la1
lda #ITEM_SIZE-1+1
cmp sub
bne b2_from_b2
@ -320,7 +393,7 @@ main: {
!:
//SEG30 [13] (byte) main::item#1 ← ++ (byte) main::item#4 -- vbuz1=_inc_vbuz1
inc item
//SEG31 [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG31 [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #ITEM_COUNT-1+1
cmp item
bne b1_from_b3
@ -333,11 +406,11 @@ main: {
items: .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] (byte~) main::$2 ← (byte) main::item#4 << (byte/signed byte/word/signed word/dword/signed dword) 4 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ( main:2 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ( main:2 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::item#4 main::item#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::sub#2 main::sub#1 ]
Statement [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 [ main::item#4 main::cur_item#1 ] ( main:2 [ main::item#4 main::cur_item#1 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$2 ← (byte) main::item#4 << (byte/signed byte/word/signed word/dword/signed dword) 4 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ( main:2 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ( main:2 [ main::item#4 main::cur_item#4 main::sub#2 main::$2 ] ) always clobbers reg byte a
Statement [12] (byte*) main::cur_item#1 ← (byte*) main::cur_item#4 + (const byte) ITEM_SIZE#0 [ main::item#4 main::cur_item#1 ] ( main:2 [ main::item#4 main::cur_item#1 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::item#4 main::item#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:3 [ main::cur_item#4 main::cur_item#1 ] : zp ZP_WORD:3 ,
@ -391,7 +464,7 @@ main: {
sta cur_item
lda #>items
sta cur_item+1
//SEG13 [5] phi (byte) main::item#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
//SEG13 [5] phi (byte) main::item#4 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #0
jmp b1
//SEG14 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
@ -403,7 +476,7 @@ main: {
b1:
//SEG18 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
//SEG19 [6] phi (byte) main::sub#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuyy=vbuc1
//SEG19 [6] phi (byte) main::sub#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuyy=vbuc1
ldy #0
jmp b2
//SEG20 [6] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
@ -412,7 +485,7 @@ main: {
jmp b2
//SEG22 main::@2
b2:
//SEG23 [7] (byte~) main::$2 ← (byte) main::item#4 << (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_rol_4
//SEG23 [7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4 -- vbuaa=vbuxx_rol_4
txa
asl
asl
@ -425,7 +498,7 @@ main: {
sta (cur_item),y
//SEG26 [10] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuyy=_inc_vbuyy
iny
//SEG27 [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@2 -- vbuyy_neq_vbuc1_then_la1
//SEG27 [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2 -- vbuyy_neq_vbuc1_then_la1
cpy #ITEM_SIZE-1+1
bne b2_from_b2
jmp b3
@ -441,7 +514,7 @@ main: {
!:
//SEG30 [13] (byte) main::item#1 ← ++ (byte) main::item#4 -- vbuxx=_inc_vbuxx
inx
//SEG31 [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG31 [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #ITEM_COUNT-1+1
bne b1_from_b3
jmp breturn
@ -489,11 +562,11 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte) ITEM_COUNT
(const byte) ITEM_COUNT#0 ITEM_COUNT = (byte/signed byte/word/signed word/dword/signed dword) 3
(const byte) ITEM_COUNT#0 ITEM_COUNT = (byte) 3
(byte) ITEM_SIZE
(const byte) ITEM_SIZE#0 ITEM_SIZE = (byte/signed byte/word/signed word/dword/signed dword) 5
(const byte) ITEM_SIZE#0 ITEM_SIZE = (byte) 5
(byte[ITEM_COUNT#0*ITEM_SIZE#0]) items
(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items#0 items = { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items#0 items = { (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 }
(void()) main()
(byte~) main::$2 reg byte a 202.0
(byte~) main::$3 reg byte a 202.0
@ -547,7 +620,7 @@ main: {
sta cur_item
lda #>items
sta cur_item+1
//SEG13 [5] phi (byte) main::item#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
//SEG13 [5] phi (byte) main::item#4 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #0
//SEG14 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
//SEG15 [5] phi (byte*) main::cur_item#4 = (byte*) main::cur_item#1 [phi:main::@3->main::@1#0] -- register_copy
@ -555,13 +628,13 @@ main: {
//SEG17 main::@1
b1:
//SEG18 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG19 [6] phi (byte) main::sub#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuyy=vbuc1
//SEG19 [6] phi (byte) main::sub#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuyy=vbuc1
ldy #0
//SEG20 [6] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
//SEG21 [6] phi (byte) main::sub#2 = (byte) main::sub#1 [phi:main::@2->main::@2#0] -- register_copy
//SEG22 main::@2
b2:
//SEG23 [7] (byte~) main::$2 ← (byte) main::item#4 << (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_rol_4
//SEG23 [7] (byte~) main::$2 ← (byte) main::item#4 << (byte) 4 -- vbuaa=vbuxx_rol_4
txa
asl
asl
@ -574,7 +647,7 @@ main: {
sta (cur_item),y
//SEG26 [10] (byte) main::sub#1 ← ++ (byte) main::sub#2 -- vbuyy=_inc_vbuyy
iny
//SEG27 [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@2 -- vbuyy_neq_vbuc1_then_la1
//SEG27 [11] if((byte) main::sub#1!=(const byte) ITEM_SIZE#0-(byte) 1+(byte) 1) goto main::@2 -- vbuyy_neq_vbuc1_then_la1
cpy #ITEM_SIZE-1+1
bne b2
//SEG28 main::@3
@ -588,7 +661,7 @@ main: {
!:
//SEG30 [13] (byte) main::item#1 ← ++ (byte) main::item#4 -- vbuxx=_inc_vbuxx
inx
//SEG31 [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG31 [14] if((byte) main::item#1!=(const byte) ITEM_COUNT#0-(byte) 1+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #ITEM_COUNT-1+1
bne b1
//SEG32 main::@return

@ -1,31 +1 @@
(label) @1
(label) @begin
(label) @end
(byte) ITEM_COUNT
(const byte) ITEM_COUNT#0 ITEM_COUNT = (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) ITEM_SIZE
(const byte) ITEM_SIZE#0 ITEM_SIZE = (byte/signed byte/word/signed word/dword/signed dword) 5
(byte[ITEM_COUNT#0*ITEM_SIZE#0]) items
(const byte[ITEM_COUNT#0*ITEM_SIZE#0]) items#0 items = { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(void()) main()
(byte~) main::$2 reg byte a 202.0
(byte~) main::$3 reg byte a 202.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte*) main::cur_item
(byte*) main::cur_item#1 cur_item zp ZP_WORD:2 7.333333333333333
(byte*) main::cur_item#4 cur_item zp ZP_WORD:2 17.571428571428573
(byte) main::item
(byte) main::item#1 reg byte x 16.5
(byte) main::item#4 reg byte x 15.375
(byte) main::sub
(byte) main::sub#1 reg byte y 151.5
(byte) main::sub#2 reg byte y 101.0
reg byte x [ main::item#4 main::item#1 ]
zp ZP_WORD:2 [ main::cur_item#4 main::cur_item#1 ]
reg byte y [ main::sub#2 main::sub#1 ]
reg byte a [ main::$2 ]
reg byte a [ main::$3 ]
program

@ -10,8 +10,8 @@
main: scope:[main] from @1
[4] *((const byte[3]) b#0) ← (byte) 'c'
[5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0)
[6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1)
[7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2)
[6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c#0+(byte) 1)
[7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d#0+(byte) 2)
to:main::@return
main::@return: scope:[main] from main
[8] return

@ -1,3 +1,4 @@
Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400
Identified constant variable (byte*) SCREEN
CONTROL FLOW GRAPH SSA
@ -5,15 +6,15 @@ CONTROL FLOW GRAPH SSA
(byte[3]) b#0 ← { fill( 3, 0) }
(byte[]) c#0 ← { (byte) 'c', (byte) 'm', (byte) 'l' }
(byte[]) d#0 ← (const string) $0
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte*) SCREEN#0 ← ((byte*)) (number) $400
to:@1
main: scope:[main] from @1
*((byte[3]) b#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c'
*((byte*) SCREEN#0) ← *((byte[3]) b#0 + (byte/signed byte/word/signed word/dword/signed dword) 0)
(byte*~) main::$0 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1
*((byte*~) main::$0) ← *((byte[]) c#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)
(byte*~) main::$1 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2
*((byte*~) main::$1) ← *((byte[]) d#0 + (byte/signed byte/word/signed word/dword/signed dword) 2)
*((byte[3]) b#0 + (number) 0) ← (byte) 'c'
*((byte*) SCREEN#0) ← *((byte[3]) b#0 + (number) 0)
(byte*~) main::$0 ← (byte*) SCREEN#0 + (number) 1
*((byte*~) main::$0) ← *((byte[]) c#0 + (number) 1)
(byte*~) main::$1 ← (byte*) SCREEN#0 + (number) 2
*((byte*~) main::$1) ← *((byte[]) d#0 + (number) 2)
to:main::@return
main::@return: scope:[main] from main
return
@ -44,35 +45,64 @@ SYMBOL TABLE SSA
(byte*~) main::$1
(label) main::@return
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) 0 in *((byte[3]) b#0 + (number) 0) ← (byte) 'c'
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0) ← *((byte[3]) b#0 + (number) 0)
Adding number conversion cast (unumber) 1 in (byte*~) main::$0 ← (byte*) SCREEN#0 + (number) 1
Adding number conversion cast (unumber) 1 in *((byte*~) main::$0) ← *((byte[]) c#0 + (number) 1)
Adding number conversion cast (unumber) 2 in (byte*~) main::$1 ← (byte*) SCREEN#0 + (number) 2
Adding number conversion cast (unumber) 2 in *((byte*~) main::$1) ← *((byte[]) d#0 + (number) 2)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [0] (byte[3]) b#0 ← { fill( 3, 0) }
Constant right-side identified [1] (byte[]) c#0 ← { (byte) 'c', (byte) 'm', (byte) 'l' }
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte[3]) b#0 = { fill( 3, 0) }
Constant (const byte[]) c#0 = { 'c', 'm', 'l' }
Constant (const byte[]) d#0 = $0
Constant (const byte*) SCREEN#0 = ((byte*))$400
Constant (const byte*) SCREEN#0 = (byte*) 1024
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) main::$0 = SCREEN#0+1
Constant (const byte*) main::$1 = SCREEN#0+2
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(b#0+0)
Consolidated array index constant in *(b#0+0)
Consolidated array index constant in *(c#0+1)
Consolidated array index constant in *(d#0+2)
Successful SSA optimization Pass2ConstantAdditionElimination
Constant inlined main::$1 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2
Converting *(pointer+n) to pointer[n] [7] *((byte*~) main::$0) ← *((const byte[]) c#0 + (byte) 1) -- *(SCREEN#0 + 1)
Converting *(pointer+n) to pointer[n] [9] *((byte*~) main::$1) ← *((const byte[]) d#0 + (byte) 2) -- *(SCREEN#0 + 2)
Successful SSA optimization Pass2InlineDerefIdx
Simplifying expression containing zero b#0 in [4] *((const byte[3]) b#0 + (byte) 0) ← (byte) 'c'
Simplifying expression containing zero b#0 in [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0 + (byte) 0)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte*~) main::$0 and assignment [2] (byte*~) main::$0 ← (const byte*) SCREEN#0 + (byte) 1
Eliminating unused variable (byte*~) main::$1 and assignment [4] (byte*~) main::$1 ← (const byte*) SCREEN#0 + (byte) 2
Successful SSA optimization PassNEliminateUnusedVars
Constant inlined $0 = (const byte[]) d#0
Constant inlined main::$0 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1
Successful SSA optimization Pass2ConstantInlining
Simplifying constant plus zero b#0+0
Simplifying constant plus zero b#0+0
Consolidated array index constant in *(c#0+1)
Consolidated array index constant in *(SCREEN#0+1)
Consolidated array index constant in *(d#0+2)
Consolidated array index constant in *(SCREEN#0+2)
Successful SSA optimization Pass2ConstantAdditionElimination
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
@ -90,8 +120,8 @@ FINAL CONTROL FLOW GRAPH
main: scope:[main] from @1
[4] *((const byte[3]) b#0) ← (byte) 'c'
[5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0)
[6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1)
[7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2)
[6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c#0+(byte) 1)
[7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d#0+(byte) 2)
to:main::@return
main::@return: scope:[main] from main
[8] return
@ -138,10 +168,10 @@ main: {
//SEG11 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) -- _deref_pbuc1=_deref_pbuc2
lda b
sta SCREEN
//SEG12 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) -- _deref_pbuc1=_deref_pbuc2
//SEG12 [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c#0+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
lda c+1
sta SCREEN+1
//SEG13 [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2) -- _deref_pbuc1=_deref_pbuc2
//SEG13 [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d#0+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
lda d+2
sta SCREEN+2
jmp breturn
@ -157,8 +187,8 @@ main: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte[3]) b#0) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c#0+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d#0+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
@ -197,10 +227,10 @@ main: {
//SEG11 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) -- _deref_pbuc1=_deref_pbuc2
lda b
sta SCREEN
//SEG12 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) -- _deref_pbuc1=_deref_pbuc2
//SEG12 [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c#0+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
lda c+1
sta SCREEN+1
//SEG13 [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2) -- _deref_pbuc1=_deref_pbuc2
//SEG13 [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d#0+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
lda d+2
sta SCREEN+2
jmp breturn
@ -238,7 +268,7 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(byte[3]) b
(const byte[3]) b#0 b = { fill( 3, 0) }
(byte[]) c
@ -273,10 +303,10 @@ main: {
sta b
//SEG11 [5] *((const byte*) SCREEN#0) ← *((const byte[3]) b#0) -- _deref_pbuc1=_deref_pbuc2
sta SCREEN
//SEG12 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← *((const byte[]) c#0+(byte/signed byte/word/signed word/dword/signed dword) 1) -- _deref_pbuc1=_deref_pbuc2
//SEG12 [6] *((const byte*) SCREEN#0+(byte) 1) ← *((const byte[]) c#0+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
lda c+1
sta SCREEN+1
//SEG13 [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte[]) d#0+(byte/signed byte/word/signed word/dword/signed dword) 2) -- _deref_pbuc1=_deref_pbuc2
//SEG13 [7] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte[]) d#0+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
lda d+2
sta SCREEN+2
//SEG14 main::@return

@ -1,14 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte[3]) b
(const byte[3]) b#0 b = { fill( 3, 0) }
(byte[]) c
(const byte[]) c#0 c = { (byte) 'c', (byte) 'm', (byte) 'l' }
(byte[]) d
(const byte[]) d#0 d = (string) "cml"
(void()) main()
(label) main::@return
program

@ -9,12 +9,12 @@
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::screen#0) ← (byte) 'c'
[5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28) ← (byte) 'c'
[6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm'
[7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1)
[8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $29) ← (byte) main::a#2
[9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l'
[10] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $2a) ← (byte) 'l'
[5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c'
[6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm'
[7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1)
[8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2
[9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l'
[10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l'
to:main::@return
main::@return: scope:[main] from main
[11] return

@ -1,21 +1,22 @@
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Identified constant variable (byte*) main::screen
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @1
(byte*) main::screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte) main::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte) main::a#0 ← (byte) 0
(byte) main::a#1 ← (byte) 'c'
*((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::a#1
*((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $28) ← (byte) main::a#1
*((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm'
(byte) main::a#2 ← *((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)
*((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $29) ← (byte) main::a#2
*((byte*) main::screen#0 + (number) 0) ← (byte) main::a#1
*((byte*) main::screen#0 + (number) $28) ← (byte) main::a#1
*((byte*) main::screen#0 + (number) 1) ← (byte) 'm'
(byte) main::a#2 ← *((byte*) main::screen#0 + (number) 1)
*((byte*) main::screen#0 + (number) $29) ← (byte) main::a#2
(byte) main::a#3 ← (byte) 'l'
(byte/signed word/word/dword/signed dword~) main::$0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) main::a#3
*((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed word/word/dword/signed dword~) main::$0
*((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $2a) ← (byte) main::a#3
(number~) main::$0 ← (number) 1 + (byte) main::a#3
*((byte*) main::screen#0 + (number) 2) ← (number~) main::$0
*((byte*) main::screen#0 + (number) $2a) ← (byte) main::a#3
to:main::@return
main::@return: scope:[main] from main
return
@ -33,7 +34,7 @@ SYMBOL TABLE SSA
(label) @begin
(label) @end
(void()) main()
(byte/signed word/word/dword/signed dword~) main::$0
(number~) main::$0
(label) main::@return
(byte) main::a
(byte) main::a#0
@ -43,16 +44,54 @@ SYMBOL TABLE SSA
(byte*) main::screen
(byte*) main::screen#0
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Constant (const byte*) main::screen#0 = ((byte*))$400
Adding number conversion cast (unumber) 0 in *((byte*) main::screen#0 + (number) 0) ← (byte) main::a#1
Adding number conversion cast (unumber) $28 in *((byte*) main::screen#0 + (number) $28) ← (byte) main::a#1
Adding number conversion cast (unumber) 1 in *((byte*) main::screen#0 + (number) 1) ← (byte) 'm'
Adding number conversion cast (unumber) $29 in *((byte*) main::screen#0 + (number) $29) ← (byte) main::a#2
Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (number) 1 + (byte) main::a#3
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 1 + (byte) main::a#3
Adding number conversion cast (unumber) 2 in *((byte*) main::screen#0 + (number) 2) ← (unumber~) main::$0
Adding number conversion cast (unumber) $2a in *((byte*) main::screen#0 + (number) $2a) ← (byte) main::a#3
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Simplifying constant integer cast 1
Simplifying constant integer cast $29
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast $2a
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $29
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $2a
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) 1 + (byte) main::a#3
Constant (const byte*) main::screen#0 = (byte*) 1024
Constant (const byte) main::a#0 = 0
Constant (const byte) main::a#1 = 'c'
Constant (const byte) main::a#3 = 'l'
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte/signed word/word/dword/signed dword) main::$0 = 1+main::a#3
Simplifying expression containing zero main::screen#0 in [3] *((const byte*) main::screen#0 + (byte) 0) ← (const byte) main::a#1
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::a#0
Successful SSA optimization PassNEliminateUnusedVars
Constant right-side identified [5] (byte~) main::$0 ← (byte) 1 + (const byte) main::a#3
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = 1+main::a#3
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(main::screen#0+0)
Inlining constant with var siblings (const byte) main::a#1
Inlining constant with var siblings (const byte) main::a#3
Constant inlined main::a#3 = (byte) 'l'
Constant inlined main::$0 = (byte) 1+(byte) 'l'
Constant inlined main::a#1 = (byte) 'c'
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::screen#0+$28)
Consolidated array index constant in *(main::screen#0+1)
Consolidated array index constant in *(main::screen#0+1)
@ -60,23 +99,16 @@ Consolidated array index constant in *(main::screen#0+$29)
Consolidated array index constant in *(main::screen#0+2)
Consolidated array index constant in *(main::screen#0+$2a)
Successful SSA optimization Pass2ConstantAdditionElimination
Eliminating unused constant (const byte) main::a#0
Successful SSA optimization PassNEliminateUnusedVars
Inlining constant with var siblings (const byte) main::a#1
Inlining constant with var siblings (const byte) main::a#3
Constant inlined main::a#3 = (byte) 'l'
Constant inlined main::$0 = (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l'
Constant inlined main::a#1 = (byte) 'c'
Successful SSA optimization Pass2ConstantInlining
Simplifying constant plus zero main::screen#0+0
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
@ -93,12 +125,12 @@ FINAL CONTROL FLOW GRAPH
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::screen#0) ← (byte) 'c'
[5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28) ← (byte) 'c'
[6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm'
[7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1)
[8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $29) ← (byte) main::a#2
[9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l'
[10] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $2a) ← (byte) 'l'
[5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c'
[6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm'
[7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1)
[8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2
[9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l'
[10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l'
to:main::@return
main::@return: scope:[main] from main
[11] return
@ -146,22 +178,22 @@ main: {
//SEG10 [4] *((const byte*) main::screen#0) ← (byte) 'c' -- _deref_pbuc1=vbuc2
lda #'c'
sta screen
//SEG11 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2
lda #'c'
sta screen+$28
//SEG12 [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2
//SEG12 [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2
lda #'m'
sta screen+1
//SEG13 [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) -- vbuz1=_deref_pbuc1
//SEG13 [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1) -- vbuz1=_deref_pbuc1
lda screen+1
sta a
//SEG14 [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1
//SEG14 [8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuz1
lda a
sta screen+$29
//SEG15 [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l' -- _deref_pbuc1=vbuc2
//SEG15 [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2
lda #1+'l'
sta screen+2
//SEG16 [10] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2
//SEG16 [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2
// Chained assignment with a modification of the result
lda #'l'
sta screen+$2a
@ -174,10 +206,10 @@ main: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) main::screen#0) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [10] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $2a) ← (byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::a#2 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
@ -215,20 +247,20 @@ main: {
//SEG10 [4] *((const byte*) main::screen#0) ← (byte) 'c' -- _deref_pbuc1=vbuc2
lda #'c'
sta screen
//SEG11 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2
lda #'c'
sta screen+$28
//SEG12 [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2
//SEG12 [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2
lda #'m'
sta screen+1
//SEG13 [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) -- vbuaa=_deref_pbuc1
//SEG13 [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1) -- vbuaa=_deref_pbuc1
lda screen+1
//SEG14 [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuaa
//SEG14 [8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuaa
sta screen+$29
//SEG15 [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l' -- _deref_pbuc1=vbuc2
//SEG15 [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2
lda #1+'l'
sta screen+2
//SEG16 [10] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2
//SEG16 [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2
// Chained assignment with a modification of the result
lda #'l'
sta screen+$2a
@ -269,7 +301,7 @@ FINAL SYMBOL TABLE
(byte) main::a
(byte) main::a#2 reg byte a 4.0
(byte*) main::screen
(const byte*) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) main::screen#0 screen = (byte*) 1024
reg byte a [ main::a#2 ]
@ -296,18 +328,18 @@ main: {
//SEG10 [4] *((const byte*) main::screen#0) ← (byte) 'c' -- _deref_pbuc1=vbuc2
lda #'c'
sta screen
//SEG11 [5] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) main::screen#0+(byte) $28) ← (byte) 'c' -- _deref_pbuc1=vbuc2
sta screen+$28
//SEG12 [6] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2
//SEG12 [6] *((const byte*) main::screen#0+(byte) 1) ← (byte) 'm' -- _deref_pbuc1=vbuc2
lda #'m'
sta screen+1
//SEG13 [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) -- vbuaa=_deref_pbuc1
//SEG14 [8] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuaa
//SEG13 [7] (byte) main::a#2 ← *((const byte*) main::screen#0+(byte) 1) -- vbuaa=_deref_pbuc1
//SEG14 [8] *((const byte*) main::screen#0+(byte) $29) ← (byte) main::a#2 -- _deref_pbuc1=vbuaa
sta screen+$29
//SEG15 [9] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte/signed byte/word/signed word/dword/signed dword) 1+(byte) 'l' -- _deref_pbuc1=vbuc2
//SEG15 [9] *((const byte*) main::screen#0+(byte) 2) ← (byte) 1+(byte) 'l' -- _deref_pbuc1=vbuc2
lda #1+'l'
sta screen+2
//SEG16 [10] *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2
//SEG16 [10] *((const byte*) main::screen#0+(byte) $2a) ← (byte) 'l' -- _deref_pbuc1=vbuc2
// Chained assignment with a modification of the result
lda #'l'
sta screen+$2a

@ -1,11 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@return
(byte) main::a
(byte) main::a#2 reg byte a 4.0
(byte*) main::screen
(const byte*) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
reg byte a [ main::a#2 ]
program

@ -55,8 +55,8 @@ main::@return: scope:[main] from main::@10
[26] return
to:@return
test: scope:[test] from main main::@1 main::@10 main::@2 main::@3 main::@4 main::@5 main::@6 main::@7 main::@8 main::@9
[27] (byte) test::i#11 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@10/(byte/signed byte/word/signed word/dword/signed dword) $a main::@2/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@3/(byte/signed byte/word/signed word/dword/signed dword) 3 main::@4/(byte/signed byte/word/signed word/dword/signed dword) 4 main::@5/(byte/signed byte/word/signed word/dword/signed dword) 5 main::@6/(byte/signed byte/word/signed word/dword/signed dword) 6 main::@7/(byte/signed byte/word/signed word/dword/signed dword) 7 main::@8/(byte/signed byte/word/signed word/dword/signed dword) 8 main::@9/(byte/signed byte/word/signed word/dword/signed dword) 9 )
[27] (byte) test::a#11 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 3 main::@1/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1 main::@10/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1&(byte/signed byte/word/signed word/dword/signed dword) 1 main::@2/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1 main::@3/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6 main::@4/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@5/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2 main::@6/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2 main::@7/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1 main::@8/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6 main::@9/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1 )
[27] (byte) test::i#11 ← phi( main/(byte) 0 main::@1/(byte) 1 main::@10/(byte) $a main::@2/(byte) 2 main::@3/(byte) 3 main::@4/(byte) 4 main::@5/(byte) 5 main::@6/(byte) 6 main::@7/(byte) 7 main::@8/(byte) 8 main::@9/(byte) 9 )
[27] (byte) test::a#11 ← phi( main/(byte) 3 main::@1/(byte) 3+(byte) 1 main::@10/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1 main::@2/(byte) 3+(byte) 1-(byte) 1 main::@3/(byte) 3+(byte) 1-(byte) 1*(byte) 6 main::@4/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2 main::@5/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2 main::@6/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2 main::@7/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1 main::@8/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6 main::@9/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1 )
[28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11
[29] *((const byte*) screen2#0 + (byte) test::i#11) ← *((const byte[]) ref#0 + (byte) test::i#11)
[30] if(*((const byte[]) ref#0 + (byte) test::i#11)==(byte) test::a#11) goto test::@1

@ -1,22 +1,27 @@
Adding pointer type conversion cast (byte*) screen1 in (byte*) screen1 ← (number) $400
Adding pointer type conversion cast (byte*) cols in (byte*) cols ← (number) $d800
Identified constant variable (byte*) screen1
Identified constant variable (byte*) cols
Identified constant variable (byte) GREEN
Identified constant variable (byte) RED
Culled Empty Block (label) @1
Culled Empty Block (label) test::@2
Culled Empty Block (label) test::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte[]) ref#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) $12, (byte/signed byte/word/signed word/dword/signed dword) 9, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(byte*) screen1#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte*~) $0 ← (byte*) screen1#0 + (byte/signed byte/word/signed word/dword/signed dword) $28
(byte[]) ref#0 ← { (number) 3, (number) 4, (number) 3, (number) $12, (number) 9, (number) 1, (number) 4, (number) 2, (number) 4, (number) 5, (number) 1, (number) 0 }
(byte*) screen1#0 ← ((byte*)) (number) $400
(byte*~) $0 ← (byte*) screen1#0 + (number) $28
(byte*) screen2#0 ← (byte*~) $0
(byte*) cols#0 ← ((byte*)) (word/dword/signed dword) $d800
(byte) GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5
(byte) RED#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte*) cols#0 ← ((byte*)) (number) $d800
(byte) GREEN#0 ← (number) 5
(byte) RED#0 ← (number) 2
to:@2
main: scope:[main] from @2
(byte*) screen2#2 ← phi( @2/(byte*) screen2#13 )
(byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) main::i#0 ← (number) 0
(byte) main::a#0 ← (number) 3
(byte) test::i#0 ← (byte) main::i#0
(byte) test::a#0 ← (byte) main::a#0
call test
@ -26,7 +31,7 @@ main::@1: scope:[main] from main
(byte) main::a#11 ← phi( main/(byte) main::a#0 )
(byte) main::i#12 ← phi( main/(byte) main::i#0 )
(byte) main::i#1 ← ++ (byte) main::i#12
(byte) main::a#1 ← (byte) main::a#11 + (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::a#1 ← (byte) main::a#11 + (number) 1
(byte) test::i#1 ← (byte) main::i#1
(byte) test::a#1 ← (byte) main::a#1
call test
@ -36,7 +41,7 @@ main::@2: scope:[main] from main::@1
(byte) main::a#12 ← phi( main::@1/(byte) main::a#1 )
(byte) main::i#13 ← phi( main::@1/(byte) main::i#1 )
(byte) main::i#2 ← ++ (byte) main::i#13
(byte) main::a#2 ← (byte) main::a#12 - (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::a#2 ← (byte) main::a#12 - (number) 1
(byte) test::i#2 ← (byte) main::i#2
(byte) test::a#2 ← (byte) main::a#2
call test
@ -46,7 +51,7 @@ main::@3: scope:[main] from main::@2
(byte) main::a#13 ← phi( main::@2/(byte) main::a#2 )
(byte) main::i#14 ← phi( main::@2/(byte) main::i#2 )
(byte) main::i#3 ← ++ (byte) main::i#14
(byte) main::a#3 ← (byte) main::a#13 * (byte/signed byte/word/signed word/dword/signed dword) 6
(byte) main::a#3 ← (byte) main::a#13 * (number) 6
(byte) test::i#3 ← (byte) main::i#3
(byte) test::a#3 ← (byte) main::a#3
call test
@ -56,7 +61,7 @@ main::@4: scope:[main] from main::@3
(byte) main::a#14 ← phi( main::@3/(byte) main::a#3 )
(byte) main::i#15 ← phi( main::@3/(byte) main::i#3 )
(byte) main::i#4 ← ++ (byte) main::i#15
(byte) main::a#4 ← (byte) main::a#14 / (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) main::a#4 ← (byte) main::a#14 / (number) 2
(byte) test::i#4 ← (byte) main::i#4
(byte) test::a#4 ← (byte) main::a#4
call test
@ -66,7 +71,7 @@ main::@5: scope:[main] from main::@4
(byte) main::a#15 ← phi( main::@4/(byte) main::a#4 )
(byte) main::i#16 ← phi( main::@4/(byte) main::i#4 )
(byte) main::i#5 ← ++ (byte) main::i#16
(byte) main::a#5 ← (byte) main::a#15 % (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) main::a#5 ← (byte) main::a#15 % (number) 2
(byte) test::i#5 ← (byte) main::i#5
(byte) test::a#5 ← (byte) main::a#5
call test
@ -76,7 +81,7 @@ main::@6: scope:[main] from main::@5
(byte) main::a#16 ← phi( main::@5/(byte) main::a#5 )
(byte) main::i#17 ← phi( main::@5/(byte) main::i#5 )
(byte) main::i#6 ← ++ (byte) main::i#17
(byte) main::a#6 ← (byte) main::a#16 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) main::a#6 ← (byte) main::a#16 << (number) 2
(byte) test::i#6 ← (byte) main::i#6
(byte) test::a#6 ← (byte) main::a#6
call test
@ -86,7 +91,7 @@ main::@7: scope:[main] from main::@6
(byte) main::a#17 ← phi( main::@6/(byte) main::a#6 )
(byte) main::i#18 ← phi( main::@6/(byte) main::i#6 )
(byte) main::i#7 ← ++ (byte) main::i#18
(byte) main::a#7 ← (byte) main::a#17 >> (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::a#7 ← (byte) main::a#17 >> (number) 1
(byte) test::i#7 ← (byte) main::i#7
(byte) test::a#7 ← (byte) main::a#7
call test
@ -96,7 +101,7 @@ main::@8: scope:[main] from main::@7
(byte) main::a#18 ← phi( main::@7/(byte) main::a#7 )
(byte) main::i#19 ← phi( main::@7/(byte) main::i#7 )
(byte) main::i#8 ← ++ (byte) main::i#19
(byte) main::a#8 ← (byte) main::a#18 ^ (byte/signed byte/word/signed word/dword/signed dword) 6
(byte) main::a#8 ← (byte) main::a#18 ^ (number) 6
(byte) test::i#8 ← (byte) main::i#8
(byte) test::a#8 ← (byte) main::a#8
call test
@ -106,7 +111,7 @@ main::@9: scope:[main] from main::@8
(byte) main::a#19 ← phi( main::@8/(byte) main::a#8 )
(byte) main::i#20 ← phi( main::@8/(byte) main::i#8 )
(byte) main::i#9 ← ++ (byte) main::i#20
(byte) main::a#9 ← (byte) main::a#19 | (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::a#9 ← (byte) main::a#19 | (number) 1
(byte) test::i#9 ← (byte) main::i#9
(byte) test::a#9 ← (byte) main::a#9
call test
@ -116,7 +121,7 @@ main::@10: scope:[main] from main::@9
(byte) main::a#20 ← phi( main::@9/(byte) main::a#9 )
(byte) main::i#21 ← phi( main::@9/(byte) main::i#9 )
(byte) main::i#10 ← ++ (byte) main::i#21
(byte) main::a#10 ← (byte) main::a#20 & (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::a#10 ← (byte) main::a#20 & (number) 1
(byte) test::i#10 ← (byte) main::i#10
(byte) test::a#10 ← (byte) main::a#10
call test
@ -280,8 +285,77 @@ SYMBOL TABLE SSA
(byte) test::i#8
(byte) test::i#9
Culled Empty Block (label) @3
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) $28 in (byte*~) $0 ← (byte*) screen1#0 + (number) $28
Adding number conversion cast (unumber) 5 in (byte) GREEN#0 ← (number) 5
Adding number conversion cast (unumber) 2 in (byte) RED#0 ← (number) 2
Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0
Adding number conversion cast (unumber) 3 in (byte) main::a#0 ← (number) 3
Adding number conversion cast (unumber) 1 in (byte) main::a#1 ← (byte) main::a#11 + (number) 1
Adding number conversion cast (unumber) 1 in (byte) main::a#2 ← (byte) main::a#12 - (number) 1
Adding number conversion cast (unumber) 6 in (byte) main::a#3 ← (byte) main::a#13 * (number) 6
Adding number conversion cast (unumber) 2 in (byte) main::a#4 ← (byte) main::a#14 / (number) 2
Adding number conversion cast (unumber) 2 in (byte) main::a#5 ← (byte) main::a#15 % (number) 2
Adding number conversion cast (unumber) 2 in (byte) main::a#6 ← (byte) main::a#16 << (number) 2
Adding number conversion cast (unumber) 1 in (byte) main::a#7 ← (byte) main::a#17 >> (number) 1
Adding number conversion cast (unumber) 6 in (byte) main::a#8 ← (byte) main::a#18 ^ (number) 6
Adding number conversion cast (unumber) 1 in (byte) main::a#9 ← (byte) main::a#19 | (number) 1
Adding number conversion cast (unumber) 1 in (byte) main::a#10 ← (byte) main::a#20 & (number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (byte) to elements in (byte[]) ref#0 ← { (byte)(number) 3, (byte)(number) 4, (byte)(number) 3, (byte)(number) $12, (byte)(number) 9, (byte)(number) 1, (byte)(number) 4, (byte)(number) 2, (byte)(number) 4, (byte)(number) 5, (byte)(number) 1, (byte)(number) 0 }
Successful SSA optimization PassNAddArrayNumberTypeConversions
Inlining cast (byte*) screen1#0 ← (byte*)(number) $400
Inlining cast (byte*) cols#0 ← (byte*)(number) $d800
Inlining cast (byte) GREEN#0 ← (unumber)(number) 5
Inlining cast (byte) RED#0 ← (unumber)(number) 2
Inlining cast (byte) main::i#0 ← (unumber)(number) 0
Inlining cast (byte) main::a#0 ← (unumber)(number) 3
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast 3
Simplifying constant integer cast 4
Simplifying constant integer cast 3
Simplifying constant integer cast $12
Simplifying constant integer cast 9
Simplifying constant integer cast 1
Simplifying constant integer cast 4
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast 5
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $28
Simplifying constant pointer cast (byte*) 55296
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Simplifying constant integer cast 0
Simplifying constant integer cast 3
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 6
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 1
Simplifying constant integer cast 6
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 6
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 6
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) screen2#0 = (byte*~) $0 (byte*) screen2#13
Alias (byte) main::i#0 = (byte) main::i#12
Alias (byte) main::a#0 = (byte) main::a#11
@ -307,78 +381,118 @@ Alias (byte) main::a#20 = (byte) main::a#9
Alias (byte) main::i#10 = (byte) main::i#22
Alias (byte) test::i#11 = (byte) test::i#12 (byte) test::i#13
Successful SSA optimization Pass2AliasElimination
Redundant Phi (byte*) screen2#10 (byte*) screen2#0
Redundant Phi (byte*) screen2#1 (byte*) screen2#10
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte*) screen2#10 (byte*) screen2#0
Identical Phi Values (byte*) screen2#1 (byte*) screen2#10
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) test::$0 [80] if(*((byte[]) ref#0 + (byte) test::i#11)==(byte) test::a#11) goto test::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [0] (byte[]) ref#0 ← { (byte) 3, (byte) 4, (byte) 3, (byte) $12, (byte) 9, (byte) 1, (byte) 4, (byte) 2, (byte) 4, (byte) 5, (byte) 1, (byte) 0 }
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte[]) ref#0 = { 3, 4, 3, $12, 9, 1, 4, 2, 4, 5, 1, 0 }
Constant (const byte*) screen1#0 = ((byte*))$400
Constant (const byte*) cols#0 = ((byte*))$d800
Constant (const byte*) screen1#0 = (byte*) 1024
Constant (const byte*) cols#0 = (byte*) 55296
Constant (const byte) GREEN#0 = 5
Constant (const byte) RED#0 = 2
Constant (const byte) main::i#0 = 0
Constant (const byte) main::a#0 = 3
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) screen2#0 = screen1#0+$28
Constant (const byte) test::i#0 = main::i#0
Constant (const byte) test::a#0 = main::a#0
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused variable (byte) main::i#11 and assignment [52] (byte) main::i#11 ← ++ (byte) main::i#10
Successful SSA optimization PassNEliminateUnusedVars
Constant right-side identified [0] (byte*) screen2#0 ← (const byte*) screen1#0 + (byte) $28
Constant right-side identified [2] (byte) main::i#1 ← ++ (const byte) main::i#0
Constant right-side identified [3] (byte) main::a#1 ← (const byte) main::a#0 + (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) screen2#0 = screen1#0+$28
Constant (const byte) main::i#1 = ++main::i#0
Constant (const byte) main::a#1 = main::a#0+1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#1 = main::i#1
Constant (const byte) test::a#1 = main::a#1
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [2] (byte) main::i#14 ← ++ (const byte) main::i#1
Constant right-side identified [3] (byte) main::a#13 ← (const byte) main::a#1 - (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#14 = ++main::i#1
Constant (const byte) main::a#13 = main::a#1-1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#2 = main::i#14
Constant (const byte) test::a#2 = main::a#13
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [3] (byte) main::i#15 ← ++ (const byte) main::i#14
Constant right-side identified [4] (byte) main::a#14 ← (const byte) main::a#13 * (byte) 6
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#15 = ++main::i#14
Constant (const byte) main::a#14 = main::a#13*6
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#3 = main::i#15
Constant (const byte) test::a#3 = main::a#14
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [4] (byte) main::i#16 ← ++ (const byte) main::i#15
Constant right-side identified [5] (byte) main::a#15 ← (const byte) main::a#14 / (byte) 2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#16 = ++main::i#15
Constant (const byte) main::a#15 = main::a#14/2
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#4 = main::i#16
Constant (const byte) test::a#4 = main::a#15
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [5] (byte) main::i#17 ← ++ (const byte) main::i#16
Constant right-side identified [6] (byte) main::a#16 ← (const byte) main::a#15 % (byte) 2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#17 = ++main::i#16
Constant (const byte) main::a#16 = main::a#15%2
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#5 = main::i#17
Constant (const byte) test::a#5 = main::a#16
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [6] (byte) main::i#18 ← ++ (const byte) main::i#17
Constant right-side identified [7] (byte) main::a#17 ← (const byte) main::a#16 << (byte) 2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#18 = ++main::i#17
Constant (const byte) main::a#17 = main::a#16<<2
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#6 = main::i#18
Constant (const byte) test::a#6 = main::a#17
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [7] (byte) main::i#19 ← ++ (const byte) main::i#18
Constant right-side identified [8] (byte) main::a#18 ← (const byte) main::a#17 >> (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#19 = ++main::i#18
Constant (const byte) main::a#18 = main::a#17>>1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#7 = main::i#19
Constant (const byte) test::a#7 = main::a#18
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [8] (byte) main::i#20 ← ++ (const byte) main::i#19
Constant right-side identified [9] (byte) main::a#19 ← (const byte) main::a#18 ^ (byte) 6
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#20 = ++main::i#19
Constant (const byte) main::a#19 = main::a#18^6
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#8 = main::i#20
Constant (const byte) test::a#8 = main::a#19
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [9] (byte) main::i#21 ← ++ (const byte) main::i#20
Constant right-side identified [10] (byte) main::a#20 ← (const byte) main::a#19 | (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#21 = ++main::i#20
Constant (const byte) main::a#20 = main::a#19|1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#9 = main::i#21
Constant (const byte) test::a#9 = main::a#20
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [10] (byte) main::i#10 ← ++ (const byte) main::i#21
Constant right-side identified [11] (byte) main::a#10 ← (const byte) main::a#20 & (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#10 = ++main::i#21
Constant (const byte) main::a#10 = main::a#20&1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) test::i#10 = main::i#10
Constant (const byte) test::a#10 = main::a#10
Constant (const byte) main::i#11 = ++main::i#10
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const byte) main::i#11
Successful SSA optimization PassNEliminateUnusedVars
Culled Empty Block (label) main::@11
Successful SSA optimization Pass2CullEmptyBlocks
Inlining constant with different constant siblings (const byte) main::i#0
Inlining constant with different constant siblings (const byte) main::a#0
Inlining constant with different constant siblings (const byte) main::i#1
@ -423,50 +537,50 @@ Inlining constant with var siblings (const byte) test::i#9
Inlining constant with var siblings (const byte) test::a#9
Inlining constant with var siblings (const byte) test::i#10
Inlining constant with var siblings (const byte) test::a#10
Constant inlined test::i#1 = ++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::a#8 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6
Constant inlined test::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::a#9 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined test::i#3 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::i#2 = ++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::a#4 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::i#21 = ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::a#5 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined test::a#6 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined test::a#7 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::i#20 = ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::i#9 = ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::i#8 = ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::a#20 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined test::a#10 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1&(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined test::i#5 = ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::i#4 = ++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::i#7 = ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::i#6 = ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::i#10 = ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::a#0 = (byte/signed byte/word/signed word/dword/signed dword) 3
Constant inlined main::a#19 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6
Constant inlined main::a#18 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::a#17 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::a#1 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::a#16 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::i#1 = ++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::i#14 = ++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::i#15 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::i#10 = ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::a#10 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1&(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::a#15 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::i#18 = ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::a#14 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6
Constant inlined main::i#19 = ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::a#13 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::i#16 = ++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::i#17 = ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined test::a#0 = (byte/signed byte/word/signed word/dword/signed dword) 3
Constant inlined test::a#1 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined test::a#2 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined test::a#3 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6
Constant inlined test::i#1 = ++(byte) 0
Constant inlined test::a#8 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6
Constant inlined test::i#0 = (byte) 0
Constant inlined test::a#9 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1
Constant inlined test::i#3 = ++++++(byte) 0
Constant inlined test::i#2 = ++++(byte) 0
Constant inlined test::a#4 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2
Constant inlined main::i#21 = ++++++++++++++++++(byte) 0
Constant inlined test::a#5 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2
Constant inlined test::a#6 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2
Constant inlined test::a#7 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1
Constant inlined main::i#20 = ++++++++++++++++(byte) 0
Constant inlined test::i#9 = ++++++++++++++++++(byte) 0
Constant inlined test::i#8 = ++++++++++++++++(byte) 0
Constant inlined main::a#20 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1
Constant inlined test::a#10 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1
Constant inlined test::i#5 = ++++++++++(byte) 0
Constant inlined test::i#4 = ++++++++(byte) 0
Constant inlined test::i#7 = ++++++++++++++(byte) 0
Constant inlined test::i#6 = ++++++++++++(byte) 0
Constant inlined test::i#10 = ++++++++++++++++++++(byte) 0
Constant inlined main::a#0 = (byte) 3
Constant inlined main::a#19 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6
Constant inlined main::a#18 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1
Constant inlined main::a#17 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2
Constant inlined main::a#1 = (byte) 3+(byte) 1
Constant inlined main::a#16 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2
Constant inlined main::i#0 = (byte) 0
Constant inlined main::i#1 = ++(byte) 0
Constant inlined main::i#14 = ++++(byte) 0
Constant inlined main::i#15 = ++++++(byte) 0
Constant inlined main::i#10 = ++++++++++++++++++++(byte) 0
Constant inlined main::a#10 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1
Constant inlined main::a#15 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2
Constant inlined main::i#18 = ++++++++++++(byte) 0
Constant inlined main::a#14 = (byte) 3+(byte) 1-(byte) 1*(byte) 6
Constant inlined main::i#19 = ++++++++++++++(byte) 0
Constant inlined main::a#13 = (byte) 3+(byte) 1-(byte) 1
Constant inlined main::i#16 = ++++++++(byte) 0
Constant inlined main::i#17 = ++++++++++(byte) 0
Constant inlined test::a#0 = (byte) 3
Constant inlined test::a#1 = (byte) 3+(byte) 1
Constant inlined test::a#2 = (byte) 3+(byte) 1-(byte) 1
Constant inlined test::a#3 = (byte) 3+(byte) 1-(byte) 1*(byte) 6
Successful SSA optimization Pass2ConstantInlining
Simplifying constant integer increment ++0
Simplifying constant integer increment ++0
@ -492,6 +606,7 @@ Simplifying constant integer increment ++9
Successful SSA optimization Pass2ConstantSimplification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
@ -504,12 +619,15 @@ Adding NOP phi() at start of main::@7
Adding NOP phi() at start of main::@8
Adding NOP phi() at start of main::@9
Adding NOP phi() at start of main::@10
Adding NOP phi() at start of main::@11
CALL GRAPH
Calls in [] to main:2
Calls in [main] to test:5 test:7 test:9 test:11 test:13 test:15 test:17 test:19 test:21 test:23 test:25
Calls in [main] to test:6 test:8 test:10 test:12 test:14 test:16 test:18 test:20 test:22 test:24 test:26
Created 2 initial phi equivalence classes
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) main::@11
Renumbering block @2 to @1
Renumbering block test::@3 to test::@2
Adding NOP phi() at start of @begin
@ -585,8 +703,8 @@ main::@return: scope:[main] from main::@10
[26] return
to:@return
test: scope:[test] from main main::@1 main::@10 main::@2 main::@3 main::@4 main::@5 main::@6 main::@7 main::@8 main::@9
[27] (byte) test::i#11 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@10/(byte/signed byte/word/signed word/dword/signed dword) $a main::@2/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@3/(byte/signed byte/word/signed word/dword/signed dword) 3 main::@4/(byte/signed byte/word/signed word/dword/signed dword) 4 main::@5/(byte/signed byte/word/signed word/dword/signed dword) 5 main::@6/(byte/signed byte/word/signed word/dword/signed dword) 6 main::@7/(byte/signed byte/word/signed word/dword/signed dword) 7 main::@8/(byte/signed byte/word/signed word/dword/signed dword) 8 main::@9/(byte/signed byte/word/signed word/dword/signed dword) 9 )
[27] (byte) test::a#11 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 3 main::@1/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1 main::@10/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1&(byte/signed byte/word/signed word/dword/signed dword) 1 main::@2/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1 main::@3/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6 main::@4/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@5/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2 main::@6/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2 main::@7/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1 main::@8/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6 main::@9/(byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1 )
[27] (byte) test::i#11 ← phi( main/(byte) 0 main::@1/(byte) 1 main::@10/(byte) $a main::@2/(byte) 2 main::@3/(byte) 3 main::@4/(byte) 4 main::@5/(byte) 5 main::@6/(byte) 6 main::@7/(byte) 7 main::@8/(byte) 8 main::@9/(byte) 9 )
[27] (byte) test::a#11 ← phi( main/(byte) 3 main::@1/(byte) 3+(byte) 1 main::@10/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1 main::@2/(byte) 3+(byte) 1-(byte) 1 main::@3/(byte) 3+(byte) 1-(byte) 1*(byte) 6 main::@4/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2 main::@5/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2 main::@6/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2 main::@7/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1 main::@8/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6 main::@9/(byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1 )
[28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11
[29] *((const byte*) screen2#0 + (byte) test::i#11) ← *((const byte[]) ref#0 + (byte) test::i#11)
[30] if(*((const byte[]) ref#0 + (byte) test::i#11)==(byte) test::a#11) goto test::@1
@ -661,10 +779,10 @@ main: {
//SEG11 [5] call test
//SEG12 [27] phi from main to test [phi:main->test]
test_from_main:
//SEG13 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->test#0] -- vbuz1=vbuc1
//SEG13 [27] phi (byte) test::i#11 = (byte) 0 [phi:main->test#0] -- vbuz1=vbuc1
lda #0
sta test.i
//SEG14 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main->test#1] -- vbuz1=vbuc1
//SEG14 [27] phi (byte) test::a#11 = (byte) 3 [phi:main->test#1] -- vbuz1=vbuc1
lda #3
sta test.a
jsr test
@ -676,10 +794,10 @@ main: {
//SEG17 [7] call test
//SEG18 [27] phi from main::@1 to test [phi:main::@1->test]
test_from_b1:
//SEG19 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@1->test#0] -- vbuz1=vbuc1
//SEG19 [27] phi (byte) test::i#11 = (byte) 1 [phi:main::@1->test#0] -- vbuz1=vbuc1
lda #1
sta test.i
//SEG20 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@1->test#1] -- vbuz1=vbuc1
//SEG20 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1 [phi:main::@1->test#1] -- vbuz1=vbuc1
lda #3+1
sta test.a
jsr test
@ -691,10 +809,10 @@ main: {
//SEG23 [9] call test
//SEG24 [27] phi from main::@2 to test [phi:main::@2->test]
test_from_b2:
//SEG25 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@2->test#0] -- vbuz1=vbuc1
//SEG25 [27] phi (byte) test::i#11 = (byte) 2 [phi:main::@2->test#0] -- vbuz1=vbuc1
lda #2
sta test.i
//SEG26 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@2->test#1] -- vbuz1=vbuc1
//SEG26 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1 [phi:main::@2->test#1] -- vbuz1=vbuc1
lda #3+1-1
sta test.a
jsr test
@ -706,10 +824,10 @@ main: {
//SEG29 [11] call test
//SEG30 [27] phi from main::@3 to test [phi:main::@3->test]
test_from_b3:
//SEG31 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main::@3->test#0] -- vbuz1=vbuc1
//SEG31 [27] phi (byte) test::i#11 = (byte) 3 [phi:main::@3->test#0] -- vbuz1=vbuc1
lda #3
sta test.i
//SEG32 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@3->test#1] -- vbuz1=vbuc1
//SEG32 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6 [phi:main::@3->test#1] -- vbuz1=vbuc1
lda #(3+1-1)*6
sta test.a
jsr test
@ -721,10 +839,10 @@ main: {
//SEG35 [13] call test
//SEG36 [27] phi from main::@4 to test [phi:main::@4->test]
test_from_b4:
//SEG37 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main::@4->test#0] -- vbuz1=vbuc1
//SEG37 [27] phi (byte) test::i#11 = (byte) 4 [phi:main::@4->test#0] -- vbuz1=vbuc1
lda #4
sta test.i
//SEG38 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@4->test#1] -- vbuz1=vbuc1
//SEG38 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2 [phi:main::@4->test#1] -- vbuz1=vbuc1
lda #(3+1-1)*6/2
sta test.a
jsr test
@ -736,10 +854,10 @@ main: {
//SEG41 [15] call test
//SEG42 [27] phi from main::@5 to test [phi:main::@5->test]
test_from_b5:
//SEG43 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 5 [phi:main::@5->test#0] -- vbuz1=vbuc1
//SEG43 [27] phi (byte) test::i#11 = (byte) 5 [phi:main::@5->test#0] -- vbuz1=vbuc1
lda #5
sta test.i
//SEG44 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@5->test#1] -- vbuz1=vbuc1
//SEG44 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2 [phi:main::@5->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)
sta test.a
jsr test
@ -751,10 +869,10 @@ main: {
//SEG47 [17] call test
//SEG48 [27] phi from main::@6 to test [phi:main::@6->test]
test_from_b6:
//SEG49 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@6->test#0] -- vbuz1=vbuc1
//SEG49 [27] phi (byte) test::i#11 = (byte) 6 [phi:main::@6->test#0] -- vbuz1=vbuc1
lda #6
sta test.i
//SEG50 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@6->test#1] -- vbuz1=vbuc1
//SEG50 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2 [phi:main::@6->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2
sta test.a
jsr test
@ -766,10 +884,10 @@ main: {
//SEG53 [19] call test
//SEG54 [27] phi from main::@7 to test [phi:main::@7->test]
test_from_b7:
//SEG55 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main::@7->test#0] -- vbuz1=vbuc1
//SEG55 [27] phi (byte) test::i#11 = (byte) 7 [phi:main::@7->test#0] -- vbuz1=vbuc1
lda #7
sta test.i
//SEG56 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->test#1] -- vbuz1=vbuc1
//SEG56 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1 [phi:main::@7->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1
sta test.a
jsr test
@ -781,10 +899,10 @@ main: {
//SEG59 [21] call test
//SEG60 [27] phi from main::@8 to test [phi:main::@8->test]
test_from_b8:
//SEG61 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 8 [phi:main::@8->test#0] -- vbuz1=vbuc1
//SEG61 [27] phi (byte) test::i#11 = (byte) 8 [phi:main::@8->test#0] -- vbuz1=vbuc1
lda #8
sta test.i
//SEG62 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@8->test#1] -- vbuz1=vbuc1
//SEG62 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6 [phi:main::@8->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1^6
sta test.a
jsr test
@ -796,10 +914,10 @@ main: {
//SEG65 [23] call test
//SEG66 [27] phi from main::@9 to test [phi:main::@9->test]
test_from_b9:
//SEG67 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 9 [phi:main::@9->test#0] -- vbuz1=vbuc1
//SEG67 [27] phi (byte) test::i#11 = (byte) 9 [phi:main::@9->test#0] -- vbuz1=vbuc1
lda #9
sta test.i
//SEG68 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@9->test#1] -- vbuz1=vbuc1
//SEG68 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1 [phi:main::@9->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1^6|1
sta test.a
jsr test
@ -811,10 +929,10 @@ main: {
//SEG71 [25] call test
//SEG72 [27] phi from main::@10 to test [phi:main::@10->test]
test_from_b10:
//SEG73 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) $a [phi:main::@10->test#0] -- vbuz1=vbuc1
//SEG73 [27] phi (byte) test::i#11 = (byte) $a [phi:main::@10->test#0] -- vbuz1=vbuc1
lda #$a
sta test.i
//SEG74 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1&(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@10->test#1] -- vbuz1=vbuc1
//SEG74 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1 [phi:main::@10->test#1] -- vbuz1=vbuc1
lda #(mod((3+1-1)*6/2,2)<<2>>1^6|1)&1
sta test.a
jsr test
@ -924,9 +1042,9 @@ main: {
//SEG11 [5] call test
//SEG12 [27] phi from main to test [phi:main->test]
test_from_main:
//SEG13 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->test#0] -- vbuxx=vbuc1
//SEG13 [27] phi (byte) test::i#11 = (byte) 0 [phi:main->test#0] -- vbuxx=vbuc1
ldx #0
//SEG14 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main->test#1] -- vbuz1=vbuc1
//SEG14 [27] phi (byte) test::a#11 = (byte) 3 [phi:main->test#1] -- vbuz1=vbuc1
lda #3
sta test.a
jsr test
@ -938,9 +1056,9 @@ main: {
//SEG17 [7] call test
//SEG18 [27] phi from main::@1 to test [phi:main::@1->test]
test_from_b1:
//SEG19 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@1->test#0] -- vbuxx=vbuc1
//SEG19 [27] phi (byte) test::i#11 = (byte) 1 [phi:main::@1->test#0] -- vbuxx=vbuc1
ldx #1
//SEG20 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@1->test#1] -- vbuz1=vbuc1
//SEG20 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1 [phi:main::@1->test#1] -- vbuz1=vbuc1
lda #3+1
sta test.a
jsr test
@ -952,9 +1070,9 @@ main: {
//SEG23 [9] call test
//SEG24 [27] phi from main::@2 to test [phi:main::@2->test]
test_from_b2:
//SEG25 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@2->test#0] -- vbuxx=vbuc1
//SEG25 [27] phi (byte) test::i#11 = (byte) 2 [phi:main::@2->test#0] -- vbuxx=vbuc1
ldx #2
//SEG26 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@2->test#1] -- vbuz1=vbuc1
//SEG26 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1 [phi:main::@2->test#1] -- vbuz1=vbuc1
lda #3+1-1
sta test.a
jsr test
@ -966,9 +1084,9 @@ main: {
//SEG29 [11] call test
//SEG30 [27] phi from main::@3 to test [phi:main::@3->test]
test_from_b3:
//SEG31 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main::@3->test#0] -- vbuxx=vbuc1
//SEG31 [27] phi (byte) test::i#11 = (byte) 3 [phi:main::@3->test#0] -- vbuxx=vbuc1
ldx #3
//SEG32 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@3->test#1] -- vbuz1=vbuc1
//SEG32 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6 [phi:main::@3->test#1] -- vbuz1=vbuc1
lda #(3+1-1)*6
sta test.a
jsr test
@ -980,9 +1098,9 @@ main: {
//SEG35 [13] call test
//SEG36 [27] phi from main::@4 to test [phi:main::@4->test]
test_from_b4:
//SEG37 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main::@4->test#0] -- vbuxx=vbuc1
//SEG37 [27] phi (byte) test::i#11 = (byte) 4 [phi:main::@4->test#0] -- vbuxx=vbuc1
ldx #4
//SEG38 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@4->test#1] -- vbuz1=vbuc1
//SEG38 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2 [phi:main::@4->test#1] -- vbuz1=vbuc1
lda #(3+1-1)*6/2
sta test.a
jsr test
@ -994,9 +1112,9 @@ main: {
//SEG41 [15] call test
//SEG42 [27] phi from main::@5 to test [phi:main::@5->test]
test_from_b5:
//SEG43 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 5 [phi:main::@5->test#0] -- vbuxx=vbuc1
//SEG43 [27] phi (byte) test::i#11 = (byte) 5 [phi:main::@5->test#0] -- vbuxx=vbuc1
ldx #5
//SEG44 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@5->test#1] -- vbuz1=vbuc1
//SEG44 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2 [phi:main::@5->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)
sta test.a
jsr test
@ -1008,9 +1126,9 @@ main: {
//SEG47 [17] call test
//SEG48 [27] phi from main::@6 to test [phi:main::@6->test]
test_from_b6:
//SEG49 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@6->test#0] -- vbuxx=vbuc1
//SEG49 [27] phi (byte) test::i#11 = (byte) 6 [phi:main::@6->test#0] -- vbuxx=vbuc1
ldx #6
//SEG50 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@6->test#1] -- vbuz1=vbuc1
//SEG50 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2 [phi:main::@6->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2
sta test.a
jsr test
@ -1022,9 +1140,9 @@ main: {
//SEG53 [19] call test
//SEG54 [27] phi from main::@7 to test [phi:main::@7->test]
test_from_b7:
//SEG55 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main::@7->test#0] -- vbuxx=vbuc1
//SEG55 [27] phi (byte) test::i#11 = (byte) 7 [phi:main::@7->test#0] -- vbuxx=vbuc1
ldx #7
//SEG56 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->test#1] -- vbuz1=vbuc1
//SEG56 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1 [phi:main::@7->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1
sta test.a
jsr test
@ -1036,9 +1154,9 @@ main: {
//SEG59 [21] call test
//SEG60 [27] phi from main::@8 to test [phi:main::@8->test]
test_from_b8:
//SEG61 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 8 [phi:main::@8->test#0] -- vbuxx=vbuc1
//SEG61 [27] phi (byte) test::i#11 = (byte) 8 [phi:main::@8->test#0] -- vbuxx=vbuc1
ldx #8
//SEG62 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@8->test#1] -- vbuz1=vbuc1
//SEG62 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6 [phi:main::@8->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1^6
sta test.a
jsr test
@ -1050,9 +1168,9 @@ main: {
//SEG65 [23] call test
//SEG66 [27] phi from main::@9 to test [phi:main::@9->test]
test_from_b9:
//SEG67 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 9 [phi:main::@9->test#0] -- vbuxx=vbuc1
//SEG67 [27] phi (byte) test::i#11 = (byte) 9 [phi:main::@9->test#0] -- vbuxx=vbuc1
ldx #9
//SEG68 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@9->test#1] -- vbuz1=vbuc1
//SEG68 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1 [phi:main::@9->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1^6|1
sta test.a
jsr test
@ -1064,9 +1182,9 @@ main: {
//SEG71 [25] call test
//SEG72 [27] phi from main::@10 to test [phi:main::@10->test]
test_from_b10:
//SEG73 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) $a [phi:main::@10->test#0] -- vbuxx=vbuc1
//SEG73 [27] phi (byte) test::i#11 = (byte) $a [phi:main::@10->test#0] -- vbuxx=vbuc1
ldx #$a
//SEG74 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1&(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@10->test#1] -- vbuz1=vbuc1
//SEG74 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1 [phi:main::@10->test#1] -- vbuz1=vbuc1
lda #(mod((3+1-1)*6/2,2)<<2>>1^6|1)&1
sta test.a
jsr test
@ -1181,11 +1299,11 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte) GREEN
(const byte) GREEN#0 GREEN = (byte/signed byte/word/signed word/dword/signed dword) 5
(const byte) GREEN#0 GREEN = (byte) 5
(byte) RED
(const byte) RED#0 RED = (byte/signed byte/word/signed word/dword/signed dword) 2
(const byte) RED#0 RED = (byte) 2
(byte*) cols
(const byte*) cols#0 cols = ((byte*))(word/dword/signed dword) $d800
(const byte*) cols#0 cols = (byte*) 55296
(void()) main()
(label) main::@1
(label) main::@10
@ -1201,11 +1319,11 @@ FINAL SYMBOL TABLE
(byte) main::a
(byte) main::i
(byte[]) ref
(const byte[]) ref#0 ref = { (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) $12, (byte/signed byte/word/signed word/dword/signed dword) 9, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(const byte[]) ref#0 ref = { (byte) 3, (byte) 4, (byte) 3, (byte) $12, (byte) 9, (byte) 1, (byte) 4, (byte) 2, (byte) 4, (byte) 5, (byte) 1, (byte) 0 }
(byte*) screen1
(const byte*) screen1#0 screen1 = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) screen1#0 screen1 = (byte*) 1024
(byte*) screen2
(const byte*) screen2#0 screen2 = (const byte*) screen1#0+(byte/signed byte/word/signed word/dword/signed dword) $28
(const byte*) screen2#0 screen2 = (const byte*) screen1#0+(byte) $28
(void()) test((byte) test::i , (byte) test::a)
(label) test::@1
(label) test::@2
@ -1245,9 +1363,9 @@ Score: 202
main: {
//SEG11 [5] call test
//SEG12 [27] phi from main to test [phi:main->test]
//SEG13 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->test#0] -- vbuxx=vbuc1
//SEG13 [27] phi (byte) test::i#11 = (byte) 0 [phi:main->test#0] -- vbuxx=vbuc1
ldx #0
//SEG14 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main->test#1] -- vbuz1=vbuc1
//SEG14 [27] phi (byte) test::a#11 = (byte) 3 [phi:main->test#1] -- vbuz1=vbuc1
lda #3
sta test.a
jsr test
@ -1255,9 +1373,9 @@ main: {
//SEG16 main::@1
//SEG17 [7] call test
//SEG18 [27] phi from main::@1 to test [phi:main::@1->test]
//SEG19 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@1->test#0] -- vbuxx=vbuc1
//SEG19 [27] phi (byte) test::i#11 = (byte) 1 [phi:main::@1->test#0] -- vbuxx=vbuc1
ldx #1
//SEG20 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@1->test#1] -- vbuz1=vbuc1
//SEG20 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1 [phi:main::@1->test#1] -- vbuz1=vbuc1
lda #3+1
sta test.a
jsr test
@ -1265,9 +1383,9 @@ main: {
//SEG22 main::@2
//SEG23 [9] call test
//SEG24 [27] phi from main::@2 to test [phi:main::@2->test]
//SEG25 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@2->test#0] -- vbuxx=vbuc1
//SEG25 [27] phi (byte) test::i#11 = (byte) 2 [phi:main::@2->test#0] -- vbuxx=vbuc1
ldx #2
//SEG26 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@2->test#1] -- vbuz1=vbuc1
//SEG26 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1 [phi:main::@2->test#1] -- vbuz1=vbuc1
lda #3+1-1
sta test.a
jsr test
@ -1275,9 +1393,9 @@ main: {
//SEG28 main::@3
//SEG29 [11] call test
//SEG30 [27] phi from main::@3 to test [phi:main::@3->test]
//SEG31 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main::@3->test#0] -- vbuxx=vbuc1
//SEG31 [27] phi (byte) test::i#11 = (byte) 3 [phi:main::@3->test#0] -- vbuxx=vbuc1
ldx #3
//SEG32 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@3->test#1] -- vbuz1=vbuc1
//SEG32 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6 [phi:main::@3->test#1] -- vbuz1=vbuc1
lda #(3+1-1)*6
sta test.a
jsr test
@ -1285,9 +1403,9 @@ main: {
//SEG34 main::@4
//SEG35 [13] call test
//SEG36 [27] phi from main::@4 to test [phi:main::@4->test]
//SEG37 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main::@4->test#0] -- vbuxx=vbuc1
//SEG37 [27] phi (byte) test::i#11 = (byte) 4 [phi:main::@4->test#0] -- vbuxx=vbuc1
ldx #4
//SEG38 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@4->test#1] -- vbuz1=vbuc1
//SEG38 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2 [phi:main::@4->test#1] -- vbuz1=vbuc1
lda #(3+1-1)*6/2
sta test.a
jsr test
@ -1295,9 +1413,9 @@ main: {
//SEG40 main::@5
//SEG41 [15] call test
//SEG42 [27] phi from main::@5 to test [phi:main::@5->test]
//SEG43 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 5 [phi:main::@5->test#0] -- vbuxx=vbuc1
//SEG43 [27] phi (byte) test::i#11 = (byte) 5 [phi:main::@5->test#0] -- vbuxx=vbuc1
ldx #5
//SEG44 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@5->test#1] -- vbuz1=vbuc1
//SEG44 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2 [phi:main::@5->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)
sta test.a
jsr test
@ -1305,9 +1423,9 @@ main: {
//SEG46 main::@6
//SEG47 [17] call test
//SEG48 [27] phi from main::@6 to test [phi:main::@6->test]
//SEG49 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@6->test#0] -- vbuxx=vbuc1
//SEG49 [27] phi (byte) test::i#11 = (byte) 6 [phi:main::@6->test#0] -- vbuxx=vbuc1
ldx #6
//SEG50 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main::@6->test#1] -- vbuz1=vbuc1
//SEG50 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2 [phi:main::@6->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2
sta test.a
jsr test
@ -1315,9 +1433,9 @@ main: {
//SEG52 main::@7
//SEG53 [19] call test
//SEG54 [27] phi from main::@7 to test [phi:main::@7->test]
//SEG55 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 7 [phi:main::@7->test#0] -- vbuxx=vbuc1
//SEG55 [27] phi (byte) test::i#11 = (byte) 7 [phi:main::@7->test#0] -- vbuxx=vbuc1
ldx #7
//SEG56 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@7->test#1] -- vbuz1=vbuc1
//SEG56 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1 [phi:main::@7->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1
sta test.a
jsr test
@ -1325,9 +1443,9 @@ main: {
//SEG58 main::@8
//SEG59 [21] call test
//SEG60 [27] phi from main::@8 to test [phi:main::@8->test]
//SEG61 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 8 [phi:main::@8->test#0] -- vbuxx=vbuc1
//SEG61 [27] phi (byte) test::i#11 = (byte) 8 [phi:main::@8->test#0] -- vbuxx=vbuc1
ldx #8
//SEG62 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6 [phi:main::@8->test#1] -- vbuz1=vbuc1
//SEG62 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6 [phi:main::@8->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1^6
sta test.a
jsr test
@ -1335,9 +1453,9 @@ main: {
//SEG64 main::@9
//SEG65 [23] call test
//SEG66 [27] phi from main::@9 to test [phi:main::@9->test]
//SEG67 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) 9 [phi:main::@9->test#0] -- vbuxx=vbuc1
//SEG67 [27] phi (byte) test::i#11 = (byte) 9 [phi:main::@9->test#0] -- vbuxx=vbuc1
ldx #9
//SEG68 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@9->test#1] -- vbuz1=vbuc1
//SEG68 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1 [phi:main::@9->test#1] -- vbuz1=vbuc1
lda #mod((3+1-1)*6/2,2)<<2>>1^6|1
sta test.a
jsr test
@ -1345,9 +1463,9 @@ main: {
//SEG70 main::@10
//SEG71 [25] call test
//SEG72 [27] phi from main::@10 to test [phi:main::@10->test]
//SEG73 [27] phi (byte) test::i#11 = (byte/signed byte/word/signed word/dword/signed dword) $a [phi:main::@10->test#0] -- vbuxx=vbuc1
//SEG73 [27] phi (byte) test::i#11 = (byte) $a [phi:main::@10->test#0] -- vbuxx=vbuc1
ldx #$a
//SEG74 [27] phi (byte) test::a#11 = (byte/signed byte/word/signed word/dword/signed dword) 3+(byte/signed byte/word/signed word/dword/signed dword) 1-(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 6/(byte/signed byte/word/signed word/dword/signed dword) 2%(byte/signed byte/word/signed word/dword/signed dword) 2<<(byte/signed byte/word/signed word/dword/signed dword) 2>>(byte/signed byte/word/signed word/dword/signed dword) 1^(byte/signed byte/word/signed word/dword/signed dword) 6|(byte/signed byte/word/signed word/dword/signed dword) 1&(byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main::@10->test#1] -- vbuz1=vbuc1
//SEG74 [27] phi (byte) test::a#11 = (byte) 3+(byte) 1-(byte) 1*(byte) 6/(byte) 2%(byte) 2<<(byte) 2>>(byte) 1^(byte) 6|(byte) 1&(byte) 1 [phi:main::@10->test#1] -- vbuz1=vbuc1
lda #(mod((3+1-1)*6/2,2)<<2>>1^6|1)&1
sta test.a
jsr test

@ -1,40 +1 @@
(label) @1
(label) @begin
(label) @end
(byte) GREEN
(const byte) GREEN#0 GREEN = (byte/signed byte/word/signed word/dword/signed dword) 5
(byte) RED
(const byte) RED#0 RED = (byte/signed byte/word/signed word/dword/signed dword) 2
(byte*) cols
(const byte*) cols#0 cols = ((byte*))(word/dword/signed dword) $d800
(void()) main()
(label) main::@1
(label) main::@10
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(label) main::@return
(byte) main::a
(byte) main::i
(byte[]) ref
(const byte[]) ref#0 ref = { (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) $12, (byte/signed byte/word/signed word/dword/signed dword) 9, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(byte*) screen1
(const byte*) screen1#0 screen1 = ((byte*))(word/signed word/dword/signed dword) $400
(byte*) screen2
(const byte*) screen2#0 screen2 = (const byte*) screen1#0+(byte/signed byte/word/signed word/dword/signed dword) $28
(void()) test((byte) test::i , (byte) test::a)
(label) test::@1
(label) test::@2
(label) test::@return
(byte) test::a
(byte) test::a#11 a zp ZP_BYTE:2 1.3333333333333333
(byte) test::i
(byte) test::i#11 reg byte x 3.0
zp ZP_BYTE:2 [ test::a#11 ]
reg byte x [ test::i#11 ]
program

@ -1,9 +1,57 @@
Adding pointer type conversion cast (byte*) PROCPORT_DDR in (byte*) PROCPORT_DDR ← (number) 0
Adding pointer type conversion cast (byte*) PROCPORT in (byte*) PROCPORT ← (number) 1
Adding pointer type conversion cast (byte*) CHARGEN in (byte*) CHARGEN ← (number) $d000
Adding pointer type conversion cast (byte*) SPRITES_XPOS in (byte*) SPRITES_XPOS ← (number) $d000
Adding pointer type conversion cast (byte*) SPRITES_YPOS in (byte*) SPRITES_YPOS ← (number) $d001
Adding pointer type conversion cast (byte*) SPRITES_XMSB in (byte*) SPRITES_XMSB ← (number) $d010
Adding pointer type conversion cast (byte*) RASTER in (byte*) RASTER ← (number) $d012
Adding pointer type conversion cast (byte*) SPRITES_ENABLE in (byte*) SPRITES_ENABLE ← (number) $d015
Adding pointer type conversion cast (byte*) SPRITES_EXPAND_Y in (byte*) SPRITES_EXPAND_Y ← (number) $d017
Adding pointer type conversion cast (byte*) SPRITES_PRIORITY in (byte*) SPRITES_PRIORITY ← (number) $d01b
Adding pointer type conversion cast (byte*) SPRITES_MC in (byte*) SPRITES_MC ← (number) $d01c
Adding pointer type conversion cast (byte*) SPRITES_EXPAND_X in (byte*) SPRITES_EXPAND_X ← (number) $d01d
Adding pointer type conversion cast (byte*) BORDERCOL in (byte*) BORDERCOL ← (number) $d020
Adding pointer type conversion cast (byte*) BGCOL in (byte*) BGCOL ← (number) $d021
Adding pointer type conversion cast (byte*) BGCOL1 in (byte*) BGCOL1 ← (number) $d021
Adding pointer type conversion cast (byte*) BGCOL2 in (byte*) BGCOL2 ← (number) $d022
Adding pointer type conversion cast (byte*) BGCOL3 in (byte*) BGCOL3 ← (number) $d023
Adding pointer type conversion cast (byte*) BGCOL4 in (byte*) BGCOL4 ← (number) $d024
Adding pointer type conversion cast (byte*) SPRITES_MC1 in (byte*) SPRITES_MC1 ← (number) $d025
Adding pointer type conversion cast (byte*) SPRITES_MC2 in (byte*) SPRITES_MC2 ← (number) $d026
Adding pointer type conversion cast (byte*) SPRITES_COLS in (byte*) SPRITES_COLS ← (number) $d027
Adding pointer type conversion cast (byte*) VIC_CONTROL in (byte*) VIC_CONTROL ← (number) $d011
Adding pointer type conversion cast (byte*) D011 in (byte*) D011 ← (number) $d011
Adding pointer type conversion cast (byte*) VIC_CONTROL2 in (byte*) VIC_CONTROL2 ← (number) $d016
Adding pointer type conversion cast (byte*) D016 in (byte*) D016 ← (number) $d016
Adding pointer type conversion cast (byte*) D018 in (byte*) D018 ← (number) $d018
Adding pointer type conversion cast (byte*) VIC_MEMORY in (byte*) VIC_MEMORY ← (number) $d018
Adding pointer type conversion cast (byte*) LIGHTPEN_X in (byte*) LIGHTPEN_X ← (number) $d013
Adding pointer type conversion cast (byte*) LIGHTPEN_Y in (byte*) LIGHTPEN_Y ← (number) $d014
Adding pointer type conversion cast (byte*) IRQ_STATUS in (byte*) IRQ_STATUS ← (number) $d019
Adding pointer type conversion cast (byte*) IRQ_ENABLE in (byte*) IRQ_ENABLE ← (number) $d01a
Adding pointer type conversion cast (byte*) COLS in (byte*) COLS ← (number) $d800
Adding pointer type conversion cast (byte*) CIA1_PORT_A in (byte*) CIA1_PORT_A ← (number) $dc00
Adding pointer type conversion cast (byte*) CIA1_PORT_B in (byte*) CIA1_PORT_B ← (number) $dc01
Adding pointer type conversion cast (byte*) CIA1_PORT_A_DDR in (byte*) CIA1_PORT_A_DDR ← (number) $dc02
Adding pointer type conversion cast (byte*) CIA1_PORT_B_DDR in (byte*) CIA1_PORT_B_DDR ← (number) $dc03
Adding pointer type conversion cast (byte*) CIA1_INTERRUPT in (byte*) CIA1_INTERRUPT ← (number) $dc0d
Adding pointer type conversion cast (byte*) CIA2_PORT_A in (byte*) CIA2_PORT_A ← (number) $dd00
Adding pointer type conversion cast (byte*) CIA2_PORT_B in (byte*) CIA2_PORT_B ← (number) $dd01
Adding pointer type conversion cast (byte*) CIA2_PORT_A_DDR in (byte*) CIA2_PORT_A_DDR ← (number) $dd02
Adding pointer type conversion cast (byte*) CIA2_PORT_B_DDR in (byte*) CIA2_PORT_B_DDR ← (number) $dd03
Adding pointer type conversion cast (byte*) CIA2_INTERRUPT in (byte*) CIA2_INTERRUPT ← (number) $dd0d
Adding pointer type conversion cast (void()**) KERNEL_IRQ in (void()**) KERNEL_IRQ ← (number) $314
Adding pointer type conversion cast (void()**) HARDWARE_IRQ in (void()**) HARDWARE_IRQ ← (number) $fffe
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) $d021
(byte) BLACK#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) BGCOL#0 ← ((byte*)) (number) $d021
(byte) BLACK#0 ← (number) 0
to:@5
main: scope:[main] from @5
*((byte*) BGCOL#0) ← (byte) BLACK#0
@ -30,19 +78,29 @@ SYMBOL TABLE SSA
(void()) main()
(label) main::@return
Culled Empty Block (label) @6
Successful SSA optimization Pass2CullEmptyBlocks
Constant (const byte*) BGCOL#0 = ((byte*))$d021
Adding number conversion cast (unumber) 0 in (byte) BLACK#0 ← (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d021
Inlining cast (byte) BLACK#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53281
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant (const byte*) BGCOL#0 = (byte*) 53281
Constant (const byte) BLACK#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @5
Adding NOP phi() at start of @6
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @6
Renumbering block @5 to @1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
@ -179,9 +237,9 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) $d021
(const byte*) BGCOL#0 BGCOL = (byte*) 53281
(byte) BLACK
(const byte) BLACK#0 BLACK = (byte/signed byte/word/signed word/dword/signed dword) 0
(const byte) BLACK#0 BLACK = (byte) 0
(void()) main()
(label) main::@return

@ -1,10 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) $d021
(byte) BLACK
(const byte) BLACK#0 BLACK = (byte/signed byte/word/signed word/dword/signed dword) 0
(void()) main()
(label) main::@return
program

@ -8,10 +8,10 @@
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[5] *((const byte*) FGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[7] *((const byte*) D018#0) ← ((byte))((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) BITMAP#0/(word/signed word/dword/signed dword) $400
[4] *((const byte*) BGCOL#0) ← (byte) 0
[5] *((const byte*) FGCOL#0) ← (byte) 0
[6] *((const byte*) D011#0) ← (const byte) BMM#0|(const byte) DEN#0|(const byte) RSEL#0|(byte) 3
[7] *((const byte*) D018#0) ← (byte)(word)(const byte*) SCREEN#0/(byte) $40|(word)(const byte*) BITMAP#0/(word) $400
[8] call init_screen
to:main::@3
main::@3: scope:[main] from main
@ -19,7 +19,7 @@ main::@3: scope:[main] from main
[10] call init_plot_tables
to:main::@1
main::@1: scope:[main] from main::@1 main::@3 main::@4
[11] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@1
[11] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[12] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0)
@ -32,7 +32,7 @@ plots: scope:[plots] from main::@2
[15] phi()
to:plots::@1
plots::@1: scope:[plots] from plots plots::@2
[16] (byte) plots::i#2 ← phi( plots/(byte/signed byte/word/signed word/dword/signed dword) 0 plots::@2/(byte) plots::i#1 )
[16] (byte) plots::i#2 ← phi( plots/(byte) 0 plots::@2/(byte) plots::i#1 )
[17] (byte) plot::x#0 ← *((const byte[]) plots_x#0 + (byte) plots::i#2)
[18] (byte) plot::y#0 ← *((const byte[]) plots_y#0 + (byte) plots::i#2)
[19] call plot
@ -46,11 +46,11 @@ plots::@return: scope:[plots] from plots::@2
to:@return
plot: scope:[plot] from plots::@1
[23] (byte~) plot::$6 ← *((const byte[$100]) plot_xhi#0 + (byte) plot::x#0)
[24] (byte*) plot::plotter_x#1 ← ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 0 hi= (byte~) plot::$6
[24] (byte*) plot::plotter_x#1 ← (byte*) 0 hi= (byte~) plot::$6
[25] (byte~) plot::$7 ← *((const byte[$100]) plot_xlo#0 + (byte) plot::x#0)
[26] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$7
[27] (byte~) plot::$8 ← *((const byte[$100]) plot_yhi#0 + (byte) plot::y#0)
[28] (word) plot::plotter_y#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 hi= (byte~) plot::$8
[28] (word) plot::plotter_y#1 ← (byte) 0 hi= (byte~) plot::$8
[29] (byte~) plot::$9 ← *((const byte[$100]) plot_ylo#0 + (byte) plot::y#0)
[30] (word) plot::plotter_y#2 ← (word) plot::plotter_y#1 lo= (byte~) plot::$9
[31] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (word) plot::plotter_y#2
@ -64,61 +64,60 @@ init_plot_tables: scope:[init_plot_tables] from main::@3
[35] phi()
to:init_plot_tables::@1
init_plot_tables::@1: scope:[init_plot_tables] from init_plot_tables init_plot_tables::@2
[36] (byte) init_plot_tables::bits#3 ← phi( init_plot_tables/(byte/word/signed word/dword/signed dword) $80 init_plot_tables::@2/(byte) init_plot_tables::bits#4 )
[36] (byte) init_plot_tables::x#2 ← phi( init_plot_tables/(byte/signed byte/word/signed word/dword/signed dword) 0 init_plot_tables::@2/(byte) init_plot_tables::x#1 )
[37] (byte~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte/word/signed word/dword/signed dword) $f8
[36] (byte) init_plot_tables::bits#3 ← phi( init_plot_tables/(byte) $80 init_plot_tables::@2/(byte) init_plot_tables::bits#4 )
[36] (byte) init_plot_tables::x#2 ← phi( init_plot_tables/(byte) 0 init_plot_tables::@2/(byte) init_plot_tables::x#1 )
[37] (byte~) init_plot_tables::$0 ← (byte) init_plot_tables::x#2 & (byte) $f8
[38] *((const byte[$100]) plot_xlo#0 + (byte) init_plot_tables::x#2) ← (byte~) init_plot_tables::$0
[39] *((const byte[$100]) plot_xhi#0 + (byte) init_plot_tables::x#2) ← >(const byte*) BITMAP#0
[40] *((const byte[$100]) plot_bit#0 + (byte) init_plot_tables::x#2) ← (byte) init_plot_tables::bits#3
[41] (byte) init_plot_tables::bits#1 ← (byte) init_plot_tables::bits#3 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[42] if((byte) init_plot_tables::bits#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto init_plot_tables::@6
[41] (byte) init_plot_tables::bits#1 ← (byte) init_plot_tables::bits#3 >> (byte) 1
[42] if((byte) init_plot_tables::bits#1!=(byte) 0) goto init_plot_tables::@6
to:init_plot_tables::@2
init_plot_tables::@6: scope:[init_plot_tables] from init_plot_tables::@1
[43] phi()
to:init_plot_tables::@2
init_plot_tables::@2: scope:[init_plot_tables] from init_plot_tables::@1 init_plot_tables::@6
[43] (byte) init_plot_tables::bits#4 ← phi( init_plot_tables::@6/(byte) init_plot_tables::bits#1 init_plot_tables::@1/(byte/word/signed word/dword/signed dword) $80 )
[44] (byte) init_plot_tables::x#1 ← ++ (byte) init_plot_tables::x#2
[45] if((byte) init_plot_tables::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto init_plot_tables::@1
[44] (byte) init_plot_tables::bits#4 ← phi( init_plot_tables::@6/(byte) init_plot_tables::bits#1 init_plot_tables::@1/(byte) $80 )
[45] (byte) init_plot_tables::x#1 ← ++ (byte) init_plot_tables::x#2
[46] if((byte) init_plot_tables::x#1!=(byte) 0) goto init_plot_tables::@1
to:init_plot_tables::@3
init_plot_tables::@3: scope:[init_plot_tables] from init_plot_tables::@2 init_plot_tables::@4
[46] (byte*) init_plot_tables::yoffs#2 ← phi( init_plot_tables::@2/((byte*))(byte/signed byte/word/signed word/dword/signed dword) 0 init_plot_tables::@4/(byte*) init_plot_tables::yoffs#4 )
[46] (byte) init_plot_tables::y#2 ← phi( init_plot_tables::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 init_plot_tables::@4/(byte) init_plot_tables::y#1 )
[47] (byte~) init_plot_tables::$6 ← (byte) init_plot_tables::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
[48] (byte~) init_plot_tables::$7 ← < (byte*) init_plot_tables::yoffs#2
[49] (byte~) init_plot_tables::$8 ← (byte~) init_plot_tables::$6 | (byte~) init_plot_tables::$7
[50] *((const byte[$100]) plot_ylo#0 + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$8
[51] (byte~) init_plot_tables::$9 ← > (byte*) init_plot_tables::yoffs#2
[52] *((const byte[$100]) plot_yhi#0 + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$9
[53] (byte~) init_plot_tables::$10 ← (byte) init_plot_tables::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
[54] if((byte~) init_plot_tables::$10!=(byte/signed byte/word/signed word/dword/signed dword) 7) goto init_plot_tables::@4
[47] (byte*) init_plot_tables::yoffs#2 ← phi( init_plot_tables::@2/(byte*) 0 init_plot_tables::@4/(byte*) init_plot_tables::yoffs#4 )
[47] (byte) init_plot_tables::y#2 ← phi( init_plot_tables::@2/(byte) 0 init_plot_tables::@4/(byte) init_plot_tables::y#1 )
[48] (byte~) init_plot_tables::$10 ← (byte) init_plot_tables::y#2 & (byte) 7
[49] (byte~) init_plot_tables::$7 ← < (byte*) init_plot_tables::yoffs#2
[50] (byte~) init_plot_tables::$8 ← (byte~) init_plot_tables::$10 | (byte~) init_plot_tables::$7
[51] *((const byte[$100]) plot_ylo#0 + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$8
[52] (byte~) init_plot_tables::$9 ← > (byte*) init_plot_tables::yoffs#2
[53] *((const byte[$100]) plot_yhi#0 + (byte) init_plot_tables::y#2) ← (byte~) init_plot_tables::$9
[54] if((byte~) init_plot_tables::$10!=(byte) 7) goto init_plot_tables::@4
to:init_plot_tables::@5
init_plot_tables::@5: scope:[init_plot_tables] from init_plot_tables::@3
[55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 8
[55] (byte*) init_plot_tables::yoffs#1 ← (byte*) init_plot_tables::yoffs#2 + (word)(number) $28*(number) 8
to:init_plot_tables::@4
init_plot_tables::@4: scope:[init_plot_tables] from init_plot_tables::@3 init_plot_tables::@5
[56] (byte*) init_plot_tables::yoffs#4 ← phi( init_plot_tables::@3/(byte*) init_plot_tables::yoffs#2 init_plot_tables::@5/(byte*) init_plot_tables::yoffs#1 )
[57] (byte) init_plot_tables::y#1 ← ++ (byte) init_plot_tables::y#2
[58] if((byte) init_plot_tables::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto init_plot_tables::@3
[58] if((byte) init_plot_tables::y#1!=(byte) 0) goto init_plot_tables::@3
to:init_plot_tables::@return
init_plot_tables::@return: scope:[init_plot_tables] from init_plot_tables::@4
[59] return
to:@return
init_plot_tables::@6: scope:[init_plot_tables] from init_plot_tables::@1
[60] phi()
to:init_plot_tables::@2
init_screen: scope:[init_screen] from main
[61] phi()
[60] phi()
to:init_screen::@1
init_screen::@1: scope:[init_screen] from init_screen init_screen::@1
[62] (byte*) init_screen::b#2 ← phi( init_screen/(const byte*) BITMAP#0 init_screen::@1/(byte*) init_screen::b#1 )
[63] *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[64] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2
[65] if((byte*) init_screen::b#1!=(const byte*) BITMAP#0+(word/signed word/dword/signed dword) $2000) goto init_screen::@1
[61] (byte*) init_screen::b#2 ← phi( init_screen/(const byte*) BITMAP#0 init_screen::@1/(byte*) init_screen::b#1 )
[62] *((byte*) init_screen::b#2) ← (byte) 0
[63] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2
[64] if((byte*) init_screen::b#1!=(const byte*) BITMAP#0+(word) $2000) goto init_screen::@1
to:init_screen::@2
init_screen::@2: scope:[init_screen] from init_screen::@1 init_screen::@2
[66] (byte*) init_screen::c#2 ← phi( init_screen::@1/(const byte*) SCREEN#0 init_screen::@2/(byte*) init_screen::c#1 )
[67] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word/dword/signed dword) $14
[68] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2
[69] if((byte*) init_screen::c#1!=(const byte*) SCREEN#0+(word/signed word/dword/signed dword) $400) goto init_screen::@2
[65] (byte*) init_screen::c#2 ← phi( init_screen::@1/(const byte*) SCREEN#0 init_screen::@2/(byte*) init_screen::c#1 )
[66] *((byte*) init_screen::c#2) ← (byte) $14
[67] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2
[68] if((byte*) init_screen::c#1!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@2
to:init_screen::@return
init_screen::@return: scope:[init_screen] from init_screen::@2
[70] return
[69] return
to:@return

File diff suppressed because it is too large Load Diff

@ -1,127 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) $d020
(byte*) BITMAP
(const byte*) BITMAP#0 BITMAP = ((byte*))(word/signed word/dword/signed dword) $2000
(byte) BMM
(const byte) BMM#0 BMM = (byte/signed byte/word/signed word/dword/signed dword) $20
(byte*) D011
(const byte*) D011#0 D011 = ((byte*))(word/dword/signed dword) $d011
(byte*) D018
(const byte*) D018#0 D018 = ((byte*))(word/dword/signed dword) $d018
(byte) DEN
(const byte) DEN#0 DEN = (byte/signed byte/word/signed word/dword/signed dword) $10
(byte*) FGCOL
(const byte*) FGCOL#0 FGCOL = ((byte*))(word/dword/signed dword) $d021
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) $d012
(byte) RSEL
(const byte) RSEL#0 RSEL = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(void()) init_plot_tables()
(byte~) init_plot_tables::$0 reg byte a 22.0
(byte~) init_plot_tables::$10 reg byte a 22.0
(byte~) init_plot_tables::$6 $6 zp ZP_BYTE:4 11.0
(byte~) init_plot_tables::$7 reg byte a 22.0
(byte~) init_plot_tables::$8 reg byte a 22.0
(byte~) init_plot_tables::$9 reg byte a 22.0
(label) init_plot_tables::@1
(label) init_plot_tables::@2
(label) init_plot_tables::@3
(label) init_plot_tables::@4
(label) init_plot_tables::@5
(label) init_plot_tables::@6
(label) init_plot_tables::@return
(byte) init_plot_tables::bits
(byte) init_plot_tables::bits#1 reg byte y 11.0
(byte) init_plot_tables::bits#3 reg byte y 6.6000000000000005
(byte) init_plot_tables::bits#4 reg byte y 7.333333333333333
(byte) init_plot_tables::x
(byte) init_plot_tables::x#1 reg byte x 16.5
(byte) init_plot_tables::x#2 reg byte x 7.333333333333334
(byte) init_plot_tables::y
(byte) init_plot_tables::y#1 reg byte x 16.5
(byte) init_plot_tables::y#2 reg byte x 6.0
(byte*) init_plot_tables::yoffs
(byte*) init_plot_tables::yoffs#1 yoffs zp ZP_WORD:2 22.0
(byte*) init_plot_tables::yoffs#2 yoffs zp ZP_WORD:2 6.111111111111112
(byte*) init_plot_tables::yoffs#4 yoffs zp ZP_WORD:2 11.0
(void()) init_screen()
(label) init_screen::@1
(label) init_screen::@2
(label) init_screen::@return
(byte*) init_screen::b
(byte*) init_screen::b#1 b zp ZP_WORD:2 16.5
(byte*) init_screen::b#2 b zp ZP_WORD:2 16.5
(byte*) init_screen::c
(byte*) init_screen::c#1 c zp ZP_WORD:2 16.5
(byte*) init_screen::c#2 c zp ZP_WORD:2 16.5
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(void()) plot((byte) plot::x , (byte) plot::y)
(byte~) plot::$5 reg byte a 4.0
(byte~) plot::$6 reg byte a 4.0
(byte~) plot::$7 reg byte a 4.0
(byte~) plot::$8 reg byte a 4.0
(byte~) plot::$9 reg byte a 4.0
(label) plot::@return
(byte*) plot::plotter
(byte*) plot::plotter#0 plotter zp ZP_WORD:2 3.0
(byte*) plot::plotter_x
(byte*) plot::plotter_x#1 plotter_x zp ZP_WORD:2 2.0
(byte*) plot::plotter_x#2 plotter_x zp ZP_WORD:2 0.8
(word) plot::plotter_y
(word) plot::plotter_y#1 plotter_y zp ZP_WORD:6 2.0
(word) plot::plotter_y#2 plotter_y zp ZP_WORD:6 4.0
(byte) plot::x
(byte) plot::x#0 x zp ZP_BYTE:4 9.727272727272727
(byte) plot::y
(byte) plot::y#0 y zp ZP_BYTE:5 15.000000000000002
(byte[$100]) plot_bit
(const byte[$100]) plot_bit#0 plot_bit = { fill( $100, 0) }
(byte[$100]) plot_xhi
(const byte[$100]) plot_xhi#0 plot_xhi = { fill( $100, 0) }
(byte[$100]) plot_xlo
(const byte[$100]) plot_xlo#0 plot_xlo = { fill( $100, 0) }
(byte[$100]) plot_yhi
(const byte[$100]) plot_yhi#0 plot_yhi = { fill( $100, 0) }
(byte[$100]) plot_ylo
(const byte[$100]) plot_ylo#0 plot_ylo = { fill( $100, 0) }
(void()) plots()
(label) plots::@1
(label) plots::@2
(label) plots::@return
(byte) plots::i
(byte) plots::i#1 reg byte x 151.5
(byte) plots::i#2 reg byte x 101.0
(byte) plots_cnt
(const byte) plots_cnt#0 plots_cnt = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte[]) plots_x
(const byte[]) plots_x#0 plots_x = { (byte/signed byte/word/signed word/dword/signed dword) $3c, (byte/signed byte/word/signed word/dword/signed dword) $50, (byte/signed byte/word/signed word/dword/signed dword) $6e, (byte/signed byte/word/signed word/dword/signed dword) $50, (byte/signed byte/word/signed word/dword/signed dword) $3c, (byte/signed byte/word/signed word/dword/signed dword) $28, (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $28 }
(byte[]) plots_y
(const byte[]) plots_y#0 plots_y = { (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $28, (byte/signed byte/word/signed word/dword/signed dword) $3c, (byte/signed byte/word/signed word/dword/signed dword) $50, (byte/signed byte/word/signed word/dword/signed dword) $6e, (byte/signed byte/word/signed word/dword/signed dword) $50, (byte/signed byte/word/signed word/dword/signed dword) $3c, (byte/signed byte/word/signed word/dword/signed dword) $28 }
reg byte x [ plots::i#2 plots::i#1 ]
reg byte x [ init_plot_tables::x#2 init_plot_tables::x#1 ]
reg byte y [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
reg byte x [ init_plot_tables::y#2 init_plot_tables::y#1 ]
zp ZP_WORD:2 [ init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 init_screen::b#2 init_screen::b#1 init_screen::c#2 init_screen::c#1 plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 ]
zp ZP_BYTE:4 [ plot::x#0 init_plot_tables::$6 ]
zp ZP_BYTE:5 [ plot::y#0 ]
reg byte a [ plot::$6 ]
reg byte a [ plot::$7 ]
reg byte a [ plot::$8 ]
zp ZP_WORD:6 [ plot::plotter_y#1 plot::plotter_y#2 ]
reg byte a [ plot::$9 ]
reg byte a [ plot::$5 ]
reg byte a [ init_plot_tables::$0 ]
reg byte a [ init_plot_tables::$7 ]
reg byte a [ init_plot_tables::$8 ]
reg byte a [ init_plot_tables::$9 ]
reg byte a [ init_plot_tables::$10 ]
program

@ -8,14 +8,14 @@
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::SCREEN#0) ← ~(byte/signed byte/word/signed word/dword/signed dword) 1
[4] *((const byte*) main::SCREEN#0) ← ~(byte) 1
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::c#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@1/(byte) main::c#1 )
[5] (byte) main::c#2 ← phi( main/(byte) 1 main::@1/(byte) main::c#1 )
[6] (byte~) main::$1 ← ~ (byte) main::c#2
[7] *((const byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$1
[8] (byte) main::c#1 ← ++ (byte) main::c#2
[9] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $1b) goto main::@1
[9] if((byte) main::c#1!=(byte) $1b) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[10] return

@ -1,13 +1,15 @@
Adding pointer type conversion cast (byte*) main::SCREEN in (byte*) main::SCREEN ← (number) $400
Identified constant variable (byte*) main::SCREEN
Culled Empty Block (label) main::@2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @1
(byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte/signed byte/word/signed word/dword/signed dword~) main::$0 ← ~ (byte/signed byte/word/signed word/dword/signed dword) 1
*((byte*) main::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword~) main::$0
(byte) main::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) main::SCREEN#0 ← ((byte*)) (number) $400
(byte~) main::$0 ← ~ (byte) 1
*((byte*) main::SCREEN#0) ← (byte~) main::$0
(byte) main::c#0 ← (number) 1
to:main::@1
main::@1: scope:[main] from main main::@1
(byte) main::c#2 ← phi( main/(byte) main::c#0 main::@1/(byte) main::c#1 )
@ -33,7 +35,7 @@ SYMBOL TABLE SSA
(label) @begin
(label) @end
(void()) main()
(byte/signed byte/word/signed word/dword/signed dword~) main::$0
(byte~) main::$0
(byte~) main::$1
(bool~) main::$2
(label) main::@1
@ -45,30 +47,48 @@ SYMBOL TABLE SSA
(byte) main::c#1
(byte) main::c#2
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) 1 in (byte) main::c#0 ← (number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) main::c#0 ← (unumber)(number) 1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simple Condition (bool~) main::$2 [9] if((byte) main::c#1!=rangelast(1,$1a)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::SCREEN#0 = ((byte*))$400
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$0 = ~1
Constant right-side identified [1] (byte~) main::$0 ← ~ (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
Constant (const byte) main::$0 = ~1
Constant (const byte) main::c#0 = 1
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value main::c#1 ← ++ main::c#2 to ++
Resolved ranged comparison value if(main::c#1!=rangelast(1,$1a)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) $1b
Resolved ranged next value [7] main::c#1 ← ++ main::c#2 to ++
Resolved ranged comparison value [9] if(main::c#1!=rangelast(1,$1a)) goto main::@1 to (number) $1b
Adding number conversion cast (unumber) $1b in if((byte) main::c#1!=(number) $1b) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $1b
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $1b
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte) main::c#0
Constant inlined main::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$0 = ~(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::c#0 = (byte) 1
Constant inlined main::$0 = ~(byte) 1
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 1 initial phi equivalence classes
Coalesced [11] main::c#3 ← main::c#1
Coalesced [12] main::c#3 ← main::c#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
@ -85,14 +105,14 @@ FINAL CONTROL FLOW GRAPH
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::SCREEN#0) ← ~(byte/signed byte/word/signed word/dword/signed dword) 1
[4] *((const byte*) main::SCREEN#0) ← ~(byte) 1
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::c#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@1/(byte) main::c#1 )
[5] (byte) main::c#2 ← phi( main/(byte) 1 main::@1/(byte) main::c#1 )
[6] (byte~) main::$1 ← ~ (byte) main::c#2
[7] *((const byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$1
[8] (byte) main::c#1 ← ++ (byte) main::c#2
[9] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $1b) goto main::@1
[9] if((byte) main::c#1!=(byte) $1b) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[10] return
@ -142,12 +162,12 @@ main: {
.label SCREEN = $400
.label _1 = 3
.label c = 2
//SEG10 [4] *((const byte*) main::SCREEN#0) ← ~(byte/signed byte/word/signed word/dword/signed dword) 1 -- _deref_pbuc1=vbuc2
//SEG10 [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 -- _deref_pbuc1=vbuc2
lda #1^$ff
sta SCREEN
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG12 [5] phi (byte) main::c#2 = (byte) 1 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #1
sta c
jmp b1
@ -167,7 +187,7 @@ main: {
sta SCREEN,y
//SEG18 [8] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuz1=_inc_vbuz1
inc c
//SEG19 [9] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $1b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG19 [9] if((byte) main::c#1!=(byte) $1b) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$1b
cmp c
bne b1_from_b1
@ -179,10 +199,10 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) main::SCREEN#0) ← ~(byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte~) main::$1 ← ~ (byte) main::c#2 [ main::c#2 main::$1 ] ( main:2 [ main::c#2 main::$1 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::c#2 main::c#1 ]
Statement [4] *((const byte*) main::SCREEN#0) ← ~(byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] (byte~) main::$1 ← ~ (byte) main::c#2 [ main::c#2 main::$1 ] ( main:2 [ main::c#2 main::$1 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::c#2 main::c#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::$1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
@ -218,12 +238,12 @@ bend:
//SEG9 main
main: {
.label SCREEN = $400
//SEG10 [4] *((const byte*) main::SCREEN#0) ← ~(byte/signed byte/word/signed word/dword/signed dword) 1 -- _deref_pbuc1=vbuc2
//SEG10 [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 -- _deref_pbuc1=vbuc2
lda #1^$ff
sta SCREEN
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::c#2 = (byte) 1 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #1
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
@ -239,7 +259,7 @@ main: {
sta SCREEN,x
//SEG18 [8] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG19 [9] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $1b) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG19 [9] if((byte) main::c#1!=(byte) $1b) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #$1b
bne b1_from_b1
jmp breturn
@ -282,7 +302,7 @@ FINAL SYMBOL TABLE
(label) main::@1
(label) main::@return
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
(byte) main::c
(byte) main::c#1 reg byte x 16.5
(byte) main::c#2 reg byte x 14.666666666666666
@ -309,11 +329,11 @@ Score: 187
//SEG9 main
main: {
.label SCREEN = $400
//SEG10 [4] *((const byte*) main::SCREEN#0) ← ~(byte/signed byte/word/signed word/dword/signed dword) 1 -- _deref_pbuc1=vbuc2
//SEG10 [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 -- _deref_pbuc1=vbuc2
lda #1^$ff
sta SCREEN
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::c#2 = (byte) 1 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG14 [5] phi (byte) main::c#2 = (byte) main::c#1 [phi:main::@1->main::@1#0] -- register_copy
@ -326,7 +346,7 @@ main: {
sta SCREEN,x
//SEG18 [8] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG19 [9] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $1b) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG19 [9] if((byte) main::c#1!=(byte) $1b) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #$1b
bne b1
//SEG20 main::@return

@ -1,15 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(byte~) main::$1 reg byte a 22.0
(label) main::@1
(label) main::@return
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte) main::c
(byte) main::c#1 reg byte x 16.5
(byte) main::c#2 reg byte x 14.666666666666666
reg byte x [ main::c#2 main::c#1 ]
reg byte a [ main::$1 ]
program

@ -26,7 +26,7 @@ bool_const_inline: scope:[bool_const_inline] from main::@2
[11] phi()
to:bool_const_inline::@1
bool_const_inline::@1: scope:[bool_const_inline] from bool_const_inline
[12] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 't'
[12] *((const byte*) SCREEN#0+(byte) 2) ← (byte) 't'
to:bool_const_inline::@return
bool_const_inline::@return: scope:[bool_const_inline] from bool_const_inline::@1
[13] return
@ -35,7 +35,7 @@ bool_const_vars: scope:[bool_const_vars] from main::@1
[14] phi()
to:bool_const_vars::@1
bool_const_vars::@1: scope:[bool_const_vars] from bool_const_vars
[15] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'f'
[15] *((const byte*) SCREEN#0+(byte) 1) ← (byte) 'f'
to:bool_const_vars::@return
bool_const_vars::@return: scope:[bool_const_vars] from bool_const_vars::@1
[16] return

@ -1,10 +1,20 @@
Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400
Identified constant variable (bool) bool_const_if::b
Identified constant variable (byte) bool_const_vars::a
Identified constant variable (byte) bool_const_inline::a
Culled Empty Block (label) @1
Culled Empty Block (label) bool_const_if::@2
Culled Empty Block (label) bool_const_if::@4
Culled Empty Block (label) @2
Culled Empty Block (label) bool_const_vars::@2
Culled Empty Block (label) bool_const_vars::@4
Culled Empty Block (label) @3
Culled Empty Block (label) bool_const_inline::@2
Culled Empty Block (label) bool_const_inline::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte*) SCREEN#0 ← ((byte*)) (number) $400
to:@4
main: scope:[main] from @4
call bool_const_if
@ -25,59 +35,57 @@ bool_const_if: scope:[bool_const_if] from main
if((bool) bool_const_if::b#0) goto bool_const_if::@1
to:bool_const_if::@3
bool_const_if::@1: scope:[bool_const_if] from bool_const_if
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 't'
*((byte*) SCREEN#0 + (number) 0) ← (byte) 't'
to:bool_const_if::@return
bool_const_if::@3: scope:[bool_const_if] from bool_const_if
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'f'
*((byte*) SCREEN#0 + (number) 0) ← (byte) 'f'
to:bool_const_if::@return
bool_const_if::@return: scope:[bool_const_if] from bool_const_if::@1 bool_const_if::@3
return
to:@return
bool_const_vars: scope:[bool_const_vars] from main::@1
(byte) bool_const_vars::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) $e
(bool~) bool_const_vars::$0 ← (byte) bool_const_vars::a#0 == (byte/signed byte/word/signed word/dword/signed dword) $f
(bool~) bool_const_vars::$1 ← (byte/signed byte/word/signed word/dword/signed dword) $15 < (byte) bool_const_vars::a#0
(byte) bool_const_vars::a#0 ← (number) $e
(bool~) bool_const_vars::$0 ← (byte) bool_const_vars::a#0 == (number) $f
(bool~) bool_const_vars::$1 ← (number) $15 < (byte) bool_const_vars::a#0
(bool~) bool_const_vars::$2 ← ! (bool~) bool_const_vars::$1
(bool~) bool_const_vars::$3 ← (bool~) bool_const_vars::$0 || (bool~) bool_const_vars::$2
(bool) bool_const_vars::b1#0 ← (bool~) bool_const_vars::$3
(bool~) bool_const_vars::$4 ← (byte) bool_const_vars::a#0 != (byte/signed byte/word/signed word/dword/signed dword) $2c
(signed byte/signed word/signed dword~) bool_const_vars::$5 ← - (byte/signed byte/word/signed word/dword/signed dword) 8
(bool~) bool_const_vars::$6 ← (byte) bool_const_vars::a#0 >= (signed byte/signed word/signed dword~) bool_const_vars::$5
(bool~) bool_const_vars::$7 ← (bool~) bool_const_vars::$4 || (bool~) bool_const_vars::$6
(bool) bool_const_vars::b2#0 ← (bool~) bool_const_vars::$7
(bool~) bool_const_vars::$8 ← ! (bool) bool_const_vars::b2#0
(bool~) bool_const_vars::$9 ← (bool) bool_const_vars::b1#0 && (bool~) bool_const_vars::$8
(bool~) bool_const_vars::$10 ← (bool~) bool_const_vars::$9 || false
(bool) bool_const_vars::b#0 ← (bool~) bool_const_vars::$10
(bool~) bool_const_vars::$4 ← (byte) bool_const_vars::a#0 != (number) $2c
(bool~) bool_const_vars::$5 ← (byte) bool_const_vars::a#0 >= (number) -8
(bool~) bool_const_vars::$6 ← (bool~) bool_const_vars::$4 || (bool~) bool_const_vars::$5
(bool) bool_const_vars::b2#0 ← (bool~) bool_const_vars::$6
(bool~) bool_const_vars::$7 ← ! (bool) bool_const_vars::b2#0
(bool~) bool_const_vars::$8 ← (bool) bool_const_vars::b1#0 && (bool~) bool_const_vars::$7
(bool~) bool_const_vars::$9 ← (bool~) bool_const_vars::$8 || false
(bool) bool_const_vars::b#0 ← (bool~) bool_const_vars::$9
if((bool) bool_const_vars::b#0) goto bool_const_vars::@1
to:bool_const_vars::@3
bool_const_vars::@1: scope:[bool_const_vars] from bool_const_vars
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 't'
*((byte*) SCREEN#0 + (number) 1) ← (byte) 't'
to:bool_const_vars::@return
bool_const_vars::@3: scope:[bool_const_vars] from bool_const_vars
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'f'
*((byte*) SCREEN#0 + (number) 1) ← (byte) 'f'
to:bool_const_vars::@return
bool_const_vars::@return: scope:[bool_const_vars] from bool_const_vars::@1 bool_const_vars::@3
return
to:@return
bool_const_inline: scope:[bool_const_inline] from main::@2
(byte) bool_const_inline::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) $17
(bool~) bool_const_inline::$0 ← (byte) bool_const_inline::a#0 != (byte/signed byte/word/signed word/dword/signed dword) $2c
(signed byte/signed word/signed dword~) bool_const_inline::$1 ← - (byte/signed byte/word/signed word/dword/signed dword) 8
(bool~) bool_const_inline::$2 ← (byte) bool_const_inline::a#0 >= (signed byte/signed word/signed dword~) bool_const_inline::$1
(bool~) bool_const_inline::$3 ← (byte) bool_const_inline::a#0 == (byte/signed byte/word/signed word/dword/signed dword) $f
(bool~) bool_const_inline::$4 ← (bool~) bool_const_inline::$2 && (bool~) bool_const_inline::$3
(bool~) bool_const_inline::$5 ← (bool~) bool_const_inline::$0 || (bool~) bool_const_inline::$4
(bool~) bool_const_inline::$6 ← (byte/signed byte/word/signed word/dword/signed dword) $15 < (byte) bool_const_inline::a#0
(bool~) bool_const_inline::$7 ← ! (bool~) bool_const_inline::$6
(bool~) bool_const_inline::$8 ← (bool~) bool_const_inline::$5 || (bool~) bool_const_inline::$7
if((bool~) bool_const_inline::$8) goto bool_const_inline::@1
(byte) bool_const_inline::a#0 ← (number) $17
(bool~) bool_const_inline::$0 ← (byte) bool_const_inline::a#0 != (number) $2c
(bool~) bool_const_inline::$1 ← (byte) bool_const_inline::a#0 >= (number) -8
(bool~) bool_const_inline::$2 ← (byte) bool_const_inline::a#0 == (number) $f
(bool~) bool_const_inline::$3 ← (bool~) bool_const_inline::$1 && (bool~) bool_const_inline::$2
(bool~) bool_const_inline::$4 ← (bool~) bool_const_inline::$0 || (bool~) bool_const_inline::$3
(bool~) bool_const_inline::$5 ← (number) $15 < (byte) bool_const_inline::a#0
(bool~) bool_const_inline::$6 ← ! (bool~) bool_const_inline::$5
(bool~) bool_const_inline::$7 ← (bool~) bool_const_inline::$4 || (bool~) bool_const_inline::$6
if((bool~) bool_const_inline::$7) goto bool_const_inline::@1
to:bool_const_inline::@3
bool_const_inline::@1: scope:[bool_const_inline] from bool_const_inline
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 't'
*((byte*) SCREEN#0 + (number) 2) ← (byte) 't'
to:bool_const_inline::@return
bool_const_inline::@3: scope:[bool_const_inline] from bool_const_inline
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 'f'
*((byte*) SCREEN#0 + (number) 2) ← (byte) 'f'
to:bool_const_inline::@return
bool_const_inline::@return: scope:[bool_const_inline] from bool_const_inline::@1 bool_const_inline::@3
return
@ -104,14 +112,13 @@ SYMBOL TABLE SSA
(bool) bool_const_if::b#0
(void()) bool_const_inline()
(bool~) bool_const_inline::$0
(signed byte/signed word/signed dword~) bool_const_inline::$1
(bool~) bool_const_inline::$1
(bool~) bool_const_inline::$2
(bool~) bool_const_inline::$3
(bool~) bool_const_inline::$4
(bool~) bool_const_inline::$5
(bool~) bool_const_inline::$6
(bool~) bool_const_inline::$7
(bool~) bool_const_inline::$8
(label) bool_const_inline::@1
(label) bool_const_inline::@3
(label) bool_const_inline::@return
@ -120,11 +127,10 @@ SYMBOL TABLE SSA
(void()) bool_const_vars()
(bool~) bool_const_vars::$0
(bool~) bool_const_vars::$1
(bool~) bool_const_vars::$10
(bool~) bool_const_vars::$2
(bool~) bool_const_vars::$3
(bool~) bool_const_vars::$4
(signed byte/signed word/signed dword~) bool_const_vars::$5
(bool~) bool_const_vars::$5
(bool~) bool_const_vars::$6
(bool~) bool_const_vars::$7
(bool~) bool_const_vars::$8
@ -146,82 +152,123 @@ SYMBOL TABLE SSA
(label) main::@3
(label) main::@return
Culled Empty Block (label) main::@3
Culled Empty Block (label) @5
Successful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not [13] (bool~) bool_const_vars::$2 ← (byte/signed byte/word/signed word/dword/signed dword) $15 >= (byte) bool_const_vars::a#0 from [12] (bool~) bool_const_vars::$1 ← (byte/signed byte/word/signed word/dword/signed dword) $15 < (byte) bool_const_vars::a#0
Inversing boolean not [37] (bool~) bool_const_inline::$7 ← (byte/signed byte/word/signed word/dword/signed dword) $15 >= (byte) bool_const_inline::a#0 from [36] (bool~) bool_const_inline::$6 ← (byte/signed byte/word/signed word/dword/signed dword) $15 < (byte) bool_const_inline::a#0
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (number) 0) ← (byte) 't'
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (number) 0) ← (byte) 'f'
Adding number conversion cast (unumber) $e in (byte) bool_const_vars::a#0 ← (number) $e
Adding number conversion cast (unumber) $f in (bool~) bool_const_vars::$0 ← (byte) bool_const_vars::a#0 == (number) $f
Adding number conversion cast (unumber) $15 in (bool~) bool_const_vars::$1 ← (number) $15 < (byte) bool_const_vars::a#0
Adding number conversion cast (unumber) $2c in (bool~) bool_const_vars::$4 ← (byte) bool_const_vars::a#0 != (number) $2c
Adding number conversion cast (unumber) -8 in (bool~) bool_const_vars::$5 ← (byte) bool_const_vars::a#0 >= (number) -8
Adding number conversion cast (unumber) 1 in *((byte*) SCREEN#0 + (number) 1) ← (byte) 't'
Adding number conversion cast (unumber) 1 in *((byte*) SCREEN#0 + (number) 1) ← (byte) 'f'
Adding number conversion cast (unumber) $17 in (byte) bool_const_inline::a#0 ← (number) $17
Adding number conversion cast (unumber) $2c in (bool~) bool_const_inline::$0 ← (byte) bool_const_inline::a#0 != (number) $2c
Adding number conversion cast (unumber) -8 in (bool~) bool_const_inline::$1 ← (byte) bool_const_inline::a#0 >= (number) -8
Adding number conversion cast (unumber) $f in (bool~) bool_const_inline::$2 ← (byte) bool_const_inline::a#0 == (number) $f
Adding number conversion cast (unumber) $15 in (bool~) bool_const_inline::$5 ← (number) $15 < (byte) bool_const_inline::a#0
Adding number conversion cast (unumber) 2 in *((byte*) SCREEN#0 + (number) 2) ← (byte) 't'
Adding number conversion cast (unumber) 2 in *((byte*) SCREEN#0 + (number) 2) ← (byte) 'f'
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) bool_const_vars::a#0 ← (unumber)(number) $e
Inlining cast (byte) bool_const_inline::a#0 ← (unumber)(number) $17
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $e
Simplifying constant integer cast $f
Simplifying constant integer cast $15
Simplifying constant integer cast $2c
Simplifying constant integer cast -8
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast $17
Simplifying constant integer cast $2c
Simplifying constant integer cast -8
Simplifying constant integer cast $f
Simplifying constant integer cast $15
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $e
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) $2c
Finalized unsigned number type (byte) -8
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $17
Finalized unsigned number type (byte) $2c
Finalized unsigned number type (byte) -8
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inversing boolean not [13] (bool~) bool_const_vars::$2 ← (byte) $15 >= (byte) bool_const_vars::a#0 from [12] (bool~) bool_const_vars::$1 ← (byte) $15 < (byte) bool_const_vars::a#0
Inversing boolean not [35] (bool~) bool_const_inline::$6 ← (byte) $15 >= (byte) bool_const_inline::a#0 from [34] (bool~) bool_const_inline::$5 ← (byte) $15 < (byte) bool_const_inline::a#0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (bool) bool_const_vars::b1#0 = (bool~) bool_const_vars::$3
Alias (bool) bool_const_vars::b2#0 = (bool~) bool_const_vars::$7
Alias (bool) bool_const_vars::b#0 = (bool~) bool_const_vars::$10
Alias (bool) bool_const_vars::b2#0 = (bool~) bool_const_vars::$6
Alias (bool) bool_const_vars::b#0 = (bool~) bool_const_vars::$9
Successful SSA optimization Pass2AliasElimination
Rewriting || if()-condition to two if()s [23] (bool) bool_const_vars::b#0 ← (bool~) bool_const_vars::$9 || false
Rewriting || if()-condition to two if()s [22] (bool) bool_const_vars::b#0 ← (bool~) bool_const_vars::$8 || false
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [22] (bool~) bool_const_vars::$9 ← (bool) bool_const_vars::b1#0 && (bool~) bool_const_vars::$8
Rewriting && if()-condition to two if()s [21] (bool~) bool_const_vars::$8 ← (bool) bool_const_vars::b1#0 && (bool~) bool_const_vars::$7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [14] (bool) bool_const_vars::b1#0 ← (bool~) bool_const_vars::$0 || (bool~) bool_const_vars::$2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [38] (bool~) bool_const_inline::$8 ← (bool~) bool_const_inline::$5 || (bool~) bool_const_inline::$7
Rewriting || if()-condition to two if()s [36] (bool~) bool_const_inline::$7 ← (bool~) bool_const_inline::$4 || (bool~) bool_const_inline::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [35] (bool~) bool_const_inline::$5 ← (bool~) bool_const_inline::$0 || (bool~) bool_const_inline::$4
Rewriting || if()-condition to two if()s [33] (bool~) bool_const_inline::$4 ← (bool~) bool_const_inline::$0 || (bool~) bool_const_inline::$3
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [21] (bool~) bool_const_vars::$8 ← ! (bool) bool_const_vars::b2#0
Rewriting ! if()-condition to reversed if() [20] (bool~) bool_const_vars::$7 ← ! (bool) bool_const_vars::b2#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [19] (bool) bool_const_vars::b2#0 ← (bool~) bool_const_vars::$4 || (bool~) bool_const_vars::$6
Rewriting || if()-condition to two if()s [18] (bool) bool_const_vars::b2#0 ← (bool~) bool_const_vars::$4 || (bool~) bool_const_vars::$5
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [34] (bool~) bool_const_inline::$4 ← (bool~) bool_const_inline::$2 && (bool~) bool_const_inline::$3
Rewriting && if()-condition to two if()s [32] (bool~) bool_const_inline::$3 ← (bool~) bool_const_inline::$1 && (bool~) bool_const_inline::$2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) SCREEN#0 = ((byte*))$400
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const bool) bool_const_if::b#0 = true
Constant (const byte) bool_const_vars::a#0 = $e
Constant (const signed byte/signed word/signed dword) bool_const_vars::$5 = -8
Constant (const byte) bool_const_inline::a#0 = $17
Constant (const signed byte/signed word/signed dword) bool_const_inline::$1 = -8
Successful SSA optimization Pass2ConstantIdentification
Constant (const bool) bool_const_vars::$0 = bool_const_vars::a#0==$f
Constant (const bool) bool_const_vars::$2 = $15>=bool_const_vars::a#0
Constant (const bool) bool_const_vars::$4 = bool_const_vars::a#0!=$2c
Constant (const bool) bool_const_vars::$6 = bool_const_vars::a#0>=bool_const_vars::$5
Constant (const bool) bool_const_inline::$0 = bool_const_inline::a#0!=$2c
Constant (const bool) bool_const_inline::$2 = bool_const_inline::a#0>=bool_const_inline::$1
Constant (const bool) bool_const_inline::$3 = bool_const_inline::a#0==$f
Constant (const bool) bool_const_inline::$7 = $15>=bool_const_inline::a#0
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(SCREEN#0+0)
Consolidated array index constant in *(SCREEN#0+0)
Consolidated array index constant in *(SCREEN#0+1)
Consolidated array index constant in *(SCREEN#0+1)
Consolidated array index constant in *(SCREEN#0+2)
Consolidated array index constant in *(SCREEN#0+2)
Successful SSA optimization Pass2ConstantAdditionElimination
if() condition always true - replacing block destination [4] if((const bool) bool_const_if::b#0) goto bool_const_if::@1
if() condition always false - eliminating [8] if((const bool) bool_const_vars::$0) goto bool_const_vars::@6
if() condition always true - replacing block destination [12] if((const bool) bool_const_inline::$0) goto bool_const_inline::@1
if() condition always false - eliminating [17] if(false) goto bool_const_vars::@1
if() condition always true - replacing block destination [18] if((const bool) bool_const_vars::$4) goto bool_const_vars::@5
if() condition always true - replacing block destination [19] if((const bool) bool_const_vars::$2) goto bool_const_vars::@6
if() condition always false - eliminating [20] if((const bool) bool_const_inline::$7) goto bool_const_inline::@1
if() condition always true - replacing block destination [21] if((const bool) bool_const_inline::$2) goto bool_const_inline::@7
if() condition always true - replacing block destination [22] if((const bool) bool_const_vars::$6) goto bool_const_vars::@5
if() condition always false - eliminating [23] if((const bool) bool_const_inline::$3) goto bool_const_inline::@1
if() condition always true - replacing block destination [6] if((const bool) bool_const_if::b#0) goto bool_const_if::@1
if() condition always false - eliminating if(false) goto bool_const_vars::@1
Successful SSA optimization Pass2ConstantIfs
Simplifying expression containing zero SCREEN#0 in [7] *((const byte*) SCREEN#0 + (byte) 0) ← (byte) 't'
Simplifying expression containing zero SCREEN#0 in [8] *((const byte*) SCREEN#0 + (byte) 0) ← (byte) 'f'
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const bool) bool_const_if::b#0
Eliminating unused constant (const bool) bool_const_vars::$0
Eliminating unused constant (const bool) bool_const_vars::$2
Eliminating unused constant (const bool) bool_const_vars::$4
Eliminating unused constant (const bool) bool_const_vars::$6
Eliminating unused constant (const bool) bool_const_inline::$0
Eliminating unused constant (const bool) bool_const_inline::$2
Eliminating unused constant (const bool) bool_const_inline::$3
Eliminating unused constant (const bool) bool_const_inline::$7
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte) bool_const_vars::a#0
Eliminating unused constant (const signed byte/signed word/signed dword) bool_const_vars::$5
Eliminating unused constant (const byte) bool_const_inline::a#0
Eliminating unused constant (const signed byte/signed word/signed dword) bool_const_inline::$1
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block bool_const_if::@3
Successful SSA optimization Pass2EliminateUnusedBlocks
Simple Condition (bool~) bool_const_vars::$0 [10] if((const byte) bool_const_vars::a#0==(byte) $f) goto bool_const_vars::@6
Simple Condition (bool~) bool_const_inline::$0 [18] if((const byte) bool_const_inline::a#0!=(byte) $2c) goto bool_const_inline::@1
Simple Condition (bool~) bool_const_vars::$4 [23] if((const byte) bool_const_vars::a#0!=(byte) $2c) goto bool_const_vars::@5
Simple Condition (bool~) bool_const_vars::$2 [24] if((byte) $15>=(const byte) bool_const_vars::a#0) goto bool_const_vars::@6
Simple Condition (bool~) bool_const_inline::$6 [25] if((byte) $15>=(const byte) bool_const_inline::a#0) goto bool_const_inline::@1
Simple Condition (bool~) bool_const_inline::$1 [26] if((const byte) bool_const_inline::a#0>=(byte) -8) goto bool_const_inline::@7
Simple Condition (bool~) bool_const_vars::$5 [27] if((const byte) bool_const_vars::a#0>=(byte) -8) goto bool_const_vars::@5
Simple Condition (bool~) bool_const_inline::$2 [28] if((const byte) bool_const_inline::a#0==(byte) $f) goto bool_const_inline::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [26] if((const byte) bool_const_inline::a#0<(byte) -8) goto bool_const_inline::@5
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
if() condition always false - eliminating [10] if((const byte) bool_const_vars::a#0==(byte) $f) goto bool_const_vars::@6
if() condition always true - replacing block destination [18] if((const byte) bool_const_inline::a#0!=(byte) $2c) goto bool_const_inline::@1
if() condition always true - replacing block destination [23] if((const byte) bool_const_vars::a#0!=(byte) $2c) goto bool_const_vars::@5
if() condition always true - replacing block destination [24] if((byte) $15>=(const byte) bool_const_vars::a#0) goto bool_const_vars::@6
if() condition always false - eliminating [25] if((byte) $15>=(const byte) bool_const_inline::a#0) goto bool_const_inline::@1
if() condition always false - eliminating [26] if((const byte) bool_const_inline::a#0<(byte) -8) goto bool_const_inline::@5
if() condition always true - replacing block destination [27] if((const byte) bool_const_vars::a#0>=(byte) -8) goto bool_const_vars::@5
if() condition always false - eliminating [28] if((const byte) bool_const_inline::a#0==(byte) $f) goto bool_const_inline::@1
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) bool_const_vars::a#0
Eliminating unused constant (const byte) bool_const_inline::a#0
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block bool_const_vars::@1
Removing unused block bool_const_inline::@3
Removing unused block bool_const_inline::@5
@ -229,26 +276,34 @@ Removing unused block bool_const_inline::@6
Removing unused block bool_const_vars::@8
Removing unused block bool_const_inline::@7
Successful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) bool_const_vars::@5
Culled Empty Block (label) bool_const_vars::@6
Culled Empty Block (label) bool_const_vars::@7
Successful SSA optimization Pass2CullEmptyBlocks
Simplifying constant plus zero SCREEN#0+0
Consolidated array index constant in *(SCREEN#0+1)
Consolidated array index constant in *(SCREEN#0+2)
Successful SSA optimization Pass2ConstantAdditionElimination
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of bool_const_inline
Adding NOP phi() at start of bool_const_vars
Adding NOP phi() at start of bool_const_vars::@7
Adding NOP phi() at start of bool_const_vars::@6
Adding NOP phi() at start of bool_const_vars::@5
Adding NOP phi() at start of bool_const_if
CALL GRAPH
Calls in [] to main:2
Calls in [main] to bool_const_if:5 bool_const_vars:7 bool_const_inline:9
Calls in [main] to bool_const_if:6 bool_const_vars:8 bool_const_inline:10
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) main::@3
Culled Empty Block (label) bool_const_vars::@7
Culled Empty Block (label) bool_const_vars::@6
Culled Empty Block (label) bool_const_vars::@5
Renumbering block @4 to @1
Renumbering block bool_const_vars::@3 to bool_const_vars::@1
Adding NOP phi() at start of @begin
@ -290,7 +345,7 @@ bool_const_inline: scope:[bool_const_inline] from main::@2
[11] phi()
to:bool_const_inline::@1
bool_const_inline::@1: scope:[bool_const_inline] from bool_const_inline
[12] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 't'
[12] *((const byte*) SCREEN#0+(byte) 2) ← (byte) 't'
to:bool_const_inline::@return
bool_const_inline::@return: scope:[bool_const_inline] from bool_const_inline::@1
[13] return
@ -299,7 +354,7 @@ bool_const_vars: scope:[bool_const_vars] from main::@1
[14] phi()
to:bool_const_vars::@1
bool_const_vars::@1: scope:[bool_const_vars] from bool_const_vars
[15] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'f'
[15] *((const byte*) SCREEN#0+(byte) 1) ← (byte) 'f'
to:bool_const_vars::@return
bool_const_vars::@return: scope:[bool_const_vars] from bool_const_vars::@1
[16] return
@ -392,7 +447,7 @@ bool_const_inline: {
jmp b1
//SEG24 bool_const_inline::@1
b1:
//SEG25 [12] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2
//SEG25 [12] *((const byte*) SCREEN#0+(byte) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2
lda #'t'
sta SCREEN+2
jmp breturn
@ -407,7 +462,7 @@ bool_const_vars: {
jmp b1
//SEG29 bool_const_vars::@1
b1:
//SEG30 [15] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2
//SEG30 [15] *((const byte*) SCREEN#0+(byte) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2
lda #'f'
sta SCREEN+1
jmp breturn
@ -433,8 +488,8 @@ bool_const_if: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [12] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 't' [ ] ( main:2::bool_const_inline:9 [ ] ) always clobbers reg byte a
Statement [15] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'f' [ ] ( main:2::bool_const_vars:7 [ ] ) always clobbers reg byte a
Statement [12] *((const byte*) SCREEN#0+(byte) 2) ← (byte) 't' [ ] ( main:2::bool_const_inline:9 [ ] ) always clobbers reg byte a
Statement [15] *((const byte*) SCREEN#0+(byte) 1) ← (byte) 'f' [ ] ( main:2::bool_const_vars:7 [ ] ) always clobbers reg byte a
Statement [18] *((const byte*) SCREEN#0) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
@ -511,7 +566,7 @@ bool_const_inline: {
jmp b1
//SEG24 bool_const_inline::@1
b1:
//SEG25 [12] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2
//SEG25 [12] *((const byte*) SCREEN#0+(byte) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2
lda #'t'
sta SCREEN+2
jmp breturn
@ -526,7 +581,7 @@ bool_const_vars: {
jmp b1
//SEG29 bool_const_vars::@1
b1:
//SEG30 [15] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2
//SEG30 [15] *((const byte*) SCREEN#0+(byte) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2
lda #'f'
sta SCREEN+1
jmp breturn
@ -596,7 +651,7 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(void()) bool_const_if()
(label) bool_const_if::@1
(label) bool_const_if::@return
@ -660,7 +715,7 @@ main: {
// A constant boolean inside an if()
bool_const_inline: {
//SEG24 bool_const_inline::@1
//SEG25 [12] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2
//SEG25 [12] *((const byte*) SCREEN#0+(byte) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2
lda #'t'
sta SCREEN+2
//SEG26 bool_const_inline::@return
@ -671,7 +726,7 @@ bool_const_inline: {
// A bunch of constant boolean vars (used in an if)
bool_const_vars: {
//SEG29 bool_const_vars::@1
//SEG30 [15] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2
//SEG30 [15] *((const byte*) SCREEN#0+(byte) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2
lda #'f'
sta SCREEN+1
//SEG31 bool_const_vars::@return

@ -1,25 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(void()) bool_const_if()
(label) bool_const_if::@1
(label) bool_const_if::@return
(bool) bool_const_if::b
(void()) bool_const_inline()
(label) bool_const_inline::@1
(label) bool_const_inline::@return
(byte) bool_const_inline::a
(void()) bool_const_vars()
(label) bool_const_vars::@1
(label) bool_const_vars::@return
(byte) bool_const_vars::a
(bool) bool_const_vars::b
(bool) bool_const_vars::b1
(bool) bool_const_vars::b2
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
program

@ -11,9 +11,9 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::i#1 )
[6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@3/(byte) main::i#1 )
[6] (byte~) main::$0 ← (byte) main::i#2 & (byte) 1
[7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0
[8] (byte) isSet::i#0 ← (byte) main::i#2
[9] call isSet
[10] (bool) isSet::return#0 ← (bool) isSet::return#1
@ -27,7 +27,7 @@ main::@4: scope:[main] from main::@5
to:main::@3
main::@3: scope:[main] from main::@2 main::@4
[14] (byte) main::i#1 ← ++ (byte) main::i#2
[15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1
[15] if((byte) main::i#1!=(byte) $65) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
[16] return
@ -36,8 +36,8 @@ main::@2: scope:[main] from main::@5
[17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*'
to:main::@3
isSet: scope:[isSet] from main::@1
[18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8
[19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0
[18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte) 8
[19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0
[20] (bool) isSet::return#1 ← (bool) isSet::b#0 || (bool~) isSet::$1
to:isSet::@return
isSet::@return: scope:[isSet] from isSet

@ -1,16 +1,21 @@
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Identified constant variable (byte*) main::screen
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Culled Empty Block (label) @1
Culled Empty Block (label) isSet::@1
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@2
main: scope:[main] from @2
(byte*) main::screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte) main::i#0 ← (number) 0
to:main::@1
main::@1: scope:[main] from main main::@3
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
(bool~) main::$1 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0
(number~) main::$0 ← (byte) main::i#2 & (number) 1
(bool~) main::$1 ← (number~) main::$0 == (number) 0
(byte) isSet::i#0 ← (byte) main::i#2
(bool) isSet::b#0 ← (bool~) main::$1
call isSet
@ -42,8 +47,8 @@ main::@return: scope:[main] from main::@3
isSet: scope:[isSet] from main::@1
(bool) isSet::b#1 ← phi( main::@1/(bool) isSet::b#0 )
(byte) isSet::i#1 ← phi( main::@1/(byte) isSet::i#0 )
(byte~) isSet::$0 ← (byte) isSet::i#1 & (byte/signed byte/word/signed word/dword/signed dword) 8
(bool~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0
(number~) isSet::$0 ← (byte) isSet::i#1 & (number) 8
(bool~) isSet::$1 ← (number~) isSet::$0 != (number) 0
(bool~) isSet::$2 ← (bool) isSet::b#1 || (bool~) isSet::$1
(bool) isSet::return#1 ← (bool~) isSet::$2
to:isSet::@return
@ -65,7 +70,7 @@ SYMBOL TABLE SSA
(label) @begin
(label) @end
(bool()) isSet((byte) isSet::i , (bool) isSet::b)
(byte~) isSet::$0
(number~) isSet::$0
(bool~) isSet::$1
(bool~) isSet::$2
(label) isSet::@return
@ -82,7 +87,7 @@ SYMBOL TABLE SSA
(bool) isSet::return#3
(bool) isSet::return#4
(void()) main()
(byte~) main::$0
(number~) main::$0
(bool~) main::$1
(bool~) main::$2
(bool~) main::$3
@ -103,8 +108,32 @@ SYMBOL TABLE SSA
(byte*) main::screen
(byte*) main::screen#0
Culled Empty Block (label) @3
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0
Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::i#2 & (number) 1
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::i#2 & (unumber)(number) 1
Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (unumber~) main::$0 == (number) 0
Adding number conversion cast (unumber) 8 in (number~) isSet::$0 ← (byte) isSet::i#1 & (number) 8
Adding number conversion cast (unumber) isSet::$0 in (number~) isSet::$0 ← (byte) isSet::i#1 & (unumber)(number) 8
Adding number conversion cast (unumber) 0 in (bool~) isSet::$1 ← (unumber~) isSet::$0 != (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (byte) main::i#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 8
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::i#2 & (byte) 1
Inferred type updated to byte in (unumber~) isSet::$0 ← (byte) isSet::i#1 & (byte) 8
Alias (bool) isSet::b#0 = (bool~) main::$1
Alias (bool) isSet::return#0 = (bool) isSet::return#3
Alias (byte) main::i#2 = (byte) main::i#6 (byte) main::i#3 (byte) main::i#4
@ -112,31 +141,39 @@ Alias (bool) isSet::return#1 = (bool~) isSet::$2 (bool) isSet::return#4 (bool) i
Successful SSA optimization Pass2AliasElimination
Alias (byte) main::i#2 = (byte) main::i#5
Successful SSA optimization Pass2AliasElimination
Redundant Phi (byte) isSet::i#1 (byte) isSet::i#0
Redundant Phi (bool) isSet::b#1 (bool) isSet::b#0
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte) isSet::i#1 (byte) isSet::i#0
Identical Phi Values (bool) isSet::b#1 (bool) isSet::b#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$3 [19] if((byte) main::i#1!=rangelast(0,$64)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::screen#0 = ((byte*))$400
Constant (const byte*) main::screen#0 = (byte*) 1024
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value if(main::i#1!=rangelast(0,$64)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) $65
Resolved ranged next value [17] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [19] if(main::i#1!=rangelast(0,$64)) goto main::@1 to (number) $65
Adding number conversion cast (unumber) $65 in if((byte) main::i#1!=(number) $65) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $65
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $65
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::i#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@8(between main::@3 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Calls in [main] to isSet:9
Calls in [main] to isSet:10
Created 1 initial phi equivalence classes
Coalesced [17] main::i#7 ← main::i#1
Coalesced [18] main::i#7 ← main::i#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) main::@8
Renumbering block @2 to @1
Renumbering block main::@7 to main::@5
@ -159,9 +196,9 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::i#1 )
[6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@3/(byte) main::i#1 )
[6] (byte~) main::$0 ← (byte) main::i#2 & (byte) 1
[7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0
[8] (byte) isSet::i#0 ← (byte) main::i#2
[9] call isSet
[10] (bool) isSet::return#0 ← (bool) isSet::return#1
@ -175,7 +212,7 @@ main::@4: scope:[main] from main::@5
to:main::@3
main::@3: scope:[main] from main::@2 main::@4
[14] (byte) main::i#1 ← ++ (byte) main::i#2
[15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1
[15] if((byte) main::i#1!=(byte) $65) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
[16] return
@ -184,8 +221,8 @@ main::@2: scope:[main] from main::@5
[17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*'
to:main::@3
isSet: scope:[isSet] from main::@1
[18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8
[19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0
[18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte) 8
[19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0
[20] (bool) isSet::return#1 ← (bool) isSet::b#0 || (bool~) isSet::$1
to:isSet::@return
isSet::@return: scope:[isSet] from isSet
@ -274,7 +311,7 @@ main: {
.label i = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG12 [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta i
jmp b1
@ -284,11 +321,11 @@ main: {
jmp b1
//SEG15 main::@1
b1:
//SEG16 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_band_vbuc1
//SEG16 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte) 1 -- vbuz1=vbuz2_band_vbuc1
lda #1
and i
sta _0
//SEG17 [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 -- vboz1=vbuz2_eq_vbuc1
//SEG17 [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0 -- vboz1=vbuz2_eq_vbuc1
lda _0
eor #0
beq !+
@ -326,7 +363,7 @@ main: {
b3:
//SEG27 [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG28 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG28 [15] if((byte) main::i#1!=(byte) $65) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$65
cmp i
bne b1_from_b3
@ -354,11 +391,11 @@ isSet: {
.label b = 4
.label return = 6
.label return_1 = $a
//SEG34 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuz1=vbuz2_band_vbuc1
//SEG34 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte) 8 -- vbuz1=vbuz2_band_vbuc1
lda #8
and i
sta _0
//SEG35 [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 -- vboz1=vbuz2_neq_vbuc1
//SEG35 [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0 -- vboz1=vbuz2_neq_vbuc1
lda _0
eor #0
beq !+
@ -377,18 +414,18 @@ isSet: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) always clobbers reg byte a
Statement [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Statement [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) always clobbers reg byte a
Statement [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BOOL:4 [ isSet::b#0 ]
Statement [20] (bool) isSet::return#1 ← (bool) isSet::b#0 || (bool~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) always clobbers reg byte a
Statement [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$0 ← (byte) main::i#2 & (byte) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) always clobbers reg byte a
Statement [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) always clobbers reg byte a
Statement [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) always clobbers reg byte a
Statement [20] (bool) isSet::return#1 ← (bool) isSet::b#0 || (bool~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::$0 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
@ -440,7 +477,7 @@ main: {
.label screen = $400
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
jmp b1
//SEG13 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
@ -449,10 +486,10 @@ main: {
jmp b1
//SEG15 main::@1
b1:
//SEG16 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuxx_band_vbuc1
//SEG16 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte) 1 -- vbuaa=vbuxx_band_vbuc1
txa
and #1
//SEG17 [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 -- vboz1=vbuaa_eq_vbuc1
//SEG17 [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0 -- vboz1=vbuaa_eq_vbuc1
eor #0
beq !+
lda #1
@ -481,7 +518,7 @@ main: {
b3:
//SEG27 [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG28 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG28 [15] if((byte) main::i#1!=(byte) $65) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #$65
bne b1_from_b3
jmp breturn
@ -502,10 +539,10 @@ main: {
// isSet(byte register(X) i, bool zeropage(2) b)
isSet: {
.label b = 2
//SEG34 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuaa=vbuxx_band_vbuc1
//SEG34 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte) 8 -- vbuaa=vbuxx_band_vbuc1
txa
and #8
//SEG35 [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 -- vboaa=vbuaa_neq_vbuc1
//SEG35 [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0 -- vboaa=vbuaa_neq_vbuc1
eor #0
beq !+
lda #1
@ -579,7 +616,7 @@ FINAL SYMBOL TABLE
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 6.6
(byte*) main::screen
(const byte*) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) main::screen#0 screen = (byte*) 1024
reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::$0 ]
@ -613,16 +650,16 @@ Score: 540
main: {
.label screen = $400
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
//SEG13 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
//SEG14 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@3->main::@1#0] -- register_copy
//SEG15 main::@1
b1:
//SEG16 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuxx_band_vbuc1
//SEG16 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte) 1 -- vbuaa=vbuxx_band_vbuc1
txa
and #1
//SEG17 [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 -- vboz1=vbuaa_eq_vbuc1
//SEG17 [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0 -- vboz1=vbuaa_eq_vbuc1
eor #0
beq !+
lda #1
@ -646,7 +683,7 @@ main: {
b3:
//SEG27 [14] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG28 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG28 [15] if((byte) main::i#1!=(byte) $65) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #$65
bne b1
//SEG29 main::@return
@ -665,10 +702,10 @@ main: {
// isSet(byte register(X) i, bool zeropage(2) b)
isSet: {
.label b = 2
//SEG34 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuaa=vbuxx_band_vbuc1
//SEG34 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte) 8 -- vbuaa=vbuxx_band_vbuc1
txa
and #8
//SEG35 [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 -- vboaa=vbuaa_neq_vbuc1
//SEG35 [19] (bool~) isSet::$1 ← (byte~) isSet::$0 != (byte) 0 -- vboaa=vbuaa_neq_vbuc1
eor #0
beq !+
lda #1

@ -1,38 +1 @@
(label) @1
(label) @begin
(label) @end
(bool()) isSet((byte) isSet::i , (bool) isSet::b)
(byte~) isSet::$0 reg byte a 4.0
(bool~) isSet::$1 reg byte a 4.0
(label) isSet::@return
(bool) isSet::b
(bool) isSet::b#0 b zp ZP_BOOL:2 3.25
(byte) isSet::i
(byte) isSet::i#0 reg byte x 13.0
(bool) isSet::return
(bool) isSet::return#0 reg byte a 22.0
(bool) isSet::return#1 reg byte a 4.333333333333333
(void()) main()
(byte~) main::$0 reg byte a 22.0
(bool~) main::$2 reg byte a 22.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@return
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 6.6
(byte*) main::screen
(const byte*) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::$0 ]
zp ZP_BOOL:2 [ isSet::b#0 ]
reg byte x [ isSet::i#0 ]
reg byte a [ isSet::return#0 ]
reg byte a [ main::$2 ]
reg byte a [ isSet::$0 ]
reg byte a [ isSet::$1 ]
reg byte a [ isSet::return#1 ]
program

@ -30,23 +30,25 @@ bool_complex: scope:[bool_complex] from main::@3
[13] phi()
to:bool_complex::@1
bool_complex::@1: scope:[bool_complex] from bool_complex bool_complex::@3
[14] (byte) bool_complex::i#2 ← phi( bool_complex/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_complex::@3/(byte) bool_complex::i#1 )
[15] (byte~) bool_complex::$1 ← (byte) bool_complex::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[16] (byte~) bool_complex::$5 ← (byte) bool_complex::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[17] if((byte) bool_complex::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto bool_complex::@6
[14] (byte) bool_complex::i#2 ← phi( bool_complex/(byte) 0 bool_complex::@3/(byte) bool_complex::i#1 )
[15] (byte~) bool_complex::$5 ← (byte) bool_complex::i#2 & (byte) 1
[16] if((byte) bool_complex::i#2>=(byte) $a) goto bool_complex::@5
to:bool_complex::@6
bool_complex::@6: scope:[bool_complex] from bool_complex::@1
[17] if((byte~) bool_complex::$5==(byte) 0) goto bool_complex::@2
to:bool_complex::@5
bool_complex::@5: scope:[bool_complex] from bool_complex::@1 bool_complex::@6
[18] if((byte) bool_complex::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto bool_complex::@4
[18] if((byte) bool_complex::i#2<(byte) $a) goto bool_complex::@4
to:bool_complex::@7
bool_complex::@7: scope:[bool_complex] from bool_complex::@5
[19] if((byte~) bool_complex::$5==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_complex::@4
[19] if((byte~) bool_complex::$5==(byte) 0) goto bool_complex::@4
to:bool_complex::@2
bool_complex::@2: scope:[bool_complex] from bool_complex::@6 bool_complex::@7
[20] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) '*'
to:bool_complex::@3
bool_complex::@3: scope:[bool_complex] from bool_complex::@2 bool_complex::@4
[21] (byte) bool_complex::i#1 ← ++ (byte) bool_complex::i#2
[22] if((byte) bool_complex::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $15) goto bool_complex::@1
[22] if((byte) bool_complex::i#1!=(byte) $15) goto bool_complex::@1
to:bool_complex::@return
bool_complex::@return: scope:[bool_complex] from bool_complex::@3
[23] return
@ -54,78 +56,75 @@ bool_complex::@return: scope:[bool_complex] from bool_complex::@3
bool_complex::@4: scope:[bool_complex] from bool_complex::@5 bool_complex::@7
[24] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) ' '
to:bool_complex::@3
bool_complex::@6: scope:[bool_complex] from bool_complex::@1
[25] if((byte~) bool_complex::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_complex::@2
to:bool_complex::@5
bool_not: scope:[bool_not] from main::@2
[26] phi()
[25] phi()
to:bool_not::@1
bool_not::@1: scope:[bool_not] from bool_not bool_not::@3
[27] (byte) bool_not::i#2 ← phi( bool_not/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_not::@3/(byte) bool_not::i#1 )
[28] (byte~) bool_not::$1 ← (byte) bool_not::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[29] if((byte) bool_not::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto bool_not::@4
[26] (byte) bool_not::i#2 ← phi( bool_not/(byte) 0 bool_not::@3/(byte) bool_not::i#1 )
[27] (byte~) bool_not::$1 ← (byte) bool_not::i#2 & (byte) 1
[28] if((byte) bool_not::i#2<(byte) $a) goto bool_not::@4
to:bool_not::@5
bool_not::@5: scope:[bool_not] from bool_not::@1
[30] if((byte~) bool_not::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_not::@4
[29] if((byte~) bool_not::$1==(byte) 0) goto bool_not::@4
to:bool_not::@2
bool_not::@2: scope:[bool_not] from bool_not::@5
[31] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) '*'
[30] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) '*'
to:bool_not::@3
bool_not::@3: scope:[bool_not] from bool_not::@2 bool_not::@4
[32] (byte) bool_not::i#1 ← ++ (byte) bool_not::i#2
[33] if((byte) bool_not::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $15) goto bool_not::@1
[31] (byte) bool_not::i#1 ← ++ (byte) bool_not::i#2
[32] if((byte) bool_not::i#1!=(byte) $15) goto bool_not::@1
to:bool_not::@return
bool_not::@return: scope:[bool_not] from bool_not::@3
[34] return
[33] return
to:@return
bool_not::@4: scope:[bool_not] from bool_not::@1 bool_not::@5
[35] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) ' '
[34] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) ' '
to:bool_not::@3
bool_or: scope:[bool_or] from main::@1
[36] phi()
[35] phi()
to:bool_or::@1
bool_or::@1: scope:[bool_or] from bool_or bool_or::@3
[37] (byte) bool_or::i#2 ← phi( bool_or/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_or::@3/(byte) bool_or::i#1 )
[38] (byte~) bool_or::$1 ← (byte) bool_or::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[39] if((byte) bool_or::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto bool_or::@2
[36] (byte) bool_or::i#2 ← phi( bool_or/(byte) 0 bool_or::@3/(byte) bool_or::i#1 )
[37] (byte~) bool_or::$1 ← (byte) bool_or::i#2 & (byte) 1
[38] if((byte) bool_or::i#2<(byte) $a) goto bool_or::@2
to:bool_or::@5
bool_or::@5: scope:[bool_or] from bool_or::@1
[40] if((byte~) bool_or::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_or::@2
[39] if((byte~) bool_or::$1==(byte) 0) goto bool_or::@2
to:bool_or::@4
bool_or::@4: scope:[bool_or] from bool_or::@5
[41] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) ' '
[40] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) ' '
to:bool_or::@3
bool_or::@3: scope:[bool_or] from bool_or::@2 bool_or::@4
[42] (byte) bool_or::i#1 ← ++ (byte) bool_or::i#2
[43] if((byte) bool_or::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $15) goto bool_or::@1
[41] (byte) bool_or::i#1 ← ++ (byte) bool_or::i#2
[42] if((byte) bool_or::i#1!=(byte) $15) goto bool_or::@1
to:bool_or::@return
bool_or::@return: scope:[bool_or] from bool_or::@3
[44] return
[43] return
to:@return
bool_or::@2: scope:[bool_or] from bool_or::@1 bool_or::@5
[45] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) '*'
[44] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) '*'
to:bool_or::@3
bool_and: scope:[bool_and] from main
[46] phi()
[45] phi()
to:bool_and::@1
bool_and::@1: scope:[bool_and] from bool_and bool_and::@3
[47] (byte) bool_and::i#2 ← phi( bool_and/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_and::@3/(byte) bool_and::i#1 )
[48] (byte~) bool_and::$1 ← (byte) bool_and::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[49] if((byte) bool_and::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto bool_and::@5
[46] (byte) bool_and::i#2 ← phi( bool_and/(byte) 0 bool_and::@3/(byte) bool_and::i#1 )
[47] (byte~) bool_and::$1 ← (byte) bool_and::i#2 & (byte) 1
[48] if((byte) bool_and::i#2>=(byte) $a) goto bool_and::@4
to:bool_and::@5
bool_and::@5: scope:[bool_and] from bool_and::@1
[49] if((byte~) bool_and::$1==(byte) 0) goto bool_and::@2
to:bool_and::@4
bool_and::@4: scope:[bool_and] from bool_and::@1 bool_and::@5
[50] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) ' '
to:bool_and::@3
bool_and::@3: scope:[bool_and] from bool_and::@2 bool_and::@4
[51] (byte) bool_and::i#1 ← ++ (byte) bool_and::i#2
[52] if((byte) bool_and::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $15) goto bool_and::@1
[52] if((byte) bool_and::i#1!=(byte) $15) goto bool_and::@1
to:bool_and::@return
bool_and::@return: scope:[bool_and] from bool_and::@3
[53] return
to:@return
bool_and::@5: scope:[bool_and] from bool_and::@1
[54] if((byte~) bool_and::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_and::@2
to:bool_and::@4
bool_and::@2: scope:[bool_and] from bool_and::@5
[55] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) '*'
[54] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) '*'
to:bool_and::@3

File diff suppressed because it is too large Load Diff

@ -1,73 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) bool_and()
(byte~) bool_and::$1 reg byte a 11.0
(label) bool_and::@1
(label) bool_and::@2
(label) bool_and::@3
(label) bool_and::@4
(label) bool_and::@5
(label) bool_and::@return
(byte) bool_and::i
(byte) bool_and::i#1 reg byte x 16.5
(byte) bool_and::i#2 reg byte x 11.0
(byte*) bool_and::screen
(const byte*) bool_and::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
(void()) bool_complex()
(byte~) bool_complex::$1 reg byte x 7.333333333333333
(byte~) bool_complex::$5 reg byte a 5.5
(label) bool_complex::@1
(label) bool_complex::@2
(label) bool_complex::@3
(label) bool_complex::@4
(label) bool_complex::@5
(label) bool_complex::@6
(label) bool_complex::@7
(label) bool_complex::@return
(byte) bool_complex::i
(byte) bool_complex::i#1 reg byte y 16.5
(byte) bool_complex::i#2 reg byte y 9.777777777777779
(byte*) bool_complex::screen
(const byte*) bool_complex::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $478
(void()) bool_not()
(byte~) bool_not::$1 reg byte a 11.0
(label) bool_not::@1
(label) bool_not::@2
(label) bool_not::@3
(label) bool_not::@4
(label) bool_not::@5
(label) bool_not::@return
(byte) bool_not::i
(byte) bool_not::i#1 reg byte x 16.5
(byte) bool_not::i#2 reg byte x 11.0
(byte*) bool_not::screen
(const byte*) bool_not::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $450
(void()) bool_or()
(byte~) bool_or::$1 reg byte a 11.0
(label) bool_or::@1
(label) bool_or::@2
(label) bool_or::@3
(label) bool_or::@4
(label) bool_or::@5
(label) bool_or::@return
(byte) bool_or::i
(byte) bool_or::i#1 reg byte x 16.5
(byte) bool_or::i#2 reg byte x 11.0
(byte*) bool_or::screen
(const byte*) bool_or::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $428
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
reg byte y [ bool_complex::i#2 bool_complex::i#1 ]
reg byte x [ bool_not::i#2 bool_not::i#1 ]
reg byte x [ bool_or::i#2 bool_or::i#1 ]
reg byte x [ bool_and::i#2 bool_and::i#1 ]
reg byte x [ bool_complex::$1 ]
reg byte a [ bool_complex::$5 ]
reg byte a [ bool_not::$1 ]
reg byte a [ bool_or::$1 ]
reg byte a [ bool_and::$1 ]
program

@ -1,36 +1,39 @@
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@11
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@12
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@9
Culled Empty Block (label) main::@10
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(bool) framedone#0 ← true
to:@1
main: scope:[main] from @1
(bool) framedone#11 ← phi( @1/(bool) framedone#10 )
(bool) framedone#9 ← phi( @1/(bool) framedone#8 )
to:main::@1
main::@1: scope:[main] from main main::@6
(bool) framedone#9 ← phi( main/(bool) framedone#11 main::@6/(bool) framedone#1 )
if(true) goto main::@2
(bool) framedone#7 ← phi( main/(bool) framedone#9 main::@6/(bool) framedone#1 )
if(true) goto main::@4
to:main::@return
main::@2: scope:[main] from main::@1
(bool) framedone#7 ← phi( main::@1/(bool) framedone#9 )
to:main::@4
main::@4: scope:[main] from main::@2 main::@5
(bool) framedone#4 ← phi( main::@2/(bool) framedone#7 main::@5/(bool) framedone#8 )
main::@4: scope:[main] from main::@1 main::@4
(bool) framedone#4 ← phi( main::@1/(bool) framedone#7 main::@4/(bool) framedone#4 )
(bool~) main::$0 ← ! (bool) framedone#4
if((bool~) main::$0) goto main::@5
if((bool~) main::$0) goto main::@4
to:main::@6
main::@5: scope:[main] from main::@4
(bool) framedone#8 ← phi( main::@4/(bool) framedone#4 )
to:main::@4
main::@6: scope:[main] from main::@4
(bool) framedone#1 ← false
to:main::@1
main::@return: scope:[main] from main::@1
(bool) framedone#5 ← phi( main::@1/(bool) framedone#9 )
(bool) framedone#5 ← phi( main::@1/(bool) framedone#7 )
(bool) framedone#2 ← (bool) framedone#5
return
to:@return
@1: scope:[] from @begin
(bool) framedone#10 ← phi( @begin/(bool) framedone#0 )
(bool) framedone#8 ← phi( @begin/(bool) framedone#0 )
call main
to:@2
@2: scope:[] from @1
@ -47,8 +50,6 @@ SYMBOL TABLE SSA
(bool) framedone
(bool) framedone#0
(bool) framedone#1
(bool) framedone#10
(bool) framedone#11
(bool) framedone#2
(bool) framedone#3
(bool) framedone#4
@ -60,37 +61,29 @@ SYMBOL TABLE SSA
(void()) main()
(bool~) main::$0
(label) main::@1
(label) main::@2
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
Alias (bool) framedone#2 = (bool) framedone#7 (bool) framedone#9 (bool) framedone#5
Alias (bool) framedone#4 = (bool) framedone#8
Alias (bool) framedone#0 = (bool) framedone#10
Alias (bool) framedone#2 = (bool) framedone#5 (bool) framedone#7
Alias (bool) framedone#0 = (bool) framedone#8
Alias (bool) framedone#3 = (bool) framedone#6
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (bool) framedone#4
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (bool) framedone#11 (bool) framedone#0
Redundant Phi (bool) framedone#4 (bool) framedone#2
Redundant Phi (bool) framedone#3 (bool) framedone#2
Successful SSA optimization Pass2RedundantPhiElimination
Rewriting ! if()-condition to reversed if() [6] (bool~) main::$0 ← ! (bool) framedone#2
Identical Phi Values (bool) framedone#9 (bool) framedone#0
Identical Phi Values (bool) framedone#4 (bool) framedone#2
Identical Phi Values (bool) framedone#3 (bool) framedone#2
Successful SSA optimization Pass2IdenticalPhiElimination
Rewriting ! if()-condition to reversed if() [5] (bool~) main::$0 ← ! (bool) framedone#2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const bool) framedone#0 = true
Constant (const bool) framedone#1 = false
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [1] if(true) goto main::@2
if() condition always true - replacing block destination [3] if(true) goto main::@4
Successful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Inlining constant with var siblings (const bool) framedone#0
Inlining constant with var siblings (const bool) framedone#1
Constant inlined framedone#1 = false
@ -98,13 +91,17 @@ Constant inlined framedone#0 = true
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@6
CALL GRAPH
Calls in [] to main:2
Created 1 initial phi equivalence classes
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@6
Renumbering block main::@4 to main::@2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1

@ -1,10 +1 @@
(label) @1
(label) @begin
(label) @end
(bool) framedone
(bool) framedone#2 reg byte a 50.5
(void()) main()
(label) main::@1
(label) main::@2
reg byte a [ framedone#2 ]
program

@ -8,14 +8,14 @@
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *(((bool*))(word/signed word/dword/signed dword) $400) ← true
[5] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false
[6] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true
[7] if(*(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@1
[4] *((bool*) 1024) ← true
[5] *((bool*) 1024+(byte) 1) ← false
[6] *((bool*) 1024+(byte) 2) ← true
[7] if(*((bool*) 1024+(byte) 2)) goto main::@1
to:main::@return
main::@1: scope:[main] from main
[8] *((bool*) 1024+(byte) 3) ← true
to:main::@return
main::@return: scope:[main] from main main::@1
[8] return
[9] return
to:@return
main::@1: scope:[main] from main
[9] *(++((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true
to:main::@return

@ -1,25 +1,25 @@
Adding pointer type conversion cast (bool*) main::bscreen in (bool*) main::bscreen ← (number) $400
Culled Empty Block (label) main::@1
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @1
(bool*) main::bscreen#0 ← ((bool*)) (word/signed word/dword/signed dword) $400
*((bool*) main::bscreen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← true
*((bool*) main::bscreen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← false
(bool*~) main::$0 ← (bool*) main::bscreen#0 + (byte/signed byte/word/signed word/dword/signed dword) 2
(bool*) main::bscreen#0 ← ((bool*)) (number) $400
*((bool*) main::bscreen#0 + (number) 0) ← true
*((bool*) main::bscreen#0 + (number) 1) ← false
(bool*~) main::$0 ← (bool*) main::bscreen#0 + (number) 2
(bool*) main::bscreen#1 ← (bool*~) main::$0
*((bool*) main::bscreen#1) ← true
(bool~) main::$1 ← ! *((bool*) main::bscreen#1)
if((bool~) main::$1) goto main::@1
if((bool~) main::$1) goto main::@return
to:main::@2
main::@1: scope:[main] from main
to:main::@return
main::@2: scope:[main] from main
(bool*) main::bscreen#3 ← phi( main/(bool*) main::bscreen#1 )
(bool*) main::bscreen#2 ← ++ (bool*) main::bscreen#3
*((bool*) main::bscreen#2) ← true
to:main::@return
main::@return: scope:[main] from main::@1 main::@2
main::@return: scope:[main] from main main::@2
return
to:@return
@1: scope:[] from @begin
@ -37,7 +37,6 @@ SYMBOL TABLE SSA
(void()) main()
(bool*~) main::$0
(bool~) main::$1
(label) main::@1
(label) main::@2
(label) main::@return
(bool*) main::bscreen
@ -46,38 +45,58 @@ SYMBOL TABLE SSA
(bool*) main::bscreen#2
(bool*) main::bscreen#3
Culled Empty Block (label) main::@1
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) 0 in *((bool*) main::bscreen#0 + (number) 0) ← true
Adding number conversion cast (unumber) 1 in *((bool*) main::bscreen#0 + (number) 1) ← false
Adding number conversion cast (unumber) 2 in (bool*~) main::$0 ← (bool*) main::bscreen#0 + (number) 2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (bool*) main::bscreen#0 ← (bool*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (bool*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (bool*) main::bscreen#1 = (bool*~) main::$0 (bool*) main::bscreen#3
Successful SSA optimization Pass2AliasElimination
Rewriting ! if()-condition to reversed if() [6] (bool~) main::$1 ← ! *((bool*) main::bscreen#1)
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const bool*) main::bscreen#0 = ((bool*))$400
Constant (const bool*) main::bscreen#0 = (bool*) 1024
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::bscreen#0 in [1] *((const bool*) main::bscreen#0 + (byte) 0) ← true
Successful SSA optimization PassNSimplifyExpressionWithZero
Constant right-side identified [2] (bool*) main::bscreen#1 ← (const bool*) main::bscreen#0 + (byte) 2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const bool*) main::bscreen#1 = main::bscreen#0+2
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [4] (bool*) main::bscreen#2 ← ++ (const bool*) main::bscreen#1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const bool*) main::bscreen#2 = ++main::bscreen#1
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(main::bscreen#0+0)
Consolidated array index constant in *(main::bscreen#0+1)
Successful SSA optimization Pass2ConstantAdditionElimination
Inlining constant with different constant siblings (const bool*) main::bscreen#0
Inlining constant with different constant siblings (const bool*) main::bscreen#1
Inlining constant with different constant siblings (const bool*) main::bscreen#2
Constant inlined main::bscreen#2 = ++((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::bscreen#0 = ((bool*))(word/signed word/dword/signed dword) $400
Constant inlined main::bscreen#1 = ((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::bscreen#2 = ++(bool*) 1024+(byte) 2
Constant inlined main::bscreen#0 = (bool*) 1024
Constant inlined main::bscreen#1 = (bool*) 1024+(byte) 2
Successful SSA optimization Pass2ConstantInlining
Simplifying constant plus zero ((bool*))$400+0
Consolidated array index constant in *((bool*) 1024+1)
Successful SSA optimization Pass2ConstantAdditionElimination
Simplifying constant integer increment ++(bool*) 1024+2
Successful SSA optimization Pass2ConstantSimplification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Renumbering block main::@2 to main::@1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
@ -94,17 +113,17 @@ FINAL CONTROL FLOW GRAPH
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *(((bool*))(word/signed word/dword/signed dword) $400) ← true
[5] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false
[6] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true
[7] if(*(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@1
[4] *((bool*) 1024) ← true
[5] *((bool*) 1024+(byte) 1) ← false
[6] *((bool*) 1024+(byte) 2) ← true
[7] if(*((bool*) 1024+(byte) 2)) goto main::@1
to:main::@return
main::@1: scope:[main] from main
[8] *((bool*) 1024+(byte) 3) ← true
to:main::@return
main::@return: scope:[main] from main main::@1
[8] return
[9] return
to:@return
main::@1: scope:[main] from main
[9] *(++((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true
to:main::@return
VARIABLE REGISTER WEIGHTS
@ -138,38 +157,38 @@ bend_from_b1:
bend:
//SEG9 main
main: {
//SEG10 [4] *(((bool*))(word/signed word/dword/signed dword) $400) ← true -- _deref_pboc1=vboc2
//SEG10 [4] *((bool*) 1024) ← true -- _deref_pboc1=vboc2
lda #1
sta $400
//SEG11 [5] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false -- _deref_pboc1=vboc2
//SEG11 [5] *((bool*) 1024+(byte) 1) ← false -- _deref_pboc1=vboc2
lda #0
sta $400+1
//SEG12 [6] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true -- _deref_pboc1=vboc2
//SEG12 [6] *((bool*) 1024+(byte) 2) ← true -- _deref_pboc1=vboc2
lda #1
sta $400+2
//SEG13 [7] if(*(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@1 -- _deref_pboc1_then_la1
//SEG13 [7] if(*((bool*) 1024+(byte) 2)) goto main::@1 -- _deref_pboc1_then_la1
lda $400+2
cmp #0
bne b1
jmp breturn
//SEG14 main::@return
breturn:
//SEG15 [8] return
rts
//SEG16 main::@1
//SEG14 main::@1
b1:
//SEG17 [9] *(++((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true -- _deref_pboc1=vboc2
//SEG15 [8] *((bool*) 1024+(byte) 3) ← true -- _deref_pboc1=vboc2
lda #1
sta $400+2+1
sta $400+3
jmp breturn
//SEG16 main::@return
breturn:
//SEG17 [9] return
rts
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *(((bool*))(word/signed word/dword/signed dword) $400) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] if(*(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *(++((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] *((bool*) 1024) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((bool*) 1024+(byte) 1) ← false [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((bool*) 1024+(byte) 2) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] if(*((bool*) 1024+(byte) 2)) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((bool*) 1024+(byte) 3) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
@ -202,30 +221,30 @@ bend_from_b1:
bend:
//SEG9 main
main: {
//SEG10 [4] *(((bool*))(word/signed word/dword/signed dword) $400) ← true -- _deref_pboc1=vboc2
//SEG10 [4] *((bool*) 1024) ← true -- _deref_pboc1=vboc2
lda #1
sta $400
//SEG11 [5] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false -- _deref_pboc1=vboc2
//SEG11 [5] *((bool*) 1024+(byte) 1) ← false -- _deref_pboc1=vboc2
lda #0
sta $400+1
//SEG12 [6] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true -- _deref_pboc1=vboc2
//SEG12 [6] *((bool*) 1024+(byte) 2) ← true -- _deref_pboc1=vboc2
lda #1
sta $400+2
//SEG13 [7] if(*(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@1 -- _deref_pboc1_then_la1
//SEG13 [7] if(*((bool*) 1024+(byte) 2)) goto main::@1 -- _deref_pboc1_then_la1
lda $400+2
cmp #0
bne b1
jmp breturn
//SEG14 main::@return
breturn:
//SEG15 [8] return
rts
//SEG16 main::@1
//SEG14 main::@1
b1:
//SEG17 [9] *(++((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true -- _deref_pboc1=vboc2
//SEG15 [8] *((bool*) 1024+(byte) 3) ← true -- _deref_pboc1=vboc2
lda #1
sta $400+2+1
sta $400+3
jmp breturn
//SEG16 main::@return
breturn:
//SEG17 [9] return
rts
}
ASSEMBLER OPTIMIZATIONS
@ -279,26 +298,26 @@ Score: 40
//SEG8 @end
//SEG9 main
main: {
//SEG10 [4] *(((bool*))(word/signed word/dword/signed dword) $400) ← true -- _deref_pboc1=vboc2
//SEG10 [4] *((bool*) 1024) ← true -- _deref_pboc1=vboc2
lda #1
sta $400
//SEG11 [5] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 1) ← false -- _deref_pboc1=vboc2
//SEG11 [5] *((bool*) 1024+(byte) 1) ← false -- _deref_pboc1=vboc2
lda #0
sta $400+1
//SEG12 [6] *(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true -- _deref_pboc1=vboc2
//SEG12 [6] *((bool*) 1024+(byte) 2) ← true -- _deref_pboc1=vboc2
lda #1
sta $400+2
//SEG13 [7] if(*(((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2)) goto main::@1 -- _deref_pboc1_then_la1
//SEG13 [7] if(*((bool*) 1024+(byte) 2)) goto main::@1 -- _deref_pboc1_then_la1
cmp #0
bne b1
//SEG14 main::@return
//SEG15 [8] return
rts
//SEG16 main::@1
//SEG14 main::@1
b1:
//SEG17 [9] *(++((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true -- _deref_pboc1=vboc2
//SEG15 [8] *((bool*) 1024+(byte) 3) ← true -- _deref_pboc1=vboc2
lda #1
sta $400+2+1
sta $400+3
//SEG16 main::@return
//SEG17 [9] return
rts
}

@ -1,8 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@return
(bool*) main::bscreen
program

@ -30,51 +30,51 @@ bool_complex: scope:[bool_complex] from main::@3
[13] phi()
to:bool_complex::@1
bool_complex::@1: scope:[bool_complex] from bool_complex bool_complex::@3
[14] (byte) bool_complex::i#2 ← phi( bool_complex/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_complex::@3/(byte) bool_complex::i#1 )
[15] (bool) bool_complex::o1#0 ← (byte) bool_complex::i#2 < (byte/signed byte/word/signed word/dword/signed dword) $a
[16] (byte~) bool_complex::$1 ← (byte) bool_complex::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[17] (bool) bool_complex::o2#0 ← (byte~) bool_complex::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0
[14] (byte) bool_complex::i#2 ← phi( bool_complex/(byte) 0 bool_complex::@3/(byte) bool_complex::i#1 )
[15] (bool) bool_complex::o1#0 ← (byte) bool_complex::i#2 < (byte) $a
[16] (byte~) bool_complex::$1 ← (byte) bool_complex::i#2 & (byte) 1
[17] (bool) bool_complex::o2#0 ← (byte~) bool_complex::$1 == (byte) 0
[18] if((bool) bool_complex::o1#0) goto bool_complex::@6
to:bool_complex::@5
bool_complex::@6: scope:[bool_complex] from bool_complex::@1
[19] if((bool) bool_complex::o2#0) goto bool_complex::@2
to:bool_complex::@5
bool_complex::@5: scope:[bool_complex] from bool_complex::@1 bool_complex::@6
[19] if((bool) bool_complex::o1#0) goto bool_complex::@4
[20] if((bool) bool_complex::o1#0) goto bool_complex::@4
to:bool_complex::@7
bool_complex::@7: scope:[bool_complex] from bool_complex::@5
[20] if((bool) bool_complex::o2#0) goto bool_complex::@4
[21] if((bool) bool_complex::o2#0) goto bool_complex::@4
to:bool_complex::@2
bool_complex::@2: scope:[bool_complex] from bool_complex::@6 bool_complex::@7
[21] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) '*'
[22] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) '*'
to:bool_complex::@3
bool_complex::@3: scope:[bool_complex] from bool_complex::@2 bool_complex::@4
[22] (byte) bool_complex::i#1 ← ++ (byte) bool_complex::i#2
[23] if((byte) bool_complex::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $15) goto bool_complex::@1
[23] (byte) bool_complex::i#1 ← ++ (byte) bool_complex::i#2
[24] if((byte) bool_complex::i#1!=(byte) $15) goto bool_complex::@1
to:bool_complex::@return
bool_complex::@return: scope:[bool_complex] from bool_complex::@3
[24] return
[25] return
to:@return
bool_complex::@4: scope:[bool_complex] from bool_complex::@5 bool_complex::@7
[25] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) ' '
[26] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) ' '
to:bool_complex::@3
bool_complex::@6: scope:[bool_complex] from bool_complex::@1
[26] if((bool) bool_complex::o2#0) goto bool_complex::@2
to:bool_complex::@5
bool_not: scope:[bool_not] from main::@2
[27] phi()
to:bool_not::@1
bool_not::@1: scope:[bool_not] from bool_not bool_not::@3
[28] (byte) bool_not::i#2 ← phi( bool_not/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_not::@3/(byte) bool_not::i#1 )
[29] (byte~) bool_not::$1 ← (byte) bool_not::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[30] if((byte) bool_not::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto bool_not::@4
[28] (byte) bool_not::i#2 ← phi( bool_not/(byte) 0 bool_not::@3/(byte) bool_not::i#1 )
[29] (byte~) bool_not::$1 ← (byte) bool_not::i#2 & (byte) 1
[30] if((byte) bool_not::i#2<(byte) $a) goto bool_not::@4
to:bool_not::@5
bool_not::@5: scope:[bool_not] from bool_not::@1
[31] if((byte~) bool_not::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_not::@4
[31] if((byte~) bool_not::$1==(byte) 0) goto bool_not::@4
to:bool_not::@2
bool_not::@2: scope:[bool_not] from bool_not::@5
[32] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) '*'
to:bool_not::@3
bool_not::@3: scope:[bool_not] from bool_not::@2 bool_not::@4
[33] (byte) bool_not::i#1 ← ++ (byte) bool_not::i#2
[34] if((byte) bool_not::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $15) goto bool_not::@1
[34] if((byte) bool_not::i#1!=(byte) $15) goto bool_not::@1
to:bool_not::@return
bool_not::@return: scope:[bool_not] from bool_not::@3
[35] return
@ -86,19 +86,19 @@ bool_or: scope:[bool_or] from main::@1
[37] phi()
to:bool_or::@1
bool_or::@1: scope:[bool_or] from bool_or bool_or::@3
[38] (byte) bool_or::i#2 ← phi( bool_or/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_or::@3/(byte) bool_or::i#1 )
[39] (byte~) bool_or::$1 ← (byte) bool_or::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[40] if((byte) bool_or::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto bool_or::@2
[38] (byte) bool_or::i#2 ← phi( bool_or/(byte) 0 bool_or::@3/(byte) bool_or::i#1 )
[39] (byte~) bool_or::$1 ← (byte) bool_or::i#2 & (byte) 1
[40] if((byte) bool_or::i#2<(byte) $a) goto bool_or::@2
to:bool_or::@5
bool_or::@5: scope:[bool_or] from bool_or::@1
[41] if((byte~) bool_or::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_or::@2
[41] if((byte~) bool_or::$1==(byte) 0) goto bool_or::@2
to:bool_or::@4
bool_or::@4: scope:[bool_or] from bool_or::@5
[42] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) ' '
to:bool_or::@3
bool_or::@3: scope:[bool_or] from bool_or::@2 bool_or::@4
[43] (byte) bool_or::i#1 ← ++ (byte) bool_or::i#2
[44] if((byte) bool_or::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $15) goto bool_or::@1
[44] if((byte) bool_or::i#1!=(byte) $15) goto bool_or::@1
to:bool_or::@return
bool_or::@return: scope:[bool_or] from bool_or::@3
[45] return
@ -110,23 +110,23 @@ bool_and: scope:[bool_and] from main
[47] phi()
to:bool_and::@1
bool_and::@1: scope:[bool_and] from bool_and bool_and::@3
[48] (byte) bool_and::i#2 ← phi( bool_and/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_and::@3/(byte) bool_and::i#1 )
[49] (byte~) bool_and::$1 ← (byte) bool_and::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[50] if((byte) bool_and::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto bool_and::@5
[48] (byte) bool_and::i#2 ← phi( bool_and/(byte) 0 bool_and::@3/(byte) bool_and::i#1 )
[49] (byte~) bool_and::$1 ← (byte) bool_and::i#2 & (byte) 1
[50] if((byte) bool_and::i#2>=(byte) $a) goto bool_and::@4
to:bool_and::@5
bool_and::@5: scope:[bool_and] from bool_and::@1
[51] if((byte~) bool_and::$1==(byte) 0) goto bool_and::@2
to:bool_and::@4
bool_and::@4: scope:[bool_and] from bool_and::@1 bool_and::@5
[51] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) ' '
[52] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) ' '
to:bool_and::@3
bool_and::@3: scope:[bool_and] from bool_and::@2 bool_and::@4
[52] (byte) bool_and::i#1 ← ++ (byte) bool_and::i#2
[53] if((byte) bool_and::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $15) goto bool_and::@1
[53] (byte) bool_and::i#1 ← ++ (byte) bool_and::i#2
[54] if((byte) bool_and::i#1!=(byte) $15) goto bool_and::@1
to:bool_and::@return
bool_and::@return: scope:[bool_and] from bool_and::@3
[54] return
[55] return
to:@return
bool_and::@5: scope:[bool_and] from bool_and::@1
[55] if((byte~) bool_and::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_and::@2
to:bool_and::@4
bool_and::@2: scope:[bool_and] from bool_and::@5
[56] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) '*'
to:bool_and::@3

File diff suppressed because it is too large Load Diff

@ -1,89 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) bool_and()
(byte~) bool_and::$1 reg byte a 11.0
(label) bool_and::@1
(label) bool_and::@2
(label) bool_and::@3
(label) bool_and::@4
(label) bool_and::@5
(label) bool_and::@return
(byte) bool_and::i
(byte) bool_and::i#1 reg byte x 16.5
(byte) bool_and::i#2 reg byte x 11.0
(bool) bool_and::o1
(bool) bool_and::o2
(bool) bool_and::o3
(byte*) bool_and::screen
(const byte*) bool_and::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
(void()) bool_complex()
(byte~) bool_complex::$1 reg byte a 22.0
(label) bool_complex::@1
(label) bool_complex::@2
(label) bool_complex::@3
(label) bool_complex::@4
(label) bool_complex::@5
(label) bool_complex::@6
(label) bool_complex::@7
(label) bool_complex::@return
(byte) bool_complex::i
(byte) bool_complex::i#1 reg byte x 16.5
(byte) bool_complex::i#2 reg byte x 6.6
(bool) bool_complex::o1
(bool) bool_complex::o1#0 o1 zp ZP_BOOL:2 6.6000000000000005
(bool) bool_complex::o2
(bool) bool_complex::o2#0 o2 zp ZP_BOOL:3 8.25
(bool) bool_complex::o3
(bool) bool_complex::o4
(bool) bool_complex::o5
(byte*) bool_complex::screen
(const byte*) bool_complex::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $478
(void()) bool_not()
(byte~) bool_not::$1 reg byte a 11.0
(label) bool_not::@1
(label) bool_not::@2
(label) bool_not::@3
(label) bool_not::@4
(label) bool_not::@5
(label) bool_not::@return
(byte) bool_not::i
(byte) bool_not::i#1 reg byte x 16.5
(byte) bool_not::i#2 reg byte x 11.0
(bool) bool_not::o1
(bool) bool_not::o2
(bool) bool_not::o3
(byte*) bool_not::screen
(const byte*) bool_not::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $450
(void()) bool_or()
(byte~) bool_or::$1 reg byte a 11.0
(label) bool_or::@1
(label) bool_or::@2
(label) bool_or::@3
(label) bool_or::@4
(label) bool_or::@5
(label) bool_or::@return
(byte) bool_or::i
(byte) bool_or::i#1 reg byte x 16.5
(byte) bool_or::i#2 reg byte x 11.0
(bool) bool_or::o1
(bool) bool_or::o2
(bool) bool_or::o3
(byte*) bool_or::screen
(const byte*) bool_or::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $428
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
reg byte x [ bool_complex::i#2 bool_complex::i#1 ]
reg byte x [ bool_not::i#2 bool_not::i#1 ]
reg byte x [ bool_or::i#2 bool_or::i#1 ]
reg byte x [ bool_and::i#2 bool_and::i#1 ]
zp ZP_BOOL:2 [ bool_complex::o1#0 ]
reg byte a [ bool_complex::$1 ]
zp ZP_BOOL:3 [ bool_complex::o2#0 ]
reg byte a [ bool_not::$1 ]
reg byte a [ bool_or::$1 ]
reg byte a [ bool_and::$1 ]
program

@ -12,25 +12,25 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@2
[5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 )
[5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 )
[5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte) 2 main::@2/(byte) main::e#5 )
[5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 )
[5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0 main::@2/(byte*) main::cursor#5 )
[5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 main::@2/(byte*) main::cursor#5 )
[6] *((byte*) main::cursor#3) ← (const byte) STAR#0
[7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
[8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
[7] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1
[8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte) 1
[9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0
[10] if((const byte) main::xd#0>(byte) main::e#1) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@1
[11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
[12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte/signed byte/word/signed word/dword/signed dword) $28
[11] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1
[12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28
[13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[14] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 )
[14] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
[14] (byte*) main::cursor#5 ← phi( main::@1/(byte*) main::cursor#1 main::@3/(byte*) main::cursor#2 )
[15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
[15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@2
[16] return

@ -1,30 +1,32 @@
Adding pointer type conversion cast (byte[$0]) SCREEN in (byte[$0]) SCREEN ← (number) $400
Identified constant variable (byte) STAR
Identified constant variable (byte) main::x0
Identified constant variable (byte) main::y0
Identified constant variable (byte) main::x1
Identified constant variable (byte) main::y1
Culled Empty Block (label) main::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte) STAR#0 ← (byte/signed byte/word/signed word/dword/signed dword) $51
(word/signed word/dword/signed dword~) $0 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $19
(byte[$0]) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte) STAR#0 ← (number) $51
(number~) $0 ← (number) $28 * (number) $19
(byte[$0]) SCREEN#0 ← ((byte*)) (number) $400
to:@1
main: scope:[main] from @1
(byte) main::x0#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) main::y0#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) main::x1#0 ← (byte/signed byte/word/signed word/dword/signed dword) $27
(byte) main::y1#0 ← (byte/signed byte/word/signed word/dword/signed dword) $18
(byte) main::x0#0 ← (number) 4
(byte) main::y0#0 ← (number) 4
(byte) main::x1#0 ← (number) $27
(byte) main::y1#0 ← (number) $18
(byte~) main::$0 ← (byte) main::x1#0 - (byte) main::x0#0
(byte) main::xd#0 ← (byte~) main::$0
(byte~) main::$1 ← (byte) main::y1#0 - (byte) main::y0#0
(byte) main::yd#0 ← (byte~) main::$1
(byte) main::x#0 ← (byte) main::x0#0
(byte) main::y#0 ← (byte) main::y0#0
(byte/signed word/word/dword/signed dword~) main::$2 ← (byte) main::yd#0 / (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) main::e#0 ← (byte/signed word/word/dword/signed dword~) main::$2
(byte/signed word/word/dword/signed dword~) main::$3 ← (byte) main::y#0 * (byte/signed byte/word/signed word/dword/signed dword) $28
(byte*~) main::$4 ← (byte[$0]) SCREEN#0 + (byte/signed word/word/dword/signed dword~) main::$3
(number~) main::$2 ← (byte) main::yd#0 / (number) 2
(byte) main::e#0 ← (number~) main::$2
(number~) main::$3 ← (byte) main::y#0 * (number) $28
(byte*~) main::$4 ← (byte[$0]) SCREEN#0 + (number~) main::$3
(byte*~) main::$5 ← (byte*~) main::$4 + (byte) main::x#0
(byte*) main::cursor#0 ← (byte*~) main::$5
to:main::@1
@ -36,9 +38,9 @@ main::@1: scope:[main] from main main::@2
(byte) main::x#2 ← phi( main/(byte) main::x#0 main::@2/(byte) main::x#3 )
(byte*) main::cursor#3 ← phi( main/(byte*) main::cursor#0 main::@2/(byte*) main::cursor#5 )
*((byte*) main::cursor#3) ← (byte) STAR#0
(byte/signed word/word/dword/signed dword~) main::$6 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::x#1 ← (byte/signed word/word/dword/signed dword~) main::$6
(byte*~) main::$7 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
(number~) main::$6 ← (byte) main::x#2 + (number) 1
(byte) main::x#1 ← (number~) main::$6
(byte*~) main::$7 ← (byte*) main::cursor#3 + (number) 1
(byte*) main::cursor#1 ← (byte*~) main::$7
(byte~) main::$8 ← (byte) main::e#3 + (byte) main::yd#1
(byte) main::e#1 ← (byte~) main::$8
@ -53,8 +55,8 @@ main::@2: scope:[main] from main::@1 main::@3
(byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
(byte*) main::cursor#5 ← phi( main::@1/(byte*) main::cursor#1 main::@3/(byte*) main::cursor#2 )
(byte) main::x#3 ← phi( main::@1/(byte) main::x#1 main::@3/(byte) main::x#4 )
(byte/signed word/word/dword/signed dword~) main::$14 ← (byte) main::x1#0 + (byte/signed byte/word/signed word/dword/signed dword) 1
(bool~) main::$15 ← (byte) main::x#3 < (byte/signed word/word/dword/signed dword~) main::$14
(number~) main::$14 ← (byte) main::x1#0 + (number) 1
(bool~) main::$15 ← (byte) main::x#3 < (number~) main::$14
if((bool~) main::$15) goto main::@1
to:main::@return
main::@3: scope:[main] from main::@1
@ -64,9 +66,9 @@ main::@3: scope:[main] from main::@1
(byte) main::e#4 ← phi( main::@1/(byte) main::e#1 )
(byte*) main::cursor#4 ← phi( main::@1/(byte*) main::cursor#1 )
(byte) main::y#2 ← phi( main::@1/(byte) main::y#3 )
(byte/signed word/word/dword/signed dword~) main::$11 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::y#1 ← (byte/signed word/word/dword/signed dword~) main::$11
(byte*~) main::$12 ← (byte*) main::cursor#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
(number~) main::$11 ← (byte) main::y#2 + (number) 1
(byte) main::y#1 ← (number~) main::$11
(byte*~) main::$12 ← (byte*) main::cursor#4 + (number) $28
(byte*) main::cursor#2 ← (byte*~) main::$12
(byte~) main::$13 ← (byte) main::e#4 - (byte) main::xd#2
(byte) main::e#2 ← (byte~) main::$13
@ -82,7 +84,7 @@ main::@return: scope:[main] from main::@2
@end: scope:[] from @2
SYMBOL TABLE SSA
(word/signed word/dword/signed dword~) $0
(number~) $0
(label) @1
(label) @2
(label) @begin
@ -95,16 +97,16 @@ SYMBOL TABLE SSA
(byte~) main::$0
(byte~) main::$1
(bool~) main::$10
(byte/signed word/word/dword/signed dword~) main::$11
(number~) main::$11
(byte*~) main::$12
(byte~) main::$13
(byte/signed word/word/dword/signed dword~) main::$14
(number~) main::$14
(bool~) main::$15
(byte/signed word/word/dword/signed dword~) main::$2
(byte/signed word/word/dword/signed dword~) main::$3
(number~) main::$2
(number~) main::$3
(byte*~) main::$4
(byte*~) main::$5
(byte/signed word/word/dword/signed dword~) main::$6
(number~) main::$6
(byte*~) main::$7
(byte~) main::$8
(bool~) main::$9
@ -157,23 +159,78 @@ SYMBOL TABLE SSA
(byte) main::yd#2
(byte) main::yd#3
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) $51 in (byte) STAR#0 ← (number) $51
Adding number conversion cast (unumber) 4 in (byte) main::x0#0 ← (number) 4
Adding number conversion cast (unumber) 4 in (byte) main::y0#0 ← (number) 4
Adding number conversion cast (unumber) $27 in (byte) main::x1#0 ← (number) $27
Adding number conversion cast (unumber) $18 in (byte) main::y1#0 ← (number) $18
Adding number conversion cast (unumber) 2 in (number~) main::$2 ← (byte) main::yd#0 / (number) 2
Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte) main::yd#0 / (unumber)(number) 2
Adding number conversion cast (unumber) $28 in (number~) main::$3 ← (byte) main::y#0 * (number) $28
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte) main::y#0 * (unumber)(number) $28
Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (byte) main::x#2 + (number) 1
Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (byte) main::x#2 + (unumber)(number) 1
Adding number conversion cast (unumber) 1 in (byte*~) main::$7 ← (byte*) main::cursor#3 + (number) 1
Adding number conversion cast (unumber) 1 in (number~) main::$14 ← (byte) main::x1#0 + (number) 1
Adding number conversion cast (unumber) main::$14 in (number~) main::$14 ← (byte) main::x1#0 + (unumber)(number) 1
Adding number conversion cast (unumber) 1 in (number~) main::$11 ← (byte) main::y#2 + (number) 1
Adding number conversion cast (unumber) main::$11 in (number~) main::$11 ← (byte) main::y#2 + (unumber)(number) 1
Adding number conversion cast (unumber) $28 in (byte*~) main::$12 ← (byte*) main::cursor#4 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) STAR#0 ← (unumber)(number) $51
Inlining cast (byte[$0]) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) main::x0#0 ← (unumber)(number) 4
Inlining cast (byte) main::y0#0 ← (unumber)(number) 4
Inlining cast (byte) main::x1#0 ← (unumber)(number) $27
Inlining cast (byte) main::y1#0 ← (unumber)(number) $18
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast $51
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $27
Simplifying constant integer cast $18
Simplifying constant integer cast 2
Simplifying constant integer cast $28
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $51
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $27
Finalized unsigned number type (byte) $18
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $28
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$2 ← (byte) main::yd#0 / (byte) 2
Inferred type updated to byte in (unumber~) main::$3 ← (byte) main::y#0 * (byte) $28
Inferred type updated to byte in (unumber~) main::$6 ← (byte) main::x#2 + (byte) 1
Inferred type updated to byte in (unumber~) main::$14 ← (byte) main::x1#0 + (byte) 1
Inferred type updated to byte in (unumber~) main::$11 ← (byte) main::y#2 + (byte) 1
Inversing boolean not [28] (bool~) main::$10 ← (byte) main::xd#1 > (byte) main::e#1 from [27] (bool~) main::$9 ← (byte) main::xd#1 <= (byte) main::e#1
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte) main::xd#0 = (byte~) main::$0
Alias (byte) main::yd#0 = (byte~) main::$1
Alias (byte) main::x0#0 = (byte) main::x#0
Alias (byte) main::y0#0 = (byte) main::y#0
Alias (byte) main::e#0 = (byte/signed word/word/dword/signed dword~) main::$2
Alias (byte) main::e#0 = (byte~) main::$2
Alias (byte*) main::cursor#0 = (byte*~) main::$5
Alias (byte) main::x#1 = (byte/signed word/word/dword/signed dword~) main::$6 (byte) main::x#4
Alias (byte) main::x#1 = (byte~) main::$6 (byte) main::x#4
Alias (byte*) main::cursor#1 = (byte*~) main::$7 (byte*) main::cursor#4
Alias (byte) main::e#1 = (byte~) main::$8 (byte) main::e#4
Alias (byte) main::y#2 = (byte) main::y#3
Alias (byte) main::xd#1 = (byte) main::xd#2
Alias (byte) main::yd#1 = (byte) main::yd#3
Alias (byte) main::y#1 = (byte/signed word/word/dword/signed dword~) main::$11
Alias (byte) main::y#1 = (byte~) main::$11
Alias (byte*) main::cursor#2 = (byte*~) main::$12
Alias (byte) main::e#2 = (byte~) main::$13
Successful SSA optimization Pass2AliasElimination
@ -184,60 +241,74 @@ Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) main::yd#1
Self Phi Eliminated (byte) main::xd#1
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte) main::yd#1 (byte) main::yd#0
Redundant Phi (byte) main::xd#1 (byte) main::xd#0
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte) main::yd#1 (byte) main::yd#0
Identical Phi Values (byte) main::xd#1 (byte) main::xd#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$10 [29] if((byte) main::xd#0>(byte) main::e#1) goto main::@2
Simple Condition (bool~) main::$15 [33] if((byte) main::x#1<(byte/signed word/word/dword/signed dword~) main::$14) goto main::@1
Simple Condition (bool~) main::$15 [33] if((byte) main::x#1<(byte~) main::$14) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [1] (number~) $0 ← (number) $28 * (number) $19
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) STAR#0 = $51
Constant (const word/signed word/dword/signed dword) $0 = $28*$19
Constant (const byte[$0]) SCREEN#0 = ((byte*))$400
Constant (const number) $0 = $28*$19
Constant (const byte[$0]) SCREEN#0 = (byte*) 1024
Constant (const byte) main::x0#0 = 4
Constant (const byte) main::y0#0 = 4
Constant (const byte) main::x1#0 = $27
Constant (const byte) main::y1#0 = $18
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [0] (byte) main::xd#0 ← (const byte) main::x1#0 - (const byte) main::x0#0
Constant right-side identified [1] (byte) main::yd#0 ← (const byte) main::y1#0 - (const byte) main::y0#0
Constant right-side identified [3] (byte~) main::$3 ← (const byte) main::y0#0 * (byte) $28
Constant right-side identified [13] (byte~) main::$14 ← (const byte) main::x1#0 + (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::xd#0 = main::x1#0-main::x0#0
Constant (const byte) main::yd#0 = main::y1#0-main::y0#0
Constant (const byte/signed word/word/dword/signed dword) main::$3 = main::y0#0*$28
Constant (const byte/signed word/word/dword/signed dword) main::$14 = main::x1#0+1
Constant (const byte) main::$3 = main::y0#0*$28
Constant (const byte) main::$14 = main::x1#0+1
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [0] (byte) main::e#0 ← (const byte) main::yd#0 / (byte) 2
Constant right-side identified [1] (byte*~) main::$4 ← (const byte[$0]) SCREEN#0 + (const byte) main::$3
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::e#0 = main::yd#0/2
Constant (const byte*) main::$4 = SCREEN#0+main::$3
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [0] (byte*) main::cursor#0 ← (const byte*) main::$4 + (const byte) main::x0#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::cursor#0 = main::$4+main::x0#0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte) main::e#0
Inlining constant with var siblings (const byte*) main::cursor#0
Constant inlined main::$3 = (const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28
Constant inlined main::$14 = (const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$4 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28
Constant inlined $0 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $19
Constant inlined main::e#0 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::cursor#0 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0
Constant inlined main::$3 = (const byte) main::y0#0*(byte) $28
Constant inlined main::$14 = (const byte) main::x1#0+(byte) 1
Constant inlined main::$4 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte) $28
Constant inlined $0 = (number) $28*(number) $19
Constant inlined main::e#0 = (const byte) main::yd#0/(byte) 2
Constant inlined main::cursor#0 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@5(between main::@2 and main::@1)
Added new block during phi lifting main::@6(between main::@1 and main::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Created 7 initial phi equivalence classes
Coalesced [14] main::cursor#8 ← main::cursor#2
Coalesced [15] main::e#8 ← main::e#2
Coalesced [16] main::y#7 ← main::y#1
Coalesced [20] main::cursor#6 ← main::cursor#5
Coalesced [21] main::x#5 ← main::x#1
Coalesced [22] main::e#6 ← main::e#5
Coalesced [23] main::y#5 ← main::y#4
Coalesced [24] main::cursor#7 ← main::cursor#1
Coalesced [25] main::e#7 ← main::e#1
Coalesced (already) [26] main::y#6 ← main::y#2
Coalesced [15] main::cursor#8 ← main::cursor#2
Coalesced [16] main::e#8 ← main::e#2
Coalesced [17] main::y#7 ← main::y#1
Coalesced [21] main::cursor#6 ← main::cursor#5
Coalesced [22] main::x#5 ← main::x#1
Coalesced [23] main::e#6 ← main::e#5
Coalesced [24] main::y#5 ← main::y#4
Coalesced [25] main::cursor#7 ← main::cursor#1
Coalesced [26] main::e#7 ← main::e#1
Coalesced (already) [27] main::y#6 ← main::y#2
Coalesced down to 4 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Adding NOP phi() at start of @begin
@ -260,25 +331,25 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@2
[5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 )
[5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 )
[5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte) 2 main::@2/(byte) main::e#5 )
[5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 )
[5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0 main::@2/(byte*) main::cursor#5 )
[5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 main::@2/(byte*) main::cursor#5 )
[6] *((byte*) main::cursor#3) ← (const byte) STAR#0
[7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
[8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
[7] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1
[8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte) 1
[9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0
[10] if((const byte) main::xd#0>(byte) main::e#1) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@1
[11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
[12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte/signed byte/word/signed word/dword/signed dword) $28
[11] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1
[12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28
[13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[14] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 )
[14] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
[14] (byte*) main::cursor#5 ← phi( main::@1/(byte*) main::cursor#1 main::@3/(byte*) main::cursor#2 )
[15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
[15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@2
[16] return
@ -370,13 +441,13 @@ main: {
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #y0
sta y
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1
lda #yd/2
sta e
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #x0
sta x
//SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1
//SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1
lda #<SCREEN+y0*$28+x0
sta cursor
lda #>SCREEN+y0*$28+x0
@ -395,9 +466,9 @@ main: {
lda #STAR
ldy #0
sta (cursor),y
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc x
//SEG24 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- pbuz1=pbuz1_plus_1
//SEG24 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte) 1 -- pbuz1=pbuz1_plus_1
inc cursor
bne !+
inc cursor+1
@ -413,9 +484,9 @@ main: {
jmp b3
//SEG27 main::@3
b3:
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc y
//SEG29 [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG29 [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cursor
@ -436,7 +507,7 @@ main: {
jmp b2
//SEG35 main::@2
b2:
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #x1+1
bcc b1_from_b2
@ -458,14 +529,14 @@ Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ ma
Statement [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::cursor#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::cursor#1 main::e#1 ] ) always clobbers reg byte a reg byte x
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
Statement [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ) always clobbers reg byte a
Statement [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ) always clobbers reg byte a
Statement [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::cursor#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::cursor#2 main::e#2 ] ) always clobbers reg byte a reg byte x
Statement [15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
Statement [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
Statement [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y
Statement [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::cursor#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::cursor#1 main::e#1 ] ) always clobbers reg byte a reg byte x
Statement [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ) always clobbers reg byte a
Statement [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::cursor#2 ] ) always clobbers reg byte a
Statement [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::cursor#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::cursor#2 main::e#2 ] ) always clobbers reg byte a reg byte x
Statement [15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
Statement [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::cursor#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
Potential registers zp ZP_WORD:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_BYTE:4 [ main::x#2 main::x#1 ] : zp ZP_BYTE:4 ,
Potential registers zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] : zp ZP_BYTE:5 , reg byte x ,
@ -524,12 +595,12 @@ main: {
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #y0
sta y
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #yd/2
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #x0
sta x
//SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1
//SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1
lda #<SCREEN+y0*$28+x0
sta cursor
lda #>SCREEN+y0*$28+x0
@ -548,9 +619,9 @@ main: {
lda #STAR
ldy #0
sta (cursor),y
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc x
//SEG24 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- pbuz1=pbuz1_plus_1
//SEG24 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte) 1 -- pbuz1=pbuz1_plus_1
inc cursor
bne !+
inc cursor+1
@ -564,9 +635,9 @@ main: {
jmp b3
//SEG27 main::@3
b3:
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc y
//SEG29 [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG29 [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cursor
@ -586,7 +657,7 @@ main: {
jmp b2
//SEG35 main::@2
b2:
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #x1+1
bcc b1_from_b2
@ -633,9 +704,9 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte[$28*$19]) SCREEN
(const byte[$28*$19]) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(const byte[$28*$19]) SCREEN#0 SCREEN = (byte*) 1024
(byte) STAR
(const byte) STAR#0 STAR = (byte/signed byte/word/signed word/dword/signed dword) $51
(const byte) STAR#0 STAR = (byte) $51
(void()) main()
(label) main::@1
(label) main::@2
@ -655,9 +726,9 @@ FINAL SYMBOL TABLE
(byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667
(byte) main::x#2 x zp ZP_BYTE:4 11.0
(byte) main::x0
(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 4
(const byte) main::x0#0 x0 = (byte) 4
(byte) main::x1
(const byte) main::x1#0 x1 = (byte/signed byte/word/signed word/dword/signed dword) $27
(const byte) main::x1#0 x1 = (byte) $27
(byte) main::xd
(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0
(byte) main::y
@ -665,9 +736,9 @@ FINAL SYMBOL TABLE
(byte) main::y#2 y zp ZP_BYTE:5 5.5
(byte) main::y#4 y zp ZP_BYTE:5 16.5
(byte) main::y0
(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 4
(const byte) main::y0#0 y0 = (byte) 4
(byte) main::y1
(const byte) main::y1#0 y1 = (byte/signed byte/word/signed word/dword/signed dword) $18
(const byte) main::y1#0 y1 = (byte) $18
(byte) main::yd
(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0
@ -710,12 +781,12 @@ main: {
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #y0
sta y
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #yd/2
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #x0
sta x
//SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1
//SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte) $28+(const byte) main::x0#0 [phi:main->main::@1#3] -- pbuz1=pbuc1
lda #<SCREEN+y0*$28+x0
sta cursor
lda #>SCREEN+y0*$28+x0
@ -731,9 +802,9 @@ main: {
lda #STAR
ldy #0
sta (cursor),y
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc x
//SEG24 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- pbuz1=pbuz1_plus_1
//SEG24 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte) 1 -- pbuz1=pbuz1_plus_1
inc cursor
bne !+
inc cursor+1
@ -745,9 +816,9 @@ main: {
cpx #xd
bcc b2
//SEG27 main::@3
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc y
//SEG29 [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG29 [12] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc cursor
@ -764,7 +835,7 @@ main: {
//SEG34 [14] phi (byte*) main::cursor#5 = (byte*) main::cursor#1 [phi:main::@1/main::@3->main::@2#2] -- register_copy
//SEG35 main::@2
b2:
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #x1+1
bcc b1

@ -1,46 +1 @@
(label) @1
(label) @begin
(label) @end
(byte[$28*$19]) SCREEN
(const byte[$28*$19]) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte) STAR
(const byte) STAR#0 STAR = (byte/signed byte/word/signed word/dword/signed dword) $51
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte*) main::cursor
(byte*) main::cursor#1 cursor zp ZP_WORD:2 8.25
(byte*) main::cursor#2 cursor zp ZP_WORD:2 11.0
(byte*) main::cursor#3 cursor zp ZP_WORD:2 11.0
(byte*) main::cursor#5 cursor zp ZP_WORD:2 16.5
(byte) main::e
(byte) main::e#1 reg byte x 11.0
(byte) main::e#2 reg byte x 22.0
(byte) main::e#3 reg byte x 5.5
(byte) main::e#5 reg byte x 16.5
(byte) main::x
(byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667
(byte) main::x#2 x zp ZP_BYTE:4 11.0
(byte) main::x0
(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) main::x1
(const byte) main::x1#0 x1 = (byte/signed byte/word/signed word/dword/signed dword) $27
(byte) main::xd
(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0
(byte) main::y
(byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333
(byte) main::y#2 y zp ZP_BYTE:5 5.5
(byte) main::y#4 y zp ZP_BYTE:5 16.5
(byte) main::y0
(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) main::y1
(const byte) main::y1#0 y1 = (byte/signed byte/word/signed word/dword/signed dword) $18
(byte) main::yd
(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0
zp ZP_WORD:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ]
zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
reg byte x [ main::e#3 main::e#5 main::e#1 main::e#2 ]
zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ]
program

@ -12,26 +12,26 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@2
[5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 )
[5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 )
[5] (byte) main::e#3 ← phi( main/(const byte) main::y1#0/(byte) 2 main::@2/(byte) main::e#5 )
[5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 )
[5] (word) main::idx#3 ← phi( main/(const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 main::@2/(word) main::idx#5 )
[6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3
[7] *((byte*) main::$16) ← (const byte) main::STAR#0
[8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
[9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
[10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0
[11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2
[5] (word) main::idx#3 ← phi( main/(byte) 0 main::@2/(word) main::idx#5 )
[6] (byte*~) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3
[7] *((byte*~) main::$16) ← (const byte) main::STAR#0
[8] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1
[9] (word) main::idx#1 ← (word) main::idx#3 + (byte) 1
[10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0
[11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@1
[12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
[13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28
[14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0
[12] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1
[13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28
[14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[15] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 )
[15] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
[15] (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 )
[16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
[16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@2
[17] return

@ -1,31 +1,33 @@
Adding pointer type conversion cast (byte[main::$0]) main::screen in (byte[main::$0]) main::screen ← (number) $400
Identified constant variable (byte) main::STAR
Identified constant variable (byte) main::x0
Identified constant variable (byte) main::y0
Identified constant variable (byte) main::x1
Identified constant variable (byte) main::y1
Culled Empty Block (label) main::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @1
(byte) main::STAR#0 ← (byte/signed byte/word/signed word/dword/signed dword) $51
(word/signed word/dword/signed dword~) main::$0 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $19
(byte[main::$0]) main::screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte) main::x0#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::y0#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::x1#0 ← (byte/signed byte/word/signed word/dword/signed dword) $27
(byte) main::y1#0 ← (byte/signed byte/word/signed word/dword/signed dword) $18
(byte) main::STAR#0 ← (number) $51
(number~) main::$0 ← (number) $28 * (number) $19
(byte[main::$0]) main::screen#0 ← ((byte*)) (number) $400
(byte) main::x0#0 ← (number) 0
(byte) main::y0#0 ← (number) 0
(byte) main::x1#0 ← (number) $27
(byte) main::y1#0 ← (number) $18
(byte~) main::$1 ← (byte) main::x1#0 - (byte) main::x0#0
(byte) main::xd#0 ← (byte~) main::$1
(byte~) main::$2 ← (byte) main::y1#0 - (byte) main::y0#0
(byte) main::yd#0 ← (byte~) main::$2
(byte) main::x#0 ← (byte) main::x0#0
(byte) main::y#0 ← (byte) main::y0#0
(byte/signed word/word/dword/signed dword~) main::$3 ← (byte) main::yd#0 / (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) main::e#0 ← (byte/signed word/word/dword/signed dword~) main::$3
(byte/signed word/word/dword/signed dword~) main::$4 ← (byte) main::y#0 * (byte/signed byte/word/signed word/dword/signed dword) $28
(byte/signed word/word/dword/signed dword~) main::$5 ← (byte) main::x#0 + (byte/signed word/word/dword/signed dword~) main::$4
(word) main::idx#0 ← (byte/signed word/word/dword/signed dword~) main::$5
(number~) main::$3 ← (byte) main::yd#0 / (number) 2
(byte) main::e#0 ← (number~) main::$3
(number~) main::$4 ← (byte) main::y#0 * (number) $28
(number~) main::$5 ← (byte) main::x#0 + (number~) main::$4
(word) main::idx#0 ← (number~) main::$5
to:main::@1
main::@1: scope:[main] from main main::@2
(byte) main::y#3 ← phi( main/(byte) main::y#0 main::@2/(byte) main::y#4 )
@ -35,10 +37,10 @@ main::@1: scope:[main] from main main::@2
(byte) main::x#2 ← phi( main/(byte) main::x#0 main::@2/(byte) main::x#3 )
(word) main::idx#3 ← phi( main/(word) main::idx#0 main::@2/(word) main::idx#5 )
*((byte[main::$0]) main::screen#0 + (word) main::idx#3) ← (byte) main::STAR#0
(byte/signed word/word/dword/signed dword~) main::$6 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::x#1 ← (byte/signed word/word/dword/signed dword~) main::$6
(word/signed dword/dword~) main::$7 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
(word) main::idx#1 ← (word/signed dword/dword~) main::$7
(number~) main::$6 ← (byte) main::x#2 + (number) 1
(byte) main::x#1 ← (number~) main::$6
(number~) main::$7 ← (word) main::idx#3 + (number) 1
(word) main::idx#1 ← (number~) main::$7
(byte~) main::$8 ← (byte) main::e#3 + (byte) main::yd#1
(byte) main::e#1 ← (byte~) main::$8
(bool~) main::$9 ← (byte) main::xd#1 < (byte) main::e#1
@ -52,8 +54,8 @@ main::@2: scope:[main] from main::@1 main::@3
(byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
(word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 )
(byte) main::x#3 ← phi( main::@1/(byte) main::x#1 main::@3/(byte) main::x#4 )
(byte/signed word/word/dword/signed dword~) main::$14 ← (byte) main::x1#0 + (byte/signed byte/word/signed word/dword/signed dword) 1
(bool~) main::$15 ← (byte) main::x#3 < (byte/signed word/word/dword/signed dword~) main::$14
(number~) main::$14 ← (byte) main::x1#0 + (number) 1
(bool~) main::$15 ← (byte) main::x#3 < (number~) main::$14
if((bool~) main::$15) goto main::@1
to:main::@return
main::@3: scope:[main] from main::@1
@ -63,10 +65,10 @@ main::@3: scope:[main] from main::@1
(byte) main::e#4 ← phi( main::@1/(byte) main::e#1 )
(word) main::idx#4 ← phi( main::@1/(word) main::idx#1 )
(byte) main::y#2 ← phi( main::@1/(byte) main::y#3 )
(byte/signed word/word/dword/signed dword~) main::$11 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::y#1 ← (byte/signed word/word/dword/signed dword~) main::$11
(word/signed dword/dword~) main::$12 ← (word) main::idx#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
(word) main::idx#2 ← (word/signed dword/dword~) main::$12
(number~) main::$11 ← (byte) main::y#2 + (number) 1
(byte) main::y#1 ← (number~) main::$11
(number~) main::$12 ← (word) main::idx#4 + (number) $28
(word) main::idx#2 ← (number~) main::$12
(byte~) main::$13 ← (byte) main::e#4 - (byte) main::xd#2
(byte) main::e#2 ← (byte~) main::$13
to:main::@2
@ -86,20 +88,20 @@ SYMBOL TABLE SSA
(label) @begin
(label) @end
(void()) main()
(word/signed word/dword/signed dword~) main::$0
(number~) main::$0
(byte~) main::$1
(bool~) main::$10
(byte/signed word/word/dword/signed dword~) main::$11
(word/signed dword/dword~) main::$12
(number~) main::$11
(number~) main::$12
(byte~) main::$13
(byte/signed word/word/dword/signed dword~) main::$14
(number~) main::$14
(bool~) main::$15
(byte~) main::$2
(byte/signed word/word/dword/signed dword~) main::$3
(byte/signed word/word/dword/signed dword~) main::$4
(byte/signed word/word/dword/signed dword~) main::$5
(byte/signed word/word/dword/signed dword~) main::$6
(word/signed dword/dword~) main::$7
(number~) main::$3
(number~) main::$4
(number~) main::$5
(number~) main::$6
(number~) main::$7
(byte~) main::$8
(bool~) main::$9
(label) main::@1
@ -155,24 +157,85 @@ SYMBOL TABLE SSA
(byte) main::yd#2
(byte) main::yd#3
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) $51 in (byte) main::STAR#0 ← (number) $51
Adding number conversion cast (unumber) 0 in (byte) main::x0#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) main::y0#0 ← (number) 0
Adding number conversion cast (unumber) $27 in (byte) main::x1#0 ← (number) $27
Adding number conversion cast (unumber) $18 in (byte) main::y1#0 ← (number) $18
Adding number conversion cast (unumber) 2 in (number~) main::$3 ← (byte) main::yd#0 / (number) 2
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte) main::yd#0 / (unumber)(number) 2
Adding number conversion cast (unumber) $28 in (number~) main::$4 ← (byte) main::y#0 * (number) $28
Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (byte) main::y#0 * (unumber)(number) $28
Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (byte) main::x#0 + (unumber~) main::$4
Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (byte) main::x#2 + (number) 1
Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (byte) main::x#2 + (unumber)(number) 1
Adding number conversion cast (unumber) 1 in (number~) main::$7 ← (word) main::idx#3 + (number) 1
Adding number conversion cast (unumber) main::$7 in (number~) main::$7 ← (word) main::idx#3 + (unumber)(number) 1
Adding number conversion cast (unumber) 1 in (number~) main::$14 ← (byte) main::x1#0 + (number) 1
Adding number conversion cast (unumber) main::$14 in (number~) main::$14 ← (byte) main::x1#0 + (unumber)(number) 1
Adding number conversion cast (unumber) 1 in (number~) main::$11 ← (byte) main::y#2 + (number) 1
Adding number conversion cast (unumber) main::$11 in (number~) main::$11 ← (byte) main::y#2 + (unumber)(number) 1
Adding number conversion cast (unumber) $28 in (number~) main::$12 ← (word) main::idx#4 + (number) $28
Adding number conversion cast (unumber) main::$12 in (number~) main::$12 ← (word) main::idx#4 + (unumber)(number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) main::STAR#0 ← (unumber)(number) $51
Inlining cast (byte[main::$0]) main::screen#0 ← (byte*)(number) $400
Inlining cast (byte) main::x0#0 ← (unumber)(number) 0
Inlining cast (byte) main::y0#0 ← (unumber)(number) 0
Inlining cast (byte) main::x1#0 ← (unumber)(number) $27
Inlining cast (byte) main::y1#0 ← (unumber)(number) $18
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast $51
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $27
Simplifying constant integer cast $18
Simplifying constant integer cast 2
Simplifying constant integer cast $28
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $51
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $27
Finalized unsigned number type (byte) $18
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $28
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$3 ← (byte) main::yd#0 / (byte) 2
Inferred type updated to byte in (unumber~) main::$4 ← (byte) main::y#0 * (byte) $28
Inferred type updated to byte in (unumber~) main::$5 ← (byte) main::x#0 + (byte~) main::$4
Inferred type updated to byte in (unumber~) main::$6 ← (byte) main::x#2 + (byte) 1
Inferred type updated to word in (unumber~) main::$7 ← (word) main::idx#3 + (byte) 1
Inferred type updated to byte in (unumber~) main::$14 ← (byte) main::x1#0 + (byte) 1
Inferred type updated to byte in (unumber~) main::$11 ← (byte) main::y#2 + (byte) 1
Inferred type updated to word in (unumber~) main::$12 ← (word) main::idx#4 + (byte) $28
Inversing boolean not [27] (bool~) main::$10 ← (byte) main::xd#1 >= (byte) main::e#1 from [26] (bool~) main::$9 ← (byte) main::xd#1 < (byte) main::e#1
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte) main::xd#0 = (byte~) main::$1
Alias (byte) main::yd#0 = (byte~) main::$2
Alias (byte) main::x0#0 = (byte) main::x#0
Alias (byte) main::y0#0 = (byte) main::y#0
Alias (byte) main::e#0 = (byte/signed word/word/dword/signed dword~) main::$3
Alias (word) main::idx#0 = (byte/signed word/word/dword/signed dword~) main::$5
Alias (byte) main::x#1 = (byte/signed word/word/dword/signed dword~) main::$6 (byte) main::x#4
Alias (word) main::idx#1 = (word/signed dword/dword~) main::$7 (word) main::idx#4
Alias (byte) main::e#0 = (byte~) main::$3
Alias (word) main::idx#0 = (byte~) main::$5
Alias (byte) main::x#1 = (byte~) main::$6 (byte) main::x#4
Alias (word) main::idx#1 = (word~) main::$7 (word) main::idx#4
Alias (byte) main::e#1 = (byte~) main::$8 (byte) main::e#4
Alias (byte) main::y#2 = (byte) main::y#3
Alias (byte) main::xd#1 = (byte) main::xd#2
Alias (byte) main::yd#1 = (byte) main::yd#3
Alias (byte) main::y#1 = (byte/signed word/word/dword/signed dword~) main::$11
Alias (word) main::idx#2 = (word/signed dword/dword~) main::$12
Alias (byte) main::y#1 = (byte~) main::$11
Alias (word) main::idx#2 = (word~) main::$12
Alias (byte) main::e#2 = (byte~) main::$13
Successful SSA optimization Pass2AliasElimination
Alias (byte) main::x#1 = (byte) main::x#3
@ -182,59 +245,76 @@ Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) main::yd#1
Self Phi Eliminated (byte) main::xd#1
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte) main::yd#1 (byte) main::yd#0
Redundant Phi (byte) main::xd#1 (byte) main::xd#0
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte) main::yd#1 (byte) main::yd#0
Identical Phi Values (byte) main::xd#1 (byte) main::xd#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$10 [28] if((byte) main::xd#0>=(byte) main::e#1) goto main::@2
Simple Condition (bool~) main::$15 [32] if((byte) main::x#1<(byte/signed word/word/dword/signed dword~) main::$14) goto main::@1
Simple Condition (bool~) main::$15 [32] if((byte) main::x#1<(byte~) main::$14) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [1] (number~) main::$0 ← (number) $28 * (number) $19
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::STAR#0 = $51
Constant (const word/signed word/dword/signed dword) main::$0 = $28*$19
Constant (const byte[main::$0]) main::screen#0 = ((byte*))$400
Constant (const number) main::$0 = $28*$19
Constant (const byte[main::$0]) main::screen#0 = (byte*) 1024
Constant (const byte) main::x0#0 = 0
Constant (const byte) main::y0#0 = 0
Constant (const byte) main::x1#0 = $27
Constant (const byte) main::y1#0 = $18
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::xd#0 = main::x1#0-main::x0#0
Constant (const byte) main::yd#0 = main::y1#0-main::y0#0
Constant (const byte/signed word/word/dword/signed dword) main::$4 = main::y0#0*$28
Constant (const byte/signed word/word/dword/signed dword) main::$14 = main::x1#0+1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::e#0 = main::yd#0/2
Constant (const word) main::idx#0 = main::x0#0+main::$4
Successful SSA optimization Pass2ConstantIdentification
De-inlining pointer[w] to *(pointer+w) *((const byte[main::$0]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0
De-inlining pointer[w] to *(pointer+w) [19] *((const byte[main::$0]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0
Successful SSA optimization Pass2DeInlineWordDerefIdx
Inlining constant with var siblings (const byte) main::e#0
Simplifying expression containing zero main::x1#0 in [7] (byte) main::xd#0 ← (const byte) main::x1#0 - (const byte) main::x0#0
Simplifying expression containing zero main::y1#0 in [9] (byte) main::yd#0 ← (const byte) main::y1#0 - (const byte) main::y0#0
Simplifying expression containing zero main::$4 in [16] (word) main::idx#0 ← (const byte) main::x0#0 + (byte~) main::$4
Successful SSA optimization PassNSimplifyExpressionWithZero
Alias (word) main::idx#0 = (byte~) main::$4
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [3] (word) main::idx#0 ← (const byte) main::y0#0 * (byte) $28
Constant right-side identified [13] (byte~) main::$14 ← (const byte) main::x1#0 + (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::xd#0 = main::x1#0
Constant (const byte) main::yd#0 = main::y1#0
Constant (const word) main::idx#0 = main::y0#0*$28
Constant (const byte) main::$14 = main::x1#0+1
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero (const byte) main::y0#0*(byte) $28 in
Successful SSA optimization PassNSimplifyConstantZero
Constant right-side identified [0] (byte) main::e#0 ← (const byte) main::yd#0 / (byte) 2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::e#0 = main::yd#0/2
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const word) main::idx#0
Constant inlined main::idx#0 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28
Constant inlined main::$14 = (const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$4 = (const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28
Constant inlined main::e#0 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::$0 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $19
Inlining constant with var siblings (const byte) main::e#0
Constant inlined main::idx#0 = (byte) 0
Constant inlined main::$14 = (const byte) main::x1#0+(byte) 1
Constant inlined main::xd#0 = (const byte) main::x1#0
Constant inlined main::e#0 = (const byte) main::y1#0/(byte) 2
Constant inlined main::yd#0 = (const byte) main::y1#0
Constant inlined main::$0 = (number) $28*(number) $19
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@5(between main::@2 and main::@1)
Added new block during phi lifting main::@6(between main::@1 and main::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Created 7 initial phi equivalence classes
Coalesced [15] main::idx#8 ← main::idx#2
Coalesced [16] main::e#8 ← main::e#2
Coalesced [17] main::y#7 ← main::y#1
Coalesced [21] main::idx#6 ← main::idx#5
Coalesced [22] main::x#5 ← main::x#1
Coalesced [23] main::e#6 ← main::e#5
Coalesced [24] main::y#5 ← main::y#4
Coalesced [25] main::idx#7 ← main::idx#1
Coalesced [26] main::e#7 ← main::e#1
Coalesced (already) [27] main::y#6 ← main::y#2
Coalesced [16] main::idx#8 ← main::idx#2
Coalesced [17] main::e#8 ← main::e#2
Coalesced [18] main::y#7 ← main::y#1
Coalesced [22] main::idx#6 ← main::idx#5
Coalesced [23] main::x#5 ← main::x#1
Coalesced [24] main::e#6 ← main::e#5
Coalesced [25] main::y#5 ← main::y#4
Coalesced [26] main::idx#7 ← main::idx#1
Coalesced [27] main::e#7 ← main::e#1
Coalesced (already) [28] main::y#6 ← main::y#2
Coalesced down to 4 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Adding NOP phi() at start of @begin
@ -257,26 +337,26 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@2
[5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 )
[5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 )
[5] (byte) main::e#3 ← phi( main/(const byte) main::y1#0/(byte) 2 main::@2/(byte) main::e#5 )
[5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 )
[5] (word) main::idx#3 ← phi( main/(const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 main::@2/(word) main::idx#5 )
[6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3
[7] *((byte*) main::$16) ← (const byte) main::STAR#0
[8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
[9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
[10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0
[11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2
[5] (word) main::idx#3 ← phi( main/(byte) 0 main::@2/(word) main::idx#5 )
[6] (byte*~) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3
[7] *((byte*~) main::$16) ← (const byte) main::STAR#0
[8] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1
[9] (word) main::idx#1 ← (word) main::idx#3 + (byte) 1
[10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0
[11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@1
[12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
[13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28
[14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0
[12] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1
[13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28
[14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[15] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 )
[15] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
[15] (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 )
[16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
[16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@2
[17] return
@ -285,7 +365,7 @@ main::@return: scope:[main] from main::@2
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::$16 22.0
(byte*~) main::$16 22.0
(byte) main::STAR
(byte) main::e
(byte) main::e#1 11.0
@ -361,8 +441,6 @@ main: {
.const y0 = 0
.const x1 = $27
.const y1 = $18
.const xd = x1-x0
.const yd = y1-y0
.label x = 4
.label idx = 2
.label e = 5
@ -373,14 +451,14 @@ main: {
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #y0
sta y
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1
lda #yd/2
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::y1#0/(byte) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1
lda #y1/2
sta e
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #x0
sta x
//SEG15 [5] phi (word) main::idx#3 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:main->main::@1#3] -- vwuz1=vbuc1
lda #x0+y0*$28
//SEG15 [5] phi (word) main::idx#3 = (byte) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1
lda #0
sta idx
lda #0
sta idx+1
@ -394,7 +472,7 @@ main: {
jmp b1
//SEG21 main::@1
b1:
//SEG22 [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
//SEG22 [6] (byte*~) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
lda idx
clc
adc #<screen
@ -402,31 +480,31 @@ main: {
lda idx+1
adc #>screen
sta _16+1
//SEG23 [7] *((byte*) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
//SEG23 [7] *((byte*~) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
lda #STAR
ldy #0
sta (_16),y
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc x
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte) 1 -- vwuz1=vwuz1_plus_1
inc idx
bne !+
inc idx+1
!:
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuz1=vbuz1_plus_vbuc1
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 -- vbuz1=vbuz1_plus_vbuc1
lax e
axs #-[yd]
axs #-[y1]
stx e
//SEG27 [11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuz1_then_la1
lda #xd
//SEG27 [11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuz1_then_la1
lda #x1
cmp e
bcs b2_from_b1
jmp b3
//SEG28 main::@3
b3:
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc y
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc idx
@ -434,9 +512,9 @@ main: {
bcc !+
inc idx+1
!:
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuz1=vbuz1_minus_vbuc1
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 -- vbuz1=vbuz1_minus_vbuc1
lax e
axs #xd
axs #x1
stx e
//SEG32 [15] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
b2_from_b1:
@ -447,7 +525,7 @@ main: {
jmp b2
//SEG36 main::@2
b2:
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #x1+1
bcc b1_from_b2
@ -459,26 +537,26 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ) always clobbers reg byte a
Statement [6] (byte*~) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
Statement [7] *((byte*) main::$16) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y
Statement [7] *((byte*~) main::$16) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x
Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
Statement [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a
Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x
Statement [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
Statement [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ) always clobbers reg byte a
Statement [7] *((byte*) main::$16) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y
Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x
Statement [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a
Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x
Statement [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
Statement [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a
Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x
Statement [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
Statement [6] (byte*~) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ) always clobbers reg byte a
Statement [7] *((byte*~) main::$16) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y
Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x
Statement [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a
Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x
Statement [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
Potential registers zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_BYTE:4 [ main::x#2 main::x#1 ] : zp ZP_BYTE:4 ,
Potential registers zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] : zp ZP_BYTE:5 , reg byte x ,
@ -529,8 +607,6 @@ main: {
.const y0 = 0
.const x1 = $27
.const y1 = $18
.const xd = x1-x0
.const yd = y1-y0
.label x = 4
.label idx = 2
.label y = 5
@ -540,13 +616,13 @@ main: {
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #y0
sta y
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #yd/2
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::y1#0/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #y1/2
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #x0
sta x
//SEG15 [5] phi (word) main::idx#3 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:main->main::@1#3] -- vwuz1=vbuc1
lda #x0+y0*$28
//SEG15 [5] phi (word) main::idx#3 = (byte) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1
lda #0
sta idx
lda #0
sta idx+1
@ -560,7 +636,7 @@ main: {
jmp b1
//SEG21 main::@1
b1:
//SEG22 [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
//SEG22 [6] (byte*~) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
lda idx
clc
adc #<screen
@ -568,30 +644,30 @@ main: {
lda idx+1
adc #>screen
sta _16+1
//SEG23 [7] *((byte*) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
//SEG23 [7] *((byte*~) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
lda #STAR
ldy #0
sta (_16),y
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc x
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte) 1 -- vwuz1=vwuz1_plus_1
inc idx
bne !+
inc idx+1
!:
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuxx=vbuxx_plus_vbuc1
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 -- vbuxx=vbuxx_plus_vbuc1
txa
axs #-[yd]
//SEG27 [11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1
cpx #xd
axs #-[y1]
//SEG27 [11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1
cpx #x1
bcc b2_from_b1
beq b2_from_b1
jmp b3
//SEG28 main::@3
b3:
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc y
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc idx
@ -599,9 +675,9 @@ main: {
bcc !+
inc idx+1
!:
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuxx=vbuxx_minus_vbuc1
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 -- vbuxx=vbuxx_minus_vbuc1
txa
axs #xd
axs #x1
//SEG32 [15] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
b2_from_b1:
b2_from_b3:
@ -611,7 +687,7 @@ main: {
jmp b2
//SEG36 main::@2
b2:
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #x1+1
bcc b1_from_b2
@ -630,6 +706,8 @@ Removing instruction jmp b3
Removing instruction jmp b2
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b2_from_b1 with b2
Replacing label b2_from_b1 with b2
Replacing label b1_from_b2 with b1
@ -659,13 +737,13 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(void()) main()
(byte*) main::$16 $16 zp ZP_WORD:6 22.0
(byte*~) main::$16 $16 zp ZP_WORD:6 22.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte) main::STAR
(const byte) main::STAR#0 STAR = (byte/signed byte/word/signed word/dword/signed dword) $51
(const byte) main::STAR#0 STAR = (byte) $51
(byte) main::e
(byte) main::e#1 reg byte x 11.0
(byte) main::e#2 reg byte x 22.0
@ -677,26 +755,24 @@ FINAL SYMBOL TABLE
(word) main::idx#3 idx zp ZP_WORD:2 8.25
(word) main::idx#5 idx zp ZP_WORD:2 16.5
(byte[$28*$19]) main::screen
(const byte[$28*$19]) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
(const byte[$28*$19]) main::screen#0 screen = (byte*) 1024
(byte) main::x
(byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667
(byte) main::x#2 x zp ZP_BYTE:4 7.333333333333333
(byte) main::x0
(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 0
(const byte) main::x0#0 x0 = (byte) 0
(byte) main::x1
(const byte) main::x1#0 x1 = (byte/signed byte/word/signed word/dword/signed dword) $27
(const byte) main::x1#0 x1 = (byte) $27
(byte) main::xd
(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0
(byte) main::y
(byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333
(byte) main::y#2 y zp ZP_BYTE:5 4.714285714285714
(byte) main::y#4 y zp ZP_BYTE:5 16.5
(byte) main::y0
(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 0
(const byte) main::y0#0 y0 = (byte) 0
(byte) main::y1
(const byte) main::y1#0 y1 = (byte/signed byte/word/signed word/dword/signed dword) $18
(const byte) main::y1#0 y1 = (byte) $18
(byte) main::yd
(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0
zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ]
zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
@ -706,7 +782,7 @@ zp ZP_WORD:6 [ main::$16 ]
FINAL ASSEMBLER
Score: 1131
Score: 1111
//SEG0 File Comments
//SEG1 Basic Upstart
@ -729,8 +805,6 @@ main: {
.const y0 = 0
.const x1 = $27
.const y1 = $18
.const xd = x1-x0
.const yd = y1-y0
.label x = 4
.label idx = 2
.label y = 5
@ -739,15 +813,14 @@ main: {
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #y0
sta y
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #yd/2
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::y1#0/(byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
ldx #y1/2
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #x0
sta x
//SEG15 [5] phi (word) main::idx#3 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:main->main::@1#3] -- vwuz1=vbuc1
lda #x0+y0*$28
sta idx
//SEG15 [5] phi (word) main::idx#3 = (byte) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1
lda #0
sta idx
sta idx+1
//SEG16 [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
//SEG17 [5] phi (byte) main::y#2 = (byte) main::y#4 [phi:main::@2->main::@1#0] -- register_copy
@ -756,7 +829,7 @@ main: {
//SEG20 [5] phi (word) main::idx#3 = (word) main::idx#5 [phi:main::@2->main::@1#3] -- register_copy
//SEG21 main::@1
b1:
//SEG22 [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
//SEG22 [6] (byte*~) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
lda idx
clc
adc #<screen
@ -764,28 +837,28 @@ main: {
lda idx+1
adc #>screen
sta _16+1
//SEG23 [7] *((byte*) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
//SEG23 [7] *((byte*~) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
lda #STAR
ldy #0
sta (_16),y
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc x
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte) 1 -- vwuz1=vwuz1_plus_1
inc idx
bne !+
inc idx+1
!:
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuxx=vbuxx_plus_vbuc1
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::y1#0 -- vbuxx=vbuxx_plus_vbuc1
txa
axs #-[yd]
//SEG27 [11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1
cpx #xd
axs #-[y1]
//SEG27 [11] if((const byte) main::x1#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1
cpx #x1
bcc b2
beq b2
//SEG28 main::@3
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc y
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
lda #$28
clc
adc idx
@ -793,16 +866,16 @@ main: {
bcc !+
inc idx+1
!:
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuxx=vbuxx_minus_vbuc1
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::x1#0 -- vbuxx=vbuxx_minus_vbuc1
txa
axs #xd
axs #x1
//SEG32 [15] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
//SEG33 [15] phi (byte) main::y#4 = (byte) main::y#2 [phi:main::@1/main::@3->main::@2#0] -- register_copy
//SEG34 [15] phi (byte) main::e#5 = (byte) main::e#1 [phi:main::@1/main::@3->main::@2#1] -- register_copy
//SEG35 [15] phi (word) main::idx#5 = (word) main::idx#1 [phi:main::@1/main::@3->main::@2#2] -- register_copy
//SEG36 main::@2
b2:
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #x1+1
bcc b1

@ -1,48 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(byte*) main::$16 $16 zp ZP_WORD:6 22.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte) main::STAR
(const byte) main::STAR#0 STAR = (byte/signed byte/word/signed word/dword/signed dword) $51
(byte) main::e
(byte) main::e#1 reg byte x 11.0
(byte) main::e#2 reg byte x 22.0
(byte) main::e#3 reg byte x 4.4
(byte) main::e#5 reg byte x 16.5
(word) main::idx
(word) main::idx#1 idx zp ZP_WORD:2 8.25
(word) main::idx#2 idx zp ZP_WORD:2 11.0
(word) main::idx#3 idx zp ZP_WORD:2 8.25
(word) main::idx#5 idx zp ZP_WORD:2 16.5
(byte[$28*$19]) main::screen
(const byte[$28*$19]) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
(byte) main::x
(byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667
(byte) main::x#2 x zp ZP_BYTE:4 7.333333333333333
(byte) main::x0
(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::x1
(const byte) main::x1#0 x1 = (byte/signed byte/word/signed word/dword/signed dword) $27
(byte) main::xd
(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0
(byte) main::y
(byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333
(byte) main::y#2 y zp ZP_BYTE:5 4.714285714285714
(byte) main::y#4 y zp ZP_BYTE:5 16.5
(byte) main::y0
(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::y1
(const byte) main::y1#0 y1 = (byte/signed byte/word/signed word/dword/signed dword) $18
(byte) main::yd
(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0
zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ]
zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
reg byte x [ main::e#3 main::e#5 main::e#1 main::e#2 ]
zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ]
zp ZP_WORD:6 [ main::$16 ]
program

@ -31,7 +31,7 @@ main::@return: scope:[main] from main::@4
[14] return
to:@return
testLong: scope:[testLong] from main::@4
[15] (byte*~) print_char_cursor#181 ← (byte*) print_line_cursor#1
[15] (byte*~) print_char_cursor#156 ← (byte*) print_line_cursor#1
[16] call print_str
to:testLong::@1
testLong::@1: scope:[testLong] from testLong
@ -62,11 +62,11 @@ testLong::@return: scope:[testLong] from testLong::@6
[29] return
to:@return
print_ln: scope:[print_ln] from testChar::@6 testInt::@6 testLong::@6 testShort::@6
[30] (byte*) print_line_cursor#39 ← phi( testChar::@6/((byte*))(word/signed word/dword/signed dword) $400 testInt::@6/(byte*) print_line_cursor#1 testLong::@6/(byte*) print_line_cursor#1 testShort::@6/(byte*) print_line_cursor#1 )
[30] (byte*) print_line_cursor#39 ← phi( testChar::@6/(byte*) 1024 testInt::@6/(byte*) print_line_cursor#1 testLong::@6/(byte*) print_line_cursor#1 testShort::@6/(byte*) print_line_cursor#1 )
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[31] (byte*) print_line_cursor#20 ← phi( print_ln/(byte*) print_line_cursor#39 print_ln::@1/(byte*) print_line_cursor#1 )
[32] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#20 + (byte/signed byte/word/signed word/dword/signed dword) $28
[32] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#20 + (byte) $28
[33] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#24) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
@ -74,7 +74,7 @@ print_ln::@return: scope:[print_ln] from print_ln::@1
to:@return
print_sdword: scope:[print_sdword] from testLong::@3 testLong::@5
[35] (signed dword) print_sdword::dw#3 ← phi( testLong::@3/(const signed dword) testLong::n#0 testLong::@5/(const signed dword) testLong::s#0 )
[36] if((signed dword) print_sdword::dw#3>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sdword::@1
[36] if((signed dword) print_sdword::dw#3>=(signed byte) 0) goto print_sdword::@1
to:print_sdword::@2
print_sdword::@2: scope:[print_sdword] from print_sdword
[37] phi()
@ -85,7 +85,7 @@ print_sdword::@3: scope:[print_sdword] from print_sdword::@2
to:print_sdword::@1
print_sdword::@1: scope:[print_sdword] from print_sdword print_sdword::@3
[40] (signed dword) print_sdword::dw#4 ← phi( print_sdword/(signed dword) print_sdword::dw#3 print_sdword::@3/(signed dword) print_sdword::dw#0 )
[41] (dword) print_dword::dw#0 ← ((dword)) (signed dword) print_sdword::dw#4
[41] (dword) print_dword::dw#0 ← (dword)(signed dword) print_sdword::dw#4
[42] call print_dword
to:print_sdword::@return
print_sdword::@return: scope:[print_sdword] from print_sdword::@1
@ -120,12 +120,12 @@ print_word::@return: scope:[print_word] from print_word::@1
print_byte: scope:[print_byte] from print_sbyte::@2 print_word print_word::@1 testChar::@1
[56] (byte*) print_char_cursor#143 ← phi( print_sbyte::@2/(byte*) print_char_cursor#24 print_word/(byte*) print_char_cursor#139 print_word::@1/(byte*) print_char_cursor#24 testChar::@1/(byte*) print_char_cursor#132 )
[56] (byte) print_byte::b#4 ← phi( print_sbyte::@2/(byte~) print_byte::b#6 print_word/(byte) print_byte::b#1 print_word::@1/(byte) print_byte::b#2 testChar::@1/(const byte) testChar::u#0 )
[57] (byte~) print_byte::$0 ← (byte) print_byte::b#4 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[57] (byte~) print_byte::$0 ← (byte) print_byte::b#4 >> (byte) 4
[58] (byte) print_char::ch#4 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[59] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[60] (byte~) print_byte::$2 ← (byte) print_byte::b#4 & (byte/signed byte/word/signed word/dword/signed dword) $f
[60] (byte~) print_byte::$2 ← (byte) print_byte::b#4 & (byte) $f
[61] (byte) print_char::ch#5 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[62] call print_char
to:print_byte::@return
@ -142,7 +142,7 @@ print_char::@return: scope:[print_char] from print_char
[67] return
to:@return
print_str: scope:[print_str] from testChar testInt testLong testShort
[68] (byte*) print_char_cursor#150 ← phi( testChar/((byte*))(word/signed word/dword/signed dword) $400 testInt/(byte*~) print_char_cursor#180 testLong/(byte*~) print_char_cursor#181 testShort/(byte*~) print_char_cursor#182 )
[68] (byte*) print_char_cursor#150 ← phi( testChar/(byte*) 1024 testInt/(byte*~) print_char_cursor#155 testLong/(byte*~) print_char_cursor#156 testShort/(byte*~) print_char_cursor#157 )
[68] (byte*) print_str::str#7 ← phi( testChar/(const string) testChar::str testInt/(const string) testInt::str testLong/(const string) testLong::str testShort/(const string) testShort::str )
to:print_str::@1
print_str::@1: scope:[print_str] from print_str print_str::@2
@ -159,7 +159,7 @@ print_str::@2: scope:[print_str] from print_str::@1
[74] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#5
to:print_str::@1
testInt: scope:[testInt] from main::@3
[75] (byte*~) print_char_cursor#180 ← (byte*) print_line_cursor#1
[75] (byte*~) print_char_cursor#155 ← (byte*) print_line_cursor#1
[76] call print_str
to:testInt::@1
testInt::@1: scope:[testInt] from testInt
@ -191,7 +191,7 @@ testInt::@return: scope:[testInt] from testInt::@6
to:@return
print_sword: scope:[print_sword] from testInt::@3 testInt::@5 testShort::@3 testShort::@5
[90] (signed word) print_sword::w#5 ← phi( testInt::@3/(const signed word) testInt::n#0 testInt::@5/(const signed word) testInt::s#0 testShort::@3/(const signed word) testShort::n#0 testShort::@5/(const signed word) testShort::s#0 )
[91] if((signed word) print_sword::w#5>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1
[91] if((signed word) print_sword::w#5>=(signed byte) 0) goto print_sword::@1
to:print_sword::@2
print_sword::@2: scope:[print_sword] from print_sword
[92] phi()
@ -209,7 +209,7 @@ print_sword::@return: scope:[print_sword] from print_sword::@1
[98] return
to:@return
testShort: scope:[testShort] from main::@2
[99] (byte*~) print_char_cursor#182 ← (byte*) print_line_cursor#1
[99] (byte*~) print_char_cursor#157 ← (byte*) print_line_cursor#1
[100] call print_str
to:testShort::@1
testShort::@1: scope:[testShort] from testShort
@ -272,7 +272,7 @@ testChar::@return: scope:[testChar] from testChar::@6
to:@return
print_sbyte: scope:[print_sbyte] from testChar::@3 testChar::@5
[129] (signed byte) print_sbyte::b#3 ← phi( testChar::@3/(const signed byte) testChar::n#0 testChar::@5/(const signed byte) testChar::s#0 )
[130] if((signed byte) print_sbyte::b#3<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1
[130] if((signed byte) print_sbyte::b#3<(signed byte) 0) goto print_sbyte::@1
to:print_sbyte::@3
print_sbyte::@3: scope:[print_sbyte] from print_sbyte
[131] phi()
@ -297,10 +297,10 @@ print_cls: scope:[print_cls] from main
[140] phi()
to:print_cls::@1
print_cls::@1: scope:[print_cls] from print_cls print_cls::@1
[141] (byte*) print_cls::sc#2 ← phi( print_cls/((byte*))(word/signed word/dword/signed dword) $400 print_cls::@1/(byte*) print_cls::sc#1 )
[141] (byte*) print_cls::sc#2 ← phi( print_cls/(byte*) 1024 print_cls::@1/(byte*) print_cls::sc#1 )
[142] *((byte*) print_cls::sc#2) ← (byte) ' '
[143] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
[144] if((byte*) print_cls::sc#1!=((byte*))(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
[144] if((byte*) print_cls::sc#1!=(byte*) 1024+(word) $3e8) goto print_cls::@1
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls::@1
[145] return

File diff suppressed because one or more lines are too long

@ -1,173 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@return
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 reg byte a 4.0
(byte~) print_byte::$2 reg byte x 4.0
(label) print_byte::@1
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#1 reg byte x 4.0
(byte) print_byte::b#2 reg byte x 4.0
(byte) print_byte::b#4 reg byte x 2.5
(byte~) print_byte::b#6 reg byte x 4.0
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
(byte) print_char::ch#14 reg byte a 6.0
(byte) print_char::ch#4 reg byte a 4.0
(byte) print_char::ch#5 reg byte a 4.0
(byte*) print_char_cursor
(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:10 11.0
(byte*) print_char_cursor#132 print_char_cursor zp ZP_WORD:10 3.583333333333333
(byte*) print_char_cursor#139 print_char_cursor zp ZP_WORD:10 6.0
(byte*) print_char_cursor#140 print_char_cursor zp ZP_WORD:10 3.0
(byte*) print_char_cursor#143 print_char_cursor zp ZP_WORD:10 3.333333333333333
(byte*) print_char_cursor#150 print_char_cursor zp ZP_WORD:10 8.0
(byte*~) print_char_cursor#180 print_char_cursor zp ZP_WORD:10 4.0
(byte*~) print_char_cursor#181 print_char_cursor zp ZP_WORD:10 4.0
(byte*~) print_char_cursor#182 print_char_cursor zp ZP_WORD:10 4.0
(byte*) print_char_cursor#24 print_char_cursor zp ZP_WORD:10 0.5568181818181817
(byte*) print_char_cursor#90 print_char_cursor zp ZP_WORD:10 16.0
(void()) print_cls()
(label) print_cls::@1
(label) print_cls::@return
(byte*) print_cls::sc
(byte*) print_cls::sc#1 sc zp ZP_WORD:2 16.5
(byte*) print_cls::sc#2 sc zp ZP_WORD:2 16.5
(void()) print_dword((dword) print_dword::dw)
(label) print_dword::@1
(label) print_dword::@return
(dword) print_dword::dw
(dword) print_dword::dw#0 dw zp ZP_DWORD:4 4.0
(dword) print_dword::dw#2 dw zp ZP_DWORD:4 2.0
(byte[]) print_hextab
(const byte[]) print_hextab#0 print_hextab = (string) "0123456789abcdef"
(byte*) print_line_cursor
(byte*) print_line_cursor#1 print_line_cursor zp ZP_WORD:2 0.8333333333333333
(byte*) print_line_cursor#20 print_line_cursor zp ZP_WORD:2 24.0
(byte*) print_line_cursor#39 print_line_cursor zp ZP_WORD:2 8.0
(void()) print_ln()
(label) print_ln::@1
(label) print_ln::@return
(void()) print_sbyte((signed byte) print_sbyte::b)
(label) print_sbyte::@1
(label) print_sbyte::@2
(label) print_sbyte::@3
(label) print_sbyte::@4
(label) print_sbyte::@return
(signed byte) print_sbyte::b
(signed byte) print_sbyte::b#0 reg byte x 4.0
(signed byte) print_sbyte::b#3 reg byte x 1.0
(signed byte) print_sbyte::b#5 reg byte x 4.0
(byte*) print_screen
(void()) print_sdword((signed dword) print_sdword::dw)
(label) print_sdword::@1
(label) print_sdword::@2
(label) print_sdword::@3
(label) print_sdword::@return
(signed dword) print_sdword::dw
(signed dword) print_sdword::dw#0 dw zp ZP_DWORD:4 4.0
(signed dword) print_sdword::dw#3 dw zp ZP_DWORD:4 1.5
(signed dword) print_sdword::dw#4 dw zp ZP_DWORD:4 6.0
(void()) print_str((byte*) print_str::str)
(label) print_str::@1
(label) print_str::@2
(label) print_str::@return
(byte*) print_str::str
(byte*) print_str::str#0 str zp ZP_WORD:8 22.0
(byte*) print_str::str#5 str zp ZP_WORD:8 11.5
(byte*) print_str::str#7 str zp ZP_WORD:8 2.0
(void()) print_sword((signed word) print_sword::w)
(label) print_sword::@1
(label) print_sword::@2
(label) print_sword::@3
(label) print_sword::@return
(signed word) print_sword::w
(signed word) print_sword::w#0 w zp ZP_WORD:8 4.0
(signed word) print_sword::w#5 w zp ZP_WORD:8 1.5
(signed word) print_sword::w#6 w zp ZP_WORD:8 4.0
(void()) print_word((word) print_word::w)
(label) print_word::@1
(label) print_word::@return
(word) print_word::w
(word) print_word::w#1 w zp ZP_WORD:8 4.0
(word) print_word::w#2 w zp ZP_WORD:8 4.0
(word) print_word::w#5 w zp ZP_WORD:8 3.333333333333333
(word~) print_word::w#9 w zp ZP_WORD:8 4.0
(void()) testChar()
(label) testChar::@1
(label) testChar::@2
(label) testChar::@3
(label) testChar::@4
(label) testChar::@5
(label) testChar::@6
(label) testChar::@return
(signed byte) testChar::n
(const signed byte) testChar::n#0 n = -(byte/signed byte/word/signed word/dword/signed dword) $e
(signed byte) testChar::s
(const signed byte) testChar::s#0 s = -(byte/signed byte/word/signed word/dword/signed dword) $e
(const string) testChar::str str = (string) "char: @"
(byte) testChar::u
(const byte) testChar::u#0 u = (byte/signed byte/word/signed word/dword/signed dword) $e
(void()) testInt()
(label) testInt::@1
(label) testInt::@2
(label) testInt::@3
(label) testInt::@4
(label) testInt::@5
(label) testInt::@6
(label) testInt::@return
(signed word) testInt::n
(const signed word) testInt::n#0 n = -(word/signed word/dword/signed dword) $578
(signed word) testInt::s
(const signed word) testInt::s#0 s = -(word/signed word/dword/signed dword) $578
(const string) testInt::str str = (string) "int: @"
(word) testInt::u
(const word) testInt::u#0 u = (word/signed word/dword/signed dword) $578
(void()) testLong()
(label) testLong::@1
(label) testLong::@2
(label) testLong::@3
(label) testLong::@4
(label) testLong::@5
(label) testLong::@6
(label) testLong::@return
(signed dword) testLong::n
(const signed dword) testLong::n#0 n = -(dword/signed dword) $222e0
(signed dword) testLong::s
(const signed dword) testLong::s#0 s = -(dword/signed dword) $222e0
(const string) testLong::str str = (string) "long: @"
(dword) testLong::u
(const dword) testLong::u#0 u = (dword/signed dword) $222e0
(void()) testShort()
(label) testShort::@1
(label) testShort::@2
(label) testShort::@3
(label) testShort::@4
(label) testShort::@5
(label) testShort::@6
(label) testShort::@return
(signed word) testShort::n
(const signed word) testShort::n#0 n = -(word/signed word/dword/signed dword) $578
(signed word) testShort::s
(const signed word) testShort::s#0 s = -(word/signed word/dword/signed dword) $578
(const string) testShort::str str = (string) "short: @"
(word) testShort::u
(const word) testShort::u#0 u = (word/signed word/dword/signed dword) $578
zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 print_cls::sc#2 print_cls::sc#1 ]
zp ZP_DWORD:4 [ print_sdword::dw#4 print_sdword::dw#3 print_sdword::dw#0 print_dword::dw#2 print_dword::dw#0 ]
zp ZP_WORD:8 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#9 print_sword::w#6 print_sword::w#5 print_sword::w#0 print_str::str#5 print_str::str#7 print_str::str#0 ]
reg byte x [ print_byte::b#4 print_byte::b#6 print_byte::b#1 print_byte::b#2 ]
reg byte a [ print_char::ch#14 print_char::ch#4 print_char::ch#5 ]
zp ZP_WORD:10 [ print_char_cursor#90 print_char_cursor#143 print_char_cursor#139 print_char_cursor#140 print_char_cursor#24 print_char_cursor#132 print_char_cursor#150 print_char_cursor#180 print_char_cursor#181 print_char_cursor#182 print_char_cursor#1 ]
reg byte x [ print_sbyte::b#5 print_sbyte::b#0 print_sbyte::b#3 ]
reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]
program

@ -16,50 +16,50 @@ main: scope:[main] from @1
main::@6: scope:[main] from main
[8] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0
[9] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0
[10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte) 3
[11] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0
[12] *((const byte*) DTV_PLANEA_START_LO#0) ← <(const byte*) SCREEN#0
[12] *((const byte*) DTV_PLANEA_START_LO#0) ← (byte) 0
[13] *((const byte*) DTV_PLANEA_START_MI#0) ← >(const byte*) SCREEN#0
[14] *((const byte*) DTV_PLANEA_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[15] *((const byte*) DTV_PLANEA_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1
[16] *((const byte*) DTV_PLANEA_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[17] *((const byte*) DTV_PLANEA_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[18] *((const byte*) DTV_PLANEB_START_LO#0) ← <(const byte*) CHARSET8#0
[14] *((const byte*) DTV_PLANEA_START_HI#0) ← (byte) 0
[15] *((const byte*) DTV_PLANEA_STEP#0) ← (byte) 1
[16] *((const byte*) DTV_PLANEA_MODULO_LO#0) ← (byte) 0
[17] *((const byte*) DTV_PLANEA_MODULO_HI#0) ← (byte) 0
[18] *((const byte*) DTV_PLANEB_START_LO#0) ← (byte) 0
[19] *((const byte*) DTV_PLANEB_START_MI#0) ← >(const byte*) CHARSET8#0
[20] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[21] *((const byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[22] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[23] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[24] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3
[25] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) SCREEN#0/(word/signed word/dword/signed dword) $4000
[26] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff/(byte/signed byte/word/signed word/dword/signed dword) $40|>((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff/(byte/signed byte/word/signed word/dword/signed dword) 4
[20] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte) 0
[21] *((const byte*) DTV_PLANEB_STEP#0) ← (byte) 0
[22] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte) 0
[23] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte) 0
[24] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte) 3
[25] *((const byte*) CIA2_PORT_A#0) ← (byte) 3^(byte)(word)(const byte*) SCREEN#0/(word) $4000
[26] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|>(word)(const byte*) SCREEN#0&(word) $3fff/(byte) 4
to:main::@1
main::@1: scope:[main] from main::@1 main::@6
[27] (byte) main::j#2 ← phi( main::@1/(byte) main::j#1 main::@6/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[27] (byte) main::j#2 ← phi( main::@1/(byte) main::j#1 main::@6/(byte) 0 )
[28] *((const byte*) DTV_PALETTE#0 + (byte) main::j#2) ← (byte) main::j#2
[29] (byte) main::j#1 ← ++ (byte) main::j#2
[30] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@1
[30] if((byte) main::j#1!=(byte) $10) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@5
asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize }
[32] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[33] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[32] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte) 3
[33] *((const byte*) BORDERCOL#0) ← (byte) 0
to:main::@3
main::@3: scope:[main] from main::@2 main::@3
[34] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $42) goto main::@3
[34] if(*((const byte*) RASTER#0)!=(byte) $42) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@3
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
to:main::@5
main::@5: scope:[main] from main::@4 main::@5
[36] (byte) main::rst#1 ← *((const byte*) RASTER#0)
[37] (byte~) main::$32 ← (byte) main::rst#1 & (byte/signed byte/word/signed word/dword/signed dword) 7
[37] (byte~) main::$32 ← (byte) main::rst#1 & (byte) 7
[38] (byte~) main::$33 ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0 | (byte~) main::$32
[39] *((const byte*) VIC_CONTROL#0) ← (byte~) main::$33
[40] (byte~) main::$34 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4
[40] (byte~) main::$34 ← (byte) main::rst#1 << (byte) 4
[41] *((const byte*) BORDERCOL#0) ← (byte~) main::$34
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
[43] if((byte) main::rst#1!=(byte/word/signed word/dword/signed dword) $f2) goto main::@5
[43] if((byte) main::rst#1!=(byte) $f2) goto main::@5
to:main::@2
gfx_init: scope:[gfx_init] from main
[44] phi()
@ -80,13 +80,13 @@ gfx_init_plane_charset8::@9: scope:[gfx_init_plane_charset8] from gfx_init_plan
[51] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_CHARROM#0
to:gfx_init_plane_charset8::@1
gfx_init_plane_charset8::@1: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@7 gfx_init_plane_charset8::@9
[52] (byte) gfx_init_plane_charset8::ch#8 ← phi( gfx_init_plane_charset8::@7/(byte) gfx_init_plane_charset8::ch#1 gfx_init_plane_charset8::@9/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[52] (byte) gfx_init_plane_charset8::col#6 ← phi( gfx_init_plane_charset8::@7/(byte) gfx_init_plane_charset8::col#1 gfx_init_plane_charset8::@9/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[52] (byte*) gfx_init_plane_charset8::gfxa#6 ← phi( gfx_init_plane_charset8::@7/(byte*) gfx_init_plane_charset8::gfxa#1 gfx_init_plane_charset8::@9/((byte*))(word/signed word/dword/signed dword) $4000+((word))(const byte*) CHARSET8#0&(word/signed word/dword/signed dword) $3fff )
[52] (byte*) gfx_init_plane_charset8::chargen#3 ← phi( gfx_init_plane_charset8::@7/(byte*) gfx_init_plane_charset8::chargen#1 gfx_init_plane_charset8::@9/(const byte*) CHARGEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1 )
[52] (byte) gfx_init_plane_charset8::ch#8 ← phi( gfx_init_plane_charset8::@7/(byte) gfx_init_plane_charset8::ch#1 gfx_init_plane_charset8::@9/(byte) 0 )
[52] (byte) gfx_init_plane_charset8::col#6 ← phi( gfx_init_plane_charset8::@7/(byte) gfx_init_plane_charset8::col#1 gfx_init_plane_charset8::@9/(byte) 0 )
[52] (byte*) gfx_init_plane_charset8::gfxa#6 ← phi( gfx_init_plane_charset8::@7/(byte*) gfx_init_plane_charset8::gfxa#1 gfx_init_plane_charset8::@9/(byte*)(word) $4000 )
[52] (byte*) gfx_init_plane_charset8::chargen#3 ← phi( gfx_init_plane_charset8::@7/(byte*) gfx_init_plane_charset8::chargen#1 gfx_init_plane_charset8::@9/(const byte*) CHARGEN#0+(byte) 1 )
to:gfx_init_plane_charset8::@2
gfx_init_plane_charset8::@2: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@6
[53] (byte) gfx_init_plane_charset8::cr#6 ← phi( gfx_init_plane_charset8::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 gfx_init_plane_charset8::@6/(byte) gfx_init_plane_charset8::cr#1 )
[53] (byte) gfx_init_plane_charset8::cr#6 ← phi( gfx_init_plane_charset8::@1/(byte) 0 gfx_init_plane_charset8::@6/(byte) gfx_init_plane_charset8::cr#1 )
[53] (byte) gfx_init_plane_charset8::col#5 ← phi( gfx_init_plane_charset8::@1/(byte) gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::@6/(byte) gfx_init_plane_charset8::col#1 )
[53] (byte*) gfx_init_plane_charset8::gfxa#5 ← phi( gfx_init_plane_charset8::@1/(byte*) gfx_init_plane_charset8::gfxa#6 gfx_init_plane_charset8::@6/(byte*) gfx_init_plane_charset8::gfxa#1 )
[53] (byte*) gfx_init_plane_charset8::chargen#2 ← phi( gfx_init_plane_charset8::@1/(byte*) gfx_init_plane_charset8::chargen#3 gfx_init_plane_charset8::@6/(byte*) gfx_init_plane_charset8::chargen#1 )
@ -94,32 +94,32 @@ gfx_init_plane_charset8::@2: scope:[gfx_init_plane_charset8] from gfx_init_plan
[55] (byte*) gfx_init_plane_charset8::chargen#1 ← ++ (byte*) gfx_init_plane_charset8::chargen#2
to:gfx_init_plane_charset8::@3
gfx_init_plane_charset8::@3: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@4
[56] (byte) gfx_init_plane_charset8::cp#2 ← phi( gfx_init_plane_charset8::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 gfx_init_plane_charset8::@4/(byte) gfx_init_plane_charset8::cp#1 )
[56] (byte) gfx_init_plane_charset8::cp#2 ← phi( gfx_init_plane_charset8::@2/(byte) 0 gfx_init_plane_charset8::@4/(byte) gfx_init_plane_charset8::cp#1 )
[56] (byte) gfx_init_plane_charset8::col#2 ← phi( gfx_init_plane_charset8::@2/(byte) gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::@4/(byte) gfx_init_plane_charset8::col#1 )
[56] (byte*) gfx_init_plane_charset8::gfxa#2 ← phi( gfx_init_plane_charset8::@2/(byte*) gfx_init_plane_charset8::gfxa#5 gfx_init_plane_charset8::@4/(byte*) gfx_init_plane_charset8::gfxa#1 )
[56] (byte) gfx_init_plane_charset8::bits#2 ← phi( gfx_init_plane_charset8::@2/(byte) gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::@4/(byte) gfx_init_plane_charset8::bits#1 )
[57] (byte~) gfx_init_plane_charset8::$10 ← (byte) gfx_init_plane_charset8::bits#2 & (byte/word/signed word/dword/signed dword) $80
[58] if((byte~) gfx_init_plane_charset8::$10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_init_plane_charset8::@4
[57] (byte~) gfx_init_plane_charset8::$10 ← (byte) gfx_init_plane_charset8::bits#2 & (byte) $80
[58] if((byte~) gfx_init_plane_charset8::$10==(byte) 0) goto gfx_init_plane_charset8::@4
to:gfx_init_plane_charset8::@5
gfx_init_plane_charset8::@5: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@3
[59] (byte~) gfx_init_plane_charset8::c#3 ← (byte) gfx_init_plane_charset8::col#2
to:gfx_init_plane_charset8::@4
gfx_init_plane_charset8::@4: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5
[60] (byte) gfx_init_plane_charset8::c#2 ← phi( gfx_init_plane_charset8::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 gfx_init_plane_charset8::@5/(byte~) gfx_init_plane_charset8::c#3 )
[60] (byte) gfx_init_plane_charset8::c#2 ← phi( gfx_init_plane_charset8::@3/(byte) 0 gfx_init_plane_charset8::@5/(byte~) gfx_init_plane_charset8::c#3 )
[61] *((byte*) gfx_init_plane_charset8::gfxa#2) ← (byte) gfx_init_plane_charset8::c#2
[62] (byte*) gfx_init_plane_charset8::gfxa#1 ← ++ (byte*) gfx_init_plane_charset8::gfxa#2
[63] (byte) gfx_init_plane_charset8::bits#1 ← (byte) gfx_init_plane_charset8::bits#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[63] (byte) gfx_init_plane_charset8::bits#1 ← (byte) gfx_init_plane_charset8::bits#2 << (byte) 1
[64] (byte) gfx_init_plane_charset8::col#1 ← ++ (byte) gfx_init_plane_charset8::col#2
[65] (byte) gfx_init_plane_charset8::cp#1 ← ++ (byte) gfx_init_plane_charset8::cp#2
[66] if((byte) gfx_init_plane_charset8::cp#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto gfx_init_plane_charset8::@3
[66] if((byte) gfx_init_plane_charset8::cp#1!=(byte) 8) goto gfx_init_plane_charset8::@3
to:gfx_init_plane_charset8::@6
gfx_init_plane_charset8::@6: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@4
[67] (byte) gfx_init_plane_charset8::cr#1 ← ++ (byte) gfx_init_plane_charset8::cr#6
[68] if((byte) gfx_init_plane_charset8::cr#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto gfx_init_plane_charset8::@2
[68] if((byte) gfx_init_plane_charset8::cr#1!=(byte) 8) goto gfx_init_plane_charset8::@2
to:gfx_init_plane_charset8::@7
gfx_init_plane_charset8::@7: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@6
[69] (byte) gfx_init_plane_charset8::ch#1 ← ++ (byte) gfx_init_plane_charset8::ch#8
[70] if((byte) gfx_init_plane_charset8::ch#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_init_plane_charset8::@1
[70] if((byte) gfx_init_plane_charset8::ch#1!=(byte) 0) goto gfx_init_plane_charset8::@1
to:gfx_init_plane_charset8::@8
gfx_init_plane_charset8::@8: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@7
[71] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0
@ -129,7 +129,7 @@ gfx_init_plane_charset8::@return: scope:[gfx_init_plane_charset8] from gfx_init
[73] return
to:@return
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_charset8 gfx_init_plane_charset8::@8
[74] (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 ← phi( gfx_init_plane_charset8/(const byte) gfx_init_plane_charset8::gfxbCpuBank#0 gfx_init_plane_charset8::@8/((byte))(word/signed word/dword/signed dword) $4000/(word/signed word/dword/signed dword) $4000 )
[74] (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 ← phi( gfx_init_plane_charset8/(const byte) gfx_init_plane_charset8::gfxbCpuBank#0 gfx_init_plane_charset8::@8/(byte)(number) $4000/(number) $4000 )
[75] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#2
asm { .byte$32,$dd lda$ff .byte$32,$00 }
to:dtvSetCpuBankSegment1::@return
@ -141,23 +141,23 @@ gfx_init_screen0: scope:[gfx_init_screen0] from gfx_init
to:gfx_init_screen0::@1
gfx_init_screen0::@1: scope:[gfx_init_screen0] from gfx_init_screen0 gfx_init_screen0::@3
[79] (byte*) gfx_init_screen0::ch#3 ← phi( gfx_init_screen0/(const byte*) SCREEN#0 gfx_init_screen0::@3/(byte*) gfx_init_screen0::ch#1 )
[79] (byte) gfx_init_screen0::cy#4 ← phi( gfx_init_screen0/(byte/signed byte/word/signed word/dword/signed dword) 0 gfx_init_screen0::@3/(byte) gfx_init_screen0::cy#1 )
[79] (byte) gfx_init_screen0::cy#4 ← phi( gfx_init_screen0/(byte) 0 gfx_init_screen0::@3/(byte) gfx_init_screen0::cy#1 )
to:gfx_init_screen0::@2
gfx_init_screen0::@2: scope:[gfx_init_screen0] from gfx_init_screen0::@1 gfx_init_screen0::@2
[80] (byte*) gfx_init_screen0::ch#2 ← phi( gfx_init_screen0::@1/(byte*) gfx_init_screen0::ch#3 gfx_init_screen0::@2/(byte*) gfx_init_screen0::ch#1 )
[80] (byte) gfx_init_screen0::cx#2 ← phi( gfx_init_screen0::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 gfx_init_screen0::@2/(byte) gfx_init_screen0::cx#1 )
[81] (byte~) gfx_init_screen0::$0 ← (byte) gfx_init_screen0::cy#4 & (byte/signed byte/word/signed word/dword/signed dword) $f
[82] (byte~) gfx_init_screen0::$1 ← (byte~) gfx_init_screen0::$0 << (byte/signed byte/word/signed word/dword/signed dword) 4
[83] (byte~) gfx_init_screen0::$2 ← (byte) gfx_init_screen0::cx#2 & (byte/signed byte/word/signed word/dword/signed dword) $f
[80] (byte) gfx_init_screen0::cx#2 ← phi( gfx_init_screen0::@1/(byte) 0 gfx_init_screen0::@2/(byte) gfx_init_screen0::cx#1 )
[81] (byte~) gfx_init_screen0::$0 ← (byte) gfx_init_screen0::cy#4 & (byte) $f
[82] (byte~) gfx_init_screen0::$1 ← (byte~) gfx_init_screen0::$0 << (byte) 4
[83] (byte~) gfx_init_screen0::$2 ← (byte) gfx_init_screen0::cx#2 & (byte) $f
[84] (byte~) gfx_init_screen0::$3 ← (byte~) gfx_init_screen0::$1 | (byte~) gfx_init_screen0::$2
[85] *((byte*) gfx_init_screen0::ch#2) ← (byte~) gfx_init_screen0::$3
[86] (byte*) gfx_init_screen0::ch#1 ← ++ (byte*) gfx_init_screen0::ch#2
[87] (byte) gfx_init_screen0::cx#1 ← ++ (byte) gfx_init_screen0::cx#2
[88] if((byte) gfx_init_screen0::cx#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto gfx_init_screen0::@2
[88] if((byte) gfx_init_screen0::cx#1!=(byte) $28) goto gfx_init_screen0::@2
to:gfx_init_screen0::@3
gfx_init_screen0::@3: scope:[gfx_init_screen0] from gfx_init_screen0::@2
[89] (byte) gfx_init_screen0::cy#1 ← ++ (byte) gfx_init_screen0::cy#4
[90] if((byte) gfx_init_screen0::cy#1!=(byte/signed byte/word/signed word/dword/signed dword) $19) goto gfx_init_screen0::@1
[90] if((byte) gfx_init_screen0::cy#1!=(byte) $19) goto gfx_init_screen0::@1
to:gfx_init_screen0::@return
gfx_init_screen0::@return: scope:[gfx_init_screen0] from gfx_init_screen0::@3
[91] return

File diff suppressed because it is too large Load Diff

@ -1,190 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = ((byte*))(word/dword/signed dword) $d020
(byte*) CHARGEN
(const byte*) CHARGEN#0 CHARGEN = ((byte*))(word/dword/signed dword) $d000
(byte*) CHARSET8
(const byte*) CHARSET8#0 CHARSET8 = ((byte*))(word/dword/signed dword) $8000
(byte*) CIA2_PORT_A
(const byte*) CIA2_PORT_A#0 CIA2_PORT_A = ((byte*))(word/dword/signed dword) $dd00
(byte*) CIA2_PORT_A_DDR
(const byte*) CIA2_PORT_A_DDR#0 CIA2_PORT_A_DDR = ((byte*))(word/dword/signed dword) $dd02
(byte) DTV_BADLINE_OFF
(const byte) DTV_BADLINE_OFF#0 DTV_BADLINE_OFF = (byte/signed byte/word/signed word/dword/signed dword) $20
(byte) DTV_CHUNKY
(const byte) DTV_CHUNKY#0 DTV_CHUNKY = (byte/signed byte/word/signed word/dword/signed dword) $40
(byte*) DTV_CONTROL
(const byte*) DTV_CONTROL#0 DTV_CONTROL = ((byte*))(word/dword/signed dword) $d03c
(byte*) DTV_FEATURE
(const byte*) DTV_FEATURE#0 DTV_FEATURE = ((byte*))(word/dword/signed dword) $d03f
(byte) DTV_FEATURE_ENABLE
(const byte) DTV_FEATURE_ENABLE#0 DTV_FEATURE_ENABLE = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_HIGHCOLOR
(const byte) DTV_HIGHCOLOR#0 DTV_HIGHCOLOR = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_LINEAR
(const byte) DTV_LINEAR#0 DTV_LINEAR = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) DTV_PALETTE
(const byte*) DTV_PALETTE#0 DTV_PALETTE = ((byte*))(word/dword/signed dword) $d200
(byte*) DTV_PLANEA_MODULO_HI
(const byte*) DTV_PLANEA_MODULO_HI#0 DTV_PLANEA_MODULO_HI = ((byte*))(word/dword/signed dword) $d039
(byte*) DTV_PLANEA_MODULO_LO
(const byte*) DTV_PLANEA_MODULO_LO#0 DTV_PLANEA_MODULO_LO = ((byte*))(word/dword/signed dword) $d038
(byte*) DTV_PLANEA_START_HI
(const byte*) DTV_PLANEA_START_HI#0 DTV_PLANEA_START_HI = ((byte*))(word/dword/signed dword) $d045
(byte*) DTV_PLANEA_START_LO
(const byte*) DTV_PLANEA_START_LO#0 DTV_PLANEA_START_LO = ((byte*))(word/dword/signed dword) $d03a
(byte*) DTV_PLANEA_START_MI
(const byte*) DTV_PLANEA_START_MI#0 DTV_PLANEA_START_MI = ((byte*))(word/dword/signed dword) $d03b
(byte*) DTV_PLANEA_STEP
(const byte*) DTV_PLANEA_STEP#0 DTV_PLANEA_STEP = ((byte*))(word/dword/signed dword) $d046
(byte*) DTV_PLANEB_MODULO_HI
(const byte*) DTV_PLANEB_MODULO_HI#0 DTV_PLANEB_MODULO_HI = ((byte*))(word/dword/signed dword) $d048
(byte*) DTV_PLANEB_MODULO_LO
(const byte*) DTV_PLANEB_MODULO_LO#0 DTV_PLANEB_MODULO_LO = ((byte*))(word/dword/signed dword) $d047
(byte*) DTV_PLANEB_START_HI
(const byte*) DTV_PLANEB_START_HI#0 DTV_PLANEB_START_HI = ((byte*))(word/dword/signed dword) $d04b
(byte*) DTV_PLANEB_START_LO
(const byte*) DTV_PLANEB_START_LO#0 DTV_PLANEB_START_LO = ((byte*))(word/dword/signed dword) $d049
(byte*) DTV_PLANEB_START_MI
(const byte*) DTV_PLANEB_START_MI#0 DTV_PLANEB_START_MI = ((byte*))(word/dword/signed dword) $d04a
(byte*) DTV_PLANEB_STEP
(const byte*) DTV_PLANEB_STEP#0 DTV_PLANEB_STEP = ((byte*))(word/dword/signed dword) $d04c
(byte*) PROCPORT
(const byte*) PROCPORT#0 PROCPORT = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) PROCPORT_DDR
(const byte*) PROCPORT_DDR#0 PROCPORT_DDR = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 0
(byte) PROCPORT_DDR_MEMORY_MASK
(const byte) PROCPORT_DDR_MEMORY_MASK#0 PROCPORT_DDR_MEMORY_MASK = (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) PROCPORT_RAM_CHARROM
(const byte) PROCPORT_RAM_CHARROM#0 PROCPORT_RAM_CHARROM = (byte/signed byte/word/signed word/dword/signed dword) $31
(byte) PROCPORT_RAM_IO
(const byte) PROCPORT_RAM_IO#0 PROCPORT_RAM_IO = (byte/signed byte/word/signed word/dword/signed dword) $35
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) $d012
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $7c00
(byte*) VIC_CONTROL
(const byte*) VIC_CONTROL#0 VIC_CONTROL = ((byte*))(word/dword/signed dword) $d011
(byte*) VIC_CONTROL2
(const byte*) VIC_CONTROL2#0 VIC_CONTROL2 = ((byte*))(word/dword/signed dword) $d016
(byte) VIC_CSEL
(const byte) VIC_CSEL#0 VIC_CSEL = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) VIC_DEN
(const byte) VIC_DEN#0 VIC_DEN = (byte/signed byte/word/signed word/dword/signed dword) $10
(byte) VIC_ECM
(const byte) VIC_ECM#0 VIC_ECM = (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) VIC_MCM
(const byte) VIC_MCM#0 VIC_MCM = (byte/signed byte/word/signed word/dword/signed dword) $10
(byte*) VIC_MEMORY
(const byte*) VIC_MEMORY#0 VIC_MEMORY = ((byte*))(word/dword/signed dword) $d018
(byte) VIC_RSEL
(const byte) VIC_RSEL#0 VIC_RSEL = (byte/signed byte/word/signed word/dword/signed dword) 8
(void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx)
(label) dtvSetCpuBankSegment1::@return
(byte*) dtvSetCpuBankSegment1::cpuBank
(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = ((byte*))(byte/word/signed word/dword/signed dword) $ff
(byte) dtvSetCpuBankSegment1::cpuBankIdx
(byte) dtvSetCpuBankSegment1::cpuBankIdx#2 reg byte a 2.0
(void()) gfx_init()
(label) gfx_init::@1
(label) gfx_init::@return
(void()) gfx_init_plane_charset8()
(byte~) gfx_init_plane_charset8::$10 reg byte a 2002.0
(label) gfx_init_plane_charset8::@1
(label) gfx_init_plane_charset8::@2
(label) gfx_init_plane_charset8::@3
(label) gfx_init_plane_charset8::@4
(label) gfx_init_plane_charset8::@5
(label) gfx_init_plane_charset8::@6
(label) gfx_init_plane_charset8::@7
(label) gfx_init_plane_charset8::@8
(label) gfx_init_plane_charset8::@9
(label) gfx_init_plane_charset8::@return
(byte) gfx_init_plane_charset8::bits
(byte) gfx_init_plane_charset8::bits#0 bits zp ZP_BYTE:6 101.0
(byte) gfx_init_plane_charset8::bits#1 bits zp ZP_BYTE:6 500.5
(byte) gfx_init_plane_charset8::bits#2 bits zp ZP_BYTE:6 443.42857142857144
(byte) gfx_init_plane_charset8::c
(byte) gfx_init_plane_charset8::c#2 reg byte a 2002.0
(byte~) gfx_init_plane_charset8::c#3 reg byte a 2002.0
(byte) gfx_init_plane_charset8::ch
(byte) gfx_init_plane_charset8::ch#1 ch zp ZP_BYTE:2 16.5
(byte) gfx_init_plane_charset8::ch#8 ch zp ZP_BYTE:2 1.2941176470588236
(byte*) gfx_init_plane_charset8::chargen
(byte*) gfx_init_plane_charset8::chargen#1 chargen zp ZP_WORD:3 13.3125
(byte*) gfx_init_plane_charset8::chargen#2 chargen zp ZP_WORD:3 157.0
(byte*) gfx_init_plane_charset8::chargen#3 chargen zp ZP_WORD:3 22.0
(byte) gfx_init_plane_charset8::col
(byte) gfx_init_plane_charset8::col#1 col zp ZP_BYTE:9 302.0
(byte) gfx_init_plane_charset8::col#2 col zp ZP_BYTE:9 388.0
(byte) gfx_init_plane_charset8::col#5 col zp ZP_BYTE:9 71.0
(byte) gfx_init_plane_charset8::col#6 col zp ZP_BYTE:9 22.0
(byte) gfx_init_plane_charset8::cp
(byte) gfx_init_plane_charset8::cp#1 reg byte x 1501.5
(byte) gfx_init_plane_charset8::cp#2 reg byte x 222.44444444444446
(byte) gfx_init_plane_charset8::cr
(byte) gfx_init_plane_charset8::cr#1 cr zp ZP_BYTE:5 151.5
(byte) gfx_init_plane_charset8::cr#6 cr zp ZP_BYTE:5 14.428571428571429
(byte*) gfx_init_plane_charset8::gfxa
(byte*) gfx_init_plane_charset8::gfxa#1 gfxa zp ZP_WORD:7 234.8888888888889
(byte*) gfx_init_plane_charset8::gfxa#2 gfxa zp ZP_WORD:7 517.3333333333334
(byte*) gfx_init_plane_charset8::gfxa#5 gfxa zp ZP_WORD:7 71.0
(byte*) gfx_init_plane_charset8::gfxa#6 gfxa zp ZP_WORD:7 22.0
(byte) gfx_init_plane_charset8::gfxbCpuBank
(const byte) gfx_init_plane_charset8::gfxbCpuBank#0 gfxbCpuBank = ((byte))(const byte*) CHARSET8#0/(word/signed word/dword/signed dword) $4000
(void()) gfx_init_screen0()
(byte~) gfx_init_screen0::$0 reg byte a 202.0
(byte~) gfx_init_screen0::$1 $1 zp ZP_BYTE:5 101.0
(byte~) gfx_init_screen0::$2 reg byte a 202.0
(byte~) gfx_init_screen0::$3 reg byte a 202.0
(label) gfx_init_screen0::@1
(label) gfx_init_screen0::@2
(label) gfx_init_screen0::@3
(label) gfx_init_screen0::@return
(byte*) gfx_init_screen0::ch
(byte*) gfx_init_screen0::ch#1 ch zp ZP_WORD:3 42.599999999999994
(byte*) gfx_init_screen0::ch#2 ch zp ZP_WORD:3 52.33333333333333
(byte*) gfx_init_screen0::ch#3 ch zp ZP_WORD:3 22.0
(byte) gfx_init_screen0::cx
(byte) gfx_init_screen0::cx#1 reg byte x 151.5
(byte) gfx_init_screen0::cx#2 reg byte x 43.285714285714285
(byte) gfx_init_screen0::cy
(byte) gfx_init_screen0::cy#1 cy zp ZP_BYTE:2 16.5
(byte) gfx_init_screen0::cy#4 cy zp ZP_BYTE:2 12.299999999999999
(void()) main()
(byte~) main::$32 reg byte a 202.0
(byte~) main::$33 reg byte a 202.0
(byte~) main::$34 reg byte a 202.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(byte) main::j
(byte) main::j#1 reg byte x 16.5
(byte) main::j#2 reg byte x 22.0
(byte) main::rst
(byte) main::rst#1 reg byte x 57.714285714285715
reg byte x [ main::j#2 main::j#1 ]
zp ZP_BYTE:2 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ]
zp ZP_WORD:3 [ gfx_init_plane_charset8::chargen#2 gfx_init_plane_charset8::chargen#3 gfx_init_plane_charset8::chargen#1 gfx_init_screen0::ch#2 gfx_init_screen0::ch#3 gfx_init_screen0::ch#1 ]
zp ZP_BYTE:5 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 gfx_init_screen0::$1 ]
zp ZP_BYTE:6 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ]
zp ZP_WORD:7 [ gfx_init_plane_charset8::gfxa#2 gfx_init_plane_charset8::gfxa#5 gfx_init_plane_charset8::gfxa#6 gfx_init_plane_charset8::gfxa#1 ]
zp ZP_BYTE:9 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ]
reg byte x [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ]
reg byte a [ gfx_init_plane_charset8::c#2 gfx_init_plane_charset8::c#3 ]
reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#2 ]
reg byte x [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ]
reg byte x [ main::rst#1 ]
reg byte a [ main::$32 ]
reg byte a [ main::$33 ]
reg byte a [ main::$34 ]
reg byte a [ gfx_init_plane_charset8::$10 ]
reg byte a [ gfx_init_screen0::$0 ]
reg byte a [ gfx_init_screen0::$2 ]
reg byte a [ gfx_init_screen0::$3 ]
program

@ -16,59 +16,59 @@ main: scope:[main] from @1
main::@6: scope:[main] from main
[8] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0
[9] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0
[10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte) 3
[11] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0
[12] *((const byte*) DTV_PLANEB_START_LO#0) ← <(const byte*) CHUNKY#0
[12] *((const byte*) DTV_PLANEB_START_LO#0) ← (byte) 0
[13] *((const byte*) DTV_PLANEB_START_MI#0) ← >(const byte*) CHUNKY#0
[14] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[15] *((const byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 8
[16] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[17] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[18] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3
[19] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
[20] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff/(byte/signed byte/word/signed word/dword/signed dword) $40|>((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff/(byte/signed byte/word/signed word/dword/signed dword) 4
[14] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte) 0
[15] *((const byte*) DTV_PLANEB_STEP#0) ← (byte) 8
[16] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte) 0
[17] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte) 0
[18] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte) 3
[19] *((const byte*) CIA2_PORT_A#0) ← (byte) 3^(byte)(word)(const byte*) CHUNKY#0/(word) $4000
[20] *((const byte*) VIC_MEMORY#0) ← (byte) 0
to:main::@1
main::@1: scope:[main] from main::@1 main::@6
[21] (byte) main::j#2 ← phi( main::@1/(byte) main::j#1 main::@6/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[21] (byte) main::j#2 ← phi( main::@1/(byte) main::j#1 main::@6/(byte) 0 )
[22] *((const byte*) DTV_PALETTE#0 + (byte) main::j#2) ← (byte) main::j#2
[23] (byte) main::j#1 ← ++ (byte) main::j#2
[24] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@1
[24] if((byte) main::j#1!=(byte) $10) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@5
asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize }
[26] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[27] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[26] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte) 3
[27] *((const byte*) BORDERCOL#0) ← (byte) 0
to:main::@3
main::@3: scope:[main] from main::@2 main::@3
[28] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $42) goto main::@3
[28] if(*((const byte*) RASTER#0)!=(byte) $42) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@3
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
to:main::@5
main::@5: scope:[main] from main::@4 main::@5
[30] (byte) main::rst#1 ← *((const byte*) RASTER#0)
[31] (byte~) main::$31 ← (byte) main::rst#1 & (byte/signed byte/word/signed word/dword/signed dword) 7
[31] (byte~) main::$31 ← (byte) main::rst#1 & (byte) 7
[32] (byte~) main::$32 ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0 | (byte~) main::$31
[33] *((const byte*) VIC_CONTROL#0) ← (byte~) main::$32
[34] (byte~) main::$33 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4
[34] (byte~) main::$33 ← (byte) main::rst#1 << (byte) 4
[35] *((const byte*) BORDERCOL#0) ← (byte~) main::$33
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
[37] if((byte) main::rst#1!=(byte/word/signed word/dword/signed dword) $f2) goto main::@5
[37] if((byte) main::rst#1!=(byte) $f2) goto main::@5
to:main::@2
gfx_init_chunky: scope:[gfx_init_chunky] from main
[38] phi()
[39] call dtvSetCpuBankSegment1
to:gfx_init_chunky::@1
gfx_init_chunky::@1: scope:[gfx_init_chunky] from gfx_init_chunky gfx_init_chunky::@5
[40] (byte) gfx_init_chunky::gfxbCpuBank#7 ← phi( gfx_init_chunky::@5/(byte) gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky/++((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 )
[40] (byte) gfx_init_chunky::y#6 ← phi( gfx_init_chunky::@5/(byte) gfx_init_chunky::y#1 gfx_init_chunky/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[40] (byte*) gfx_init_chunky::gfxb#5 ← phi( gfx_init_chunky::@5/(byte*) gfx_init_chunky::gfxb#1 gfx_init_chunky/((byte*))(word/signed word/dword/signed dword) $4000 )
[40] (byte) gfx_init_chunky::gfxbCpuBank#7 ← phi( gfx_init_chunky::@5/(byte) gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky/++(byte)(const byte*) CHUNKY#0/(word) $4000 )
[40] (byte) gfx_init_chunky::y#6 ← phi( gfx_init_chunky::@5/(byte) gfx_init_chunky::y#1 gfx_init_chunky/(byte) 0 )
[40] (byte*) gfx_init_chunky::gfxb#5 ← phi( gfx_init_chunky::@5/(byte*) gfx_init_chunky::gfxb#1 gfx_init_chunky/(byte*) 16384 )
to:gfx_init_chunky::@2
gfx_init_chunky::@2: scope:[gfx_init_chunky] from gfx_init_chunky::@1 gfx_init_chunky::@3
[41] (byte) gfx_init_chunky::gfxbCpuBank#4 ← phi( gfx_init_chunky::@1/(byte) gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::@3/(byte) gfx_init_chunky::gfxbCpuBank#8 )
[41] (word) gfx_init_chunky::x#2 ← phi( gfx_init_chunky::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 gfx_init_chunky::@3/(word) gfx_init_chunky::x#1 )
[41] (word) gfx_init_chunky::x#2 ← phi( gfx_init_chunky::@1/(byte) 0 gfx_init_chunky::@3/(word) gfx_init_chunky::x#1 )
[41] (byte*) gfx_init_chunky::gfxb#3 ← phi( gfx_init_chunky::@1/(byte*) gfx_init_chunky::gfxb#5 gfx_init_chunky::@3/(byte*) gfx_init_chunky::gfxb#1 )
[42] if((byte*) gfx_init_chunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_chunky::@3
[42] if((byte*) gfx_init_chunky::gfxb#3!=(word) $8000) goto gfx_init_chunky::@3
to:gfx_init_chunky::@4
gfx_init_chunky::@4: scope:[gfx_init_chunky] from gfx_init_chunky::@2
[43] (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 ← (byte) gfx_init_chunky::gfxbCpuBank#4
@ -79,17 +79,17 @@ gfx_init_chunky::@7: scope:[gfx_init_chunky] from gfx_init_chunky::@4
to:gfx_init_chunky::@3
gfx_init_chunky::@3: scope:[gfx_init_chunky] from gfx_init_chunky::@2 gfx_init_chunky::@7
[46] (byte) gfx_init_chunky::gfxbCpuBank#8 ← phi( gfx_init_chunky::@2/(byte) gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::@7/(byte) gfx_init_chunky::gfxbCpuBank#2 )
[46] (byte*) gfx_init_chunky::gfxb#4 ← phi( gfx_init_chunky::@2/(byte*) gfx_init_chunky::gfxb#3 gfx_init_chunky::@7/((byte*))(word/signed word/dword/signed dword) $4000 )
[46] (byte*) gfx_init_chunky::gfxb#4 ← phi( gfx_init_chunky::@2/(byte*) gfx_init_chunky::gfxb#3 gfx_init_chunky::@7/(byte*) 16384 )
[47] (word~) gfx_init_chunky::$9 ← (word) gfx_init_chunky::x#2 + (byte) gfx_init_chunky::y#6
[48] (byte) gfx_init_chunky::c#0 ← ((byte)) (word~) gfx_init_chunky::$9
[48] (byte) gfx_init_chunky::c#0 ← (byte)(word~) gfx_init_chunky::$9
[49] *((byte*) gfx_init_chunky::gfxb#4) ← (byte) gfx_init_chunky::c#0
[50] (byte*) gfx_init_chunky::gfxb#1 ← ++ (byte*) gfx_init_chunky::gfxb#4
[51] (word) gfx_init_chunky::x#1 ← ++ (word) gfx_init_chunky::x#2
[52] if((word) gfx_init_chunky::x#1!=(word/signed word/dword/signed dword) $140) goto gfx_init_chunky::@2
[52] if((word) gfx_init_chunky::x#1!=(word) $140) goto gfx_init_chunky::@2
to:gfx_init_chunky::@5
gfx_init_chunky::@5: scope:[gfx_init_chunky] from gfx_init_chunky::@3
[53] (byte) gfx_init_chunky::y#1 ← ++ (byte) gfx_init_chunky::y#6
[54] if((byte) gfx_init_chunky::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $33) goto gfx_init_chunky::@1
[54] if((byte) gfx_init_chunky::y#1!=(byte) $33) goto gfx_init_chunky::@1
to:gfx_init_chunky::@6
gfx_init_chunky::@6: scope:[gfx_init_chunky] from gfx_init_chunky::@5
[55] phi()
@ -99,7 +99,7 @@ gfx_init_chunky::@return: scope:[gfx_init_chunky] from gfx_init_chunky::@6
[57] return
to:@return
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_chunky gfx_init_chunky::@4 gfx_init_chunky::@6
[58] (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 ← phi( gfx_init_chunky/((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 gfx_init_chunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_chunky::@6/((byte))(word/signed word/dword/signed dword) $4000/(word/signed word/dword/signed dword) $4000 )
[58] (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 ← phi( gfx_init_chunky/(byte)(const byte*) CHUNKY#0/(word) $4000 gfx_init_chunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_chunky::@6/(byte)(number) $4000/(number) $4000 )
[59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3
asm { .byte$32,$dd lda$ff .byte$32,$00 }
to:dtvSetCpuBankSegment1::@return

File diff suppressed because it is too large Load Diff

@ -1,130 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = ((byte*))(word/dword/signed dword) $d020
(byte*) CHUNKY
(const byte*) CHUNKY#0 CHUNKY = ((byte*))(word/dword/signed dword) $8000
(byte*) CIA2_PORT_A
(const byte*) CIA2_PORT_A#0 CIA2_PORT_A = ((byte*))(word/dword/signed dword) $dd00
(byte*) CIA2_PORT_A_DDR
(const byte*) CIA2_PORT_A_DDR#0 CIA2_PORT_A_DDR = ((byte*))(word/dword/signed dword) $dd02
(byte) DTV_BADLINE_OFF
(const byte) DTV_BADLINE_OFF#0 DTV_BADLINE_OFF = (byte/signed byte/word/signed word/dword/signed dword) $20
(byte) DTV_CHUNKY
(const byte) DTV_CHUNKY#0 DTV_CHUNKY = (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) DTV_COLORRAM_OFF
(const byte) DTV_COLORRAM_OFF#0 DTV_COLORRAM_OFF = (byte/signed byte/word/signed word/dword/signed dword) $10
(byte*) DTV_CONTROL
(const byte*) DTV_CONTROL#0 DTV_CONTROL = ((byte*))(word/dword/signed dword) $d03c
(byte*) DTV_FEATURE
(const byte*) DTV_FEATURE#0 DTV_FEATURE = ((byte*))(word/dword/signed dword) $d03f
(byte) DTV_FEATURE_ENABLE
(const byte) DTV_FEATURE_ENABLE#0 DTV_FEATURE_ENABLE = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_HIGHCOLOR
(const byte) DTV_HIGHCOLOR#0 DTV_HIGHCOLOR = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_LINEAR
(const byte) DTV_LINEAR#0 DTV_LINEAR = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) DTV_PALETTE
(const byte*) DTV_PALETTE#0 DTV_PALETTE = ((byte*))(word/dword/signed dword) $d200
(byte*) DTV_PLANEB_MODULO_HI
(const byte*) DTV_PLANEB_MODULO_HI#0 DTV_PLANEB_MODULO_HI = ((byte*))(word/dword/signed dword) $d048
(byte*) DTV_PLANEB_MODULO_LO
(const byte*) DTV_PLANEB_MODULO_LO#0 DTV_PLANEB_MODULO_LO = ((byte*))(word/dword/signed dword) $d047
(byte*) DTV_PLANEB_START_HI
(const byte*) DTV_PLANEB_START_HI#0 DTV_PLANEB_START_HI = ((byte*))(word/dword/signed dword) $d04b
(byte*) DTV_PLANEB_START_LO
(const byte*) DTV_PLANEB_START_LO#0 DTV_PLANEB_START_LO = ((byte*))(word/dword/signed dword) $d049
(byte*) DTV_PLANEB_START_MI
(const byte*) DTV_PLANEB_START_MI#0 DTV_PLANEB_START_MI = ((byte*))(word/dword/signed dword) $d04a
(byte*) DTV_PLANEB_STEP
(const byte*) DTV_PLANEB_STEP#0 DTV_PLANEB_STEP = ((byte*))(word/dword/signed dword) $d04c
(byte*) PROCPORT
(const byte*) PROCPORT#0 PROCPORT = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) PROCPORT_DDR
(const byte*) PROCPORT_DDR#0 PROCPORT_DDR = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 0
(byte) PROCPORT_DDR_MEMORY_MASK
(const byte) PROCPORT_DDR_MEMORY_MASK#0 PROCPORT_DDR_MEMORY_MASK = (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) PROCPORT_RAM_IO
(const byte) PROCPORT_RAM_IO#0 PROCPORT_RAM_IO = (byte/signed byte/word/signed word/dword/signed dword) $35
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) $d012
(byte*) VIC_CONTROL
(const byte*) VIC_CONTROL#0 VIC_CONTROL = ((byte*))(word/dword/signed dword) $d011
(byte*) VIC_CONTROL2
(const byte*) VIC_CONTROL2#0 VIC_CONTROL2 = ((byte*))(word/dword/signed dword) $d016
(byte) VIC_CSEL
(const byte) VIC_CSEL#0 VIC_CSEL = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) VIC_DEN
(const byte) VIC_DEN#0 VIC_DEN = (byte/signed byte/word/signed word/dword/signed dword) $10
(byte) VIC_ECM
(const byte) VIC_ECM#0 VIC_ECM = (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) VIC_MCM
(const byte) VIC_MCM#0 VIC_MCM = (byte/signed byte/word/signed word/dword/signed dword) $10
(byte*) VIC_MEMORY
(const byte*) VIC_MEMORY#0 VIC_MEMORY = ((byte*))(word/dword/signed dword) $d018
(byte) VIC_RSEL
(const byte) VIC_RSEL#0 VIC_RSEL = (byte/signed byte/word/signed word/dword/signed dword) 8
(void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx)
(label) dtvSetCpuBankSegment1::@return
(byte*) dtvSetCpuBankSegment1::cpuBank
(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = ((byte*))(byte/word/signed word/dword/signed dword) $ff
(byte) dtvSetCpuBankSegment1::cpuBankIdx
(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 reg byte a 202.0
(byte) dtvSetCpuBankSegment1::cpuBankIdx#3 reg byte a 103.0
(void()) gfx_init_chunky()
(word~) gfx_init_chunky::$9 $9 zp ZP_WORD:7 202.0
(label) gfx_init_chunky::@1
(label) gfx_init_chunky::@2
(label) gfx_init_chunky::@3
(label) gfx_init_chunky::@4
(label) gfx_init_chunky::@5
(label) gfx_init_chunky::@6
(label) gfx_init_chunky::@7
(label) gfx_init_chunky::@return
(byte) gfx_init_chunky::c
(byte) gfx_init_chunky::c#0 reg byte a 202.0
(byte*) gfx_init_chunky::gfxb
(byte*) gfx_init_chunky::gfxb#1 gfxb zp ZP_WORD:5 42.599999999999994
(byte*) gfx_init_chunky::gfxb#3 gfxb zp ZP_WORD:5 157.0
(byte*) gfx_init_chunky::gfxb#4 gfxb zp ZP_WORD:5 75.75
(byte*) gfx_init_chunky::gfxb#5 gfxb zp ZP_WORD:5 22.0
(byte) gfx_init_chunky::gfxbCpuBank
(byte) gfx_init_chunky::gfxbCpuBank#2 reg byte x 202.0
(byte) gfx_init_chunky::gfxbCpuBank#4 reg byte x 103.75
(byte) gfx_init_chunky::gfxbCpuBank#7 reg byte x 22.0
(byte) gfx_init_chunky::gfxbCpuBank#8 reg byte x 34.888888888888886
(word) gfx_init_chunky::x
(word) gfx_init_chunky::x#1 x zp ZP_WORD:3 151.5
(word) gfx_init_chunky::x#2 x zp ZP_WORD:3 30.299999999999997
(byte) gfx_init_chunky::y
(byte) gfx_init_chunky::y#1 y zp ZP_BYTE:2 16.5
(byte) gfx_init_chunky::y#6 y zp ZP_BYTE:2 9.461538461538462
(void()) main()
(byte~) main::$31 reg byte a 202.0
(byte~) main::$32 reg byte a 202.0
(byte~) main::$33 reg byte a 202.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(byte) main::j
(byte) main::j#1 reg byte x 16.5
(byte) main::j#2 reg byte x 22.0
(byte) main::rst
(byte) main::rst#1 reg byte x 57.714285714285715
reg byte x [ main::j#2 main::j#1 ]
zp ZP_BYTE:2 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
zp ZP_WORD:3 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ]
reg byte x [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ]
zp ZP_WORD:5 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ]
reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
reg byte x [ main::rst#1 ]
reg byte a [ main::$31 ]
reg byte a [ main::$32 ]
reg byte a [ main::$33 ]
zp ZP_WORD:7 [ gfx_init_chunky::$9 ]
reg byte a [ gfx_init_chunky::c#0 ]
program

@ -0,0 +1,50 @@
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0
[5] *((const byte*) DTV_BLITTER_CONTROL2#0) ← (const byte) DTV_BLIT_CLEAR_IRQ#0
[6] *((const byte*) DTV_BLITTER_SRCA_LO#0) ← <(const byte[]) SRCA#0
[7] *((const byte*) DTV_BLITTER_SRCA_MI#0) ← >(const byte[]) SRCA#0
[8] *((const byte*) DTV_BLITTER_SRCA_HI#0) ← (byte) 0
[9] *((const byte*) DTV_BLITTER_SRCA_MOD_LO#0) ← (byte) 0
[10] *((const byte*) DTV_BLITTER_SRCA_MOD_HI#0) ← (byte) 0
[11] *((const byte*) DTV_BLITTER_SRCA_LIN_LO#0) ← (byte) 0
[12] *((const byte*) DTV_BLITTER_SRCA_LIN_HI#0) ← >(word) $100
[13] *((const byte*) DTV_BLITTER_SRCA_STEP#0) ← (byte) 1
[14] *((const byte*) DTV_BLITTER_SRCB_LO#0) ← <(const byte[]) SRCB#0
[15] *((const byte*) DTV_BLITTER_SRCB_MI#0) ← >(const byte[]) SRCB#0
[16] *((const byte*) DTV_BLITTER_SRCB_HI#0) ← (byte) 0
[17] *((const byte*) DTV_BLITTER_SRCB_MOD_LO#0) ← (byte) 0
[18] *((const byte*) DTV_BLITTER_SRCB_MOD_HI#0) ← (byte) 0
[19] *((const byte*) DTV_BLITTER_SRCB_LIN_LO#0) ← (byte) 0
[20] *((const byte*) DTV_BLITTER_SRCB_LIN_HI#0) ← >(word) $100
[21] *((const byte*) DTV_BLITTER_SRCB_STEP#0) ← (byte) 0
[22] *((const byte*) DTV_BLITTER_DEST_LO#0) ← <(const byte*) SCREEN#0+(byte) $28+(byte) 5
[23] *((const byte*) DTV_BLITTER_DEST_MI#0) ← >(const byte*) SCREEN#0+(byte) $28+(byte) 5
[24] *((const byte*) DTV_BLITTER_DEST_HI#0) ← (byte) 0
[25] *((const byte*) DTV_BLITTER_DEST_MOD_LO#0) ← <(word) $15
[26] *((const byte*) DTV_BLITTER_DEST_MOD_HI#0) ← (byte) 0
[27] *((const byte*) DTV_BLITTER_DEST_LIN_LO#0) ← <(word) $13
[28] *((const byte*) DTV_BLITTER_DEST_LIN_HI#0) ← (byte) 0
[29] *((const byte*) DTV_BLITTER_DEST_STEP#0) ← (byte) $10
[30] *((const byte*) DTV_BLITTER_LEN_LO#0) ← <(byte) $14*(word) $a
[31] *((const byte*) DTV_BLITTER_LEN_HI#0) ← (byte) 0
[32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD#0
[33] *((const byte*) DTV_BLITTER_TRANSPARANCY#0) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE#0
[34] *((const byte*) DTV_BLITTER_CONTROL#0) ← (const byte) DTV_BLIT_FORCE_START#0|(const byte) DTV_BLIT_SRCA_FWD#0|(const byte) DTV_BLIT_SRCB_FWD#0|(const byte) DTV_BLIT_DEST_FWD#0
[35] *((const byte*) DTV_BLITTER_CONTROL2#0) ← (const byte) DTV_BLIT_DEST_CONT#0
to:main::@1
main::@1: scope:[main] from main main::@1
[36] (byte~) main::$25 ← *((const byte*) DTV_BLITTER_CONTROL2#0) & (const byte) DTV_BLIT_STATUS_BUSY#0
[37] if((byte~) main::$25!=(byte) 0) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[38] return
to:@return

File diff suppressed because it is too large Load Diff

@ -0,0 +1 @@
program

@ -12,44 +12,44 @@ main: scope:[main] from @1
[5] *((const byte*) DTV_BLITTER_CONTROL2#0) ← (const byte) DTV_BLIT_CLEAR_IRQ#0
[6] *((const byte*) DTV_BLITTER_SRCA_LO#0) ← <(const byte[]) SRCA#0
[7] *((const byte*) DTV_BLITTER_SRCA_MI#0) ← >(const byte[]) SRCA#0
[8] *((const byte*) DTV_BLITTER_SRCA_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[9] *((const byte*) DTV_BLITTER_SRCA_MOD_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[10] *((const byte*) DTV_BLITTER_SRCA_MOD_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[11] *((const byte*) DTV_BLITTER_SRCA_LIN_LO#0) ← <(word/signed word/dword/signed dword) $100
[12] *((const byte*) DTV_BLITTER_SRCA_LIN_HI#0) ← >(word/signed word/dword/signed dword) $100
[13] *((const byte*) DTV_BLITTER_SRCA_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) $10
[8] *((const byte*) DTV_BLITTER_SRCA_HI#0) ← (byte) 0
[9] *((const byte*) DTV_BLITTER_SRCA_MOD_LO#0) ← (byte) 0
[10] *((const byte*) DTV_BLITTER_SRCA_MOD_HI#0) ← (byte) 0
[11] *((const byte*) DTV_BLITTER_SRCA_LIN_LO#0) ← (byte) 0
[12] *((const byte*) DTV_BLITTER_SRCA_LIN_HI#0) ← >(word) $100
[13] *((const byte*) DTV_BLITTER_SRCA_STEP#0) ← (byte) $10
[14] *((const byte*) DTV_BLITTER_SRCB_LO#0) ← <(const byte[]) SRCB#0
[15] *((const byte*) DTV_BLITTER_SRCB_MI#0) ← >(const byte[]) SRCB#0
[16] *((const byte*) DTV_BLITTER_SRCB_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[17] *((const byte*) DTV_BLITTER_SRCB_MOD_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[18] *((const byte*) DTV_BLITTER_SRCB_MOD_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[19] *((const byte*) DTV_BLITTER_SRCB_LIN_LO#0) ← <(word/signed word/dword/signed dword) $100
[20] *((const byte*) DTV_BLITTER_SRCB_LIN_HI#0) ← >(word/signed word/dword/signed dword) $100
[21] *((const byte*) DTV_BLITTER_SRCB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[22] *((const byte*) DTV_BLITTER_DEST_LO#0) ← <(const byte*) SCREEN#0
[16] *((const byte*) DTV_BLITTER_SRCB_HI#0) ← (byte) 0
[17] *((const byte*) DTV_BLITTER_SRCB_MOD_LO#0) ← (byte) 0
[18] *((const byte*) DTV_BLITTER_SRCB_MOD_HI#0) ← (byte) 0
[19] *((const byte*) DTV_BLITTER_SRCB_LIN_LO#0) ← (byte) 0
[20] *((const byte*) DTV_BLITTER_SRCB_LIN_HI#0) ← >(word) $100
[21] *((const byte*) DTV_BLITTER_SRCB_STEP#0) ← (byte) 0
[22] *((const byte*) DTV_BLITTER_DEST_LO#0) ← (byte) 0
[23] *((const byte*) DTV_BLITTER_DEST_MI#0) ← >(const byte*) SCREEN#0
[24] *((const byte*) DTV_BLITTER_DEST_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[25] *((const byte*) DTV_BLITTER_DEST_MOD_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[26] *((const byte*) DTV_BLITTER_DEST_MOD_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[27] *((const byte*) DTV_BLITTER_DEST_LIN_LO#0) ← <(word/signed word/dword/signed dword) $100
[28] *((const byte*) DTV_BLITTER_DEST_LIN_HI#0) ← >(word/signed word/dword/signed dword) $100
[29] *((const byte*) DTV_BLITTER_DEST_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) $10
[24] *((const byte*) DTV_BLITTER_DEST_HI#0) ← (byte) 0
[25] *((const byte*) DTV_BLITTER_DEST_MOD_LO#0) ← (byte) 0
[26] *((const byte*) DTV_BLITTER_DEST_MOD_HI#0) ← (byte) 0
[27] *((const byte*) DTV_BLITTER_DEST_LIN_LO#0) ← (byte) 0
[28] *((const byte*) DTV_BLITTER_DEST_LIN_HI#0) ← >(word) $100
[29] *((const byte*) DTV_BLITTER_DEST_STEP#0) ← (byte) $10
[30] *((const byte*) DTV_BLITTER_LEN_LO#0) ← (const byte) SRCA_LEN#0
[31] *((const byte*) DTV_BLITTER_LEN_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[31] *((const byte*) DTV_BLITTER_LEN_HI#0) ← (byte) 0
[32] *((const byte*) DTV_BLITTER_ALU#0) ← (const byte) DTV_BLIT_ADD#0
[33] *((const byte*) DTV_BLITTER_TRANSPARANCY#0) ← (const byte) DTV_BLIT_TRANSPARANCY_NONE#0
[34] *((const byte*) DTV_BLITTER_CONTROL#0) ← (const byte) DTV_BLIT_FORCE_START#0|(const byte) DTV_BLIT_SRCA_FWD#0|(const byte) DTV_BLIT_SRCB_FWD#0|(const byte) DTV_BLIT_DEST_FWD#0
[35] *((const byte*) DTV_BLITTER_CONTROL2#0) ← (const byte) DTV_BLIT_DEST_CONT#0
to:main::@1
main::@1: scope:[main] from main main::@1 main::@2
[36] (byte) main::r#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::r#1 )
[36] (byte) main::r#2 ← phi( main/(byte) 0 main::@2/(byte) main::r#1 )
[37] (byte~) main::$15 ← *((const byte*) DTV_BLITTER_CONTROL2#0) & (const byte) DTV_BLIT_STATUS_BUSY#0
[38] if((byte~) main::$15!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1
[38] if((byte~) main::$15!=(byte) 0) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[39] *((const byte*) DTV_BLITTER_CONTROL#0) ← (const byte) DTV_BLIT_FORCE_START#0|(const byte) DTV_BLIT_SRCA_FWD#0|(const byte) DTV_BLIT_SRCB_FWD#0|(const byte) DTV_BLIT_DEST_FWD#0
[40] (byte) main::r#1 ← ++ (byte) main::r#2
[41] if((byte) main::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1
[41] if((byte) main::r#1!=(byte) 8) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@2
[42] return

File diff suppressed because it is too large Load Diff

@ -1,104 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) DTV_BLITTER_ALU
(const byte*) DTV_BLITTER_ALU#0 DTV_BLITTER_ALU = ((byte*))(word/dword/signed dword) $d33e
(byte*) DTV_BLITTER_CONTROL
(const byte*) DTV_BLITTER_CONTROL#0 DTV_BLITTER_CONTROL = ((byte*))(word/dword/signed dword) $d33a
(byte*) DTV_BLITTER_CONTROL2
(const byte*) DTV_BLITTER_CONTROL2#0 DTV_BLITTER_CONTROL2 = ((byte*))(word/dword/signed dword) $d33f
(byte*) DTV_BLITTER_DEST_HI
(const byte*) DTV_BLITTER_DEST_HI#0 DTV_BLITTER_DEST_HI = ((byte*))(word/dword/signed dword) $d332
(byte*) DTV_BLITTER_DEST_LIN_HI
(const byte*) DTV_BLITTER_DEST_LIN_HI#0 DTV_BLITTER_DEST_LIN_HI = ((byte*))(word/dword/signed dword) $d336
(byte*) DTV_BLITTER_DEST_LIN_LO
(const byte*) DTV_BLITTER_DEST_LIN_LO#0 DTV_BLITTER_DEST_LIN_LO = ((byte*))(word/dword/signed dword) $d335
(byte*) DTV_BLITTER_DEST_LO
(const byte*) DTV_BLITTER_DEST_LO#0 DTV_BLITTER_DEST_LO = ((byte*))(word/dword/signed dword) $d330
(byte*) DTV_BLITTER_DEST_MI
(const byte*) DTV_BLITTER_DEST_MI#0 DTV_BLITTER_DEST_MI = ((byte*))(word/dword/signed dword) $d331
(byte*) DTV_BLITTER_DEST_MOD_HI
(const byte*) DTV_BLITTER_DEST_MOD_HI#0 DTV_BLITTER_DEST_MOD_HI = ((byte*))(word/dword/signed dword) $d334
(byte*) DTV_BLITTER_DEST_MOD_LO
(const byte*) DTV_BLITTER_DEST_MOD_LO#0 DTV_BLITTER_DEST_MOD_LO = ((byte*))(word/dword/signed dword) $d333
(byte*) DTV_BLITTER_DEST_STEP
(const byte*) DTV_BLITTER_DEST_STEP#0 DTV_BLITTER_DEST_STEP = ((byte*))(word/dword/signed dword) $d337
(byte*) DTV_BLITTER_LEN_HI
(const byte*) DTV_BLITTER_LEN_HI#0 DTV_BLITTER_LEN_HI = ((byte*))(word/dword/signed dword) $d339
(byte*) DTV_BLITTER_LEN_LO
(const byte*) DTV_BLITTER_LEN_LO#0 DTV_BLITTER_LEN_LO = ((byte*))(word/dword/signed dword) $d338
(byte*) DTV_BLITTER_SRCA_HI
(const byte*) DTV_BLITTER_SRCA_HI#0 DTV_BLITTER_SRCA_HI = ((byte*))(word/dword/signed dword) $d322
(byte*) DTV_BLITTER_SRCA_LIN_HI
(const byte*) DTV_BLITTER_SRCA_LIN_HI#0 DTV_BLITTER_SRCA_LIN_HI = ((byte*))(word/dword/signed dword) $d326
(byte*) DTV_BLITTER_SRCA_LIN_LO
(const byte*) DTV_BLITTER_SRCA_LIN_LO#0 DTV_BLITTER_SRCA_LIN_LO = ((byte*))(word/dword/signed dword) $d325
(byte*) DTV_BLITTER_SRCA_LO
(const byte*) DTV_BLITTER_SRCA_LO#0 DTV_BLITTER_SRCA_LO = ((byte*))(word/dword/signed dword) $d320
(byte*) DTV_BLITTER_SRCA_MI
(const byte*) DTV_BLITTER_SRCA_MI#0 DTV_BLITTER_SRCA_MI = ((byte*))(word/dword/signed dword) $d321
(byte*) DTV_BLITTER_SRCA_MOD_HI
(const byte*) DTV_BLITTER_SRCA_MOD_HI#0 DTV_BLITTER_SRCA_MOD_HI = ((byte*))(word/dword/signed dword) $d324
(byte*) DTV_BLITTER_SRCA_MOD_LO
(const byte*) DTV_BLITTER_SRCA_MOD_LO#0 DTV_BLITTER_SRCA_MOD_LO = ((byte*))(word/dword/signed dword) $d323
(byte*) DTV_BLITTER_SRCA_STEP
(const byte*) DTV_BLITTER_SRCA_STEP#0 DTV_BLITTER_SRCA_STEP = ((byte*))(word/dword/signed dword) $d327
(byte*) DTV_BLITTER_SRCB_HI
(const byte*) DTV_BLITTER_SRCB_HI#0 DTV_BLITTER_SRCB_HI = ((byte*))(word/dword/signed dword) $d32a
(byte*) DTV_BLITTER_SRCB_LIN_HI
(const byte*) DTV_BLITTER_SRCB_LIN_HI#0 DTV_BLITTER_SRCB_LIN_HI = ((byte*))(word/dword/signed dword) $d32e
(byte*) DTV_BLITTER_SRCB_LIN_LO
(const byte*) DTV_BLITTER_SRCB_LIN_LO#0 DTV_BLITTER_SRCB_LIN_LO = ((byte*))(word/dword/signed dword) $d32d
(byte*) DTV_BLITTER_SRCB_LO
(const byte*) DTV_BLITTER_SRCB_LO#0 DTV_BLITTER_SRCB_LO = ((byte*))(word/dword/signed dword) $d328
(byte*) DTV_BLITTER_SRCB_MI
(const byte*) DTV_BLITTER_SRCB_MI#0 DTV_BLITTER_SRCB_MI = ((byte*))(word/dword/signed dword) $d329
(byte*) DTV_BLITTER_SRCB_MOD_HI
(const byte*) DTV_BLITTER_SRCB_MOD_HI#0 DTV_BLITTER_SRCB_MOD_HI = ((byte*))(word/dword/signed dword) $d32c
(byte*) DTV_BLITTER_SRCB_MOD_LO
(const byte*) DTV_BLITTER_SRCB_MOD_LO#0 DTV_BLITTER_SRCB_MOD_LO = ((byte*))(word/dword/signed dword) $d32b
(byte*) DTV_BLITTER_SRCB_STEP
(const byte*) DTV_BLITTER_SRCB_STEP#0 DTV_BLITTER_SRCB_STEP = ((byte*))(word/dword/signed dword) $d32f
(byte*) DTV_BLITTER_TRANSPARANCY
(const byte*) DTV_BLITTER_TRANSPARANCY#0 DTV_BLITTER_TRANSPARANCY = ((byte*))(word/dword/signed dword) $d33b
(byte) DTV_BLIT_ADD
(const byte) DTV_BLIT_ADD#0 DTV_BLIT_ADD = (byte/signed byte/word/signed word/dword/signed dword) $30
(byte) DTV_BLIT_CLEAR_IRQ
(const byte) DTV_BLIT_CLEAR_IRQ#0 DTV_BLIT_CLEAR_IRQ = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_DEST_CONT
(const byte) DTV_BLIT_DEST_CONT#0 DTV_BLIT_DEST_CONT = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) DTV_BLIT_DEST_FWD
(const byte) DTV_BLIT_DEST_FWD#0 DTV_BLIT_DEST_FWD = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) DTV_BLIT_FORCE_START
(const byte) DTV_BLIT_FORCE_START#0 DTV_BLIT_FORCE_START = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_SRCA_FWD
(const byte) DTV_BLIT_SRCA_FWD#0 DTV_BLIT_SRCA_FWD = (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) DTV_BLIT_SRCB_FWD
(const byte) DTV_BLIT_SRCB_FWD#0 DTV_BLIT_SRCB_FWD = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_BLIT_STATUS_BUSY
(const byte) DTV_BLIT_STATUS_BUSY#0 DTV_BLIT_STATUS_BUSY = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_TRANSPARANCY_NONE
(const byte) DTV_BLIT_TRANSPARANCY_NONE#0 DTV_BLIT_TRANSPARANCY_NONE = (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) DTV_FEATURE
(const byte*) DTV_FEATURE#0 DTV_FEATURE = ((byte*))(word/dword/signed dword) $d03f
(byte) DTV_FEATURE_ENABLE
(const byte) DTV_FEATURE_ENABLE#0 DTV_FEATURE_ENABLE = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte[]) SRCA
(const byte[]) SRCA#0 SRCA = { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
(byte) SRCA_LEN
(const byte) SRCA_LEN#0 SRCA_LEN = (byte/signed byte/word/signed word/dword/signed dword) 9
(byte[]) SRCB
(const byte[]) SRCB#0 SRCB = { (byte/word/signed word/dword/signed dword) $80 }
(void()) main()
(byte~) main::$15 reg byte a 202.0
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::r
(byte) main::r#1 reg byte x 16.5
(byte) main::r#2 reg byte x 5.5
reg byte x [ main::r#2 main::r#1 ]
reg byte a [ main::$15 ]
program

@ -13,22 +13,22 @@ main: scope:[main] from @1
[6] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0|(const byte) DTV_BADLINE_OFF#0
to:main::@1
main::@1: scope:[main] from main main::@1 main::@4
[7] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $40) goto main::@1
[7] if(*((const byte*) RASTER#0)!=(byte) $40) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[8] *((const byte*) BGCOL#0) ← (byte) 0
to:main::@3
main::@3: scope:[main] from main::@2 main::@3
[9] (byte) main::r#2 ← phi( main::@3/(byte) main::r#1 main::@2/(byte/signed byte/word/signed word/dword/signed dword) $31 )
[9] (byte) main::r#2 ← phi( main::@3/(byte) main::r#1 main::@2/(byte) $31 )
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
[11] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0)
[12] (byte) main::r#1 ← ++ (byte) main::r#2
[13] if((byte) main::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3
[13] if((byte) main::r#1!=(byte) 0) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@3 main::@4
[14] (byte) main::c#2 ← phi( main::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::c#1 )
[14] (byte) main::c#2 ← phi( main::@3/(byte) 0 main::@4/(byte) main::c#1 )
[15] *((const byte*) DTV_PALETTE#0 + (byte) main::c#2) ← *((const byte[$10]) main::palette#0 + (byte) main::c#2)
[16] *((const byte[$10]) main::palette#0 + (byte) main::c#2) ← ++ *((const byte[$10]) main::palette#0 + (byte) main::c#2)
[17] (byte) main::c#1 ← ++ (byte) main::c#2
[18] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@4
[18] if((byte) main::c#1!=(byte) $10) goto main::@4
to:main::@1

@ -1,20 +1,129 @@
Adding pointer type conversion cast (byte*) PROCPORT_DDR in (byte*) PROCPORT_DDR ← (number) 0
Adding pointer type conversion cast (byte*) PROCPORT in (byte*) PROCPORT ← (number) 1
Adding pointer type conversion cast (byte*) CHARGEN in (byte*) CHARGEN ← (number) $d000
Adding pointer type conversion cast (byte*) SPRITES_XPOS in (byte*) SPRITES_XPOS ← (number) $d000
Adding pointer type conversion cast (byte*) SPRITES_YPOS in (byte*) SPRITES_YPOS ← (number) $d001
Adding pointer type conversion cast (byte*) SPRITES_XMSB in (byte*) SPRITES_XMSB ← (number) $d010
Adding pointer type conversion cast (byte*) RASTER in (byte*) RASTER ← (number) $d012
Adding pointer type conversion cast (byte*) SPRITES_ENABLE in (byte*) SPRITES_ENABLE ← (number) $d015
Adding pointer type conversion cast (byte*) SPRITES_EXPAND_Y in (byte*) SPRITES_EXPAND_Y ← (number) $d017
Adding pointer type conversion cast (byte*) SPRITES_PRIORITY in (byte*) SPRITES_PRIORITY ← (number) $d01b
Adding pointer type conversion cast (byte*) SPRITES_MC in (byte*) SPRITES_MC ← (number) $d01c
Adding pointer type conversion cast (byte*) SPRITES_EXPAND_X in (byte*) SPRITES_EXPAND_X ← (number) $d01d
Adding pointer type conversion cast (byte*) BORDERCOL in (byte*) BORDERCOL ← (number) $d020
Adding pointer type conversion cast (byte*) BGCOL in (byte*) BGCOL ← (number) $d021
Adding pointer type conversion cast (byte*) BGCOL1 in (byte*) BGCOL1 ← (number) $d021
Adding pointer type conversion cast (byte*) BGCOL2 in (byte*) BGCOL2 ← (number) $d022
Adding pointer type conversion cast (byte*) BGCOL3 in (byte*) BGCOL3 ← (number) $d023
Adding pointer type conversion cast (byte*) BGCOL4 in (byte*) BGCOL4 ← (number) $d024
Adding pointer type conversion cast (byte*) SPRITES_MC1 in (byte*) SPRITES_MC1 ← (number) $d025
Adding pointer type conversion cast (byte*) SPRITES_MC2 in (byte*) SPRITES_MC2 ← (number) $d026
Adding pointer type conversion cast (byte*) SPRITES_COLS in (byte*) SPRITES_COLS ← (number) $d027
Adding pointer type conversion cast (byte*) VIC_CONTROL in (byte*) VIC_CONTROL ← (number) $d011
Adding pointer type conversion cast (byte*) D011 in (byte*) D011 ← (number) $d011
Adding pointer type conversion cast (byte*) VIC_CONTROL2 in (byte*) VIC_CONTROL2 ← (number) $d016
Adding pointer type conversion cast (byte*) D016 in (byte*) D016 ← (number) $d016
Adding pointer type conversion cast (byte*) D018 in (byte*) D018 ← (number) $d018
Adding pointer type conversion cast (byte*) VIC_MEMORY in (byte*) VIC_MEMORY ← (number) $d018
Adding pointer type conversion cast (byte*) LIGHTPEN_X in (byte*) LIGHTPEN_X ← (number) $d013
Adding pointer type conversion cast (byte*) LIGHTPEN_Y in (byte*) LIGHTPEN_Y ← (number) $d014
Adding pointer type conversion cast (byte*) IRQ_STATUS in (byte*) IRQ_STATUS ← (number) $d019
Adding pointer type conversion cast (byte*) IRQ_ENABLE in (byte*) IRQ_ENABLE ← (number) $d01a
Adding pointer type conversion cast (byte*) COLS in (byte*) COLS ← (number) $d800
Adding pointer type conversion cast (byte*) CIA1_PORT_A in (byte*) CIA1_PORT_A ← (number) $dc00
Adding pointer type conversion cast (byte*) CIA1_PORT_B in (byte*) CIA1_PORT_B ← (number) $dc01
Adding pointer type conversion cast (byte*) CIA1_PORT_A_DDR in (byte*) CIA1_PORT_A_DDR ← (number) $dc02
Adding pointer type conversion cast (byte*) CIA1_PORT_B_DDR in (byte*) CIA1_PORT_B_DDR ← (number) $dc03
Adding pointer type conversion cast (byte*) CIA1_INTERRUPT in (byte*) CIA1_INTERRUPT ← (number) $dc0d
Adding pointer type conversion cast (byte*) CIA2_PORT_A in (byte*) CIA2_PORT_A ← (number) $dd00
Adding pointer type conversion cast (byte*) CIA2_PORT_B in (byte*) CIA2_PORT_B ← (number) $dd01
Adding pointer type conversion cast (byte*) CIA2_PORT_A_DDR in (byte*) CIA2_PORT_A_DDR ← (number) $dd02
Adding pointer type conversion cast (byte*) CIA2_PORT_B_DDR in (byte*) CIA2_PORT_B_DDR ← (number) $dd03
Adding pointer type conversion cast (byte*) CIA2_INTERRUPT in (byte*) CIA2_INTERRUPT ← (number) $dd0d
Adding pointer type conversion cast (void()**) KERNEL_IRQ in (void()**) KERNEL_IRQ ← (number) $314
Adding pointer type conversion cast (void()**) HARDWARE_IRQ in (void()**) HARDWARE_IRQ ← (number) $fffe
Adding pointer type conversion cast (byte*) DTV_FEATURE in (byte*) DTV_FEATURE ← (number) $d03f
Adding pointer type conversion cast (byte*) DTV_CONTROL in (byte*) DTV_CONTROL ← (number) $d03c
Adding pointer type conversion cast (byte*) DTV_PALETTE in (byte*) DTV_PALETTE ← (number) $d200
Adding pointer type conversion cast (byte*) DTV_PLANEA_START_LO in (byte*) DTV_PLANEA_START_LO ← (number) $d03a
Adding pointer type conversion cast (byte*) DTV_PLANEA_START_MI in (byte*) DTV_PLANEA_START_MI ← (number) $d03b
Adding pointer type conversion cast (byte*) DTV_PLANEA_START_HI in (byte*) DTV_PLANEA_START_HI ← (number) $d045
Adding pointer type conversion cast (byte*) DTV_PLANEA_STEP in (byte*) DTV_PLANEA_STEP ← (number) $d046
Adding pointer type conversion cast (byte*) DTV_PLANEA_MODULO_LO in (byte*) DTV_PLANEA_MODULO_LO ← (number) $d038
Adding pointer type conversion cast (byte*) DTV_PLANEA_MODULO_HI in (byte*) DTV_PLANEA_MODULO_HI ← (number) $d039
Adding pointer type conversion cast (byte*) DTV_PLANEB_START_LO in (byte*) DTV_PLANEB_START_LO ← (number) $d049
Adding pointer type conversion cast (byte*) DTV_PLANEB_START_MI in (byte*) DTV_PLANEB_START_MI ← (number) $d04a
Adding pointer type conversion cast (byte*) DTV_PLANEB_START_HI in (byte*) DTV_PLANEB_START_HI ← (number) $d04b
Adding pointer type conversion cast (byte*) DTV_PLANEB_STEP in (byte*) DTV_PLANEB_STEP ← (number) $d04c
Adding pointer type conversion cast (byte*) DTV_PLANEB_MODULO_LO in (byte*) DTV_PLANEB_MODULO_LO ← (number) $d047
Adding pointer type conversion cast (byte*) DTV_PLANEB_MODULO_HI in (byte*) DTV_PLANEB_MODULO_HI ← (number) $d048
Adding pointer type conversion cast (byte*) DTV_SPRITE_BANK in (byte*) DTV_SPRITE_BANK ← (number) $d04d
Adding pointer type conversion cast (byte*) DTV_COLOR_BANK_LO in (byte*) DTV_COLOR_BANK_LO ← (number) $d036
Adding pointer type conversion cast (byte*) DTV_COLOR_BANK_HI in (byte*) DTV_COLOR_BANK_HI ← (number) $d037
Adding pointer type conversion cast (byte*) DTV_GRAPHICS_VIC_BANK in (byte*) DTV_GRAPHICS_VIC_BANK ← (number) $d03d
Adding pointer type conversion cast (byte*) DTV_GRAPHICS_HICOL_BANK in (byte*) DTV_GRAPHICS_HICOL_BANK ← (number) $d03e
Adding pointer type conversion cast (byte*) dtvSetCpuBankSegment1::cpuBank in (byte*) dtvSetCpuBankSegment1::cpuBank ← (number) $ff
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCA_LO in (byte*) DTV_BLITTER_SRCA_LO ← (number) $d320
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCA_MI in (byte*) DTV_BLITTER_SRCA_MI ← (number) $d321
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCA_HI in (byte*) DTV_BLITTER_SRCA_HI ← (number) $d322
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCA_MOD_LO in (byte*) DTV_BLITTER_SRCA_MOD_LO ← (number) $d323
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCA_MOD_HI in (byte*) DTV_BLITTER_SRCA_MOD_HI ← (number) $d324
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCA_LIN_LO in (byte*) DTV_BLITTER_SRCA_LIN_LO ← (number) $d325
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCA_LIN_HI in (byte*) DTV_BLITTER_SRCA_LIN_HI ← (number) $d326
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCA_STEP in (byte*) DTV_BLITTER_SRCA_STEP ← (number) $d327
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCB_LO in (byte*) DTV_BLITTER_SRCB_LO ← (number) $d328
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCB_MI in (byte*) DTV_BLITTER_SRCB_MI ← (number) $d329
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCB_HI in (byte*) DTV_BLITTER_SRCB_HI ← (number) $d32a
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCB_MOD_LO in (byte*) DTV_BLITTER_SRCB_MOD_LO ← (number) $d32b
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCB_MOD_HI in (byte*) DTV_BLITTER_SRCB_MOD_HI ← (number) $d32c
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCB_LIN_LO in (byte*) DTV_BLITTER_SRCB_LIN_LO ← (number) $d32d
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCB_LIN_HI in (byte*) DTV_BLITTER_SRCB_LIN_HI ← (number) $d32e
Adding pointer type conversion cast (byte*) DTV_BLITTER_SRCB_STEP in (byte*) DTV_BLITTER_SRCB_STEP ← (number) $d32f
Adding pointer type conversion cast (byte*) DTV_BLITTER_DEST_LO in (byte*) DTV_BLITTER_DEST_LO ← (number) $d330
Adding pointer type conversion cast (byte*) DTV_BLITTER_DEST_MI in (byte*) DTV_BLITTER_DEST_MI ← (number) $d331
Adding pointer type conversion cast (byte*) DTV_BLITTER_DEST_HI in (byte*) DTV_BLITTER_DEST_HI ← (number) $d332
Adding pointer type conversion cast (byte*) DTV_BLITTER_DEST_MOD_LO in (byte*) DTV_BLITTER_DEST_MOD_LO ← (number) $d333
Adding pointer type conversion cast (byte*) DTV_BLITTER_DEST_MOD_HI in (byte*) DTV_BLITTER_DEST_MOD_HI ← (number) $d334
Adding pointer type conversion cast (byte*) DTV_BLITTER_DEST_LIN_LO in (byte*) DTV_BLITTER_DEST_LIN_LO ← (number) $d335
Adding pointer type conversion cast (byte*) DTV_BLITTER_DEST_LIN_HI in (byte*) DTV_BLITTER_DEST_LIN_HI ← (number) $d336
Adding pointer type conversion cast (byte*) DTV_BLITTER_DEST_STEP in (byte*) DTV_BLITTER_DEST_STEP ← (number) $d337
Adding pointer type conversion cast (byte*) DTV_BLITTER_LEN_LO in (byte*) DTV_BLITTER_LEN_LO ← (number) $d338
Adding pointer type conversion cast (byte*) DTV_BLITTER_LEN_HI in (byte*) DTV_BLITTER_LEN_HI ← (number) $d339
Adding pointer type conversion cast (byte*) DTV_BLITTER_CONTROL in (byte*) DTV_BLITTER_CONTROL ← (number) $d33a
Adding pointer type conversion cast (byte*) DTV_BLITTER_TRANSPARANCY in (byte*) DTV_BLITTER_TRANSPARANCY ← (number) $d33b
Adding pointer type conversion cast (byte*) DTV_BLITTER_ALU in (byte*) DTV_BLITTER_ALU ← (number) $d33e
Adding pointer type conversion cast (byte*) DTV_BLITTER_CONTROL2 in (byte*) DTV_BLITTER_CONTROL2 ← (number) $d33f
Identified constant variable (byte*) dtvSetCpuBankSegment1::cpuBank
Identified constant variable (byte*) DTV_BLITTER_ALU
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) @5
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@15
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@16
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@9
Culled Empty Block (label) main::@13
Culled Empty Block (label) main::@14
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) $d012
(byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) $d021
(byte*) RASTER#0 ← ((byte*)) (number) $d012
(byte*) BGCOL#0 ← ((byte*)) (number) $d021
to:@4
@4: scope:[] from @begin
(byte*) DTV_FEATURE#0 ← ((byte*)) (word/dword/signed dword) $d03f
(byte) DTV_FEATURE_ENABLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) DTV_CONTROL#0 ← ((byte*)) (word/dword/signed dword) $d03c
(byte) DTV_BORDER_OFF#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) DTV_HIGHCOLOR#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_BADLINE_OFF#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20
(byte*) DTV_PALETTE#0 ← ((byte*)) (word/dword/signed dword) $d200
(byte*) DTV_FEATURE#0 ← ((byte*)) (number) $d03f
(byte) DTV_FEATURE_ENABLE#0 ← (number) 1
(byte*) DTV_CONTROL#0 ← ((byte*)) (number) $d03c
(byte) DTV_BORDER_OFF#0 ← (number) 2
(byte) DTV_HIGHCOLOR#0 ← (number) 4
(byte) DTV_BADLINE_OFF#0 ← (number) $20
(byte*) DTV_PALETTE#0 ← ((byte*)) (number) $d200
to:@6
main: scope:[main] from @6
asm { sei }
@ -22,22 +131,18 @@ main: scope:[main] from @6
(byte~) main::$0 ← (byte) DTV_HIGHCOLOR#0 | (byte) DTV_BORDER_OFF#0
(byte~) main::$1 ← (byte~) main::$0 | (byte) DTV_BADLINE_OFF#0
*((byte*) DTV_CONTROL#0) ← (byte~) main::$1
(byte[$10]) main::palette#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 6, (byte/signed byte/word/signed word/dword/signed dword) 7, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 9, (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $b, (byte/signed byte/word/signed word/dword/signed dword) $c, (byte/signed byte/word/signed word/dword/signed dword) $d, (byte/signed byte/word/signed word/dword/signed dword) $e, (byte/signed byte/word/signed word/dword/signed dword) $f }
(byte[$10]) main::palette#0 ← { (number) 0, (number) 1, (number) 2, (number) 3, (number) 4, (number) 5, (number) 6, (number) 7, (number) 8, (number) 9, (number) $a, (number) $b, (number) $c, (number) $d, (number) $e, (number) $f }
to:main::@1
main::@1: scope:[main] from main main::@12
if(true) goto main::@2
if(true) goto main::@4
to:main::@return
main::@2: scope:[main] from main::@1
to:main::@4
main::@4: scope:[main] from main::@2 main::@5
(bool~) main::$2 ← *((byte*) RASTER#0) != (byte/signed byte/word/signed word/dword/signed dword) $40
if((bool~) main::$2) goto main::@5
main::@4: scope:[main] from main::@1 main::@4
(bool~) main::$2 ← *((byte*) RASTER#0) != (number) $40
if((bool~) main::$2) goto main::@4
to:main::@6
main::@5: scope:[main] from main::@4
to:main::@4
main::@6: scope:[main] from main::@4
*((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::r#0 ← (byte/signed byte/word/signed word/dword/signed dword) $31
*((byte*) BGCOL#0) ← (number) 0
(byte) main::r#0 ← (number) $31
to:main::@10
main::@10: scope:[main] from main::@10 main::@6
(byte) main::r#2 ← phi( main::@10/(byte) main::r#1 main::@6/(byte) main::r#0 )
@ -48,7 +153,7 @@ main::@10: scope:[main] from main::@10 main::@6
if((bool~) main::$3) goto main::@10
to:main::@11
main::@11: scope:[main] from main::@10
(byte) main::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::c#0 ← (number) 0
to:main::@12
main::@12: scope:[main] from main::@11 main::@12
(byte) main::c#2 ← phi( main::@11/(byte) main::c#0 main::@12/(byte) main::c#1 )
@ -102,9 +207,7 @@ SYMBOL TABLE SSA
(label) main::@10
(label) main::@11
(label) main::@12
(label) main::@2
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
(byte) main::c
@ -118,62 +221,140 @@ SYMBOL TABLE SSA
(byte) main::r#1
(byte) main::r#2
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@5
Culled Empty Block (label) @7
Successful SSA optimization Pass2CullEmptyBlocks
Simple Condition (bool~) main::$2 [17] if(*((byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $40) goto main::@4
Adding number conversion cast (unumber) 1 in (byte) DTV_FEATURE_ENABLE#0 ← (number) 1
Adding number conversion cast (unumber) 2 in (byte) DTV_BORDER_OFF#0 ← (number) 2
Adding number conversion cast (unumber) 4 in (byte) DTV_HIGHCOLOR#0 ← (number) 4
Adding number conversion cast (unumber) $20 in (byte) DTV_BADLINE_OFF#0 ← (number) $20
Adding number conversion cast (unumber) $40 in (bool~) main::$2 ← *((byte*) RASTER#0) != (number) $40
Adding number conversion cast (unumber) 0 in *((byte*) BGCOL#0) ← (number) 0
Adding number conversion cast (unumber) $31 in (byte) main::r#0 ← (number) $31
Adding number conversion cast (unumber) 0 in (byte) main::c#0 ← (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (byte) to elements in (byte[$10]) main::palette#0 ← { (byte)(number) 0, (byte)(number) 1, (byte)(number) 2, (byte)(number) 3, (byte)(number) 4, (byte)(number) 5, (byte)(number) 6, (byte)(number) 7, (byte)(number) 8, (byte)(number) 9, (byte)(number) $a, (byte)(number) $b, (byte)(number) $c, (byte)(number) $d, (byte)(number) $e, (byte)(number) $f }
Successful SSA optimization PassNAddArrayNumberTypeConversions
Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012
Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d021
Inlining cast (byte*) DTV_FEATURE#0 ← (byte*)(number) $d03f
Inlining cast (byte) DTV_FEATURE_ENABLE#0 ← (unumber)(number) 1
Inlining cast (byte*) DTV_CONTROL#0 ← (byte*)(number) $d03c
Inlining cast (byte) DTV_BORDER_OFF#0 ← (unumber)(number) 2
Inlining cast (byte) DTV_HIGHCOLOR#0 ← (unumber)(number) 4
Inlining cast (byte) DTV_BADLINE_OFF#0 ← (unumber)(number) $20
Inlining cast (byte*) DTV_PALETTE#0 ← (byte*)(number) $d200
Inlining cast *((byte*) BGCOL#0) ← (unumber)(number) 0
Inlining cast (byte) main::r#0 ← (unumber)(number) $31
Inlining cast (byte) main::c#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53311
Simplifying constant integer cast 1
Simplifying constant pointer cast (byte*) 53308
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast $20
Simplifying constant pointer cast (byte*) 53760
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast 4
Simplifying constant integer cast 5
Simplifying constant integer cast 6
Simplifying constant integer cast 7
Simplifying constant integer cast 8
Simplifying constant integer cast 9
Simplifying constant integer cast $a
Simplifying constant integer cast $b
Simplifying constant integer cast $c
Simplifying constant integer cast $d
Simplifying constant integer cast $e
Simplifying constant integer cast $f
Simplifying constant integer cast $40
Simplifying constant integer cast 0
Simplifying constant integer cast $31
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $20
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $31
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simple Condition (bool~) main::$2 [17] if(*((byte*) RASTER#0)!=(byte) $40) goto main::@4
Simple Condition (bool~) main::$3 [25] if((byte) main::r#1!=rangelast($31,$ff)) goto main::@10
Simple Condition (bool~) main::$4 [32] if((byte) main::c#1!=rangelast(0,$f)) goto main::@12
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) RASTER#0 = ((byte*))$d012
Constant (const byte*) BGCOL#0 = ((byte*))$d021
Constant (const byte*) DTV_FEATURE#0 = ((byte*))$d03f
Constant right-side identified [14] (byte[$10]) main::palette#0 ← { (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) $a, (byte) $b, (byte) $c, (byte) $d, (byte) $e, (byte) $f }
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) RASTER#0 = (byte*) 53266
Constant (const byte*) BGCOL#0 = (byte*) 53281
Constant (const byte*) DTV_FEATURE#0 = (byte*) 53311
Constant (const byte) DTV_FEATURE_ENABLE#0 = 1
Constant (const byte*) DTV_CONTROL#0 = ((byte*))$d03c
Constant (const byte*) DTV_CONTROL#0 = (byte*) 53308
Constant (const byte) DTV_BORDER_OFF#0 = 2
Constant (const byte) DTV_HIGHCOLOR#0 = 4
Constant (const byte) DTV_BADLINE_OFF#0 = $20
Constant (const byte*) DTV_PALETTE#0 = ((byte*))$d200
Constant (const byte*) DTV_PALETTE#0 = (byte*) 53760
Constant (const byte[$10]) main::palette#0 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, $a, $b, $c, $d, $e, $f }
Constant (const byte) main::r#0 = $31
Constant (const byte) main::c#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$0 = DTV_HIGHCOLOR#0|DTV_BORDER_OFF#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$1 = main::$0|DTV_BADLINE_OFF#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [3] if(true) goto main::@4
if() condition always true - replacing block destination [15] if(true) goto main::@4
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [23] main::r#1 ← ++ main::r#2 to ++
Resolved ranged comparison value [25] if(main::r#1!=rangelast($31,$ff)) goto main::@10 to (number) 0
Resolved ranged next value [30] main::c#1 ← ++ main::c#2 to ++
Resolved ranged comparison value [32] if(main::c#1!=rangelast(0,$f)) goto main::@12 to (number) $10
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Resolved ranged next value main::r#1 ← ++ main::r#2 to ++
Resolved ranged comparison value if(main::r#1!=rangelast($31,$ff)) goto main::@10 to (byte/signed byte/word/signed word/dword/signed dword) 0
Resolved ranged next value main::c#1 ← ++ main::c#2 to ++
Resolved ranged comparison value if(main::c#1!=rangelast(0,$f)) goto main::@12 to (byte/signed byte/word/signed word/dword/signed dword) $10
Culled Empty Block (label) @4
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@11
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) 0 in if((byte) main::r#1!=(number) 0) goto main::@10
Adding number conversion cast (unumber) $10 in if((byte) main::c#1!=(number) $10) goto main::@12
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 0
Simplifying constant integer cast $10
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $10
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [2] (byte~) main::$0 ← (const byte) DTV_HIGHCOLOR#0 | (const byte) DTV_BORDER_OFF#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = DTV_HIGHCOLOR#0|DTV_BORDER_OFF#0
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [2] (byte~) main::$1 ← (const byte) main::$0 | (const byte) DTV_BADLINE_OFF#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$1 = main::$0|DTV_BADLINE_OFF#0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings (const byte) main::r#0
Inlining constant with var siblings (const byte) main::c#0
Constant inlined main::r#0 = (byte/signed byte/word/signed word/dword/signed dword) $31
Constant inlined main::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::r#0 = (byte) $31
Constant inlined main::c#0 = (byte) 0
Constant inlined main::$1 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0|(const byte) DTV_BADLINE_OFF#0
Constant inlined main::$0 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@17(between main::@10 and main::@10)
Added new block during phi lifting main::@18(between main::@12 and main::@12)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @6
Adding NOP phi() at start of @7
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@11
CALL GRAPH
Calls in [] to main:2
Calls in [] to main:3
Created 2 initial phi equivalence classes
Coalesced [19] main::c#3 ← main::c#1
Coalesced [20] main::r#3 ← main::r#1
Coalesced [23] main::c#3 ← main::c#1
Coalesced [24] main::r#3 ← main::r#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) @4
Culled Empty Block (label) @7
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@11
Culled Empty Block (label) main::@18
Culled Empty Block (label) main::@17
Renumbering block @6 to @1
@ -201,24 +382,24 @@ main: scope:[main] from @1
[6] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0|(const byte) DTV_BADLINE_OFF#0
to:main::@1
main::@1: scope:[main] from main main::@1 main::@4
[7] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $40) goto main::@1
[7] if(*((const byte*) RASTER#0)!=(byte) $40) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[8] *((const byte*) BGCOL#0) ← (byte) 0
to:main::@3
main::@3: scope:[main] from main::@2 main::@3
[9] (byte) main::r#2 ← phi( main::@3/(byte) main::r#1 main::@2/(byte/signed byte/word/signed word/dword/signed dword) $31 )
[9] (byte) main::r#2 ← phi( main::@3/(byte) main::r#1 main::@2/(byte) $31 )
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
[11] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0)
[12] (byte) main::r#1 ← ++ (byte) main::r#2
[13] if((byte) main::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3
[13] if((byte) main::r#1!=(byte) 0) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@3 main::@4
[14] (byte) main::c#2 ← phi( main::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::c#1 )
[14] (byte) main::c#2 ← phi( main::@3/(byte) 0 main::@4/(byte) main::c#1 )
[15] *((const byte*) DTV_PALETTE#0 + (byte) main::c#2) ← *((const byte[$10]) main::palette#0 + (byte) main::c#2)
[16] *((const byte[$10]) main::palette#0 + (byte) main::c#2) ← ++ *((const byte[$10]) main::palette#0 + (byte) main::c#2)
[17] (byte) main::c#1 ← ++ (byte) main::c#2
[18] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@4
[18] if((byte) main::c#1!=(byte) $10) goto main::@4
to:main::@1
@ -299,20 +480,20 @@ main: {
jmp b1
//SEG13 main::@1
b1:
//SEG14 [7] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $40) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
//SEG14 [7] if(*((const byte*) RASTER#0)!=(byte) $40) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$40
cmp RASTER
bne b1
jmp b2
//SEG15 main::@2
b2:
//SEG16 [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
//SEG16 [8] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Create rasterbars
lda #0
sta BGCOL
//SEG17 [9] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
b3_from_b2:
//SEG18 [9] phi (byte) main::r#2 = (byte/signed byte/word/signed word/dword/signed dword) $31 [phi:main::@2->main::@3#0] -- vbuz1=vbuc1
//SEG18 [9] phi (byte) main::r#2 = (byte) $31 [phi:main::@2->main::@3#0] -- vbuz1=vbuc1
lda #$31
sta r
jmp b3
@ -352,13 +533,13 @@ main: {
inc BGCOL
//SEG24 [12] (byte) main::r#1 ← ++ (byte) main::r#2 -- vbuz1=_inc_vbuz1
inc r
//SEG25 [13] if((byte) main::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuz1_neq_0_then_la1
//SEG25 [13] if((byte) main::r#1!=(byte) 0) goto main::@3 -- vbuz1_neq_0_then_la1
lda r
cmp #0
bne b3_from_b3
//SEG26 [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
b4_from_b3:
//SEG27 [14] phi (byte) main::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuz1=vbuc1
//SEG27 [14] phi (byte) main::c#2 = (byte) 0 [phi:main::@3->main::@4#0] -- vbuz1=vbuc1
lda #0
sta c
jmp b4
@ -378,7 +559,7 @@ main: {
inc palette,x
//SEG33 [17] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuz1=_inc_vbuz1
inc c
//SEG34 [18] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@4 -- vbuz1_neq_vbuc1_then_la1
//SEG34 [18] if((byte) main::c#1!=(byte) $10) goto main::@4 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp c
bne b4_from_b4
@ -389,14 +570,14 @@ main: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0|(const byte) DTV_BADLINE_OFF#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $40) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] if(*((const byte*) RASTER#0)!=(byte) $40) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) BGCOL#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [15] *((const byte*) DTV_PALETTE#0 + (byte) main::c#2) ← *((const byte[$10]) main::palette#0 + (byte) main::c#2) [ main::c#2 ] ( main:2 [ main::c#2 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::c#2 main::c#1 ]
Statement [5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0|(const byte) DTV_BADLINE_OFF#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $40) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] if(*((const byte*) RASTER#0)!=(byte) $40) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) BGCOL#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [15] *((const byte*) DTV_PALETTE#0 + (byte) main::c#2) ← *((const byte[$10]) main::palette#0 + (byte) main::c#2) [ main::c#2 ] ( main:2 [ main::c#2 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::r#2 main::r#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::c#2 main::c#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
@ -455,20 +636,20 @@ main: {
jmp b1
//SEG13 main::@1
b1:
//SEG14 [7] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $40) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
//SEG14 [7] if(*((const byte*) RASTER#0)!=(byte) $40) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$40
cmp RASTER
bne b1
jmp b2
//SEG15 main::@2
b2:
//SEG16 [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
//SEG16 [8] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Create rasterbars
lda #0
sta BGCOL
//SEG17 [9] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
b3_from_b2:
//SEG18 [9] phi (byte) main::r#2 = (byte/signed byte/word/signed word/dword/signed dword) $31 [phi:main::@2->main::@3#0] -- vbuxx=vbuc1
//SEG18 [9] phi (byte) main::r#2 = (byte) $31 [phi:main::@2->main::@3#0] -- vbuxx=vbuc1
ldx #$31
jmp b3
//SEG19 [9] phi from main::@3 to main::@3 [phi:main::@3->main::@3]
@ -507,12 +688,12 @@ main: {
inc BGCOL
//SEG24 [12] (byte) main::r#1 ← ++ (byte) main::r#2 -- vbuxx=_inc_vbuxx
inx
//SEG25 [13] if((byte) main::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuxx_neq_0_then_la1
//SEG25 [13] if((byte) main::r#1!=(byte) 0) goto main::@3 -- vbuxx_neq_0_then_la1
cpx #0
bne b3_from_b3
//SEG26 [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
b4_from_b3:
//SEG27 [14] phi (byte) main::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuxx=vbuc1
//SEG27 [14] phi (byte) main::c#2 = (byte) 0 [phi:main::@3->main::@4#0] -- vbuxx=vbuc1
ldx #0
jmp b4
// Rotate palette
@ -529,7 +710,7 @@ main: {
inc palette,x
//SEG33 [17] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG34 [18] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@4 -- vbuxx_neq_vbuc1_then_la1
//SEG34 [18] if((byte) main::c#1!=(byte) $10) goto main::@4 -- vbuxx_neq_vbuc1_then_la1
cpx #$10
bne b4_from_b4
jmp b1
@ -571,23 +752,23 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) $d021
(const byte*) BGCOL#0 BGCOL = (byte*) 53281
(byte) DTV_BADLINE_OFF
(const byte) DTV_BADLINE_OFF#0 DTV_BADLINE_OFF = (byte/signed byte/word/signed word/dword/signed dword) $20
(const byte) DTV_BADLINE_OFF#0 DTV_BADLINE_OFF = (byte) $20
(byte) DTV_BORDER_OFF
(const byte) DTV_BORDER_OFF#0 DTV_BORDER_OFF = (byte/signed byte/word/signed word/dword/signed dword) 2
(const byte) DTV_BORDER_OFF#0 DTV_BORDER_OFF = (byte) 2
(byte*) DTV_CONTROL
(const byte*) DTV_CONTROL#0 DTV_CONTROL = ((byte*))(word/dword/signed dword) $d03c
(const byte*) DTV_CONTROL#0 DTV_CONTROL = (byte*) 53308
(byte*) DTV_FEATURE
(const byte*) DTV_FEATURE#0 DTV_FEATURE = ((byte*))(word/dword/signed dword) $d03f
(const byte*) DTV_FEATURE#0 DTV_FEATURE = (byte*) 53311
(byte) DTV_FEATURE_ENABLE
(const byte) DTV_FEATURE_ENABLE#0 DTV_FEATURE_ENABLE = (byte/signed byte/word/signed word/dword/signed dword) 1
(const byte) DTV_FEATURE_ENABLE#0 DTV_FEATURE_ENABLE = (byte) 1
(byte) DTV_HIGHCOLOR
(const byte) DTV_HIGHCOLOR#0 DTV_HIGHCOLOR = (byte/signed byte/word/signed word/dword/signed dword) 4
(const byte) DTV_HIGHCOLOR#0 DTV_HIGHCOLOR = (byte) 4
(byte*) DTV_PALETTE
(const byte*) DTV_PALETTE#0 DTV_PALETTE = ((byte*))(word/dword/signed dword) $d200
(const byte*) DTV_PALETTE#0 DTV_PALETTE = (byte*) 53760
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) $d012
(const byte*) RASTER#0 RASTER = (byte*) 53266
(void()) main()
(label) main::@1
(label) main::@2
@ -597,7 +778,7 @@ FINAL SYMBOL TABLE
(byte) main::c#1 reg byte x 151.5
(byte) main::c#2 reg byte x 201.99999999999997
(byte[$10]) main::palette
(const byte[$10]) main::palette#0 palette = { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 6, (byte/signed byte/word/signed word/dword/signed dword) 7, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 9, (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $b, (byte/signed byte/word/signed word/dword/signed dword) $c, (byte/signed byte/word/signed word/dword/signed dword) $d, (byte/signed byte/word/signed word/dword/signed dword) $e, (byte/signed byte/word/signed word/dword/signed dword) $f }
(const byte[$10]) main::palette#0 palette = { (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) $a, (byte) $b, (byte) $c, (byte) $d, (byte) $e, (byte) $f }
(byte) main::r
(byte) main::r#1 reg byte x 151.5
(byte) main::r#2 reg byte x 67.33333333333333
@ -646,17 +827,17 @@ main: {
sta DTV_CONTROL
//SEG13 main::@1
b1:
//SEG14 [7] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $40) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
//SEG14 [7] if(*((const byte*) RASTER#0)!=(byte) $40) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$40
cmp RASTER
bne b1
//SEG15 main::@2
//SEG16 [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
//SEG16 [8] *((const byte*) BGCOL#0) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Create rasterbars
lda #0
sta BGCOL
//SEG17 [9] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
//SEG18 [9] phi (byte) main::r#2 = (byte/signed byte/word/signed word/dword/signed dword) $31 [phi:main::@2->main::@3#0] -- vbuxx=vbuc1
//SEG18 [9] phi (byte) main::r#2 = (byte) $31 [phi:main::@2->main::@3#0] -- vbuxx=vbuc1
ldx #$31
//SEG19 [9] phi from main::@3 to main::@3 [phi:main::@3->main::@3]
//SEG20 [9] phi (byte) main::r#2 = (byte) main::r#1 [phi:main::@3->main::@3#0] -- register_copy
@ -692,11 +873,11 @@ main: {
inc BGCOL
//SEG24 [12] (byte) main::r#1 ← ++ (byte) main::r#2 -- vbuxx=_inc_vbuxx
inx
//SEG25 [13] if((byte) main::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuxx_neq_0_then_la1
//SEG25 [13] if((byte) main::r#1!=(byte) 0) goto main::@3 -- vbuxx_neq_0_then_la1
cpx #0
bne b3
//SEG26 [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
//SEG27 [14] phi (byte) main::c#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuxx=vbuc1
//SEG27 [14] phi (byte) main::c#2 = (byte) 0 [phi:main::@3->main::@4#0] -- vbuxx=vbuc1
ldx #0
// Rotate palette
//SEG28 [14] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
@ -710,7 +891,7 @@ main: {
inc palette,x
//SEG33 [17] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx
inx
//SEG34 [18] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@4 -- vbuxx_neq_vbuc1_then_la1
//SEG34 [18] if((byte) main::c#1!=(byte) $10) goto main::@4 -- vbuxx_neq_vbuc1_then_la1
cpx #$10
bne b4
jmp b1

@ -1,37 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) $d021
(byte) DTV_BADLINE_OFF
(const byte) DTV_BADLINE_OFF#0 DTV_BADLINE_OFF = (byte/signed byte/word/signed word/dword/signed dword) $20
(byte) DTV_BORDER_OFF
(const byte) DTV_BORDER_OFF#0 DTV_BORDER_OFF = (byte/signed byte/word/signed word/dword/signed dword) 2
(byte*) DTV_CONTROL
(const byte*) DTV_CONTROL#0 DTV_CONTROL = ((byte*))(word/dword/signed dword) $d03c
(byte*) DTV_FEATURE
(const byte*) DTV_FEATURE#0 DTV_FEATURE = ((byte*))(word/dword/signed dword) $d03f
(byte) DTV_FEATURE_ENABLE
(const byte) DTV_FEATURE_ENABLE#0 DTV_FEATURE_ENABLE = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_HIGHCOLOR
(const byte) DTV_HIGHCOLOR#0 DTV_HIGHCOLOR = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte*) DTV_PALETTE
(const byte*) DTV_PALETTE#0 DTV_PALETTE = ((byte*))(word/dword/signed dword) $d200
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) $d012
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(byte) main::c
(byte) main::c#1 reg byte x 151.5
(byte) main::c#2 reg byte x 201.99999999999997
(byte[$10]) main::palette
(const byte[$10]) main::palette#0 palette = { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 6, (byte/signed byte/word/signed word/dword/signed dword) 7, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 9, (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $b, (byte/signed byte/word/signed word/dword/signed dword) $c, (byte/signed byte/word/signed word/dword/signed dword) $d, (byte/signed byte/word/signed word/dword/signed dword) $e, (byte/signed byte/word/signed word/dword/signed dword) $f }
(byte) main::r
(byte) main::r#1 reg byte x 151.5
(byte) main::r#2 reg byte x 67.33333333333333
reg byte x [ main::r#2 main::r#1 ]
reg byte x [ main::c#2 main::c#1 ]
program

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -19,9 +19,9 @@ main::@return: scope:[main] from main::@1
[8] return
to:@return
line: scope:[line] from main main::@1
[9] (byte) line::x1#3 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@1/(byte/signed byte/word/signed word/dword/signed dword) 5 )
[9] (byte*) screen#14 ← phi( main/((byte*))(word/signed word/dword/signed dword) $400 main::@1/(byte*) screen#11 )
[9] (byte) line::x#0 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@1/(byte/signed byte/word/signed word/dword/signed dword) 3 )
[9] (byte) line::x1#3 ← phi( main/(byte) 2 main::@1/(byte) 5 )
[9] (byte*) screen#14 ← phi( main/(byte*) 1024 main::@1/(byte*) screen#11 )
[9] (byte) line::x#0 ← phi( main/(byte) 1 main::@1/(byte) 3 )
to:line::@1
line::@1: scope:[line] from line line::@1
[10] (byte*) screen#10 ← phi( line/(byte*) screen#14 line::@1/(byte*) screen#11 )

@ -1,19 +1,22 @@
Adding pointer type conversion cast (byte*) screen in (byte*) screen ← (number) $400
Culled Empty Block (label) @1
Culled Empty Block (label) line::@2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte*) screen#0 ← ((byte*)) (number) $400
to:@2
main: scope:[main] from @2
(byte*) screen#13 ← phi( @2/(byte*) screen#15 )
(byte) line::x0#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) line::x1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) line::x0#0 ← (number) 1
(byte) line::x1#0 ← (number) 2
call line
to:main::@1
main::@1: scope:[main] from main
(byte*) screen#7 ← phi( main/(byte*) screen#5 )
(byte*) screen#1 ← (byte*) screen#7
(byte) line::x0#1 ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) line::x1#1 ← (byte/signed byte/word/signed word/dword/signed dword) 5
(byte) line::x0#1 ← (number) 3
(byte) line::x1#1 ← (number) 5
call line
to:main::@2
main::@2: scope:[main] from main::@1
@ -100,6 +103,28 @@ SYMBOL TABLE SSA
(byte*) screen#8
(byte*) screen#9
Adding number conversion cast (unumber) 1 in (byte) line::x0#0 ← (number) 1
Adding number conversion cast (unumber) 2 in (byte) line::x1#0 ← (number) 2
Adding number conversion cast (unumber) 3 in (byte) line::x0#1 ← (number) 3
Adding number conversion cast (unumber) 5 in (byte) line::x1#1 ← (number) 5
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) screen#0 ← (byte*)(number) $400
Inlining cast (byte) line::x0#0 ← (unumber)(number) 1
Inlining cast (byte) line::x1#0 ← (unumber)(number) 2
Inlining cast (byte) line::x0#1 ← (unumber)(number) 3
Inlining cast (byte) line::x1#1 ← (unumber)(number) 5
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast 5
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 5
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) screen#1 = (byte*) screen#7
Alias (byte*) screen#2 = (byte*) screen#8 (byte*) screen#9 (byte*) screen#3
Alias (byte) line::x#0 = (byte) line::x0#2
@ -109,50 +134,51 @@ Alias (byte*) screen#12 = (byte*) screen#6
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) line::x1#2
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) screen#13 (byte*) screen#0
Redundant Phi (byte*) screen#1 (byte*) screen#11
Redundant Phi (byte*) screen#2 (byte*) screen#11
Redundant Phi (byte) line::x1#2 (byte) line::x1#3
Redundant Phi (byte*) screen#12 (byte*) screen#2
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte*) screen#13 (byte*) screen#0
Identical Phi Values (byte*) screen#1 (byte*) screen#11
Identical Phi Values (byte*) screen#2 (byte*) screen#11
Identical Phi Values (byte) line::x1#2 (byte) line::x1#3
Identical Phi Values (byte*) screen#12 (byte*) screen#2
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) line::$0 [22] if((byte) line::x#1<(byte) line::x1#3) goto line::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) screen#0 = ((byte*))$400
Constant (const byte*) screen#0 = (byte*) 1024
Constant (const byte) line::x0#0 = 1
Constant (const byte) line::x1#0 = 2
Constant (const byte) line::x0#1 = 3
Constant (const byte) line::x1#1 = 5
Successful SSA optimization Pass2ConstantIdentification
Culled Empty Block (label) main::@2
Culled Empty Block (label) @3
Successful SSA optimization Pass2CullEmptyBlocks
Inlining constant with different constant siblings (const byte) line::x0#0
Inlining constant with var siblings (const byte) line::x1#0
Inlining constant with different constant siblings (const byte) line::x0#1
Inlining constant with var siblings (const byte) line::x1#1
Inlining constant with var siblings (const byte*) screen#0
Constant inlined line::x0#0 = (byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined line::x1#1 = (byte/signed byte/word/signed word/dword/signed dword) 5
Constant inlined screen#0 = ((byte*))(word/signed word/dword/signed dword) $400
Constant inlined line::x1#0 = (byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined line::x0#1 = (byte/signed byte/word/signed word/dword/signed dword) 3
Constant inlined line::x0#0 = (byte) 1
Constant inlined line::x1#1 = (byte) 5
Constant inlined screen#0 = (byte*) 1024
Constant inlined line::x1#0 = (byte) 2
Constant inlined line::x0#1 = (byte) 3
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting line::@3(between line::@1 and line::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@2
CALL GRAPH
Calls in [] to main:2
Calls in [main] to line:5 line:7
Calls in [main] to line:6 line:8
Created 5 initial phi equivalence classes
Coalesced [6] screen#16 ← screen#11
Coalesced [10] line::x#3 ← line::x#0
Coalesced [11] screen#17 ← screen#14
Coalesced [18] line::x#4 ← line::x#1
Coalesced (already) [19] screen#18 ← screen#11
Coalesced [7] screen#16 ← screen#11
Coalesced [12] line::x#3 ← line::x#0
Coalesced [13] screen#17 ← screen#14
Coalesced [20] line::x#4 ← line::x#1
Coalesced (already) [21] screen#18 ← screen#11
Coalesced down to 3 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) main::@2
Culled Empty Block (label) line::@3
Renumbering block @2 to @1
Adding NOP phi() at start of @begin
@ -183,9 +209,9 @@ main::@return: scope:[main] from main::@1
[8] return
to:@return
line: scope:[line] from main main::@1
[9] (byte) line::x1#3 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@1/(byte/signed byte/word/signed word/dword/signed dword) 5 )
[9] (byte*) screen#14 ← phi( main/((byte*))(word/signed word/dword/signed dword) $400 main::@1/(byte*) screen#11 )
[9] (byte) line::x#0 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@1/(byte/signed byte/word/signed word/dword/signed dword) 3 )
[9] (byte) line::x1#3 ← phi( main/(byte) 2 main::@1/(byte) 5 )
[9] (byte*) screen#14 ← phi( main/(byte*) 1024 main::@1/(byte*) screen#11 )
[9] (byte) line::x#0 ← phi( main/(byte) 1 main::@1/(byte) 3 )
to:line::@1
line::@1: scope:[line] from line line::@1
[10] (byte*) screen#10 ← phi( line/(byte*) screen#14 line::@1/(byte*) screen#11 )
@ -259,15 +285,15 @@ main: {
//SEG11 [5] call line
//SEG12 [9] phi from main to line [phi:main->line]
line_from_main:
//SEG13 [9] phi (byte) line::x1#3 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->line#0] -- vbuz1=vbuc1
//SEG13 [9] phi (byte) line::x1#3 = (byte) 2 [phi:main->line#0] -- vbuz1=vbuc1
lda #2
sta line.x1
//SEG14 [9] phi (byte*) screen#14 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->line#1] -- pbuz1=pbuc1
//SEG14 [9] phi (byte*) screen#14 = (byte*) 1024 [phi:main->line#1] -- pbuz1=pbuc1
lda #<$400
sta screen
lda #>$400
sta screen+1
//SEG15 [9] phi (byte) line::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->line#2] -- vbuz1=vbuc1
//SEG15 [9] phi (byte) line::x#0 = (byte) 1 [phi:main->line#2] -- vbuz1=vbuc1
lda #1
sta line.x
jsr line
@ -279,11 +305,11 @@ main: {
//SEG18 [7] call line
//SEG19 [9] phi from main::@1 to line [phi:main::@1->line]
line_from_b1:
//SEG20 [9] phi (byte) line::x1#3 = (byte/signed byte/word/signed word/dword/signed dword) 5 [phi:main::@1->line#0] -- vbuz1=vbuc1
//SEG20 [9] phi (byte) line::x1#3 = (byte) 5 [phi:main::@1->line#0] -- vbuz1=vbuc1
lda #5
sta line.x1
//SEG21 [9] phi (byte*) screen#14 = (byte*) screen#11 [phi:main::@1->line#1] -- register_copy
//SEG22 [9] phi (byte) line::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main::@1->line#2] -- vbuz1=vbuc1
//SEG22 [9] phi (byte) line::x#0 = (byte) 3 [phi:main::@1->line#2] -- vbuz1=vbuc1
lda #3
sta line.x
jsr line
@ -381,15 +407,15 @@ main: {
//SEG11 [5] call line
//SEG12 [9] phi from main to line [phi:main->line]
line_from_main:
//SEG13 [9] phi (byte) line::x1#3 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->line#0] -- vbuz1=vbuc1
//SEG13 [9] phi (byte) line::x1#3 = (byte) 2 [phi:main->line#0] -- vbuz1=vbuc1
lda #2
sta line.x1
//SEG14 [9] phi (byte*) screen#14 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->line#1] -- pbuz1=pbuc1
//SEG14 [9] phi (byte*) screen#14 = (byte*) 1024 [phi:main->line#1] -- pbuz1=pbuc1
lda #<$400
sta screen
lda #>$400
sta screen+1
//SEG15 [9] phi (byte) line::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->line#2] -- vbuxx=vbuc1
//SEG15 [9] phi (byte) line::x#0 = (byte) 1 [phi:main->line#2] -- vbuxx=vbuc1
ldx #1
jsr line
//SEG16 [6] phi from main to main::@1 [phi:main->main::@1]
@ -400,11 +426,11 @@ main: {
//SEG18 [7] call line
//SEG19 [9] phi from main::@1 to line [phi:main::@1->line]
line_from_b1:
//SEG20 [9] phi (byte) line::x1#3 = (byte/signed byte/word/signed word/dword/signed dword) 5 [phi:main::@1->line#0] -- vbuz1=vbuc1
//SEG20 [9] phi (byte) line::x1#3 = (byte) 5 [phi:main::@1->line#0] -- vbuz1=vbuc1
lda #5
sta line.x1
//SEG21 [9] phi (byte*) screen#14 = (byte*) screen#11 [phi:main::@1->line#1] -- register_copy
//SEG22 [9] phi (byte) line::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main::@1->line#2] -- vbuxx=vbuc1
//SEG22 [9] phi (byte) line::x#0 = (byte) 3 [phi:main::@1->line#2] -- vbuxx=vbuc1
ldx #3
jsr line
jmp breturn
@ -527,26 +553,26 @@ Score: 348
main: {
//SEG11 [5] call line
//SEG12 [9] phi from main to line [phi:main->line]
//SEG13 [9] phi (byte) line::x1#3 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->line#0] -- vbuz1=vbuc1
//SEG13 [9] phi (byte) line::x1#3 = (byte) 2 [phi:main->line#0] -- vbuz1=vbuc1
lda #2
sta line.x1
//SEG14 [9] phi (byte*) screen#14 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->line#1] -- pbuz1=pbuc1
//SEG14 [9] phi (byte*) screen#14 = (byte*) 1024 [phi:main->line#1] -- pbuz1=pbuc1
lda #<$400
sta screen
lda #>$400
sta screen+1
//SEG15 [9] phi (byte) line::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->line#2] -- vbuxx=vbuc1
//SEG15 [9] phi (byte) line::x#0 = (byte) 1 [phi:main->line#2] -- vbuxx=vbuc1
ldx #1
jsr line
//SEG16 [6] phi from main to main::@1 [phi:main->main::@1]
//SEG17 main::@1
//SEG18 [7] call line
//SEG19 [9] phi from main::@1 to line [phi:main::@1->line]
//SEG20 [9] phi (byte) line::x1#3 = (byte/signed byte/word/signed word/dword/signed dword) 5 [phi:main::@1->line#0] -- vbuz1=vbuc1
//SEG20 [9] phi (byte) line::x1#3 = (byte) 5 [phi:main::@1->line#0] -- vbuz1=vbuc1
lda #5
sta line.x1
//SEG21 [9] phi (byte*) screen#14 = (byte*) screen#11 [phi:main::@1->line#1] -- register_copy
//SEG22 [9] phi (byte) line::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 3 [phi:main::@1->line#2] -- vbuxx=vbuc1
//SEG22 [9] phi (byte) line::x#0 = (byte) 3 [phi:main::@1->line#2] -- vbuxx=vbuc1
ldx #3
jsr line
//SEG23 main::@return

@ -1,24 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) line((byte) line::x0 , (byte) line::x1)
(label) line::@1
(label) line::@return
(byte) line::x
(byte) line::x#0 reg byte x 2.0
(byte) line::x#1 reg byte x 16.5
(byte) line::x#2 reg byte x 11.666666666666666
(byte) line::x0
(byte) line::x1
(byte) line::x1#3 x1 zp ZP_BYTE:2 1.8333333333333333
(void()) main()
(label) main::@1
(label) main::@return
(byte*) screen
(byte*) screen#10 screen zp ZP_WORD:3 17.5
(byte*) screen#11 screen zp ZP_WORD:3 4.0
(byte*) screen#14 screen zp ZP_WORD:3 4.0
zp ZP_BYTE:2 [ line::x1#3 ]
reg byte x [ line::x#2 line::x#0 line::x#1 ]
zp ZP_WORD:3 [ screen#10 screen#14 screen#11 ]
program

@ -11,10 +11,10 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::i#1 )
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs#0 + (byte) main::i#2)
[7] (byte) main::i#1 ← ++ (byte) main::i#2
[8] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto main::@1
[8] if((byte) main::i#1!=(byte) 4) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[9] return

@ -1,24 +1,22 @@
Adding pointer type conversion cast (byte*) main::SCREEN in (byte*) main::SCREEN ← (number) $400
Identified constant variable (byte*) main::SCREEN
Culled Empty Block (label) main::@2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @1
(signed byte/signed word/signed dword~) main::$0 ← - (byte/signed byte/word/signed word/dword/signed dword) 1
(signed byte/signed word/signed dword~) main::$1 ← - (byte/signed byte/word/signed word/dword/signed dword) 2
(signed byte/signed word/signed dword~) main::$2 ← - (byte/signed byte/word/signed word/dword/signed dword) 3
(signed byte/signed word/signed dword~) main::$3 ← - (byte/signed byte/word/signed word/dword/signed dword) 4
(signed byte[]) main::sbs#0 ← { (signed byte/signed word/signed dword~) main::$0, (signed byte/signed word/signed dword~) main::$1, (signed byte/signed word/signed dword~) main::$2, (signed byte/signed word/signed dword~) main::$3 }
(byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(signed byte[]) main::sbs#0 ← { (number) -1, (number) -2, (number) -3, (number) -4 }
(byte*) main::SCREEN#0 ← ((byte*)) (number) $400
(byte) main::i#0 ← (number) 0
to:main::@1
main::@1: scope:[main] from main main::@1
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
(byte~) main::$4 ← ((byte)) *((signed byte[]) main::sbs#0 + (byte) main::i#2)
*((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$4
(byte~) main::$0 ← ((byte)) *((signed byte[]) main::sbs#0 + (byte) main::i#2)
*((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0
(byte) main::i#1 ← (byte) main::i#2 + rangenext(0,3)
(bool~) main::$5 ← (byte) main::i#1 != rangelast(0,3)
if((bool~) main::$5) goto main::@1
(bool~) main::$1 ← (byte) main::i#1 != rangelast(0,3)
if((bool~) main::$1) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
return
@ -36,12 +34,8 @@ SYMBOL TABLE SSA
(label) @begin
(label) @end
(void()) main()
(signed byte/signed word/signed dword~) main::$0
(signed byte/signed word/signed dword~) main::$1
(signed byte/signed word/signed dword~) main::$2
(signed byte/signed word/signed dword~) main::$3
(byte~) main::$4
(bool~) main::$5
(byte~) main::$0
(bool~) main::$1
(label) main::@1
(label) main::@return
(byte*) main::SCREEN
@ -53,41 +47,57 @@ SYMBOL TABLE SSA
(signed byte[]) main::sbs
(signed byte[]) main::sbs#0
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Simple Condition (bool~) main::$5 [12] if((byte) main::i#1!=rangelast(0,3)) goto main::@1
Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (signed byte) to elements in (signed byte[]) main::sbs#0 ← { (signed byte)(number) -1, (signed byte)(number) -2, (signed byte)(number) -3, (signed byte)(number) -4 }
Successful SSA optimization PassNAddArrayNumberTypeConversions
Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) main::i#0 ← (unumber)(number) 0
Inlining cast (byte~) main::$0 ← (byte)*((signed byte[]) main::sbs#0 + (byte) main::i#2)
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast -1
Simplifying constant integer cast -2
Simplifying constant integer cast -3
Simplifying constant integer cast -4
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simple Condition (bool~) main::$1 [8] if((byte) main::i#1!=rangelast(0,3)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const signed byte/signed word/signed dword) main::$0 = -1
Constant (const signed byte/signed word/signed dword) main::$1 = -2
Constant (const signed byte/signed word/signed dword) main::$2 = -3
Constant (const signed byte/signed word/signed dword) main::$3 = -4
Constant (const byte*) main::SCREEN#0 = ((byte*))$400
Constant right-side identified [0] (signed byte[]) main::sbs#0 ← { (signed byte) -1, (signed byte) -2, (signed byte) -3, (signed byte) -4 }
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const signed byte[]) main::sbs#0 = { -1, -2, -3, -4 }
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const signed byte[]) main::sbs#0 = { main::$0, main::$1, main::$2, main::$3 }
Successful SSA optimization Pass2ConstantIdentification
Eliminating Noop Cast (byte~) main::$4 ← ((byte)) *((const signed byte[]) main::sbs#0 + (byte) main::i#2)
Successful SSA optimization Pass2NopCastElimination
Resolved ranged next value main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value if(main::i#1!=rangelast(0,3)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 4
Resolved ranged next value [6] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [8] if(main::i#1!=rangelast(0,3)) goto main::@1 to (number) 4
Adding number conversion cast (unumber) 4 in if((byte) main::i#1!=(number) 4) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 4
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 4
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining Noop Cast [1] (byte~) main::$0 ← (byte)*((const signed byte[]) main::sbs#0 + (byte) main::i#2) keeping *(main::sbs#0 + main::i#2)
Successful SSA optimization Pass2NopCastInlining
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::$3 = -(byte/signed byte/word/signed word/dword/signed dword) 4
Constant inlined main::$1 = -(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::$2 = -(byte/signed byte/word/signed word/dword/signed dword) 3
Constant inlined main::$0 = -(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::i#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Created 1 initial phi equivalence classes
Coalesced [10] main::i#3 ← main::i#1
Coalesced [11] main::i#3 ← main::i#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
@ -108,10 +118,10 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::i#1 )
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs#0 + (byte) main::i#2)
[7] (byte) main::i#1 ← ++ (byte) main::i#2
[8] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto main::@1
[8] if((byte) main::i#1!=(byte) 4) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@1
[9] return
@ -162,7 +172,7 @@ main: {
.label i = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG12 [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta i
jmp b1
@ -178,7 +188,7 @@ main: {
sta SCREEN,y
//SEG17 [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG18 [8] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG18 [8] if((byte) main::i#1!=(byte) 4) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #4
cmp i
bne b1_from_b1
@ -232,7 +242,7 @@ main: {
.label SCREEN = $400
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
@ -246,7 +256,7 @@ main: {
sta SCREEN,x
//SEG17 [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG18 [8] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG18 [8] if((byte) main::i#1!=(byte) 4) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #4
bne b1_from_b1
jmp breturn
@ -290,12 +300,12 @@ FINAL SYMBOL TABLE
(label) main::@1
(label) main::@return
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 16.5
(signed byte[]) main::sbs
(const signed byte[]) main::sbs#0 sbs = { -(byte/signed byte/word/signed word/dword/signed dword) 1, -(byte/signed byte/word/signed word/dword/signed dword) 2, -(byte/signed byte/word/signed word/dword/signed dword) 3, -(byte/signed byte/word/signed word/dword/signed dword) 4 }
(const signed byte[]) main::sbs#0 sbs = { (signed byte) -1, (signed byte) -2, (signed byte) -3, (signed byte) -4 }
reg byte x [ main::i#2 main::i#1 ]
@ -321,7 +331,7 @@ Score: 186
main: {
.label SCREEN = $400
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG14 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
@ -332,7 +342,7 @@ main: {
sta SCREEN,x
//SEG17 [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG18 [8] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG18 [8] if((byte) main::i#1!=(byte) 4) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #4
bne b1
//SEG19 main::@return

@ -1,15 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@return
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 16.5
(signed byte[]) main::sbs
(const signed byte[]) main::sbs#0 sbs = { -(byte/signed byte/word/signed word/dword/signed dword) 1, -(byte/signed byte/word/signed word/dword/signed dword) 2, -(byte/signed byte/word/signed word/dword/signed dword) 3, -(byte/signed byte/word/signed word/dword/signed dword) 4 }
reg byte x [ main::i#2 main::i#1 ]
program

@ -11,13 +11,13 @@ main: scope:[main] from @1
[4] phi()
to:main::getScreen1
main::getScreen1: scope:[main] from main
[5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER)
[5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0)
to:main::spritePtr1
main::spritePtr1: scope:[main] from main::getScreen1
[6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378
[6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word) $378
to:main::@1
main::@1: scope:[main] from main::spritePtr1
[7] *((byte*) main::spritePtr1_return#0) ← (byte/signed byte/word/signed word/dword/signed dword) $22
[7] *((byte*) main::spritePtr1_return#0) ← (byte) $22
to:main::@return
main::@return: scope:[main] from main::@1
[8] return

@ -1,21 +1,25 @@
Fixing pointer array-indexing *((byte*[]) screens + (byte) getScreen::id)
Inlined call (byte*~) main::$0 ← call getScreen (byte/signed byte/word/signed word/dword/signed dword) 0
Inlined call (byte*~) main::$0 ← call getScreen (number) 0
Inlined call (byte*~) main::$1 ← call spritePtr (byte*) main::screen
Culled Empty Block (label) main::getScreen1_@1
Culled Empty Block (label) main::spritePtr1_@1
Culled Empty Block (label) @1
Culled Empty Block (label) @2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*~) $0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte*~) $1 ← ((byte*)) (word/signed word/dword/signed dword) $1400
(byte*~) $0 ← ((byte*)) (number) $400
(byte*~) $1 ← ((byte*)) (number) $1400
(byte*[]) screens#0 ← { (byte*~) $0, (byte*~) $1 }
to:@3
main: scope:[main] from @3
(byte*) main::screen#0 ← (byte*) 0
(byte) main::getScreen1_id#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::getScreen1_id#0 ← (number) 0
to:main::getScreen1
main::getScreen1: scope:[main] from main
(byte) main::getScreen1_id#1 ← phi( main/(byte) main::getScreen1_id#0 )
(byte) main::getScreen1_$0#0 ← (byte) main::getScreen1_id#1 * (const byte) SIZEOF_POINTER
(byte*) main::getScreen1_return#0 ← *((byte*[]) screens#0 + (byte) main::getScreen1_$0#0)
(byte~) main::getScreen1_$0#0 ← (byte) main::getScreen1_id#1 * (const byte) SIZEOF_POINTER
(byte*) main::getScreen1_return#0 ← *((byte*[]) screens#0 + (byte~) main::getScreen1_$0#0)
to:main::getScreen1_@return
main::getScreen1_@return: scope:[main] from main::getScreen1
(byte*) main::getScreen1_return#2 ← phi( main::getScreen1/(byte*) main::getScreen1_return#0 )
@ -29,9 +33,9 @@ main::@1: scope:[main] from main::getScreen1_@return
to:main::spritePtr1
main::spritePtr1: scope:[main] from main::@1
(byte*) main::spritePtr1_screen#1 ← phi( main::@1/(byte*) main::spritePtr1_screen#0 )
(byte*) main::spritePtr1_$0#0 ← (byte*) main::spritePtr1_screen#1 + (word/signed word/dword/signed dword) $378
(byte*) main::spritePtr1_$1#0 ← ((byte*)) (byte*) main::spritePtr1_$0#0
(byte*) main::spritePtr1_return#0 ← (byte*) main::spritePtr1_$1#0
(byte*~) main::spritePtr1_$0#0 ← (byte*) main::spritePtr1_screen#1 + (number) $378
(byte*~) main::spritePtr1_$1#0 ← ((byte*)) (byte*~) main::spritePtr1_$0#0
(byte*) main::spritePtr1_return#0 ← (byte*~) main::spritePtr1_$1#0
to:main::spritePtr1_@return
main::spritePtr1_@return: scope:[main] from main::spritePtr1
(byte*) main::spritePtr1_return#2 ← phi( main::spritePtr1/(byte*) main::spritePtr1_return#0 )
@ -40,7 +44,7 @@ main::spritePtr1_@return: scope:[main] from main::spritePtr1
main::@2: scope:[main] from main::spritePtr1_@return
(byte*) main::spritePtr1_return#3 ← phi( main::spritePtr1_@return/(byte*) main::spritePtr1_return#1 )
(byte*~) main::$1 ← (byte*) main::spritePtr1_return#3
*((byte*~) main::$1) ← (byte/signed byte/word/signed word/dword/signed dword) $22
*((byte*~) main::$1) ← (number) $22
to:main::@return
main::@return: scope:[main] from main::@2
return
@ -59,7 +63,7 @@ SYMBOL TABLE SSA
(label) @4
(label) @begin
(label) @end
(const byte) SIZEOF_POINTER = (byte/signed byte/word/signed word/dword/signed dword) 2
(const byte) SIZEOF_POINTER = (byte) 2
(void()) main()
(byte*~) main::$0
(byte*~) main::$1
@ -67,8 +71,8 @@ SYMBOL TABLE SSA
(label) main::@2
(label) main::@return
(label) main::getScreen1
(byte) main::getScreen1_$0
(byte) main::getScreen1_$0#0
(byte~) main::getScreen1_$0
(byte~) main::getScreen1_$0#0
(label) main::getScreen1_@return
(byte) main::getScreen1_id
(byte) main::getScreen1_id#0
@ -83,9 +87,9 @@ SYMBOL TABLE SSA
(byte*) main::screen#1
(label) main::spritePtr1
(byte*~) main::spritePtr1_$0
(byte*) main::spritePtr1_$0#0
(byte*~) main::spritePtr1_$0#0
(byte*~) main::spritePtr1_$1
(byte*) main::spritePtr1_$1#0
(byte*~) main::spritePtr1_$1#0
(label) main::spritePtr1_@return
(byte*) main::spritePtr1_return
(byte*) main::spritePtr1_return#0
@ -98,45 +102,72 @@ SYMBOL TABLE SSA
(byte*[]) screens
(byte*[]) screens#0
Culled Empty Block (label) @4
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) 0 in (byte) main::getScreen1_id#0 ← (number) 0
Adding number conversion cast (unumber) $378 in (byte*~) main::spritePtr1_$0#0 ← (byte*) main::spritePtr1_screen#1 + (number) $378
Adding number conversion cast (unumber) $22 in *((byte*~) main::$1) ← (number) $22
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) $0 ← (byte*)(number) $400
Inlining cast (byte*~) $1 ← (byte*)(number) $1400
Inlining cast (byte) main::getScreen1_id#0 ← (unumber)(number) 0
Inlining cast (byte*~) main::spritePtr1_$1#0 ← (byte*)(byte*~) main::spritePtr1_$0#0
Inlining cast *((byte*~) main::$1) ← (unumber)(number) $22
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 5120
Simplifying constant integer cast 0
Simplifying constant integer cast $378
Simplifying constant integer cast (byte*~) main::spritePtr1_$0#0
Simplifying constant integer cast $22
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $378
Finalized unsigned number type (byte) $22
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) main::getScreen1_id#0 = (byte) main::getScreen1_id#1
Alias (byte*) main::getScreen1_return#0 = (byte*) main::getScreen1_return#2 (byte*) main::getScreen1_return#1 (byte*) main::getScreen1_return#3 (byte*~) main::$0 (byte*) main::screen#1 (byte*) main::spritePtr1_screen#0 (byte*) main::spritePtr1_screen#1
Alias (byte*) main::spritePtr1_return#0 = (byte*) main::spritePtr1_$1#0 (byte*) main::spritePtr1_return#2 (byte*) main::spritePtr1_return#1 (byte*) main::spritePtr1_return#3 (byte*~) main::$1
Alias (byte*) main::spritePtr1_return#0 = (byte*~) main::spritePtr1_$1#0 (byte*~) main::spritePtr1_$0#0 (byte*) main::spritePtr1_return#2 (byte*) main::spritePtr1_return#1 (byte*) main::spritePtr1_return#3 (byte*~) main::$1
Successful SSA optimization Pass2AliasElimination
Constant (const byte*) $0 = ((byte*))$400
Constant (const byte*) $1 = ((byte*))$1400
Constant (const byte*) main::screen#0 = 0
Constant (const byte*) $0 = (byte*) 1024
Constant (const byte*) $1 = (byte*) 5120
Constant (const byte*) main::screen#0 = (byte*) 0
Constant (const byte) main::getScreen1_id#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const byte*) main::screen#0
Successful SSA optimization PassNEliminateUnusedVars
Constant right-side identified [0] (byte*[]) screens#0 ← { (const byte*) $0, (const byte*) $1 }
Constant right-side identified [1] (byte~) main::getScreen1_$0#0 ← (const byte) main::getScreen1_id#0 * (const byte) SIZEOF_POINTER
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*[]) screens#0 = { $0, $1 }
Constant (const byte) main::getScreen1_$0#0 = main::getScreen1_id#0*SIZEOF_POINTER
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(screens#0+main::getScreen1_$0#0)
Successful SSA optimization Pass2ConstantAdditionElimination
Eliminating unused constant (const byte*) main::screen#0
Simplifying constant evaluating to zero (const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER in
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero screens#0 in [2] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0 + (const byte) main::getScreen1_$0#0)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::getScreen1_id#0
Eliminating unused constant (const byte) main::getScreen1_$0#0
Eliminating unused constant (const byte) SIZEOF_POINTER
Successful SSA optimization PassNEliminateUnusedVars
Removing redundant cast (byte*) main::spritePtr1_return#0 ← ((byte*)) (byte*) main::spritePtr1_$0#0
Successful SSA optimization Pass2EliminateRedundantCasts
Culled Empty Block (label) main::getScreen1_@return
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::spritePtr1_@return
Successful SSA optimization Pass2CullEmptyBlocks
Alias (byte*) main::spritePtr1_return#0 = (byte*) main::spritePtr1_$0#0
Successful SSA optimization Pass2AliasElimination
Constant inlined $0 = ((byte*))(word/signed word/dword/signed dword) $400
Constant inlined $1 = ((byte*))(word/signed word/dword/signed dword) $1400
Constant inlined main::getScreen1_$0#0 = (const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER
Constant inlined $0 = (byte*) 1024
Constant inlined $1 = (byte*) 5120
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @4
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::getScreen1_@return
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::spritePtr1_@return
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @4
Culled Empty Block (label) main::getScreen1_@return
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::spritePtr1_@return
Renumbering block @3 to @1
Renumbering block main::@2 to main::@1
Adding NOP phi() at start of @begin
@ -158,13 +189,13 @@ main: scope:[main] from @1
[4] phi()
to:main::getScreen1
main::getScreen1: scope:[main] from main
[5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER)
[5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0)
to:main::spritePtr1
main::spritePtr1: scope:[main] from main::getScreen1
[6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378
[6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word) $378
to:main::@1
main::@1: scope:[main] from main::spritePtr1
[7] *((byte*) main::spritePtr1_return#0) ← (byte/signed byte/word/signed word/dword/signed dword) $22
[7] *((byte*) main::spritePtr1_return#0) ← (byte) $22
to:main::@return
main::@return: scope:[main] from main::@1
[8] return
@ -173,7 +204,7 @@ main::@return: scope:[main] from main::@1
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::getScreen1_$0
(byte~) main::getScreen1_$0
(byte) main::getScreen1_id
(byte*) main::getScreen1_return
(byte*) main::getScreen1_return#0 4.0
@ -202,7 +233,6 @@ INITIAL ASM
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_POINTER = 2
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -221,21 +251,20 @@ bend_from_b1:
bend:
//SEG10 main
main: {
.const getScreen1_id = 0
.label getScreen1_return = 2
.label spritePtr1_return = 4
jmp getScreen1
//SEG11 main::getScreen1
getScreen1:
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER) -- pbuz1=_deref_pptc1
lda screens+getScreen1_id*SIZEOF_POINTER
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0) -- pbuz1=_deref_pptc1
lda screens
sta getScreen1_return
lda screens+getScreen1_id*SIZEOF_POINTER+1
lda screens+1
sta getScreen1_return+1
jmp spritePtr1
//SEG13 main::spritePtr1
spritePtr1:
//SEG14 [6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378 -- pbuz1=pbuz2_plus_vwuc1
//SEG14 [6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word) $378 -- pbuz1=pbuz2_plus_vwuc1
lda getScreen1_return
clc
adc #<$378
@ -246,7 +275,7 @@ main: {
jmp b1
//SEG15 main::@1
b1:
//SEG16 [7] *((byte*) main::spritePtr1_return#0) ← (byte/signed byte/word/signed word/dword/signed dword) $22 -- _deref_pbuz1=vbuc1
//SEG16 [7] *((byte*) main::spritePtr1_return#0) ← (byte) $22 -- _deref_pbuz1=vbuc1
lda #$22
ldy #0
sta (spritePtr1_return),y
@ -259,9 +288,9 @@ main: {
screens: .word $400, $1400
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER) [ main::getScreen1_return#0 ] ( main:2 [ main::getScreen1_return#0 ] ) always clobbers reg byte a
Statement [6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378 [ main::spritePtr1_return#0 ] ( main:2 [ main::spritePtr1_return#0 ] ) always clobbers reg byte a
Statement [7] *((byte*) main::spritePtr1_return#0) ← (byte/signed byte/word/signed word/dword/signed dword) $22 [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Statement [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0) [ main::getScreen1_return#0 ] ( main:2 [ main::getScreen1_return#0 ] ) always clobbers reg byte a
Statement [6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word) $378 [ main::spritePtr1_return#0 ] ( main:2 [ main::spritePtr1_return#0 ] ) always clobbers reg byte a
Statement [7] *((byte*) main::spritePtr1_return#0) ← (byte) $22 [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
Potential registers zp ZP_WORD:2 [ main::getScreen1_return#0 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_WORD:4 [ main::spritePtr1_return#0 ] : zp ZP_WORD:4 ,
@ -281,7 +310,6 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_POINTER = 2
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -300,21 +328,20 @@ bend_from_b1:
bend:
//SEG10 main
main: {
.const getScreen1_id = 0
.label getScreen1_return = 2
.label spritePtr1_return = 2
jmp getScreen1
//SEG11 main::getScreen1
getScreen1:
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER) -- pbuz1=_deref_pptc1
lda screens+getScreen1_id*SIZEOF_POINTER
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0) -- pbuz1=_deref_pptc1
lda screens
sta getScreen1_return
lda screens+getScreen1_id*SIZEOF_POINTER+1
lda screens+1
sta getScreen1_return+1
jmp spritePtr1
//SEG13 main::spritePtr1
spritePtr1:
//SEG14 [6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378 -- pbuz1=pbuz1_plus_vwuc1
//SEG14 [6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word) $378 -- pbuz1=pbuz1_plus_vwuc1
clc
lda spritePtr1_return
adc #<$378
@ -325,7 +352,7 @@ main: {
jmp b1
//SEG15 main::@1
b1:
//SEG16 [7] *((byte*) main::spritePtr1_return#0) ← (byte/signed byte/word/signed word/dword/signed dword) $22 -- _deref_pbuz1=vbuc1
//SEG16 [7] *((byte*) main::spritePtr1_return#0) ← (byte) $22 -- _deref_pbuz1=vbuc1
lda #$22
ldy #0
sta (spritePtr1_return),y
@ -366,14 +393,12 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_POINTER SIZEOF_POINTER = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(label) main::@1
(label) main::@return
(label) main::getScreen1
(byte) main::getScreen1_$0
(byte~) main::getScreen1_$0
(byte) main::getScreen1_id
(const byte) main::getScreen1_id#0 getScreen1_id = (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) main::getScreen1_return
(byte*) main::getScreen1_return#0 getScreen1_return zp ZP_WORD:2 4.0
(byte*) main::screen
@ -384,7 +409,7 @@ FINAL SYMBOL TABLE
(byte*) main::spritePtr1_return#0 spritePtr1_return zp ZP_WORD:2 4.0
(byte*) main::spritePtr1_screen
(byte*[]) screens
(const byte*[]) screens#0 screens = { ((byte*))(word/signed word/dword/signed dword) $400, ((byte*))(word/signed word/dword/signed dword) $1400 }
(const byte*[]) screens#0 screens = { (byte*) 1024, (byte*) 5120 }
zp ZP_WORD:2 [ main::getScreen1_return#0 main::spritePtr1_return#0 ]
@ -399,7 +424,6 @@ Score: 48
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_POINTER = 2
//SEG3 @begin
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
@ -409,17 +433,16 @@ Score: 48
//SEG9 @end
//SEG10 main
main: {
.const getScreen1_id = 0
.label getScreen1_return = 2
.label spritePtr1_return = 2
//SEG11 main::getScreen1
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER) -- pbuz1=_deref_pptc1
lda screens+getScreen1_id*SIZEOF_POINTER
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0) -- pbuz1=_deref_pptc1
lda screens
sta getScreen1_return
lda screens+getScreen1_id*SIZEOF_POINTER+1
lda screens+1
sta getScreen1_return+1
//SEG13 main::spritePtr1
//SEG14 [6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378 -- pbuz1=pbuz1_plus_vwuc1
//SEG14 [6] (byte*) main::spritePtr1_return#0 ← (byte*) main::getScreen1_return#0 + (word) $378 -- pbuz1=pbuz1_plus_vwuc1
clc
lda spritePtr1_return
adc #<$378
@ -428,7 +451,7 @@ main: {
adc #>$378
sta spritePtr1_return+1
//SEG15 main::@1
//SEG16 [7] *((byte*) main::spritePtr1_return#0) ← (byte/signed byte/word/signed word/dword/signed dword) $22 -- _deref_pbuz1=vbuc1
//SEG16 [7] *((byte*) main::spritePtr1_return#0) ← (byte) $22 -- _deref_pbuz1=vbuc1
lda #$22
ldy #0
sta (spritePtr1_return),y

@ -1,24 +1 @@
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_POINTER SIZEOF_POINTER = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(label) main::@1
(label) main::@return
(label) main::getScreen1
(byte) main::getScreen1_$0
(byte) main::getScreen1_id
(const byte) main::getScreen1_id#0 getScreen1_id = (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) main::getScreen1_return
(byte*) main::getScreen1_return#0 getScreen1_return zp ZP_WORD:2 4.0
(byte*) main::screen
(label) main::spritePtr1
(byte*~) main::spritePtr1_$0
(byte*~) main::spritePtr1_$1
(byte*) main::spritePtr1_return
(byte*) main::spritePtr1_return#0 spritePtr1_return zp ZP_WORD:2 4.0
(byte*) main::spritePtr1_screen
(byte*[]) screens
(const byte*[]) screens#0 screens = { ((byte*))(word/signed word/dword/signed dword) $400, ((byte*))(word/signed word/dword/signed dword) $1400 }
zp ZP_WORD:2 [ main::getScreen1_return#0 main::spritePtr1_return#0 ]
program

@ -11,11 +11,11 @@ main: scope:[main] from @1
[4] phi()
to:main::getScreen1
main::getScreen1: scope:[main] from main
[5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER)
[5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0)
to:main::spritePtr1
main::spritePtr1: scope:[main] from main::getScreen1
[6] (byte*) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378
[7] (byte) main::spritePtr1_return#0 ← *((byte*) main::spritePtr1_$0#0)
[6] (byte*~) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word) $378
[7] (byte) main::spritePtr1_return#0 ← *((byte*~) main::spritePtr1_$0#0)
to:main::@1
main::@1: scope:[main] from main::spritePtr1
[8] *((const byte*) main::DSP#0) ← (byte) main::spritePtr1_return#0

@ -1,22 +1,27 @@
Fixing pointer array-indexing *((byte*[]) screens + (byte) getScreen::id)
Adding pointer type conversion cast (byte*) main::DSP in (byte*) main::DSP ← (number) $400
Identified constant variable (byte*) main::DSP
Inlined call (byte*~) main::$0 ← call getScreen (byte/signed byte/word/signed word/dword/signed dword) 0
Inlined call (byte*~) main::$0 ← call getScreen (number) 0
Inlined call (byte~) main::$1 ← call spritePtr (byte*~) main::$0
Culled Empty Block (label) main::getScreen1_@1
Culled Empty Block (label) main::spritePtr1_@1
Culled Empty Block (label) @1
Culled Empty Block (label) @2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*~) $0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte*~) $1 ← ((byte*)) (word/signed word/dword/signed dword) $1400
(byte*~) $0 ← ((byte*)) (number) $400
(byte*~) $1 ← ((byte*)) (number) $1400
(byte*[]) screens#0 ← { (byte*~) $0, (byte*~) $1 }
to:@3
main: scope:[main] from @3
(byte*) main::DSP#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte) main::getScreen1_id#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) main::DSP#0 ← ((byte*)) (number) $400
(byte) main::getScreen1_id#0 ← (number) 0
to:main::getScreen1
main::getScreen1: scope:[main] from main
(byte) main::getScreen1_id#1 ← phi( main/(byte) main::getScreen1_id#0 )
(byte) main::getScreen1_$0#0 ← (byte) main::getScreen1_id#1 * (const byte) SIZEOF_POINTER
(byte*) main::getScreen1_return#0 ← *((byte*[]) screens#0 + (byte) main::getScreen1_$0#0)
(byte~) main::getScreen1_$0#0 ← (byte) main::getScreen1_id#1 * (const byte) SIZEOF_POINTER
(byte*) main::getScreen1_return#0 ← *((byte*[]) screens#0 + (byte~) main::getScreen1_$0#0)
to:main::getScreen1_@return
main::getScreen1_@return: scope:[main] from main::getScreen1
(byte*) main::getScreen1_return#2 ← phi( main::getScreen1/(byte*) main::getScreen1_return#0 )
@ -29,9 +34,9 @@ main::@1: scope:[main] from main::getScreen1_@return
to:main::spritePtr1
main::spritePtr1: scope:[main] from main::@1
(byte*) main::spritePtr1_screen#1 ← phi( main::@1/(byte*) main::spritePtr1_screen#0 )
(byte*) main::spritePtr1_$0#0 ← (byte*) main::spritePtr1_screen#1 + (word/signed word/dword/signed dword) $378
(byte) main::spritePtr1_$1#0 ← ((byte)) *((byte*) main::spritePtr1_$0#0)
(byte) main::spritePtr1_return#0 ← (byte) main::spritePtr1_$1#0
(byte*~) main::spritePtr1_$0#0 ← (byte*) main::spritePtr1_screen#1 + (number) $378
(byte~) main::spritePtr1_$1#0 ← ((byte)) *((byte*~) main::spritePtr1_$0#0)
(byte) main::spritePtr1_return#0 ← (byte~) main::spritePtr1_$1#0
to:main::spritePtr1_@return
main::spritePtr1_@return: scope:[main] from main::spritePtr1
(byte) main::spritePtr1_return#2 ← phi( main::spritePtr1/(byte) main::spritePtr1_return#0 )
@ -40,7 +45,7 @@ main::spritePtr1_@return: scope:[main] from main::spritePtr1
main::@2: scope:[main] from main::spritePtr1_@return
(byte) main::spritePtr1_return#3 ← phi( main::spritePtr1_@return/(byte) main::spritePtr1_return#1 )
(byte~) main::$1 ← (byte) main::spritePtr1_return#3
*((byte*) main::DSP#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$1
*((byte*) main::DSP#0 + (number) 0) ← (byte~) main::$1
to:main::@return
main::@return: scope:[main] from main::@2
return
@ -59,7 +64,7 @@ SYMBOL TABLE SSA
(label) @4
(label) @begin
(label) @end
(const byte) SIZEOF_POINTER = (byte/signed byte/word/signed word/dword/signed dword) 2
(const byte) SIZEOF_POINTER = (byte) 2
(void()) main()
(byte*~) main::$0
(byte~) main::$1
@ -69,8 +74,8 @@ SYMBOL TABLE SSA
(byte*) main::DSP
(byte*) main::DSP#0
(label) main::getScreen1
(byte) main::getScreen1_$0
(byte) main::getScreen1_$0#0
(byte~) main::getScreen1_$0
(byte~) main::getScreen1_$0#0
(label) main::getScreen1_@return
(byte) main::getScreen1_id
(byte) main::getScreen1_id#0
@ -82,9 +87,9 @@ SYMBOL TABLE SSA
(byte*) main::getScreen1_return#3
(label) main::spritePtr1
(byte*~) main::spritePtr1_$0
(byte*) main::spritePtr1_$0#0
(byte*~) main::spritePtr1_$0#0
(byte~) main::spritePtr1_$1
(byte) main::spritePtr1_$1#0
(byte~) main::spritePtr1_$1#0
(label) main::spritePtr1_@return
(byte) main::spritePtr1_return
(byte) main::spritePtr1_return#0
@ -97,43 +102,73 @@ SYMBOL TABLE SSA
(byte*[]) screens
(byte*[]) screens#0
Culled Empty Block (label) @4
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) 0 in (byte) main::getScreen1_id#0 ← (number) 0
Adding number conversion cast (unumber) $378 in (byte*~) main::spritePtr1_$0#0 ← (byte*) main::spritePtr1_screen#1 + (number) $378
Adding number conversion cast (unumber) 0 in *((byte*) main::DSP#0 + (number) 0) ← (byte~) main::$1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) $0 ← (byte*)(number) $400
Inlining cast (byte*~) $1 ← (byte*)(number) $1400
Inlining cast (byte*) main::DSP#0 ← (byte*)(number) $400
Inlining cast (byte) main::getScreen1_id#0 ← (unumber)(number) 0
Inlining cast (byte~) main::spritePtr1_$1#0 ← (byte)*((byte*~) main::spritePtr1_$0#0)
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 5120
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast $378
Simplifying constant integer cast *((byte*~) main::spritePtr1_$0#0)
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $378
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) main::getScreen1_id#0 = (byte) main::getScreen1_id#1
Alias (byte*) main::getScreen1_return#0 = (byte*) main::getScreen1_return#2 (byte*) main::getScreen1_return#1 (byte*) main::getScreen1_return#3 (byte*~) main::$0 (byte*) main::spritePtr1_screen#0 (byte*) main::spritePtr1_screen#1
Alias (byte) main::spritePtr1_return#0 = (byte) main::spritePtr1_$1#0 (byte) main::spritePtr1_return#2 (byte) main::spritePtr1_return#1 (byte) main::spritePtr1_return#3 (byte~) main::$1
Alias (byte) main::spritePtr1_return#0 = (byte~) main::spritePtr1_$1#0 (byte) main::spritePtr1_return#2 (byte) main::spritePtr1_return#1 (byte) main::spritePtr1_return#3 (byte~) main::$1
Successful SSA optimization Pass2AliasElimination
Constant (const byte*) $0 = ((byte*))$400
Constant (const byte*) $1 = ((byte*))$1400
Constant (const byte*) main::DSP#0 = ((byte*))$400
Constant (const byte*) $0 = (byte*) 1024
Constant (const byte*) $1 = (byte*) 5120
Constant (const byte*) main::DSP#0 = (byte*) 1024
Constant (const byte) main::getScreen1_id#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::DSP#0 in [21] *((const byte*) main::DSP#0 + (byte) 0) ← (byte) main::spritePtr1_return#0
Successful SSA optimization PassNSimplifyExpressionWithZero
Constant right-side identified [0] (byte*[]) screens#0 ← { (const byte*) $0, (const byte*) $1 }
Constant right-side identified [1] (byte~) main::getScreen1_$0#0 ← (const byte) main::getScreen1_id#0 * (const byte) SIZEOF_POINTER
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*[]) screens#0 = { $0, $1 }
Constant (const byte) main::getScreen1_$0#0 = main::getScreen1_id#0*SIZEOF_POINTER
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(screens#0+main::getScreen1_$0#0)
Consolidated array index constant in *(main::DSP#0+0)
Successful SSA optimization Pass2ConstantAdditionElimination
Removing redundant cast (byte) main::spritePtr1_return#0 ← ((byte)) *((byte*) main::spritePtr1_$0#0)
Successful SSA optimization Pass2EliminateRedundantCasts
Culled Empty Block (label) main::getScreen1_@return
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::spritePtr1_@return
Successful SSA optimization Pass2CullEmptyBlocks
Constant inlined $0 = ((byte*))(word/signed word/dword/signed dword) $400
Constant inlined $1 = ((byte*))(word/signed word/dword/signed dword) $1400
Constant inlined main::getScreen1_$0#0 = (const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER
Simplifying constant evaluating to zero (const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER in
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero screens#0 in [2] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0 + (const byte) main::getScreen1_$0#0)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::getScreen1_id#0
Eliminating unused constant (const byte) main::getScreen1_$0#0
Eliminating unused constant (const byte) SIZEOF_POINTER
Successful SSA optimization PassNEliminateUnusedVars
Constant inlined $0 = (byte*) 1024
Constant inlined $1 = (byte*) 5120
Successful SSA optimization Pass2ConstantInlining
Simplifying constant plus zero main::DSP#0+0
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @4
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::getScreen1_@return
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::spritePtr1_@return
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @4
Culled Empty Block (label) main::getScreen1_@return
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::spritePtr1_@return
Renumbering block @3 to @1
Renumbering block main::@2 to main::@1
Adding NOP phi() at start of @begin
@ -155,11 +190,11 @@ main: scope:[main] from @1
[4] phi()
to:main::getScreen1
main::getScreen1: scope:[main] from main
[5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER)
[5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0)
to:main::spritePtr1
main::spritePtr1: scope:[main] from main::getScreen1
[6] (byte*) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378
[7] (byte) main::spritePtr1_return#0 ← *((byte*) main::spritePtr1_$0#0)
[6] (byte*~) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word) $378
[7] (byte) main::spritePtr1_return#0 ← *((byte*~) main::spritePtr1_$0#0)
to:main::@1
main::@1: scope:[main] from main::spritePtr1
[8] *((const byte*) main::DSP#0) ← (byte) main::spritePtr1_return#0
@ -172,12 +207,12 @@ main::@return: scope:[main] from main::@1
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::DSP
(byte) main::getScreen1_$0
(byte~) main::getScreen1_$0
(byte) main::getScreen1_id
(byte*) main::getScreen1_return
(byte*) main::getScreen1_return#0 4.0
(byte*~) main::spritePtr1_$0
(byte*) main::spritePtr1_$0#0 4.0
(byte*~) main::spritePtr1_$0#0 4.0
(byte~) main::spritePtr1_$1
(byte) main::spritePtr1_return
(byte) main::spritePtr1_return#0 4.0
@ -204,7 +239,6 @@ INITIAL ASM
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_POINTER = 2
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -224,22 +258,21 @@ bend:
//SEG10 main
main: {
.label DSP = $400
.const getScreen1_id = 0
.label getScreen1_return = 2
.label spritePtr1__0 = 4
.label spritePtr1_return = 6
jmp getScreen1
//SEG11 main::getScreen1
getScreen1:
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER) -- pbuz1=_deref_pptc1
lda screens+getScreen1_id*SIZEOF_POINTER
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0) -- pbuz1=_deref_pptc1
lda screens
sta getScreen1_return
lda screens+getScreen1_id*SIZEOF_POINTER+1
lda screens+1
sta getScreen1_return+1
jmp spritePtr1
//SEG13 main::spritePtr1
spritePtr1:
//SEG14 [6] (byte*) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378 -- pbuz1=pbuz2_plus_vwuc1
//SEG14 [6] (byte*~) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word) $378 -- pbuz1=pbuz2_plus_vwuc1
lda getScreen1_return
clc
adc #<$378
@ -247,7 +280,7 @@ main: {
lda getScreen1_return+1
adc #>$378
sta spritePtr1__0+1
//SEG15 [7] (byte) main::spritePtr1_return#0 ← *((byte*) main::spritePtr1_$0#0) -- vbuz1=_deref_pbuz2
//SEG15 [7] (byte) main::spritePtr1_return#0 ← *((byte*~) main::spritePtr1_$0#0) -- vbuz1=_deref_pbuz2
ldy #0
lda (spritePtr1__0),y
sta spritePtr1_return
@ -266,9 +299,9 @@ main: {
screens: .word $400, $1400
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER) [ main::getScreen1_return#0 ] ( main:2 [ main::getScreen1_return#0 ] ) always clobbers reg byte a
Statement [6] (byte*) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378 [ main::spritePtr1_$0#0 ] ( main:2 [ main::spritePtr1_$0#0 ] ) always clobbers reg byte a
Statement [7] (byte) main::spritePtr1_return#0 ← *((byte*) main::spritePtr1_$0#0) [ main::spritePtr1_return#0 ] ( main:2 [ main::spritePtr1_return#0 ] ) always clobbers reg byte a reg byte y
Statement [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0) [ main::getScreen1_return#0 ] ( main:2 [ main::getScreen1_return#0 ] ) always clobbers reg byte a
Statement [6] (byte*~) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word) $378 [ main::spritePtr1_$0#0 ] ( main:2 [ main::spritePtr1_$0#0 ] ) always clobbers reg byte a
Statement [7] (byte) main::spritePtr1_return#0 ← *((byte*~) main::spritePtr1_$0#0) [ main::spritePtr1_return#0 ] ( main:2 [ main::spritePtr1_return#0 ] ) always clobbers reg byte a reg byte y
Potential registers zp ZP_WORD:2 [ main::getScreen1_return#0 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_WORD:4 [ main::spritePtr1_$0#0 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_BYTE:6 [ main::spritePtr1_return#0 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
@ -289,7 +322,6 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_POINTER = 2
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
@ -309,21 +341,20 @@ bend:
//SEG10 main
main: {
.label DSP = $400
.const getScreen1_id = 0
.label getScreen1_return = 2
.label spritePtr1__0 = 2
jmp getScreen1
//SEG11 main::getScreen1
getScreen1:
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER) -- pbuz1=_deref_pptc1
lda screens+getScreen1_id*SIZEOF_POINTER
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0) -- pbuz1=_deref_pptc1
lda screens
sta getScreen1_return
lda screens+getScreen1_id*SIZEOF_POINTER+1
lda screens+1
sta getScreen1_return+1
jmp spritePtr1
//SEG13 main::spritePtr1
spritePtr1:
//SEG14 [6] (byte*) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378 -- pbuz1=pbuz1_plus_vwuc1
//SEG14 [6] (byte*~) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word) $378 -- pbuz1=pbuz1_plus_vwuc1
clc
lda spritePtr1__0
adc #<$378
@ -331,7 +362,7 @@ main: {
lda spritePtr1__0+1
adc #>$378
sta spritePtr1__0+1
//SEG15 [7] (byte) main::spritePtr1_return#0 ← *((byte*) main::spritePtr1_$0#0) -- vbuaa=_deref_pbuz1
//SEG15 [7] (byte) main::spritePtr1_return#0 ← *((byte*~) main::spritePtr1_$0#0) -- vbuaa=_deref_pbuz1
ldy #0
lda (spritePtr1__0),y
jmp b1
@ -376,27 +407,25 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_POINTER SIZEOF_POINTER = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(label) main::@1
(label) main::@return
(byte*) main::DSP
(const byte*) main::DSP#0 DSP = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) main::DSP#0 DSP = (byte*) 1024
(label) main::getScreen1
(byte) main::getScreen1_$0
(byte~) main::getScreen1_$0
(byte) main::getScreen1_id
(const byte) main::getScreen1_id#0 getScreen1_id = (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) main::getScreen1_return
(byte*) main::getScreen1_return#0 getScreen1_return zp ZP_WORD:2 4.0
(label) main::spritePtr1
(byte*~) main::spritePtr1_$0
(byte*) main::spritePtr1_$0#0 spritePtr1_$0 zp ZP_WORD:2 4.0
(byte*~) main::spritePtr1_$0#0 spritePtr1_$0 zp ZP_WORD:2 4.0
(byte~) main::spritePtr1_$1
(byte) main::spritePtr1_return
(byte) main::spritePtr1_return#0 reg byte a 4.0
(byte*) main::spritePtr1_screen
(byte*[]) screens
(const byte*[]) screens#0 screens = { ((byte*))(word/signed word/dword/signed dword) $400, ((byte*))(word/signed word/dword/signed dword) $1400 }
(const byte*[]) screens#0 screens = { (byte*) 1024, (byte*) 5120 }
zp ZP_WORD:2 [ main::getScreen1_return#0 main::spritePtr1_$0#0 ]
reg byte a [ main::spritePtr1_return#0 ]
@ -412,7 +441,6 @@ Score: 49
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_POINTER = 2
//SEG3 @begin
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
@ -423,17 +451,16 @@ Score: 49
//SEG10 main
main: {
.label DSP = $400
.const getScreen1_id = 0
.label getScreen1_return = 2
.label spritePtr1__0 = 2
//SEG11 main::getScreen1
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0+(const byte) main::getScreen1_id#0*(const byte) SIZEOF_POINTER) -- pbuz1=_deref_pptc1
lda screens+getScreen1_id*SIZEOF_POINTER
//SEG12 [5] (byte*) main::getScreen1_return#0 ← *((const byte*[]) screens#0) -- pbuz1=_deref_pptc1
lda screens
sta getScreen1_return
lda screens+getScreen1_id*SIZEOF_POINTER+1
lda screens+1
sta getScreen1_return+1
//SEG13 main::spritePtr1
//SEG14 [6] (byte*) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word/signed word/dword/signed dword) $378 -- pbuz1=pbuz1_plus_vwuc1
//SEG14 [6] (byte*~) main::spritePtr1_$0#0 ← (byte*) main::getScreen1_return#0 + (word) $378 -- pbuz1=pbuz1_plus_vwuc1
clc
lda spritePtr1__0
adc #<$378
@ -441,7 +468,7 @@ main: {
lda spritePtr1__0+1
adc #>$378
sta spritePtr1__0+1
//SEG15 [7] (byte) main::spritePtr1_return#0 ← *((byte*) main::spritePtr1_$0#0) -- vbuaa=_deref_pbuz1
//SEG15 [7] (byte) main::spritePtr1_return#0 ← *((byte*~) main::spritePtr1_$0#0) -- vbuaa=_deref_pbuz1
ldy #0
lda (spritePtr1__0),y
//SEG16 main::@1

@ -1,27 +1 @@
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_POINTER SIZEOF_POINTER = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(label) main::@1
(label) main::@return
(byte*) main::DSP
(const byte*) main::DSP#0 DSP = ((byte*))(word/signed word/dword/signed dword) $400
(label) main::getScreen1
(byte) main::getScreen1_$0
(byte) main::getScreen1_id
(const byte) main::getScreen1_id#0 getScreen1_id = (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) main::getScreen1_return
(byte*) main::getScreen1_return#0 getScreen1_return zp ZP_WORD:2 4.0
(label) main::spritePtr1
(byte*~) main::spritePtr1_$0
(byte*) main::spritePtr1_$0#0 spritePtr1_$0 zp ZP_WORD:2 4.0
(byte~) main::spritePtr1_$1
(byte) main::spritePtr1_return
(byte) main::spritePtr1_return#0 reg byte a 4.0
(byte*) main::spritePtr1_screen
(byte*[]) screens
(const byte*[]) screens#0 screens = { ((byte*))(word/signed word/dword/signed dword) $400, ((byte*))(word/signed word/dword/signed dword) $1400 }
zp ZP_WORD:2 [ main::getScreen1_return#0 main::spritePtr1_$0#0 ]
reg byte a [ main::spritePtr1_return#0 ]
program

@ -8,7 +8,7 @@
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::sprite_ptr#0) ← ((byte))(const byte*) sprite#0/(byte/signed byte/word/signed word/dword/signed dword) $40
[4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40
to:main::@return
main::@return: scope:[main] from main
[5] return

@ -1,17 +1,19 @@
Adding pointer type conversion cast (byte*) sprite in (byte*) sprite ← (number) $5000
Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $4400
Identified constant variable (byte*) sprite
Identified constant variable (byte*) SCREEN
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) sprite#0 ← ((byte*)) (word/signed word/dword/signed dword) $5000
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $4400
(byte*) sprite#0 ← ((byte*)) (number) $5000
(byte*) SCREEN#0 ← ((byte*)) (number) $4400
to:@1
main: scope:[main] from @1
(byte*~) main::$0 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $378
(byte*~) main::$0 ← (byte*) SCREEN#0 + (number) $378
(byte*) main::sprite_ptr#0 ← (byte*~) main::$0
(byte*~) main::$1 ← (byte*) sprite#0 / (byte/signed byte/word/signed word/dword/signed dword) $40
(byte*~) main::$1 ← (byte*) sprite#0 / (number) $40
(byte~) main::$2 ← ((byte)) (byte*~) main::$1
*((byte*) main::sprite_ptr#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$2
*((byte*) main::sprite_ptr#0 + (number) 0) ← (byte~) main::$2
to:main::@return
main::@return: scope:[main] from main
return
@ -40,32 +42,54 @@ SYMBOL TABLE SSA
(byte*) sprite
(byte*) sprite#0
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) $378 in (byte*~) main::$0 ← (byte*) SCREEN#0 + (number) $378
Adding number conversion cast (unumber) $40 in (byte*~) main::$1 ← (byte*) sprite#0 / (number) $40
Adding number conversion cast (unumber) 0 in *((byte*) main::sprite_ptr#0 + (number) 0) ← (byte~) main::$2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) sprite#0 ← (byte*)(number) $5000
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $4400
Inlining cast (byte~) main::$2 ← (byte)(byte*~) main::$1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 20480
Simplifying constant pointer cast (byte*) 17408
Simplifying constant integer cast $378
Simplifying constant integer cast $40
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $378
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) main::sprite_ptr#0 = (byte*~) main::$0
Successful SSA optimization Pass2AliasElimination
Constant (const byte*) sprite#0 = ((byte*))$5000
Constant (const byte*) SCREEN#0 = ((byte*))$4400
Constant (const byte*) sprite#0 = (byte*) 20480
Constant (const byte*) SCREEN#0 = (byte*) 17408
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::sprite_ptr#0 in [6] *((byte*) main::sprite_ptr#0 + (byte) 0) ← (byte~) main::$2
Successful SSA optimization PassNSimplifyExpressionWithZero
Constant right-side identified [0] (byte*) main::sprite_ptr#0 ← (const byte*) SCREEN#0 + (word) $378
Constant right-side identified [1] (byte*~) main::$1 ← (const byte*) sprite#0 / (byte) $40
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::sprite_ptr#0 = SCREEN#0+$378
Constant (const byte*) main::$1 = sprite#0/$40
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$2 = ((byte))main::$1
Constant value identified (byte)main::$1 in [2] (byte~) main::$2 ← (byte)(const byte*) main::$1
Successful SSA optimization Pass2ConstantValues
Constant (const byte) main::$2 = (byte)main::$1
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(main::sprite_ptr#0+0)
Successful SSA optimization Pass2ConstantAdditionElimination
Constant inlined main::$1 = (const byte*) sprite#0/(byte/signed byte/word/signed word/dword/signed dword) $40
Constant inlined main::$2 = ((byte))(const byte*) sprite#0/(byte/signed byte/word/signed word/dword/signed dword) $40
Constant inlined main::$1 = (const byte*) sprite#0/(byte) $40
Constant inlined main::$2 = (byte)(const byte*) sprite#0/(byte) $40
Successful SSA optimization Pass2ConstantInlining
Simplifying constant plus zero main::sprite_ptr#0+0
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
@ -81,7 +105,7 @@ FINAL CONTROL FLOW GRAPH
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::sprite_ptr#0) ← ((byte))(const byte*) sprite#0/(byte/signed byte/word/signed word/dword/signed dword) $40
[4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40
to:main::@return
main::@return: scope:[main] from main
[5] return
@ -124,7 +148,7 @@ bend:
//SEG9 main
main: {
.label sprite_ptr = SCREEN+$378
//SEG10 [4] *((const byte*) main::sprite_ptr#0) ← ((byte))(const byte*) sprite#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- _deref_pbuc1=vbuc2
//SEG10 [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 -- _deref_pbuc1=vbuc2
lda #$ff&sprite/$40
sta sprite_ptr
jmp breturn
@ -135,7 +159,7 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) main::sprite_ptr#0) ← ((byte))(const byte*) sprite#0/(byte/signed byte/word/signed word/dword/signed dword) $40 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
@ -171,7 +195,7 @@ bend:
//SEG9 main
main: {
.label sprite_ptr = SCREEN+$378
//SEG10 [4] *((const byte*) main::sprite_ptr#0) ← ((byte))(const byte*) sprite#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- _deref_pbuc1=vbuc2
//SEG10 [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 -- _deref_pbuc1=vbuc2
lda #$ff&sprite/$40
sta sprite_ptr
jmp breturn
@ -204,13 +228,13 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $4400
(const byte*) SCREEN#0 SCREEN = (byte*) 17408
(void()) main()
(label) main::@return
(byte*) main::sprite_ptr
(const byte*) main::sprite_ptr#0 sprite_ptr = (const byte*) SCREEN#0+(word/signed word/dword/signed dword) $378
(const byte*) main::sprite_ptr#0 sprite_ptr = (const byte*) SCREEN#0+(word) $378
(byte*) sprite
(const byte*) sprite#0 sprite = ((byte*))(word/signed word/dword/signed dword) $5000
(const byte*) sprite#0 sprite = (byte*) 20480
@ -235,7 +259,7 @@ Score: 12
//SEG9 main
main: {
.label sprite_ptr = SCREEN+$378
//SEG10 [4] *((const byte*) main::sprite_ptr#0) ← ((byte))(const byte*) sprite#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- _deref_pbuc1=vbuc2
//SEG10 [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 -- _deref_pbuc1=vbuc2
lda #$ff&sprite/$40
sta sprite_ptr
//SEG11 main::@return

@ -1,12 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $4400
(void()) main()
(label) main::@return
(byte*) main::sprite_ptr
(const byte*) main::sprite_ptr#0 sprite_ptr = (const byte*) SCREEN#0+(word/signed word/dword/signed dword) $378
(byte*) sprite
(const byte*) sprite#0 sprite = ((byte*))(word/signed word/dword/signed dword) $5000
program

@ -9,15 +9,15 @@
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0
[5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0
[6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1
[5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0
[6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1
to:main::@2
main::@2: scope:[main] from main
[7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2
[7] *((const byte*) main::BGCOL#0) ← (byte) 2
to:main::@return
main::@return: scope:[main] from main::@1 main::@2
[8] return
to:@return
main::@1: scope:[main] from main
[9] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5
[9] *((const byte*) main::BGCOL#0) ← (byte) 5
to:main::@return

@ -1,37 +1,41 @@
Adding pointer type conversion cast (byte*) main::SCREEN in (byte*) main::SCREEN ← (number) $400
Adding pointer type conversion cast (byte*) main::BGCOL in (byte*) main::BGCOL ← (number) $d021
Identified constant variable (byte*) main::SCREEN
Identified constant variable (byte) main::min
Identified constant variable (byte) main::max
Identified constant variable (byte*) main::BGCOL
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @1
(byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte) main::min#0 ← (byte/signed byte/word/signed word/dword/signed dword) $a
(byte) main::max#0 ← (byte/word/signed word/dword/signed dword) $c8
(byte*) main::SCREEN#0 ← ((byte*)) (number) $400
(byte) main::min#0 ← (number) $a
(byte) main::max#0 ← (number) $c8
(byte~) main::$0 ← (byte) main::min#0 + (byte) main::max#0
(word) main::sumw#0 ← ((word)) (byte~) main::$0
(word~) main::$1 ← (word) main::sumw#0 >> (byte/signed byte/word/signed word/dword/signed dword) 1
(word) main::sumw#0 ← (byte~) main::$0
(word~) main::$1 ← (word) main::sumw#0 >> (number) 1
(byte~) main::$2 ← ((byte)) (word~) main::$1
(byte/signed word/word/dword/signed dword~) main::$3 ← (byte~) main::$2 + (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::midw#0 ← (byte/signed word/word/dword/signed dword~) main::$3
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::midw#0
(number~) main::$3 ← (byte~) main::$2 + (number) 1
(byte) main::midw#0 ← (number~) main::$3
*((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::midw#0
(byte~) main::$4 ← (byte) main::min#0 + (byte) main::max#0
(byte) main::sumb#0 ← (byte~) main::$4
(byte~) main::$5 ← (byte) main::sumb#0 >> (byte/signed byte/word/signed word/dword/signed dword) 1
(byte/signed word/word/dword/signed dword~) main::$6 ← (byte~) main::$5 + (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::midb#0 ← (byte/signed word/word/dword/signed dword~) main::$6
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::midb#0
(byte*) main::BGCOL#0 ← ((byte*)) (word/dword/signed dword) $d021
(bool~) main::$7 ← *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) == *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)
(byte~) main::$5 ← (byte) main::sumb#0 >> (number) 1
(number~) main::$6 ← (byte~) main::$5 + (number) 1
(byte) main::midb#0 ← (number~) main::$6
*((byte*) main::SCREEN#0 + (number) 1) ← (byte) main::midb#0
(byte*) main::BGCOL#0 ← ((byte*)) (number) $d021
(bool~) main::$7 ← *((byte*) main::SCREEN#0 + (number) 0) == *((byte*) main::SCREEN#0 + (number) 1)
if((bool~) main::$7) goto main::@1
to:main::@3
main::@1: scope:[main] from main
*((byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5
*((byte*) main::BGCOL#0) ← (number) 5
to:main::@return
main::@3: scope:[main] from main
*((byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2
*((byte*) main::BGCOL#0) ← (number) 2
to:main::@return
main::@return: scope:[main] from main::@1 main::@3
return
@ -52,10 +56,10 @@ SYMBOL TABLE SSA
(byte~) main::$0
(word~) main::$1
(byte~) main::$2
(byte/signed word/word/dword/signed dword~) main::$3
(number~) main::$3
(byte~) main::$4
(byte~) main::$5
(byte/signed word/word/dword/signed dword~) main::$6
(number~) main::$6
(bool~) main::$7
(label) main::@1
(label) main::@3
@ -77,52 +81,114 @@ SYMBOL TABLE SSA
(word) main::sumw
(word) main::sumw#0
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Alias (byte) main::midw#0 = (byte/signed word/word/dword/signed dword~) main::$3
Adding number conversion cast (unumber) $a in (byte) main::min#0 ← (number) $a
Adding number conversion cast (unumber) $c8 in (byte) main::max#0 ← (number) $c8
Adding number conversion cast (unumber) 1 in (word~) main::$1 ← (word) main::sumw#0 >> (number) 1
Adding number conversion cast (unumber) 1 in (number~) main::$3 ← (byte~) main::$2 + (number) 1
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (byte~) main::$2 + (unumber)(number) 1
Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::midw#0
Adding number conversion cast (unumber) 1 in (byte~) main::$5 ← (byte) main::sumb#0 >> (number) 1
Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (byte~) main::$5 + (number) 1
Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (byte~) main::$5 + (unumber)(number) 1
Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← (byte) main::midb#0
Adding number conversion cast (unumber) 0 in (bool~) main::$7 ← *((byte*) main::SCREEN#0 + (number) 0) == *((byte*) main::SCREEN#0 + (number) 1)
Adding number conversion cast (unumber) 1 in (bool~) main::$7 ← *((byte*) main::SCREEN#0 + (unumber)(number) 0) == *((byte*) main::SCREEN#0 + (number) 1)
Adding number conversion cast (unumber) 5 in *((byte*) main::BGCOL#0) ← (number) 5
Adding number conversion cast (unumber) 2 in *((byte*) main::BGCOL#0) ← (number) 2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) main::min#0 ← (unumber)(number) $a
Inlining cast (byte) main::max#0 ← (unumber)(number) $c8
Inlining cast (byte~) main::$2 ← (byte)(word~) main::$1
Inlining cast (byte*) main::BGCOL#0 ← (byte*)(number) $d021
Inlining cast *((byte*) main::BGCOL#0) ← (unumber)(number) 5
Inlining cast *((byte*) main::BGCOL#0) ← (unumber)(number) 2
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $a
Simplifying constant integer cast $c8
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant pointer cast (byte*) 53281
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $a
Finalized unsigned number type (byte) $c8
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$3 ← (byte~) main::$2 + (byte) 1
Inferred type updated to byte in (unumber~) main::$6 ← (byte~) main::$5 + (byte) 1
Alias (word) main::sumw#0 = (byte~) main::$0
Alias (byte) main::midw#0 = (byte~) main::$3
Alias (byte) main::sumb#0 = (byte~) main::$4
Alias (byte) main::midb#0 = (byte/signed word/word/dword/signed dword~) main::$6
Alias (byte) main::midb#0 = (byte~) main::$6
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$7 [18] if(*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0)==*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1
Simple Condition (bool~) main::$7 [18] if(*((byte*) main::SCREEN#0 + (byte) 0)==*((byte*) main::SCREEN#0 + (byte) 1)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::SCREEN#0 = ((byte*))$400
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
Constant (const byte) main::min#0 = $a
Constant (const byte) main::max#0 = $c8
Constant (const byte*) main::BGCOL#0 = ((byte*))$d021
Constant (const byte*) main::BGCOL#0 = (byte*) 53281
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$0 = main::min#0+main::max#0
Simplifying expression containing zero main::SCREEN#0 in [9] *((const byte*) main::SCREEN#0 + (byte) 0) ← (byte) main::midw#0
Simplifying expression containing zero main::SCREEN#0 in [18] if(*((const byte*) main::SCREEN#0 + (byte) 0)==*((const byte*) main::SCREEN#0 + (byte) 1)) goto main::@1
Successful SSA optimization PassNSimplifyExpressionWithZero
Constant right-side identified [0] (word) main::sumw#0 ← (const byte) main::min#0 + (const byte) main::max#0
Constant right-side identified [5] (byte) main::sumb#0 ← (const byte) main::min#0 + (const byte) main::max#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::sumw#0 = main::min#0+main::max#0
Constant (const byte) main::sumb#0 = main::min#0+main::max#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const word) main::sumw#0 = ((word))main::$0
Constant right-side identified [0] (word~) main::$1 ← (const word) main::sumw#0 >> (byte) 1
Constant right-side identified [4] (byte~) main::$5 ← (const byte) main::sumb#0 >> (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::$1 = main::sumw#0>>1
Constant (const byte) main::$5 = main::sumb#0>>1
Successful SSA optimization Pass2ConstantIdentification
Constant (const word) main::$1 = main::sumw#0>>1
Constant value identified (byte)main::$1 in [1] (byte~) main::$2 ← (byte)(const word) main::$1
Successful SSA optimization Pass2ConstantValues
Constant right-side identified [3] (byte) main::midb#0 ← (const byte) main::$5 + (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$2 = (byte)main::$1
Constant (const byte) main::midb#0 = main::$5+1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$2 = ((byte))main::$1
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [0] (byte) main::midw#0 ← (const byte) main::$2 + (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::midw#0 = main::$2+1
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(main::SCREEN#0+0)
Constant inlined main::$5 = (const byte) main::sumb#0>>(byte) 1
Constant inlined main::$1 = (const word) main::sumw#0>>(byte) 1
Constant inlined main::$2 = (byte)(const word) main::sumw#0>>(byte) 1
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::SCREEN#0+1)
Consolidated array index constant in *(main::SCREEN#0+0)
Consolidated array index constant in *(main::SCREEN#0+1)
Successful SSA optimization Pass2ConstantAdditionElimination
Constant inlined main::$5 = (const byte) main::sumb#0>>(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$1 = (const word) main::sumw#0>>(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$2 = ((byte))(const word) main::sumw#0>>(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$0 = (const byte) main::min#0+(const byte) main::max#0
Successful SSA optimization Pass2ConstantInlining
Simplifying constant plus zero main::SCREEN#0+0
Simplifying constant plus zero main::SCREEN#0+0
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Renumbering block main::@3 to main::@2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
@ -140,17 +206,17 @@ FINAL CONTROL FLOW GRAPH
[3] phi()
main: scope:[main] from @1
[4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0
[5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0
[6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1
[5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0
[6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1
to:main::@2
main::@2: scope:[main] from main
[7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2
[7] *((const byte*) main::BGCOL#0) ← (byte) 2
to:main::@return
main::@return: scope:[main] from main::@1 main::@2
[8] return
to:@return
main::@1: scope:[main] from main
[9] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5
[9] *((const byte*) main::BGCOL#0) ← (byte) 5
to:main::@return
@ -196,24 +262,24 @@ main: {
.const min = $a
.const max = $c8
.label BGCOL = $d021
.const sumb = min+max
.const sumw = min+max
.const sumb = min+max
.const midb = (sumb>>1)+1
.const midw = (sumw>>1)+1
//SEG10 [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2
lda #midw
sta SCREEN
//SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2
lda #midb
sta SCREEN+1
//SEG12 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1
//SEG12 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1
lda SCREEN
cmp SCREEN+1
beq b1
jmp b2
//SEG13 main::@2
b2:
//SEG14 [7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 -- _deref_pbuc1=vbuc2
//SEG14 [7] *((const byte*) main::BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
sta BGCOL
jmp breturn
@ -223,7 +289,7 @@ main: {
rts
//SEG17 main::@1
b1:
//SEG18 [9] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 -- _deref_pbuc1=vbuc2
//SEG18 [9] *((const byte*) main::BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2
lda #5
sta BGCOL
jmp breturn
@ -231,10 +297,10 @@ main: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] *((const byte*) main::BGCOL#0) ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *((const byte*) main::BGCOL#0) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
@ -271,24 +337,24 @@ main: {
.const min = $a
.const max = $c8
.label BGCOL = $d021
.const sumb = min+max
.const sumw = min+max
.const sumb = min+max
.const midb = (sumb>>1)+1
.const midw = (sumw>>1)+1
//SEG10 [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2
lda #midw
sta SCREEN
//SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2
lda #midb
sta SCREEN+1
//SEG12 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1
//SEG12 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1
lda SCREEN
cmp SCREEN+1
beq b1
jmp b2
//SEG13 main::@2
b2:
//SEG14 [7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 -- _deref_pbuc1=vbuc2
//SEG14 [7] *((const byte*) main::BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
sta BGCOL
jmp breturn
@ -298,7 +364,7 @@ main: {
rts
//SEG17 main::@1
b1:
//SEG18 [9] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 -- _deref_pbuc1=vbuc2
//SEG18 [9] *((const byte*) main::BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2
lda #5
sta BGCOL
jmp breturn
@ -335,21 +401,21 @@ FINAL SYMBOL TABLE
(label) main::@2
(label) main::@return
(byte*) main::BGCOL
(const byte*) main::BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) $d021
(const byte*) main::BGCOL#0 BGCOL = (byte*) 53281
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
(byte) main::max
(const byte) main::max#0 max = (byte/word/signed word/dword/signed dword) $c8
(const byte) main::max#0 max = (byte) $c8
(byte) main::midb
(const byte) main::midb#0 midb = (const byte) main::sumb#0>>(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1
(const byte) main::midb#0 midb = (const byte) main::sumb#0>>(byte) 1+(byte) 1
(byte) main::midw
(const byte) main::midw#0 midw = ((byte))(const word) main::sumw#0>>(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1
(const byte) main::midw#0 midw = (byte)(const word) main::sumw#0>>(byte) 1+(byte) 1
(byte) main::min
(const byte) main::min#0 min = (byte/signed byte/word/signed word/dword/signed dword) $a
(const byte) main::min#0 min = (byte) $a
(byte) main::sumb
(const byte) main::sumb#0 sumb = (const byte) main::min#0+(const byte) main::max#0
(word) main::sumw
(const word) main::sumw#0 sumw = ((word))(const byte) main::min#0+(const byte) main::max#0
(const word) main::sumw#0 sumw = (const byte) main::min#0+(const byte) main::max#0
@ -375,22 +441,22 @@ main: {
.const min = $a
.const max = $c8
.label BGCOL = $d021
.const sumb = min+max
.const sumw = min+max
.const sumb = min+max
.const midb = (sumb>>1)+1
.const midw = (sumw>>1)+1
//SEG10 [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 -- _deref_pbuc1=vbuc2
lda #midw
sta SCREEN
//SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) main::SCREEN#0+(byte) 1) ← (const byte) main::midb#0 -- _deref_pbuc1=vbuc2
lda #midb
sta SCREEN+1
//SEG12 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1
//SEG12 [6] if(*((const byte*) main::SCREEN#0)==*((const byte*) main::SCREEN#0+(byte) 1)) goto main::@1 -- _deref_pbuc1_eq__deref_pbuc2_then_la1
lda SCREEN
cmp SCREEN+1
beq b1
//SEG13 main::@2
//SEG14 [7] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 -- _deref_pbuc1=vbuc2
//SEG14 [7] *((const byte*) main::BGCOL#0) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
sta BGCOL
//SEG15 main::@return
@ -398,7 +464,7 @@ main: {
rts
//SEG17 main::@1
b1:
//SEG18 [9] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 -- _deref_pbuc1=vbuc2
//SEG18 [9] *((const byte*) main::BGCOL#0) ← (byte) 5 -- _deref_pbuc1=vbuc2
lda #5
sta BGCOL
rts

@ -1,24 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) main::BGCOL
(const byte*) main::BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) $d021
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte) main::max
(const byte) main::max#0 max = (byte/word/signed word/dword/signed dword) $c8
(byte) main::midb
(const byte) main::midb#0 midb = (const byte) main::sumb#0>>(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::midw
(const byte) main::midw#0 midw = ((byte))(const word) main::sumw#0>>(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::min
(const byte) main::min#0 min = (byte/signed byte/word/signed word/dword/signed dword) $a
(byte) main::sumb
(const byte) main::sumb#0 sumb = (const byte) main::min#0+(const byte) main::max#0
(word) main::sumw
(const word) main::sumw#0 sumw = ((word))(const byte) main::min#0+(const byte) main::max#0
program

@ -11,13 +11,13 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::b#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::b#1 )
[6] (byte) main::b2#0 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2
[5] (byte) main::b#2 ← phi( main/(byte) 0 main::@1/(byte) main::b#1 )
[6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2
[7] *((const byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0
[8] (signed byte) main::sb#0 ← - (signed byte)(byte) main::b#2
[9] *((const byte*) SCREEN2#0 + (byte) main::b#2) ← (byte)(signed byte) main::sb#0
[10] (byte) main::b#1 ← ++ (byte) main::b#2
[11] if((byte) main::b#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1
[11] if((byte) main::b#1!=(byte) $65) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[12] phi()
@ -30,12 +30,12 @@ w: scope:[w] from main::@2
[15] phi()
to:w::@1
w::@1: scope:[w] from w w::@1
[16] (byte) w::i#2 ← phi( w/(byte/signed byte/word/signed word/dword/signed dword) 0 w::@1/(byte) w::i#1 )
[17] (byte) w::b2#0 ← (word/signed word/dword/signed dword) $578-(word/signed word/dword/signed dword) $546 + (byte) w::i#2
[16] (byte) w::i#2 ← phi( w/(byte) 0 w::@1/(byte) w::i#1 )
[17] (byte) w::b2#0 ← (byte)(number) $578-(number) $546 + (byte) w::i#2
[18] *((const byte*) SCREEN3#0 + (byte) w::i#2) ← (const byte) w::b#0
[19] *((const byte*) SCREEN4#0 + (byte) w::i#2) ← (byte) w::b2#0
[20] (byte) w::i#1 ← ++ (byte) w::i#2
[21] if((byte) w::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $b) goto w::@1
[21] if((byte) w::i#1!=(byte) $b) goto w::@1
to:w::@return
w::@return: scope:[w] from w::@1
[22] return

@ -1,33 +1,36 @@
Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400
Identified constant variable (byte*) SCREEN
Identified constant variable (word) w::w1
Identified constant variable (word) w::w2
Culled Empty Block (label) @1
Culled Empty Block (label) w::@2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte/signed byte/word/signed word/dword/signed dword~) $0 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 3
(byte*~) $1 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) $0
(byte*) SCREEN#0 ← ((byte*)) (number) $400
(number~) $0 ← (number) $28 * (number) 3
(byte*~) $1 ← (byte*) SCREEN#0 + (number~) $0
(byte*) SCREEN2#0 ← (byte*~) $1
(byte/word/signed word/dword/signed dword~) $2 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 6
(byte*~) $3 ← (byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) $2
(number~) $2 ← (number) $28 * (number) 6
(byte*~) $3 ← (byte*) SCREEN#0 + (number~) $2
(byte*) SCREEN3#0 ← (byte*~) $3
(word/signed word/dword/signed dword~) $4 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 9
(byte*~) $5 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) $4
(number~) $4 ← (number) $28 * (number) 9
(byte*~) $5 ← (byte*) SCREEN#0 + (number~) $4
(byte*) SCREEN4#0 ← (byte*~) $5
to:@2
main: scope:[main] from @2
(byte*) SCREEN4#5 ← phi( @2/(byte*) SCREEN4#6 )
(byte*) SCREEN3#5 ← phi( @2/(byte*) SCREEN3#6 )
(byte*) SCREEN2#2 ← phi( @2/(byte*) SCREEN2#3 )
(byte) main::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::b#0 ← (number) 0
to:main::@1
main::@1: scope:[main] from main main::@1
(byte*) SCREEN4#4 ← phi( main/(byte*) SCREEN4#5 main::@1/(byte*) SCREEN4#4 )
(byte*) SCREEN3#4 ← phi( main/(byte*) SCREEN3#5 main::@1/(byte*) SCREEN3#4 )
(byte*) SCREEN2#1 ← phi( main/(byte*) SCREEN2#2 main::@1/(byte*) SCREEN2#1 )
(byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 )
(byte/word/signed word/dword/signed dword~) main::$1 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2
(byte) main::b2#0 ← (byte/word/signed word/dword/signed dword~) main::$1
(number~) main::$1 ← (number) $c8 - (byte) main::b#2
(byte) main::b2#0 ← (number~) main::$1
*((byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0
(signed byte~) main::$2 ← ((signed byte)) (byte) main::b#2
(signed byte~) main::$3 ← - (signed byte~) main::$2
@ -51,20 +54,20 @@ main::@return: scope:[main] from main::@3
w: scope:[w] from main::@2
(byte*) SCREEN4#2 ← phi( main::@2/(byte*) SCREEN4#3 )
(byte*) SCREEN3#2 ← phi( main::@2/(byte*) SCREEN3#3 )
(byte) w::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) w::i#0 ← (number) 0
to:w::@1
w::@1: scope:[w] from w w::@1
(byte*) SCREEN4#1 ← phi( w/(byte*) SCREEN4#2 w::@1/(byte*) SCREEN4#1 )
(byte*) SCREEN3#1 ← phi( w/(byte*) SCREEN3#2 w::@1/(byte*) SCREEN3#1 )
(byte) w::i#2 ← phi( w/(byte) w::i#0 w::@1/(byte) w::i#1 )
(word) w::w1#0 ← (word/signed word/dword/signed dword) $514
(word) w::w2#0 ← (word/signed word/dword/signed dword) $4e2
(word) w::w1#0 ← (number) $514
(word) w::w2#0 ← (number) $4e2
(word~) w::$0 ← (word) w::w1#0 - (word) w::w2#0
(byte~) w::$1 ← ((byte)) (word~) w::$0
(byte) w::b#0 ← (byte~) w::$1
(byte/signed byte/word/signed word/dword/signed dword~) w::$2 ← (word/signed word/dword/signed dword) $578 - (word/signed word/dword/signed dword) $546
(byte/signed word/word/dword/signed dword~) w::$3 ← (byte/signed byte/word/signed word/dword/signed dword~) w::$2 + (byte) w::i#2
(byte) w::b2#0 ← (byte/signed word/word/dword/signed dword~) w::$3
(number~) w::$2 ← (number) $578 - (number) $546
(number~) w::$3 ← (number~) w::$2 + (byte) w::i#2
(byte) w::b2#0 ← (number~) w::$3
*((byte*) SCREEN3#1 + (byte) w::i#2) ← (byte) w::b#0
*((byte*) SCREEN4#1 + (byte) w::i#2) ← (byte) w::b2#0
(byte) w::i#1 ← (byte) w::i#2 + rangenext(0,$a)
@ -85,11 +88,11 @@ w::@return: scope:[w] from w::@1
@end: scope:[] from @3
SYMBOL TABLE SSA
(byte/signed byte/word/signed word/dword/signed dword~) $0
(number~) $0
(byte*~) $1
(byte/word/signed word/dword/signed dword~) $2
(number~) $2
(byte*~) $3
(word/signed word/dword/signed dword~) $4
(number~) $4
(byte*~) $5
(label) @2
(label) @3
@ -119,7 +122,7 @@ SYMBOL TABLE SSA
(byte*) SCREEN4#5
(byte*) SCREEN4#6
(void()) main()
(byte/word/signed word/dword/signed dword~) main::$1
(number~) main::$1
(signed byte~) main::$2
(signed byte~) main::$3
(byte~) main::$4
@ -139,8 +142,8 @@ SYMBOL TABLE SSA
(void()) w()
(word~) w::$0
(byte~) w::$1
(byte/signed byte/word/signed word/dword/signed dword~) w::$2
(byte/signed word/word/dword/signed dword~) w::$3
(number~) w::$2
(number~) w::$3
(bool~) w::$4
(label) w::@1
(label) w::@return
@ -157,18 +160,54 @@ SYMBOL TABLE SSA
(word) w::w2
(word) w::w2#0
Culled Empty Block (label) main::@3
Culled Empty Block (label) @3
Successful SSA optimization Pass2CullEmptyBlocks
Adding number conversion cast (unumber) $0 in (byte*~) $1 ← (byte*) SCREEN#0 + (number~) $0
Adding number conversion cast (unumber) $2 in (byte*~) $3 ← (byte*) SCREEN#0 + (number~) $2
Adding number conversion cast (unumber) $4 in (byte*~) $5 ← (byte*) SCREEN#0 + (number~) $4
Adding number conversion cast (unumber) 0 in (byte) main::b#0 ← (number) 0
Adding number conversion cast (unumber) $c8 in (number~) main::$1 ← (number) $c8 - (byte) main::b#2
Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (unumber)(number) $c8 - (byte) main::b#2
Adding number conversion cast (unumber) 0 in (byte) w::i#0 ← (number) 0
Adding number conversion cast (unumber) $514 in (word) w::w1#0 ← (number) $514
Adding number conversion cast (unumber) $4e2 in (word) w::w2#0 ← (number) $4e2
Adding number conversion cast (unumber) w::$2 in (number~) w::$3 ← (number~) w::$2 + (byte) w::i#2
Adding number conversion cast (unumber) w::$3 in (number~) w::$3 ← (unumber~) w::$5 + (byte) w::i#2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (unumber~) $6 ← (unumber)(number~) $0
Inlining cast (unumber~) $7 ← (unumber)(number~) $2
Inlining cast (unumber~) $8 ← (unumber)(number~) $4
Inlining cast (byte) main::b#0 ← (unumber)(number) 0
Inlining cast (signed byte~) main::$2 ← (signed byte)(byte) main::b#2
Inlining cast (byte~) main::$4 ← (byte)(signed byte) main::sb#0
Inlining cast (byte) w::i#0 ← (unumber)(number) 0
Inlining cast (word) w::w1#0 ← (unumber)(number) $514
Inlining cast (word) w::w2#0 ← (unumber)(number) $4e2
Inlining cast (byte~) w::$1 ← (byte)(word~) w::$0
Inlining cast (unumber~) w::$5 ← (unumber)(number~) w::$2
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast $c8
Simplifying constant integer cast 0
Simplifying constant integer cast $514
Simplifying constant integer cast $4e2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $c8
Finalized unsigned number type (byte) 0
Finalized unsigned number type (word) $514
Finalized unsigned number type (word) $4e2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$1 ← (byte) $c8 - (byte) main::b#2
Alias (byte*) SCREEN2#0 = (byte*~) $1 (byte*) SCREEN2#3
Alias (byte*) SCREEN3#0 = (byte*~) $3 (byte*) SCREEN3#6
Alias (byte*) SCREEN4#0 = (byte*~) $5 (byte*) SCREEN4#6
Alias (byte) main::b2#0 = (byte/word/signed word/dword/signed dword~) main::$1
Alias (byte) main::b2#0 = (byte~) main::$1
Alias (signed byte) main::sb#0 = (signed byte~) main::$3
Alias (byte*) SCREEN3#3 = (byte*) SCREEN3#4
Alias (byte*) SCREEN4#3 = (byte*) SCREEN4#4
Alias (byte) w::b#0 = (byte~) w::$1
Alias (byte) w::b2#0 = (byte/signed word/word/dword/signed dword~) w::$3
Alias (byte) w::b2#0 = (unumber~) w::$3
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) SCREEN2#1
Self Phi Eliminated (byte*) SCREEN3#3
@ -176,70 +215,119 @@ Self Phi Eliminated (byte*) SCREEN4#3
Self Phi Eliminated (byte*) SCREEN3#1
Self Phi Eliminated (byte*) SCREEN4#1
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) SCREEN2#2 (byte*) SCREEN2#0
Redundant Phi (byte*) SCREEN3#5 (byte*) SCREEN3#0
Redundant Phi (byte*) SCREEN4#5 (byte*) SCREEN4#0
Redundant Phi (byte*) SCREEN2#1 (byte*) SCREEN2#2
Redundant Phi (byte*) SCREEN3#3 (byte*) SCREEN3#5
Redundant Phi (byte*) SCREEN4#3 (byte*) SCREEN4#5
Redundant Phi (byte*) SCREEN3#2 (byte*) SCREEN3#3
Redundant Phi (byte*) SCREEN4#2 (byte*) SCREEN4#3
Redundant Phi (byte*) SCREEN3#1 (byte*) SCREEN3#2
Redundant Phi (byte*) SCREEN4#1 (byte*) SCREEN4#2
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) main::$5 [23] if((byte) main::b#1!=rangelast(0,$64)) goto main::@1
Simple Condition (bool~) w::$4 [42] if((byte) w::i#1!=rangelast(0,$a)) goto w::@1
Identical Phi Values (byte*) SCREEN2#2 (byte*) SCREEN2#0
Identical Phi Values (byte*) SCREEN3#5 (byte*) SCREEN3#0
Identical Phi Values (byte*) SCREEN4#5 (byte*) SCREEN4#0
Identical Phi Values (byte*) SCREEN2#1 (byte*) SCREEN2#2
Identical Phi Values (byte*) SCREEN3#3 (byte*) SCREEN3#5
Identical Phi Values (byte*) SCREEN4#3 (byte*) SCREEN4#5
Identical Phi Values (byte*) SCREEN3#2 (byte*) SCREEN3#3
Identical Phi Values (byte*) SCREEN4#2 (byte*) SCREEN4#3
Identical Phi Values (byte*) SCREEN3#1 (byte*) SCREEN3#2
Identical Phi Values (byte*) SCREEN4#1 (byte*) SCREEN4#2
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$5 [26] if((byte) main::b#1!=rangelast(0,$64)) goto main::@1
Simple Condition (bool~) w::$4 [46] if((byte) w::i#1!=rangelast(0,$a)) goto w::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) SCREEN#0 = ((byte*))$400
Constant (const byte/signed byte/word/signed word/dword/signed dword) $0 = $28*3
Constant (const byte/word/signed word/dword/signed dword) $2 = $28*6
Constant (const word/signed word/dword/signed dword) $4 = $28*9
Constant right-side identified [1] (number~) $0 ← (number) $28 * (number) 3
Constant right-side identified [5] (number~) $2 ← (number) $28 * (number) 6
Constant right-side identified [9] (number~) $4 ← (number) $28 * (number) 9
Constant right-side identified [38] (number~) w::$2 ← (number) $578 - (number) $546
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const number) $0 = $28*3
Constant (const number) $2 = $28*6
Constant (const number) $4 = $28*9
Constant (const byte) main::b#0 = 0
Constant (const byte) w::i#0 = 0
Constant (const word) w::w1#0 = $514
Constant (const word) w::w2#0 = $4e2
Constant (const byte/signed byte/word/signed word/dword/signed dword) w::$2 = $578-$546
Constant (const number) w::$2 = $578-$546
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) SCREEN2#0 = SCREEN#0+$0
Constant (const byte*) SCREEN3#0 = SCREEN#0+$2
Constant (const byte*) SCREEN4#0 = SCREEN#0+$4
Constant value identified (unumber)$0 in [2] (unumber~) $6 ← (unumber)(const number) $0
Constant value identified (unumber)$2 in [6] (unumber~) $7 ← (unumber)(const number) $2
Constant value identified (unumber)$4 in [10] (unumber~) $8 ← (unumber)(const number) $4
Constant value identified (unumber)w::$2 in [39] (unumber~) w::$5 ← (unumber)(const number) w::$2
Successful SSA optimization Pass2ConstantValues
Resolved ranged next value [24] main::b#1 ← ++ main::b#2 to ++
Resolved ranged comparison value [26] if(main::b#1!=rangelast(0,$64)) goto main::@1 to (number) $65
Resolved ranged next value [44] w::i#1 ← ++ w::i#2 to ++
Resolved ranged comparison value [46] if(w::i#1!=rangelast(0,$a)) goto w::@1 to (number) $b
Adding number conversion cast (unumber) $65 in if((byte) main::b#1!=(number) $65) goto main::@1
Adding number conversion cast (unumber) $b in if((byte) w::i#1!=(number) $b) goto w::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $65
Simplifying constant integer cast $b
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $65
Finalized unsigned number type (byte) $b
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [18] (word~) w::$0 ← (const word) w::w1#0 - (const word) w::w2#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const unumber) $6 = (unumber)$0
Constant (const unumber) $7 = (unumber)$2
Constant (const unumber) $8 = (unumber)$4
Constant (const word) w::$0 = w::w1#0-w::w2#0
Constant (const unumber) w::$5 = (unumber)w::$2
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) w::b#0 = ((byte))w::$0
Constant value identified (byte)w::$0 in [19] (byte) w::b#0 ← (byte)(const word) w::$0
Successful SSA optimization Pass2ConstantValues
Simplifying constant integer cast (const unumber) w::$2
Simplifying constant integer cast (const unumber) $0
Simplifying constant integer cast (const unumber) $2
Simplifying constant integer cast (const unumber) $4
Successful SSA optimization PassNCastSimplification
Constant right-side identified [0] (byte*) SCREEN2#0 ← (const byte*) SCREEN#0 + (const unumber) $6
Constant right-side identified [1] (byte*) SCREEN3#0 ← (const byte*) SCREEN#0 + (const unumber) $7
Constant right-side identified [2] (byte*) SCREEN4#0 ← (const byte*) SCREEN#0 + (const unumber) $8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) SCREEN2#0 = SCREEN#0+$6
Constant (const byte*) SCREEN3#0 = SCREEN#0+$7
Constant (const byte*) SCREEN4#0 = SCREEN#0+$8
Constant (const byte) w::b#0 = (byte)w::$0
Successful SSA optimization Pass2ConstantIdentification
Eliminating Noop Cast (signed byte~) main::$2 ← ((signed byte)) (byte) main::b#2
Eliminating Noop Cast (byte~) main::$4 ← ((byte)) (signed byte) main::sb#0
Successful SSA optimization Pass2NopCastElimination
Resolved ranged next value main::b#1 ← ++ main::b#2 to ++
Resolved ranged comparison value if(main::b#1!=rangelast(0,$64)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) $65
Resolved ranged next value w::i#1 ← ++ w::i#2 to ++
Resolved ranged comparison value if(w::i#1!=rangelast(0,$a)) goto w::@1 to (byte/signed byte/word/signed word/dword/signed dword) $b
Inlining Noop Cast [3] (signed byte~) main::$2 ← (signed byte)(byte) main::b#2 keeping main::b#2
Inlining Noop Cast [5] (byte~) main::$4 ← (byte)(signed byte) main::sb#0 keeping main::sb#0
Successful SSA optimization Pass2NopCastInlining
Inlining constant with var siblings (const byte) main::b#0
Inlining constant with var siblings (const byte) w::i#0
Constant inlined $4 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 9
Constant inlined w::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::b#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined $4 = (number) $28*(number) 9
Constant inlined w::$5 = (number) $578-(number) $546
Constant inlined $6 = (number) $28*(number) 3
Constant inlined w::i#0 = (byte) 0
Constant inlined $7 = (number) $28*(number) 6
Constant inlined main::b#0 = (byte) 0
Constant inlined $8 = (number) $28*(number) 9
Constant inlined w::$0 = (const word) w::w1#0-(const word) w::w2#0
Constant inlined $0 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 3
Constant inlined w::$2 = (word/signed word/dword/signed dword) $578-(word/signed word/dword/signed dword) $546
Constant inlined $2 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 6
Constant inlined $0 = (number) $28*(number) 3
Constant inlined w::$2 = (number) $578-(number) $546
Constant inlined $2 = (number) $28*(number) 6
Successful SSA optimization Pass2ConstantInlining
Adding number conversion cast (unumber) $28*3 in
Adding number conversion cast (unumber) $28*6 in
Adding number conversion cast (unumber) $28*9 in
Adding number conversion cast (unumber) $578-$546 in [12] (byte) w::b2#0 ← (number) $578-(number) $546 + (byte) w::i#2
Successful SSA optimization PassNAddNumberTypeConversions
Added new block during phi lifting main::@4(between main::@1 and main::@1)
Added new block during phi lifting w::@3(between w::@1 and w::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of w
CALL GRAPH
Calls in [] to main:2
Calls in [main] to w:13
Calls in [main] to w:14
Created 2 initial phi equivalence classes
Coalesced [15] main::b#3 ← main::b#1
Coalesced [24] w::i#3 ← w::i#1
Coalesced [17] main::b#3 ← main::b#1
Coalesced [26] w::i#3 ← w::i#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@4
Culled Empty Block (label) w::@3
Renumbering block @2 to @1
@ -264,13 +352,13 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::b#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::b#1 )
[6] (byte) main::b2#0 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2
[5] (byte) main::b#2 ← phi( main/(byte) 0 main::@1/(byte) main::b#1 )
[6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2
[7] *((const byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0
[8] (signed byte) main::sb#0 ← - (signed byte)(byte) main::b#2
[9] *((const byte*) SCREEN2#0 + (byte) main::b#2) ← (byte)(signed byte) main::sb#0
[10] (byte) main::b#1 ← ++ (byte) main::b#2
[11] if((byte) main::b#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1
[11] if((byte) main::b#1!=(byte) $65) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[12] phi()
@ -283,12 +371,12 @@ w: scope:[w] from main::@2
[15] phi()
to:w::@1
w::@1: scope:[w] from w w::@1
[16] (byte) w::i#2 ← phi( w/(byte/signed byte/word/signed word/dword/signed dword) 0 w::@1/(byte) w::i#1 )
[17] (byte) w::b2#0 ← (word/signed word/dword/signed dword) $578-(word/signed word/dword/signed dword) $546 + (byte) w::i#2
[16] (byte) w::i#2 ← phi( w/(byte) 0 w::@1/(byte) w::i#1 )
[17] (byte) w::b2#0 ← (byte)(number) $578-(number) $546 + (byte) w::i#2
[18] *((const byte*) SCREEN3#0 + (byte) w::i#2) ← (const byte) w::b#0
[19] *((const byte*) SCREEN4#0 + (byte) w::i#2) ← (byte) w::b2#0
[20] (byte) w::i#1 ← ++ (byte) w::i#2
[21] if((byte) w::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $b) goto w::@1
[21] if((byte) w::i#1!=(byte) $b) goto w::@1
to:w::@return
w::@return: scope:[w] from w::@1
[22] return
@ -370,7 +458,7 @@ main: {
.label b = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::b#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG12 [5] phi (byte) main::b#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta b
jmp b1
@ -380,7 +468,7 @@ main: {
jmp b1
//SEG15 main::@1
b1:
//SEG16 [6] (byte) main::b2#0 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2 -- vbuz1=vbuc1_minus_vbuz2
//SEG16 [6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2 -- vbuz1=vbuc1_minus_vbuz2
lda #$c8
sec
sbc b
@ -401,7 +489,7 @@ main: {
sta SCREEN2,y
//SEG20 [10] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuz1=_inc_vbuz1
inc b
//SEG21 [11] if((byte) main::b#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG21 [11] if((byte) main::b#1!=(byte) $65) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$65
cmp b
bne b1_from_b1
@ -429,7 +517,7 @@ w: {
.label i = 3
//SEG29 [16] phi from w to w::@1 [phi:w->w::@1]
b1_from_w:
//SEG30 [16] phi (byte) w::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:w->w::@1#0] -- vbuz1=vbuc1
//SEG30 [16] phi (byte) w::i#2 = (byte) 0 [phi:w->w::@1#0] -- vbuz1=vbuc1
lda #0
sta i
jmp b1
@ -439,7 +527,7 @@ w: {
jmp b1
//SEG33 w::@1
b1:
//SEG34 [17] (byte) w::b2#0 ← (word/signed word/dword/signed dword) $578-(word/signed word/dword/signed dword) $546 + (byte) w::i#2 -- vbuz1=vbuc1_plus_vbuz2
//SEG34 [17] (byte) w::b2#0 ← (byte)(number) $578-(number) $546 + (byte) w::i#2 -- vbuz1=vbuc1_plus_vbuz2
lax i
axs #-[$578-$546]
stx b2
@ -453,7 +541,7 @@ w: {
sta SCREEN4,y
//SEG37 [20] (byte) w::i#1 ← ++ (byte) w::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG38 [21] if((byte) w::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $b) goto w::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG38 [21] if((byte) w::i#1!=(byte) $b) goto w::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$b
cmp i
bne b1_from_b1
@ -465,16 +553,16 @@ w: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte) main::b2#0 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2 [ main::b#2 main::b2#0 ] ( main:2 [ main::b#2 main::b2#0 ] ) always clobbers reg byte a
Statement [6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2 [ main::b#2 main::b2#0 ] ( main:2 [ main::b#2 main::b2#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::b#2 main::b#1 ]
Statement [8] (signed byte) main::sb#0 ← - (signed byte)(byte) main::b#2 [ main::b#2 main::sb#0 ] ( main:2 [ main::b#2 main::sb#0 ] ) always clobbers reg byte a
Statement [18] *((const byte*) SCREEN3#0 + (byte) w::i#2) ← (const byte) w::b#0 [ w::i#2 w::b2#0 ] ( main:2::w:13 [ w::i#2 w::b2#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ w::i#2 w::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ w::b2#0 ]
Statement [19] *((const byte*) SCREEN4#0 + (byte) w::i#2) ← (byte) w::b2#0 [ w::i#2 ] ( main:2::w:13 [ w::i#2 ] ) always clobbers reg byte a
Statement [6] (byte) main::b2#0 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2 [ main::b#2 main::b2#0 ] ( main:2 [ main::b#2 main::b2#0 ] ) always clobbers reg byte a
Statement [6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2 [ main::b#2 main::b2#0 ] ( main:2 [ main::b#2 main::b2#0 ] ) always clobbers reg byte a
Statement [8] (signed byte) main::sb#0 ← - (signed byte)(byte) main::b#2 [ main::b#2 main::sb#0 ] ( main:2 [ main::b#2 main::sb#0 ] ) always clobbers reg byte a
Statement [17] (byte) w::b2#0 ← (word/signed word/dword/signed dword) $578-(word/signed word/dword/signed dword) $546 + (byte) w::i#2 [ w::i#2 w::b2#0 ] ( main:2::w:13 [ w::i#2 w::b2#0 ] ) always clobbers reg byte a
Statement [17] (byte) w::b2#0 ← (byte)(number) $578-(number) $546 + (byte) w::i#2 [ w::i#2 w::b2#0 ] ( main:2::w:13 [ w::i#2 w::b2#0 ] ) always clobbers reg byte a
Statement [18] *((const byte*) SCREEN3#0 + (byte) w::i#2) ← (const byte) w::b#0 [ w::i#2 w::b2#0 ] ( main:2::w:13 [ w::i#2 w::b2#0 ] ) always clobbers reg byte a
Statement [19] *((const byte*) SCREEN4#0 + (byte) w::i#2) ← (byte) w::b2#0 [ w::i#2 ] ( main:2::w:13 [ w::i#2 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::b#2 main::b#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
@ -523,7 +611,7 @@ bend:
main: {
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::b#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::b#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
@ -532,7 +620,7 @@ main: {
jmp b1
//SEG15 main::@1
b1:
//SEG16 [6] (byte) main::b2#0 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2 -- vbuaa=vbuc1_minus_vbuxx
//SEG16 [6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2 -- vbuaa=vbuc1_minus_vbuxx
txa
eor #$ff
clc
@ -548,7 +636,7 @@ main: {
sta SCREEN2,x
//SEG20 [10] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuxx=_inc_vbuxx
inx
//SEG21 [11] if((byte) main::b#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG21 [11] if((byte) main::b#1!=(byte) $65) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #$65
bne b1_from_b1
//SEG22 [12] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
@ -573,7 +661,7 @@ w: {
.const b = w1-w2
//SEG29 [16] phi from w to w::@1 [phi:w->w::@1]
b1_from_w:
//SEG30 [16] phi (byte) w::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:w->w::@1#0] -- vbuyy=vbuc1
//SEG30 [16] phi (byte) w::i#2 = (byte) 0 [phi:w->w::@1#0] -- vbuyy=vbuc1
ldy #0
jmp b1
//SEG31 [16] phi from w::@1 to w::@1 [phi:w::@1->w::@1]
@ -582,7 +670,7 @@ w: {
jmp b1
//SEG33 w::@1
b1:
//SEG34 [17] (byte) w::b2#0 ← (word/signed word/dword/signed dword) $578-(word/signed word/dword/signed dword) $546 + (byte) w::i#2 -- vbuxx=vbuc1_plus_vbuyy
//SEG34 [17] (byte) w::b2#0 ← (byte)(number) $578-(number) $546 + (byte) w::i#2 -- vbuxx=vbuc1_plus_vbuyy
tya
tax
axs #-[$578-$546]
@ -594,7 +682,7 @@ w: {
sta SCREEN4,y
//SEG37 [20] (byte) w::i#1 ← ++ (byte) w::i#2 -- vbuyy=_inc_vbuyy
iny
//SEG38 [21] if((byte) w::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $b) goto w::@1 -- vbuyy_neq_vbuc1_then_la1
//SEG38 [21] if((byte) w::i#1!=(byte) $b) goto w::@1 -- vbuyy_neq_vbuc1_then_la1
cpy #$b
bne b1_from_b1
jmp breturn
@ -645,13 +733,13 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(byte*) SCREEN2
(const byte*) SCREEN2#0 SCREEN2 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 3
(const byte*) SCREEN2#0 SCREEN2 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 3
(byte*) SCREEN3
(const byte*) SCREEN3#0 SCREEN3 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 6
(const byte*) SCREEN3#0 SCREEN3 = (const byte*) SCREEN#0+(byte)(number) $28*(number) 6
(byte*) SCREEN4
(const byte*) SCREEN4#0 SCREEN4 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 9
(const byte*) SCREEN4#0 SCREEN4 = (const byte*) SCREEN#0+(word)(number) $28*(number) 9
(void()) main()
(label) main::@1
(label) main::@2
@ -667,16 +755,16 @@ FINAL SYMBOL TABLE
(label) w::@1
(label) w::@return
(byte) w::b
(const byte) w::b#0 b = ((byte))(const word) w::w1#0-(const word) w::w2#0
(const byte) w::b#0 b = (byte)(const word) w::w1#0-(const word) w::w2#0
(byte) w::b2
(byte) w::b2#0 reg byte x 11.0
(byte) w::i
(byte) w::i#1 reg byte y 16.5
(byte) w::i#2 reg byte y 13.75
(word) w::w1
(const word) w::w1#0 w1 = (word/signed word/dword/signed dword) $514
(const word) w::w1#0 w1 = (word) $514
(word) w::w2
(const word) w::w2#0 w2 = (word/signed word/dword/signed dword) $4e2
(const word) w::w2#0 w2 = (word) $4e2
reg byte x [ main::b#2 main::b#1 ]
reg byte y [ w::i#2 w::i#1 ]
@ -708,13 +796,13 @@ Score: 648
//SEG10 main
main: {
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::b#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
//SEG12 [5] phi (byte) main::b#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG14 [5] phi (byte) main::b#2 = (byte) main::b#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG15 main::@1
b1:
//SEG16 [6] (byte) main::b2#0 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2 -- vbuaa=vbuc1_minus_vbuxx
//SEG16 [6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2 -- vbuaa=vbuc1_minus_vbuxx
txa
eor #$ff
clc
@ -730,7 +818,7 @@ main: {
sta SCREEN2,x
//SEG20 [10] (byte) main::b#1 ← ++ (byte) main::b#2 -- vbuxx=_inc_vbuxx
inx
//SEG21 [11] if((byte) main::b#1!=(byte/signed byte/word/signed word/dword/signed dword) $65) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
//SEG21 [11] if((byte) main::b#1!=(byte) $65) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #$65
bne b1
//SEG22 [12] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
@ -748,13 +836,13 @@ w: {
.const w2 = $4e2
.const b = w1-w2
//SEG29 [16] phi from w to w::@1 [phi:w->w::@1]
//SEG30 [16] phi (byte) w::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:w->w::@1#0] -- vbuyy=vbuc1
//SEG30 [16] phi (byte) w::i#2 = (byte) 0 [phi:w->w::@1#0] -- vbuyy=vbuc1
ldy #0
//SEG31 [16] phi from w::@1 to w::@1 [phi:w::@1->w::@1]
//SEG32 [16] phi (byte) w::i#2 = (byte) w::i#1 [phi:w::@1->w::@1#0] -- register_copy
//SEG33 w::@1
b1:
//SEG34 [17] (byte) w::b2#0 ← (word/signed word/dword/signed dword) $578-(word/signed word/dword/signed dword) $546 + (byte) w::i#2 -- vbuxx=vbuc1_plus_vbuyy
//SEG34 [17] (byte) w::b2#0 ← (byte)(number) $578-(number) $546 + (byte) w::i#2 -- vbuxx=vbuc1_plus_vbuyy
tya
tax
axs #-[$578-$546]
@ -766,7 +854,7 @@ w: {
sta SCREEN4,y
//SEG37 [20] (byte) w::i#1 ← ++ (byte) w::i#2 -- vbuyy=_inc_vbuyy
iny
//SEG38 [21] if((byte) w::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $b) goto w::@1 -- vbuyy_neq_vbuc1_then_la1
//SEG38 [21] if((byte) w::i#1!=(byte) $b) goto w::@1 -- vbuyy_neq_vbuc1_then_la1
cpy #$b
bne b1
//SEG39 w::@return

@ -1,42 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte*) SCREEN2
(const byte*) SCREEN2#0 SCREEN2 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 3
(byte*) SCREEN3
(const byte*) SCREEN3#0 SCREEN3 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 6
(byte*) SCREEN4
(const byte*) SCREEN4#0 SCREEN4 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 9
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::b
(byte) main::b#1 reg byte x 16.5
(byte) main::b#2 reg byte x 11.0
(byte) main::b2
(byte) main::b2#0 reg byte a 22.0
(signed byte) main::sb
(signed byte) main::sb#0 reg byte a 11.0
(void()) w()
(label) w::@1
(label) w::@return
(byte) w::b
(const byte) w::b#0 b = ((byte))(const word) w::w1#0-(const word) w::w2#0
(byte) w::b2
(byte) w::b2#0 reg byte x 11.0
(byte) w::i
(byte) w::i#1 reg byte y 16.5
(byte) w::i#2 reg byte y 13.75
(word) w::w1
(const word) w::w1#0 w1 = (word/signed word/dword/signed dword) $514
(word) w::w2
(const word) w::w2#0 w2 = (word/signed word/dword/signed dword) $4e2
reg byte x [ main::b#2 main::b#1 ]
reg byte y [ w::i#2 w::i#1 ]
reg byte a [ main::b2#0 ]
reg byte a [ main::sb#0 ]
reg byte x [ w::b2#0 ]
program

@ -9,19 +9,19 @@
[3] phi()
main: scope:[main] from @1
asm { sei }
[5] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32
[5] *((const byte*) PROCPORT#0) ← (byte) $32
to:main::@1
main::@1: scope:[main] from main main::@5
[6] (byte*) main::sc#7 ← phi( main/(const byte*) SCREEN#0 main::@5/(byte*) main::sc#2 )
[6] (byte) main::y#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@5/(byte) main::y#1 )
[6] (byte) main::y#2 ← phi( main/(byte) 0 main::@5/(byte) main::y#1 )
[7] (byte) main::bits#0 ← *((const byte*) main::CHAR_A#0 + (byte) main::y#2)
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[8] (byte) main::x#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::x#1 )
[8] (byte) main::x#2 ← phi( main::@1/(byte) 0 main::@3/(byte) main::x#1 )
[8] (byte*) main::sc#3 ← phi( main::@1/(byte*) main::sc#7 main::@3/(byte*) main::sc#1 )
[8] (byte) main::bits#2 ← phi( main::@1/(byte) main::bits#0 main::@3/(byte) main::bits#1 )
[9] (byte~) main::$1 ← (byte) main::bits#2 & (byte/word/signed word/dword/signed dword) $80
[10] if((byte~) main::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3
[9] (byte~) main::$1 ← (byte) main::bits#2 & (byte) $80
[10] if((byte~) main::$1==(byte) 0) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@2
[11] phi()
@ -30,17 +30,17 @@ main::@3: scope:[main] from main::@2 main::@4
[12] (byte) main::c#2 ← phi( main::@2/(byte) '.' main::@4/(byte) '*' )
[13] *((byte*) main::sc#3) ← (byte) main::c#2
[14] (byte*) main::sc#1 ← ++ (byte*) main::sc#3
[15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte) 1
[16] (byte) main::x#1 ← ++ (byte) main::x#2
[17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2
[17] if((byte) main::x#1!=(byte) 8) goto main::@2
to:main::@5
main::@5: scope:[main] from main::@3
[18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte/signed byte/word/signed word/dword/signed dword) $20
[18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20
[19] (byte) main::y#1 ← ++ (byte) main::y#2
[20] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1
[20] if((byte) main::y#1!=(byte) 8) goto main::@1
to:main::@6
main::@6: scope:[main] from main::@5
[21] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37
[21] *((const byte*) PROCPORT#0) ← (byte) $37
asm { cli }
to:main::@return
main::@return: scope:[main] from main::@6

@ -1,27 +1,30 @@
Adding pointer type conversion cast (byte*) PROCPORT in (byte*) PROCPORT ← (number) 1
Adding pointer type conversion cast (byte*) CHARGEN in (byte*) CHARGEN ← (number) $d000
Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400
Identified constant variable (byte*) PROCPORT
Identified constant variable (byte*) CHARGEN
Identified constant variable (byte*) SCREEN
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) PROCPORT#0 ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) CHARGEN#0 ← ((byte*)) (word/dword/signed dword) $d000
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte*) PROCPORT#0 ← ((byte*)) (number) 1
(byte*) CHARGEN#0 ← ((byte*)) (number) $d000
(byte*) SCREEN#0 ← ((byte*)) (number) $400
to:@1
main: scope:[main] from @1
asm { sei }
(byte*~) main::$0 ← (byte*) CHARGEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 8
(byte*~) main::$0 ← (byte*) CHARGEN#0 + (number) 8
(byte*) main::CHAR_A#0 ← (byte*~) main::$0
*((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32
*((byte*) PROCPORT#0) ← (number) $32
(byte*) main::sc#0 ← (byte*) SCREEN#0
(byte) main::y#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::y#0 ← (number) 0
to:main::@1
main::@1: scope:[main] from main main::@5
(byte*) main::sc#7 ← phi( main/(byte*) main::sc#0 main::@5/(byte*) main::sc#2 )
(byte) main::y#2 ← phi( main/(byte) main::y#0 main::@5/(byte) main::y#1 )
(byte*) main::CHAR_A#1 ← phi( main/(byte*) main::CHAR_A#0 main::@5/(byte*) main::CHAR_A#2 )
(byte) main::bits#0 ← *((byte*) main::CHAR_A#1 + (byte) main::y#2)
(byte) main::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::x#0 ← (number) 0
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
(byte*) main::CHAR_A#4 ← phi( main::@1/(byte*) main::CHAR_A#1 main::@3/(byte*) main::CHAR_A#3 )
@ -30,8 +33,8 @@ main::@2: scope:[main] from main::@1 main::@3
(byte*) main::sc#5 ← phi( main::@1/(byte*) main::sc#7 main::@3/(byte*) main::sc#1 )
(byte) main::bits#2 ← phi( main::@1/(byte) main::bits#0 main::@3/(byte) main::bits#1 )
(byte) main::c#0 ← (byte) '.'
(byte~) main::$1 ← (byte) main::bits#2 & (byte/word/signed word/dword/signed dword) $80
(bool~) main::$2 ← (byte~) main::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0
(number~) main::$1 ← (byte) main::bits#2 & (number) $80
(bool~) main::$2 ← (number~) main::$1 != (number) 0
(bool~) main::$3 ← ! (bool~) main::$2
if((bool~) main::$3) goto main::@3
to:main::@4
@ -44,8 +47,8 @@ main::@3: scope:[main] from main::@2 main::@4
(byte) main::c#2 ← phi( main::@2/(byte) main::c#0 main::@4/(byte) main::c#1 )
*((byte*) main::sc#3) ← (byte) main::c#2
(byte*) main::sc#1 ← ++ (byte*) main::sc#3
(byte/signed word/word/dword/signed dword~) main::$4 ← (byte) main::bits#3 * (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) main::bits#1 ← (byte/signed word/word/dword/signed dword~) main::$4
(number~) main::$4 ← (byte) main::bits#3 * (number) 2
(byte) main::bits#1 ← (number~) main::$4
(byte) main::x#1 ← (byte) main::x#2 + rangenext(0,7)
(bool~) main::$5 ← (byte) main::x#1 != rangelast(0,7)
if((bool~) main::$5) goto main::@2
@ -62,14 +65,14 @@ main::@5: scope:[main] from main::@3
(byte*) main::CHAR_A#2 ← phi( main::@3/(byte*) main::CHAR_A#3 )
(byte) main::y#3 ← phi( main::@3/(byte) main::y#4 )
(byte*) main::sc#4 ← phi( main::@3/(byte*) main::sc#1 )
(byte*~) main::$6 ← (byte*) main::sc#4 + (byte/signed byte/word/signed word/dword/signed dword) $20
(byte*~) main::$6 ← (byte*) main::sc#4 + (number) $20
(byte*) main::sc#2 ← (byte*~) main::$6
(byte) main::y#1 ← (byte) main::y#3 + rangenext(0,7)
(bool~) main::$7 ← (byte) main::y#1 != rangelast(0,7)
if((bool~) main::$7) goto main::@1
to:main::@6
main::@6: scope:[main] from main::@5
*((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37
*((byte*) PROCPORT#0) ← (number) $37
asm { cli }
to:main::@return
main::@return: scope:[main] from main::@6
@ -95,10 +98,10 @@ SYMBOL TABLE SSA
(byte*) SCREEN#0
(void()) main()
(byte*~) main::$0
(byte~) main::$1
(number~) main::$1
(bool~) main::$2
(bool~) main::$3
(byte/signed word/word/dword/signed dword~) main::$4
(number~) main::$4
(bool~) main::$5
(byte*~) main::$6
(bool~) main::$7
@ -150,12 +153,55 @@ SYMBOL TABLE SSA
(byte) main::y#5
(byte) main::y#6
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not [16] (bool~) main::$3 ← (byte~) main::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [15] (bool~) main::$2 ← (byte~) main::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0
Adding number conversion cast (unumber) 8 in (byte*~) main::$0 ← (byte*) CHARGEN#0 + (number) 8
Adding number conversion cast (unumber) $32 in *((byte*) PROCPORT#0) ← (number) $32
Adding number conversion cast (unumber) 0 in (byte) main::y#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) main::x#0 ← (number) 0
Adding number conversion cast (unumber) $80 in (number~) main::$1 ← (byte) main::bits#2 & (number) $80
Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (byte) main::bits#2 & (unumber)(number) $80
Adding number conversion cast (unumber) 0 in (bool~) main::$2 ← (unumber~) main::$1 != (number) 0
Adding number conversion cast (unumber) 2 in (number~) main::$4 ← (byte) main::bits#3 * (number) 2
Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (byte) main::bits#3 * (unumber)(number) 2
Adding number conversion cast (unumber) $20 in (byte*~) main::$6 ← (byte*) main::sc#4 + (number) $20
Adding number conversion cast (unumber) $37 in *((byte*) PROCPORT#0) ← (number) $37
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) PROCPORT#0 ← (byte*)(number) 1
Inlining cast (byte*) CHARGEN#0 ← (byte*)(number) $d000
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast *((byte*) PROCPORT#0) ← (unumber)(number) $32
Inlining cast (byte) main::y#0 ← (unumber)(number) 0
Inlining cast (byte) main::x#0 ← (unumber)(number) 0
Inlining cast *((byte*) PROCPORT#0) ← (unumber)(number) $37
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 8
Simplifying constant integer cast $32
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $80
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast $20
Simplifying constant integer cast $37
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) $32
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $80
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $20
Finalized unsigned number type (byte) $37
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$1 ← (byte) main::bits#2 & (byte) $80
Inferred type updated to byte in (unumber~) main::$4 ← (byte) main::bits#3 * (byte) 2
Inversing boolean not [16] (bool~) main::$3 ← (byte~) main::$1 == (byte) 0 from [15] (bool~) main::$2 ← (byte~) main::$1 != (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) main::CHAR_A#0 = (byte*~) main::$0
Alias (byte) main::bits#1 = (byte/signed word/word/dword/signed dword~) main::$4
Alias (byte) main::bits#1 = (byte~) main::$4
Alias (byte*) main::sc#5 = (byte*) main::sc#6
Alias (byte) main::bits#2 = (byte) main::bits#4
Alias (byte) main::x#3 = (byte) main::x#4
@ -175,34 +221,46 @@ Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) main::y#3
Self Phi Eliminated (byte*) main::CHAR_A#2
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte) main::y#3 (byte) main::y#2
Redundant Phi (byte*) main::CHAR_A#2 (byte*) main::CHAR_A#1
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) main::$3 [17] if((byte~) main::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3
Identical Phi Values (byte) main::y#3 (byte) main::y#2
Identical Phi Values (byte*) main::CHAR_A#2 (byte*) main::CHAR_A#1
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$3 [17] if((byte~) main::$1==(byte) 0) goto main::@3
Simple Condition (bool~) main::$5 [25] if((byte) main::x#1!=rangelast(0,7)) goto main::@2
Simple Condition (bool~) main::$7 [33] if((byte) main::y#1!=rangelast(0,7)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) PROCPORT#0 = ((byte*))1
Constant (const byte*) CHARGEN#0 = ((byte*))$d000
Constant (const byte*) SCREEN#0 = ((byte*))$400
Constant (const byte*) PROCPORT#0 = (byte*) 1
Constant (const byte*) CHARGEN#0 = (byte*) 53248
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const byte) main::y#0 = 0
Constant (const byte) main::x#0 = 0
Constant (const byte) main::c#0 = '.'
Constant (const byte) main::c#1 = '*'
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) main::CHAR_A#0 = CHARGEN#0+8
Constant (const byte*) main::sc#0 = SCREEN#0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value main::x#1 ← ++ main::x#2 to ++
Resolved ranged comparison value if(main::x#1!=rangelast(0,7)) goto main::@2 to (byte/signed byte/word/signed word/dword/signed dword) 8
Resolved ranged next value main::y#1 ← ++ main::y#2 to ++
Resolved ranged comparison value if(main::y#1!=rangelast(0,7)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 8
Rewriting multiplication to use shift (byte) main::bits#1 ← (byte) main::bits#2 * (byte/signed byte/word/signed word/dword/signed dword) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Resolved ranged next value [23] main::x#1 ← ++ main::x#2 to ++
Resolved ranged comparison value [25] if(main::x#1!=rangelast(0,7)) goto main::@2 to (number) 8
Resolved ranged next value [31] main::y#1 ← ++ main::y#2 to ++
Resolved ranged comparison value [33] if(main::y#1!=rangelast(0,7)) goto main::@1 to (number) 8
Adding number conversion cast (unumber) 8 in if((byte) main::x#1!=(number) 8) goto main::@2
Adding number conversion cast (unumber) 8 in if((byte) main::y#1!=(number) 8) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 8
Simplifying constant integer cast 8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Self Phi Eliminated (byte*) main::CHAR_A#1
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) main::CHAR_A#1 (const byte*) main::CHAR_A#0
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte*) main::CHAR_A#1 (byte*) main::CHAR_A#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [1] (byte*) main::CHAR_A#0 ← (const byte*) CHARGEN#0 + (byte) 8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::CHAR_A#0 = CHARGEN#0+8
Successful SSA optimization Pass2ConstantIdentification
Rewriting multiplication to use shift [10] (byte) main::bits#1 ← (byte) main::bits#2 * (byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) main::y#0
Inlining constant with var siblings (const byte) main::x#0
Inlining constant with var siblings (const byte) main::c#0
@ -210,28 +268,30 @@ Inlining constant with var siblings (const byte) main::c#1
Inlining constant with var siblings (const byte*) main::sc#0
Constant inlined main::sc#0 = (const byte*) SCREEN#0
Constant inlined main::c#0 = (byte) '.'
Constant inlined main::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::y#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::x#0 = (byte) 0
Constant inlined main::y#0 = (byte) 0
Constant inlined main::c#1 = (byte) '*'
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@7(between main::@5 and main::@1)
Added new block during phi lifting main::@8(between main::@3 and main::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@4
CALL GRAPH
Calls in [] to main:2
Created 6 initial phi equivalence classes
Coalesced [8] main::bits#5 ← main::bits#0
Coalesced [9] main::sc#9 ← main::sc#7
Coalesced [26] main::y#7 ← main::y#1
Coalesced [27] main::sc#8 ← main::sc#2
Coalesced [28] main::bits#6 ← main::bits#1
Coalesced [29] main::sc#10 ← main::sc#1
Coalesced [30] main::x#5 ← main::x#1
Coalesced [9] main::bits#5 ← main::bits#0
Coalesced [10] main::sc#9 ← main::sc#7
Coalesced [27] main::y#7 ← main::y#1
Coalesced [28] main::sc#8 ← main::sc#2
Coalesced [29] main::bits#6 ← main::bits#1
Coalesced [30] main::sc#10 ← main::sc#1
Coalesced [31] main::x#5 ← main::x#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::@8
Adding NOP phi() at start of @begin
@ -251,19 +311,19 @@ FINAL CONTROL FLOW GRAPH
[3] phi()
main: scope:[main] from @1
asm { sei }
[5] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32
[5] *((const byte*) PROCPORT#0) ← (byte) $32
to:main::@1
main::@1: scope:[main] from main main::@5
[6] (byte*) main::sc#7 ← phi( main/(const byte*) SCREEN#0 main::@5/(byte*) main::sc#2 )
[6] (byte) main::y#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@5/(byte) main::y#1 )
[6] (byte) main::y#2 ← phi( main/(byte) 0 main::@5/(byte) main::y#1 )
[7] (byte) main::bits#0 ← *((const byte*) main::CHAR_A#0 + (byte) main::y#2)
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[8] (byte) main::x#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::x#1 )
[8] (byte) main::x#2 ← phi( main::@1/(byte) 0 main::@3/(byte) main::x#1 )
[8] (byte*) main::sc#3 ← phi( main::@1/(byte*) main::sc#7 main::@3/(byte*) main::sc#1 )
[8] (byte) main::bits#2 ← phi( main::@1/(byte) main::bits#0 main::@3/(byte) main::bits#1 )
[9] (byte~) main::$1 ← (byte) main::bits#2 & (byte/word/signed word/dword/signed dword) $80
[10] if((byte~) main::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3
[9] (byte~) main::$1 ← (byte) main::bits#2 & (byte) $80
[10] if((byte~) main::$1==(byte) 0) goto main::@3
to:main::@4
main::@4: scope:[main] from main::@2
[11] phi()
@ -272,17 +332,17 @@ main::@3: scope:[main] from main::@2 main::@4
[12] (byte) main::c#2 ← phi( main::@2/(byte) '.' main::@4/(byte) '*' )
[13] *((byte*) main::sc#3) ← (byte) main::c#2
[14] (byte*) main::sc#1 ← ++ (byte*) main::sc#3
[15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte) 1
[16] (byte) main::x#1 ← ++ (byte) main::x#2
[17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2
[17] if((byte) main::x#1!=(byte) 8) goto main::@2
to:main::@5
main::@5: scope:[main] from main::@3
[18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte/signed byte/word/signed word/dword/signed dword) $20
[18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20
[19] (byte) main::y#1 ← ++ (byte) main::y#2
[20] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1
[20] if((byte) main::y#1!=(byte) 8) goto main::@1
to:main::@6
main::@6: scope:[main] from main::@5
[21] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37
[21] *((const byte*) PROCPORT#0) ← (byte) $37
asm { cli }
to:main::@return
main::@return: scope:[main] from main::@6
@ -371,7 +431,7 @@ main: {
.label c = 7
//SEG10 asm { sei }
sei
//SEG11 [5] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2
lda #$32
sta PROCPORT
//SEG12 [6] phi from main to main::@1 [phi:main->main::@1]
@ -381,7 +441,7 @@ main: {
sta sc
lda #>SCREEN
sta sc+1
//SEG14 [6] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
//SEG14 [6] phi (byte) main::y#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
lda #0
sta y
jmp b1
@ -398,7 +458,7 @@ main: {
sta bits
//SEG20 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
//SEG21 [8] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1
//SEG21 [8] phi (byte) main::x#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1
lda #0
sta x
//SEG22 [8] phi (byte*) main::sc#3 = (byte*) main::sc#7 [phi:main::@1->main::@2#1] -- register_copy
@ -412,11 +472,11 @@ main: {
jmp b2
//SEG28 main::@2
b2:
//SEG29 [9] (byte~) main::$1 ← (byte) main::bits#2 & (byte/word/signed word/dword/signed dword) $80 -- vbuz1=vbuz2_band_vbuc1
//SEG29 [9] (byte~) main::$1 ← (byte) main::bits#2 & (byte) $80 -- vbuz1=vbuz2_band_vbuc1
lda #$80
and bits
sta _1
//SEG30 [10] if((byte~) main::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuz1_eq_0_then_la1
//SEG30 [10] if((byte~) main::$1==(byte) 0) goto main::@3 -- vbuz1_eq_0_then_la1
lda _1
cmp #0
beq b3_from_b2
@ -448,18 +508,18 @@ main: {
bne !+
inc sc+1
!:
//SEG40 [15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1
//SEG40 [15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte) 1 -- vbuz1=vbuz1_rol_1
asl bits
//SEG41 [16] (byte) main::x#1 ← ++ (byte) main::x#2 -- vbuz1=_inc_vbuz1
inc x
//SEG42 [17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 -- vbuz1_neq_vbuc1_then_la1
//SEG42 [17] if((byte) main::x#1!=(byte) 8) goto main::@2 -- vbuz1_neq_vbuc1_then_la1
lda #8
cmp x
bne b2_from_b3
jmp b5
//SEG43 main::@5
b5:
//SEG44 [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte/signed byte/word/signed word/dword/signed dword) $20 -- pbuz1=pbuz1_plus_vbuc1
//SEG44 [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20 -- pbuz1=pbuz1_plus_vbuc1
lda #$20
clc
adc sc
@ -469,14 +529,14 @@ main: {
!:
//SEG45 [19] (byte) main::y#1 ← ++ (byte) main::y#2 -- vbuz1=_inc_vbuz1
inc y
//SEG46 [20] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG46 [20] if((byte) main::y#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #8
cmp y
bne b1_from_b5
jmp b6
//SEG47 main::@6
b6:
//SEG48 [21] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37 -- _deref_pbuc1=vbuc2
//SEG48 [21] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2
lda #$37
sta PROCPORT
//SEG49 asm { cli }
@ -489,18 +549,18 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) PROCPORT#0) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [13] *((byte*) main::sc#3) ← (byte) main::c#2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ( main:2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ main::y#2 main::y#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ main::bits#2 main::bits#0 main::bits#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ main::x#2 main::x#1 ]
Statement [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte/signed byte/word/signed word/dword/signed dword) $20 [ main::y#2 main::sc#2 ] ( main:2 [ main::y#2 main::sc#2 ] ) always clobbers reg byte a
Statement [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20 [ main::y#2 main::sc#2 ] ( main:2 [ main::y#2 main::sc#2 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::y#2 main::y#1 ]
Statement [21] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [21] *((const byte*) PROCPORT#0) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *((const byte*) PROCPORT#0) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [13] *((byte*) main::sc#3) ← (byte) main::c#2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ( main:2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ) always clobbers reg byte y
Statement [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte/signed byte/word/signed word/dword/signed dword) $20 [ main::y#2 main::sc#2 ] ( main:2 [ main::y#2 main::sc#2 ] ) always clobbers reg byte a
Statement [21] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20 [ main::y#2 main::sc#2 ] ( main:2 [ main::y#2 main::sc#2 ] ) always clobbers reg byte a
Statement [21] *((const byte*) PROCPORT#0) ← (byte) $37 [ ] ( main:2 [ ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::y#2 main::y#1 ] : zp ZP_BYTE:2 , reg byte x ,
Potential registers zp ZP_BYTE:3 [ main::bits#2 main::bits#0 main::bits#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x ,
Potential registers zp ZP_WORD:4 [ main::sc#3 main::sc#7 main::sc#2 main::sc#1 ] : zp ZP_WORD:4 ,
@ -552,7 +612,7 @@ main: {
.label y = 2
//SEG10 asm { sei }
sei
//SEG11 [5] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2
lda #$32
sta PROCPORT
//SEG12 [6] phi from main to main::@1 [phi:main->main::@1]
@ -562,7 +622,7 @@ main: {
sta sc
lda #>SCREEN
sta sc+1
//SEG14 [6] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
//SEG14 [6] phi (byte) main::y#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
lda #0
sta y
jmp b1
@ -579,7 +639,7 @@ main: {
sta bits
//SEG20 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
//SEG21 [8] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1
//SEG21 [8] phi (byte) main::x#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG22 [8] phi (byte*) main::sc#3 = (byte*) main::sc#7 [phi:main::@1->main::@2#1] -- register_copy
//SEG23 [8] phi (byte) main::bits#2 = (byte) main::bits#0 [phi:main::@1->main::@2#2] -- register_copy
@ -592,10 +652,10 @@ main: {
jmp b2
//SEG28 main::@2
b2:
//SEG29 [9] (byte~) main::$1 ← (byte) main::bits#2 & (byte/word/signed word/dword/signed dword) $80 -- vbuaa=vbuz1_band_vbuc1
//SEG29 [9] (byte~) main::$1 ← (byte) main::bits#2 & (byte) $80 -- vbuaa=vbuz1_band_vbuc1
lda #$80
and bits
//SEG30 [10] if((byte~) main::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuaa_eq_0_then_la1
//SEG30 [10] if((byte~) main::$1==(byte) 0) goto main::@3 -- vbuaa_eq_0_then_la1
cmp #0
beq b3_from_b2
//SEG31 [11] phi from main::@2 to main::@4 [phi:main::@2->main::@4]
@ -623,17 +683,17 @@ main: {
bne !+
inc sc+1
!:
//SEG40 [15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1
//SEG40 [15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte) 1 -- vbuz1=vbuz1_rol_1
asl bits
//SEG41 [16] (byte) main::x#1 ← ++ (byte) main::x#2 -- vbuxx=_inc_vbuxx
inx
//SEG42 [17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 -- vbuxx_neq_vbuc1_then_la1
//SEG42 [17] if((byte) main::x#1!=(byte) 8) goto main::@2 -- vbuxx_neq_vbuc1_then_la1
cpx #8
bne b2_from_b3
jmp b5
//SEG43 main::@5
b5:
//SEG44 [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte/signed byte/word/signed word/dword/signed dword) $20 -- pbuz1=pbuz1_plus_vbuc1
//SEG44 [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20 -- pbuz1=pbuz1_plus_vbuc1
lda #$20
clc
adc sc
@ -643,14 +703,14 @@ main: {
!:
//SEG45 [19] (byte) main::y#1 ← ++ (byte) main::y#2 -- vbuz1=_inc_vbuz1
inc y
//SEG46 [20] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG46 [20] if((byte) main::y#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #8
cmp y
bne b1_from_b5
jmp b6
//SEG47 main::@6
b6:
//SEG48 [21] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37 -- _deref_pbuc1=vbuc2
//SEG48 [21] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2
lda #$37
sta PROCPORT
//SEG49 asm { cli }
@ -707,11 +767,11 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte*) CHARGEN
(const byte*) CHARGEN#0 CHARGEN = ((byte*))(word/dword/signed dword) $d000
(const byte*) CHARGEN#0 CHARGEN = (byte*) 53248
(byte*) PROCPORT
(const byte*) PROCPORT#0 PROCPORT = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 1
(const byte*) PROCPORT#0 PROCPORT = (byte*) 1
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(void()) main()
(byte~) main::$1 reg byte a 202.0
(label) main::@1
@ -722,7 +782,7 @@ FINAL SYMBOL TABLE
(label) main::@6
(label) main::@return
(byte*) main::CHAR_A
(const byte*) main::CHAR_A#0 CHAR_A = (const byte*) CHARGEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8
(const byte*) main::CHAR_A#0 CHAR_A = (const byte*) CHARGEN#0+(byte) 8
(byte) main::bits
(byte) main::bits#0 bits zp ZP_BYTE:3 22.0
(byte) main::bits#1 bits zp ZP_BYTE:3 67.33333333333333
@ -775,7 +835,7 @@ main: {
.label y = 2
//SEG10 asm { sei }
sei
//SEG11 [5] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 -- _deref_pbuc1=vbuc2
//SEG11 [5] *((const byte*) PROCPORT#0) ← (byte) $32 -- _deref_pbuc1=vbuc2
lda #$32
sta PROCPORT
//SEG12 [6] phi from main to main::@1 [phi:main->main::@1]
@ -784,7 +844,7 @@ main: {
sta sc
lda #>SCREEN
sta sc+1
//SEG14 [6] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
//SEG14 [6] phi (byte) main::y#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
lda #0
sta y
//SEG15 [6] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
@ -797,7 +857,7 @@ main: {
lda CHAR_A,y
sta bits
//SEG20 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG21 [8] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1
//SEG21 [8] phi (byte) main::x#2 = (byte) 0 [phi:main::@1->main::@2#0] -- vbuxx=vbuc1
ldx #0
//SEG22 [8] phi (byte*) main::sc#3 = (byte*) main::sc#7 [phi:main::@1->main::@2#1] -- register_copy
//SEG23 [8] phi (byte) main::bits#2 = (byte) main::bits#0 [phi:main::@1->main::@2#2] -- register_copy
@ -807,10 +867,10 @@ main: {
//SEG27 [8] phi (byte) main::bits#2 = (byte) main::bits#1 [phi:main::@3->main::@2#2] -- register_copy
//SEG28 main::@2
b2:
//SEG29 [9] (byte~) main::$1 ← (byte) main::bits#2 & (byte/word/signed word/dword/signed dword) $80 -- vbuaa=vbuz1_band_vbuc1
//SEG29 [9] (byte~) main::$1 ← (byte) main::bits#2 & (byte) $80 -- vbuaa=vbuz1_band_vbuc1
lda #$80
and bits
//SEG30 [10] if((byte~) main::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -- vbuaa_eq_0_then_la1
//SEG30 [10] if((byte~) main::$1==(byte) 0) goto main::@3 -- vbuaa_eq_0_then_la1
cmp #0
beq b4
//SEG31 [11] phi from main::@2 to main::@4 [phi:main::@2->main::@4]
@ -833,15 +893,15 @@ main: {
bne !+
inc sc+1
!:
//SEG40 [15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1
//SEG40 [15] (byte) main::bits#1 ← (byte) main::bits#2 << (byte) 1 -- vbuz1=vbuz1_rol_1
asl bits
//SEG41 [16] (byte) main::x#1 ← ++ (byte) main::x#2 -- vbuxx=_inc_vbuxx
inx
//SEG42 [17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 -- vbuxx_neq_vbuc1_then_la1
//SEG42 [17] if((byte) main::x#1!=(byte) 8) goto main::@2 -- vbuxx_neq_vbuc1_then_la1
cpx #8
bne b2
//SEG43 main::@5
//SEG44 [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte/signed byte/word/signed word/dword/signed dword) $20 -- pbuz1=pbuz1_plus_vbuc1
//SEG44 [18] (byte*) main::sc#2 ← (byte*) main::sc#1 + (byte) $20 -- pbuz1=pbuz1_plus_vbuc1
lda #$20
clc
adc sc
@ -851,12 +911,12 @@ main: {
!:
//SEG45 [19] (byte) main::y#1 ← ++ (byte) main::y#2 -- vbuz1=_inc_vbuz1
inc y
//SEG46 [20] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG46 [20] if((byte) main::y#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #8
cmp y
bne b1
//SEG47 main::@6
//SEG48 [21] *((const byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37 -- _deref_pbuc1=vbuc2
//SEG48 [21] *((const byte*) PROCPORT#0) ← (byte) $37 -- _deref_pbuc1=vbuc2
lda #$37
sta PROCPORT
//SEG49 asm { cli }

@ -1,44 +1 @@
(label) @1
(label) @begin
(label) @end
(byte*) CHARGEN
(const byte*) CHARGEN#0 CHARGEN = ((byte*))(word/dword/signed dword) $d000
(byte*) PROCPORT
(const byte*) PROCPORT#0 PROCPORT = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(void()) main()
(byte~) main::$1 reg byte a 202.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
(byte*) main::CHAR_A
(const byte*) main::CHAR_A#0 CHAR_A = (const byte*) CHARGEN#0+(byte/signed byte/word/signed word/dword/signed dword) 8
(byte) main::bits
(byte) main::bits#0 bits zp ZP_BYTE:3 22.0
(byte) main::bits#1 bits zp ZP_BYTE:3 67.33333333333333
(byte) main::bits#2 bits zp ZP_BYTE:3 44.85714285714286
(byte) main::c
(byte) main::c#2 reg byte a 101.0
(byte*) main::sc
(byte*) main::sc#1 sc zp ZP_WORD:4 53.25
(byte*) main::sc#2 sc zp ZP_WORD:4 7.333333333333333
(byte*) main::sc#3 sc zp ZP_WORD:4 52.33333333333333
(byte*) main::sc#7 sc zp ZP_WORD:4 11.0
(byte) main::x
(byte) main::x#1 reg byte x 151.5
(byte) main::x#2 reg byte x 25.25
(byte) main::y
(byte) main::y#1 y zp ZP_BYTE:2 16.5
(byte) main::y#2 y zp ZP_BYTE:2 2.5384615384615383
zp ZP_BYTE:2 [ main::y#2 main::y#1 ]
zp ZP_BYTE:3 [ main::bits#2 main::bits#0 main::bits#1 ]
zp ZP_WORD:4 [ main::sc#3 main::sc#7 main::sc#2 main::sc#1 ]
reg byte x [ main::x#2 main::x#1 ]
reg byte a [ main::c#2 ]
reg byte a [ main::$1 ]
program

@ -11,26 +11,26 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte) main::row#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::row#1 )
[5] (byte*) main::colors#4 ← phi( main/((byte*))(word/dword/signed dword) $d800 main::@3/(byte*) main::colors#1 )
[5] (byte) main::color#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@3/(byte) main::color#2 )
[5] (byte*) main::screen#4 ← phi( main/((byte*))(word/signed word/dword/signed dword) $400 main::@3/(byte*) main::screen#1 )
[5] (byte) main::row#4 ← phi( main/(byte) 0 main::@3/(byte) main::row#1 )
[5] (byte*) main::colors#4 ← phi( main/(byte*) 55296 main::@3/(byte*) main::colors#1 )
[5] (byte) main::color#5 ← phi( main/(byte) 1 main::@3/(byte) main::color#2 )
[5] (byte*) main::screen#4 ← phi( main/(byte*) 1024 main::@3/(byte*) main::screen#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[6] (byte) main::color#3 ← phi( main::@1/(byte) main::color#5 main::@2/(byte) main::color#1 )
[6] (byte) main::column#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::column#1 )
[7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte/word/signed word/dword/signed dword) $a0
[6] (byte) main::column#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::column#1 )
[7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte) $a0
[8] *((byte*) main::colors#4 + (byte) main::column#2) ← (byte) main::color#3
[9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1
[9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte) 1
[10] (byte) main::column#1 ← ++ (byte) main::column#2
[11] if((byte) main::column#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2
[11] if((byte) main::column#1!=(byte) 8) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte/signed byte/word/signed word/dword/signed dword) 1
[13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
[14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
[12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte) 1
[13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte) $28
[14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte) $28
[15] (byte) main::row#1 ← ++ (byte) main::row#4
[16] if((byte) main::row#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1
[16] if((byte) main::row#1!=(byte) 8) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
[17] return

@ -1,19 +1,22 @@
Adding pointer type conversion cast (byte*) main::screen in (byte*) main::screen ← (number) $400
Adding pointer type conversion cast (byte*) main::colors in (byte*) main::colors ← (number) $d800
Culled Empty Block (label) main::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @1
(byte*) main::screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte*) main::colors#0 ← ((byte*)) (word/dword/signed dword) $d800
(byte) main::color#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::colors#0 ← ((byte*)) (number) $d800
(byte) main::color#0 ← (number) 1
(byte) main::row#0 ← (number) 0
to:main::@1
main::@1: scope:[main] from main main::@3
(byte) main::row#4 ← phi( main/(byte) main::row#0 main::@3/(byte) main::row#1 )
(byte*) main::colors#4 ← phi( main/(byte*) main::colors#0 main::@3/(byte*) main::colors#1 )
(byte) main::color#5 ← phi( main/(byte) main::color#0 main::@3/(byte) main::color#2 )
(byte*) main::screen#4 ← phi( main/(byte*) main::screen#0 main::@3/(byte*) main::screen#1 )
(byte) main::column#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::column#0 ← (number) 0
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
(byte) main::row#3 ← phi( main::@1/(byte) main::row#4 main::@2/(byte) main::row#3 )
@ -21,10 +24,10 @@ main::@2: scope:[main] from main::@1 main::@2
(byte) main::color#3 ← phi( main::@1/(byte) main::color#5 main::@2/(byte) main::color#1 )
(byte) main::column#2 ← phi( main::@1/(byte) main::column#0 main::@2/(byte) main::column#1 )
(byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#4 main::@2/(byte*) main::screen#2 )
*((byte*) main::screen#2 + (byte) main::column#2) ← (byte/word/signed word/dword/signed dword) $a0
*((byte*) main::screen#2 + (byte) main::column#2) ← (number) $a0
*((byte*) main::colors#2 + (byte) main::column#2) ← (byte) main::color#3
(byte/word/dword~) main::$0 ← (byte) main::color#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::color#1 ← (byte/word/dword~) main::$0
(number~) main::$0 ← (byte) main::color#3 ^ (number) 1
(byte) main::color#1 ← (number~) main::$0
(byte) main::column#1 ← (byte) main::column#2 + rangenext(0,7)
(bool~) main::$1 ← (byte) main::column#1 != rangelast(0,7)
if((bool~) main::$1) goto main::@2
@ -34,11 +37,11 @@ main::@3: scope:[main] from main::@2
(byte*) main::colors#3 ← phi( main::@2/(byte*) main::colors#2 )
(byte*) main::screen#3 ← phi( main::@2/(byte*) main::screen#2 )
(byte) main::color#4 ← phi( main::@2/(byte) main::color#1 )
(byte/word/dword~) main::$2 ← (byte) main::color#4 ^ (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) main::color#2 ← (byte/word/dword~) main::$2
(byte*~) main::$3 ← (byte*) main::screen#3 + (byte/signed byte/word/signed word/dword/signed dword) $28
(number~) main::$2 ← (byte) main::color#4 ^ (number) 1
(byte) main::color#2 ← (number~) main::$2
(byte*~) main::$3 ← (byte*) main::screen#3 + (number) $28
(byte*) main::screen#1 ← (byte*~) main::$3
(byte*~) main::$4 ← (byte*) main::colors#3 + (byte/signed byte/word/signed word/dword/signed dword) $28
(byte*~) main::$4 ← (byte*) main::colors#3 + (number) $28
(byte*) main::colors#1 ← (byte*~) main::$4
(byte) main::row#1 ← (byte) main::row#2 + rangenext(0,7)
(bool~) main::$5 ← (byte) main::row#1 != rangelast(0,7)
@ -60,9 +63,9 @@ SYMBOL TABLE SSA
(label) @begin
(label) @end
(void()) main()
(byte/word/dword~) main::$0
(number~) main::$0
(bool~) main::$1
(byte/word/dword~) main::$2
(number~) main::$2
(byte*~) main::$3
(byte*~) main::$4
(bool~) main::$5
@ -100,13 +103,51 @@ SYMBOL TABLE SSA
(byte*) main::screen#3
(byte*) main::screen#4
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Alias (byte) main::color#1 = (byte/word/dword~) main::$0 (byte) main::color#4
Adding number conversion cast (unumber) 1 in (byte) main::color#0 ← (number) 1
Adding number conversion cast (unumber) 0 in (byte) main::row#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) main::column#0 ← (number) 0
Adding number conversion cast (unumber) $a0 in *((byte*) main::screen#2 + (byte) main::column#2) ← (number) $a0
Adding number conversion cast (unumber) 1 in (number~) main::$0 ← (byte) main::color#3 ^ (number) 1
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (byte) main::color#3 ^ (unumber)(number) 1
Adding number conversion cast (unumber) 1 in (number~) main::$2 ← (byte) main::color#4 ^ (number) 1
Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte) main::color#4 ^ (unumber)(number) 1
Adding number conversion cast (unumber) $28 in (byte*~) main::$3 ← (byte*) main::screen#3 + (number) $28
Adding number conversion cast (unumber) $28 in (byte*~) main::$4 ← (byte*) main::colors#3 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (byte*) main::colors#0 ← (byte*)(number) $d800
Inlining cast (byte) main::color#0 ← (unumber)(number) 1
Inlining cast (byte) main::row#0 ← (unumber)(number) 0
Inlining cast (byte) main::column#0 ← (unumber)(number) 0
Inlining cast *((byte*) main::screen#2 + (byte) main::column#2) ← (unumber)(number) $a0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 55296
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $a0
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $a0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) main::color#3 ^ (byte) 1
Inferred type updated to byte in (unumber~) main::$2 ← (byte) main::color#4 ^ (byte) 1
Alias (byte) main::color#1 = (byte~) main::$0 (byte) main::color#4
Alias (byte*) main::screen#2 = (byte*) main::screen#3
Alias (byte*) main::colors#2 = (byte*) main::colors#3
Alias (byte) main::row#2 = (byte) main::row#3
Alias (byte) main::color#2 = (byte/word/dword~) main::$2
Alias (byte) main::color#2 = (byte~) main::$2
Alias (byte*) main::screen#1 = (byte*~) main::$3
Alias (byte*) main::colors#1 = (byte*~) main::$4
Successful SSA optimization Pass2AliasElimination
@ -114,52 +155,63 @@ Self Phi Eliminated (byte*) main::screen#2
Self Phi Eliminated (byte*) main::colors#2
Self Phi Eliminated (byte) main::row#2
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) main::screen#2 (byte*) main::screen#4
Redundant Phi (byte*) main::colors#2 (byte*) main::colors#4
Redundant Phi (byte) main::row#2 (byte) main::row#4
Successful SSA optimization Pass2RedundantPhiElimination
Identical Phi Values (byte*) main::screen#2 (byte*) main::screen#4
Identical Phi Values (byte*) main::colors#2 (byte*) main::colors#4
Identical Phi Values (byte) main::row#2 (byte) main::row#4
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$1 [13] if((byte) main::column#1!=rangelast(0,7)) goto main::@2
Simple Condition (bool~) main::$5 [23] if((byte) main::row#1!=rangelast(0,7)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::screen#0 = ((byte*))$400
Constant (const byte*) main::colors#0 = ((byte*))$d800
Constant (const byte*) main::screen#0 = (byte*) 1024
Constant (const byte*) main::colors#0 = (byte*) 55296
Constant (const byte) main::color#0 = 1
Constant (const byte) main::row#0 = 0
Constant (const byte) main::column#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value main::column#1 ← ++ main::column#2 to ++
Resolved ranged comparison value if(main::column#1!=rangelast(0,7)) goto main::@2 to (byte/signed byte/word/signed word/dword/signed dword) 8
Resolved ranged next value main::row#1 ← ++ main::row#4 to ++
Resolved ranged comparison value if(main::row#1!=rangelast(0,7)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 8
Resolved ranged next value [11] main::column#1 ← ++ main::column#2 to ++
Resolved ranged comparison value [13] if(main::column#1!=rangelast(0,7)) goto main::@2 to (number) 8
Resolved ranged next value [21] main::row#1 ← ++ main::row#4 to ++
Resolved ranged comparison value [23] if(main::row#1!=rangelast(0,7)) goto main::@1 to (number) 8
Adding number conversion cast (unumber) 8 in if((byte) main::column#1!=(number) 8) goto main::@2
Adding number conversion cast (unumber) 8 in if((byte) main::row#1!=(number) 8) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 8
Simplifying constant integer cast 8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte*) main::screen#0
Inlining constant with var siblings (const byte*) main::colors#0
Inlining constant with var siblings (const byte) main::color#0
Inlining constant with var siblings (const byte) main::row#0
Inlining constant with var siblings (const byte) main::column#0
Constant inlined main::screen#0 = ((byte*))(word/signed word/dword/signed dword) $400
Constant inlined main::colors#0 = ((byte*))(word/dword/signed dword) $d800
Constant inlined main::color#0 = (byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::row#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::column#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::screen#0 = (byte*) 1024
Constant inlined main::colors#0 = (byte*) 55296
Constant inlined main::color#0 = (byte) 1
Constant inlined main::row#0 = (byte) 0
Constant inlined main::column#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@5(between main::@3 and main::@1)
Added new block during phi lifting main::@6(between main::@2 and main::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Created 6 initial phi equivalence classes
Coalesced [6] main::color#7 ← main::color#5
Coalesced [19] main::screen#5 ← main::screen#1
Coalesced [20] main::color#6 ← main::color#2
Coalesced [21] main::colors#5 ← main::colors#1
Coalesced [22] main::row#5 ← main::row#1
Coalesced [23] main::column#3 ← main::column#1
Coalesced [24] main::color#8 ← main::color#1
Coalesced [7] main::color#7 ← main::color#5
Coalesced [20] main::screen#5 ← main::screen#1
Coalesced [21] main::color#6 ← main::color#2
Coalesced [22] main::colors#5 ← main::colors#1
Coalesced [23] main::row#5 ← main::row#1
Coalesced [24] main::column#3 ← main::column#1
Coalesced [25] main::color#8 ← main::color#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Adding NOP phi() at start of @begin
@ -181,26 +233,26 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte) main::row#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::row#1 )
[5] (byte*) main::colors#4 ← phi( main/((byte*))(word/dword/signed dword) $d800 main::@3/(byte*) main::colors#1 )
[5] (byte) main::color#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@3/(byte) main::color#2 )
[5] (byte*) main::screen#4 ← phi( main/((byte*))(word/signed word/dword/signed dword) $400 main::@3/(byte*) main::screen#1 )
[5] (byte) main::row#4 ← phi( main/(byte) 0 main::@3/(byte) main::row#1 )
[5] (byte*) main::colors#4 ← phi( main/(byte*) 55296 main::@3/(byte*) main::colors#1 )
[5] (byte) main::color#5 ← phi( main/(byte) 1 main::@3/(byte) main::color#2 )
[5] (byte*) main::screen#4 ← phi( main/(byte*) 1024 main::@3/(byte*) main::screen#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[6] (byte) main::color#3 ← phi( main::@1/(byte) main::color#5 main::@2/(byte) main::color#1 )
[6] (byte) main::column#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::column#1 )
[7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte/word/signed word/dword/signed dword) $a0
[6] (byte) main::column#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::column#1 )
[7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte) $a0
[8] *((byte*) main::colors#4 + (byte) main::column#2) ← (byte) main::color#3
[9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1
[9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte) 1
[10] (byte) main::column#1 ← ++ (byte) main::column#2
[11] if((byte) main::column#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2
[11] if((byte) main::column#1!=(byte) 8) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte/signed byte/word/signed word/dword/signed dword) 1
[13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
[14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
[12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte) 1
[13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte) $28
[14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte) $28
[15] (byte) main::row#1 ← ++ (byte) main::row#4
[16] if((byte) main::row#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1
[16] if((byte) main::row#1!=(byte) 8) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
[17] return
@ -278,18 +330,18 @@ main: {
.label row = 6
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::row#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG12 [5] phi (byte) main::row#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta row
//SEG13 [5] phi (byte*) main::colors#4 = ((byte*))(word/dword/signed dword) $d800 [phi:main->main::@1#1] -- pbuz1=pbuc1
//SEG13 [5] phi (byte*) main::colors#4 = (byte*) 55296 [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<$d800
sta colors
lda #>$d800
sta colors+1
//SEG14 [5] phi (byte) main::color#5 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->main::@1#2] -- vbuz1=vbuc1
//SEG14 [5] phi (byte) main::color#5 = (byte) 1 [phi:main->main::@1#2] -- vbuz1=vbuc1
lda #1
sta color
//SEG15 [5] phi (byte*) main::screen#4 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->main::@1#3] -- pbuz1=pbuc1
//SEG15 [5] phi (byte*) main::screen#4 = (byte*) 1024 [phi:main->main::@1#3] -- pbuz1=pbuc1
lda #<$400
sta screen
lda #>$400
@ -307,7 +359,7 @@ main: {
//SEG22 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
//SEG23 [6] phi (byte) main::color#3 = (byte) main::color#5 [phi:main::@1->main::@2#0] -- register_copy
//SEG24 [6] phi (byte) main::column#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#1] -- vbuz1=vbuc1
//SEG24 [6] phi (byte) main::column#2 = (byte) 0 [phi:main::@1->main::@2#1] -- vbuz1=vbuc1
lda #0
sta column
jmp b2
@ -318,7 +370,7 @@ main: {
jmp b2
//SEG28 main::@2
b2:
//SEG29 [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte/word/signed word/dword/signed dword) $a0 -- pbuz1_derefidx_vbuz2=vbuc1
//SEG29 [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte) $a0 -- pbuz1_derefidx_vbuz2=vbuc1
lda #$a0
ldy column
sta (screen),y
@ -326,24 +378,24 @@ main: {
lda color
ldy column
sta (colors),y
//SEG31 [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_bxor_vbuc1
//SEG31 [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte) 1 -- vbuz1=vbuz1_bxor_vbuc1
lda #1
eor color
sta color
//SEG32 [10] (byte) main::column#1 ← ++ (byte) main::column#2 -- vbuz1=_inc_vbuz1
inc column
//SEG33 [11] if((byte) main::column#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 -- vbuz1_neq_vbuc1_then_la1
//SEG33 [11] if((byte) main::column#1!=(byte) 8) goto main::@2 -- vbuz1_neq_vbuc1_then_la1
lda #8
cmp column
bne b2_from_b2
jmp b3
//SEG34 main::@3
b3:
//SEG35 [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_bxor_vbuc1
//SEG35 [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte) 1 -- vbuz1=vbuz1_bxor_vbuc1
lda #1
eor color
sta color
//SEG36 [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG36 [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc screen
@ -351,7 +403,7 @@ main: {
bcc !+
inc screen+1
!:
//SEG37 [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG37 [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc colors
@ -361,7 +413,7 @@ main: {
!:
//SEG38 [15] (byte) main::row#1 ← ++ (byte) main::row#4 -- vbuz1=_inc_vbuz1
inc row
//SEG39 [16] if((byte) main::row#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG39 [16] if((byte) main::row#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #8
cmp row
bne b1_from_b3
@ -373,21 +425,21 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte/word/signed word/dword/signed dword) $a0 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ) always clobbers reg byte a
Statement [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte) $a0 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ main::row#4 main::row#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ main::column#2 main::column#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ main::color#3 main::color#5 main::color#2 main::color#1 ]
Statement [8] *((byte*) main::colors#4 + (byte) main::column#2) ← (byte) main::color#3 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ) always clobbers reg byte a
Statement [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#1 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#1 ] ) always clobbers reg byte a
Statement [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::screen#4 main::colors#4 main::row#4 main::color#2 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::color#2 ] ) always clobbers reg byte a
Statement [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::colors#4 main::row#4 main::screen#1 main::color#2 ] ( main:2 [ main::colors#4 main::row#4 main::screen#1 main::color#2 ] ) always clobbers reg byte a
Statement [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::row#4 main::screen#1 main::color#2 main::colors#1 ] ( main:2 [ main::row#4 main::screen#1 main::color#2 main::colors#1 ] ) always clobbers reg byte a
Statement [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte/word/signed word/dword/signed dword) $a0 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ) always clobbers reg byte a
Statement [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte) 1 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#1 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#1 ] ) always clobbers reg byte a
Statement [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte) 1 [ main::screen#4 main::colors#4 main::row#4 main::color#2 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::color#2 ] ) always clobbers reg byte a
Statement [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte) $28 [ main::colors#4 main::row#4 main::screen#1 main::color#2 ] ( main:2 [ main::colors#4 main::row#4 main::screen#1 main::color#2 ] ) always clobbers reg byte a
Statement [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte) $28 [ main::row#4 main::screen#1 main::color#2 main::colors#1 ] ( main:2 [ main::row#4 main::screen#1 main::color#2 main::colors#1 ] ) always clobbers reg byte a
Statement [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte) $a0 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ) always clobbers reg byte a
Statement [8] *((byte*) main::colors#4 + (byte) main::column#2) ← (byte) main::color#3 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ) always clobbers reg byte a
Statement [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#1 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#1 ] ) always clobbers reg byte a
Statement [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::screen#4 main::colors#4 main::row#4 main::color#2 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::color#2 ] ) always clobbers reg byte a
Statement [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::colors#4 main::row#4 main::screen#1 main::color#2 ] ( main:2 [ main::colors#4 main::row#4 main::screen#1 main::color#2 ] ) always clobbers reg byte a
Statement [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::row#4 main::screen#1 main::color#2 main::colors#1 ] ( main:2 [ main::row#4 main::screen#1 main::color#2 main::colors#1 ] ) always clobbers reg byte a
Statement [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte) 1 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#1 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#1 ] ) always clobbers reg byte a
Statement [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte) 1 [ main::screen#4 main::colors#4 main::row#4 main::color#2 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::color#2 ] ) always clobbers reg byte a
Statement [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte) $28 [ main::colors#4 main::row#4 main::screen#1 main::color#2 ] ( main:2 [ main::colors#4 main::row#4 main::screen#1 main::color#2 ] ) always clobbers reg byte a
Statement [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte) $28 [ main::row#4 main::screen#1 main::color#2 main::colors#1 ] ( main:2 [ main::row#4 main::screen#1 main::color#2 main::colors#1 ] ) always clobbers reg byte a
Potential registers zp ZP_WORD:2 [ main::screen#4 main::screen#1 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_WORD:4 [ main::colors#4 main::colors#1 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_BYTE:6 [ main::row#4 main::row#1 ] : zp ZP_BYTE:6 , reg byte x , reg byte y ,
@ -434,17 +486,17 @@ main: {
.label row = 6
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::row#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG12 [5] phi (byte) main::row#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta row
//SEG13 [5] phi (byte*) main::colors#4 = ((byte*))(word/dword/signed dword) $d800 [phi:main->main::@1#1] -- pbuz1=pbuc1
//SEG13 [5] phi (byte*) main::colors#4 = (byte*) 55296 [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<$d800
sta colors
lda #>$d800
sta colors+1
//SEG14 [5] phi (byte) main::color#5 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->main::@1#2] -- vbuxx=vbuc1
//SEG14 [5] phi (byte) main::color#5 = (byte) 1 [phi:main->main::@1#2] -- vbuxx=vbuc1
ldx #1
//SEG15 [5] phi (byte*) main::screen#4 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->main::@1#3] -- pbuz1=pbuc1
//SEG15 [5] phi (byte*) main::screen#4 = (byte*) 1024 [phi:main->main::@1#3] -- pbuz1=pbuc1
lda #<$400
sta screen
lda #>$400
@ -462,7 +514,7 @@ main: {
//SEG22 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
b2_from_b1:
//SEG23 [6] phi (byte) main::color#3 = (byte) main::color#5 [phi:main::@1->main::@2#0] -- register_copy
//SEG24 [6] phi (byte) main::column#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#1] -- vbuyy=vbuc1
//SEG24 [6] phi (byte) main::column#2 = (byte) 0 [phi:main::@1->main::@2#1] -- vbuyy=vbuc1
ldy #0
jmp b2
//SEG25 [6] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
@ -472,29 +524,29 @@ main: {
jmp b2
//SEG28 main::@2
b2:
//SEG29 [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte/word/signed word/dword/signed dword) $a0 -- pbuz1_derefidx_vbuyy=vbuc1
//SEG29 [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte) $a0 -- pbuz1_derefidx_vbuyy=vbuc1
lda #$a0
sta (screen),y
//SEG30 [8] *((byte*) main::colors#4 + (byte) main::column#2) ← (byte) main::color#3 -- pbuz1_derefidx_vbuyy=vbuxx
txa
sta (colors),y
//SEG31 [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuxx_bxor_vbuc1
//SEG31 [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte) 1 -- vbuxx=vbuxx_bxor_vbuc1
txa
eor #1
tax
//SEG32 [10] (byte) main::column#1 ← ++ (byte) main::column#2 -- vbuyy=_inc_vbuyy
iny
//SEG33 [11] if((byte) main::column#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 -- vbuyy_neq_vbuc1_then_la1
//SEG33 [11] if((byte) main::column#1!=(byte) 8) goto main::@2 -- vbuyy_neq_vbuc1_then_la1
cpy #8
bne b2_from_b2
jmp b3
//SEG34 main::@3
b3:
//SEG35 [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuxx_bxor_vbuc1
//SEG35 [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte) 1 -- vbuxx=vbuxx_bxor_vbuc1
txa
eor #1
tax
//SEG36 [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG36 [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc screen
@ -502,7 +554,7 @@ main: {
bcc !+
inc screen+1
!:
//SEG37 [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG37 [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc colors
@ -512,7 +564,7 @@ main: {
!:
//SEG38 [15] (byte) main::row#1 ← ++ (byte) main::row#4 -- vbuz1=_inc_vbuz1
inc row
//SEG39 [16] if((byte) main::row#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG39 [16] if((byte) main::row#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #8
cmp row
bne b1_from_b3
@ -612,17 +664,17 @@ main: {
.label colors = 4
.label row = 6
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::row#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
//SEG12 [5] phi (byte) main::row#4 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta row
//SEG13 [5] phi (byte*) main::colors#4 = ((byte*))(word/dword/signed dword) $d800 [phi:main->main::@1#1] -- pbuz1=pbuc1
//SEG13 [5] phi (byte*) main::colors#4 = (byte*) 55296 [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<$d800
sta colors
lda #>$d800
sta colors+1
//SEG14 [5] phi (byte) main::color#5 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:main->main::@1#2] -- vbuxx=vbuc1
//SEG14 [5] phi (byte) main::color#5 = (byte) 1 [phi:main->main::@1#2] -- vbuxx=vbuc1
ldx #1
//SEG15 [5] phi (byte*) main::screen#4 = ((byte*))(word/signed word/dword/signed dword) $400 [phi:main->main::@1#3] -- pbuz1=pbuc1
//SEG15 [5] phi (byte*) main::screen#4 = (byte*) 1024 [phi:main->main::@1#3] -- pbuz1=pbuc1
lda #<$400
sta screen
lda #>$400
@ -636,34 +688,34 @@ main: {
b1:
//SEG22 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
//SEG23 [6] phi (byte) main::color#3 = (byte) main::color#5 [phi:main::@1->main::@2#0] -- register_copy
//SEG24 [6] phi (byte) main::column#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#1] -- vbuyy=vbuc1
//SEG24 [6] phi (byte) main::column#2 = (byte) 0 [phi:main::@1->main::@2#1] -- vbuyy=vbuc1
ldy #0
//SEG25 [6] phi from main::@2 to main::@2 [phi:main::@2->main::@2]
//SEG26 [6] phi (byte) main::color#3 = (byte) main::color#1 [phi:main::@2->main::@2#0] -- register_copy
//SEG27 [6] phi (byte) main::column#2 = (byte) main::column#1 [phi:main::@2->main::@2#1] -- register_copy
//SEG28 main::@2
b2:
//SEG29 [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte/word/signed word/dword/signed dword) $a0 -- pbuz1_derefidx_vbuyy=vbuc1
//SEG29 [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte) $a0 -- pbuz1_derefidx_vbuyy=vbuc1
lda #$a0
sta (screen),y
//SEG30 [8] *((byte*) main::colors#4 + (byte) main::column#2) ← (byte) main::color#3 -- pbuz1_derefidx_vbuyy=vbuxx
txa
sta (colors),y
//SEG31 [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuxx_bxor_vbuc1
//SEG31 [9] (byte) main::color#1 ← (byte) main::color#3 ^ (byte) 1 -- vbuxx=vbuxx_bxor_vbuc1
txa
eor #1
tax
//SEG32 [10] (byte) main::column#1 ← ++ (byte) main::column#2 -- vbuyy=_inc_vbuyy
iny
//SEG33 [11] if((byte) main::column#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 -- vbuyy_neq_vbuc1_then_la1
//SEG33 [11] if((byte) main::column#1!=(byte) 8) goto main::@2 -- vbuyy_neq_vbuc1_then_la1
cpy #8
bne b2
//SEG34 main::@3
//SEG35 [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuxx_bxor_vbuc1
//SEG35 [12] (byte) main::color#2 ← (byte) main::color#1 ^ (byte) 1 -- vbuxx=vbuxx_bxor_vbuc1
txa
eor #1
tax
//SEG36 [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG36 [13] (byte*) main::screen#1 ← (byte*) main::screen#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc screen
@ -671,7 +723,7 @@ main: {
bcc !+
inc screen+1
!:
//SEG37 [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- pbuz1=pbuz1_plus_vbuc1
//SEG37 [14] (byte*) main::colors#1 ← (byte*) main::colors#4 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc colors
@ -681,7 +733,7 @@ main: {
!:
//SEG38 [15] (byte) main::row#1 ← ++ (byte) main::row#4 -- vbuz1=_inc_vbuz1
inc row
//SEG39 [16] if((byte) main::row#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
//SEG39 [16] if((byte) main::row#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #8
cmp row
bne b1

@ -1,31 +1 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte) main::color
(byte) main::color#1 reg byte x 71.0
(byte) main::color#2 reg byte x 4.4
(byte) main::color#3 reg byte x 104.66666666666666
(byte) main::color#5 reg byte x 22.0
(byte*) main::colors
(byte*) main::colors#1 colors zp ZP_WORD:4 7.333333333333333
(byte*) main::colors#4 colors zp ZP_WORD:4 13.666666666666664
(byte) main::column
(byte) main::column#1 reg byte y 151.5
(byte) main::column#2 reg byte y 101.0
(byte) main::row
(byte) main::row#1 row zp ZP_BYTE:6 16.5
(byte) main::row#4 row zp ZP_BYTE:6 2.2
(byte*) main::screen
(byte*) main::screen#1 screen zp ZP_WORD:2 5.5
(byte*) main::screen#4 screen zp ZP_WORD:2 15.375
zp ZP_WORD:2 [ main::screen#4 main::screen#1 ]
zp ZP_WORD:4 [ main::colors#4 main::colors#1 ]
zp ZP_BYTE:6 [ main::row#4 main::row#1 ]
reg byte y [ main::column#2 main::column#1 ]
reg byte x [ main::color#3 main::color#5 main::color#2 main::color#1 ]
program

@ -2,7 +2,7 @@
[0] phi()
to:@1
@1: scope:[] from @begin
[1] (byte) irq_raster_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
[1] (byte) irq_raster_next#0 ← (byte) 0
to:@2
@2: scope:[] from @1
[2] phi()
@ -18,13 +18,13 @@ main::@return: scope:[main] from main
to:@return
irq: scope:[irq] from
[7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0
[8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte/signed byte/word/signed word/dword/signed dword) $15
[8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15
[9] (byte) irq::raster_next#0 ← (byte) irq_raster_next#1
[10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7
[11] if((byte~) irq::$0!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto irq::@1
[10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte) 7
[11] if((byte~) irq::$0!=(byte) 0) goto irq::@1
to:irq::@2
irq::@2: scope:[irq] from irq
[12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte/signed byte/word/signed word/dword/signed dword) 1
[12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte) 1
to:irq::@1
irq::@1: scope:[irq] from irq irq::@2
[13] (byte) irq::raster_next#2 ← phi( irq/(byte) irq::raster_next#0 irq::@2/(byte) irq::raster_next#1 )

@ -1,4 +1,7 @@
Resolved forward reference irq to interrupt(HARDWARE_CLOBBER)(void()) irq()
Adding pointer type conversion cast (byte*) BORDERCOL in (byte*) BORDERCOL ← (number) $d020
Adding pointer type conversion cast (byte*) RASTER in (byte*) RASTER ← (number) $d012
Adding pointer type conversion cast (void()**) KERNEL_IRQ in (void()**) KERNEL_IRQ ← (number) $314
Identified constant variable (byte*) BORDERCOL
Identified constant variable (byte*) RASTER
Identified constant variable (byte) DARK_GREY
@ -6,11 +9,11 @@ Identified constant variable (byte) BLACK
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) BORDERCOL#0 ← ((byte*)) (word/dword/signed dword) $d020
(byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) $d012
(byte) DARK_GREY#0 ← (byte/signed byte/word/signed word/dword/signed dword) $b
(byte) BLACK#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(void()**) KERNEL_IRQ#0 ← ((void()**)) (word/signed word/dword/signed dword) $314
(byte*) BORDERCOL#0 ← ((byte*)) (number) $d020
(byte*) RASTER#0 ← ((byte*)) (number) $d012
(byte) DARK_GREY#0 ← (number) $b
(byte) BLACK#0 ← (number) 0
(void()**) KERNEL_IRQ#0 ← ((void()**)) (number) $314
to:@1
main: scope:[main] from @2
(void()*~) main::$0 ← & interrupt(HARDWARE_CLOBBER)(void()) irq()
@ -20,15 +23,15 @@ main::@return: scope:[main] from main
return
to:@return
@1: scope:[] from @begin
(byte) irq_raster_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) irq_raster_next#0 ← (number) 0
to:@2
irq: scope:[irq] from
(byte) irq_raster_next#3 ← phi( @2/(byte) irq_raster_next#5 )
*((byte*) BORDERCOL#0) ← (byte) DARK_GREY#0
(byte) irq_raster_next#1 ← (byte) irq_raster_next#3 + (byte/signed byte/word/signed word/dword/signed dword) $15
(byte) irq_raster_next#1 ← (byte) irq_raster_next#3 + (number) $15
(byte) irq::raster_next#0 ← (byte) irq_raster_next#1
(byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7
(bool~) irq::$1 ← (byte~) irq::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0
(number~) irq::$0 ← (byte) irq::raster_next#0 & (number) 7
(bool~) irq::$1 ← (number~) irq::$0 == (number) 0
(bool~) irq::$2 ← ! (bool~) irq::$1
if((bool~) irq::$2) goto irq::@1
to:irq::@2
@ -41,7 +44,7 @@ irq::@1: scope:[irq] from irq irq::@2
irq::@2: scope:[irq] from irq
(byte) irq_raster_next#7 ← phi( irq/(byte) irq_raster_next#1 )
(byte) irq::raster_next#3 ← phi( irq/(byte) irq::raster_next#0 )
(byte) irq::raster_next#1 ← (byte) irq::raster_next#3 - (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) irq::raster_next#1 ← (byte) irq::raster_next#3 - (number) 1
to:irq::@1
irq::@return: scope:[irq] from irq::@1
(byte) irq_raster_next#4 ← phi( irq::@1/(byte) irq_raster_next#6 )
@ -73,7 +76,7 @@ SYMBOL TABLE SSA
(byte*) RASTER
(byte*) RASTER#0
interrupt(HARDWARE_CLOBBER)(void()) irq()
(byte~) irq::$0
(number~) irq::$0
(bool~) irq::$1
(bool~) irq::$2
(label) irq::@1
@ -97,9 +100,43 @@ interrupt(HARDWARE_CLOBBER)(void()) irq()
(void()*~) main::$0
(label) main::@return
Culled Empty Block (label) @3
Successful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not [15] (bool~) irq::$2 ← (byte~) irq::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [14] (bool~) irq::$1 ← (byte~) irq::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0
Adding number conversion cast (unumber) $b in (byte) DARK_GREY#0 ← (number) $b
Adding number conversion cast (unumber) 0 in (byte) BLACK#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) irq_raster_next#0 ← (number) 0
Adding number conversion cast (unumber) $15 in (byte) irq_raster_next#1 ← (byte) irq_raster_next#3 + (number) $15
Adding number conversion cast (unumber) 7 in (number~) irq::$0 ← (byte) irq::raster_next#0 & (number) 7
Adding number conversion cast (unumber) irq::$0 in (number~) irq::$0 ← (byte) irq::raster_next#0 & (unumber)(number) 7
Adding number conversion cast (unumber) 0 in (bool~) irq::$1 ← (unumber~) irq::$0 == (number) 0
Adding number conversion cast (unumber) 1 in (byte) irq::raster_next#1 ← (byte) irq::raster_next#3 - (number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) BORDERCOL#0 ← (byte*)(number) $d020
Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012
Inlining cast (byte) DARK_GREY#0 ← (unumber)(number) $b
Inlining cast (byte) BLACK#0 ← (unumber)(number) 0
Inlining cast (void()**) KERNEL_IRQ#0 ← (void()**)(number) $314
Inlining cast (byte) irq_raster_next#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53266
Simplifying constant integer cast $b
Simplifying constant integer cast 0
Simplifying constant pointer cast (void()**) 788
Simplifying constant integer cast 0
Simplifying constant integer cast $15
Simplifying constant integer cast 7
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $b
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) 7
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) irq::$0 ← (byte) irq::raster_next#0 & (byte) 7
Inversing boolean not [15] (bool~) irq::$2 ← (byte~) irq::$0 != (byte) 0 from [14] (bool~) irq::$1 ← (byte~) irq::$0 == (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte) irq::raster_next#0 = (byte) irq::raster_next#3
Alias (byte) irq_raster_next#1 = (byte) irq_raster_next#7
@ -108,15 +145,17 @@ Alias (byte) irq_raster_next#0 = (byte) irq_raster_next#5
Successful SSA optimization Pass2AliasElimination
Alias (byte) irq_raster_next#1 = (byte) irq_raster_next#2
Successful SSA optimization Pass2AliasElimination
Redundant Phi (byte) irq_raster_next#3 (byte) irq_raster_next#0
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) irq::$2 [16] if((byte~) irq::$0!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto irq::@1
Identical Phi Values (byte) irq_raster_next#3 (byte) irq_raster_next#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) irq::$2 [16] if((byte~) irq::$0!=(byte) 0) goto irq::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) BORDERCOL#0 = ((byte*))$d020
Constant (const byte*) RASTER#0 = ((byte*))$d012
Constant right-side identified [5] (void()*~) main::$0 ← & interrupt(HARDWARE_CLOBBER)(void()) irq()
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) BORDERCOL#0 = (byte*) 53280
Constant (const byte*) RASTER#0 = (byte*) 53266
Constant (const byte) DARK_GREY#0 = $b
Constant (const byte) BLACK#0 = 0
Constant (const void()**) KERNEL_IRQ#0 = ((void()**))$314
Constant (const void()**) KERNEL_IRQ#0 = (void()**) 788
Constant (const void()*) main::$0 = &irq
Successful SSA optimization Pass2ConstantIdentification
Constant inlined main::$0 = &interrupt(HARDWARE_CLOBBER)(void()) irq()
@ -124,14 +163,16 @@ Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting irq::@3(between irq and irq::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:3
Created 1 initial phi equivalence classes
Coalesced [13] irq::raster_next#5 ← irq::raster_next#1
Coalesced [18] irq::raster_next#4 ← irq::raster_next#0
Coalesced [14] irq::raster_next#5 ← irq::raster_next#1
Coalesced [19] irq::raster_next#4 ← irq::raster_next#0
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) irq::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
@ -142,7 +183,7 @@ FINAL CONTROL FLOW GRAPH
[0] phi()
to:@1
@1: scope:[] from @begin
[1] (byte) irq_raster_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
[1] (byte) irq_raster_next#0 ← (byte) 0
to:@2
@2: scope:[] from @1
[2] phi()
@ -158,13 +199,13 @@ main::@return: scope:[main] from main
to:@return
irq: scope:[irq] from
[7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0
[8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte/signed byte/word/signed word/dword/signed dword) $15
[8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15
[9] (byte) irq::raster_next#0 ← (byte) irq_raster_next#1
[10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7
[11] if((byte~) irq::$0!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto irq::@1
[10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte) 7
[11] if((byte~) irq::$0!=(byte) 0) goto irq::@1
to:irq::@2
irq::@2: scope:[irq] from irq
[12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte/signed byte/word/signed word/dword/signed dword) 1
[12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte) 1
to:irq::@1
irq::@1: scope:[irq] from irq irq::@2
[13] (byte) irq::raster_next#2 ← phi( irq/(byte) irq::raster_next#0 irq::@2/(byte) irq::raster_next#1 )
@ -223,7 +264,7 @@ bbegin:
jmp b1
//SEG4 @1
b1:
//SEG5 [1] (byte) irq_raster_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
//SEG5 [1] (byte) irq_raster_next#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta irq_raster_next
//SEG6 [2] phi from @1 to @2 [phi:@1->@2]
@ -262,7 +303,7 @@ irq: {
//SEG17 [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2
lda #DARK_GREY
sta BORDERCOL
//SEG18 [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuz1=vbuz1_plus_vbuc1
//SEG18 [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1
lax irq_raster_next
axs #-[$15]
stx irq_raster_next
@ -270,18 +311,18 @@ irq: {
// Setup next interrupt
lda irq_raster_next
sta raster_next
//SEG20 [10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuz2_band_vbuc1
//SEG20 [10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1
lda #7
and raster_next
sta _0
//SEG21 [11] if((byte~) irq::$0!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto irq::@1 -- vbuz1_neq_0_then_la1
//SEG21 [11] if((byte~) irq::$0!=(byte) 0) goto irq::@1 -- vbuz1_neq_0_then_la1
lda _0
cmp #0
bne b1_from_irq
jmp b2
//SEG22 irq::@2
b2:
//SEG23 [12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_minus_1
//SEG23 [12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte) 1 -- vbuz1=vbuz1_minus_1
dec raster_next
//SEG24 [13] phi from irq irq::@2 to irq::@1 [phi:irq/irq::@2->irq::@1]
b1_from_irq:
@ -310,10 +351,10 @@ irq: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] (byte) irq_raster_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( ) always clobbers reg byte a
Statement [1] (byte) irq_raster_next#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
Statement [5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 [ irq_raster_next#0 ] ( [ irq_raster_next#0 ] ) always clobbers reg byte a
Statement [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 [ irq_raster_next#1 ] ( [ irq_raster_next#1 ] ) always clobbers reg byte a reg byte x
Statement [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 [ irq_raster_next#1 ] ( [ irq_raster_next#1 ] ) always clobbers reg byte a reg byte x
Statement [15] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 [ ] ( [ ] ) always clobbers reg byte a
Statement [16] return [ ] ( [ ] ) always clobbers reg byte a reg byte x reg byte y
Potential registers zp ZP_BYTE:2 [ irq::raster_next#2 irq::raster_next#0 irq::raster_next#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
@ -354,7 +395,7 @@ bbegin:
jmp b1
//SEG4 @1
b1:
//SEG5 [1] (byte) irq_raster_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
//SEG5 [1] (byte) irq_raster_next#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta irq_raster_next
//SEG6 [2] phi from @1 to @2 [phi:@1->@2]
@ -390,23 +431,23 @@ irq: {
//SEG17 [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2
lda #DARK_GREY
sta BORDERCOL
//SEG18 [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuz1=vbuz1_plus_vbuc1
//SEG18 [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1
lax irq_raster_next
axs #-[$15]
stx irq_raster_next
//SEG19 [9] (byte) irq::raster_next#0 ← (byte) irq_raster_next#1 -- vbuxx=vbuz1
// Setup next interrupt
ldx irq_raster_next
//SEG20 [10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuaa=vbuxx_band_vbuc1
//SEG20 [10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1
txa
and #7
//SEG21 [11] if((byte~) irq::$0!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto irq::@1 -- vbuaa_neq_0_then_la1
//SEG21 [11] if((byte~) irq::$0!=(byte) 0) goto irq::@1 -- vbuaa_neq_0_then_la1
cmp #0
bne b1_from_irq
jmp b2
//SEG22 irq::@2
b2:
//SEG23 [12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuxx_minus_1
//SEG23 [12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte) 1 -- vbuxx=vbuxx_minus_1
dex
//SEG24 [13] phi from irq irq::@2 to irq::@1 [phi:irq/irq::@2->irq::@1]
b1_from_irq:
@ -464,15 +505,15 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(byte) BLACK
(const byte) BLACK#0 BLACK = (byte/signed byte/word/signed word/dword/signed dword) 0
(const byte) BLACK#0 BLACK = (byte) 0
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = ((byte*))(word/dword/signed dword) $d020
(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280
(byte) DARK_GREY
(const byte) DARK_GREY#0 DARK_GREY = (byte/signed byte/word/signed word/dword/signed dword) $b
(const byte) DARK_GREY#0 DARK_GREY = (byte) $b
(void()**) KERNEL_IRQ
(const void()**) KERNEL_IRQ#0 KERNEL_IRQ = ((void()**))(word/signed word/dword/signed dword) $314
(const void()**) KERNEL_IRQ#0 KERNEL_IRQ = (void()**) 788
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) $d012
(const byte*) RASTER#0 RASTER = (byte*) 53266
interrupt(HARDWARE_CLOBBER)(void()) irq()
(byte~) irq::$0 reg byte a 4.0
(label) irq::@1
@ -511,7 +552,7 @@ Score: 159
//SEG3 @begin
bbegin:
//SEG4 @1
//SEG5 [1] (byte) irq_raster_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
//SEG5 [1] (byte) irq_raster_next#0 ← (byte) 0 -- vbuz1=vbuc1
lda #0
sta irq_raster_next
//SEG6 [2] phi from @1 to @2 [phi:@1->@2]
@ -540,20 +581,20 @@ irq: {
//SEG17 [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 -- _deref_pbuc1=vbuc2
lda #DARK_GREY
sta BORDERCOL
//SEG18 [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuz1=vbuz1_plus_vbuc1
//SEG18 [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 -- vbuz1=vbuz1_plus_vbuc1
lax irq_raster_next
axs #-[$15]
stx irq_raster_next
//SEG19 [9] (byte) irq::raster_next#0 ← (byte) irq_raster_next#1 -- vbuxx=vbuz1
// Setup next interrupt
//SEG20 [10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuaa=vbuxx_band_vbuc1
//SEG20 [10] (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1
txa
and #7
//SEG21 [11] if((byte~) irq::$0!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto irq::@1 -- vbuaa_neq_0_then_la1
//SEG21 [11] if((byte~) irq::$0!=(byte) 0) goto irq::@1 -- vbuaa_neq_0_then_la1
cmp #0
bne b1
//SEG22 irq::@2
//SEG23 [12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuxx_minus_1
//SEG23 [12] (byte) irq::raster_next#1 ← (byte) irq::raster_next#0 - (byte) 1 -- vbuxx=vbuxx_minus_1
dex
//SEG24 [13] phi from irq irq::@2 to irq::@1 [phi:irq/irq::@2->irq::@1]
//SEG25 [13] phi (byte) irq::raster_next#2 = (byte) irq::raster_next#0 [phi:irq/irq::@2->irq::@1#0] -- register_copy

Some files were not shown because too many files have changed in this diff Show More