Inlined call call __init

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  idx#5 = phi( __start::@1/idx#9 )
  kickasm() {{ sei  }}
  SCREEN[idx#5] = 'x'
  idx#0 = ++ idx#5
  kickasm() {{ cli  }}
  to:main::@return
main::@return: scope:[main]  from main
  idx#6 = phi( main/idx#0 )
  idx#1 = idx#6
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  idx#2 = 0
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  idx#9 = phi( __start::__init1/idx#2 )
  call main
  to:__start::@2
__start::@2: scope:[__start]  from __start::@1
  idx#7 = phi( __start::@1/idx#1 )
  idx#3 = idx#7
  to:__start::@return
__start::@return: scope:[__start]  from __start::@2
  idx#8 = phi( __start::@2/idx#3 )
  idx#4 = idx#8
  return 
  to:@return

SYMBOL TABLE SSA
__constant char *SCREEN = (char *)$400
void __start()
char idx
char idx#0
char idx#1
char idx#2
char idx#3
char idx#4
char idx#5
char idx#6
char idx#7
char idx#8
char idx#9
void main()

Simplifying constant pointer cast (char *) 1024
Successful SSA optimization PassNCastSimplification
Alias idx#0 = idx#6 idx#1 
Alias idx#2 = idx#9 
Alias idx#3 = idx#7 idx#8 idx#4 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values idx#5 idx#2
Identical Phi Values idx#3 idx#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant idx#2 = 0
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero SCREEN in [2] SCREEN[idx#2] = 'x'
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable idx#0 and assignment [2] idx#0 = ++ idx#2
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant idx#2
Successful SSA optimization PassNEliminateUnusedVars
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::__init1
Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
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
  kickasm() {{ sei  }}
  [1] *SCREEN = 'x'
  kickasm() {{ cli  }}
  to:main::@return
main::@return: scope:[main]  from main
  [3] return 
  to:@return


VARIABLE REGISTER WEIGHTS
char idx
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] *SCREEN = 'x' [ ] (  [ ] { }  ) always clobbers reg byte a 

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

Uplifting [main] best 527 combination 
Uplifting [] best 527 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test the preprocessor
// Macro generating inline kickasm
  // Upstart
  // Commodore 64 PRG executable file
.file [name="preprocessor-8.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
  .label SCREEN = $400
.segment Code
  // main
main: {
    // kickasm() {{ sei  }}
    sei 
    // [1] *SCREEN = 'x' -- _deref_pbuc1=vbuc2 
    lda #'x'
    sta SCREEN
    // kickasm() {{ cli  }}
    cli 
    jmp __breturn
    // main::@return
  __breturn:
    // [3] 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 char *SCREEN = (char *) 1024
char idx
void main()



FINAL ASSEMBLER
Score: 524

  // File Comments
// Test the preprocessor
// Macro generating inline kickasm
  // Upstart
  // Commodore 64 PRG executable file
.file [name="preprocessor-8.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
  .label SCREEN = $400
.segment Code
  // main
main: {
    // SEI
    // kickasm() {{ sei  }}
    sei 
    // SCREEN[idx++] = 'x'
    // [1] *SCREEN = 'x' -- _deref_pbuc1=vbuc2 
    lda #'x'
    sta SCREEN
    // CLI
    // kickasm() {{ cli  }}
    cli 
    // main::@return
    // }
    // [3] return 
    rts
}
  // File Data

