PARSING src/test/java/dk/camelot64/kickc/test/kc/ptrtest.kc
// Test all types of pointers

void main() {
  lvalue();
  rvalue();
  rvaluevar();
  lvaluevar();
}

void lvalue() {

  // A constant pointer
  byte[1024] SCREEN = $0400;

  // LValue constant pointer dereference
  *SCREEN = 1;

  // LValue constant array constant indexing
  SCREEN[1] = 2;

  // LValue constant array variable indexing
  byte i=2;
  while(i<10) {
    SCREEN[i++] = 3;
  }
}

void rvalue() {

  // A constant pointer
  byte[1024] SCREEN = $0400;

  // RValue constant pointer
  byte b = *SCREEN;

  // RValue constant array pointer constant index
  b = SCREEN[1];

  // RValue constant array variable index
  byte i=2;
  while(i<10) {
    b = SCREEN[i++];
  }
}

void lvaluevar() {
  byte *screen = $0400;

  // LValue Variable pointer dereference
  byte b=4;
  byte i=2;
  while(i<10) {
    *screen = b;
    screen++;
    i++;
  }

}

void rvaluevar() {
  byte *screen = $0400;

  // RValue Variable pointer dereference
  byte b;
  byte i=2;
  while(i<10) {
    b = *screen;
    screen++;
    i++;
  }

}


Adding pre/post-modifier (byte) lvalue::i ← ++ (byte) lvalue::i
Adding pre/post-modifier (byte) rvalue::i ← ++ (byte) rvalue::i
Adding pre/post-modifier (byte*) lvaluevar::screen ← ++ (byte*) lvaluevar::screen
Adding pre/post-modifier (byte) lvaluevar::i ← ++ (byte) lvaluevar::i
Adding pre/post-modifier (byte*) rvaluevar::screen ← ++ (byte*) rvaluevar::screen
Adding pre/post-modifier (byte) rvaluevar::i ← ++ (byte) rvaluevar::i

STATEMENTS
proc (void()) main()
  (void~) main::$0 ← call lvalue 
  (void~) main::$1 ← call rvalue 
  (void~) main::$2 ← call rvaluevar 
  (void~) main::$3 ← call lvaluevar 
main::@return:
  return 
endproc // main()
proc (void()) lvalue()
  (byte[1024]) lvalue::SCREEN ← (word/signed word/dword/signed dword) 1024
  *((byte[1024]) lvalue::SCREEN) ← (byte/signed byte/word/signed word/dword/signed dword) 1
  *((byte[1024]) lvalue::SCREEN + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) lvalue::i ← (byte/signed byte/word/signed word/dword/signed dword) 2
lvalue::@1:
  (boolean~) lvalue::$0 ← (byte) lvalue::i < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) lvalue::$0) goto lvalue::@2
  goto lvalue::@3
lvalue::@2:
  *((byte[1024]) lvalue::SCREEN + (byte) lvalue::i) ← (byte/signed byte/word/signed word/dword/signed dword) 3
  (byte) lvalue::i ← ++ (byte) lvalue::i
  goto lvalue::@1
lvalue::@3:
lvalue::@return:
  return 
endproc // lvalue()
proc (void()) rvalue()
  (byte[1024]) rvalue::SCREEN ← (word/signed word/dword/signed dword) 1024
  (byte) rvalue::b ← *((byte[1024]) rvalue::SCREEN)
  (byte) rvalue::b ← *((byte[1024]) rvalue::SCREEN + (byte/signed byte/word/signed word/dword/signed dword) 1)
  (byte) rvalue::i ← (byte/signed byte/word/signed word/dword/signed dword) 2
rvalue::@1:
  (boolean~) rvalue::$0 ← (byte) rvalue::i < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) rvalue::$0) goto rvalue::@2
  goto rvalue::@3
rvalue::@2:
  (byte) rvalue::b ← *((byte[1024]) rvalue::SCREEN + (byte) rvalue::i)
  (byte) rvalue::i ← ++ (byte) rvalue::i
  goto rvalue::@1
rvalue::@3:
rvalue::@return:
  return 
endproc // rvalue()
proc (void()) lvaluevar()
  (byte*) lvaluevar::screen ← (word/signed word/dword/signed dword) 1024
  (byte) lvaluevar::b ← (byte/signed byte/word/signed word/dword/signed dword) 4
  (byte) lvaluevar::i ← (byte/signed byte/word/signed word/dword/signed dword) 2
lvaluevar::@1:
  (boolean~) lvaluevar::$0 ← (byte) lvaluevar::i < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) lvaluevar::$0) goto lvaluevar::@2
  goto lvaluevar::@3
lvaluevar::@2:
  *((byte*) lvaluevar::screen) ← (byte) lvaluevar::b
  (byte*) lvaluevar::screen ← ++ (byte*) lvaluevar::screen
  (byte) lvaluevar::i ← ++ (byte) lvaluevar::i
  goto lvaluevar::@1
lvaluevar::@3:
lvaluevar::@return:
  return 
endproc // lvaluevar()
proc (void()) rvaluevar()
  (byte*) rvaluevar::screen ← (word/signed word/dword/signed dword) 1024
  (byte) rvaluevar::i ← (byte/signed byte/word/signed word/dword/signed dword) 2
rvaluevar::@1:
  (boolean~) rvaluevar::$0 ← (byte) rvaluevar::i < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) rvaluevar::$0) goto rvaluevar::@2
  goto rvaluevar::@3
rvaluevar::@2:
  (byte) rvaluevar::b ← *((byte*) rvaluevar::screen)
  (byte*) rvaluevar::screen ← ++ (byte*) rvaluevar::screen
  (byte) rvaluevar::i ← ++ (byte) rvaluevar::i
  goto rvaluevar::@1
rvaluevar::@3:
rvaluevar::@return:
  return 
endproc // rvaluevar()
  call main 

SYMBOLS
(void()) lvalue()
(boolean~) lvalue::$0
(label) lvalue::@1
(label) lvalue::@2
(label) lvalue::@3
(label) lvalue::@return
(byte[1024]) lvalue::SCREEN
(byte) lvalue::i
(void()) lvaluevar()
(boolean~) lvaluevar::$0
(label) lvaluevar::@1
(label) lvaluevar::@2
(label) lvaluevar::@3
(label) lvaluevar::@return
(byte) lvaluevar::b
(byte) lvaluevar::i
(byte*) lvaluevar::screen
(void()) main()
(void~) main::$0
(void~) main::$1
(void~) main::$2
(void~) main::$3
(label) main::@return
(void()) rvalue()
(boolean~) rvalue::$0
(label) rvalue::@1
(label) rvalue::@2
(label) rvalue::@3
(label) rvalue::@return
(byte[1024]) rvalue::SCREEN
(byte) rvalue::b
(byte) rvalue::i
(void()) rvaluevar()
(boolean~) rvaluevar::$0
(label) rvaluevar::@1
(label) rvaluevar::@2
(label) rvaluevar::@3
(label) rvaluevar::@return
(byte) rvaluevar::b
(byte) rvaluevar::i
(byte*) rvaluevar::screen

Promoting word/signed word/dword/signed dword to byte[1024] in lvalue::SCREEN ← ((byte*)) 1024
Promoting word/signed word/dword/signed dword to byte[1024] in rvalue::SCREEN ← ((byte*)) 1024
Promoting word/signed word/dword/signed dword to byte* in lvaluevar::screen ← ((byte*)) 1024
Promoting word/signed word/dword/signed dword to byte* in rvaluevar::screen ← ((byte*)) 1024
INITIAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  to:@1
main: scope:[main]  from
  (void~) main::$0 ← call lvalue 
  (void~) main::$1 ← call rvalue 
  (void~) main::$2 ← call rvaluevar 
  (void~) main::$3 ← call lvaluevar 
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return
@1: scope:[]  from @begin
  to:@2
lvalue: scope:[lvalue]  from
  (byte[1024]) lvalue::SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024
  *((byte[1024]) lvalue::SCREEN) ← (byte/signed byte/word/signed word/dword/signed dword) 1
  *((byte[1024]) lvalue::SCREEN + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) lvalue::i ← (byte/signed byte/word/signed word/dword/signed dword) 2
  to:lvalue::@1
lvalue::@1: scope:[lvalue]  from lvalue lvalue::@2
  (boolean~) lvalue::$0 ← (byte) lvalue::i < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) lvalue::$0) goto lvalue::@2
  to:lvalue::@4
lvalue::@2: scope:[lvalue]  from lvalue::@1 lvalue::@5
  *((byte[1024]) lvalue::SCREEN + (byte) lvalue::i) ← (byte/signed byte/word/signed word/dword/signed dword) 3
  (byte) lvalue::i ← ++ (byte) lvalue::i
  to:lvalue::@1
lvalue::@4: scope:[lvalue]  from lvalue::@1
  to:lvalue::@3
lvalue::@3: scope:[lvalue]  from lvalue::@4 lvalue::@6
  to:lvalue::@return
lvalue::@5: scope:[lvalue]  from
  to:lvalue::@2
lvalue::@6: scope:[lvalue]  from
  to:lvalue::@3
lvalue::@return: scope:[lvalue]  from lvalue::@3
  return 
  to:@return
@2: scope:[]  from @1
  to:@3
rvalue: scope:[rvalue]  from
  (byte[1024]) rvalue::SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte) rvalue::b ← *((byte[1024]) rvalue::SCREEN)
  (byte) rvalue::b ← *((byte[1024]) rvalue::SCREEN + (byte/signed byte/word/signed word/dword/signed dword) 1)
  (byte) rvalue::i ← (byte/signed byte/word/signed word/dword/signed dword) 2
  to:rvalue::@1
rvalue::@1: scope:[rvalue]  from rvalue rvalue::@2
  (boolean~) rvalue::$0 ← (byte) rvalue::i < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) rvalue::$0) goto rvalue::@2
  to:rvalue::@4
rvalue::@2: scope:[rvalue]  from rvalue::@1 rvalue::@5
  (byte) rvalue::b ← *((byte[1024]) rvalue::SCREEN + (byte) rvalue::i)
  (byte) rvalue::i ← ++ (byte) rvalue::i
  to:rvalue::@1
rvalue::@4: scope:[rvalue]  from rvalue::@1
  to:rvalue::@3
rvalue::@3: scope:[rvalue]  from rvalue::@4 rvalue::@6
  to:rvalue::@return
rvalue::@5: scope:[rvalue]  from
  to:rvalue::@2
rvalue::@6: scope:[rvalue]  from
  to:rvalue::@3
rvalue::@return: scope:[rvalue]  from rvalue::@3
  return 
  to:@return
@3: scope:[]  from @2
  to:@4
lvaluevar: scope:[lvaluevar]  from
  (byte*) lvaluevar::screen ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte) lvaluevar::b ← (byte/signed byte/word/signed word/dword/signed dword) 4
  (byte) lvaluevar::i ← (byte/signed byte/word/signed word/dword/signed dword) 2
  to:lvaluevar::@1
lvaluevar::@1: scope:[lvaluevar]  from lvaluevar lvaluevar::@2
  (boolean~) lvaluevar::$0 ← (byte) lvaluevar::i < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) lvaluevar::$0) goto lvaluevar::@2
  to:lvaluevar::@4
lvaluevar::@2: scope:[lvaluevar]  from lvaluevar::@1 lvaluevar::@5
  *((byte*) lvaluevar::screen) ← (byte) lvaluevar::b
  (byte*) lvaluevar::screen ← ++ (byte*) lvaluevar::screen
  (byte) lvaluevar::i ← ++ (byte) lvaluevar::i
  to:lvaluevar::@1
lvaluevar::@4: scope:[lvaluevar]  from lvaluevar::@1
  to:lvaluevar::@3
lvaluevar::@3: scope:[lvaluevar]  from lvaluevar::@4 lvaluevar::@6
  to:lvaluevar::@return
lvaluevar::@5: scope:[lvaluevar]  from
  to:lvaluevar::@2
lvaluevar::@6: scope:[lvaluevar]  from
  to:lvaluevar::@3
lvaluevar::@return: scope:[lvaluevar]  from lvaluevar::@3
  return 
  to:@return
@4: scope:[]  from @3
  to:@5
rvaluevar: scope:[rvaluevar]  from
  (byte*) rvaluevar::screen ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte) rvaluevar::i ← (byte/signed byte/word/signed word/dword/signed dword) 2
  to:rvaluevar::@1
rvaluevar::@1: scope:[rvaluevar]  from rvaluevar rvaluevar::@2
  (boolean~) rvaluevar::$0 ← (byte) rvaluevar::i < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) rvaluevar::$0) goto rvaluevar::@2
  to:rvaluevar::@4
rvaluevar::@2: scope:[rvaluevar]  from rvaluevar::@1 rvaluevar::@5
  (byte) rvaluevar::b ← *((byte*) rvaluevar::screen)
  (byte*) rvaluevar::screen ← ++ (byte*) rvaluevar::screen
  (byte) rvaluevar::i ← ++ (byte) rvaluevar::i
  to:rvaluevar::@1
rvaluevar::@4: scope:[rvaluevar]  from rvaluevar::@1
  to:rvaluevar::@3
rvaluevar::@3: scope:[rvaluevar]  from rvaluevar::@4 rvaluevar::@6
  to:rvaluevar::@return
rvaluevar::@5: scope:[rvaluevar]  from
  to:rvaluevar::@2
rvaluevar::@6: scope:[rvaluevar]  from
  to:rvaluevar::@3
rvaluevar::@return: scope:[rvaluevar]  from rvaluevar::@3
  return 
  to:@return
@5: scope:[]  from @4
  call main 
  to:@end
@end: scope:[]  from @5

Eliminating unused variable - keeping the call (void~) main::$0
Eliminating unused variable - keeping the call (void~) main::$1
Eliminating unused variable - keeping the call (void~) main::$2
Eliminating unused variable - keeping the call (void~) main::$3
Eliminating unused variable (byte) rvaluevar::b and assignment [36] (byte) rvaluevar::b ← *((byte*) rvaluevar::screen)
Removing empty block @1
Removing empty block lvalue::@4
Removing empty block lvalue::@3
Removing empty block lvalue::@5
Removing empty block lvalue::@6
Removing empty block @2
Removing empty block rvalue::@4
Removing empty block rvalue::@3
Removing empty block rvalue::@5
Removing empty block rvalue::@6
Removing empty block @3
Removing empty block lvaluevar::@4
Removing empty block lvaluevar::@3
Removing empty block lvaluevar::@5
Removing empty block lvaluevar::@6
Removing empty block @4
Removing empty block rvaluevar::@4
Removing empty block rvaluevar::@3
Removing empty block rvaluevar::@5
Removing empty block rvaluevar::@6
PROCEDURE MODIFY VARIABLE ANALYSIS

Completing Phi functions...
Completing Phi functions...

CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
@begin: scope:[]  from
  to:@5
main: scope:[main]  from @5
  call lvalue param-assignment
  to:main::@1
main::@1: scope:[main]  from main
  call rvalue param-assignment
  to:main::@2
main::@2: scope:[main]  from main::@1
  call rvaluevar param-assignment
  to:main::@3
main::@3: scope:[main]  from main::@2
  call lvaluevar param-assignment
  to:main::@4
main::@4: scope:[main]  from main::@3
  to:main::@return
main::@return: scope:[main]  from main::@4
  return 
  to:@return
lvalue: scope:[lvalue]  from main
  (byte[1024]) lvalue::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  *((byte[1024]) lvalue::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1
  *((byte[1024]) lvalue::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2
  (byte) lvalue::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
  to:lvalue::@1
lvalue::@1: scope:[lvalue]  from lvalue lvalue::@2
  (byte) lvalue::i#2 ← phi( lvalue/(byte) lvalue::i#0 lvalue::@2/(byte) lvalue::i#1 )
  (boolean~) lvalue::$0 ← (byte) lvalue::i#2 < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) lvalue::$0) goto lvalue::@2
  to:lvalue::@return
lvalue::@2: scope:[lvalue]  from lvalue::@1
  (byte) lvalue::i#3 ← phi( lvalue::@1/(byte) lvalue::i#2 )
  *((byte[1024]) lvalue::SCREEN#0 + (byte) lvalue::i#3) ← (byte/signed byte/word/signed word/dword/signed dword) 3
  (byte) lvalue::i#1 ← ++ (byte) lvalue::i#3
  to:lvalue::@1
lvalue::@return: scope:[lvalue]  from lvalue::@1
  return 
  to:@return
rvalue: scope:[rvalue]  from main::@1
  (byte[1024]) rvalue::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte) rvalue::b#0 ← *((byte[1024]) rvalue::SCREEN#0)
  (byte) rvalue::b#1 ← *((byte[1024]) rvalue::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)
  (byte) rvalue::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
  to:rvalue::@1
rvalue::@1: scope:[rvalue]  from rvalue rvalue::@2
  (byte) rvalue::i#2 ← phi( rvalue/(byte) rvalue::i#0 rvalue::@2/(byte) rvalue::i#1 )
  (boolean~) rvalue::$0 ← (byte) rvalue::i#2 < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) rvalue::$0) goto rvalue::@2
  to:rvalue::@return
rvalue::@2: scope:[rvalue]  from rvalue::@1
  (byte) rvalue::i#3 ← phi( rvalue::@1/(byte) rvalue::i#2 )
  (byte) rvalue::b#2 ← *((byte[1024]) rvalue::SCREEN#0 + (byte) rvalue::i#3)
  (byte) rvalue::i#1 ← ++ (byte) rvalue::i#3
  to:rvalue::@1
rvalue::@return: scope:[rvalue]  from rvalue::@1
  return 
  to:@return
lvaluevar: scope:[lvaluevar]  from main::@3
  (byte*) lvaluevar::screen#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte) lvaluevar::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
  (byte) lvaluevar::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
  to:lvaluevar::@1
lvaluevar::@1: scope:[lvaluevar]  from lvaluevar lvaluevar::@2
  (byte*) lvaluevar::screen#3 ← phi( lvaluevar/(byte*) lvaluevar::screen#0 lvaluevar::@2/(byte*) lvaluevar::screen#1 )
  (byte) lvaluevar::b#2 ← phi( lvaluevar/(byte) lvaluevar::b#0 lvaluevar::@2/(byte) lvaluevar::b#1 )
  (byte) lvaluevar::i#2 ← phi( lvaluevar/(byte) lvaluevar::i#0 lvaluevar::@2/(byte) lvaluevar::i#1 )
  (boolean~) lvaluevar::$0 ← (byte) lvaluevar::i#2 < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) lvaluevar::$0) goto lvaluevar::@2
  to:lvaluevar::@return
lvaluevar::@2: scope:[lvaluevar]  from lvaluevar::@1
  (byte) lvaluevar::i#3 ← phi( lvaluevar::@1/(byte) lvaluevar::i#2 )
  (byte*) lvaluevar::screen#2 ← phi( lvaluevar::@1/(byte*) lvaluevar::screen#3 )
  (byte) lvaluevar::b#1 ← phi( lvaluevar::@1/(byte) lvaluevar::b#2 )
  *((byte*) lvaluevar::screen#2) ← (byte) lvaluevar::b#1
  (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2
  (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#3
  to:lvaluevar::@1
lvaluevar::@return: scope:[lvaluevar]  from lvaluevar::@1
  return 
  to:@return
rvaluevar: scope:[rvaluevar]  from main::@2
  (byte*) rvaluevar::screen#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte) rvaluevar::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
  to:rvaluevar::@1
rvaluevar::@1: scope:[rvaluevar]  from rvaluevar rvaluevar::@2
  (byte*) rvaluevar::screen#3 ← phi( rvaluevar/(byte*) rvaluevar::screen#0 rvaluevar::@2/(byte*) rvaluevar::screen#1 )
  (byte) rvaluevar::i#2 ← phi( rvaluevar/(byte) rvaluevar::i#0 rvaluevar::@2/(byte) rvaluevar::i#1 )
  (boolean~) rvaluevar::$0 ← (byte) rvaluevar::i#2 < (byte/signed byte/word/signed word/dword/signed dword) 10
  if((boolean~) rvaluevar::$0) goto rvaluevar::@2
  to:rvaluevar::@return
rvaluevar::@2: scope:[rvaluevar]  from rvaluevar::@1
  (byte) rvaluevar::i#3 ← phi( rvaluevar::@1/(byte) rvaluevar::i#2 )
  (byte*) rvaluevar::screen#2 ← phi( rvaluevar::@1/(byte*) rvaluevar::screen#3 )
  (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2
  (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#3
  to:rvaluevar::@1
rvaluevar::@return: scope:[rvaluevar]  from rvaluevar::@1
  return 
  to:@return
@5: scope:[]  from @begin
  call main param-assignment
  to:@6
@6: scope:[]  from @5
  to:@end
@end: scope:[]  from @6

SYMBOL TABLE SSA
(label) @5
(label) @6
(label) @begin
(label) @end
(void()) lvalue()
(boolean~) lvalue::$0
(label) lvalue::@1
(label) lvalue::@2
(label) lvalue::@return
(byte[1024]) lvalue::SCREEN
(byte[1024]) lvalue::SCREEN#0
(byte) lvalue::i
(byte) lvalue::i#0
(byte) lvalue::i#1
(byte) lvalue::i#2
(byte) lvalue::i#3
(void()) lvaluevar()
(boolean~) lvaluevar::$0
(label) lvaluevar::@1
(label) lvaluevar::@2
(label) lvaluevar::@return
(byte) lvaluevar::b
(byte) lvaluevar::b#0
(byte) lvaluevar::b#1
(byte) lvaluevar::b#2
(byte) lvaluevar::i
(byte) lvaluevar::i#0
(byte) lvaluevar::i#1
(byte) lvaluevar::i#2
(byte) lvaluevar::i#3
(byte*) lvaluevar::screen
(byte*) lvaluevar::screen#0
(byte*) lvaluevar::screen#1
(byte*) lvaluevar::screen#2
(byte*) lvaluevar::screen#3
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@return
(void()) rvalue()
(boolean~) rvalue::$0
(label) rvalue::@1
(label) rvalue::@2
(label) rvalue::@return
(byte[1024]) rvalue::SCREEN
(byte[1024]) rvalue::SCREEN#0
(byte) rvalue::b
(byte) rvalue::b#0
(byte) rvalue::b#1
(byte) rvalue::b#2
(byte) rvalue::i
(byte) rvalue::i#0
(byte) rvalue::i#1
(byte) rvalue::i#2
(byte) rvalue::i#3
(void()) rvaluevar()
(boolean~) rvaluevar::$0
(label) rvaluevar::@1
(label) rvaluevar::@2
(label) rvaluevar::@return
(byte) rvaluevar::i
(byte) rvaluevar::i#0
(byte) rvaluevar::i#1
(byte) rvaluevar::i#2
(byte) rvaluevar::i#3
(byte*) rvaluevar::screen
(byte*) rvaluevar::screen#0
(byte*) rvaluevar::screen#1
(byte*) rvaluevar::screen#2
(byte*) rvaluevar::screen#3

OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) main::@4
Culled Empty Block (label) @6
Succesful SSA optimization Pass2CullEmptyBlocks
Alias (byte) lvalue::i#2 = (byte) lvalue::i#3 
Alias (byte) rvalue::i#2 = (byte) rvalue::i#3 
Alias (byte) lvaluevar::b#1 = (byte) lvaluevar::b#2 
Alias (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#3 
Alias (byte) lvaluevar::i#2 = (byte) lvaluevar::i#3 
Alias (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#3 
Alias (byte) rvaluevar::i#2 = (byte) rvaluevar::i#3 
Succesful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) lvaluevar::b#1
Succesful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte) lvaluevar::b#1 (byte) lvaluevar::b#0
Succesful SSA optimization Pass2RedundantPhiElimination
Simple Condition (boolean~) lvalue::$0 if((byte) lvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvalue::@2
Simple Condition (boolean~) rvalue::$0 if((byte) rvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvalue::@2
Simple Condition (boolean~) lvaluevar::$0 if((byte) lvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvaluevar::@2
Simple Condition (boolean~) rvaluevar::$0 if((byte) rvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvaluevar::@2
Succesful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) lvalue::SCREEN#0 = ((byte*))1024
Constant (const byte) lvalue::i#0 = 2
Constant (const byte*) rvalue::SCREEN#0 = ((byte*))1024
Constant (const byte) rvalue::i#0 = 2
Constant (const byte*) lvaluevar::screen#0 = ((byte*))1024
Constant (const byte) lvaluevar::b#0 = 4
Constant (const byte) lvaluevar::i#0 = 2
Constant (const byte*) rvaluevar::screen#0 = ((byte*))1024
Constant (const byte) rvaluevar::i#0 = 2
Succesful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(lvalue::SCREEN#0+1)
Consolidated array index constant in *(rvalue::SCREEN#0+1)
Succesful SSA optimization Pass2ConstantAdditionElimination
Eliminating unused variable (byte) rvalue::b#0 and assignment [12] (byte) rvalue::b#0 ← *((const byte*) rvalue::SCREEN#0)
Eliminating unused variable (byte) rvalue::b#1 and assignment [13] (byte) rvalue::b#1 ← *((const byte*) rvalue::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1)
Eliminating unused variable (byte) rvalue::b#2 and assignment [16] (byte) rvalue::b#2 ← *((const byte*) rvalue::SCREEN#0 + (byte) rvalue::i#2)
Succesful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte*) rvalue::SCREEN#0
Succesful SSA optimization PassNEliminateUnusedVars
OPTIMIZING CONTROL FLOW GRAPH
Inlining constant with var siblings (const byte) lvalue::i#0
Inlining constant with var siblings (const byte) lvalue::i#0
Inlining constant with var siblings (const byte) rvalue::i#0
Inlining constant with var siblings (const byte) rvalue::i#0
Inlining constant with var siblings (const byte*) lvaluevar::screen#0
Inlining constant with var siblings (const byte*) lvaluevar::screen#0
Inlining constant with var siblings (const byte) lvaluevar::i#0
Inlining constant with var siblings (const byte) lvaluevar::i#0
Inlining constant with var siblings (const byte*) rvaluevar::screen#0
Inlining constant with var siblings (const byte*) rvaluevar::screen#0
Inlining constant with var siblings (const byte) rvaluevar::i#0
Inlining constant with var siblings (const byte) rvaluevar::i#0
Constant inlined lvalue::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined rvaluevar::screen#0 = ((byte*))(word/signed word/dword/signed dword) 1024
Constant inlined rvalue::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined lvaluevar::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined lvaluevar::screen#0 = ((byte*))(word/signed word/dword/signed dword) 1024
Constant inlined rvaluevar::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 2
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @5 @end main main::@1 main::@2 main::@3 main::@return lvaluevar lvaluevar::@1 lvaluevar::@return lvaluevar::@2 rvaluevar rvaluevar::@1 rvaluevar::@return rvaluevar::@2 rvalue rvalue::@1 rvalue::@return rvalue::@2 lvalue lvalue::@1 lvalue::@return lvalue::@2 
Block Sequence Planned @begin @5 @end main main::@1 main::@2 main::@3 main::@return lvaluevar lvaluevar::@1 lvaluevar::@return lvaluevar::@2 rvaluevar rvaluevar::@1 rvaluevar::@return rvaluevar::@2 rvalue rvalue::@1 rvalue::@return rvalue::@2 lvalue lvalue::@1 lvalue::@return lvalue::@2 
Adding NOP phi() at start of @begin
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 lvaluevar
Adding NOP phi() at start of rvaluevar
Adding NOP phi() at start of rvalue
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to lvalue:5 rvalue:7 rvaluevar:9 lvaluevar:11 

Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Created 6 initial phi equivalence classes
Coalesced [20] lvaluevar::i#4 ← lvaluevar::i#1
Coalesced [21] lvaluevar::screen#4 ← lvaluevar::screen#1
Coalesced [28] rvaluevar::i#4 ← rvaluevar::i#1
Coalesced [29] rvaluevar::screen#4 ← rvaluevar::screen#1
Coalesced [35] rvalue::i#4 ← rvalue::i#1
Coalesced [43] lvalue::i#4 ← lvalue::i#1
Coalesced down to 6 phi equivalence classes
Block Sequence Planned @begin @5 @end main main::@1 main::@2 main::@3 main::@return lvaluevar lvaluevar::@1 lvaluevar::@return lvaluevar::@2 rvaluevar rvaluevar::@1 rvaluevar::@return rvaluevar::@2 rvalue rvalue::@1 rvalue::@return rvalue::@2 lvalue lvalue::@1 lvalue::@return lvalue::@2 
Adding NOP phi() at start of @begin
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 lvaluevar
Adding NOP phi() at start of rvaluevar
Adding NOP phi() at start of rvalue
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi() [ ] ( )
  to:@5
@5: scope:[]  from @begin
  [1] phi() [ ] ( )
  [2] call main param-assignment [ ] ( )
  to:@end
@end: scope:[]  from @5
  [3] phi() [ ] ( )
main: scope:[main]  from @5
  [4] phi() [ ] ( main:2 [ ] )
  [5] call lvalue param-assignment [ ] ( main:2 [ ] )
  to:main::@1
main::@1: scope:[main]  from main
  [6] phi() [ ] ( main:2 [ ] )
  [7] call rvalue param-assignment [ ] ( main:2 [ ] )
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] phi() [ ] ( main:2 [ ] )
  [9] call rvaluevar param-assignment [ ] ( main:2 [ ] )
  to:main::@3
main::@3: scope:[main]  from main::@2
  [10] phi() [ ] ( main:2 [ ] )
  [11] call lvaluevar param-assignment [ ] ( main:2 [ ] )
  to:main::@return
main::@return: scope:[main]  from main::@3
  [12] return  [ ] ( main:2 [ ] )
  to:@return
lvaluevar: scope:[lvaluevar]  from main::@3
  [13] phi() [ ] ( main:2::lvaluevar:11 [ ] )
  to:lvaluevar::@1
lvaluevar::@1: scope:[lvaluevar]  from lvaluevar lvaluevar::@2
  [14] (byte*) lvaluevar::screen#2 ← phi( lvaluevar/((byte*))(word/signed word/dword/signed dword) 1024 lvaluevar::@2/(byte*) lvaluevar::screen#1 ) [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] )
  [14] (byte) lvaluevar::i#2 ← phi( lvaluevar/(byte/signed byte/word/signed word/dword/signed dword) 2 lvaluevar::@2/(byte) lvaluevar::i#1 ) [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] )
  [15] if((byte) lvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvaluevar::@2 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] )
  to:lvaluevar::@return
lvaluevar::@return: scope:[lvaluevar]  from lvaluevar::@1
  [16] return  [ ] ( main:2::lvaluevar:11 [ ] )
  to:@return
lvaluevar::@2: scope:[lvaluevar]  from lvaluevar::@1
  [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] )
  [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [ lvaluevar::i#2 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#1 ] )
  [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 [ lvaluevar::i#1 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#1 lvaluevar::screen#1 ] )
  to:lvaluevar::@1
rvaluevar: scope:[rvaluevar]  from main::@2
  [20] phi() [ ] ( main:2::rvaluevar:9 [ ] )
  to:rvaluevar::@1
rvaluevar::@1: scope:[rvaluevar]  from rvaluevar rvaluevar::@2
  [21] (byte*) rvaluevar::screen#2 ← phi( rvaluevar/((byte*))(word/signed word/dword/signed dword) 1024 rvaluevar::@2/(byte*) rvaluevar::screen#1 ) [ rvaluevar::i#2 rvaluevar::screen#2 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 ] )
  [21] (byte) rvaluevar::i#2 ← phi( rvaluevar/(byte/signed byte/word/signed word/dword/signed dword) 2 rvaluevar::@2/(byte) rvaluevar::i#1 ) [ rvaluevar::i#2 rvaluevar::screen#2 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 ] )
  [22] if((byte) rvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvaluevar::@2 [ rvaluevar::i#2 rvaluevar::screen#2 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 ] )
  to:rvaluevar::@return
rvaluevar::@return: scope:[rvaluevar]  from rvaluevar::@1
  [23] return  [ ] ( main:2::rvaluevar:9 [ ] )
  to:@return
rvaluevar::@2: scope:[rvaluevar]  from rvaluevar::@1
  [24] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#1 ] )
  [25] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 [ rvaluevar::i#1 rvaluevar::screen#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#1 rvaluevar::screen#1 ] )
  to:rvaluevar::@1
rvalue: scope:[rvalue]  from main::@1
  [26] phi() [ ] ( main:2::rvalue:7 [ ] )
  to:rvalue::@1
rvalue::@1: scope:[rvalue]  from rvalue rvalue::@2
  [27] (byte) rvalue::i#2 ← phi( rvalue/(byte/signed byte/word/signed word/dword/signed dword) 2 rvalue::@2/(byte) rvalue::i#1 ) [ rvalue::i#2 ] ( main:2::rvalue:7 [ rvalue::i#2 ] )
  [28] if((byte) rvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvalue::@2 [ rvalue::i#2 ] ( main:2::rvalue:7 [ rvalue::i#2 ] )
  to:rvalue::@return
rvalue::@return: scope:[rvalue]  from rvalue::@1
  [29] return  [ ] ( main:2::rvalue:7 [ ] )
  to:@return
rvalue::@2: scope:[rvalue]  from rvalue::@1
  [30] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2 [ rvalue::i#1 ] ( main:2::rvalue:7 [ rvalue::i#1 ] )
  to:rvalue::@1
lvalue: scope:[lvalue]  from main
  [31] *((const byte*) lvalue::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::lvalue:5 [ ] )
  [32] *((const byte*) lvalue::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2::lvalue:5 [ ] )
  to:lvalue::@1
lvalue::@1: scope:[lvalue]  from lvalue lvalue::@2
  [33] (byte) lvalue::i#2 ← phi( lvalue/(byte/signed byte/word/signed word/dword/signed dword) 2 lvalue::@2/(byte) lvalue::i#1 ) [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] )
  [34] if((byte) lvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvalue::@2 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] )
  to:lvalue::@return
lvalue::@return: scope:[lvalue]  from lvalue::@1
  [35] return  [ ] ( main:2::lvalue:5 [ ] )
  to:@return
lvalue::@2: scope:[lvalue]  from lvalue::@1
  [36] *((const byte*) lvalue::SCREEN#0 + (byte) lvalue::i#2) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] )
  [37] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2 [ lvalue::i#1 ] ( main:2::lvalue:5 [ lvalue::i#1 ] )
  to:lvalue::@1

DOMINATORS
@begin dominated by  @begin 
@5 dominated by  @begin @5 
@end dominated by  @begin @end @5 
main dominated by  @begin main @5 
main::@1 dominated by  @begin main @5 main::@1 
main::@2 dominated by  @begin main @5 main::@1 main::@2 
main::@3 dominated by  @begin main @5 main::@1 main::@2 main::@3 
main::@return dominated by  main::@return @begin main @5 main::@1 main::@2 main::@3 
lvaluevar dominated by  @begin main lvaluevar @5 main::@1 main::@2 main::@3 
lvaluevar::@1 dominated by  @begin lvaluevar::@1 main lvaluevar @5 main::@1 main::@2 main::@3 
lvaluevar::@return dominated by  @begin lvaluevar::@1 main lvaluevar lvaluevar::@return @5 main::@1 main::@2 main::@3 
lvaluevar::@2 dominated by  @begin lvaluevar::@1 lvaluevar::@2 main lvaluevar @5 main::@1 main::@2 main::@3 
rvaluevar dominated by  @begin rvaluevar main @5 main::@1 main::@2 
rvaluevar::@1 dominated by  @begin rvaluevar main @5 main::@1 main::@2 rvaluevar::@1 
rvaluevar::@return dominated by  rvaluevar::@return @begin rvaluevar main @5 main::@1 main::@2 rvaluevar::@1 
rvaluevar::@2 dominated by  @begin rvaluevar main @5 main::@1 main::@2 rvaluevar::@2 rvaluevar::@1 
rvalue dominated by  @begin main rvalue @5 main::@1 
rvalue::@1 dominated by  @begin main rvalue rvalue::@1 @5 main::@1 
rvalue::@return dominated by  @begin main rvalue rvalue::@1 @5 main::@1 rvalue::@return 
rvalue::@2 dominated by  @begin main rvalue rvalue::@1 @5 rvalue::@2 main::@1 
lvalue dominated by  @begin main lvalue @5 
lvalue::@1 dominated by  @begin main lvalue @5 lvalue::@1 
lvalue::@return dominated by  @begin main lvalue::@return lvalue @5 lvalue::@1 
lvalue::@2 dominated by  @begin main lvalue @5 lvalue::@2 lvalue::@1 

NATURAL LOOPS
Found back edge: Loop head: lvaluevar::@1 tails: lvaluevar::@2 blocks: null
Found back edge: Loop head: rvaluevar::@1 tails: rvaluevar::@2 blocks: null
Found back edge: Loop head: rvalue::@1 tails: rvalue::@2 blocks: null
Found back edge: Loop head: lvalue::@1 tails: lvalue::@2 blocks: null
Populated: Loop head: lvaluevar::@1 tails: lvaluevar::@2 blocks: lvaluevar::@2 lvaluevar::@1 
Populated: Loop head: rvaluevar::@1 tails: rvaluevar::@2 blocks: rvaluevar::@2 rvaluevar::@1 
Populated: Loop head: rvalue::@1 tails: rvalue::@2 blocks: rvalue::@2 rvalue::@1 
Populated: Loop head: lvalue::@1 tails: lvalue::@2 blocks: lvalue::@2 lvalue::@1 
Loop head: lvaluevar::@1 tails: lvaluevar::@2 blocks: lvaluevar::@2 lvaluevar::@1 
Loop head: rvaluevar::@1 tails: rvaluevar::@2 blocks: rvaluevar::@2 rvaluevar::@1 
Loop head: rvalue::@1 tails: rvalue::@2 blocks: rvalue::@2 rvalue::@1 
Loop head: lvalue::@1 tails: lvalue::@2 blocks: lvalue::@2 lvalue::@1 

NATURAL LOOPS WITH DEPTH
Found 0 loops in scope []
Found 0 loops in scope [main]
Found 1 loops in scope [lvalue]
  Loop head: lvalue::@1 tails: lvalue::@2 blocks: lvalue::@2 lvalue::@1 
Found 1 loops in scope [rvalue]
  Loop head: rvalue::@1 tails: rvalue::@2 blocks: rvalue::@2 rvalue::@1 
Found 1 loops in scope [rvaluevar]
  Loop head: rvaluevar::@1 tails: rvaluevar::@2 blocks: rvaluevar::@2 rvaluevar::@1 
Found 1 loops in scope [lvaluevar]
  Loop head: lvaluevar::@1 tails: lvaluevar::@2 blocks: lvaluevar::@2 lvaluevar::@1 
Loop head: lvaluevar::@1 tails: lvaluevar::@2 blocks: lvaluevar::@2 lvaluevar::@1  depth: 1
Loop head: rvaluevar::@1 tails: rvaluevar::@2 blocks: rvaluevar::@2 rvaluevar::@1  depth: 1
Loop head: rvalue::@1 tails: rvalue::@2 blocks: rvalue::@2 rvalue::@1  depth: 1
Loop head: lvalue::@1 tails: lvalue::@2 blocks: lvalue::@2 lvalue::@1  depth: 1


VARIABLE REGISTER WEIGHTS
(void()) lvalue()
(byte[1024]) lvalue::SCREEN
(byte) lvalue::i
(byte) lvalue::i#1 22.0
(byte) lvalue::i#2 14.666666666666666
(void()) lvaluevar()
(byte) lvaluevar::b
(byte) lvaluevar::i
(byte) lvaluevar::i#1 22.0
(byte) lvaluevar::i#2 8.25
(byte*) lvaluevar::screen
(byte*) lvaluevar::screen#1 11.0
(byte*) lvaluevar::screen#2 11.0
(void()) main()
(void()) rvalue()
(byte[1024]) rvalue::SCREEN
(byte) rvalue::b
(byte) rvalue::i
(byte) rvalue::i#1 22.0
(byte) rvalue::i#2 16.5
(void()) rvaluevar()
(byte) rvaluevar::i
(byte) rvaluevar::i#1 22.0
(byte) rvaluevar::i#2 11.0
(byte*) rvaluevar::screen
(byte*) rvaluevar::screen#1 11.0
(byte*) rvaluevar::screen#2 11.0

Initial phi equivalence classes
[ lvaluevar::i#2 lvaluevar::i#1 ]
[ lvaluevar::screen#2 lvaluevar::screen#1 ]
[ rvaluevar::i#2 rvaluevar::i#1 ]
[ rvaluevar::screen#2 rvaluevar::screen#1 ]
[ rvalue::i#2 rvalue::i#1 ]
[ lvalue::i#2 lvalue::i#1 ]
Complete equivalence classes
[ lvaluevar::i#2 lvaluevar::i#1 ]
[ lvaluevar::screen#2 lvaluevar::screen#1 ]
[ rvaluevar::i#2 rvaluevar::i#1 ]
[ rvaluevar::screen#2 rvaluevar::screen#1 ]
[ rvalue::i#2 rvalue::i#1 ]
[ lvalue::i#2 lvalue::i#1 ]
Allocated zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Allocated zp ZP_WORD:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Allocated zp ZP_BYTE:5 [ rvaluevar::i#2 rvaluevar::i#1 ]
Allocated zp ZP_WORD:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ]
Allocated zp ZP_BYTE:8 [ rvalue::i#2 rvalue::i#1 ]
Allocated zp ZP_BYTE:9 [ lvalue::i#2 lvalue::i#1 ]

INITIAL ASM
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
  jmp b5
//SEG4 @5
b5:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @5 to main [phi:@5->main]
main_from_b5:
  jsr main
//SEG7 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
  //SEG10 [5] call lvalue param-assignment [ ] ( main:2 [ ] )
    jsr lvalue
  //SEG11 [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
  //SEG12 main::@1
  b1:
  //SEG13 [7] call rvalue param-assignment [ ] ( main:2 [ ] )
  //SEG14 [26] phi from main::@1 to rvalue [phi:main::@1->rvalue]
  rvalue_from_b1:
    jsr rvalue
  //SEG15 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
  //SEG16 main::@2
  b2:
  //SEG17 [9] call rvaluevar param-assignment [ ] ( main:2 [ ] )
  //SEG18 [20] phi from main::@2 to rvaluevar [phi:main::@2->rvaluevar]
  rvaluevar_from_b2:
    jsr rvaluevar
  //SEG19 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  b3_from_b2:
    jmp b3
  //SEG20 main::@3
  b3:
  //SEG21 [11] call lvaluevar param-assignment [ ] ( main:2 [ ] )
  //SEG22 [13] phi from main::@3 to lvaluevar [phi:main::@3->lvaluevar]
  lvaluevar_from_b3:
    jsr lvaluevar
    jmp breturn
  //SEG23 main::@return
  breturn:
  //SEG24 [12] return  [ ] ( main:2 [ ] )
    rts
}
//SEG25 lvaluevar
lvaluevar: {
    .const b = 4
    .label screen = 3
    .label i = 2
  //SEG26 [14] phi from lvaluevar to lvaluevar::@1 [phi:lvaluevar->lvaluevar::@1]
  b1_from_lvaluevar:
  //SEG27 [14] phi (byte*) lvaluevar::screen#2 = ((byte*))(word/signed word/dword/signed dword) 1024 [phi:lvaluevar->lvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta screen
    lda #>$400
    sta screen+1
  //SEG28 [14] phi (byte) lvaluevar::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:lvaluevar->lvaluevar::@1#1] -- vbuz1=vbuc1 
    lda #2
    sta i
    jmp b1
  //SEG29 lvaluevar::@1
  b1:
  //SEG30 [15] if((byte) lvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvaluevar::@2 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- vbuz1_lt_vbuc1_then_la1 
    lda i
    cmp #$a
    bcc b2
    jmp breturn
  //SEG31 lvaluevar::@return
  breturn:
  //SEG32 [16] return  [ ] ( main:2::lvaluevar:11 [ ] )
    rts
  //SEG33 lvaluevar::@2
  b2:
  //SEG34 [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- _deref_pbuz1=vbuc1 
    lda #b
    ldy #0
    sta (screen),y
  //SEG35 [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [ lvaluevar::i#2 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
  //SEG36 [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 [ lvaluevar::i#1 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#1 lvaluevar::screen#1 ] ) -- vbuz1=_inc_vbuz1 
    inc i
  //SEG37 [14] phi from lvaluevar::@2 to lvaluevar::@1 [phi:lvaluevar::@2->lvaluevar::@1]
  b1_from_b2:
  //SEG38 [14] phi (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#1 [phi:lvaluevar::@2->lvaluevar::@1#0] -- register_copy 
  //SEG39 [14] phi (byte) lvaluevar::i#2 = (byte) lvaluevar::i#1 [phi:lvaluevar::@2->lvaluevar::@1#1] -- register_copy 
    jmp b1
}
//SEG40 rvaluevar
rvaluevar: {
    .label screen = 6
    .label i = 5
  //SEG41 [21] phi from rvaluevar to rvaluevar::@1 [phi:rvaluevar->rvaluevar::@1]
  b1_from_rvaluevar:
  //SEG42 [21] phi (byte*) rvaluevar::screen#2 = ((byte*))(word/signed word/dword/signed dword) 1024 [phi:rvaluevar->rvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta screen
    lda #>$400
    sta screen+1
  //SEG43 [21] phi (byte) rvaluevar::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:rvaluevar->rvaluevar::@1#1] -- vbuz1=vbuc1 
    lda #2
    sta i
    jmp b1
  //SEG44 rvaluevar::@1
  b1:
  //SEG45 [22] if((byte) rvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvaluevar::@2 [ rvaluevar::i#2 rvaluevar::screen#2 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 ] ) -- vbuz1_lt_vbuc1_then_la1 
    lda i
    cmp #$a
    bcc b2
    jmp breturn
  //SEG46 rvaluevar::@return
  breturn:
  //SEG47 [23] return  [ ] ( main:2::rvaluevar:9 [ ] )
    rts
  //SEG48 rvaluevar::@2
  b2:
  //SEG49 [24] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
  //SEG50 [25] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 [ rvaluevar::i#1 rvaluevar::screen#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#1 rvaluevar::screen#1 ] ) -- vbuz1=_inc_vbuz1 
    inc i
  //SEG51 [21] phi from rvaluevar::@2 to rvaluevar::@1 [phi:rvaluevar::@2->rvaluevar::@1]
  b1_from_b2:
  //SEG52 [21] phi (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#1 [phi:rvaluevar::@2->rvaluevar::@1#0] -- register_copy 
  //SEG53 [21] phi (byte) rvaluevar::i#2 = (byte) rvaluevar::i#1 [phi:rvaluevar::@2->rvaluevar::@1#1] -- register_copy 
    jmp b1
}
//SEG54 rvalue
rvalue: {
    .label i = 8
  //SEG55 [27] phi from rvalue to rvalue::@1 [phi:rvalue->rvalue::@1]
  b1_from_rvalue:
  //SEG56 [27] phi (byte) rvalue::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:rvalue->rvalue::@1#0] -- vbuz1=vbuc1 
    lda #2
    sta i
    jmp b1
  //SEG57 rvalue::@1
  b1:
  //SEG58 [28] if((byte) rvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvalue::@2 [ rvalue::i#2 ] ( main:2::rvalue:7 [ rvalue::i#2 ] ) -- vbuz1_lt_vbuc1_then_la1 
    lda i
    cmp #$a
    bcc b2
    jmp breturn
  //SEG59 rvalue::@return
  breturn:
  //SEG60 [29] return  [ ] ( main:2::rvalue:7 [ ] )
    rts
  //SEG61 rvalue::@2
  b2:
  //SEG62 [30] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2 [ rvalue::i#1 ] ( main:2::rvalue:7 [ rvalue::i#1 ] ) -- vbuz1=_inc_vbuz1 
    inc i
  //SEG63 [27] phi from rvalue::@2 to rvalue::@1 [phi:rvalue::@2->rvalue::@1]
  b1_from_b2:
  //SEG64 [27] phi (byte) rvalue::i#2 = (byte) rvalue::i#1 [phi:rvalue::@2->rvalue::@1#0] -- register_copy 
    jmp b1
}
//SEG65 lvalue
lvalue: {
    .label SCREEN = $400
    .label i = 9
  //SEG66 [31] *((const byte*) lvalue::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::lvalue:5 [ ] ) -- _deref_pbuc1=vbuc2 
    lda #1
    sta SCREEN
  //SEG67 [32] *((const byte*) lvalue::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2::lvalue:5 [ ] ) -- _deref_pbuc1=vbuc2 
    lda #2
    sta SCREEN+1
  //SEG68 [33] phi from lvalue to lvalue::@1 [phi:lvalue->lvalue::@1]
  b1_from_lvalue:
  //SEG69 [33] phi (byte) lvalue::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:lvalue->lvalue::@1#0] -- vbuz1=vbuc1 
    lda #2
    sta i
    jmp b1
  //SEG70 lvalue::@1
  b1:
  //SEG71 [34] if((byte) lvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvalue::@2 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) -- vbuz1_lt_vbuc1_then_la1 
    lda i
    cmp #$a
    bcc b2
    jmp breturn
  //SEG72 lvalue::@return
  breturn:
  //SEG73 [35] return  [ ] ( main:2::lvalue:5 [ ] )
    rts
  //SEG74 lvalue::@2
  b2:
  //SEG75 [36] *((const byte*) lvalue::SCREEN#0 + (byte) lvalue::i#2) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) -- pbuc1_derefidx_vbuz1=vbuc2 
    ldy i
    lda #3
    sta SCREEN,y
  //SEG76 [37] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2 [ lvalue::i#1 ] ( main:2::lvalue:5 [ lvalue::i#1 ] ) -- vbuz1=_inc_vbuz1 
    inc i
  //SEG77 [33] phi from lvalue::@2 to lvalue::@1 [phi:lvalue::@2->lvalue::@1]
  b1_from_b2:
  //SEG78 [33] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy 
    jmp b1
}

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Statement [31] *((const byte*) lvalue::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a 
Statement [32] *((const byte*) lvalue::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a 
Statement [36] *((const byte*) lvalue::SCREEN#0 + (byte) lvalue::i#2) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ lvalue::i#2 lvalue::i#1 ]
Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y 
Statement [31] *((const byte*) lvalue::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a 
Statement [32] *((const byte*) lvalue::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2::lvalue:5 [ ] ) always clobbers reg byte a 
Statement [36] *((const byte*) lvalue::SCREEN#0 + (byte) lvalue::i#2) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ] : zp ZP_BYTE:2 , reg byte x , 
Potential registers zp ZP_WORD:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] : zp ZP_WORD:3 , 
Potential registers zp ZP_BYTE:5 [ rvaluevar::i#2 rvaluevar::i#1 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] : zp ZP_WORD:6 , 
Potential registers zp ZP_BYTE:8 [ rvalue::i#2 rvalue::i#1 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:9 [ lvalue::i#2 lvalue::i#1 ] : zp ZP_BYTE:9 , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [rvaluevar] 33: zp ZP_BYTE:5 [ rvaluevar::i#2 rvaluevar::i#1 ] 22: zp ZP_WORD:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] 
Uplift Scope [lvaluevar] 30.25: zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ] 22: zp ZP_WORD:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] 
Uplift Scope [rvalue] 38.5: zp ZP_BYTE:8 [ rvalue::i#2 rvalue::i#1 ] 
Uplift Scope [lvalue] 36.67: zp ZP_BYTE:9 [ lvalue::i#2 lvalue::i#1 ] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [rvaluevar] best 1710 combination reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ] zp ZP_WORD:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] 
Uplifting [lvaluevar] best 1620 combination reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ] zp ZP_WORD:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] 
Uplifting [rvalue] best 1530 combination reg byte x [ rvalue::i#2 rvalue::i#1 ] 
Uplifting [lvalue] best 1410 combination reg byte x [ lvalue::i#2 lvalue::i#1 ] 
Uplifting [main] best 1410 combination 
Uplifting [] best 1410 combination 
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Allocated (was zp ZP_WORD:6) zp ZP_WORD:4 [ rvaluevar::screen#2 rvaluevar::screen#1 ]

ASSEMBLER BEFORE OPTIMIZATION
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
  jmp b5
//SEG4 @5
b5:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @5 to main [phi:@5->main]
main_from_b5:
  jsr main
//SEG7 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
  //SEG10 [5] call lvalue param-assignment [ ] ( main:2 [ ] )
    jsr lvalue
  //SEG11 [6] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
  //SEG12 main::@1
  b1:
  //SEG13 [7] call rvalue param-assignment [ ] ( main:2 [ ] )
  //SEG14 [26] phi from main::@1 to rvalue [phi:main::@1->rvalue]
  rvalue_from_b1:
    jsr rvalue
  //SEG15 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
  //SEG16 main::@2
  b2:
  //SEG17 [9] call rvaluevar param-assignment [ ] ( main:2 [ ] )
  //SEG18 [20] phi from main::@2 to rvaluevar [phi:main::@2->rvaluevar]
  rvaluevar_from_b2:
    jsr rvaluevar
  //SEG19 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  b3_from_b2:
    jmp b3
  //SEG20 main::@3
  b3:
  //SEG21 [11] call lvaluevar param-assignment [ ] ( main:2 [ ] )
  //SEG22 [13] phi from main::@3 to lvaluevar [phi:main::@3->lvaluevar]
  lvaluevar_from_b3:
    jsr lvaluevar
    jmp breturn
  //SEG23 main::@return
  breturn:
  //SEG24 [12] return  [ ] ( main:2 [ ] )
    rts
}
//SEG25 lvaluevar
lvaluevar: {
    .const b = 4
    .label screen = 2
  //SEG26 [14] phi from lvaluevar to lvaluevar::@1 [phi:lvaluevar->lvaluevar::@1]
  b1_from_lvaluevar:
  //SEG27 [14] phi (byte*) lvaluevar::screen#2 = ((byte*))(word/signed word/dword/signed dword) 1024 [phi:lvaluevar->lvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta screen
    lda #>$400
    sta screen+1
  //SEG28 [14] phi (byte) lvaluevar::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:lvaluevar->lvaluevar::@1#1] -- vbuxx=vbuc1 
    ldx #2
    jmp b1
  //SEG29 lvaluevar::@1
  b1:
  //SEG30 [15] if((byte) lvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvaluevar::@2 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc b2
    jmp breturn
  //SEG31 lvaluevar::@return
  breturn:
  //SEG32 [16] return  [ ] ( main:2::lvaluevar:11 [ ] )
    rts
  //SEG33 lvaluevar::@2
  b2:
  //SEG34 [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- _deref_pbuz1=vbuc1 
    lda #b
    ldy #0
    sta (screen),y
  //SEG35 [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [ lvaluevar::i#2 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
  //SEG36 [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 [ lvaluevar::i#1 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#1 lvaluevar::screen#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG37 [14] phi from lvaluevar::@2 to lvaluevar::@1 [phi:lvaluevar::@2->lvaluevar::@1]
  b1_from_b2:
  //SEG38 [14] phi (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#1 [phi:lvaluevar::@2->lvaluevar::@1#0] -- register_copy 
  //SEG39 [14] phi (byte) lvaluevar::i#2 = (byte) lvaluevar::i#1 [phi:lvaluevar::@2->lvaluevar::@1#1] -- register_copy 
    jmp b1
}
//SEG40 rvaluevar
rvaluevar: {
    .label screen = 4
  //SEG41 [21] phi from rvaluevar to rvaluevar::@1 [phi:rvaluevar->rvaluevar::@1]
  b1_from_rvaluevar:
  //SEG42 [21] phi (byte*) rvaluevar::screen#2 = ((byte*))(word/signed word/dword/signed dword) 1024 [phi:rvaluevar->rvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta screen
    lda #>$400
    sta screen+1
  //SEG43 [21] phi (byte) rvaluevar::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:rvaluevar->rvaluevar::@1#1] -- vbuxx=vbuc1 
    ldx #2
    jmp b1
  //SEG44 rvaluevar::@1
  b1:
  //SEG45 [22] if((byte) rvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvaluevar::@2 [ rvaluevar::i#2 rvaluevar::screen#2 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 ] ) -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc b2
    jmp breturn
  //SEG46 rvaluevar::@return
  breturn:
  //SEG47 [23] return  [ ] ( main:2::rvaluevar:9 [ ] )
    rts
  //SEG48 rvaluevar::@2
  b2:
  //SEG49 [24] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
  //SEG50 [25] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 [ rvaluevar::i#1 rvaluevar::screen#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#1 rvaluevar::screen#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG51 [21] phi from rvaluevar::@2 to rvaluevar::@1 [phi:rvaluevar::@2->rvaluevar::@1]
  b1_from_b2:
  //SEG52 [21] phi (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#1 [phi:rvaluevar::@2->rvaluevar::@1#0] -- register_copy 
  //SEG53 [21] phi (byte) rvaluevar::i#2 = (byte) rvaluevar::i#1 [phi:rvaluevar::@2->rvaluevar::@1#1] -- register_copy 
    jmp b1
}
//SEG54 rvalue
rvalue: {
  //SEG55 [27] phi from rvalue to rvalue::@1 [phi:rvalue->rvalue::@1]
  b1_from_rvalue:
  //SEG56 [27] phi (byte) rvalue::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:rvalue->rvalue::@1#0] -- vbuxx=vbuc1 
    ldx #2
    jmp b1
  //SEG57 rvalue::@1
  b1:
  //SEG58 [28] if((byte) rvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvalue::@2 [ rvalue::i#2 ] ( main:2::rvalue:7 [ rvalue::i#2 ] ) -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc b2
    jmp breturn
  //SEG59 rvalue::@return
  breturn:
  //SEG60 [29] return  [ ] ( main:2::rvalue:7 [ ] )
    rts
  //SEG61 rvalue::@2
  b2:
  //SEG62 [30] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2 [ rvalue::i#1 ] ( main:2::rvalue:7 [ rvalue::i#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG63 [27] phi from rvalue::@2 to rvalue::@1 [phi:rvalue::@2->rvalue::@1]
  b1_from_b2:
  //SEG64 [27] phi (byte) rvalue::i#2 = (byte) rvalue::i#1 [phi:rvalue::@2->rvalue::@1#0] -- register_copy 
    jmp b1
}
//SEG65 lvalue
lvalue: {
    .label SCREEN = $400
  //SEG66 [31] *((const byte*) lvalue::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::lvalue:5 [ ] ) -- _deref_pbuc1=vbuc2 
    lda #1
    sta SCREEN
  //SEG67 [32] *((const byte*) lvalue::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2::lvalue:5 [ ] ) -- _deref_pbuc1=vbuc2 
    lda #2
    sta SCREEN+1
  //SEG68 [33] phi from lvalue to lvalue::@1 [phi:lvalue->lvalue::@1]
  b1_from_lvalue:
  //SEG69 [33] phi (byte) lvalue::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:lvalue->lvalue::@1#0] -- vbuxx=vbuc1 
    ldx #2
    jmp b1
  //SEG70 lvalue::@1
  b1:
  //SEG71 [34] if((byte) lvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvalue::@2 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc b2
    jmp breturn
  //SEG72 lvalue::@return
  breturn:
  //SEG73 [35] return  [ ] ( main:2::lvalue:5 [ ] )
    rts
  //SEG74 lvalue::@2
  b2:
  //SEG75 [36] *((const byte*) lvalue::SCREEN#0 + (byte) lvalue::i#2) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #3
    sta SCREEN,x
  //SEG76 [37] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2 [ lvalue::i#1 ] ( main:2::lvalue:5 [ lvalue::i#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG77 [33] phi from lvalue::@2 to lvalue::@1 [phi:lvalue::@2->lvalue::@1]
  b1_from_b2:
  //SEG78 [33] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy 
    jmp b1
}

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b5
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Removing instruction b5_from_bbegin:
Removing instruction main_from_b5:
Removing instruction bend_from_b5:
Removing instruction b1_from_main:
Removing instruction rvalue_from_b1:
Removing instruction b2_from_b1:
Removing instruction rvaluevar_from_b2:
Removing instruction b3_from_b2:
Removing instruction lvaluevar_from_b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b5:
Removing instruction bend:
Removing instruction b1:
Removing instruction b2:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_lvaluevar:
Removing instruction breturn:
Removing instruction b1_from_b2:
Removing instruction b1_from_rvaluevar:
Removing instruction breturn:
Removing instruction b1_from_b2:
Removing instruction b1_from_rvalue:
Removing instruction breturn:
Removing instruction b1_from_b2:
Removing instruction b1_from_lvalue:
Removing instruction breturn:
Removing instruction b1_from_b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Replacing instruction ldx #2 with TAX

FINAL SYMBOL TABLE
(label) @5
(label) @begin
(label) @end
(void()) lvalue()
(label) lvalue::@1
(label) lvalue::@2
(label) lvalue::@return
(byte[1024]) lvalue::SCREEN
(const byte*) lvalue::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte) lvalue::i
(byte) lvalue::i#1 reg byte x 22.0
(byte) lvalue::i#2 reg byte x 14.666666666666666
(void()) lvaluevar()
(label) lvaluevar::@1
(label) lvaluevar::@2
(label) lvaluevar::@return
(byte) lvaluevar::b
(const byte) lvaluevar::b#0 b = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) lvaluevar::i
(byte) lvaluevar::i#1 reg byte x 22.0
(byte) lvaluevar::i#2 reg byte x 8.25
(byte*) lvaluevar::screen
(byte*) lvaluevar::screen#1 screen zp ZP_WORD:2 11.0
(byte*) lvaluevar::screen#2 screen zp ZP_WORD:2 11.0
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(void()) rvalue()
(label) rvalue::@1
(label) rvalue::@2
(label) rvalue::@return
(byte[1024]) rvalue::SCREEN
(byte) rvalue::b
(byte) rvalue::i
(byte) rvalue::i#1 reg byte x 22.0
(byte) rvalue::i#2 reg byte x 16.5
(void()) rvaluevar()
(label) rvaluevar::@1
(label) rvaluevar::@2
(label) rvaluevar::@return
(byte) rvaluevar::i
(byte) rvaluevar::i#1 reg byte x 22.0
(byte) rvaluevar::i#2 reg byte x 11.0
(byte*) rvaluevar::screen
(byte*) rvaluevar::screen#1 screen zp ZP_WORD:4 11.0
(byte*) rvaluevar::screen#2 screen zp ZP_WORD:4 11.0

reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ]
zp ZP_WORD:2 [ lvaluevar::screen#2 lvaluevar::screen#1 ]
reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ]
zp ZP_WORD:4 [ rvaluevar::screen#2 rvaluevar::screen#1 ]
reg byte x [ rvalue::i#2 rvalue::i#1 ]
reg byte x [ lvalue::i#2 lvalue::i#1 ]


FINAL ASSEMBLER
Score: 1152

//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
//SEG2 @begin
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
//SEG4 @5
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @5 to main [phi:@5->main]
  jsr main
//SEG7 [3] phi from @5 to @end [phi:@5->@end]
//SEG8 @end
//SEG9 main
main: {
  //SEG10 [5] call lvalue param-assignment [ ] ( main:2 [ ] )
    jsr lvalue
  //SEG11 [6] phi from main to main::@1 [phi:main->main::@1]
  //SEG12 main::@1
  //SEG13 [7] call rvalue param-assignment [ ] ( main:2 [ ] )
  //SEG14 [26] phi from main::@1 to rvalue [phi:main::@1->rvalue]
    jsr rvalue
  //SEG15 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  //SEG16 main::@2
  //SEG17 [9] call rvaluevar param-assignment [ ] ( main:2 [ ] )
  //SEG18 [20] phi from main::@2 to rvaluevar [phi:main::@2->rvaluevar]
    jsr rvaluevar
  //SEG19 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
  //SEG20 main::@3
  //SEG21 [11] call lvaluevar param-assignment [ ] ( main:2 [ ] )
  //SEG22 [13] phi from main::@3 to lvaluevar [phi:main::@3->lvaluevar]
    jsr lvaluevar
  //SEG23 main::@return
  //SEG24 [12] return  [ ] ( main:2 [ ] )
    rts
}
//SEG25 lvaluevar
lvaluevar: {
    .const b = 4
    .label screen = 2
  //SEG26 [14] phi from lvaluevar to lvaluevar::@1 [phi:lvaluevar->lvaluevar::@1]
  //SEG27 [14] phi (byte*) lvaluevar::screen#2 = ((byte*))(word/signed word/dword/signed dword) 1024 [phi:lvaluevar->lvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta screen
    lda #>$400
    sta screen+1
  //SEG28 [14] phi (byte) lvaluevar::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:lvaluevar->lvaluevar::@1#1] -- vbuxx=vbuc1 
    ldx #2
  //SEG29 lvaluevar::@1
  b1:
  //SEG30 [15] if((byte) lvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvaluevar::@2 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc b2
  //SEG31 lvaluevar::@return
  //SEG32 [16] return  [ ] ( main:2::lvaluevar:11 [ ] )
    rts
  //SEG33 lvaluevar::@2
  b2:
  //SEG34 [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- _deref_pbuz1=vbuc1 
    lda #b
    ldy #0
    sta (screen),y
  //SEG35 [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [ lvaluevar::i#2 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
  //SEG36 [19] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 [ lvaluevar::i#1 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#1 lvaluevar::screen#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG37 [14] phi from lvaluevar::@2 to lvaluevar::@1 [phi:lvaluevar::@2->lvaluevar::@1]
  //SEG38 [14] phi (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#1 [phi:lvaluevar::@2->lvaluevar::@1#0] -- register_copy 
  //SEG39 [14] phi (byte) lvaluevar::i#2 = (byte) lvaluevar::i#1 [phi:lvaluevar::@2->lvaluevar::@1#1] -- register_copy 
    jmp b1
}
//SEG40 rvaluevar
rvaluevar: {
    .label screen = 4
  //SEG41 [21] phi from rvaluevar to rvaluevar::@1 [phi:rvaluevar->rvaluevar::@1]
  //SEG42 [21] phi (byte*) rvaluevar::screen#2 = ((byte*))(word/signed word/dword/signed dword) 1024 [phi:rvaluevar->rvaluevar::@1#0] -- pbuz1=pbuc1 
    lda #<$400
    sta screen
    lda #>$400
    sta screen+1
  //SEG43 [21] phi (byte) rvaluevar::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:rvaluevar->rvaluevar::@1#1] -- vbuxx=vbuc1 
    ldx #2
  //SEG44 rvaluevar::@1
  b1:
  //SEG45 [22] if((byte) rvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvaluevar::@2 [ rvaluevar::i#2 rvaluevar::screen#2 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#2 ] ) -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc b2
  //SEG46 rvaluevar::@return
  //SEG47 [23] return  [ ] ( main:2::rvaluevar:9 [ ] )
    rts
  //SEG48 rvaluevar::@2
  b2:
  //SEG49 [24] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#2 rvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1 
    inc screen
    bne !+
    inc screen+1
  !:
  //SEG50 [25] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 [ rvaluevar::i#1 rvaluevar::screen#1 ] ( main:2::rvaluevar:9 [ rvaluevar::i#1 rvaluevar::screen#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG51 [21] phi from rvaluevar::@2 to rvaluevar::@1 [phi:rvaluevar::@2->rvaluevar::@1]
  //SEG52 [21] phi (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#1 [phi:rvaluevar::@2->rvaluevar::@1#0] -- register_copy 
  //SEG53 [21] phi (byte) rvaluevar::i#2 = (byte) rvaluevar::i#1 [phi:rvaluevar::@2->rvaluevar::@1#1] -- register_copy 
    jmp b1
}
//SEG54 rvalue
rvalue: {
  //SEG55 [27] phi from rvalue to rvalue::@1 [phi:rvalue->rvalue::@1]
  //SEG56 [27] phi (byte) rvalue::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:rvalue->rvalue::@1#0] -- vbuxx=vbuc1 
    ldx #2
  //SEG57 rvalue::@1
  b1:
  //SEG58 [28] if((byte) rvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto rvalue::@2 [ rvalue::i#2 ] ( main:2::rvalue:7 [ rvalue::i#2 ] ) -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc b2
  //SEG59 rvalue::@return
  //SEG60 [29] return  [ ] ( main:2::rvalue:7 [ ] )
    rts
  //SEG61 rvalue::@2
  b2:
  //SEG62 [30] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2 [ rvalue::i#1 ] ( main:2::rvalue:7 [ rvalue::i#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG63 [27] phi from rvalue::@2 to rvalue::@1 [phi:rvalue::@2->rvalue::@1]
  //SEG64 [27] phi (byte) rvalue::i#2 = (byte) rvalue::i#1 [phi:rvalue::@2->rvalue::@1#0] -- register_copy 
    jmp b1
}
//SEG65 lvalue
lvalue: {
    .label SCREEN = $400
  //SEG66 [31] *((const byte*) lvalue::SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( main:2::lvalue:5 [ ] ) -- _deref_pbuc1=vbuc2 
    lda #1
    sta SCREEN
  //SEG67 [32] *((const byte*) lvalue::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2::lvalue:5 [ ] ) -- _deref_pbuc1=vbuc2 
    lda #2
    sta SCREEN+1
  //SEG68 [33] phi from lvalue to lvalue::@1 [phi:lvalue->lvalue::@1]
  //SEG69 [33] phi (byte) lvalue::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 2 [phi:lvalue->lvalue::@1#0] -- vbuxx=vbuc1 
    tax
  //SEG70 lvalue::@1
  b1:
  //SEG71 [34] if((byte) lvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto lvalue::@2 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) -- vbuxx_lt_vbuc1_then_la1 
    cpx #$a
    bcc b2
  //SEG72 lvalue::@return
  //SEG73 [35] return  [ ] ( main:2::lvalue:5 [ ] )
    rts
  //SEG74 lvalue::@2
  b2:
  //SEG75 [36] *((const byte*) lvalue::SCREEN#0 + (byte) lvalue::i#2) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ lvalue::i#2 ] ( main:2::lvalue:5 [ lvalue::i#2 ] ) -- pbuc1_derefidx_vbuxx=vbuc2 
    lda #3
    sta SCREEN,x
  //SEG76 [37] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2 [ lvalue::i#1 ] ( main:2::lvalue:5 [ lvalue::i#1 ] ) -- vbuxx=_inc_vbuxx 
    inx
  //SEG77 [33] phi from lvalue::@2 to lvalue::@1 [phi:lvalue::@2->lvalue::@1]
  //SEG78 [33] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy 
    jmp b1
}

