
CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  main::SCREEN[0] = byte3 PI_u4f28
  main::SCREEN[1] = byte2 PI_u4f28
  main::SCREEN[2] = byte1 PI_u4f28
  main::SCREEN[3] = byte0 PI_u4f28
  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
__constant const unsigned long PI_u4f28 = $3243f6a9
void __start()
void main()
__constant char *main::SCREEN = (char *)$400

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


VARIABLE REGISTER WEIGHTS
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *main::SCREEN = byte3 PI_u4f28 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [1] *(main::SCREEN+1) = byte2 PI_u4f28 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [2] *(main::SCREEN+2) = byte1 PI_u4f28 [ ] (  [ ] { }  ) always clobbers reg byte a 
Statement [3] *(main::SCREEN+3) = byte0 PI_u4f28 [ ] (  [ ] { }  ) 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
// PI in u[4.28] format
  // Upstart
  // Commodore 64 PRG executable file
.file [name="test-lohiconst.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 PI_u4f28 = $3243f6a9
.segment Code
  // main
main: {
    .label SCREEN = $400
    // [0] *main::SCREEN = byte3 PI_u4f28 -- _deref_pbuc1=vbuc2 
    lda #>PI_u4f28>>$10
    sta SCREEN
    // [1] *(main::SCREEN+1) = byte2 PI_u4f28 -- _deref_pbuc1=vbuc2 
    lda #<PI_u4f28>>$10
    sta SCREEN+1
    // [2] *(main::SCREEN+2) = byte1 PI_u4f28 -- _deref_pbuc1=vbuc2 
    lda #>PI_u4f28
    sta SCREEN+2
    // [3] *(main::SCREEN+3) = byte0 PI_u4f28 -- _deref_pbuc1=vbuc2 
    lda #<PI_u4f28
    sta SCREEN+3
    jmp __breturn
    // main::@return
  __breturn:
    // [4] 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 const unsigned long PI_u4f28 = $3243f6a9
void main()
__constant char *main::SCREEN = (char *) 1024



FINAL ASSEMBLER
Score: 30

  // File Comments
// PI in u[4.28] format
  // Upstart
  // Commodore 64 PRG executable file
.file [name="test-lohiconst.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 PI_u4f28 = $3243f6a9
.segment Code
  // main
main: {
    .label SCREEN = $400
    // SCREEN[0] = BYTE3(PI_u4f28)
    // [0] *main::SCREEN = byte3 PI_u4f28 -- _deref_pbuc1=vbuc2 
    lda #>PI_u4f28>>$10
    sta SCREEN
    // SCREEN[1] = BYTE2(PI_u4f28)
    // [1] *(main::SCREEN+1) = byte2 PI_u4f28 -- _deref_pbuc1=vbuc2 
    lda #<PI_u4f28>>$10
    sta SCREEN+1
    // SCREEN[2] = BYTE1(PI_u4f28)
    // [2] *(main::SCREEN+2) = byte1 PI_u4f28 -- _deref_pbuc1=vbuc2 
    lda #>PI_u4f28
    sta SCREEN+2
    // SCREEN[3] = BYTE0(PI_u4f28)
    // [3] *(main::SCREEN+3) = byte0 PI_u4f28 -- _deref_pbuc1=vbuc2 
    lda #<PI_u4f28
    sta SCREEN+3
    // main::@return
    // }
    // [4] return 
    rts
}
  // File Data

