Eliminating unused variable with no statement main::$0

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  main::$1 = main::w2 - main::w1
  main::wd#0 = main::$1 / SIZEOF_UNSIGNED_INT
  *main::SCREEN = main::wd#0
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  call main
  to:__start::@1
__start::@1: scope:[__start]  from __start
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  return 
  to:@return

SYMBOL TABLE SSA
__constant char SIZEOF_UNSIGNED_INT = 2
void __start()
void main()
unsigned int main::$1
__constant unsigned int * const main::SCREEN = (unsigned int *)$400
__constant unsigned int *main::w1 = (unsigned int *)$1000
__constant unsigned int *main::w2 = (unsigned int *)$1140
unsigned int main::wd
unsigned int main::wd#0

Simplifying constant pointer cast (unsigned int *) 1024
Simplifying constant pointer cast (unsigned int *) 4096
Simplifying constant pointer cast (unsigned int *) 4416
Successful SSA optimization PassNCastSimplification
Constant right-side identified [0] main::$1 = main::w2 - main::w1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::$1 = main::w2-main::w1
Successful SSA optimization Pass2ConstantIdentification
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Constant right-side identified [0] main::wd#0 = main::$1 / SIZEOF_UNSIGNED_INT
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::wd#0 = main::$1/SIZEOF_UNSIGNED_INT
Successful SSA optimization Pass2ConstantIdentification
Constant inlined main::$1 = main::w2-main::w1
Successful SSA optimization Pass2ConstantInlining
CALL GRAPH

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] *main::SCREEN = main::wd#0
  to:main::@return
main::@return: scope:[main]  from main
  [1] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()
unsigned int main::wd

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *main::SCREEN = main::wd#0 [ ] (  [ ] { }  ) always clobbers reg byte a 

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

Uplifting [main] best 21 combination 
Uplifting [] best 21 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests word pointer math - subtracting two word pointers
  // Upstart
  // Commodore 64 PRG executable file
.file [name="word-pointer-math-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const SIZEOF_UNSIGNED_INT = 2
.segment Code
  // main
main: {
    .const wd = (w2-w1)/SIZEOF_UNSIGNED_INT
    .label SCREEN = $400
    .label w1 = $1000
    .label w2 = $1140
    // [0] *main::SCREEN = main::wd#0 -- _deref_pwuc1=vwuc2 
    lda #<wd
    sta SCREEN
    lda #>wd
    sta SCREEN+1
    jmp __breturn
    // main::@return
  __breturn:
    // [1] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
__constant char SIZEOF_UNSIGNED_INT = 2
void main()
__constant unsigned int * const main::SCREEN = (unsigned int *) 1024
__constant unsigned int *main::w1 = (unsigned int *) 4096
__constant unsigned int *main::w2 = (unsigned int *) 4416
unsigned int main::wd
__constant unsigned int main::wd#0 = main::w2-main::w1/SIZEOF_UNSIGNED_INT // wd



FINAL ASSEMBLER
Score: 18

  // File Comments
// Tests word pointer math - subtracting two word pointers
  // Upstart
  // Commodore 64 PRG executable file
.file [name="word-pointer-math-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const SIZEOF_UNSIGNED_INT = 2
.segment Code
  // main
main: {
    .const wd = (w2-w1)/SIZEOF_UNSIGNED_INT
    .label SCREEN = $400
    .label w1 = $1000
    .label w2 = $1140
    // *SCREEN = wd
    // [0] *main::SCREEN = main::wd#0 -- _deref_pwuc1=vwuc2 
    lda #<wd
    sta SCREEN
    lda #>wd
    sta SCREEN+1
    // main::@return
    // }
    // [1] return 
    rts
}
  // File Data

