
CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  main::SCREEN[0] = main::msg[0]
  main::SCREEN[1] = main::msg[1]
  main::SCREEN[2] = main::msg[2]
  to:main::@return
main::@return: scope:[main]  from main
  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
void __start()
void main()
__constant char *main::SCREEN = (char *)$400
__constant char main::msg[] = { 1, 2, 3 }

Adding number conversion cast (unumber) 0 in main::SCREEN[0] = main::msg[0]
Adding number conversion cast (unumber) 0 in main::SCREEN[0] = main::msg[(unumber)0]
Adding number conversion cast (unumber) 1 in main::SCREEN[1] = main::msg[1]
Adding number conversion cast (unumber) 1 in main::SCREEN[1] = main::msg[(unumber)1]
Adding number conversion cast (unumber) 2 in main::SCREEN[2] = main::msg[2]
Adding number conversion cast (unumber) 2 in main::SCREEN[2] = main::msg[(unumber)2]
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simplifying expression containing zero main::msg in [0] main::SCREEN[0] = main::msg[0]
Simplifying expression containing zero main::SCREEN in [0] main::SCREEN[0] = *main::msg
Successful SSA optimization PassNSimplifyExpressionWithZero
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
Consolidated array index constant in *(main::msg+1)
Consolidated array index constant in *(main::SCREEN+1)
Consolidated array index constant in *(main::msg+2)
Consolidated array index constant in *(main::SCREEN+2)
Successful SSA optimization Pass2ConstantAdditionElimination
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] *main::SCREEN = *main::msg
  [1] *(main::SCREEN+1) = *(main::msg+1)
  [2] *(main::SCREEN+2) = *(main::msg+2)
  to:main::@return
main::@return: scope:[main]  from main
  [3] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()

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

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

Uplifting [main] best 33 combination 
Uplifting [] best 33 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test an array with mixed byte/number types
  // Upstart
  // Commodore 64 PRG executable file
.file [name="mixed-array-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
.segment Code
  // main
main: {
    .label SCREEN = $400
    // [0] *main::SCREEN = *main::msg -- _deref_pbuc1=_deref_pbuc2 
    lda msg
    sta SCREEN
    // [1] *(main::SCREEN+1) = *(main::msg+1) -- _deref_pbuc1=_deref_pbuc2 
    lda msg+1
    sta SCREEN+1
    // [2] *(main::SCREEN+2) = *(main::msg+2) -- _deref_pbuc1=_deref_pbuc2 
    lda msg+2
    sta SCREEN+2
    jmp __breturn
    // main::@return
  __breturn:
    // [3] return 
    rts
  .segment Data
    msg: .byte 1, 2, 3
}
  // File Data

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

FINAL SYMBOL TABLE
void main()
__constant char *main::SCREEN = (char *) 1024
__constant char main::msg[] = { 1, 2, 3 }



FINAL ASSEMBLER
Score: 30

  // File Comments
// Test an array with mixed byte/number types
  // Upstart
  // Commodore 64 PRG executable file
.file [name="mixed-array-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
.segment Code
  // main
main: {
    .label SCREEN = $400
    // SCREEN[0] = msg[0]
    // [0] *main::SCREEN = *main::msg -- _deref_pbuc1=_deref_pbuc2 
    lda msg
    sta SCREEN
    // SCREEN[1] = msg[1]
    // [1] *(main::SCREEN+1) = *(main::msg+1) -- _deref_pbuc1=_deref_pbuc2 
    lda msg+1
    sta SCREEN+1
    // SCREEN[2] = msg[2]
    // [2] *(main::SCREEN+2) = *(main::msg+2) -- _deref_pbuc1=_deref_pbuc2 
    lda msg+2
    sta SCREEN+2
    // main::@return
    // }
    // [3] return 
    rts
  .segment Data
    msg: .byte 1, 2, 3
}
  // File Data

