
CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  asm { sei  }
  to:main::@1
main::@1: scope:[main]  from main main::@2
  main::$0 = 0 != 1
  if(main::$0) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR) = *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_RASTER)
  to:main::@1
main::@return: scope:[main]  from main::@1
  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 OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR = $f
__constant char OFFSET_STRUCT_MOS6561_VIC_RASTER = 4
__constant struct MOS6561_VIC * const VIC = (struct MOS6561_VIC *)$9000
void __start()
void main()
bool main::$0

Simplifying constant pointer cast (struct MOS6561_VIC *) 36864
Successful SSA optimization PassNCastSimplification
Simple Condition main::$0 [2] if(0!=1) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
if() condition always true - replacing block destination [2] if(0!=1) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
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
Adding NOP phi() at start of main::@1
CALL GRAPH

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block label main::@1
Renumbering block main::@2 to main::@1

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  asm { sei  }
  to:main::@1
main::@1: scope:[main]  from main main::@1
  [1] *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR) = *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_RASTER)
  to:main::@1


VARIABLE REGISTER WEIGHTS
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR) = *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_RASTER) [ ] (  [ ] { }  ) always clobbers reg byte a 

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

Uplifting [MOS6561_VIC] best 115 combination 
Uplifting [MOS6522_VIA] best 115 combination 
Uplifting [main] best 115 combination 
Uplifting [] best 115 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// VIC 20 Raster bars
/// @file
/// Commodore VIC 20 registers and memory layout
///
/// http://sleepingelephant.com/denial/wiki/index.php?title=Memory_Map
/// http://www.zimmers.net/anonftp/pub/cbm/vic20/manuals/VIC-20_Programmers_Reference_Guide_1st_Edition_6th_Printing.pdf
/// @file
/// MOS 6560/6561 VIDEO INTERFACE CHIP
///
/// Used in VIC 20
/// http://archive.6502.org/datasheets/mos_6560_6561_vic.pdf
  // Upstart
  // Commodore VIC 20 executable PRG file
.file [name="vic20-raster.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$1001]
.segmentdef Code [start=$100d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const OFFSET_STRUCT_MOS6561_VIC_RASTER = 4
  .const OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR = $f
  /// The MOS 6560/6561 VIC Video Interface Chip
  .label VIC = $9000
.segment Code
  // main
main: {
    // asm { sei  }
    sei
    jmp __b1
    // main::@1
  __b1:
    // [1] *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR) = *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_RASTER) -- _deref_pbuc1=_deref_pbuc2 
    lda VIC+OFFSET_STRUCT_MOS6561_VIC_RASTER
    sta VIC+OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR
    jmp __b1
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination

FINAL SYMBOL TABLE
__constant char OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR = $f
__constant char OFFSET_STRUCT_MOS6561_VIC_RASTER = 4
__constant struct MOS6561_VIC * const VIC = (struct MOS6561_VIC *) 36864
void main()



FINAL ASSEMBLER
Score: 112

  // File Comments
// VIC 20 Raster bars
/// @file
/// Commodore VIC 20 registers and memory layout
///
/// http://sleepingelephant.com/denial/wiki/index.php?title=Memory_Map
/// http://www.zimmers.net/anonftp/pub/cbm/vic20/manuals/VIC-20_Programmers_Reference_Guide_1st_Edition_6th_Printing.pdf
/// @file
/// MOS 6560/6561 VIDEO INTERFACE CHIP
///
/// Used in VIC 20
/// http://archive.6502.org/datasheets/mos_6560_6561_vic.pdf
  // Upstart
  // Commodore VIC 20 executable PRG file
.file [name="vic20-raster.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$1001]
.segmentdef Code [start=$100d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  .const OFFSET_STRUCT_MOS6561_VIC_RASTER = 4
  .const OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR = $f
  /// The MOS 6560/6561 VIC Video Interface Chip
  .label VIC = $9000
.segment Code
  // main
main: {
    // asm
    // asm { sei  }
    sei
    // main::@1
  __b1:
    // VIC->BORDER_BACKGROUND_COLOR = VIC->RASTER
    // [1] *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR) = *((char *)VIC+OFFSET_STRUCT_MOS6561_VIC_RASTER) -- _deref_pbuc1=_deref_pbuc2 
    lda VIC+OFFSET_STRUCT_MOS6561_VIC_RASTER
    sta VIC+OFFSET_STRUCT_MOS6561_VIC_BORDER_BACKGROUND_COLOR
    jmp __b1
}
  // File Data

