PARSING src/test/java/dk/camelot64/kickc/test/kc/raster-bars.kc
import "c64.kc"

void main() {
    asm {
        sei
    }
    do {
        do {} while (*RASTER!=$a);
        do {} while (*RASTER!=$b);
        raster();
    } while (true);
}

byte[] rastercols = { $b, $0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, $1, $f, $1, $1, $f, $1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, $0, $b, $0, $ff };


void raster() {
    asm {
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
    }
    byte i = 0;
    byte col = rastercols[i];
    do {
       *BGCOL = col;
       *BORDERCOL = col;
       col  = rastercols[++i];
       asm {
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
            nop
        }
    } while (col!=$ff);

}
Importing c64.kc
PARSING src/test/java/dk/camelot64/kickc/test/kc/c64.kc
const byte* PROCPORT = $01;

const byte* CHARGEN = $d000;

const byte* SPRITES_XPOS = $d000;
const byte* SPRITES_YPOS = $d001;
const byte* SPRITES_XMSB = $d010;
const byte* RASTER = $d012;
const byte* SPRITES_ENABLE = $d015;
const byte* SPRITES_EXPAND_Y = $d017;
const byte* SPRITES_PRIORITY = $d01b;
const byte* SPRITES_MC = $d01c;
const byte* SPRITES_EXPAND_X = $d01d;
const byte* BORDERCOL = $d020;
const byte* BGCOL = $d021;
const byte* SPRITES_MC1 = $d025;
const byte* SPRITES_MC2 = $d026;
const byte* SPRITES_COLS = $d027;

const byte* COLS = $d800;


const byte BLACK = $0;
const byte WHITE = $1;
const byte RED = $2;
const byte CYAN = $3;
const byte PURPLE = $4;
const byte GREEN = $5;
const byte BLUE = $6;
const byte YELLOW = $7;
const byte ORANGE = $8;
const byte BROWN = $9;
const byte PINK = $a;
const byte DARK_GREY= $b;
const byte GREY = $c;
const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;

Adding pre/post-modifier (byte) raster::i ← ++ (byte) raster::i

STATEMENTS
  (byte*) PROCPORT ← (byte/signed byte/word/signed word/dword/signed dword) 1
  (byte*) CHARGEN ← (word/dword/signed dword) 53248
  (byte*) SPRITES_XPOS ← (word/dword/signed dword) 53248
  (byte*) SPRITES_YPOS ← (word/dword/signed dword) 53249
  (byte*) SPRITES_XMSB ← (word/dword/signed dword) 53264
  (byte*) RASTER ← (word/dword/signed dword) 53266
  (byte*) SPRITES_ENABLE ← (word/dword/signed dword) 53269
  (byte*) SPRITES_EXPAND_Y ← (word/dword/signed dword) 53271
  (byte*) SPRITES_PRIORITY ← (word/dword/signed dword) 53275
  (byte*) SPRITES_MC ← (word/dword/signed dword) 53276
  (byte*) SPRITES_EXPAND_X ← (word/dword/signed dword) 53277
  (byte*) BORDERCOL ← (word/dword/signed dword) 53280
  (byte*) BGCOL ← (word/dword/signed dword) 53281
  (byte*) SPRITES_MC1 ← (word/dword/signed dword) 53285
  (byte*) SPRITES_MC2 ← (word/dword/signed dword) 53286
  (byte*) SPRITES_COLS ← (word/dword/signed dword) 53287
  (byte*) COLS ← (word/dword/signed dword) 55296
  (byte) BLACK ← (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) WHITE ← (byte/signed byte/word/signed word/dword/signed dword) 1
  (byte) RED ← (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) CYAN ← (byte/signed byte/word/signed word/dword/signed dword) 3
  (byte) PURPLE ← (byte/signed byte/word/signed word/dword/signed dword) 4
  (byte) GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 5
  (byte) BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 6
  (byte) YELLOW ← (byte/signed byte/word/signed word/dword/signed dword) 7
  (byte) ORANGE ← (byte/signed byte/word/signed word/dword/signed dword) 8
  (byte) BROWN ← (byte/signed byte/word/signed word/dword/signed dword) 9
  (byte) PINK ← (byte/signed byte/word/signed word/dword/signed dword) 10
  (byte) DARK_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 11
  (byte) GREY ← (byte/signed byte/word/signed word/dword/signed dword) 12
  (byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
  (byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
  (byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
proc (void()) main()
  asm { sei  }
main::@1:
main::@2:
  (boolean~) main::$0 ← *((byte*) RASTER) != (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) main::$0) goto main::@2
main::@3:
  (boolean~) main::$1 ← *((byte*) RASTER) != (byte/signed byte/word/signed word/dword/signed dword) 11
  if((boolean~) main::$1) goto main::@3
  (void~) main::$2 ← call raster 
  if(true) goto main::@1
main::@return:
  return 
endproc // main()
  (byte[]) rastercols ← { (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (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) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/word/signed word/dword/signed dword) 255 }
proc (void()) raster()
  asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop  }
  (byte) raster::i ← (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) raster::col ← *((byte[]) rastercols + (byte) raster::i)
raster::@1:
  *((byte*) BGCOL) ← (byte) raster::col
  *((byte*) BORDERCOL) ← (byte) raster::col
  (byte) raster::i ← ++ (byte) raster::i
  (byte) raster::col ← *((byte[]) rastercols + (byte) raster::i)
  asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop  }
  (boolean~) raster::$0 ← (byte) raster::col != (byte/word/signed word/dword/signed dword) 255
  if((boolean~) raster::$0) goto raster::@1
raster::@return:
  return 
endproc // raster()
  call main 

SYMBOLS
(byte*) BGCOL
(byte) BLACK
(byte) BLUE
(byte*) BORDERCOL
(byte) BROWN
(byte*) CHARGEN
(byte*) COLS
(byte) CYAN
(byte) DARK_GREY
(byte) GREEN
(byte) GREY
(byte) LIGHT_BLUE
(byte) LIGHT_GREEN
(byte) LIGHT_GREY
(byte) ORANGE
(byte) PINK
(byte*) PROCPORT
(byte) PURPLE
(byte*) RASTER
(byte) RED
(byte*) SPRITES_COLS
(byte*) SPRITES_ENABLE
(byte*) SPRITES_EXPAND_X
(byte*) SPRITES_EXPAND_Y
(byte*) SPRITES_MC
(byte*) SPRITES_MC1
(byte*) SPRITES_MC2
(byte*) SPRITES_PRIORITY
(byte*) SPRITES_XMSB
(byte*) SPRITES_XPOS
(byte*) SPRITES_YPOS
(byte) WHITE
(byte) YELLOW
(void()) main()
(boolean~) main::$0
(boolean~) main::$1
(void~) main::$2
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(void()) raster()
(boolean~) raster::$0
(label) raster::@1
(label) raster::@return
(byte) raster::col
(byte) raster::i
(byte[]) rastercols

Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
Promoting word/dword/signed dword to byte* in CHARGEN ← ((byte*)) 53248
Promoting word/dword/signed dword to byte* in SPRITES_XPOS ← ((byte*)) 53248
Promoting word/dword/signed dword to byte* in SPRITES_YPOS ← ((byte*)) 53249
Promoting word/dword/signed dword to byte* in SPRITES_XMSB ← ((byte*)) 53264
Promoting word/dword/signed dword to byte* in RASTER ← ((byte*)) 53266
Promoting word/dword/signed dword to byte* in SPRITES_ENABLE ← ((byte*)) 53269
Promoting word/dword/signed dword to byte* in SPRITES_EXPAND_Y ← ((byte*)) 53271
Promoting word/dword/signed dword to byte* in SPRITES_PRIORITY ← ((byte*)) 53275
Promoting word/dword/signed dword to byte* in SPRITES_MC ← ((byte*)) 53276
Promoting word/dword/signed dword to byte* in SPRITES_EXPAND_X ← ((byte*)) 53277
Promoting word/dword/signed dword to byte* in BORDERCOL ← ((byte*)) 53280
Promoting word/dword/signed dword to byte* in BGCOL ← ((byte*)) 53281
Promoting word/dword/signed dword to byte* in SPRITES_MC1 ← ((byte*)) 53285
Promoting word/dword/signed dword to byte* in SPRITES_MC2 ← ((byte*)) 53286
Promoting word/dword/signed dword to byte* in SPRITES_COLS ← ((byte*)) 53287
Promoting word/dword/signed dword to byte* in COLS ← ((byte*)) 55296
INITIAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  (byte*) PROCPORT ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1
  (byte*) CHARGEN ← ((byte*)) (word/dword/signed dword) 53248
  (byte*) SPRITES_XPOS ← ((byte*)) (word/dword/signed dword) 53248
  (byte*) SPRITES_YPOS ← ((byte*)) (word/dword/signed dword) 53249
  (byte*) SPRITES_XMSB ← ((byte*)) (word/dword/signed dword) 53264
  (byte*) RASTER ← ((byte*)) (word/dword/signed dword) 53266
  (byte*) SPRITES_ENABLE ← ((byte*)) (word/dword/signed dword) 53269
  (byte*) SPRITES_EXPAND_Y ← ((byte*)) (word/dword/signed dword) 53271
  (byte*) SPRITES_PRIORITY ← ((byte*)) (word/dword/signed dword) 53275
  (byte*) SPRITES_MC ← ((byte*)) (word/dword/signed dword) 53276
  (byte*) SPRITES_EXPAND_X ← ((byte*)) (word/dword/signed dword) 53277
  (byte*) BORDERCOL ← ((byte*)) (word/dword/signed dword) 53280
  (byte*) BGCOL ← ((byte*)) (word/dword/signed dword) 53281
  (byte*) SPRITES_MC1 ← ((byte*)) (word/dword/signed dword) 53285
  (byte*) SPRITES_MC2 ← ((byte*)) (word/dword/signed dword) 53286
  (byte*) SPRITES_COLS ← ((byte*)) (word/dword/signed dword) 53287
  (byte*) COLS ← ((byte*)) (word/dword/signed dword) 55296
  (byte) BLACK ← (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) WHITE ← (byte/signed byte/word/signed word/dword/signed dword) 1
  (byte) RED ← (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) CYAN ← (byte/signed byte/word/signed word/dword/signed dword) 3
  (byte) PURPLE ← (byte/signed byte/word/signed word/dword/signed dword) 4
  (byte) GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 5
  (byte) BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 6
  (byte) YELLOW ← (byte/signed byte/word/signed word/dword/signed dword) 7
  (byte) ORANGE ← (byte/signed byte/word/signed word/dword/signed dword) 8
  (byte) BROWN ← (byte/signed byte/word/signed word/dword/signed dword) 9
  (byte) PINK ← (byte/signed byte/word/signed word/dword/signed dword) 10
  (byte) DARK_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 11
  (byte) GREY ← (byte/signed byte/word/signed word/dword/signed dword) 12
  (byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
  (byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
  (byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
  to:@1
main: scope:[main]  from
  asm { sei  }
  to:main::@1
main::@1: scope:[main]  from main main::@5
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@2
  (boolean~) main::$0 ← *((byte*) RASTER) != (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) main::$0) goto main::@2
  to:main::@4
main::@4: scope:[main]  from main::@2
  to:main::@3
main::@3: scope:[main]  from main::@3 main::@4
  (boolean~) main::$1 ← *((byte*) RASTER) != (byte/signed byte/word/signed word/dword/signed dword) 11
  if((boolean~) main::$1) goto main::@3
  to:main::@5
main::@5: scope:[main]  from main::@3
  (void~) main::$2 ← call raster 
  if(true) goto main::@1
  to:main::@6
main::@6: scope:[main]  from main::@5
  to:main::@return
main::@return: scope:[main]  from main::@6
  return 
  to:@return
@1: scope:[]  from @begin
  (byte[]) rastercols ← { (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (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) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/word/signed word/dword/signed dword) 255 }
  to:@2
raster: scope:[raster]  from
  asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop  }
  (byte) raster::i ← (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) raster::col ← *((byte[]) rastercols + (byte) raster::i)
  to:raster::@1
raster::@1: scope:[raster]  from raster raster::@1
  *((byte*) BGCOL) ← (byte) raster::col
  *((byte*) BORDERCOL) ← (byte) raster::col
  (byte) raster::i ← ++ (byte) raster::i
  (byte) raster::col ← *((byte[]) rastercols + (byte) raster::i)
  asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop  }
  (boolean~) raster::$0 ← (byte) raster::col != (byte/word/signed word/dword/signed dword) 255
  if((boolean~) raster::$0) goto raster::@1
  to:raster::@2
raster::@2: scope:[raster]  from raster::@1
  to:raster::@return
raster::@return: scope:[raster]  from raster::@2
  return 
  to:@return
@2: scope:[]  from @1
  call main 
  to:@end
@end: scope:[]  from @2

Eliminating unused variable (byte*) PROCPORT and assignment [0] (byte*) PROCPORT ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1
Eliminating unused variable (byte*) CHARGEN and assignment [1] (byte*) CHARGEN ← ((byte*)) (word/dword/signed dword) 53248
Eliminating unused variable (byte*) SPRITES_XPOS and assignment [2] (byte*) SPRITES_XPOS ← ((byte*)) (word/dword/signed dword) 53248
Eliminating unused variable (byte*) SPRITES_YPOS and assignment [3] (byte*) SPRITES_YPOS ← ((byte*)) (word/dword/signed dword) 53249
Eliminating unused variable (byte*) SPRITES_XMSB and assignment [4] (byte*) SPRITES_XMSB ← ((byte*)) (word/dword/signed dword) 53264
Eliminating unused variable (byte*) SPRITES_ENABLE and assignment [6] (byte*) SPRITES_ENABLE ← ((byte*)) (word/dword/signed dword) 53269
Eliminating unused variable (byte*) SPRITES_EXPAND_Y and assignment [7] (byte*) SPRITES_EXPAND_Y ← ((byte*)) (word/dword/signed dword) 53271
Eliminating unused variable (byte*) SPRITES_PRIORITY and assignment [8] (byte*) SPRITES_PRIORITY ← ((byte*)) (word/dword/signed dword) 53275
Eliminating unused variable (byte*) SPRITES_MC and assignment [9] (byte*) SPRITES_MC ← ((byte*)) (word/dword/signed dword) 53276
Eliminating unused variable (byte*) SPRITES_EXPAND_X and assignment [10] (byte*) SPRITES_EXPAND_X ← ((byte*)) (word/dword/signed dword) 53277
Eliminating unused variable (byte*) SPRITES_MC1 and assignment [13] (byte*) SPRITES_MC1 ← ((byte*)) (word/dword/signed dword) 53285
Eliminating unused variable (byte*) SPRITES_MC2 and assignment [14] (byte*) SPRITES_MC2 ← ((byte*)) (word/dword/signed dword) 53286
Eliminating unused variable (byte*) SPRITES_COLS and assignment [15] (byte*) SPRITES_COLS ← ((byte*)) (word/dword/signed dword) 53287
Eliminating unused variable (byte*) COLS and assignment [16] (byte*) COLS ← ((byte*)) (word/dword/signed dword) 55296
Eliminating unused variable (byte) BLACK and assignment [17] (byte) BLACK ← (byte/signed byte/word/signed word/dword/signed dword) 0
Eliminating unused variable (byte) WHITE and assignment [18] (byte) WHITE ← (byte/signed byte/word/signed word/dword/signed dword) 1
Eliminating unused variable (byte) RED and assignment [19] (byte) RED ← (byte/signed byte/word/signed word/dword/signed dword) 2
Eliminating unused variable (byte) CYAN and assignment [20] (byte) CYAN ← (byte/signed byte/word/signed word/dword/signed dword) 3
Eliminating unused variable (byte) PURPLE and assignment [21] (byte) PURPLE ← (byte/signed byte/word/signed word/dword/signed dword) 4
Eliminating unused variable (byte) GREEN and assignment [22] (byte) GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 5
Eliminating unused variable (byte) BLUE and assignment [23] (byte) BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 6
Eliminating unused variable (byte) YELLOW and assignment [24] (byte) YELLOW ← (byte/signed byte/word/signed word/dword/signed dword) 7
Eliminating unused variable (byte) ORANGE and assignment [25] (byte) ORANGE ← (byte/signed byte/word/signed word/dword/signed dword) 8
Eliminating unused variable (byte) BROWN and assignment [26] (byte) BROWN ← (byte/signed byte/word/signed word/dword/signed dword) 9
Eliminating unused variable (byte) PINK and assignment [27] (byte) PINK ← (byte/signed byte/word/signed word/dword/signed dword) 10
Eliminating unused variable (byte) DARK_GREY and assignment [28] (byte) DARK_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 11
Eliminating unused variable (byte) GREY and assignment [29] (byte) GREY ← (byte/signed byte/word/signed word/dword/signed dword) 12
Eliminating unused variable (byte) LIGHT_GREEN and assignment [30] (byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
Eliminating unused variable (byte) LIGHT_BLUE and assignment [31] (byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
Eliminating unused variable (byte) LIGHT_GREY and assignment [32] (byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
Eliminating unused variable - keeping the call (void~) main::$2
Removing empty block main::@4
Removing empty block main::@6
Removing empty block raster::@2
PROCEDURE MODIFY VARIABLE ANALYSIS

Completing Phi functions...

CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
@begin: scope:[]  from
  (byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) 53266
  (byte*) BORDERCOL#0 ← ((byte*)) (word/dword/signed dword) 53280
  (byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) 53281
  to:@1
main: scope:[main]  from @2
  asm { sei  }
  to:main::@2
main::@1: scope:[main]  from main::@7
  to:main::@2
main::@2: scope:[main]  from main main::@1 main::@2
  (boolean~) main::$0 ← *((byte*) RASTER#0) != (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) main::$0) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@3
  (boolean~) main::$1 ← *((byte*) RASTER#0) != (byte/signed byte/word/signed word/dword/signed dword) 11
  if((boolean~) main::$1) goto main::@3
  to:main::@5
main::@5: scope:[main]  from main::@3
  call raster param-assignment
  to:main::@7
main::@7: scope:[main]  from main::@5
  if(true) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@7
  return 
  to:@return
@1: scope:[]  from @begin
  (byte[]) rastercols#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (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) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/word/signed word/dword/signed dword) 255 }
  to:@2
raster: scope:[raster]  from main::@5
  asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop  }
  (byte) raster::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
  (byte) raster::col#0 ← *((byte[]) rastercols#0 + (byte) raster::i#0)
  to:raster::@1
raster::@1: scope:[raster]  from raster raster::@1
  (byte) raster::i#2 ← phi( raster/(byte) raster::i#0 raster::@1/(byte) raster::i#1 )
  (byte) raster::col#2 ← phi( raster/(byte) raster::col#0 raster::@1/(byte) raster::col#1 )
  *((byte*) BGCOL#0) ← (byte) raster::col#2
  *((byte*) BORDERCOL#0) ← (byte) raster::col#2
  (byte) raster::i#1 ← ++ (byte) raster::i#2
  (byte) raster::col#1 ← *((byte[]) rastercols#0 + (byte) raster::i#1)
  asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop  }
  (boolean~) raster::$0 ← (byte) raster::col#1 != (byte/word/signed word/dword/signed dword) 255
  if((boolean~) raster::$0) goto raster::@1
  to:raster::@return
raster::@return: scope:[raster]  from raster::@1
  return 
  to:@return
@2: scope:[]  from @1
  call main param-assignment
  to:@3
@3: scope:[]  from @2
  to:@end
@end: scope:[]  from @3

SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @3
(label) @begin
(label) @end
(byte*) BGCOL
(byte*) BGCOL#0
(byte*) BORDERCOL
(byte*) BORDERCOL#0
(byte*) RASTER
(byte*) RASTER#0
(void()) main()
(boolean~) main::$0
(boolean~) main::$1
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@5
(label) main::@7
(label) main::@return
(void()) raster()
(boolean~) raster::$0
(label) raster::@1
(label) raster::@return
(byte) raster::col
(byte) raster::col#0
(byte) raster::col#1
(byte) raster::col#2
(byte) raster::i
(byte) raster::i#0
(byte) raster::i#1
(byte) raster::i#2
(byte[]) rastercols
(byte[]) rastercols#0

OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) main::@1
Culled Empty Block (label) @3
Succesful SSA optimization Pass2CullEmptyBlocks
Simple Condition (boolean~) main::$0 if(*((byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto main::@2
Simple Condition (boolean~) main::$1 if(*((byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@3
Simple Condition (boolean~) raster::$0 if((byte) raster::col#1!=(byte/word/signed word/dword/signed dword) 255) goto raster::@1
Succesful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) RASTER#0 = ((byte*))53266
Constant (const byte*) BORDERCOL#0 = ((byte*))53280
Constant (const byte*) BGCOL#0 = ((byte*))53281
Constant (const byte[]) rastercols#0 = { 11, 0, 11, 11, 12, 11, 12, 12, 15, 12, 15, 15, 1, 15, 1, 1, 15, 1, 15, 15, 12, 15, 12, 12, 11, 12, 11, 11, 0, 11, 0, 255 }
Constant (const byte) raster::i#0 = 0
Succesful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(rastercols#0+raster::i#0)
Succesful SSA optimization Pass2ConstantAdditionElimination
Culled Empty Block (label) @1
Succesful SSA optimization Pass2CullEmptyBlocks
OPTIMIZING CONTROL FLOW GRAPH
Inlining constant with var siblings (const byte) raster::i#0
Inlining constant with var siblings (const byte) raster::i#0
Constant inlined raster::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@5 main::@7 main::@return raster raster::@1 raster::@return 
Added new block during phi lifting raster::@3(between raster::@1 and raster::@1)
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@5 main::@7 main::@return raster raster::@1 raster::@return raster::@3 
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@5
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to raster:8 

Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Created 2 initial phi equivalence classes
Coalesced [13] raster::col#3 ← raster::col#0
Coalesced [22] raster::col#4 ← raster::col#1
Coalesced [23] raster::i#3 ← raster::i#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) raster::@3
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@5 main::@7 main::@return raster raster::@1 raster::@return 
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@5
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi() [ ] ( )
  to:@2
@2: scope:[]  from @begin
  [1] phi() [ ] ( )
  [2] call main param-assignment [ ] ( )
  to:@end
@end: scope:[]  from @2
  [3] phi() [ ] ( )
main: scope:[main]  from @2
  asm { sei  }
  to:main::@2
main::@2: scope:[main]  from main main::@2 main::@7
  [5] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto main::@2 [ ] ( main:2 [ ] )
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@3
  [6] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@3 [ ] ( main:2 [ ] )
  to:main::@5
main::@5: scope:[main]  from main::@3
  [7] phi() [ ] ( main:2 [ ] )
  [8] call raster param-assignment [ ] ( main:2 [ ] )
  to:main::@7
main::@7: scope:[main]  from main::@5
  [9] if(true) goto main::@2 [ ] ( main:2 [ ] )
  to:main::@return
main::@return: scope:[main]  from main::@7
  [10] return  [ ] ( main:2 [ ] )
  to:@return
raster: scope:[raster]  from main::@5
  asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop  }
  [12] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] )
  to:raster::@1
raster::@1: scope:[raster]  from raster raster::@1
  [13] (byte) raster::i#2 ← phi( raster/(byte/signed byte/word/signed word/dword/signed dword) 0 raster::@1/(byte) raster::i#1 ) [ raster::col#2 raster::i#2 ] ( main:2::raster:8 [ raster::col#2 raster::i#2 ] )
  [13] (byte) raster::col#2 ← phi( raster/(byte) raster::col#0 raster::@1/(byte) raster::col#1 ) [ raster::col#2 raster::i#2 ] ( main:2::raster:8 [ raster::col#2 raster::i#2 ] )
  [14] *((const byte*) BGCOL#0) ← (byte) raster::col#2 [ raster::col#2 raster::i#2 ] ( main:2::raster:8 [ raster::col#2 raster::i#2 ] )
  [15] *((const byte*) BORDERCOL#0) ← (byte) raster::col#2 [ raster::i#2 ] ( main:2::raster:8 [ raster::i#2 ] )
  [16] (byte) raster::i#1 ← ++ (byte) raster::i#2 [ raster::i#1 ] ( main:2::raster:8 [ raster::i#1 ] )
  [17] (byte) raster::col#1 ← *((const byte[]) rastercols#0 + (byte) raster::i#1) [ raster::col#1 raster::i#1 ] ( main:2::raster:8 [ raster::col#1 raster::i#1 ] )
  asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop  }
  [19] if((byte) raster::col#1!=(byte/word/signed word/dword/signed dword) 255) goto raster::@1 [ raster::col#1 raster::i#1 ] ( main:2::raster:8 [ raster::col#1 raster::i#1 ] )
  to:raster::@return
raster::@return: scope:[raster]  from raster::@1
  [20] return  [ ] ( main:2::raster:8 [ ] )
  to:@return

DOMINATORS
@begin dominated by  @begin 
@2 dominated by  @2 @begin 
@end dominated by  @2 @begin @end 
main dominated by  @2 @begin main 
main::@2 dominated by  @2 @begin main::@2 main 
main::@3 dominated by  @2 @begin main::@2 main main::@3 
main::@5 dominated by  @2 @begin main::@2 main main::@5 main::@3 
main::@7 dominated by  @2 main::@7 @begin main::@2 main main::@5 main::@3 
main::@return dominated by  main::@return @2 main::@7 @begin main::@2 main main::@5 main::@3 
raster dominated by  @2 @begin raster main::@2 main main::@5 main::@3 
raster::@1 dominated by  @2 @begin raster main::@2 raster::@1 main main::@5 main::@3 
raster::@return dominated by  @2 @begin raster main::@2 raster::@1 raster::@return main main::@5 main::@3 

NATURAL LOOPS
Found back edge: Loop head: main::@2 tails: main::@2 blocks: null
Found back edge: Loop head: main::@3 tails: main::@3 blocks: null
Found back edge: Loop head: main::@2 tails: main::@7 blocks: null
Found back edge: Loop head: raster::@1 tails: raster::@1 blocks: null
Populated: Loop head: main::@2 tails: main::@2 blocks: main::@2 
Populated: Loop head: main::@3 tails: main::@3 blocks: main::@3 
Populated: Loop head: main::@2 tails: main::@7 blocks: main::@7 main::@5 main::@3 main::@2 
Populated: Loop head: raster::@1 tails: raster::@1 blocks: raster::@1 
Loop head: main::@2 tails: main::@2 blocks: main::@2 
Loop head: main::@3 tails: main::@3 blocks: main::@3 
Loop head: main::@2 tails: main::@7 blocks: main::@7 main::@5 main::@3 main::@2 
Loop head: raster::@1 tails: raster::@1 blocks: raster::@1 

NATURAL LOOPS WITH DEPTH
Found 0 loops in scope []
Found 3 loops in scope [main]
  Loop head: main::@2 tails: main::@2 blocks: main::@2 
  Loop head: main::@3 tails: main::@3 blocks: main::@3 
  Loop head: main::@2 tails: main::@7 blocks: main::@7 main::@5 main::@3 main::@2 
Found 1 loops in scope [raster]
  Loop head: raster::@1 tails: raster::@1 blocks: raster::@1 
Loop head: main::@2 tails: main::@2 blocks: main::@2  depth: 2
Loop head: main::@3 tails: main::@3 blocks: main::@3  depth: 2
Loop head: main::@2 tails: main::@7 blocks: main::@7 main::@5 main::@3 main::@2  depth: 1
Loop head: raster::@1 tails: raster::@1 blocks: raster::@1  depth: 2


VARIABLE REGISTER WEIGHTS
(byte*) BGCOL
(byte*) BORDERCOL
(byte*) RASTER
(void()) main()
(void()) raster()
(byte) raster::col
(byte) raster::col#0 4.0
(byte) raster::col#1 101.0
(byte) raster::col#2 152.5
(byte) raster::i
(byte) raster::i#1 75.75
(byte) raster::i#2 67.33333333333333
(byte[]) rastercols

Initial phi equivalence classes
[ raster::col#2 raster::col#0 raster::col#1 ]
[ raster::i#2 raster::i#1 ]
Complete equivalence classes
[ raster::col#2 raster::col#0 raster::col#1 ]
[ raster::i#2 raster::i#1 ]
Allocated zp ZP_BYTE:2 [ raster::col#2 raster::col#0 raster::col#1 ]
Allocated zp ZP_BYTE:3 [ raster::i#2 raster::i#1 ]

INITIAL ASM
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label RASTER = $d012
  .label BORDERCOL = $d020
  .label BGCOL = $d021
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
  jmp b2
//SEG4 @2
b2:
//SEG5 [2] call main param-assignment [ ] ( )
  jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
//SEG7 @end
bend:
//SEG8 main
main: {
  //SEG9 asm { sei  }
    sei
    jmp b2
  //SEG10 main::@2
  b2:
  //SEG11 [5] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto main::@2 [ ] ( main:2 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$a
    bne b2
    jmp b3
  //SEG12 main::@3
  b3:
  //SEG13 [6] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@3 [ ] ( main:2 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$b
    bne b3
  //SEG14 [7] phi from main::@3 to main::@5 [phi:main::@3->main::@5]
  b5_from_b3:
    jmp b5
  //SEG15 main::@5
  b5:
  //SEG16 [8] call raster param-assignment [ ] ( main:2 [ ] )
    jsr raster
    jmp b7
  //SEG17 main::@7
  b7:
  //SEG18 [9] if(true) goto main::@2 [ ] ( main:2 [ ] ) -- true_then_la1 
    jmp b2
    jmp breturn
  //SEG19 main::@return
  breturn:
  //SEG20 [10] return  [ ] ( main:2 [ ] )
    rts
}
//SEG21 raster
raster: {
    .label col = 2
    .label i = 3
  //SEG22 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
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
  //SEG23 [12] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuz1=_deref_pbuc1 
    lda rastercols+0
    sta col
  //SEG24 [13] phi from raster to raster::@1 [phi:raster->raster::@1]
  b1_from_raster:
  //SEG25 [13] phi (byte) raster::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:raster->raster::@1#0] -- vbuz1=vbuc1 
    lda #0
    sta i
  //SEG26 [13] phi (byte) raster::col#2 = (byte) raster::col#0 [phi:raster->raster::@1#1] -- register_copy 
    jmp b1
  //SEG27 [13] phi from raster::@1 to raster::@1 [phi:raster::@1->raster::@1]
  b1_from_b1:
  //SEG28 [13] phi (byte) raster::i#2 = (byte) raster::i#1 [phi:raster::@1->raster::@1#0] -- register_copy 
  //SEG29 [13] phi (byte) raster::col#2 = (byte) raster::col#1 [phi:raster::@1->raster::@1#1] -- register_copy 
    jmp b1
  //SEG30 raster::@1
  b1:
  //SEG31 [14] *((const byte*) BGCOL#0) ← (byte) raster::col#2 [ raster::col#2 raster::i#2 ] ( main:2::raster:8 [ raster::col#2 raster::i#2 ] ) -- _deref_pbuc1=vbuz1 
    lda col
    sta BGCOL
  //SEG32 [15] *((const byte*) BORDERCOL#0) ← (byte) raster::col#2 [ raster::i#2 ] ( main:2::raster:8 [ raster::i#2 ] ) -- _deref_pbuc1=vbuz1 
    lda col
    sta BORDERCOL
  //SEG33 [16] (byte) raster::i#1 ← ++ (byte) raster::i#2 [ raster::i#1 ] ( main:2::raster:8 [ raster::i#1 ] ) -- vbuz1=_inc_vbuz1 
    inc i
  //SEG34 [17] (byte) raster::col#1 ← *((const byte[]) rastercols#0 + (byte) raster::i#1) [ raster::col#1 raster::i#1 ] ( main:2::raster:8 [ raster::col#1 raster::i#1 ] ) -- vbuz1=pbuc1_derefidx_vbuz2 
    ldy i
    lda rastercols,y
    sta col
  //SEG35 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
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
  //SEG36 [19] if((byte) raster::col#1!=(byte/word/signed word/dword/signed dword) 255) goto raster::@1 [ raster::col#1 raster::i#1 ] ( main:2::raster:8 [ raster::col#1 raster::i#1 ] ) -- vbuz1_neq_vbuc1_then_la1 
    lda col
    cmp #$ff
    bne b1_from_b1
    jmp breturn
  //SEG37 raster::@return
  breturn:
  //SEG38 [20] return  [ ] ( main:2::raster:8 [ ] )
    rts
}
  rastercols: .byte $b, 0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, 1, $f, 1, 1, $f, 1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, 0, $b, 0, $ff

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto main::@2 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@3 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ raster::col#2 raster::col#0 raster::col#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:3 [ raster::i#2 raster::i#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [raster] 257.5: zp ZP_BYTE:2 [ raster::col#2 raster::col#0 raster::col#1 ] 143.08: zp ZP_BYTE:3 [ raster::i#2 raster::i#1 ] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [raster] best 9651 combination reg byte a [ raster::col#2 raster::col#0 raster::col#1 ] reg byte x [ raster::i#2 raster::i#1 ] 
Uplifting [main] best 9651 combination 
Uplifting [] best 9651 combination 

ASSEMBLER BEFORE OPTIMIZATION
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label RASTER = $d012
  .label BORDERCOL = $d020
  .label BGCOL = $d021
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
  jmp b2
//SEG4 @2
b2:
//SEG5 [2] call main param-assignment [ ] ( )
  jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
//SEG7 @end
bend:
//SEG8 main
main: {
  //SEG9 asm { sei  }
    sei
    jmp b2
  //SEG10 main::@2
  b2:
  //SEG11 [5] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto main::@2 [ ] ( main:2 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$a
    bne b2
    jmp b3
  //SEG12 main::@3
  b3:
  //SEG13 [6] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@3 [ ] ( main:2 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$b
    bne b3
  //SEG14 [7] phi from main::@3 to main::@5 [phi:main::@3->main::@5]
  b5_from_b3:
    jmp b5
  //SEG15 main::@5
  b5:
  //SEG16 [8] call raster param-assignment [ ] ( main:2 [ ] )
    jsr raster
    jmp b7
  //SEG17 main::@7
  b7:
  //SEG18 [9] if(true) goto main::@2 [ ] ( main:2 [ ] ) -- true_then_la1 
    jmp b2
    jmp breturn
  //SEG19 main::@return
  breturn:
  //SEG20 [10] return  [ ] ( main:2 [ ] )
    rts
}
//SEG21 raster
raster: {
  //SEG22 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
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
  //SEG23 [12] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuaa=_deref_pbuc1 
    lda rastercols+0
  //SEG24 [13] phi from raster to raster::@1 [phi:raster->raster::@1]
  b1_from_raster:
  //SEG25 [13] phi (byte) raster::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:raster->raster::@1#0] -- vbuxx=vbuc1 
    ldx #0
  //SEG26 [13] phi (byte) raster::col#2 = (byte) raster::col#0 [phi:raster->raster::@1#1] -- register_copy 
    jmp b1
  //SEG27 [13] phi from raster::@1 to raster::@1 [phi:raster::@1->raster::@1]
  b1_from_b1:
  //SEG28 [13] phi (byte) raster::i#2 = (byte) raster::i#1 [phi:raster::@1->raster::@1#0] -- register_copy 
  //SEG29 [13] phi (byte) raster::col#2 = (byte) raster::col#1 [phi:raster::@1->raster::@1#1] -- register_copy 
    jmp b1
  //SEG30 raster::@1
  b1:
  //SEG31 [14] *((const byte*) BGCOL#0) ← (byte) raster::col#2 [ raster::col#2 raster::i#2 ] ( main:2::raster:8 [ raster::col#2 raster::i#2 ] ) -- _deref_pbuc1=vbuaa 
    sta BGCOL
  //SEG32 [15] *((const byte*) BORDERCOL#0) ← (byte) raster::col#2 [ raster::i#2 ] ( main:2::raster:8 [ raster::i#2 ] ) -- _deref_pbuc1=vbuaa 
    sta BORDERCOL
  //SEG33 [16] (byte) raster::i#1 ← ++ (byte) raster::i#2 [ raster::i#1 ] ( main:2::raster:8 [ raster::i#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG34 [17] (byte) raster::col#1 ← *((const byte[]) rastercols#0 + (byte) raster::i#1) [ raster::col#1 raster::i#1 ] ( main:2::raster:8 [ raster::col#1 raster::i#1 ] ) -- vbuaa=pbuc1_derefidx_vbuxx 
    lda rastercols,x
  //SEG35 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
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
  //SEG36 [19] if((byte) raster::col#1!=(byte/word/signed word/dword/signed dword) 255) goto raster::@1 [ raster::col#1 raster::i#1 ] ( main:2::raster:8 [ raster::col#1 raster::i#1 ] ) -- vbuaa_neq_vbuc1_then_la1 
    cmp #$ff
    bne b1_from_b1
    jmp breturn
  //SEG37 raster::@return
  breturn:
  //SEG38 [20] return  [ ] ( main:2::raster:8 [ ] )
    rts
}
  rastercols: .byte $b, 0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, 1, $f, 1, 1, $f, 1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, 0, $b, 0, $ff

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp bend
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b5
Removing instruction jmp b7
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b1 with b1
Removing instruction bbegin:
Removing instruction b2_from_bbegin:
Removing instruction bend_from_b2:
Removing instruction b5_from_b3:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b2:
Removing instruction bend:
Removing instruction b5:
Removing instruction b7:
Removing instruction breturn:
Removing instruction b1_from_raster:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing unreachable instruction rts
Succesful ASM optimization Pass5UnreachableCodeElimination
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) 53281
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = ((byte*))(word/dword/signed dword) 53280
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) 53266
(void()) main()
(label) main::@2
(label) main::@3
(label) main::@5
(label) main::@7
(label) main::@return
(void()) raster()
(label) raster::@1
(label) raster::@return
(byte) raster::col
(byte) raster::col#0 reg byte a 4.0
(byte) raster::col#1 reg byte a 101.0
(byte) raster::col#2 reg byte a 152.5
(byte) raster::i
(byte) raster::i#1 reg byte x 75.75
(byte) raster::i#2 reg byte x 67.33333333333333
(byte[]) rastercols
(const byte[]) rastercols#0 rastercols = { (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (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) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/word/signed word/dword/signed dword) 255 }

reg byte a [ raster::col#2 raster::col#0 raster::col#1 ]
reg byte x [ raster::i#2 raster::i#1 ]


FINAL ASSEMBLER
Score: 8346

//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label RASTER = $d012
  .label BORDERCOL = $d020
  .label BGCOL = $d021
//SEG2 @begin
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
//SEG4 @2
//SEG5 [2] call main param-assignment [ ] ( )
  jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
//SEG7 @end
//SEG8 main
main: {
  //SEG9 asm { sei  }
    sei
  //SEG10 main::@2
  b2:
  //SEG11 [5] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto main::@2 [ ] ( main:2 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$a
    bne b2
  //SEG12 main::@3
  b3:
  //SEG13 [6] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@3 [ ] ( main:2 [ ] ) -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$b
    bne b3
  //SEG14 [7] phi from main::@3 to main::@5 [phi:main::@3->main::@5]
  //SEG15 main::@5
  //SEG16 [8] call raster param-assignment [ ] ( main:2 [ ] )
    jsr raster
  //SEG17 main::@7
  //SEG18 [9] if(true) goto main::@2 [ ] ( main:2 [ ] ) -- true_then_la1 
    jmp b2
  //SEG19 main::@return
  //SEG20 [10] return  [ ] ( main:2 [ ] )
}
//SEG21 raster
raster: {
  //SEG22 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
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
  //SEG23 [12] (byte) raster::col#0 ← *((const byte[]) rastercols#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ raster::col#0 ] ( main:2::raster:8 [ raster::col#0 ] ) -- vbuaa=_deref_pbuc1 
    lda rastercols+0
  //SEG24 [13] phi from raster to raster::@1 [phi:raster->raster::@1]
  //SEG25 [13] phi (byte) raster::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:raster->raster::@1#0] -- vbuxx=vbuc1 
    ldx #0
  //SEG26 [13] phi (byte) raster::col#2 = (byte) raster::col#0 [phi:raster->raster::@1#1] -- register_copy 
  //SEG27 [13] phi from raster::@1 to raster::@1 [phi:raster::@1->raster::@1]
  //SEG28 [13] phi (byte) raster::i#2 = (byte) raster::i#1 [phi:raster::@1->raster::@1#0] -- register_copy 
  //SEG29 [13] phi (byte) raster::col#2 = (byte) raster::col#1 [phi:raster::@1->raster::@1#1] -- register_copy 
  //SEG30 raster::@1
  b1:
  //SEG31 [14] *((const byte*) BGCOL#0) ← (byte) raster::col#2 [ raster::col#2 raster::i#2 ] ( main:2::raster:8 [ raster::col#2 raster::i#2 ] ) -- _deref_pbuc1=vbuaa 
    sta BGCOL
  //SEG32 [15] *((const byte*) BORDERCOL#0) ← (byte) raster::col#2 [ raster::i#2 ] ( main:2::raster:8 [ raster::i#2 ] ) -- _deref_pbuc1=vbuaa 
    sta BORDERCOL
  //SEG33 [16] (byte) raster::i#1 ← ++ (byte) raster::i#2 [ raster::i#1 ] ( main:2::raster:8 [ raster::i#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG34 [17] (byte) raster::col#1 ← *((const byte[]) rastercols#0 + (byte) raster::i#1) [ raster::col#1 raster::i#1 ] ( main:2::raster:8 [ raster::col#1 raster::i#1 ] ) -- vbuaa=pbuc1_derefidx_vbuxx 
    lda rastercols,x
  //SEG35 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
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
  //SEG36 [19] if((byte) raster::col#1!=(byte/word/signed word/dword/signed dword) 255) goto raster::@1 [ raster::col#1 raster::i#1 ] ( main:2::raster:8 [ raster::col#1 raster::i#1 ] ) -- vbuaa_neq_vbuc1_then_la1 
    cmp #$ff
    bne b1
  //SEG37 raster::@return
  //SEG38 [20] return  [ ] ( main:2::raster:8 [ ] )
    rts
}
  rastercols: .byte $b, 0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, 1, $f, 1, 1, $f, 1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, 0, $b, 0, $ff

