Setting inferred volatile on symbol affected by address-of (word*~) main::$0 ← & (word) main::w
Resolving sizeof() (byte~) main::$3 ← sizeof  (byte) main::idx
Resolving sizeof() (byte~) main::$5 ← sizeof  (byte) main::b
Resolving sizeof() (byte~) main::$8 ← sizeof  (number~) main::$7
Resolving sizeof() (byte~) main::$12 ← sizeof  (word) main::w
Resolving sizeof() (byte~) main::$14 ← sizeof  (byte*) main::bp
Resolving sizeof() (byte~) main::$16 ← sizeof  (word*) main::wp
Identified constant variable (byte*) main::bp

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) SCREEN#0 ← ((byte*)) (number) $400
  to:@1
main: scope:[main]  from @1
  (byte) main::idx#0 ← (number) 0
  (byte) main::b#0 ← (number) 0
  (word) main::w#0 ← (number) 0
  (byte~) main::$1 ← sizeof  (number) 0
  (byte~) main::$2 ← (byte) '0' + (byte~) main::$1
  *((byte*) SCREEN#0 + (byte) main::idx#0) ← (byte~) main::$2
  (byte) main::idx#1 ← ++ (byte) main::idx#0
  (byte~) main::$3 ← (const byte) SIZEOF_BYTE
  (byte~) main::$4 ← (byte) '0' + (byte~) main::$3
  *((byte*) SCREEN#0 + (byte) main::idx#1) ← (byte~) main::$4
  (byte) main::idx#2 ← ++ (byte) main::idx#1
  (byte~) main::$5 ← (const byte) SIZEOF_BYTE
  (byte~) main::$6 ← (byte) '0' + (byte~) main::$5
  *((byte*) SCREEN#0 + (byte) main::idx#2) ← (byte~) main::$6
  (byte) main::idx#3 ← ++ (byte) main::idx#2
  (byte~) main::$8 ← (const byte) SIZEOF_NUMBER
  (byte~) main::$9 ← (byte) '0' + (byte~) main::$8
  *((byte*) SCREEN#0 + (byte) main::idx#3) ← (byte~) main::$9
  (byte) main::idx#4 ← ++ (byte) main::idx#3
  (byte) main::idx#5 ← ++ (byte) main::idx#4
  (byte~) main::$10 ← sizeof  (number) $43ff
  (byte~) main::$11 ← (byte) '0' + (byte~) main::$10
  *((byte*) SCREEN#0 + (byte) main::idx#5) ← (byte~) main::$11
  (byte) main::idx#6 ← ++ (byte) main::idx#5
  (byte~) main::$12 ← (const byte) SIZEOF_WORD
  (byte~) main::$13 ← (byte) '0' + (byte~) main::$12
  *((byte*) SCREEN#0 + (byte) main::idx#6) ← (byte~) main::$13
  (byte) main::idx#7 ← ++ (byte) main::idx#6
  (byte) main::idx#8 ← ++ (byte) main::idx#7
  (byte~) main::$14 ← (const byte) SIZEOF_POINTER
  (byte~) main::$15 ← (byte) '0' + (byte~) main::$14
  *((byte*) SCREEN#0 + (byte) main::idx#8) ← (byte~) main::$15
  (byte) main::idx#9 ← ++ (byte) main::idx#8
  (byte~) main::$16 ← (const byte) SIZEOF_POINTER
  (byte~) main::$17 ← (byte) '0' + (byte~) main::$16
  *((byte*) SCREEN#0 + (byte) main::idx#9) ← (byte~) main::$17
  (byte) main::idx#10 ← ++ (byte) main::idx#9
  to:main::@return
main::@return: scope:[main]  from main
  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
(byte*) SCREEN
(byte*) SCREEN#0
(const byte) SIZEOF_BYTE = (byte) 1
(const byte) SIZEOF_NUMBER = (byte) $ff
(const byte) SIZEOF_POINTER = (byte) 2
(const byte) SIZEOF_WORD = (byte) 2
(void()) main()
(byte~) main::$1
(byte~) main::$10
(byte~) main::$11
(byte~) main::$12
(byte~) main::$13
(byte~) main::$14
(byte~) main::$15
(byte~) main::$16
(byte~) main::$17
(byte~) main::$2
(byte~) main::$3
(byte~) main::$4
(byte~) main::$5
(byte~) main::$6
(byte~) main::$8
(byte~) main::$9
(label) main::@return
(byte) main::b
(byte) main::b#0
(byte) main::idx
(byte) main::idx#0
(byte) main::idx#1
(byte) main::idx#10
(byte) main::idx#2
(byte) main::idx#3
(byte) main::idx#4
(byte) main::idx#5
(byte) main::idx#6
(byte) main::idx#7
(byte) main::idx#8
(byte) main::idx#9
(word) main::w
(word) main::w#0

Adding number conversion cast (unumber) 0 in (byte) main::idx#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) main::b#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (word) main::w#0 ← (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte) main::idx#0 ← (unumber)(number) 0
Inlining cast (byte) main::b#0 ← (unumber)(number) 0
Inlining cast (word) main::w#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
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [4] (byte~) main::$1 ← sizeof  (number) 0
Constant right-side identified [21] (byte~) main::$10 ← sizeof  (number) $43ff
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) SCREEN#0 = (byte*) 1024
Constant (const byte) main::idx#0 = 0
Constant (const byte) main::$1 = sizeof 0
Constant (const byte) main::$3 = SIZEOF_BYTE
Constant (const byte) main::$5 = SIZEOF_BYTE
Constant (const byte) main::$8 = SIZEOF_NUMBER
Constant (const byte) main::$10 = sizeof $43ff
Constant (const byte) main::$12 = SIZEOF_WORD
Constant (const byte) main::$14 = SIZEOF_POINTER
Constant (const byte) main::$16 = SIZEOF_POINTER
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero SCREEN#0 in [6] *((const byte*) SCREEN#0 + (const byte) main::idx#0) ← (byte~) main::$2
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) main::idx#10 and assignment [27] (byte) main::idx#10 ← ++ (byte) main::idx#9
Successful SSA optimization PassNEliminateUnusedVars
Resolving sizeof() sizeof (number) 0
Resolving sizeof() sizeof (number) $43ff
Successful SSA optimization PassNSizeOfSimplification
Constant right-side identified [2] (byte~) main::$2 ← (byte) '0' + (const byte) main::$1
Constant right-side identified [4] (byte) main::idx#1 ← ++ (const byte) main::idx#0
Constant right-side identified [5] (byte~) main::$4 ← (byte) '0' + (const byte) main::$3
Constant right-side identified [8] (byte~) main::$6 ← (byte) '0' + (const byte) main::$5
Constant right-side identified [11] (byte~) main::$9 ← (byte) '0' + (const byte) main::$8
Constant right-side identified [15] (byte~) main::$11 ← (byte) '0' + (const byte) main::$10
Constant right-side identified [18] (byte~) main::$13 ← (byte) '0' + (const byte) main::$12
Constant right-side identified [22] (byte~) main::$15 ← (byte) '0' + (const byte) main::$14
Constant right-side identified [25] (byte~) main::$17 ← (byte) '0' + (const byte) main::$16
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$2 = '0'+main::$1
Constant (const byte) main::idx#1 = ++main::idx#0
Constant (const byte) main::$4 = '0'+main::$3
Constant (const byte) main::$6 = '0'+main::$5
Constant (const byte) main::$9 = '0'+main::$8
Constant (const byte) main::$11 = '0'+main::$10
Constant (const byte) main::$13 = '0'+main::$12
Constant (const byte) main::$15 = '0'+main::$14
Constant (const byte) main::$17 = '0'+main::$16
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [4] (byte) main::idx#2 ← ++ (const byte) main::idx#1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#2 = ++main::idx#1
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [5] (byte) main::idx#3 ← ++ (const byte) main::idx#2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#3 = ++main::idx#2
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [6] (byte) main::idx#4 ← ++ (const byte) main::idx#3
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#4 = ++main::idx#3
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [6] (byte) main::idx#5 ← ++ (const byte) main::idx#4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#5 = ++main::idx#4
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [7] (byte) main::idx#6 ← ++ (const byte) main::idx#5
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#6 = ++main::idx#5
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [8] (byte) main::idx#7 ← ++ (const byte) main::idx#6
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#7 = ++main::idx#6
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [8] (byte) main::idx#8 ← ++ (const byte) main::idx#7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#8 = ++main::idx#7
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [9] (byte) main::idx#9 ← ++ (const byte) main::idx#8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#9 = ++main::idx#8
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings (const byte) main::idx#0
Inlining constant with different constant siblings (const byte) main::idx#1
Inlining constant with different constant siblings (const byte) main::idx#2
Inlining constant with different constant siblings (const byte) main::idx#3
Inlining constant with different constant siblings (const byte) main::idx#4
Inlining constant with different constant siblings (const byte) main::idx#5
Inlining constant with different constant siblings (const byte) main::idx#6
Inlining constant with different constant siblings (const byte) main::idx#7
Inlining constant with different constant siblings (const byte) main::idx#8
Inlining constant with different constant siblings (const byte) main::idx#9
Constant inlined main::$12 = (const byte) SIZEOF_WORD
Constant inlined main::$13 = (byte) '0'+(const byte) SIZEOF_WORD
Constant inlined main::$14 = (const byte) SIZEOF_POINTER
Constant inlined main::$15 = (byte) '0'+(const byte) SIZEOF_POINTER
Constant inlined main::$10 = (const byte) SIZEOF_NUMBER
Constant inlined main::$11 = (byte) '0'+(const byte) SIZEOF_NUMBER
Constant inlined main::$16 = (const byte) SIZEOF_POINTER
Constant inlined main::$17 = (byte) '0'+(const byte) SIZEOF_POINTER
Constant inlined main::idx#0 = (byte) 0
Constant inlined main::idx#1 = ++(byte) 0
Constant inlined main::idx#2 = ++++(byte) 0
Constant inlined main::$1 = (const byte) SIZEOF_NUMBER
Constant inlined main::idx#3 = ++++++(byte) 0
Constant inlined main::$2 = (byte) '0'+(const byte) SIZEOF_NUMBER
Constant inlined main::idx#4 = ++++++++(byte) 0
Constant inlined main::idx#5 = ++++++++++(byte) 0
Constant inlined main::idx#6 = ++++++++++++(byte) 0
Constant inlined main::$5 = (const byte) SIZEOF_BYTE
Constant inlined main::idx#7 = ++++++++++++++(byte) 0
Constant inlined main::$6 = (byte) '0'+(const byte) SIZEOF_BYTE
Constant inlined main::idx#8 = ++++++++++++++++(byte) 0
Constant inlined main::$3 = (const byte) SIZEOF_BYTE
Constant inlined main::idx#9 = ++++++++++++++++++(byte) 0
Constant inlined main::$4 = (byte) '0'+(const byte) SIZEOF_BYTE
Constant inlined main::$9 = (byte) '0'+(const byte) SIZEOF_NUMBER
Constant inlined main::$8 = (const byte) SIZEOF_NUMBER
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SCREEN#0+++0)
Consolidated array index constant in *(SCREEN#0+++++0)
Consolidated array index constant in *(SCREEN#0+++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++++++++++0)
Consolidated array index constant in *(SCREEN#0+++++++++++++++++++0)
Successful SSA optimization Pass2ConstantAdditionElimination
Simplifying constant integer increment ++0
Simplifying constant integer increment ++0
Simplifying constant integer increment ++1
Simplifying constant integer increment ++2
Simplifying constant integer increment ++3
Simplifying constant integer increment ++4
Simplifying constant integer increment ++5
Successful SSA optimization Pass2ConstantSimplification
Simplifying constant integer increment ++1
Simplifying constant integer increment ++2
Simplifying constant integer increment ++4
Simplifying constant integer increment ++5
Simplifying constant integer increment ++6
Simplifying constant integer increment ++7
Successful SSA optimization Pass2ConstantSimplification
Simplifying constant integer increment ++7
Simplifying constant integer increment ++8
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
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

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::b#0 ← (byte) 0
  [5] (word) main::w#0 ← (byte) 0
  [6] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_NUMBER
  [7] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_BYTE
  [8] *((const byte*) SCREEN#0+(byte) 2) ← (byte) '0'+(const byte) SIZEOF_BYTE
  [9] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_NUMBER
  [10] *((const byte*) SCREEN#0+(byte) 5) ← (byte) '0'+(const byte) SIZEOF_NUMBER
  [11] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) SIZEOF_WORD
  [12] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) SIZEOF_POINTER
  [13] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) SIZEOF_POINTER
  to:main::@return
main::@return: scope:[main]  from main
  [14] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte*) SCREEN
(void()) main()
(byte) main::b
(byte) main::b#0 20.0
(byte) main::idx
(word) main::w
(word) main::w#0 20.0

Initial phi equivalence classes
Complete equivalence classes
[ main::b#0 ]
[ main::w#0 ]
Allocated zp ZP_BYTE:2 [ main::b#0 ]
Allocated zp ZP_WORD:3 [ main::w#0 ]

INITIAL ASM
Target platform is c64basic
  // File Comments
// Tests the sizeof() operator on values/expressions
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_BYTE = 1
  .const SIZEOF_NUMBER = $ff
  .const SIZEOF_WORD = 2
  .const SIZEOF_POINTER = 2
  .label SCREEN = $400
  // @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 b = 2
    .label w = 3
    // [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1 
    // Simple types
    lda #0
    sta.z b
    // [5] (word) main::w#0 ← (byte) 0 -- vwuz1=vbuc1 
    lda #<0
    sta.z w
    lda #>0
    sta.z w+1
    // [6] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_NUMBER
    sta SCREEN
    // [7] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_BYTE
    sta SCREEN+1
    // [8] *((const byte*) SCREEN#0+(byte) 2) ← (byte) '0'+(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_BYTE
    sta SCREEN+2
    // [9] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_NUMBER
    sta SCREEN+3
    // [10] *((const byte*) SCREEN#0+(byte) 5) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_NUMBER
    sta SCREEN+5
    // [11] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_WORD
    sta SCREEN+6
    // [12] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) SIZEOF_POINTER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_POINTER
    sta SCREEN+8
    // [13] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) SIZEOF_POINTER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_POINTER
    sta SCREEN+9
    jmp breturn
    // main::@return
  breturn:
    // [14] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] (byte) main::b#0 ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [5] (word) main::w#0 ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_NUMBER [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_BYTE [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [8] *((const byte*) SCREEN#0+(byte) 2) ← (byte) '0'+(const byte) SIZEOF_BYTE [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [9] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_NUMBER [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [10] *((const byte*) SCREEN#0+(byte) 5) ← (byte) '0'+(const byte) SIZEOF_NUMBER [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [11] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) SIZEOF_WORD [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [12] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) SIZEOF_POINTER [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [13] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) SIZEOF_POINTER [ ] ( main:2 [ ] ) always clobbers reg byte a 
Potential registers zp ZP_BYTE:2 [ main::b#0 ] : zp ZP_BYTE:2 , 
Potential registers zp ZP_WORD:3 [ main::w#0 ] : zp ZP_WORD:3 , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp ZP_BYTE:2 [ main::b#0 ] 20: zp ZP_WORD:3 [ main::w#0 ] 
Uplift Scope [] 

Uplifting [main] best 84 combination zp ZP_BYTE:2 [ main::b#0 ] zp ZP_WORD:3 [ main::w#0 ] 
Uplifting [] best 84 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::b#0 ]
Uplifting [main] best 84 combination zp ZP_BYTE:2 [ main::b#0 ] 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests the sizeof() operator on values/expressions
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_BYTE = 1
  .const SIZEOF_NUMBER = $ff
  .const SIZEOF_WORD = 2
  .const SIZEOF_POINTER = 2
  .label SCREEN = $400
  // @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 b = 2
    .label w = 3
    // [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1 
    // Simple types
    lda #0
    sta.z b
    // [5] (word) main::w#0 ← (byte) 0 -- vwuz1=vbuc1 
    lda #<0
    sta.z w
    lda #>0
    sta.z w+1
    // [6] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_NUMBER
    sta SCREEN
    // [7] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_BYTE
    sta SCREEN+1
    // [8] *((const byte*) SCREEN#0+(byte) 2) ← (byte) '0'+(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_BYTE
    sta SCREEN+2
    // [9] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_NUMBER
    sta SCREEN+3
    // [10] *((const byte*) SCREEN#0+(byte) 5) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_NUMBER
    sta SCREEN+5
    // [11] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_WORD
    sta SCREEN+6
    // [12] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) SIZEOF_POINTER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_POINTER
    sta SCREEN+8
    // [13] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) SIZEOF_POINTER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_POINTER
    sta SCREEN+9
    jmp breturn
    // main::@return
  breturn:
    // [14] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #<0
Removing instruction lda #>0
Removing instruction lda #'0'+SIZEOF_BYTE
Removing instruction lda #'0'+SIZEOF_NUMBER
Removing instruction lda #'0'+SIZEOF_POINTER
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction bend_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
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
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
(const byte) SIZEOF_BYTE SIZEOF_BYTE = (byte) 1
(const byte) SIZEOF_NUMBER SIZEOF_NUMBER = (byte) $ff
(const byte) SIZEOF_POINTER SIZEOF_POINTER = (byte) 2
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte) 2
(void()) main()
(label) main::@return
(byte) main::b
(byte) main::b#0 b zp ZP_BYTE:2 20.0
(byte) main::idx
(word) main::w
(word) main::w#0 w zp ZP_WORD:3 20.0

zp ZP_BYTE:2 [ main::b#0 ]
zp ZP_WORD:3 [ main::w#0 ]


FINAL ASSEMBLER
Score: 59

  // File Comments
// Tests the sizeof() operator on values/expressions
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .const SIZEOF_BYTE = 1
  .const SIZEOF_NUMBER = $ff
  .const SIZEOF_WORD = 2
  .const SIZEOF_POINTER = 2
  .label SCREEN = $400
  // @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 b = 2
    .label w = 3
    // b = 0
    // [4] (byte) main::b#0 ← (byte) 0 -- vbuz1=vbuc1 
    // Simple types
    lda #0
    sta.z b
    // w = 0
    // [5] (word) main::w#0 ← (byte) 0 -- vwuz1=vbuc1 
    sta.z w
    sta.z w+1
    // SCREEN[idx++] = '0'+sizeof(0)
    // [6] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_NUMBER
    sta SCREEN
    // SCREEN[idx++] = '0'+sizeof(idx)
    // [7] *((const byte*) SCREEN#0+(byte) 1) ← (byte) '0'+(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_BYTE
    sta SCREEN+1
    // SCREEN[idx++] = '0'+sizeof(b)
    // [8] *((const byte*) SCREEN#0+(byte) 2) ← (byte) '0'+(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    sta SCREEN+2
    // SCREEN[idx++] = '0'+sizeof(b*2)
    // [9] *((const byte*) SCREEN#0+(byte) 3) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_NUMBER
    sta SCREEN+3
    // SCREEN[idx++] = '0'+sizeof($43ff)
    // [10] *((const byte*) SCREEN#0+(byte) 5) ← (byte) '0'+(const byte) SIZEOF_NUMBER -- _deref_pbuc1=vbuc2 
    sta SCREEN+5
    // SCREEN[idx++] = '0'+sizeof(w)
    // [11] *((const byte*) SCREEN#0+(byte) 6) ← (byte) '0'+(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_WORD
    sta SCREEN+6
    // SCREEN[idx++] = '0'+sizeof(bp)
    // [12] *((const byte*) SCREEN#0+(byte) 8) ← (byte) '0'+(const byte) SIZEOF_POINTER -- _deref_pbuc1=vbuc2 
    lda #'0'+SIZEOF_POINTER
    sta SCREEN+8
    // SCREEN[idx++] = '0'+sizeof(wp)
    // [13] *((const byte*) SCREEN#0+(byte) 9) ← (byte) '0'+(const byte) SIZEOF_POINTER -- _deref_pbuc1=vbuc2 
    sta SCREEN+9
    // main::@return
    // }
    // [14] return 
    rts
}
  // File Data

