Setting inferred volatile on symbol affected by address-of (byte*~) main::$0 ← & (byte) main::b1
Setting inferred volatile on symbol affected by address-of (byte*~) main::$2 ← & (byte) main::b2
Setting inferred volatile on symbol affected by address-of (byte*~) main::$4 ← & (byte) main::b3
Identified constant variable (byte*) main::SCREEN
Culled Empty Block (label) @1

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@2
main: scope:[main]  from @2
  (byte*) main::SCREEN#0 ← ((byte*)) (number) $400
  (byte) main::b1#0 ← (number) 0
  (byte) main::b2#0 ← (number) 0
  (byte) main::b3#0 ← (number) 0
  (byte*~) main::$0 ← & (byte) main::b1#0
  (byte*) setByte::ptr#0 ← (byte*~) main::$0
  (byte) setByte::b#0 ← (byte) 'c'
  call setByte 
  to:main::@1
main::@1: scope:[main]  from main
  (byte) main::b1#3 ← phi( main/(byte) main::b1#0 )
  (byte) main::b3#3 ← phi( main/(byte) main::b3#0 )
  (byte) main::b2#1 ← phi( main/(byte) main::b2#0 )
  (byte*~) main::$2 ← & (byte) main::b2#1
  (byte*) setByte::ptr#1 ← (byte*~) main::$2
  (byte) setByte::b#1 ← (byte) 'm'
  call setByte 
  to:main::@2
main::@2: scope:[main]  from main::@1
  (byte) main::b2#3 ← phi( main::@1/(byte) main::b2#1 )
  (byte) main::b1#2 ← phi( main::@1/(byte) main::b1#3 )
  (byte) main::b3#1 ← phi( main::@1/(byte) main::b3#3 )
  (byte*~) main::$4 ← & (byte) main::b3#1
  (byte*) setByte::ptr#2 ← (byte*~) main::$4
  (byte) setByte::b#2 ← (byte) 'l'
  call setByte 
  to:main::@3
main::@3: scope:[main]  from main::@2
  (byte) main::b3#2 ← phi( main::@2/(byte) main::b3#1 )
  (byte) main::b2#2 ← phi( main::@2/(byte) main::b2#3 )
  (byte) main::b1#1 ← phi( main::@2/(byte) main::b1#2 )
  *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::b1#1
  *((byte*) main::SCREEN#0 + (number) 1) ← (byte) main::b2#2
  *((byte*) main::SCREEN#0 + (number) 2) ← (byte) main::b3#2
  to:main::@return
main::@return: scope:[main]  from main::@3
  return 
  to:@return
setByte: scope:[setByte]  from main main::@1 main::@2
  (byte*) setByte::ptr#3 ← phi( main/(byte*) setByte::ptr#0 main::@1/(byte*) setByte::ptr#1 main::@2/(byte*) setByte::ptr#2 )
  (byte) setByte::b#3 ← phi( main/(byte) setByte::b#0 main::@1/(byte) setByte::b#1 main::@2/(byte) setByte::b#2 )
  *((byte*) setByte::ptr#3) ← (byte) setByte::b#3
  to:setByte::@return
setByte::@return: scope:[setByte]  from setByte
  return 
  to:@return
@2: scope:[]  from @begin
  call main 
  to:@3
@3: scope:[]  from @2
  to:@end
@end: scope:[]  from @3

SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @begin
(label) @end
(void()) main()
(byte*~) main::$0
(byte*~) main::$2
(byte*~) main::$4
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte*) main::SCREEN
(byte*) main::SCREEN#0
(byte) main::b1
(byte) main::b1#0
(byte) main::b1#1
(byte) main::b1#2
(byte) main::b1#3
(byte) main::b2
(byte) main::b2#0
(byte) main::b2#1
(byte) main::b2#2
(byte) main::b2#3
(byte) main::b3
(byte) main::b3#0
(byte) main::b3#1
(byte) main::b3#2
(byte) main::b3#3
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
(label) setByte::@return
(byte) setByte::b
(byte) setByte::b#0
(byte) setByte::b#1
(byte) setByte::b#2
(byte) setByte::b#3
(byte*) setByte::ptr
(byte*) setByte::ptr#0
(byte*) setByte::ptr#1
(byte*) setByte::ptr#2
(byte*) setByte::ptr#3

Adding number conversion cast (unumber) 0 in (byte) main::b1#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) main::b2#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) main::b3#0 ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← (byte) main::b1#1
Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← (byte) main::b2#2
Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN#0 + (number) 2) ← (byte) main::b3#2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) main::b1#0 ← (unumber)(number) 0
Inlining cast (byte) main::b2#0 ← (unumber)(number) 0
Inlining cast (byte) main::b3#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) setByte::ptr#0 = (byte*~) main::$0 
Alias (byte) main::b2#0 = (byte) main::b2#1 (byte) main::b2#3 (byte) main::b2#2 
Alias (byte) main::b3#0 = (byte) main::b3#3 (byte) main::b3#1 (byte) main::b3#2 
Alias (byte) main::b1#0 = (byte) main::b1#3 (byte) main::b1#2 (byte) main::b1#1 
Alias (byte*) setByte::ptr#1 = (byte*~) main::$2 
Alias (byte*) setByte::ptr#2 = (byte*~) main::$4 
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [4] (byte*) setByte::ptr#0 ← & (byte) main::b1#0
Constant right-side identified [9] (byte*) setByte::ptr#1 ← & (byte) main::b2#0
Constant right-side identified [14] (byte*) setByte::ptr#2 ← & (byte) main::b3#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
Constant (const byte*) setByte::ptr#0 = &main::b1#0
Constant (const byte) setByte::b#0 = 'c'
Constant (const byte*) setByte::ptr#1 = &main::b2#0
Constant (const byte) setByte::b#1 = 'm'
Constant (const byte*) setByte::ptr#2 = &main::b3#0
Constant (const byte) setByte::b#2 = 'l'
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero main::SCREEN#0 in [19] *((const byte*) main::SCREEN#0 + (byte) 0) ← (byte) main::b1#0
Successful SSA optimization PassNSimplifyExpressionWithZero
Inlining constant with var siblings (const byte*) setByte::ptr#0
Inlining constant with var siblings (const byte) setByte::b#0
Inlining constant with var siblings (const byte*) setByte::ptr#1
Inlining constant with var siblings (const byte) setByte::b#1
Inlining constant with var siblings (const byte*) setByte::ptr#2
Inlining constant with var siblings (const byte) setByte::b#2
Constant inlined setByte::ptr#1 = &(byte) main::b2#0
Constant inlined setByte::ptr#2 = &(byte) main::b3#0
Constant inlined setByte::ptr#0 = &(byte) main::b1#0
Constant inlined setByte::b#2 = (byte) 'l'
Constant inlined setByte::b#1 = (byte) 'm'
Constant inlined setByte::b#0 = (byte) 'c'
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(main::SCREEN#0+1)
Consolidated array index constant in *(main::SCREEN#0+2)
Successful SSA optimization Pass2ConstantAdditionElimination
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to setByte:8 setByte:10 setByte:12 

Created 2 initial phi equivalence classes
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) @3
Renumbering block @2 to @1
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::@1
Adding NOP phi() at start of main::@2

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()
main: scope:[main]  from @1
  [4] (byte) main::b1#0 ← (byte) 0
  [5] (byte) main::b2#0 ← (byte) 0
  [6] (byte) main::b3#0 ← (byte) 0
  [7] call setByte 
  to:main::@1
main::@1: scope:[main]  from main
  [8] phi()
  [9] call setByte 
  to:main::@2
main::@2: scope:[main]  from main::@1
  [10] phi()
  [11] call setByte 
  to:main::@3
main::@3: scope:[main]  from main::@2
  [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0
  [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0
  [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0
  to:main::@return
main::@return: scope:[main]  from main::@3
  [15] return 
  to:@return
setByte: scope:[setByte]  from main main::@1 main::@2
  [16] (byte*) setByte::ptr#3 ← phi( main/&(byte) main::b1#0 main::@1/&(byte) main::b2#0 main::@2/&(byte) main::b3#0 )
  [16] (byte) setByte::b#3 ← phi( main/(byte) 'c' main::@1/(byte) 'm' main::@2/(byte) 'l' )
  [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3
  to:setByte::@return
setByte::@return: scope:[setByte]  from setByte
  [18] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte*) main::SCREEN
(byte) main::b1
(byte) main::b1#0 0.36363636363636365
(byte) main::b2
(byte) main::b2#0 0.36363636363636365
(byte) main::b3
(byte) main::b3#0 0.36363636363636365
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
(byte) setByte::b
(byte) setByte::b#3 2.0
(byte*) setByte::ptr
(byte*) setByte::ptr#3 2.0

Initial phi equivalence classes
[ setByte::b#3 ]
[ setByte::ptr#3 ]
Complete equivalence classes
[ setByte::b#3 ]
[ setByte::ptr#3 ]
[ main::b1#0 ]
[ main::b2#0 ]
[ main::b3#0 ]
Allocated zp ZP_BYTE:2 [ setByte::b#3 ]
Allocated zp ZP_WORD:3 [ setByte::ptr#3 ]
Allocated zp ZP_BYTE:5 [ main::b1#0 ]
Allocated zp ZP_BYTE:6 [ main::b2#0 ]
Allocated zp ZP_BYTE:7 [ main::b3#0 ]

INITIAL ASM
Target platform is c64basic
  // File Comments
// Test address-of - pass the pointer as parameter
  // 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 
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .label SCREEN = $400
    .label b1 = 5
    .label b2 = 6
    .label b3 = 7
    // [4] (byte) main::b1#0 ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z b1
    // [5] (byte) main::b2#0 ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z b2
    // [6] (byte) main::b3#0 ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z b3
    // [7] call setByte 
    // [16] phi from main to setByte [phi:main->setByte]
  setByte_from_main:
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1#0 [phi:main->setByte#0] -- pbuz1=pbuc1 
    lda #<b1
    sta.z setByte.ptr
    lda #>b1
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'c' [phi:main->setByte#1] -- vbuz1=vbuc1 
    lda #'c'
    sta.z setByte.b
    jsr setByte
    // [8] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
    // main::@1
  b1:
    // [9] call setByte 
    // [16] phi from main::@1 to setByte [phi:main::@1->setByte]
  setByte_from_b1:
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2#0 [phi:main::@1->setByte#0] -- pbuz1=pbuc1 
    lda #<b2
    sta.z setByte.ptr
    lda #>b2
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'm' [phi:main::@1->setByte#1] -- vbuz1=vbuc1 
    lda #'m'
    sta.z setByte.b
    jsr setByte
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
    // main::@2
  b2:
    // [11] call setByte 
    // [16] phi from main::@2 to setByte [phi:main::@2->setByte]
  setByte_from_b2:
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3#0 [phi:main::@2->setByte#0] -- pbuz1=pbuc1 
    lda #<b3
    sta.z setByte.ptr
    lda #>b3
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'l' [phi:main::@2->setByte#1] -- vbuz1=vbuc1 
    lda #'l'
    sta.z setByte.b
    jsr setByte
    jmp b3
    // main::@3
  b3:
    // [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 
    lda.z b1
    sta SCREEN
    // [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 
    lda.z b2
    sta SCREEN+1
    // [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 
    lda.z b3
    sta SCREEN+2
    jmp breturn
    // main::@return
  breturn:
    // [15] return 
    rts
}
  // setByte
// setByte(byte* zeropage(3) ptr, byte zeropage(2) b)
setByte: {
    .label b = 2
    .label ptr = 3
    // [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 -- _deref_pbuz1=vbuz2 
    lda.z b
    ldy #0
    sta (ptr),y
    jmp breturn
    // setByte::@return
  breturn:
    // [18] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte) main::b1#0 ← (byte) 0 [ main::b1#0 ] ( main:2 [ main::b1#0 ] ) always clobbers reg byte a 
Statement [5] (byte) main::b2#0 ← (byte) 0 [ main::b1#0 main::b2#0 ] ( main:2 [ main::b1#0 main::b2#0 ] ) always clobbers reg byte a 
Statement [6] (byte) main::b3#0 ← (byte) 0 [ main::b1#0 main::b2#0 main::b3#0 ] ( main:2 [ main::b1#0 main::b2#0 main::b3#0 ] ) always clobbers reg byte a 
Statement [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 [ main::b2#0 main::b3#0 ] ( main:2 [ main::b2#0 main::b3#0 ] ) always clobbers reg byte a 
Statement [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 [ main::b3#0 ] ( main:2 [ main::b3#0 ] ) always clobbers reg byte a 
Statement [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 [ main::b1#0 main::b2#0 main::b3#0 ] ( main:2::setByte:7 [ main::b1#0 main::b2#0 main::b3#0 ] main:2::setByte:9 [ main::b1#0 main::b2#0 main::b3#0 ] main:2::setByte:11 [ main::b1#0 main::b2#0 main::b3#0 ] ) always clobbers reg byte y 
Potential registers zp ZP_BYTE:2 [ setByte::b#3 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_WORD:3 [ setByte::ptr#3 ] : zp ZP_WORD:3 , 
Potential registers zp ZP_BYTE:5 [ main::b1#0 ] : zp ZP_BYTE:5 , 
Potential registers zp ZP_BYTE:6 [ main::b2#0 ] : zp ZP_BYTE:6 , 
Potential registers zp ZP_BYTE:7 [ main::b3#0 ] : zp ZP_BYTE:7 , 

REGISTER UPLIFT SCOPES
Uplift Scope [setByte] 2: zp ZP_BYTE:2 [ setByte::b#3 ] 2: zp ZP_WORD:3 [ setByte::ptr#3 ] 
Uplift Scope [main] 0.36: zp ZP_BYTE:5 [ main::b1#0 ] 0.36: zp ZP_BYTE:6 [ main::b2#0 ] 0.36: zp ZP_BYTE:7 [ main::b3#0 ] 
Uplift Scope [] 

Uplifting [setByte] best 139 combination reg byte x [ setByte::b#3 ] zp ZP_WORD:3 [ setByte::ptr#3 ] 
Uplifting [main] best 139 combination zp ZP_BYTE:5 [ main::b1#0 ] zp ZP_BYTE:6 [ main::b2#0 ] zp ZP_BYTE:7 [ main::b3#0 ] 
Uplifting [] best 139 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ main::b1#0 ]
Uplifting [main] best 139 combination zp ZP_BYTE:5 [ main::b1#0 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ main::b2#0 ]
Uplifting [main] best 139 combination zp ZP_BYTE:6 [ main::b2#0 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ main::b3#0 ]
Uplifting [main] best 139 combination zp ZP_BYTE:7 [ main::b3#0 ] 
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ setByte::ptr#3 ]
Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:4 [ main::b1#0 ]
Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:5 [ main::b2#0 ]
Allocated (was zp ZP_BYTE:7) zp ZP_BYTE:6 [ main::b3#0 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test address-of - pass the pointer as parameter
  // 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 
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    .label SCREEN = $400
    .label b1 = 4
    .label b2 = 5
    .label b3 = 6
    // [4] (byte) main::b1#0 ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z b1
    // [5] (byte) main::b2#0 ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z b2
    // [6] (byte) main::b3#0 ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z b3
    // [7] call setByte 
    // [16] phi from main to setByte [phi:main->setByte]
  setByte_from_main:
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1#0 [phi:main->setByte#0] -- pbuz1=pbuc1 
    lda #<b1
    sta.z setByte.ptr
    lda #>b1
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'c' [phi:main->setByte#1] -- vbuxx=vbuc1 
    ldx #'c'
    jsr setByte
    // [8] phi from main to main::@1 [phi:main->main::@1]
  b1_from_main:
    jmp b1
    // main::@1
  b1:
    // [9] call setByte 
    // [16] phi from main::@1 to setByte [phi:main::@1->setByte]
  setByte_from_b1:
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2#0 [phi:main::@1->setByte#0] -- pbuz1=pbuc1 
    lda #<b2
    sta.z setByte.ptr
    lda #>b2
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'm' [phi:main::@1->setByte#1] -- vbuxx=vbuc1 
    ldx #'m'
    jsr setByte
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  b2_from_b1:
    jmp b2
    // main::@2
  b2:
    // [11] call setByte 
    // [16] phi from main::@2 to setByte [phi:main::@2->setByte]
  setByte_from_b2:
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3#0 [phi:main::@2->setByte#0] -- pbuz1=pbuc1 
    lda #<b3
    sta.z setByte.ptr
    lda #>b3
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'l' [phi:main::@2->setByte#1] -- vbuxx=vbuc1 
    ldx #'l'
    jsr setByte
    jmp b3
    // main::@3
  b3:
    // [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 
    lda.z b1
    sta SCREEN
    // [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 
    lda.z b2
    sta SCREEN+1
    // [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 
    lda.z b3
    sta SCREEN+2
    jmp breturn
    // main::@return
  breturn:
    // [15] return 
    rts
}
  // setByte
// setByte(byte* zeropage(2) ptr, byte register(X) b)
setByte: {
    .label ptr = 2
    // [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (ptr),y
    jmp breturn
    // setByte::@return
  breturn:
    // [18] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_main:
Removing instruction setByte_from_b1:
Removing instruction b2_from_b1:
Removing instruction setByte_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction setByte_from_main:
Removing instruction b1:
Removing instruction b2:
Removing instruction b3:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
(byte) main::b1
(byte) main::b1#0 b1 zp ZP_BYTE:4 0.36363636363636365
(byte) main::b2
(byte) main::b2#0 b2 zp ZP_BYTE:5 0.36363636363636365
(byte) main::b3
(byte) main::b3#0 b3 zp ZP_BYTE:6 0.36363636363636365
(void()) setByte((byte*) setByte::ptr , (byte) setByte::b)
(label) setByte::@return
(byte) setByte::b
(byte) setByte::b#3 reg byte x 2.0
(byte*) setByte::ptr
(byte*) setByte::ptr#3 ptr zp ZP_WORD:2 2.0

reg byte x [ setByte::b#3 ]
zp ZP_WORD:2 [ setByte::ptr#3 ]
zp ZP_BYTE:4 [ main::b1#0 ]
zp ZP_BYTE:5 [ main::b2#0 ]
zp ZP_BYTE:6 [ main::b3#0 ]


FINAL ASSEMBLER
Score: 108

  // File Comments
// Test address-of - pass the pointer as parameter
  // 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 
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    .label SCREEN = $400
    .label b1 = 4
    .label b2 = 5
    .label b3 = 6
    // b1 = 0
    // [4] (byte) main::b1#0 ← (byte) 0 -- vbuz1=vbuc1 
    lda #0
    sta.z b1
    // b2 = 0
    // [5] (byte) main::b2#0 ← (byte) 0 -- vbuz1=vbuc1 
    sta.z b2
    // b3 = 0
    // [6] (byte) main::b3#0 ← (byte) 0 -- vbuz1=vbuc1 
    sta.z b3
    // setByte(&b1, 'c')
    // [7] call setByte 
    // [16] phi from main to setByte [phi:main->setByte]
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b1#0 [phi:main->setByte#0] -- pbuz1=pbuc1 
    lda #<b1
    sta.z setByte.ptr
    lda #>b1
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'c' [phi:main->setByte#1] -- vbuxx=vbuc1 
    ldx #'c'
    jsr setByte
    // [8] phi from main to main::@1 [phi:main->main::@1]
    // main::@1
    // setByte(&b2, 'm')
    // [9] call setByte 
    // [16] phi from main::@1 to setByte [phi:main::@1->setByte]
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b2#0 [phi:main::@1->setByte#0] -- pbuz1=pbuc1 
    lda #<b2
    sta.z setByte.ptr
    lda #>b2
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'm' [phi:main::@1->setByte#1] -- vbuxx=vbuc1 
    ldx #'m'
    jsr setByte
    // [10] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // main::@2
    // setByte(&b3, 'l')
    // [11] call setByte 
    // [16] phi from main::@2 to setByte [phi:main::@2->setByte]
    // [16] phi (byte*) setByte::ptr#3 = &(byte) main::b3#0 [phi:main::@2->setByte#0] -- pbuz1=pbuc1 
    lda #<b3
    sta.z setByte.ptr
    lda #>b3
    sta.z setByte.ptr+1
    // [16] phi (byte) setByte::b#3 = (byte) 'l' [phi:main::@2->setByte#1] -- vbuxx=vbuc1 
    ldx #'l'
    jsr setByte
    // main::@3
    // SCREEN[0] = b1
    // [12] *((const byte*) main::SCREEN#0) ← (byte) main::b1#0 -- _deref_pbuc1=vbuz1 
    lda.z b1
    sta SCREEN
    // SCREEN[1] = b2
    // [13] *((const byte*) main::SCREEN#0+(byte) 1) ← (byte) main::b2#0 -- _deref_pbuc1=vbuz1 
    lda.z b2
    sta SCREEN+1
    // SCREEN[2] = b3
    // [14] *((const byte*) main::SCREEN#0+(byte) 2) ← (byte) main::b3#0 -- _deref_pbuc1=vbuz1 
    lda.z b3
    sta SCREEN+2
    // main::@return
    // }
    // [15] return 
    rts
}
  // setByte
// setByte(byte* zeropage(2) ptr, byte register(X) b)
setByte: {
    .label ptr = 2
    // *ptr = b
    // [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (ptr),y
    // setByte::@return
    // }
    // [18] return 
    rts
}
  // File Data

