Culled Empty Block (label) main::@4
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@1

(void()) main()
main: scope:[main]  from @1
  asm { sei  }
  to:main::@1
main::@1: scope:[main]  from main main::@2
  if(true) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  (byte) main::col#0 ← *((const byte*) RASTER)
  *((const byte*) BGCOL) ← (byte) main::col#0
  to:main::@1
main::@return: scope:[main]  from main::@1
  return 
  to:@return
@1: scope:[]  from @begin
  call main 
  to:@2
@2: scope:[]  from @1
  to:@end
@end: scope:[]  from @2

SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*)(number) $d021
(const byte*) RASTER = (byte*)(number) $d012
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::col
(byte) main::col#0

Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53266
Successful SSA optimization PassNCastSimplification
if() condition always true - replacing block destination [1] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@1
CALL GRAPH
Calls in [] to main:2 

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@1
Renumbering block main::@2 to main::@1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()

(void()) main()
main: scope:[main]  from @1
  asm { sei  }
  to:main::@1
main::@1: scope:[main]  from main main::@1
  [5] (byte) main::col#0 ← *((const byte*) RASTER)
  [6] *((const byte*) BGCOL) ← (byte) main::col#0
  to:main::@1


VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::col
(byte) main::col#0 22.0

Initial phi equivalence classes
Added variable main::col#0 to live range equivalence class [ main::col#0 ]
Complete equivalence classes
[ main::col#0 ]
Allocated zp[1]:2 [ main::col#0 ]

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// Test setting the program PC through a #pc directive
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $1000 "Program"
  // Global Constants & labels
  .label BGCOL = $d021
  .label RASTER = $d012
  // @begin
__bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
__b1_from___bbegin:
  jmp __b1
  // @1
__b1:
  // [2] call main 
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
__bend_from___b1:
  jmp __bend
  // @end
__bend:
  // main
main: {
    .label col = 2
    // asm { sei  }
    sei
    jmp __b1
    // main::@1
  __b1:
    // [5] (byte) main::col#0 ← *((const byte*) RASTER) -- vbuz1=_deref_pbuc1 
    lda RASTER
    sta.z col
    // [6] *((const byte*) BGCOL) ← (byte) main::col#0 -- _deref_pbuc1=vbuz1 
    lda.z col
    sta BGCOL
    jmp __b1
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp[1]:2 [ main::col#0 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 22: zp[1]:2 [ main::col#0 ] 
Uplift Scope [] 

Uplifting [main] best 127 combination reg byte a [ main::col#0 ] 
Uplifting [] best 127 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test setting the program PC through a #pc directive
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $1000 "Program"
  // Global Constants & labels
  .label BGCOL = $d021
  .label RASTER = $d012
  // @begin
__bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
__b1_from___bbegin:
  jmp __b1
  // @1
__b1:
  // [2] call main 
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
__bend_from___b1:
  jmp __bend
  // @end
__bend:
  // main
main: {
    // asm { sei  }
    sei
    jmp __b1
    // main::@1
  __b1:
    // [5] (byte) main::col#0 ← *((const byte*) RASTER) -- vbuaa=_deref_pbuc1 
    lda RASTER
    // [6] *((const byte*) BGCOL) ← (byte) main::col#0 -- _deref_pbuc1=vbuaa 
    sta BGCOL
    jmp __b1
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*) 53281
(const byte*) RASTER = (byte*) 53266
(void()) main()
(label) main::@1
(byte) main::col
(byte) main::col#0 reg byte a 22.0

reg byte a [ main::col#0 ]


FINAL ASSEMBLER
Score: 112

  // File Comments
// Test setting the program PC through a #pc directive
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $1000 "Program"
  // Global Constants & labels
  .label BGCOL = $d021
  .label RASTER = $d012
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    // asm
    // asm { sei  }
    sei
    // main::@1
  __b1:
    // col = *RASTER
    // [5] (byte) main::col#0 ← *((const byte*) RASTER) -- vbuaa=_deref_pbuc1 
    lda RASTER
    // *BGCOL = col
    // [6] *((const byte*) BGCOL) ← (byte) main::col#0 -- _deref_pbuc1=vbuaa 
    sta BGCOL
    jmp __b1
}
  // File Data

