Inlined call call __init

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  main::idx#0 = 0
  SCREEN[main::idx#0] = '0'+4
  main::idx#1 = ++ main::idx#0
  SCREEN[main::idx#1] = 'b'+'b'
  main::idx#2 = ++ main::idx#1
  SCREEN[main::idx#2] = 'c'*'c'
  main::idx#3 = ++ main::idx#2
  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 *SCREEN = (char *)$400
void __start()
void main()
char main::idx
char main::idx#0
char main::idx#1
char main::idx#2
char main::idx#3

Adding number conversion cast (unumber) '0'+4 in SCREEN[main::idx#0] = '0'+4
Adding number conversion cast (unumber) 4 in SCREEN[main::idx#0] = ((unumber)) '0'+4
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast SCREEN[main::idx#0] = (unumber)'0'+(unumber)4
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast '0'+(unumber)4
Simplifying constant integer cast 4
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 4
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant main::idx#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero SCREEN in [1] SCREEN[main::idx#0] = '0'+4
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable main::idx#3 and assignment [5] main::idx#3 = ++ main::idx#2
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::idx#1 = ++ main::idx#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::idx#1 = ++main::idx#0
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [2] main::idx#2 = ++ main::idx#1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::idx#2 = ++main::idx#1
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings main::idx#0
Inlining constant with different constant siblings main::idx#1
Inlining constant with different constant siblings main::idx#2
Constant inlined main::idx#0 = 0
Constant inlined main::idx#1 = ++0
Constant inlined main::idx#2 = ++++0
Successful SSA optimization Pass2ConstantInlining
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
Successful SSA optimization Pass2ConstantSimplification
Simplifying constant integer increment ++1
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 = '0'+4
  [1] *(SCREEN+1) = 'b'+'b'
  [2] *(SCREEN+2) = 'c'*'c'
  to:main::@return
main::@return: scope:[main]  from main
  [3] return 
  to:@return


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

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

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

Uplifting [main] best 27 combination 
Uplifting [] best 27 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test the preprocessor
// Macro with parameters
  // Upstart
  // Commodore 64 PRG executable file
.file [name="preprocessor-9.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 = '0'+4 -- _deref_pbuc1=vbuc2 
    lda #'0'+4
    sta SCREEN
    // [1] *(SCREEN+1) = 'b'+'b' -- _deref_pbuc1=vbuc2 
    lda #'b'+'b'
    sta SCREEN+1
    // [2] *(SCREEN+2) = 'c'*'c' -- _deref_pbuc1=vbuc2 
    lda #'c'*'c'
    sta SCREEN+2
    jmp __breturn
    // main::@return
  __breturn:
    // [3] 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 *SCREEN = (char *) 1024
void main()
char main::idx



FINAL ASSEMBLER
Score: 24

  // File Comments
// Test the preprocessor
// Macro with parameters
  // Upstart
  // Commodore 64 PRG executable file
.file [name="preprocessor-9.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[idx++] = SUM
    // [0] *SCREEN = '0'+4 -- _deref_pbuc1=vbuc2 
    lda #'0'+4
    sta SCREEN
    // SCREEN[idx++] = DOUBLE
    // [1] *(SCREEN+1) = 'b'+'b' -- _deref_pbuc1=vbuc2 
    lda #'b'+'b'
    sta SCREEN+1
    // SCREEN[idx++] = SQUARE
    // [2] *(SCREEN+2) = 'c'*'c' -- _deref_pbuc1=vbuc2 
    lda #'c'*'c'
    sta SCREEN+2
    // main::@return
    // }
    // [3] return 
    rts
}
  // File Data

