Inlined call call __init

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  main::dst#0 = SCREEN
  to:main::@1
main::@1: scope:[main]  from main main::@2
  main::dst#2 = phi( main/main::dst#0, main::@2/main::dst#1 )
  main::$0 = SCREEN + $3e8
  main::$1 = main::dst#2 != main::$0
  if(main::$1) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  main::dst#3 = phi( main::@1/main::dst#2 )
  *main::dst#3 = ' '
  main::dst#1 = ++ main::dst#3
  to:main::@1
main::@return: scope:[main]  from main::@1
  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::$0
bool main::$1
char *main::dst
char *main::dst#0
char *main::dst#1
char *main::dst#2
char *main::dst#3

Adding number conversion cast (unumber) $3e8 in main::$0 = SCREEN + $3e8
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast $3e8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (unsigned int) $3e8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias main::dst#2 = main::dst#3 
Successful SSA optimization Pass2AliasElimination
Simple Condition main::$1 [4] if(main::dst#2!=main::$0) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [2] main::$0 = SCREEN + $3e8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::dst#0 = SCREEN
Constant main::$0 = SCREEN+$3e8
Successful SSA optimization Pass2ConstantIdentification
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
Inlining constant with var siblings main::dst#0
Constant inlined main::dst#0 = SCREEN
Constant inlined main::$0 = SCREEN+$3e8
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of main
CALL GRAPH

Created 1 initial phi equivalence classes
Coalesced [6] main::dst#4 = main::dst#1
Coalesced down to 1 phi equivalence classes
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@2
  [1] main::dst#2 = phi( main/SCREEN, main::@2/main::dst#1 )
  [2] if(main::dst#2!=SCREEN+$3e8) goto main::@2
  to:main::@return
main::@return: scope:[main]  from main::@1
  [3] return 
  to:@return
main::@2: scope:[main]  from main::@1
  [4] *main::dst#2 = ' '
  [5] main::dst#1 = ++ main::dst#2
  to:main::@1


VARIABLE REGISTER WEIGHTS
void main()
char *main::dst
char *main::dst#1 // 22.0
char *main::dst#2 // 14.666666666666666

Initial phi equivalence classes
[ main::dst#2 main::dst#1 ]
Complete equivalence classes
[ main::dst#2 main::dst#1 ]
Allocated zp[2]:2 [ main::dst#2 main::dst#1 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [2] if(main::dst#2!=SCREEN+$3e8) goto main::@2 [ main::dst#2 ] (  [ main::dst#2 ] { }  ) always clobbers reg byte a 
Statement [4] *main::dst#2 = ' ' [ main::dst#2 ] (  [ main::dst#2 ] { }  ) always clobbers reg byte a reg byte y 
Potential registers zp[2]:2 [ main::dst#2 main::dst#1 ] : zp[2]:2 , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 36.67: zp[2]:2 [ main::dst#2 main::dst#1 ] 
Uplift Scope [] 

Uplifting [main] best 571 combination zp[2]:2 [ main::dst#2 main::dst#1 ] 
Uplifting [] best 571 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Fill screen using a pointer
  // Upstart
  // Commodore 64 PRG executable file
.file [name="fillscreen-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: {
    .label dst = 2
    // [1] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [1] phi main::dst#2 = SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z dst
    lda #>SCREEN
    sta.z dst+1
    jmp __b1
    // main::@1
  __b1:
    // [2] if(main::dst#2!=SCREEN+$3e8) goto main::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z dst+1
    cmp #>SCREEN+$3e8
    bne __b2
    lda.z dst
    cmp #<SCREEN+$3e8
    bne __b2
    jmp __breturn
    // main::@return
  __breturn:
    // [3] return 
    rts
    // main::@2
  __b2:
    // [4] *main::dst#2 = ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (dst),y
    // [5] main::dst#1 = ++ main::dst#2 -- pbuz1=_inc_pbuz1 
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    // [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
  __b1_from___b2:
    // [1] phi main::dst#2 = main::dst#1 [phi:main::@2->main::@1#0] -- register_copy 
    jmp __b1
}
  // File Data

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

FINAL SYMBOL TABLE
__constant char *SCREEN = (char *) 1024
void main()
char *main::dst
char *main::dst#1 // dst zp[2]:2 22.0
char *main::dst#2 // dst zp[2]:2 14.666666666666666

zp[2]:2 [ main::dst#2 main::dst#1 ]


FINAL ASSEMBLER
Score: 511

  // File Comments
// Fill screen using a pointer
  // Upstart
  // Commodore 64 PRG executable file
.file [name="fillscreen-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: {
    .label dst = 2
    // [1] phi from main to main::@1 [phi:main->main::@1]
    // [1] phi main::dst#2 = SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z dst
    lda #>SCREEN
    sta.z dst+1
    // main::@1
  __b1:
    // for(char* dst = SCREEN; dst!=SCREEN + 1000; dst++)
    // [2] if(main::dst#2!=SCREEN+$3e8) goto main::@2 -- pbuz1_neq_pbuc1_then_la1 
    lda.z dst+1
    cmp #>SCREEN+$3e8
    bne __b2
    lda.z dst
    cmp #<SCREEN+$3e8
    bne __b2
    // main::@return
    // }
    // [3] return 
    rts
    // main::@2
  __b2:
    // *dst = ' '
    // [4] *main::dst#2 = ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (dst),y
    // for(char* dst = SCREEN; dst!=SCREEN + 1000; dst++)
    // [5] main::dst#1 = ++ main::dst#2 -- pbuz1=_inc_pbuz1 
    inc.z dst
    bne !+
    inc.z dst+1
  !:
    // [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
    // [1] phi main::dst#2 = main::dst#1 [phi:main::@2->main::@1#0] -- register_copy 
    jmp __b1
}
  // File Data

