
CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  to:main::@1
main::@1: scope:[main]  from main main::@1
  *((char *)$d020) = ++ *((char *)$d020)
  main::$1 = *((char *)$d020) < $ff
  if(main::$1) goto main::@1
  to:main::@return
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
void __start()
void main()
bool main::$1

Adding number conversion cast (unumber) $ff in main::$1 = *((char *)$d020) < $ff
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 53280
Simplifying constant pointer cast (char *) 53280
Simplifying constant pointer cast (char *) 53280
Simplifying constant integer cast $ff
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) $ff
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simple Condition main::$1 [2] if(*((char *) 53280)<$ff) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
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
CALL GRAPH

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@1
  [1] *((char *) 53280) = ++ *((char *) 53280)
  [2] if(*((char *) 53280)<$ff) goto main::@1
  to:main::@return
main::@return: scope:[main]  from main::@1
  [3] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [2] if(*((char *) 53280)<$ff) goto main::@1 [ ] (  [ ] { }  ) always clobbers reg byte a 

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

Uplifting [main] best 211 combination 
Uplifting [] best 211 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
  // Upstart
  // Commodore 64 PRG executable file
.file [name="incd020-2.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: {
    jmp __b1
    // main::@1
  __b1:
    // [1] *((char *) 53280) = ++ *((char *) 53280) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc $d020
    // [2] if(*((char *) 53280)<$ff) goto main::@1 -- _deref_pbuc1_lt_vbuc2_then_la1 
    lda $d020
    cmp #$ff
    bcc __b1
    jmp __breturn
    // main::@return
  __breturn:
    // [3] return 
    rts
}
  // File Data

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

FINAL SYMBOL TABLE
void main()



FINAL ASSEMBLER
Score: 151

  // File Comments
  // Upstart
  // Commodore 64 PRG executable file
.file [name="incd020-2.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: {
    // main::@1
  __b1:
    // (*(unsigned char *)(53280))++;
    // [1] *((char *) 53280) = ++ *((char *) 53280) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc $d020
    // while ( (*(unsigned char *)(53280)) < 255)
    // [2] if(*((char *) 53280)<$ff) goto main::@1 -- _deref_pbuc1_lt_vbuc2_then_la1 
    lda $d020
    cmp #$ff
    bcc __b1
    // main::@return
    // }
    // [3] return 
    rts
}
  // File Data

