Inlined call call __init

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  SCREEN[0] = b
  main::$0 = byte0  w
  SCREEN[2] = main::$0
  main::$1 = byte1  w
  SCREEN[3] = main::$1
  main::$2 = byte0  ptr
  SCREEN[5] = main::$2
  main::$3 = byte1  ptr
  SCREEN[5] = main::$3
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return

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

SYMBOL TABLE SSA
__constant char * const SCREEN = (char *)$400
void __start()
__constant char b = 0
void main()
char main::$0
char main::$1
char main::$2
char main::$3
__constant char *ptr = (char *) 0
__constant unsigned int w = 0

Adding number conversion cast (unumber) 0 in SCREEN[0] = b
Adding number conversion cast (unumber) 2 in SCREEN[2] = main::$0
Adding number conversion cast (unumber) 3 in SCREEN[3] = main::$1
Adding number conversion cast (unumber) 5 in SCREEN[5] = main::$2
Adding number conversion cast (unumber) 5 in SCREEN[5] = main::$3
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) 5
Finalized unsigned number type (char) 5
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [1] main::$0 = byte0  w
Constant right-side identified [3] main::$1 = byte1  w
Constant right-side identified [5] main::$2 = byte0  ptr
Constant right-side identified [7] main::$3 = byte1  ptr
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::$0 = byte0 w
Constant main::$1 = byte1 w
Constant main::$2 = byte0 ptr
Constant main::$3 = byte1 ptr
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero byte0 w in 
Simplifying constant evaluating to zero byte1 w in 
Simplifying constant evaluating to zero byte0 ptr in 
Simplifying constant evaluating to zero byte1 ptr in 
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = b
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant w
Eliminating unused constant ptr
Successful SSA optimization PassNEliminateUnusedVars
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::__init1
Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Constant inlined main::$3 = 0
Constant inlined main::$1 = 0
Constant inlined main::$2 = 0
Constant inlined main::$0 = 0
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SCREEN+2)
Consolidated array index constant in *(SCREEN+3)
Consolidated array index constant in *(SCREEN+5)
Consolidated array index constant in *(SCREEN+5)
Successful SSA optimization Pass2ConstantAdditionElimination
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] *SCREEN = b
  [1] *(SCREEN+2) = 0
  [2] *(SCREEN+3) = 0
  [3] *(SCREEN+5) = 0
  [4] *(SCREEN+5) = 0
  to:main::@return
main::@return: scope:[main]  from main
  [5] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *SCREEN = b [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [1] *(SCREEN+2) = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [2] *(SCREEN+3) = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [3] *(SCREEN+5) = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [4] *(SCREEN+5) = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 

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

Uplifting [main] best 39 combination 
Uplifting [] best 39 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests uninitialized values of variables.
  // Upstart
  // Commodore 64 PRG executable file
.file [name="uninitialized.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 b = 0
  .label SCREEN = $400
.segment Code
  // main
main: {
    // [0] *SCREEN = b -- _deref_pbuc1=vbuc2 
    lda #b
    sta SCREEN
    // [1] *(SCREEN+2) = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SCREEN+2
    // [2] *(SCREEN+3) = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SCREEN+3
    // [3] *(SCREEN+5) = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SCREEN+5
    // [4] *(SCREEN+5) = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SCREEN+5
    jmp __breturn
    // main::@return
  __breturn:
    // [5] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
__constant char * const SCREEN = (char *) 1024
__constant char b = 0
void main()



FINAL ASSEMBLER
Score: 30

  // File Comments
// Tests uninitialized values of variables.
  // Upstart
  // Commodore 64 PRG executable file
.file [name="uninitialized.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 b = 0
  .label SCREEN = $400
.segment Code
  // main
main: {
    // SCREEN[0] = b
    // [0] *SCREEN = b -- _deref_pbuc1=vbuc2 
    lda #b
    sta SCREEN
    // SCREEN[2] = BYTE0(w)
    // [1] *(SCREEN+2) = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta SCREEN+2
    // SCREEN[3] = BYTE1(w)
    // [2] *(SCREEN+3) = 0 -- _deref_pbuc1=vbuc2 
    sta SCREEN+3
    // SCREEN[5] = BYTE0(ptr)
    // [3] *(SCREEN+5) = 0 -- _deref_pbuc1=vbuc2 
    sta SCREEN+5
    // SCREEN[5] = BYTE1(ptr)
    // [4] *(SCREEN+5) = 0 -- _deref_pbuc1=vbuc2 
    sta SCREEN+5
    // main::@return
    // }
    // [5] return 
    rts
}
  // File Data

