Resolved forward reference init to void init()

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  asm { jsrinit  }
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return

void init()
init: scope:[init]  from
  *BG_COLOR = 0
  to:init::@return
init::@return: scope:[init]  from init
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  call main
  to:__start::@1
__start::@1: scope:[__start]  from __start
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  return 
  to:@return

SYMBOL TABLE SSA
__constant char * const BG_COLOR = (char *)$d020
void __start()
void init()
void main()

Adding number conversion cast (unumber) 0 in *BG_COLOR = 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *BG_COLOR = (unumber)0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (char *) 53280
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
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 init()
init: scope:[init]  from
  [0] *BG_COLOR = 0
  to:init::@return
init::@return: scope:[init]  from init
  [1] return 
  to:@return

void main()
main: scope:[main]  from
  asm { jsrinit  }
  to:main::@return
main::@return: scope:[main]  from main
  [3] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void init()
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *BG_COLOR = 0 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement asm { jsrinit  } always clobbers reg byte a reg byte x reg byte y 

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

Uplifting [main] best 30 combination 
Uplifting [init] best 30 combination 
Uplifting [] best 30 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests that inline asm uses clause makes the compiler not cull a procedure referenced
  // Upstart
  // Commodore 64 PRG executable file
.file [name="asm-uses-0.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 BG_COLOR = $d020
.segment Code
  // init
// Function only used inside the inline asm
init: {
    // [0] *BG_COLOR = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta BG_COLOR
    jmp __breturn
    // init::@return
  __breturn:
    // [1] return 
    rts
}
  // main
main: {
    // asm { jsrinit  }
    jsr init
    jmp __breturn
    // main::@return
  __breturn:
    // [3] return 
    rts
}
  // File Data

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

FINAL SYMBOL TABLE
__constant char * const BG_COLOR = (char *) 53280
void init()
void main()



FINAL ASSEMBLER
Score: 24

  // File Comments
// Tests that inline asm uses clause makes the compiler not cull a procedure referenced
  // Upstart
  // Commodore 64 PRG executable file
.file [name="asm-uses-0.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 BG_COLOR = $d020
.segment Code
  // init
// Function only used inside the inline asm
init: {
    // *BG_COLOR = 0
    // [0] *BG_COLOR = 0 -- _deref_pbuc1=vbuc2 
    lda #0
    sta BG_COLOR
    // init::@return
    // }
    // [1] return 
    rts
}
  // main
main: {
    // asm
    // asm { jsrinit  }
    jsr init
    // main::@return
    // }
    // [3] return 
    rts
}
  // File Data

