Inlined call call __init

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  SCREEN[0] = *cp
  SCREEN[1] = *vp
  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 const char *cp = (const char *)$a003
void main()
__constant volatile char *vp = (volatile char *)$a004

Adding number conversion cast (unumber) 0 in SCREEN[0] = *cp
Adding number conversion cast (unumber) 1 in SCREEN[1] = *vp
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant pointer cast (const char *) 40963
Simplifying constant pointer cast (volatile char *) 40964
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = *cp
Successful SSA optimization PassNSimplifyExpressionWithZero
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
Consolidated array index constant in *(SCREEN+1)
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 = *cp
  [1] *(SCREEN+1) = *vp
  to:main::@return
main::@return: scope:[main]  from main
  [2] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *SCREEN = *cp [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [1] *(SCREEN+1) = *vp [ ] (  [ ] { }  ) always clobbers reg byte a 

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

Uplifting [main] best 25 combination 
Uplifting [] best 25 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Typedef a const/volatile type and instantiate a pointer to it
  // Upstart
  // Commodore 64 PRG executable file
.file [name="typedef-5.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
  .label SCREEN = $400
  .label cp = $a003
  .label vp = $a004
.segment Code
  // main
main: {
    // [0] *SCREEN = *cp -- _deref_pbuc1=_deref_pbuc2 
    lda cp
    sta SCREEN
    // [1] *(SCREEN+1) = *vp -- _deref_pbuc1=_deref_pbuc2 
    lda vp
    sta SCREEN+1
    jmp __breturn
    // main::@return
  __breturn:
    // [2] 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 * const SCREEN = (char *) 1024
__constant const char *cp = (const char *) 40963
void main()
__constant volatile char *vp = (volatile char *) 40964



FINAL ASSEMBLER
Score: 22

  // File Comments
// Typedef a const/volatile type and instantiate a pointer to it
  // Upstart
  // Commodore 64 PRG executable file
.file [name="typedef-5.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
  .label SCREEN = $400
  .label cp = $a003
  .label vp = $a004
.segment Code
  // main
main: {
    // SCREEN[0] = *cp
    // [0] *SCREEN = *cp -- _deref_pbuc1=_deref_pbuc2 
    lda cp
    sta SCREEN
    // SCREEN[1] = *vp
    // [1] *(SCREEN+1) = *vp -- _deref_pbuc1=_deref_pbuc2 
    lda vp
    sta SCREEN+1
    // main::@return
    // }
    // [2] return 
    rts
}
  // File Data

