Identified constant variable (byte*) main::SCREEN

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@1

(void()) main()
main: scope:[main]  from @1
  (byte) main::a#0 ← (byte) 3
  to:main::@1
main::@1: scope:[main]  from main main::@1
  (byte) main::a#2 ← phi( main/(byte) main::a#0 main::@1/(byte) main::a#1 )
  *((const byte*) main::SCREEN + (byte) main::a#2) ← (byte) main::a#2
  (byte) main::a#1 ← ++ (byte) main::a#2
  (bool~) main::$0 ← (byte) main::a#1 < (number) $e
  unroll if((bool~) main::$0) goto main::@1
  to:main::@2
main::@2: scope:[main]  from main::@1
  (byte) main::a#3 ← phi( main::@1/(byte) main::a#1 )
  *((const byte*) main::SCREEN + (byte) main::a#3) ← (byte) main::a#3
  to:main::@return
main::@return: scope:[main]  from main::@2
  return 
  to:@return
@1: scope:[]  from @begin
  call main 
  to:@2
@2: scope:[]  from @1
  to:@end
@end: scope:[]  from @2

SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @begin
(label) @end
(void()) main()
(bool~) main::$0
(label) main::@1
(label) main::@2
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(byte) main::a
(byte) main::a#0
(byte) main::a#1
(byte) main::a#2
(byte) main::a#3

Adding number conversion cast (unumber) $e in (bool~) main::$0 ← (byte) main::a#1 < (number) $e
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $e
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $e
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) main::a#1 = (byte) main::a#3 
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$0 [5] unroll if((byte) main::a#1<(byte) $e) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte) main::a#0 = 3
Successful SSA optimization Pass2ConstantIdentification
Unrolling loop Loop head: main::@1 tails: main::@1 blocks: main::@1 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#2 (const byte) main::a#0
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [3] if((byte) main::a#1>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [2] (byte) main::a#1 ← ++ (const byte) main::a#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#1 = ++main::a#0
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1) in block main::@2
if() condition always false - eliminating [3] if((const byte) main::a#1>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#4 = (byte) main::a#6 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_1 tails: main::@1_1 blocks: main::@1_1 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#5 (const byte) main::a#1
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [5] if((byte) main::a#4>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [4] (byte) main::a#4 ← ++ (const byte) main::a#1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#4 = ++main::a#1
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_1) in block main::@2
if() condition always false - eliminating [5] if((const byte) main::a#4>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#7 = (byte) main::a#9 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_2 tails: main::@1_2 blocks: main::@1_2 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#8 (const byte) main::a#4
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [6] if((byte) main::a#7>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [5] (byte) main::a#7 ← ++ (const byte) main::a#4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#7 = ++main::a#4
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_2) in block main::@2
if() condition always false - eliminating [6] if((const byte) main::a#7>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#10 = (byte) main::a#12 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_3 tails: main::@1_3 blocks: main::@1_3 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#11 (const byte) main::a#7
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [7] if((byte) main::a#10>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [6] (byte) main::a#10 ← ++ (const byte) main::a#7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#10 = ++main::a#7
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_3) in block main::@2
if() condition always false - eliminating [7] if((const byte) main::a#10>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#13 = (byte) main::a#15 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_4 tails: main::@1_4 blocks: main::@1_4 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#14 (const byte) main::a#10
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [8] if((byte) main::a#13>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [7] (byte) main::a#13 ← ++ (const byte) main::a#10
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#13 = ++main::a#10
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_4) in block main::@2
if() condition always false - eliminating [8] if((const byte) main::a#13>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#16 = (byte) main::a#18 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_5 tails: main::@1_5 blocks: main::@1_5 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#17 (const byte) main::a#13
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [9] if((byte) main::a#16>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [8] (byte) main::a#16 ← ++ (const byte) main::a#13
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#16 = ++main::a#13
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_5) in block main::@2
if() condition always false - eliminating [9] if((const byte) main::a#16>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#19 = (byte) main::a#21 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_6 tails: main::@1_6 blocks: main::@1_6 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#20 (const byte) main::a#16
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [10] if((byte) main::a#19>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [9] (byte) main::a#19 ← ++ (const byte) main::a#16
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#19 = ++main::a#16
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_6) in block main::@2
if() condition always false - eliminating [10] if((const byte) main::a#19>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#22 = (byte) main::a#24 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_7 tails: main::@1_7 blocks: main::@1_7 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#23 (const byte) main::a#19
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [11] if((byte) main::a#22>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [10] (byte) main::a#22 ← ++ (const byte) main::a#19
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#22 = ++main::a#19
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_7) in block main::@2
if() condition always false - eliminating [11] if((const byte) main::a#22>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#25 = (byte) main::a#27 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_8 tails: main::@1_8 blocks: main::@1_8 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#26 (const byte) main::a#22
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [12] if((byte) main::a#25>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [11] (byte) main::a#25 ← ++ (const byte) main::a#22
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#25 = ++main::a#22
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_8) in block main::@2
if() condition always false - eliminating [12] if((const byte) main::a#25>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#28 = (byte) main::a#30 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_9 tails: main::@1_9 blocks: main::@1_9 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#29 (const byte) main::a#25
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [13] if((byte) main::a#28>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [12] (byte) main::a#28 ← ++ (const byte) main::a#25
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#28 = ++main::a#25
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_9) in block main::@2
if() condition always false - eliminating [13] if((const byte) main::a#28>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Alias (byte) main::a#31 = (byte) main::a#33 
Successful SSA optimization Pass2AliasElimination
Unrolling loop Loop head: main::@1_10 tails: main::@1_10 blocks: main::@1_10 
Successful SSA optimization Pass2LoopUnroll
Identical Phi Values (byte) main::a#32 (const byte) main::a#28
Successful SSA optimization Pass2IdenticalPhiElimination
Negating conditional jump and destination [14] if((byte) main::a#31>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [13] (byte) main::a#31 ← ++ (const byte) main::a#28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::a#31 = ++main::a#28
Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@1_10) in block main::@1_11
if() condition always true - replacing block destination [14] if((const byte) main::a#31>=(byte) $e) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Eliminating variable (byte) main::a#35 from unused block main::@1_11
Eliminating variable (byte) main::a#36 from unused block main::@1_11
Removing PHI-reference to removed block (main::@1_11) in block main::@2
Removing unused block main::@1_11
Successful SSA optimization Pass2EliminateUnusedBlocks
Identical Phi Values (byte) main::a#34 (const byte) main::a#31
Successful SSA optimization Pass2IdenticalPhiElimination
Inlining constant with different constant siblings (const byte) main::a#0
Inlining constant with different constant siblings (const byte) main::a#1
Inlining constant with different constant siblings (const byte) main::a#4
Inlining constant with different constant siblings (const byte) main::a#7
Inlining constant with different constant siblings (const byte) main::a#10
Inlining constant with different constant siblings (const byte) main::a#13
Inlining constant with different constant siblings (const byte) main::a#16
Inlining constant with different constant siblings (const byte) main::a#19
Inlining constant with different constant siblings (const byte) main::a#22
Inlining constant with different constant siblings (const byte) main::a#25
Inlining constant with different constant siblings (const byte) main::a#28
Inlining constant with different constant siblings (const byte) main::a#31
Constant inlined main::a#22 = ++++++++++++++++(byte) 3
Constant inlined main::a#10 = ++++++++(byte) 3
Constant inlined main::a#31 = ++++++++++++++++++++++(byte) 3
Constant inlined main::a#25 = ++++++++++++++++++(byte) 3
Constant inlined main::a#13 = ++++++++++(byte) 3
Constant inlined main::a#0 = (byte) 3
Constant inlined main::a#19 = ++++++++++++++(byte) 3
Constant inlined main::a#28 = ++++++++++++++++++++(byte) 3
Constant inlined main::a#1 = ++(byte) 3
Constant inlined main::a#16 = ++++++++++++(byte) 3
Constant inlined main::a#7 = ++++++(byte) 3
Constant inlined main::a#4 = ++++(byte) 3
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::SCREEN+3)
Consolidated array index constant in *(main::SCREEN+++3)
Consolidated array index constant in *(main::SCREEN+++++3)
Consolidated array index constant in *(main::SCREEN+++++++3)
Consolidated array index constant in *(main::SCREEN+++++++++3)
Consolidated array index constant in *(main::SCREEN+++++++++++3)
Consolidated array index constant in *(main::SCREEN+++++++++++++3)
Consolidated array index constant in *(main::SCREEN+++++++++++++++3)
Consolidated array index constant in *(main::SCREEN+++++++++++++++++3)
Consolidated array index constant in *(main::SCREEN+++++++++++++++++++3)
Consolidated array index constant in *(main::SCREEN+++++++++++++++++++++3)
Consolidated array index constant in *(main::SCREEN+++++++++++++++++++++++3)
Successful SSA optimization Pass2ConstantAdditionElimination
Simplifying constant integer increment ++3
Simplifying constant integer increment ++3
Simplifying constant integer increment ++3
Simplifying constant integer increment ++4
Simplifying constant integer increment ++4
Simplifying constant integer increment ++5
Simplifying constant integer increment ++5
Simplifying constant integer increment ++6
Simplifying constant integer increment ++6
Simplifying constant integer increment ++7
Simplifying constant integer increment ++7
Simplifying constant integer increment ++8
Simplifying constant integer increment ++8
Simplifying constant integer increment ++9
Simplifying constant integer increment ++9
Simplifying constant integer increment ++$a
Simplifying constant integer increment ++$a
Simplifying constant integer increment ++$b
Simplifying constant integer increment ++$b
Simplifying constant integer increment ++$c
Simplifying constant integer increment ++$c
Simplifying constant integer increment ++$d
Successful SSA optimization Pass2ConstantSimplification
Simplifying constant integer increment ++4
Simplifying constant integer increment ++5
Simplifying constant integer increment ++6
Simplifying constant integer increment ++7
Simplifying constant integer increment ++8
Simplifying constant integer increment ++9
Simplifying constant integer increment ++$a
Simplifying constant integer increment ++$b
Simplifying constant integer increment ++$c
Simplifying constant integer increment ++$d
Successful SSA optimization Pass2ConstantSimplification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2 

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()

(void()) main()
main: scope:[main]  from @1
  [4] phi()
  to:main::@1
main::@1: scope:[main]  from main
  [5] *((const byte*) main::SCREEN+(byte) 3) ← (byte) 3
  to:main::@1_1
main::@1_1: scope:[main]  from main::@1
  [6] *((const byte*) main::SCREEN+(byte) 4) ← (byte) 4
  to:main::@1_2
main::@1_2: scope:[main]  from main::@1_1
  [7] *((const byte*) main::SCREEN+(byte) 5) ← (byte) 5
  to:main::@1_3
main::@1_3: scope:[main]  from main::@1_2
  [8] *((const byte*) main::SCREEN+(byte) 6) ← (byte) 6
  to:main::@1_4
main::@1_4: scope:[main]  from main::@1_3
  [9] *((const byte*) main::SCREEN+(byte) 7) ← (byte) 7
  to:main::@1_5
main::@1_5: scope:[main]  from main::@1_4
  [10] *((const byte*) main::SCREEN+(byte) 8) ← (byte) 8
  to:main::@1_6
main::@1_6: scope:[main]  from main::@1_5
  [11] *((const byte*) main::SCREEN+(byte) 9) ← (byte) 9
  to:main::@1_7
main::@1_7: scope:[main]  from main::@1_6
  [12] *((const byte*) main::SCREEN+(byte) $a) ← (byte) $a
  to:main::@1_8
main::@1_8: scope:[main]  from main::@1_7
  [13] *((const byte*) main::SCREEN+(byte) $b) ← (byte) $b
  to:main::@1_9
main::@1_9: scope:[main]  from main::@1_8
  [14] *((const byte*) main::SCREEN+(byte) $c) ← (byte) $c
  to:main::@1_10
main::@1_10: scope:[main]  from main::@1_9
  [15] *((const byte*) main::SCREEN+(byte) $d) ← (byte) $d
  to:main::@2
main::@2: scope:[main]  from main::@1_10
  [16] *((const byte*) main::SCREEN+(byte) $e) ← (byte) $e
  to:main::@return
main::@return: scope:[main]  from main::@2
  [17] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::a

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// An unrolled loop modifying a var used later
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
__bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
__b1_from___bbegin:
  jmp __b1
  // @1
__b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from___b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
__bend_from___b1:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .label SCREEN = $400
    jmp __b1
    // main::@1
  __b1:
    // [5] *((const byte*) main::SCREEN+(byte) 3) ← (byte) 3 -- _deref_pbuc1=vbuc2 
    lda #3
    sta SCREEN+3
    jmp __b1_1
    // main::@1_1
  __b1_1:
    // [6] *((const byte*) main::SCREEN+(byte) 4) ← (byte) 4 -- _deref_pbuc1=vbuc2 
    lda #4
    sta SCREEN+4
    jmp __b1_2
    // main::@1_2
  __b1_2:
    // [7] *((const byte*) main::SCREEN+(byte) 5) ← (byte) 5 -- _deref_pbuc1=vbuc2 
    lda #5
    sta SCREEN+5
    jmp __b1_3
    // main::@1_3
  __b1_3:
    // [8] *((const byte*) main::SCREEN+(byte) 6) ← (byte) 6 -- _deref_pbuc1=vbuc2 
    lda #6
    sta SCREEN+6
    jmp __b1_4
    // main::@1_4
  __b1_4:
    // [9] *((const byte*) main::SCREEN+(byte) 7) ← (byte) 7 -- _deref_pbuc1=vbuc2 
    lda #7
    sta SCREEN+7
    jmp __b1_5
    // main::@1_5
  __b1_5:
    // [10] *((const byte*) main::SCREEN+(byte) 8) ← (byte) 8 -- _deref_pbuc1=vbuc2 
    lda #8
    sta SCREEN+8
    jmp __b1_6
    // main::@1_6
  __b1_6:
    // [11] *((const byte*) main::SCREEN+(byte) 9) ← (byte) 9 -- _deref_pbuc1=vbuc2 
    lda #9
    sta SCREEN+9
    jmp __b1_7
    // main::@1_7
  __b1_7:
    // [12] *((const byte*) main::SCREEN+(byte) $a) ← (byte) $a -- _deref_pbuc1=vbuc2 
    lda #$a
    sta SCREEN+$a
    jmp __b1_8
    // main::@1_8
  __b1_8:
    // [13] *((const byte*) main::SCREEN+(byte) $b) ← (byte) $b -- _deref_pbuc1=vbuc2 
    lda #$b
    sta SCREEN+$b
    jmp __b1_9
    // main::@1_9
  __b1_9:
    // [14] *((const byte*) main::SCREEN+(byte) $c) ← (byte) $c -- _deref_pbuc1=vbuc2 
    lda #$c
    sta SCREEN+$c
    jmp __b1_10
    // main::@1_10
  __b1_10:
    // [15] *((const byte*) main::SCREEN+(byte) $d) ← (byte) $d -- _deref_pbuc1=vbuc2 
    lda #$d
    sta SCREEN+$d
    jmp __b2
    // main::@2
  __b2:
    // [16] *((const byte*) main::SCREEN+(byte) $e) ← (byte) $e -- _deref_pbuc1=vbuc2 
    lda #$e
    sta SCREEN+$e
    jmp __breturn
    // main::@return
  __breturn:
    // [17] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const byte*) main::SCREEN+(byte) 3) ← (byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) main::SCREEN+(byte) 4) ← (byte) 4 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) main::SCREEN+(byte) 5) ← (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [8] *((const byte*) main::SCREEN+(byte) 6) ← (byte) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [9] *((const byte*) main::SCREEN+(byte) 7) ← (byte) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [10] *((const byte*) main::SCREEN+(byte) 8) ← (byte) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [11] *((const byte*) main::SCREEN+(byte) 9) ← (byte) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [12] *((const byte*) main::SCREEN+(byte) $a) ← (byte) $a [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [13] *((const byte*) main::SCREEN+(byte) $b) ← (byte) $b [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [14] *((const byte*) main::SCREEN+(byte) $c) ← (byte) $c [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [15] *((const byte*) main::SCREEN+(byte) $d) ← (byte) $d [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [16] *((const byte*) main::SCREEN+(byte) $e) ← (byte) $e [ ] ( main:2 [ ] ) always clobbers reg byte a 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [main] best 156 combination 
Uplifting [] best 156 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// An unrolled loop modifying a var used later
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
__bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
__b1_from___bbegin:
  jmp __b1
  // @1
__b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from___b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
__bend_from___b1:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .label SCREEN = $400
    jmp __b1
    // main::@1
  __b1:
    // [5] *((const byte*) main::SCREEN+(byte) 3) ← (byte) 3 -- _deref_pbuc1=vbuc2 
    lda #3
    sta SCREEN+3
    jmp __b1_1
    // main::@1_1
  __b1_1:
    // [6] *((const byte*) main::SCREEN+(byte) 4) ← (byte) 4 -- _deref_pbuc1=vbuc2 
    lda #4
    sta SCREEN+4
    jmp __b1_2
    // main::@1_2
  __b1_2:
    // [7] *((const byte*) main::SCREEN+(byte) 5) ← (byte) 5 -- _deref_pbuc1=vbuc2 
    lda #5
    sta SCREEN+5
    jmp __b1_3
    // main::@1_3
  __b1_3:
    // [8] *((const byte*) main::SCREEN+(byte) 6) ← (byte) 6 -- _deref_pbuc1=vbuc2 
    lda #6
    sta SCREEN+6
    jmp __b1_4
    // main::@1_4
  __b1_4:
    // [9] *((const byte*) main::SCREEN+(byte) 7) ← (byte) 7 -- _deref_pbuc1=vbuc2 
    lda #7
    sta SCREEN+7
    jmp __b1_5
    // main::@1_5
  __b1_5:
    // [10] *((const byte*) main::SCREEN+(byte) 8) ← (byte) 8 -- _deref_pbuc1=vbuc2 
    lda #8
    sta SCREEN+8
    jmp __b1_6
    // main::@1_6
  __b1_6:
    // [11] *((const byte*) main::SCREEN+(byte) 9) ← (byte) 9 -- _deref_pbuc1=vbuc2 
    lda #9
    sta SCREEN+9
    jmp __b1_7
    // main::@1_7
  __b1_7:
    // [12] *((const byte*) main::SCREEN+(byte) $a) ← (byte) $a -- _deref_pbuc1=vbuc2 
    lda #$a
    sta SCREEN+$a
    jmp __b1_8
    // main::@1_8
  __b1_8:
    // [13] *((const byte*) main::SCREEN+(byte) $b) ← (byte) $b -- _deref_pbuc1=vbuc2 
    lda #$b
    sta SCREEN+$b
    jmp __b1_9
    // main::@1_9
  __b1_9:
    // [14] *((const byte*) main::SCREEN+(byte) $c) ← (byte) $c -- _deref_pbuc1=vbuc2 
    lda #$c
    sta SCREEN+$c
    jmp __b1_10
    // main::@1_10
  __b1_10:
    // [15] *((const byte*) main::SCREEN+(byte) $d) ← (byte) $d -- _deref_pbuc1=vbuc2 
    lda #$d
    sta SCREEN+$d
    jmp __b2
    // main::@2
  __b2:
    // [16] *((const byte*) main::SCREEN+(byte) $e) ← (byte) $e -- _deref_pbuc1=vbuc2 
    lda #$e
    sta SCREEN+$e
    jmp __breturn
    // main::@return
  __breturn:
    // [17] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Removing instruction jmp __b1_1
Removing instruction jmp __b1_2
Removing instruction jmp __b1_3
Removing instruction jmp __b1_4
Removing instruction jmp __b1_5
Removing instruction jmp __b1_6
Removing instruction jmp __b1_7
Removing instruction jmp __b1_8
Removing instruction jmp __b1_9
Removing instruction jmp __b1_10
Removing instruction jmp __b2
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction __b1:
Removing instruction __b1_1:
Removing instruction __b1_2:
Removing instruction __b1_3:
Removing instruction __b1_4:
Removing instruction __b1_5:
Removing instruction __b1_6:
Removing instruction __b1_7:
Removing instruction __b1_8:
Removing instruction __b1_9:
Removing instruction __b1_10:
Removing instruction __b2:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@1_1
(label) main::@1_10
(label) main::@1_2
(label) main::@1_3
(label) main::@1_4
(label) main::@1_5
(label) main::@1_6
(label) main::@1_7
(label) main::@1_8
(label) main::@1_9
(label) main::@2
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(byte) main::a



FINAL ASSEMBLER
Score: 78

  // File Comments
// An unrolled loop modifying a var used later
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    .label SCREEN = $400
    // main::@1
    // SCREEN[a]=a
    // [5] *((const byte*) main::SCREEN+(byte) 3) ← (byte) 3 -- _deref_pbuc1=vbuc2 
    lda #3
    sta SCREEN+3
    // main::@1_1
    // [6] *((const byte*) main::SCREEN+(byte) 4) ← (byte) 4 -- _deref_pbuc1=vbuc2 
    lda #4
    sta SCREEN+4
    // main::@1_2
    // [7] *((const byte*) main::SCREEN+(byte) 5) ← (byte) 5 -- _deref_pbuc1=vbuc2 
    lda #5
    sta SCREEN+5
    // main::@1_3
    // [8] *((const byte*) main::SCREEN+(byte) 6) ← (byte) 6 -- _deref_pbuc1=vbuc2 
    lda #6
    sta SCREEN+6
    // main::@1_4
    // [9] *((const byte*) main::SCREEN+(byte) 7) ← (byte) 7 -- _deref_pbuc1=vbuc2 
    lda #7
    sta SCREEN+7
    // main::@1_5
    // [10] *((const byte*) main::SCREEN+(byte) 8) ← (byte) 8 -- _deref_pbuc1=vbuc2 
    lda #8
    sta SCREEN+8
    // main::@1_6
    // [11] *((const byte*) main::SCREEN+(byte) 9) ← (byte) 9 -- _deref_pbuc1=vbuc2 
    lda #9
    sta SCREEN+9
    // main::@1_7
    // [12] *((const byte*) main::SCREEN+(byte) $a) ← (byte) $a -- _deref_pbuc1=vbuc2 
    lda #$a
    sta SCREEN+$a
    // main::@1_8
    // [13] *((const byte*) main::SCREEN+(byte) $b) ← (byte) $b -- _deref_pbuc1=vbuc2 
    lda #$b
    sta SCREEN+$b
    // main::@1_9
    // [14] *((const byte*) main::SCREEN+(byte) $c) ← (byte) $c -- _deref_pbuc1=vbuc2 
    lda #$c
    sta SCREEN+$c
    // main::@1_10
    // [15] *((const byte*) main::SCREEN+(byte) $d) ← (byte) $d -- _deref_pbuc1=vbuc2 
    lda #$d
    sta SCREEN+$d
    // main::@2
    // [16] *((const byte*) main::SCREEN+(byte) $e) ← (byte) $e -- _deref_pbuc1=vbuc2 
    lda #$e
    sta SCREEN+$e
    // main::@return
    // }
    // [17] return 
    rts
}
  // File Data

