PARSING src/test/java/dk/camelot64/kickc/test/kc/loopnest2.kc
byte* SCREEN = $0400;

void main() {
    byte i=100;
    do {
        byte j=100;
        do {
            nest1();
        } while (--j>0);
    } while (--i>0);
}

void nest1() {
    byte i=100;
    do {
        byte j=100;
        do {
            nest2();
        } while (--j>0);
    } while (--i>0);
}

void nest2() {
    byte i=100;
    do {
        byte j=100;
        do {
            *SCREEN = j;
        } while (--j>0);
    } while (--i>0);
}

Adding pre/post-modifier (byte) main::j ← -- (byte) main::j
Adding pre/post-modifier (byte) main::i ← -- (byte) main::i
Adding pre/post-modifier (byte) nest1::j ← -- (byte) nest1::j
Adding pre/post-modifier (byte) nest1::i ← -- (byte) nest1::i
Adding pre/post-modifier (byte) nest2::j ← -- (byte) nest2::j
Adding pre/post-modifier (byte) nest2::i ← -- (byte) nest2::i

STATEMENTS
  (byte*) SCREEN ← (word/signed word/dword/signed dword) 1024
proc (void()) main()
  (byte) main::i ← (byte/signed byte/word/signed word/dword/signed dword) 100
main::@1:
  (byte) main::j ← (byte/signed byte/word/signed word/dword/signed dword) 100
main::@2:
  (void~) main::$0 ← call nest1 
  (byte) main::j ← -- (byte) main::j
  (boolean~) main::$1 ← (byte) main::j > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) main::$1) goto main::@2
  (byte) main::i ← -- (byte) main::i
  (boolean~) main::$2 ← (byte) main::i > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) main::$2) goto main::@1
main::@return:
  return 
endproc // main()
proc (void()) nest1()
  (byte) nest1::i ← (byte/signed byte/word/signed word/dword/signed dword) 100
nest1::@1:
  (byte) nest1::j ← (byte/signed byte/word/signed word/dword/signed dword) 100
nest1::@2:
  (void~) nest1::$0 ← call nest2 
  (byte) nest1::j ← -- (byte) nest1::j
  (boolean~) nest1::$1 ← (byte) nest1::j > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest1::$1) goto nest1::@2
  (byte) nest1::i ← -- (byte) nest1::i
  (boolean~) nest1::$2 ← (byte) nest1::i > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest1::$2) goto nest1::@1
nest1::@return:
  return 
endproc // nest1()
proc (void()) nest2()
  (byte) nest2::i ← (byte/signed byte/word/signed word/dword/signed dword) 100
nest2::@1:
  (byte) nest2::j ← (byte/signed byte/word/signed word/dword/signed dword) 100
nest2::@2:
  *((byte*) SCREEN) ← (byte) nest2::j
  (byte) nest2::j ← -- (byte) nest2::j
  (boolean~) nest2::$0 ← (byte) nest2::j > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest2::$0) goto nest2::@2
  (byte) nest2::i ← -- (byte) nest2::i
  (boolean~) nest2::$1 ← (byte) nest2::i > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest2::$1) goto nest2::@1
nest2::@return:
  return 
endproc // nest2()
  call main 

SYMBOLS
(byte*) SCREEN
(void()) main()
(void~) main::$0
(boolean~) main::$1
(boolean~) main::$2
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::i
(byte) main::j
(void()) nest1()
(void~) nest1::$0
(boolean~) nest1::$1
(boolean~) nest1::$2
(label) nest1::@1
(label) nest1::@2
(label) nest1::@return
(byte) nest1::i
(byte) nest1::j
(void()) nest2()
(boolean~) nest2::$0
(boolean~) nest2::$1
(label) nest2::@1
(label) nest2::@2
(label) nest2::@return
(byte) nest2::i
(byte) nest2::j

Promoting word/signed word/dword/signed dword to byte* in SCREEN ← ((byte*)) 1024
INITIAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  (byte*) SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024
  to:@1
main: scope:[main]  from
  (byte) main::i ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:main::@1
main::@1: scope:[main]  from main main::@3
  (byte) main::j ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@2
  (void~) main::$0 ← call nest1 
  (byte) main::j ← -- (byte) main::j
  (boolean~) main::$1 ← (byte) main::j > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) main::$1) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@2
  (byte) main::i ← -- (byte) main::i
  (boolean~) main::$2 ← (byte) main::i > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) main::$2) goto main::@1
  to:main::@4
main::@4: scope:[main]  from main::@3
  to:main::@return
main::@return: scope:[main]  from main::@4
  return 
  to:@return
@1: scope:[]  from @begin
  to:@2
nest1: scope:[nest1]  from
  (byte) nest1::i ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:nest1::@1
nest1::@1: scope:[nest1]  from nest1 nest1::@3
  (byte) nest1::j ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:nest1::@2
nest1::@2: scope:[nest1]  from nest1::@1 nest1::@2
  (void~) nest1::$0 ← call nest2 
  (byte) nest1::j ← -- (byte) nest1::j
  (boolean~) nest1::$1 ← (byte) nest1::j > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest1::$1) goto nest1::@2
  to:nest1::@3
nest1::@3: scope:[nest1]  from nest1::@2
  (byte) nest1::i ← -- (byte) nest1::i
  (boolean~) nest1::$2 ← (byte) nest1::i > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest1::$2) goto nest1::@1
  to:nest1::@4
nest1::@4: scope:[nest1]  from nest1::@3
  to:nest1::@return
nest1::@return: scope:[nest1]  from nest1::@4
  return 
  to:@return
@2: scope:[]  from @1
  to:@3
nest2: scope:[nest2]  from
  (byte) nest2::i ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:nest2::@1
nest2::@1: scope:[nest2]  from nest2 nest2::@3
  (byte) nest2::j ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:nest2::@2
nest2::@2: scope:[nest2]  from nest2::@1 nest2::@2
  *((byte*) SCREEN) ← (byte) nest2::j
  (byte) nest2::j ← -- (byte) nest2::j
  (boolean~) nest2::$0 ← (byte) nest2::j > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest2::$0) goto nest2::@2
  to:nest2::@3
nest2::@3: scope:[nest2]  from nest2::@2
  (byte) nest2::i ← -- (byte) nest2::i
  (boolean~) nest2::$1 ← (byte) nest2::i > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest2::$1) goto nest2::@1
  to:nest2::@4
nest2::@4: scope:[nest2]  from nest2::@3
  to:nest2::@return
nest2::@return: scope:[nest2]  from nest2::@4
  return 
  to:@return
@3: scope:[]  from @2
  call main 
  to:@end
@end: scope:[]  from @3

Eliminating unused variable - keeping the call (void~) main::$0
Eliminating unused variable - keeping the call (void~) nest1::$0
Removing empty block main::@4
Removing empty block @1
Removing empty block nest1::@4
Removing empty block @2
Removing empty block nest2::@4
PROCEDURE MODIFY VARIABLE ANALYSIS

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

CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
@begin: scope:[]  from
  (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  to:@3
main: scope:[main]  from @3
  (byte*) SCREEN#13 ← phi( @3/(byte*) SCREEN#15 )
  (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:main::@1
main::@1: scope:[main]  from main main::@3
  (byte*) SCREEN#11 ← phi( main/(byte*) SCREEN#13 main::@3/(byte*) SCREEN#14 )
  (byte) main::i#5 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 )
  (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@5
  (byte*) SCREEN#10 ← phi( main::@1/(byte*) SCREEN#11 main::@5/(byte*) SCREEN#12 )
  (byte) main::i#4 ← phi( main::@1/(byte) main::i#5 main::@5/(byte) main::i#3 )
  (byte) main::j#3 ← phi( main::@1/(byte) main::j#0 main::@5/(byte) main::j#1 )
  call nest1 param-assignment
  to:main::@5
main::@5: scope:[main]  from main::@2
  (byte*) SCREEN#12 ← phi( main::@2/(byte*) SCREEN#10 )
  (byte) main::i#3 ← phi( main::@2/(byte) main::i#4 )
  (byte) main::j#2 ← phi( main::@2/(byte) main::j#3 )
  (byte) main::j#1 ← -- (byte) main::j#2
  (boolean~) main::$1 ← (byte) main::j#1 > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) main::$1) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@5
  (byte*) SCREEN#14 ← phi( main::@5/(byte*) SCREEN#12 )
  (byte) main::i#2 ← phi( main::@5/(byte) main::i#3 )
  (byte) main::i#1 ← -- (byte) main::i#2
  (boolean~) main::$2 ← (byte) main::i#1 > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) main::$2) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@3
  return 
  to:@return
nest1: scope:[nest1]  from main::@2
  (byte*) SCREEN#8 ← phi( main::@2/(byte*) SCREEN#10 )
  (byte) nest1::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:nest1::@1
nest1::@1: scope:[nest1]  from nest1 nest1::@3
  (byte*) SCREEN#6 ← phi( nest1/(byte*) SCREEN#8 nest1::@3/(byte*) SCREEN#9 )
  (byte) nest1::i#5 ← phi( nest1/(byte) nest1::i#0 nest1::@3/(byte) nest1::i#1 )
  (byte) nest1::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:nest1::@2
nest1::@2: scope:[nest1]  from nest1::@1 nest1::@5
  (byte*) SCREEN#5 ← phi( nest1::@1/(byte*) SCREEN#6 nest1::@5/(byte*) SCREEN#7 )
  (byte) nest1::i#4 ← phi( nest1::@1/(byte) nest1::i#5 nest1::@5/(byte) nest1::i#3 )
  (byte) nest1::j#3 ← phi( nest1::@1/(byte) nest1::j#0 nest1::@5/(byte) nest1::j#1 )
  call nest2 param-assignment
  to:nest1::@5
nest1::@5: scope:[nest1]  from nest1::@2
  (byte*) SCREEN#7 ← phi( nest1::@2/(byte*) SCREEN#5 )
  (byte) nest1::i#3 ← phi( nest1::@2/(byte) nest1::i#4 )
  (byte) nest1::j#2 ← phi( nest1::@2/(byte) nest1::j#3 )
  (byte) nest1::j#1 ← -- (byte) nest1::j#2
  (boolean~) nest1::$1 ← (byte) nest1::j#1 > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest1::$1) goto nest1::@2
  to:nest1::@3
nest1::@3: scope:[nest1]  from nest1::@5
  (byte*) SCREEN#9 ← phi( nest1::@5/(byte*) SCREEN#7 )
  (byte) nest1::i#2 ← phi( nest1::@5/(byte) nest1::i#3 )
  (byte) nest1::i#1 ← -- (byte) nest1::i#2
  (boolean~) nest1::$2 ← (byte) nest1::i#1 > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest1::$2) goto nest1::@1
  to:nest1::@return
nest1::@return: scope:[nest1]  from nest1::@3
  return 
  to:@return
nest2: scope:[nest2]  from nest1::@2
  (byte*) SCREEN#3 ← phi( nest1::@2/(byte*) SCREEN#5 )
  (byte) nest2::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:nest2::@1
nest2::@1: scope:[nest2]  from nest2 nest2::@3
  (byte) nest2::i#4 ← phi( nest2/(byte) nest2::i#0 nest2::@3/(byte) nest2::i#1 )
  (byte*) SCREEN#2 ← phi( nest2/(byte*) SCREEN#3 nest2::@3/(byte*) SCREEN#4 )
  (byte) nest2::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 100
  to:nest2::@2
nest2::@2: scope:[nest2]  from nest2::@1 nest2::@2
  (byte) nest2::i#3 ← phi( nest2::@1/(byte) nest2::i#4 nest2::@2/(byte) nest2::i#3 )
  (byte*) SCREEN#1 ← phi( nest2::@1/(byte*) SCREEN#2 nest2::@2/(byte*) SCREEN#1 )
  (byte) nest2::j#2 ← phi( nest2::@1/(byte) nest2::j#0 nest2::@2/(byte) nest2::j#1 )
  *((byte*) SCREEN#1) ← (byte) nest2::j#2
  (byte) nest2::j#1 ← -- (byte) nest2::j#2
  (boolean~) nest2::$0 ← (byte) nest2::j#1 > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest2::$0) goto nest2::@2
  to:nest2::@3
nest2::@3: scope:[nest2]  from nest2::@2
  (byte*) SCREEN#4 ← phi( nest2::@2/(byte*) SCREEN#1 )
  (byte) nest2::i#2 ← phi( nest2::@2/(byte) nest2::i#3 )
  (byte) nest2::i#1 ← -- (byte) nest2::i#2
  (boolean~) nest2::$1 ← (byte) nest2::i#1 > (byte/signed byte/word/signed word/dword/signed dword) 0
  if((boolean~) nest2::$1) goto nest2::@1
  to:nest2::@return
nest2::@return: scope:[nest2]  from nest2::@3
  return 
  to:@return
@3: scope:[]  from @begin
  (byte*) SCREEN#15 ← phi( @begin/(byte*) SCREEN#0 )
  call main param-assignment
  to:@4
@4: scope:[]  from @3
  to:@end
@end: scope:[]  from @4

SYMBOL TABLE SSA
(label) @3
(label) @4
(label) @begin
(label) @end
(byte*) SCREEN
(byte*) SCREEN#0
(byte*) SCREEN#1
(byte*) SCREEN#10
(byte*) SCREEN#11
(byte*) SCREEN#12
(byte*) SCREEN#13
(byte*) SCREEN#14
(byte*) SCREEN#15
(byte*) SCREEN#2
(byte*) SCREEN#3
(byte*) SCREEN#4
(byte*) SCREEN#5
(byte*) SCREEN#6
(byte*) SCREEN#7
(byte*) SCREEN#8
(byte*) SCREEN#9
(void()) main()
(boolean~) main::$1
(boolean~) main::$2
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@5
(label) main::@return
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte) main::i#3
(byte) main::i#4
(byte) main::i#5
(byte) main::j
(byte) main::j#0
(byte) main::j#1
(byte) main::j#2
(byte) main::j#3
(void()) nest1()
(boolean~) nest1::$1
(boolean~) nest1::$2
(label) nest1::@1
(label) nest1::@2
(label) nest1::@3
(label) nest1::@5
(label) nest1::@return
(byte) nest1::i
(byte) nest1::i#0
(byte) nest1::i#1
(byte) nest1::i#2
(byte) nest1::i#3
(byte) nest1::i#4
(byte) nest1::i#5
(byte) nest1::j
(byte) nest1::j#0
(byte) nest1::j#1
(byte) nest1::j#2
(byte) nest1::j#3
(void()) nest2()
(boolean~) nest2::$0
(boolean~) nest2::$1
(label) nest2::@1
(label) nest2::@2
(label) nest2::@3
(label) nest2::@return
(byte) nest2::i
(byte) nest2::i#0
(byte) nest2::i#1
(byte) nest2::i#2
(byte) nest2::i#3
(byte) nest2::i#4
(byte) nest2::j
(byte) nest2::j#0
(byte) nest2::j#1
(byte) nest2::j#2

OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) @4
Succesful SSA optimization Pass2CullEmptyBlocks
Not aliassing across scopes: SCREEN#13 SCREEN#15
Not aliassing across scopes: SCREEN#8 SCREEN#10
Not aliassing across scopes: SCREEN#3 SCREEN#5
Alias (byte) main::j#2 = (byte) main::j#3 
Alias (byte) main::i#2 = (byte) main::i#3 (byte) main::i#4 
Alias (byte*) SCREEN#10 = (byte*) SCREEN#12 (byte*) SCREEN#14 
Alias (byte) nest1::j#2 = (byte) nest1::j#3 
Alias (byte) nest1::i#2 = (byte) nest1::i#3 (byte) nest1::i#4 
Alias (byte*) SCREEN#5 = (byte*) SCREEN#7 (byte*) SCREEN#9 
Alias (byte) nest2::i#2 = (byte) nest2::i#3 
Alias (byte*) SCREEN#1 = (byte*) SCREEN#4 
Alias (byte*) SCREEN#0 = (byte*) SCREEN#15 
Succesful SSA optimization Pass2AliasElimination
Not aliassing across scopes: SCREEN#13 SCREEN#0
Not aliassing across scopes: SCREEN#8 SCREEN#10
Not aliassing across scopes: SCREEN#3 SCREEN#5
Self Phi Eliminated (byte) main::i#2
Self Phi Eliminated (byte*) SCREEN#10
Self Phi Eliminated (byte) nest1::i#2
Self Phi Eliminated (byte*) SCREEN#5
Self Phi Eliminated (byte*) SCREEN#1
Self Phi Eliminated (byte) nest2::i#2
Succesful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) SCREEN#13 (byte*) SCREEN#0
Redundant Phi (byte) main::i#2 (byte) main::i#5
Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#11
Redundant Phi (byte*) SCREEN#8 (byte*) SCREEN#10
Redundant Phi (byte) nest1::i#2 (byte) nest1::i#5
Redundant Phi (byte*) SCREEN#5 (byte*) SCREEN#6
Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#5
Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2
Redundant Phi (byte) nest2::i#2 (byte) nest2::i#4
Succesful SSA optimization Pass2RedundantPhiElimination
Simple Condition (boolean~) main::$1 if((byte) main::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2
Simple Condition (boolean~) main::$2 if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1
Simple Condition (boolean~) nest1::$1 if((byte) nest1::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@2
Simple Condition (boolean~) nest1::$2 if((byte) nest1::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@1
Simple Condition (boolean~) nest2::$0 if((byte) nest2::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@2
Simple Condition (boolean~) nest2::$1 if((byte) nest2::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@1
Succesful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) SCREEN#0 = ((byte*))1024
Constant (const byte) main::i#0 = 100
Constant (const byte) main::j#0 = 100
Constant (const byte) nest1::i#0 = 100
Constant (const byte) nest1::j#0 = 100
Constant (const byte) nest2::i#0 = 100
Constant (const byte) nest2::j#0 = 100
Succesful SSA optimization Pass2ConstantIdentification
Not aliassing across scopes: SCREEN#6 SCREEN#11
Not aliassing across scopes: SCREEN#2 SCREEN#6
Self Phi Eliminated (byte*) SCREEN#11
Self Phi Eliminated (byte*) SCREEN#6
Self Phi Eliminated (byte*) SCREEN#2
Succesful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) SCREEN#11 (const byte*) SCREEN#0
Redundant Phi (byte*) SCREEN#6 (byte*) SCREEN#11
Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#6
Succesful SSA optimization Pass2RedundantPhiElimination
OPTIMIZING CONTROL FLOW GRAPH
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::j#0
Inlining constant with var siblings (const byte) main::j#0
Inlining constant with var siblings (const byte) nest1::i#0
Inlining constant with var siblings (const byte) nest1::i#0
Inlining constant with var siblings (const byte) nest1::j#0
Inlining constant with var siblings (const byte) nest1::j#0
Inlining constant with var siblings (const byte) nest2::i#0
Inlining constant with var siblings (const byte) nest2::i#0
Inlining constant with var siblings (const byte) nest2::j#0
Inlining constant with var siblings (const byte) nest2::j#0
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 100
Constant inlined nest2::j#0 = (byte/signed byte/word/signed word/dword/signed dword) 100
Constant inlined main::j#0 = (byte/signed byte/word/signed word/dword/signed dword) 100
Constant inlined nest2::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 100
Constant inlined nest1::j#0 = (byte/signed byte/word/signed word/dword/signed dword) 100
Constant inlined nest1::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 100
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @3 @end main main::@1 main::@2 main::@5 main::@3 main::@return nest1 nest1::@1 nest1::@2 nest1::@5 nest1::@3 nest1::@return nest2 nest2::@1 nest2::@2 nest2::@3 nest2::@return 
Added new block during phi lifting main::@6(between main::@3 and main::@1)
Added new block during phi lifting main::@7(between main::@5 and main::@2)
Added new block during phi lifting nest1::@6(between nest1::@3 and nest1::@1)
Added new block during phi lifting nest1::@7(between nest1::@5 and nest1::@2)
Added new block during phi lifting nest2::@5(between nest2::@3 and nest2::@1)
Added new block during phi lifting nest2::@6(between nest2::@2 and nest2::@2)
Block Sequence Planned @begin @3 @end main main::@1 main::@2 main::@5 main::@3 main::@return main::@6 main::@7 nest1 nest1::@1 nest1::@2 nest1::@5 nest1::@3 nest1::@return nest1::@6 nest1::@7 nest2 nest2::@1 nest2::@2 nest2::@3 nest2::@return nest2::@5 nest2::@6 
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of nest1
Adding NOP phi() at start of nest2
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to nest1:7 
Calls in [nest1] to nest2:18 

Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Created 6 initial phi equivalence classes
Coalesced [13] main::i#6 ← main::i#1
Coalesced [14] main::j#4 ← main::j#1
Coalesced [24] nest1::i#6 ← nest1::i#1
Coalesced [25] nest1::j#4 ← nest1::j#1
Coalesced [35] nest2::i#5 ← nest2::i#1
Coalesced [36] nest2::j#3 ← nest2::j#1
Coalesced down to 6 phi equivalence classes
Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@7
Culled Empty Block (label) nest1::@6
Culled Empty Block (label) nest1::@7
Culled Empty Block (label) nest2::@5
Culled Empty Block (label) nest2::@6
Block Sequence Planned @begin @3 @end main main::@1 main::@2 main::@5 main::@3 main::@return nest1 nest1::@1 nest1::@2 nest1::@5 nest1::@3 nest1::@return nest2 nest2::@1 nest2::@2 nest2::@3 nest2::@return 
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of nest1
Adding NOP phi() at start of nest2
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi() [ ] ( )
  to:@3
@3: scope:[]  from @begin
  [1] phi() [ ] ( )
  [2] call main param-assignment [ ] ( )
  to:@end
@end: scope:[]  from @3
  [3] phi() [ ] ( )
main: scope:[main]  from @3
  [4] phi() [ ] ( main:2 [ ] )
  to:main::@1
main::@1: scope:[main]  from main main::@3
  [5] (byte) main::i#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 100 main::@3/(byte) main::i#1 ) [ main::i#5 ] ( main:2 [ main::i#5 ] )
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@5
  [6] (byte) main::j#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 100 main::@5/(byte) main::j#1 ) [ main::i#5 main::j#2 ] ( main:2 [ main::i#5 main::j#2 ] )
  [7] call nest1 param-assignment [ main::i#5 main::j#2 ] ( main:2 [ main::i#5 main::j#2 ] )
  to:main::@5
main::@5: scope:[main]  from main::@2
  [8] (byte) main::j#1 ← -- (byte) main::j#2 [ main::i#5 main::j#1 ] ( main:2 [ main::i#5 main::j#1 ] )
  [9] if((byte) main::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 [ main::i#5 main::j#1 ] ( main:2 [ main::i#5 main::j#1 ] )
  to:main::@3
main::@3: scope:[main]  from main::@5
  [10] (byte) main::i#1 ← -- (byte) main::i#5 [ main::i#1 ] ( main:2 [ main::i#1 ] )
  [11] if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] )
  to:main::@return
main::@return: scope:[main]  from main::@3
  [12] return  [ ] ( main:2 [ ] )
  to:@return
nest1: scope:[nest1]  from main::@2
  [13] phi() [ ] ( main:2::nest1:7 [ main::i#5 main::j#2 ] )
  to:nest1::@1
nest1::@1: scope:[nest1]  from nest1 nest1::@3
  [14] (byte) nest1::i#5 ← phi( nest1/(byte/signed byte/word/signed word/dword/signed dword) 100 nest1::@3/(byte) nest1::i#1 ) [ nest1::i#5 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 ] )
  to:nest1::@2
nest1::@2: scope:[nest1]  from nest1::@1 nest1::@5
  [15] (byte) nest1::j#2 ← phi( nest1::@1/(byte/signed byte/word/signed word/dword/signed dword) 100 nest1::@5/(byte) nest1::j#1 ) [ nest1::i#5 nest1::j#2 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
  [16] call nest2 param-assignment [ nest1::i#5 nest1::j#2 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
  to:nest1::@5
nest1::@5: scope:[nest1]  from nest1::@2
  [17] (byte) nest1::j#1 ← -- (byte) nest1::j#2 [ nest1::i#5 nest1::j#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#1 ] )
  [18] if((byte) nest1::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@2 [ nest1::i#5 nest1::j#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#1 ] )
  to:nest1::@3
nest1::@3: scope:[nest1]  from nest1::@5
  [19] (byte) nest1::i#1 ← -- (byte) nest1::i#5 [ nest1::i#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#1 ] )
  [20] if((byte) nest1::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@1 [ nest1::i#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#1 ] )
  to:nest1::@return
nest1::@return: scope:[nest1]  from nest1::@3
  [21] return  [ ] ( main:2::nest1:7 [ main::i#5 main::j#2 ] )
  to:@return
nest2: scope:[nest2]  from nest1::@2
  [22] phi() [ ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
  to:nest2::@1
nest2::@1: scope:[nest2]  from nest2 nest2::@3
  [23] (byte) nest2::i#4 ← phi( nest2/(byte/signed byte/word/signed word/dword/signed dword) 100 nest2::@3/(byte) nest2::i#1 ) [ nest2::i#4 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 ] )
  to:nest2::@2
nest2::@2: scope:[nest2]  from nest2::@1 nest2::@2
  [24] (byte) nest2::j#2 ← phi( nest2::@1/(byte/signed byte/word/signed word/dword/signed dword) 100 nest2::@2/(byte) nest2::j#1 ) [ nest2::i#4 nest2::j#2 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#2 ] )
  [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 [ nest2::i#4 nest2::j#2 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#2 ] )
  [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ nest2::i#4 nest2::j#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#1 ] )
  [27] if((byte) nest2::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@2 [ nest2::i#4 nest2::j#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#1 ] )
  to:nest2::@3
nest2::@3: scope:[nest2]  from nest2::@2
  [28] (byte) nest2::i#1 ← -- (byte) nest2::i#4 [ nest2::i#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#1 ] )
  [29] if((byte) nest2::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@1 [ nest2::i#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#1 ] )
  to:nest2::@return
nest2::@return: scope:[nest2]  from nest2::@3
  [30] return  [ ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
  to:@return

DOMINATORS
@begin dominated by  @begin 
@3 dominated by  @begin @3 
@end dominated by  @begin @end @3 
main dominated by  @begin main @3 
main::@1 dominated by  @begin main @3 main::@1 
main::@2 dominated by  @begin main @3 main::@1 main::@2 
main::@5 dominated by  @begin main @3 main::@1 main::@2 main::@5 
main::@3 dominated by  @begin main @3 main::@1 main::@2 main::@5 main::@3 
main::@return dominated by  main::@return @begin main @3 main::@1 main::@2 main::@5 main::@3 
nest1 dominated by  @begin nest1 main @3 main::@1 main::@2 
nest1::@1 dominated by  nest1::@1 @begin nest1 main @3 main::@1 main::@2 
nest1::@2 dominated by  nest1::@1 nest1::@2 @begin nest1 main @3 main::@1 main::@2 
nest1::@5 dominated by  nest1::@1 nest1::@2 @begin nest1 nest1::@5 main @3 main::@1 main::@2 
nest1::@3 dominated by  nest1::@1 nest1::@2 @begin nest1 nest1::@5 nest1::@3 main @3 main::@1 main::@2 
nest1::@return dominated by  nest1::@1 nest1::@2 @begin nest1 nest1::@5 nest1::@3 main nest1::@return @3 main::@1 main::@2 
nest2 dominated by  nest1::@1 nest1::@2 @begin nest1 nest2 main @3 main::@1 main::@2 
nest2::@1 dominated by  nest1::@1 nest1::@2 @begin nest1 nest2 main nest2::@1 @3 main::@1 main::@2 
nest2::@2 dominated by  nest1::@1 nest1::@2 @begin nest1 nest2 main nest2::@1 @3 nest2::@2 main::@1 main::@2 
nest2::@3 dominated by  nest1::@1 nest1::@2 @begin nest1 nest2 main nest2::@1 @3 nest2::@3 nest2::@2 main::@1 main::@2 
nest2::@return dominated by  nest1::@1 nest1::@2 @begin nest1 nest2 main nest2::@return nest2::@1 @3 nest2::@3 nest2::@2 main::@1 main::@2 

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

NATURAL LOOPS WITH DEPTH
Found 0 loops in scope []
Found 2 loops in scope [main]
  Loop head: main::@2 tails: main::@5 blocks: main::@5 main::@2 
  Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@5 main::@2 main::@1 
Found 2 loops in scope [nest1]
  Loop head: nest1::@2 tails: nest1::@5 blocks: nest1::@5 nest1::@2 
  Loop head: nest1::@1 tails: nest1::@3 blocks: nest1::@3 nest1::@5 nest1::@2 nest1::@1 
Found 2 loops in scope [nest2]
  Loop head: nest2::@2 tails: nest2::@2 blocks: nest2::@2 
  Loop head: nest2::@1 tails: nest2::@3 blocks: nest2::@3 nest2::@2 nest2::@1 
Loop head: main::@2 tails: main::@5 blocks: main::@5 main::@2  depth: 2
Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@5 main::@2 main::@1  depth: 1
Loop head: nest1::@2 tails: nest1::@5 blocks: nest1::@5 nest1::@2  depth: 4
Loop head: nest1::@1 tails: nest1::@3 blocks: nest1::@3 nest1::@5 nest1::@2 nest1::@1  depth: 3
Loop head: nest2::@2 tails: nest2::@2 blocks: nest2::@2  depth: 6
Loop head: nest2::@1 tails: nest2::@3 blocks: nest2::@3 nest2::@2 nest2::@1  depth: 5


VARIABLE REGISTER WEIGHTS
(byte*) SCREEN
(void()) main()
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#5 4.4
(byte) main::j
(byte) main::j#1 151.5
(byte) main::j#2 101.0
(void()) nest1()
(byte) nest1::i
(byte) nest1::i#1 1501.5
(byte) nest1::i#5 400.4
(byte) nest1::j
(byte) nest1::j#1 15001.5
(byte) nest1::j#2 10001.0
(void()) nest2()
(byte) nest2::i
(byte) nest2::i#1 150001.5
(byte) nest2::i#4 40000.4
(byte) nest2::j
(byte) nest2::j#1 1500001.5
(byte) nest2::j#2 1500001.5

Initial phi equivalence classes
[ main::i#5 main::i#1 ]
[ main::j#2 main::j#1 ]
[ nest1::i#5 nest1::i#1 ]
[ nest1::j#2 nest1::j#1 ]
[ nest2::i#4 nest2::i#1 ]
[ nest2::j#2 nest2::j#1 ]
Complete equivalence classes
[ main::i#5 main::i#1 ]
[ main::j#2 main::j#1 ]
[ nest1::i#5 nest1::i#1 ]
[ nest1::j#2 nest1::j#1 ]
[ nest2::i#4 nest2::i#1 ]
[ nest2::j#2 nest2::j#1 ]
Allocated zp ZP_BYTE:2 [ main::i#5 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
Allocated zp ZP_BYTE:4 [ nest1::i#5 nest1::i#1 ]
Allocated zp ZP_BYTE:5 [ nest1::j#2 nest1::j#1 ]
Allocated zp ZP_BYTE:6 [ nest2::i#4 nest2::i#1 ]
Allocated zp ZP_BYTE:7 [ nest2::j#2 nest2::j#1 ]

INITIAL ASM
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label SCREEN = $400
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
b3_from_bbegin:
  jmp b3
//SEG4 @3
b3:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
main_from_b3:
  jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
bend_from_b3:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
    .label j = 3
    .label i = 2
  //SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
  //SEG11 [5] phi (byte) main::i#5 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #$64
    sta i
    jmp b1
  //SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  b1_from_b3:
  //SEG13 [5] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3->main::@1#0] -- register_copy 
    jmp b1
  //SEG14 main::@1
  b1:
  //SEG15 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
  //SEG16 [6] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1 
    lda #$64
    sta j
    jmp b2
  //SEG17 [6] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  b2_from_b5:
  //SEG18 [6] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@2#0] -- register_copy 
    jmp b2
  //SEG19 main::@2
  b2:
  //SEG20 [7] call nest1 param-assignment [ main::i#5 main::j#2 ] ( main:2 [ main::i#5 main::j#2 ] )
  //SEG21 [13] phi from main::@2 to nest1 [phi:main::@2->nest1]
  nest1_from_b2:
    jsr nest1
    jmp b5
  //SEG22 main::@5
  b5:
  //SEG23 [8] (byte) main::j#1 ← -- (byte) main::j#2 [ main::i#5 main::j#1 ] ( main:2 [ main::i#5 main::j#1 ] ) -- vbuz1=_dec_vbuz1 
    dec j
  //SEG24 [9] if((byte) main::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 [ main::i#5 main::j#1 ] ( main:2 [ main::i#5 main::j#1 ] ) -- vbuz1_gt_0_then_la1 
    lda j
    bne b2_from_b5
    jmp b3
  //SEG25 main::@3
  b3:
  //SEG26 [10] (byte) main::i#1 ← -- (byte) main::i#5 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1=_dec_vbuz1 
    dec i
  //SEG27 [11] if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1_gt_0_then_la1 
    lda i
    bne b1_from_b3
    jmp breturn
  //SEG28 main::@return
  breturn:
  //SEG29 [12] return  [ ] ( main:2 [ ] )
    rts
}
//SEG30 nest1
nest1: {
    .label j = 5
    .label i = 4
  //SEG31 [14] phi from nest1 to nest1::@1 [phi:nest1->nest1::@1]
  b1_from_nest1:
  //SEG32 [14] phi (byte) nest1::i#5 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest1->nest1::@1#0] -- vbuz1=vbuc1 
    lda #$64
    sta i
    jmp b1
  //SEG33 [14] phi from nest1::@3 to nest1::@1 [phi:nest1::@3->nest1::@1]
  b1_from_b3:
  //SEG34 [14] phi (byte) nest1::i#5 = (byte) nest1::i#1 [phi:nest1::@3->nest1::@1#0] -- register_copy 
    jmp b1
  //SEG35 nest1::@1
  b1:
  //SEG36 [15] phi from nest1::@1 to nest1::@2 [phi:nest1::@1->nest1::@2]
  b2_from_b1:
  //SEG37 [15] phi (byte) nest1::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest1::@1->nest1::@2#0] -- vbuz1=vbuc1 
    lda #$64
    sta j
    jmp b2
  //SEG38 [15] phi from nest1::@5 to nest1::@2 [phi:nest1::@5->nest1::@2]
  b2_from_b5:
  //SEG39 [15] phi (byte) nest1::j#2 = (byte) nest1::j#1 [phi:nest1::@5->nest1::@2#0] -- register_copy 
    jmp b2
  //SEG40 nest1::@2
  b2:
  //SEG41 [16] call nest2 param-assignment [ nest1::i#5 nest1::j#2 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
  //SEG42 [22] phi from nest1::@2 to nest2 [phi:nest1::@2->nest2]
  nest2_from_b2:
    jsr nest2
    jmp b5
  //SEG43 nest1::@5
  b5:
  //SEG44 [17] (byte) nest1::j#1 ← -- (byte) nest1::j#2 [ nest1::i#5 nest1::j#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#1 ] ) -- vbuz1=_dec_vbuz1 
    dec j
  //SEG45 [18] if((byte) nest1::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@2 [ nest1::i#5 nest1::j#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#1 ] ) -- vbuz1_gt_0_then_la1 
    lda j
    bne b2_from_b5
    jmp b3
  //SEG46 nest1::@3
  b3:
  //SEG47 [19] (byte) nest1::i#1 ← -- (byte) nest1::i#5 [ nest1::i#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#1 ] ) -- vbuz1=_dec_vbuz1 
    dec i
  //SEG48 [20] if((byte) nest1::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@1 [ nest1::i#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#1 ] ) -- vbuz1_gt_0_then_la1 
    lda i
    bne b1_from_b3
    jmp breturn
  //SEG49 nest1::@return
  breturn:
  //SEG50 [21] return  [ ] ( main:2::nest1:7 [ main::i#5 main::j#2 ] )
    rts
}
//SEG51 nest2
nest2: {
    .label j = 7
    .label i = 6
  //SEG52 [23] phi from nest2 to nest2::@1 [phi:nest2->nest2::@1]
  b1_from_nest2:
  //SEG53 [23] phi (byte) nest2::i#4 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest2->nest2::@1#0] -- vbuz1=vbuc1 
    lda #$64
    sta i
    jmp b1
  //SEG54 [23] phi from nest2::@3 to nest2::@1 [phi:nest2::@3->nest2::@1]
  b1_from_b3:
  //SEG55 [23] phi (byte) nest2::i#4 = (byte) nest2::i#1 [phi:nest2::@3->nest2::@1#0] -- register_copy 
    jmp b1
  //SEG56 nest2::@1
  b1:
  //SEG57 [24] phi from nest2::@1 to nest2::@2 [phi:nest2::@1->nest2::@2]
  b2_from_b1:
  //SEG58 [24] phi (byte) nest2::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest2::@1->nest2::@2#0] -- vbuz1=vbuc1 
    lda #$64
    sta j
    jmp b2
  //SEG59 [24] phi from nest2::@2 to nest2::@2 [phi:nest2::@2->nest2::@2]
  b2_from_b2:
  //SEG60 [24] phi (byte) nest2::j#2 = (byte) nest2::j#1 [phi:nest2::@2->nest2::@2#0] -- register_copy 
    jmp b2
  //SEG61 nest2::@2
  b2:
  //SEG62 [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 [ nest2::i#4 nest2::j#2 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#2 ] ) -- _deref_pbuc1=vbuz1 
    lda j
    sta SCREEN
  //SEG63 [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ nest2::i#4 nest2::j#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#1 ] ) -- vbuz1=_dec_vbuz1 
    dec j
  //SEG64 [27] if((byte) nest2::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@2 [ nest2::i#4 nest2::j#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#1 ] ) -- vbuz1_gt_0_then_la1 
    lda j
    bne b2_from_b2
    jmp b3
  //SEG65 nest2::@3
  b3:
  //SEG66 [28] (byte) nest2::i#1 ← -- (byte) nest2::i#4 [ nest2::i#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#1 ] ) -- vbuz1=_dec_vbuz1 
    dec i
  //SEG67 [29] if((byte) nest2::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@1 [ nest2::i#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#1 ] ) -- vbuz1_gt_0_then_la1 
    lda i
    bne b1_from_b3
    jmp breturn
  //SEG68 nest2::@return
  breturn:
  //SEG69 [30] return  [ ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
    rts
}

REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 [ main::i#5 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:4 [ nest1::i#5 nest1::i#1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:5 [ nest1::j#2 nest1::j#1 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:6 [ nest2::i#4 nest2::i#1 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:7 [ nest2::j#2 nest2::j#1 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [nest2] 3,000,003: zp ZP_BYTE:7 [ nest2::j#2 nest2::j#1 ] 190,001.9: zp ZP_BYTE:6 [ nest2::i#4 nest2::i#1 ] 
Uplift Scope [nest1] 25,002.5: zp ZP_BYTE:5 [ nest1::j#2 nest1::j#1 ] 1,901.9: zp ZP_BYTE:4 [ nest1::i#5 nest1::i#1 ] 
Uplift Scope [main] 252.5: zp ZP_BYTE:3 [ main::j#2 main::j#1 ] 20.9: zp ZP_BYTE:2 [ main::i#5 main::i#1 ] 
Uplift Scope [] 

Uplifting [nest2] best 23522243 combination reg byte y [ nest2::j#2 nest2::j#1 ] reg byte x [ nest2::i#4 nest2::i#1 ] 
Uplifting [nest1] best 23472243 combination reg byte a [ nest1::j#2 nest1::j#1 ] zp ZP_BYTE:4 [ nest1::i#5 nest1::i#1 ] 
Uplifting [main] best 23472243 combination zp ZP_BYTE:3 [ main::j#2 main::j#1 ] zp ZP_BYTE:2 [ main::i#5 main::i#1 ] 
Uplifting [] best 23472243 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:4 [ nest1::i#5 nest1::i#1 ]
Uplifting [nest1] best 23472243 combination zp ZP_BYTE:4 [ nest1::i#5 nest1::i#1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::j#2 main::j#1 ]
Uplifting [main] best 23472243 combination zp ZP_BYTE:3 [ main::j#2 main::j#1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::i#5 main::i#1 ]
Uplifting [main] best 23472243 combination zp ZP_BYTE:2 [ main::i#5 main::i#1 ] 

ASSEMBLER BEFORE OPTIMIZATION
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label SCREEN = $400
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
b3_from_bbegin:
  jmp b3
//SEG4 @3
b3:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
main_from_b3:
  jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
bend_from_b3:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
    .label j = 3
    .label i = 2
  //SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
  //SEG11 [5] phi (byte) main::i#5 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #$64
    sta i
    jmp b1
  //SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  b1_from_b3:
  //SEG13 [5] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3->main::@1#0] -- register_copy 
    jmp b1
  //SEG14 main::@1
  b1:
  //SEG15 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
  //SEG16 [6] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1 
    lda #$64
    sta j
    jmp b2
  //SEG17 [6] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  b2_from_b5:
  //SEG18 [6] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@2#0] -- register_copy 
    jmp b2
  //SEG19 main::@2
  b2:
  //SEG20 [7] call nest1 param-assignment [ main::i#5 main::j#2 ] ( main:2 [ main::i#5 main::j#2 ] )
  //SEG21 [13] phi from main::@2 to nest1 [phi:main::@2->nest1]
  nest1_from_b2:
    jsr nest1
    jmp b5
  //SEG22 main::@5
  b5:
  //SEG23 [8] (byte) main::j#1 ← -- (byte) main::j#2 [ main::i#5 main::j#1 ] ( main:2 [ main::i#5 main::j#1 ] ) -- vbuz1=_dec_vbuz1 
    dec j
  //SEG24 [9] if((byte) main::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 [ main::i#5 main::j#1 ] ( main:2 [ main::i#5 main::j#1 ] ) -- vbuz1_gt_0_then_la1 
    lda j
    bne b2_from_b5
    jmp b3
  //SEG25 main::@3
  b3:
  //SEG26 [10] (byte) main::i#1 ← -- (byte) main::i#5 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1=_dec_vbuz1 
    dec i
  //SEG27 [11] if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1_gt_0_then_la1 
    lda i
    bne b1_from_b3
    jmp breturn
  //SEG28 main::@return
  breturn:
  //SEG29 [12] return  [ ] ( main:2 [ ] )
    rts
}
//SEG30 nest1
nest1: {
    .label i = 4
  //SEG31 [14] phi from nest1 to nest1::@1 [phi:nest1->nest1::@1]
  b1_from_nest1:
  //SEG32 [14] phi (byte) nest1::i#5 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest1->nest1::@1#0] -- vbuz1=vbuc1 
    lda #$64
    sta i
    jmp b1
  //SEG33 [14] phi from nest1::@3 to nest1::@1 [phi:nest1::@3->nest1::@1]
  b1_from_b3:
  //SEG34 [14] phi (byte) nest1::i#5 = (byte) nest1::i#1 [phi:nest1::@3->nest1::@1#0] -- register_copy 
    jmp b1
  //SEG35 nest1::@1
  b1:
  //SEG36 [15] phi from nest1::@1 to nest1::@2 [phi:nest1::@1->nest1::@2]
  b2_from_b1:
  //SEG37 [15] phi (byte) nest1::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest1::@1->nest1::@2#0] -- vbuaa=vbuc1 
    lda #$64
    jmp b2
  //SEG38 [15] phi from nest1::@5 to nest1::@2 [phi:nest1::@5->nest1::@2]
  b2_from_b5:
  //SEG39 [15] phi (byte) nest1::j#2 = (byte) nest1::j#1 [phi:nest1::@5->nest1::@2#0] -- register_copy 
    jmp b2
  //SEG40 nest1::@2
  b2:
  //SEG41 [16] call nest2 param-assignment [ nest1::i#5 nest1::j#2 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
  //SEG42 [22] phi from nest1::@2 to nest2 [phi:nest1::@2->nest2]
  nest2_from_b2:
    jsr nest2
    jmp b5
  //SEG43 nest1::@5
  b5:
  //SEG44 [17] (byte) nest1::j#1 ← -- (byte) nest1::j#2 [ nest1::i#5 nest1::j#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#1 ] ) -- vbuaa=_dec_vbuaa 
    sec
    sbc #1
  //SEG45 [18] if((byte) nest1::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@2 [ nest1::i#5 nest1::j#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#1 ] ) -- vbuaa_gt_0_then_la1 
    cmp #0
    bne b2_from_b5
    jmp b3
  //SEG46 nest1::@3
  b3:
  //SEG47 [19] (byte) nest1::i#1 ← -- (byte) nest1::i#5 [ nest1::i#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#1 ] ) -- vbuz1=_dec_vbuz1 
    dec i
  //SEG48 [20] if((byte) nest1::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@1 [ nest1::i#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#1 ] ) -- vbuz1_gt_0_then_la1 
    lda i
    bne b1_from_b3
    jmp breturn
  //SEG49 nest1::@return
  breturn:
  //SEG50 [21] return  [ ] ( main:2::nest1:7 [ main::i#5 main::j#2 ] )
    rts
}
//SEG51 nest2
nest2: {
  //SEG52 [23] phi from nest2 to nest2::@1 [phi:nest2->nest2::@1]
  b1_from_nest2:
  //SEG53 [23] phi (byte) nest2::i#4 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest2->nest2::@1#0] -- vbuxx=vbuc1 
    ldx #$64
    jmp b1
  //SEG54 [23] phi from nest2::@3 to nest2::@1 [phi:nest2::@3->nest2::@1]
  b1_from_b3:
  //SEG55 [23] phi (byte) nest2::i#4 = (byte) nest2::i#1 [phi:nest2::@3->nest2::@1#0] -- register_copy 
    jmp b1
  //SEG56 nest2::@1
  b1:
  //SEG57 [24] phi from nest2::@1 to nest2::@2 [phi:nest2::@1->nest2::@2]
  b2_from_b1:
  //SEG58 [24] phi (byte) nest2::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest2::@1->nest2::@2#0] -- vbuyy=vbuc1 
    ldy #$64
    jmp b2
  //SEG59 [24] phi from nest2::@2 to nest2::@2 [phi:nest2::@2->nest2::@2]
  b2_from_b2:
  //SEG60 [24] phi (byte) nest2::j#2 = (byte) nest2::j#1 [phi:nest2::@2->nest2::@2#0] -- register_copy 
    jmp b2
  //SEG61 nest2::@2
  b2:
  //SEG62 [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 [ nest2::i#4 nest2::j#2 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#2 ] ) -- _deref_pbuc1=vbuyy 
    sty SCREEN
  //SEG63 [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ nest2::i#4 nest2::j#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#1 ] ) -- vbuyy=_dec_vbuyy 
    dey
  //SEG64 [27] if((byte) nest2::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@2 [ nest2::i#4 nest2::j#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#1 ] ) -- vbuyy_gt_0_then_la1 
    cpy #0
    bne b2_from_b2
    jmp b3
  //SEG65 nest2::@3
  b3:
  //SEG66 [28] (byte) nest2::i#1 ← -- (byte) nest2::i#4 [ nest2::i#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#1 ] ) -- vbuxx=_dec_vbuxx 
    dex
  //SEG67 [29] if((byte) nest2::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@1 [ nest2::i#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#1 ] ) -- vbuxx_gt_0_then_la1 
    cpx #0
    bne b1_from_b3
    jmp breturn
  //SEG68 nest2::@return
  breturn:
  //SEG69 [30] return  [ ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
    rts
}

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b3
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b5
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b5
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b2_from_b5 with b2
Replacing label b1_from_b3 with b1
Replacing label b2_from_b5 with b2
Replacing label b1_from_b3 with b1
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Removing instruction bbegin:
Removing instruction b3_from_bbegin:
Removing instruction main_from_b3:
Removing instruction bend_from_b3:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b5:
Removing instruction nest1_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b5:
Removing instruction nest2_from_b2:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b3:
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b5:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_nest1:
Removing instruction b5:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b1_from_nest2:
Removing instruction b3:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
(label) @3
(label) @begin
(label) @end
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@5
(label) main::@return
(byte) main::i
(byte) main::i#1 i zp ZP_BYTE:2 16.5
(byte) main::i#5 i zp ZP_BYTE:2 4.4
(byte) main::j
(byte) main::j#1 j zp ZP_BYTE:3 151.5
(byte) main::j#2 j zp ZP_BYTE:3 101.0
(void()) nest1()
(label) nest1::@1
(label) nest1::@2
(label) nest1::@3
(label) nest1::@5
(label) nest1::@return
(byte) nest1::i
(byte) nest1::i#1 i zp ZP_BYTE:4 1501.5
(byte) nest1::i#5 i zp ZP_BYTE:4 400.4
(byte) nest1::j
(byte) nest1::j#1 reg byte a 15001.5
(byte) nest1::j#2 reg byte a 10001.0
(void()) nest2()
(label) nest2::@1
(label) nest2::@2
(label) nest2::@3
(label) nest2::@return
(byte) nest2::i
(byte) nest2::i#1 reg byte x 150001.5
(byte) nest2::i#4 reg byte x 40000.4
(byte) nest2::j
(byte) nest2::j#1 reg byte y 1500001.5
(byte) nest2::j#2 reg byte y 1500001.5

zp ZP_BYTE:2 [ main::i#5 main::i#1 ]
zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
zp ZP_BYTE:4 [ nest1::i#5 nest1::i#1 ]
reg byte a [ nest1::j#2 nest1::j#1 ]
reg byte x [ nest2::i#4 nest2::i#1 ]
reg byte y [ nest2::j#2 nest2::j#1 ]


FINAL ASSEMBLER
Score: 13472241

//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
  .label SCREEN = $400
//SEG2 @begin
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
//SEG4 @3
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
  jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
//SEG8 @end
//SEG9 main
main: {
    .label j = 3
    .label i = 2
  //SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
  //SEG11 [5] phi (byte) main::i#5 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:main->main::@1#0] -- vbuz1=vbuc1 
    lda #$64
    sta i
  //SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
  //SEG13 [5] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3->main::@1#0] -- register_copy 
  //SEG14 main::@1
  b1:
  //SEG15 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  //SEG16 [6] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1 
    lda #$64
    sta j
  //SEG17 [6] phi from main::@5 to main::@2 [phi:main::@5->main::@2]
  //SEG18 [6] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@2#0] -- register_copy 
  //SEG19 main::@2
  b2:
  //SEG20 [7] call nest1 param-assignment [ main::i#5 main::j#2 ] ( main:2 [ main::i#5 main::j#2 ] )
  //SEG21 [13] phi from main::@2 to nest1 [phi:main::@2->nest1]
    jsr nest1
  //SEG22 main::@5
  //SEG23 [8] (byte) main::j#1 ← -- (byte) main::j#2 [ main::i#5 main::j#1 ] ( main:2 [ main::i#5 main::j#1 ] ) -- vbuz1=_dec_vbuz1 
    dec j
  //SEG24 [9] if((byte) main::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 [ main::i#5 main::j#1 ] ( main:2 [ main::i#5 main::j#1 ] ) -- vbuz1_gt_0_then_la1 
    lda j
    bne b2
  //SEG25 main::@3
  //SEG26 [10] (byte) main::i#1 ← -- (byte) main::i#5 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1=_dec_vbuz1 
    dec i
  //SEG27 [11] if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1_gt_0_then_la1 
    lda i
    bne b1
  //SEG28 main::@return
  //SEG29 [12] return  [ ] ( main:2 [ ] )
    rts
}
//SEG30 nest1
nest1: {
    .label i = 4
  //SEG31 [14] phi from nest1 to nest1::@1 [phi:nest1->nest1::@1]
  //SEG32 [14] phi (byte) nest1::i#5 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest1->nest1::@1#0] -- vbuz1=vbuc1 
    lda #$64
    sta i
  //SEG33 [14] phi from nest1::@3 to nest1::@1 [phi:nest1::@3->nest1::@1]
  //SEG34 [14] phi (byte) nest1::i#5 = (byte) nest1::i#1 [phi:nest1::@3->nest1::@1#0] -- register_copy 
  //SEG35 nest1::@1
  b1:
  //SEG36 [15] phi from nest1::@1 to nest1::@2 [phi:nest1::@1->nest1::@2]
  //SEG37 [15] phi (byte) nest1::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest1::@1->nest1::@2#0] -- vbuaa=vbuc1 
    lda #$64
  //SEG38 [15] phi from nest1::@5 to nest1::@2 [phi:nest1::@5->nest1::@2]
  //SEG39 [15] phi (byte) nest1::j#2 = (byte) nest1::j#1 [phi:nest1::@5->nest1::@2#0] -- register_copy 
  //SEG40 nest1::@2
  b2:
  //SEG41 [16] call nest2 param-assignment [ nest1::i#5 nest1::j#2 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
  //SEG42 [22] phi from nest1::@2 to nest2 [phi:nest1::@2->nest2]
    jsr nest2
  //SEG43 nest1::@5
  //SEG44 [17] (byte) nest1::j#1 ← -- (byte) nest1::j#2 [ nest1::i#5 nest1::j#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#1 ] ) -- vbuaa=_dec_vbuaa 
    sec
    sbc #1
  //SEG45 [18] if((byte) nest1::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@2 [ nest1::i#5 nest1::j#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#5 nest1::j#1 ] ) -- vbuaa_gt_0_then_la1 
    cmp #0
    bne b2
  //SEG46 nest1::@3
  //SEG47 [19] (byte) nest1::i#1 ← -- (byte) nest1::i#5 [ nest1::i#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#1 ] ) -- vbuz1=_dec_vbuz1 
    dec i
  //SEG48 [20] if((byte) nest1::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@1 [ nest1::i#1 ] ( main:2::nest1:7 [ main::i#5 main::j#2 nest1::i#1 ] ) -- vbuz1_gt_0_then_la1 
    lda i
    bne b1
  //SEG49 nest1::@return
  //SEG50 [21] return  [ ] ( main:2::nest1:7 [ main::i#5 main::j#2 ] )
    rts
}
//SEG51 nest2
nest2: {
  //SEG52 [23] phi from nest2 to nest2::@1 [phi:nest2->nest2::@1]
  //SEG53 [23] phi (byte) nest2::i#4 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest2->nest2::@1#0] -- vbuxx=vbuc1 
    ldx #$64
  //SEG54 [23] phi from nest2::@3 to nest2::@1 [phi:nest2::@3->nest2::@1]
  //SEG55 [23] phi (byte) nest2::i#4 = (byte) nest2::i#1 [phi:nest2::@3->nest2::@1#0] -- register_copy 
  //SEG56 nest2::@1
  b1:
  //SEG57 [24] phi from nest2::@1 to nest2::@2 [phi:nest2::@1->nest2::@2]
  //SEG58 [24] phi (byte) nest2::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 100 [phi:nest2::@1->nest2::@2#0] -- vbuyy=vbuc1 
    ldy #$64
  //SEG59 [24] phi from nest2::@2 to nest2::@2 [phi:nest2::@2->nest2::@2]
  //SEG60 [24] phi (byte) nest2::j#2 = (byte) nest2::j#1 [phi:nest2::@2->nest2::@2#0] -- register_copy 
  //SEG61 nest2::@2
  b2:
  //SEG62 [25] *((const byte*) SCREEN#0) ← (byte) nest2::j#2 [ nest2::i#4 nest2::j#2 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#2 ] ) -- _deref_pbuc1=vbuyy 
    sty SCREEN
  //SEG63 [26] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ nest2::i#4 nest2::j#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#1 ] ) -- vbuyy=_dec_vbuyy 
    dey
  //SEG64 [27] if((byte) nest2::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@2 [ nest2::i#4 nest2::j#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#4 nest2::j#1 ] ) -- vbuyy_gt_0_then_la1 
    cpy #0
    bne b2
  //SEG65 nest2::@3
  //SEG66 [28] (byte) nest2::i#1 ← -- (byte) nest2::i#4 [ nest2::i#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#1 ] ) -- vbuxx=_dec_vbuxx 
    dex
  //SEG67 [29] if((byte) nest2::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@1 [ nest2::i#1 ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 nest2::i#1 ] ) -- vbuxx_gt_0_then_la1 
    cpx #0
    bne b1
  //SEG68 nest2::@return
  //SEG69 [30] return  [ ] ( main:2::nest1:7::nest2:16 [ main::i#5 main::j#2 nest1::i#5 nest1::j#2 ] )
    rts
}

