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

(void()) main()
main: scope:[main]  from @1
  (byte) main::idx#0 ← (byte) 0
  (byte~) main::$0 ← sizeof  (const byte*) main::ba
  (byte~) main::$1 ← (byte~) main::$0 / (const byte) SIZEOF_BYTE
  (byte~) main::$2 ← (byte) '0' + (byte~) main::$1
  *((const byte*) SCREEN + (byte) main::idx#0) ← (byte~) main::$2
  (byte) main::idx#1 ← ++ (byte) main::idx#0
  (byte~) main::$3 ← sizeof  (const word*) main::wa
  (byte~) main::$4 ← (byte~) main::$3 / (const byte) SIZEOF_WORD
  (byte~) main::$5 ← (byte) '0' + (byte~) main::$4
  *((const byte*) SCREEN + (byte) main::idx#1) ← (byte~) main::$5
  (byte) main::idx#2 ← ++ (byte) main::idx#1
  (byte~) main::$6 ← sizeof  (const byte*) main::bb
  (byte~) main::$7 ← (byte~) main::$6 / (const byte) SIZEOF_BYTE
  (byte~) main::$8 ← (byte) '0' + (byte~) main::$7
  *((const byte*) SCREEN + (byte) main::idx#2) ← (byte~) main::$8
  (byte) main::idx#3 ← ++ (byte) main::idx#2
  (byte~) main::$9 ← sizeof  (const word*) main::wb
  (byte~) main::$10 ← (byte~) main::$9 / (const byte) SIZEOF_WORD
  (byte~) main::$11 ← (byte) '0' + (byte~) main::$10
  *((const byte*) SCREEN + (byte) main::idx#3) ← (byte~) main::$11
  (byte) main::idx#4 ← ++ (byte) main::idx#3
  (byte~) main::$12 ← sizeof  (const byte*) main::sa
  (byte~) main::$13 ← (byte~) main::$12 / (const byte) SIZEOF_BYTE
  (byte~) main::$14 ← (byte) '0' + (byte~) main::$13
  *((const byte*) SCREEN + (byte) main::idx#4) ← (byte~) main::$14
  (byte) main::idx#5 ← ++ (byte) main::idx#4
  (byte~) main::$15 ← sizeof  (const byte*) main::sb
  (byte~) main::$16 ← (byte~) main::$15 / (const byte) SIZEOF_BYTE
  (byte~) main::$17 ← (byte) '0' + (byte~) main::$16
  *((const byte*) SCREEN + (byte) main::idx#5) ← (byte~) main::$17
  (byte) main::idx#6 ← ++ (byte) main::idx#5
  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
(const byte*) SCREEN = (byte*)(number) $400
(const byte) SIZEOF_BYTE = (byte) 1
(const byte) SIZEOF_WORD = (byte) 2
(void()) main()
(byte~) main::$0
(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::$7
(byte~) main::$8
(byte~) main::$9
(label) main::@return
(const byte*) main::ba[(number) 3]  = { fill( 3, 0) }
(const byte*) main::bb[(const byte) main::sz+(number) 2]  = { fill( main::sz+2, 0) }
(byte) main::idx
(byte) main::idx#0
(byte) main::idx#1
(byte) main::idx#2
(byte) main::idx#3
(byte) main::idx#4
(byte) main::idx#5
(byte) main::idx#6
(const byte*) main::sa[]  = (byte*) "camelot"
(const byte*) main::sb[]  = { (byte) 'a', (byte) 'b', (byte) 'c', (byte) 0 }
(const byte) main::sz = (byte) 7
(const word*) main::wa[(number) 3]  = { fill( 3, 0) }
(const word*) main::wb[]  = { (word) 1, (word) 2, (word) 3, (word) 4 }

Adding number conversion cast (unumber) 2 in 
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [1] (byte~) main::$0 ← sizeof  (const byte*) main::ba
Constant right-side identified [6] (byte~) main::$3 ← sizeof  (const word*) main::wa
Constant right-side identified [11] (byte~) main::$6 ← sizeof  (const byte*) main::bb
Constant right-side identified [16] (byte~) main::$9 ← sizeof  (const word*) main::wb
Constant right-side identified [21] (byte~) main::$12 ← sizeof  (const byte*) main::sa
Constant right-side identified [26] (byte~) main::$15 ← sizeof  (const byte*) main::sb
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#0 = 0
Constant (const byte) main::$0 = sizeof main::ba
Constant (const byte) main::$3 = sizeof main::wa
Constant (const byte) main::$6 = sizeof main::bb
Constant (const byte) main::$9 = sizeof main::wb
Constant (const byte) main::$12 = sizeof main::sa
Constant (const byte) main::$15 = sizeof main::sb
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero SCREEN in [4] *((const byte*) SCREEN + (const byte) main::idx#0) ← (byte~) main::$2
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) main::idx#6 and assignment [23] (byte) main::idx#6 ← ++ (byte) main::idx#5
Successful SSA optimization PassNEliminateUnusedVars
Resolving array sizeof() sizeof (const byte*) main::ba
Resolving array sizeof() sizeof (const word*) main::wa
Resolving array sizeof() sizeof (const byte*) main::bb
Resolving array sizeof() sizeof (const word*) main::wb
Resolving string sizeof() sizeof (const byte*) main::sa
Resolving array sizeof() sizeof (const byte*) main::sb
Successful SSA optimization PassNSizeOfSimplification
Constant right-side identified [0] (byte~) main::$1 ← (const byte) main::$0 / (const byte) SIZEOF_BYTE
Constant right-side identified [3] (byte) main::idx#1 ← ++ (const byte) main::idx#0
Constant right-side identified [4] (byte~) main::$4 ← (const byte) main::$3 / (const byte) SIZEOF_WORD
Constant right-side identified [8] (byte~) main::$7 ← (const byte) main::$6 / (const byte) SIZEOF_BYTE
Constant right-side identified [12] (byte~) main::$10 ← (const byte) main::$9 / (const byte) SIZEOF_WORD
Constant right-side identified [16] (byte~) main::$13 ← (const byte) main::$12 / (const byte) SIZEOF_BYTE
Constant right-side identified [20] (byte~) main::$16 ← (const byte) main::$15 / (const byte) SIZEOF_BYTE
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$1 = main::$0/SIZEOF_BYTE
Constant (const byte) main::idx#1 = ++main::idx#0
Constant (const byte) main::$4 = main::$3/SIZEOF_WORD
Constant (const byte) main::$7 = main::$6/SIZEOF_BYTE
Constant (const byte) main::$10 = main::$9/SIZEOF_WORD
Constant (const byte) main::$13 = main::$12/SIZEOF_BYTE
Constant (const byte) main::$16 = main::$15/SIZEOF_BYTE
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const byte*) main::ba
Eliminating unused constant (const word*) main::wa
Eliminating unused constant (const byte*) main::bb
Eliminating unused constant (const word*) main::wb
Eliminating unused constant (const byte*) main::sa
Eliminating unused constant (const byte*) main::sb
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) 3 in 
Adding number conversion cast (unumber) 3 in 
Adding number conversion cast (unumber) 4 in 
Adding number conversion cast (unumber) 8 in 
Adding number conversion cast (unumber) 4 in 
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 3
Simplifying constant integer cast 3
Simplifying constant integer cast 4
Simplifying constant integer cast 8
Simplifying constant integer cast 4
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 3
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 4
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [0] (byte~) main::$2 ← (byte) '0' + (const byte) main::$1
Constant right-side identified [2] (byte~) main::$5 ← (byte) '0' + (const byte) main::$4
Constant right-side identified [4] (byte) main::idx#2 ← ++ (const byte) main::idx#1
Constant right-side identified [5] (byte~) main::$8 ← (byte) '0' + (const byte) main::$7
Constant right-side identified [8] (byte~) main::$11 ← (byte) '0' + (const byte) main::$10
Constant right-side identified [11] (byte~) main::$14 ← (byte) '0' + (const byte) main::$13
Constant right-side identified [14] (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::$5 = '0'+main::$4
Constant (const byte) main::idx#2 = ++main::idx#1
Constant (const byte) main::$8 = '0'+main::$7
Constant (const byte) main::$11 = '0'+main::$10
Constant (const byte) main::$14 = '0'+main::$13
Constant (const byte) main::$17 = '0'+main::$16
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [3] (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 [4] (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 [5] (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
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
Constant inlined main::$12 = (byte) 8*(const byte) SIZEOF_BYTE
Constant inlined main::$13 = (byte) 8*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
Constant inlined main::$14 = (byte) '0'+(byte) 8*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
Constant inlined main::$15 = (byte) 4*(const byte) SIZEOF_BYTE
Constant inlined main::$10 = (byte) 4*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD
Constant inlined main::$11 = (byte) '0'+(byte) 4*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD
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 = (byte) 3*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
Constant inlined main::$16 = (byte) 4*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
Constant inlined main::idx#3 = ++++++(byte) 0
Constant inlined main::$2 = (byte) '0'+(byte) 3*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
Constant inlined main::$17 = (byte) '0'+(byte) 4*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
Constant inlined main::idx#4 = ++++++++(byte) 0
Constant inlined main::idx#5 = ++++++++++(byte) 0
Constant inlined main::$0 = (byte) 3*(const byte) SIZEOF_BYTE
Constant inlined main::$5 = (byte) '0'+(byte) 3*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD
Constant inlined main::$6 = (const byte) main::sz+(byte) 2*(const byte) SIZEOF_BYTE
Constant inlined main::$3 = (byte) 3*(const byte) SIZEOF_WORD
Constant inlined main::$4 = (byte) 3*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD
Constant inlined main::$9 = (byte) 4*(const byte) SIZEOF_WORD
Constant inlined main::$7 = (const byte) main::sz+(byte) 2*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
Constant inlined main::$8 = (byte) '0'+(const byte) main::sz+(byte) 2*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SCREEN+++0)
Consolidated array index constant in *(SCREEN+++++0)
Consolidated array index constant in *(SCREEN+++++++0)
Consolidated array index constant in *(SCREEN+++++++++0)
Consolidated array index constant in *(SCREEN+++++++++++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
Successful SSA optimization Pass2ConstantSimplification
Simplifying constant integer increment ++1
Simplifying constant integer increment ++2
Simplifying constant integer increment ++3
Simplifying constant integer increment ++4
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()

(void()) main()
main: scope:[main]  from @1
  [4] *((const byte*) SCREEN) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
  [5] *((const byte*) SCREEN+(byte) 1) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD
  [6] *((const byte*) SCREEN+(byte) 2) ← (byte) '0'+(const byte) main::sz+(byte) 2*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
  [7] *((const byte*) SCREEN+(byte) 3) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD
  [8] *((const byte*) SCREEN+(byte) 4) ← (byte) '0'+(byte) 8*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
  [9] *((const byte*) SCREEN+(byte) 5) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE
  to:main::@return
main::@return: scope:[main]  from main
  [10] return 
  to:@return


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

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Tests the sizeof() operator on arrays
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .const SIZEOF_BYTE = 1
  .const SIZEOF_WORD = 2
  // @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: {
    .const sz = 7
    // [4] *((const byte*) SCREEN) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+3*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN
    // [5] *((const byte*) SCREEN+(byte) 1) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+3*SIZEOF_WORD/SIZEOF_WORD
    sta SCREEN+1
    // [6] *((const byte*) SCREEN+(byte) 2) ← (byte) '0'+(const byte) main::sz+(byte) 2*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+(sz+2)*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+2
    // [7] *((const byte*) SCREEN+(byte) 3) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+4*SIZEOF_WORD/SIZEOF_WORD
    sta SCREEN+3
    // [8] *((const byte*) SCREEN+(byte) 4) ← (byte) '0'+(byte) 8*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+8*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+4
    // [9] *((const byte*) SCREEN+(byte) 5) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+4*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+5
    jmp __breturn
    // main::@return
  __breturn:
    // [10] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const byte*) SCREEN) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [5] *((const byte*) SCREEN+(byte) 1) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [6] *((const byte*) SCREEN+(byte) 2) ← (byte) '0'+(const byte) main::sz+(byte) 2*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) SCREEN+(byte) 3) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [8] *((const byte*) SCREEN+(byte) 4) ← (byte) '0'+(byte) 8*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [9] *((const byte*) SCREEN+(byte) 5) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE [ ] ( main:2 [ ] ) always clobbers reg byte a 

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

Uplifting [main] best 57 combination 
Uplifting [] best 57 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests the sizeof() operator on arrays
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .const SIZEOF_BYTE = 1
  .const SIZEOF_WORD = 2
  // @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: {
    .const sz = 7
    // [4] *((const byte*) SCREEN) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+3*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN
    // [5] *((const byte*) SCREEN+(byte) 1) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+3*SIZEOF_WORD/SIZEOF_WORD
    sta SCREEN+1
    // [6] *((const byte*) SCREEN+(byte) 2) ← (byte) '0'+(const byte) main::sz+(byte) 2*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+(sz+2)*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+2
    // [7] *((const byte*) SCREEN+(byte) 3) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+4*SIZEOF_WORD/SIZEOF_WORD
    sta SCREEN+3
    // [8] *((const byte*) SCREEN+(byte) 4) ← (byte) '0'+(byte) 8*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+8*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+4
    // [9] *((const byte*) SCREEN+(byte) 5) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+4*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+5
    jmp __breturn
    // main::@return
  __breturn:
    // [10] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
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 __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte*) SCREEN = (byte*) 1024
(const byte) SIZEOF_BYTE = (byte) 1
(const byte) SIZEOF_WORD = (byte) 2
(void()) main()
(label) main::@return
(byte) main::idx
(const byte) main::sz = (byte) 7



FINAL ASSEMBLER
Score: 42

  // File Comments
// Tests the sizeof() operator on arrays
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  .const SIZEOF_BYTE = 1
  .const SIZEOF_WORD = 2
  // @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: {
    .const sz = 7
    // SCREEN[idx++] = '0'+sizeof(ba)/sizeof(byte)
    // [4] *((const byte*) SCREEN) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+3*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN
    // SCREEN[idx++] = '0'+sizeof(wa)/sizeof(word)
    // [5] *((const byte*) SCREEN+(byte) 1) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+3*SIZEOF_WORD/SIZEOF_WORD
    sta SCREEN+1
    // SCREEN[idx++] = '0'+sizeof(bb)/sizeof(byte)
    // [6] *((const byte*) SCREEN+(byte) 2) ← (byte) '0'+(const byte) main::sz+(byte) 2*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+(sz+2)*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+2
    // SCREEN[idx++] = '0'+sizeof(wb)/sizeof(word)
    // [7] *((const byte*) SCREEN+(byte) 3) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_WORD/(const byte) SIZEOF_WORD -- _deref_pbuc1=vbuc2 
    lda #'0'+4*SIZEOF_WORD/SIZEOF_WORD
    sta SCREEN+3
    // SCREEN[idx++] = '0'+sizeof(sa)/sizeof(byte)
    // [8] *((const byte*) SCREEN+(byte) 4) ← (byte) '0'+(byte) 8*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+8*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+4
    // SCREEN[idx++] = '0'+sizeof(sb)/sizeof(byte)
    // [9] *((const byte*) SCREEN+(byte) 5) ← (byte) '0'+(byte) 4*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE -- _deref_pbuc1=vbuc2 
    lda #'0'+4*SIZEOF_BYTE/SIZEOF_BYTE
    sta SCREEN+5
    // main::@return
    // }
    // [10] return 
    rts
}
  // File Data

