Inlined call call __init

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  value#5 = phi( __start::@1/value#9 )
  main::i#0 = 0
  SCREEN[main::i#0] = value#5
  main::i#1 = ++ main::i#0
  value#0 = 'x'
  SCREEN[main::i#1] = value#0
  main::i#2 = ++ main::i#1
  to:main::@return
main::@return: scope:[main]  from main
  value#6 = phi( main/value#0 )
  value#1 = value#6
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  value#2 = 'a'
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  value#9 = phi( __start::__init1/value#2 )
  call main
  to:__start::@2
__start::@2: scope:[__start]  from __start::@1
  value#7 = phi( __start::@1/value#1 )
  value#3 = value#7
  to:__start::@return
__start::@return: scope:[__start]  from __start::@2
  value#8 = phi( __start::@2/value#3 )
  value#4 = value#8
  return 
  to:@return

SYMBOL TABLE SSA
__constant char * const SCREEN = (char *)$400
void __start()
void main()
char main::i
char main::i#0
char main::i#1
char main::i#2
char value
char value#0
char value#1
char value#2
char value#3
char value#4
char value#5
char value#6
char value#7
char value#8
char value#9

Simplifying constant pointer cast (char *) 1024
Successful SSA optimization PassNCastSimplification
Alias value#0 = value#6 value#1 
Alias value#2 = value#9 
Alias value#3 = value#7 value#8 value#4 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values value#5 value#2
Identical Phi Values value#3 value#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant main::i#0 = 0
Constant value#0 = 'x'
Constant value#2 = 'a'
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero SCREEN in [2] SCREEN[main::i#0] = value#2
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable main::i#2 and assignment [3] main::i#2 = ++ main::i#1
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 right-side identified [1] main::i#1 = ++ main::i#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::i#1 = ++main::i#0
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings main::i#0
Inlining constant with different constant siblings main::i#1
Inlining constant with different constant siblings value#0
Inlining constant with different constant siblings value#2
Constant inlined main::i#0 = 0
Constant inlined value#0 = 'x'
Constant inlined main::i#1 = ++0
Constant inlined value#2 = 'a'
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SCREEN+++0)
Successful SSA optimization Pass2ConstantAdditionElimination
Simplifying constant integer increment ++0
Successful SSA optimization Pass2ConstantSimplification
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 = 'a'
  [1] *(SCREEN+1) = 'x'
  to:main::@return
main::@return: scope:[main]  from main
  [2] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()
char main::i
char value

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *SCREEN = 'a' [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [1] *(SCREEN+1) = 'x' [ ] (  [ ] { }  ) 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
// A file using a library
  // Upstart
  // Commodore 64 PRG executable file
.file [name="includes-3.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
.segment Code
  // main
main: {
    // [0] *SCREEN = 'a' -- _deref_pbuc1=vbuc2 
    lda #'a'
    sta SCREEN
    // [1] *(SCREEN+1) = 'x' -- _deref_pbuc1=vbuc2 
    lda #'x'
    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
void main()
char main::i
char value



FINAL ASSEMBLER
Score: 18

  // File Comments
// A file using a library
  // Upstart
  // Commodore 64 PRG executable file
.file [name="includes-3.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
.segment Code
  // main
main: {
    // SCREEN[i++] = value
    // [0] *SCREEN = 'a' -- _deref_pbuc1=vbuc2 
    lda #'a'
    sta SCREEN
    // [1] *(SCREEN+1) = 'x' -- _deref_pbuc1=vbuc2 
    lda #'x'
    sta SCREEN+1
    // main::@return
    // }
    // [2] return 
    rts
}
  // File Data

