Inlined call call __init

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  b#7 = phi( __start::@1/b#14 )
  SCREEN[0] = b#7
  to:main::@return
main::@return: scope:[main]  from main main::@2
  b#8 = phi( main/b#7, main::@2/b#1 )
  b#0 = b#8
  return 
  to:@return
main::@1: scope:[main]  from
  b#15 = phi( )
  call bb
  to:main::@2
main::@2: scope:[main]  from main::@1
  b#9 = phi( main::@1/b#3 )
  b#1 = b#9
  SCREEN[1] = b#1
  to:main::@return

void bb()
bb: scope:[bb]  from main::@1
  b#10 = phi( main::@1/b#15 )
  b#2 = ++ b#10
  to:bb::@return
bb::@return: scope:[bb]  from bb
  b#11 = phi( bb/b#2 )
  b#3 = b#11
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  b#4 = 0
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  b#14 = phi( __start::__init1/b#4 )
  call main
  to:__start::@2
__start::@2: scope:[__start]  from __start::@1
  b#12 = phi( __start::@1/b#0 )
  b#5 = b#12
  to:__start::@return
__start::@return: scope:[__start]  from __start::@2
  b#13 = phi( __start::@2/b#5 )
  b#6 = b#13
  return 
  to:@return

SYMBOL TABLE SSA
__constant char * const SCREEN = (char *)$400
void __start()
char b
char b#0
char b#1
char b#10
char b#11
char b#12
char b#13
char b#14
char b#15
char b#2
char b#3
char b#4
char b#5
char b#6
char b#7
char b#8
char b#9
void bb()
void main()

Adding number conversion cast (unumber) 0 in SCREEN[0] = b#7
Adding number conversion cast (unumber) 1 in SCREEN[1] = b#1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
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
Alias b#0 = b#8 
Alias b#1 = b#9 
Alias b#11 = b#2 b#3 
Alias b#14 = b#4 
Alias b#12 = b#5 b#13 b#6 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values b#7 b#14
Identical Phi Values b#1 b#11
Identical Phi Values b#10 b#15
Identical Phi Values b#12 b#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant b#14 = 0
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero SCREEN in [1] SCREEN[0] = b#14
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating variable b#15 from unused block main::@1
Eliminating variable b#11 from unused block bb
Removing unused block main::@1
Removing PHI-reference to removed block (main::@2) in block main::@return
Removing unused block main::@2
Removing unused procedure bb
Removing unused procedure block bb
Removing unused procedure block bb::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Eliminating unused variable - keeping the phi block b#0
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
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#14
  to:main::@return
main::@return: scope:[main]  from main
  [1] return 
  to:@return


VARIABLE REGISTER WEIGHTS
char b
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *SCREEN = b#14 [ ] (  [ ] { }  ) always clobbers reg byte a 

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

Uplifting [main] best 15 combination 
Uplifting [] best 15 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test code after return in main()
  // Upstart
  // Commodore 64 PRG executable file
.file [name="code-after-return-1.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#14 -- _deref_pbuc1=vbuc2 
    lda #b
    sta SCREEN
    jmp __breturn
    // main::@return
  __breturn:
    // [1] 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
char b
__constant char b#14 = 0 // b
void main()



FINAL ASSEMBLER
Score: 12

  // File Comments
// Test code after return in main()
  // Upstart
  // Commodore 64 PRG executable file
.file [name="code-after-return-1.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#14 -- _deref_pbuc1=vbuc2 
    lda #b
    sta SCREEN
    // main::@return
    // }
    // [1] return 
    rts
}
  // File Data

