Inlined call call __init

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start::@1
  SCREEN[0] = i
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  i = 7
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  call main
  to:__start::@2
__start::@2: scope:[__start]  from __start::@1
  to:__start::@return
__start::@return: scope:[__start]  from __start::@2
  return 
  to:@return

SYMBOL TABLE SSA
__constant char * const SCREEN = (char *)$400
void __start()
__loadstore volatile const char i
void main()

Adding number conversion cast (unumber) 0 in SCREEN[0] = i
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = i
Successful SSA optimization PassNSimplifyExpressionWithZero
Adding NOP phi() at start of __start
Adding NOP phi() at start of __start::@1
Adding NOP phi() at start of __start::@2
CALL GRAPH
Calls in [__start] to main:3 

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

FINAL CONTROL FLOW GRAPH

void __start()
__start: scope:[__start]  from
  [0] phi()
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  [1] i = 7
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  [2] phi()
  [3] call main
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  [4] return 
  to:@return

void main()
main: scope:[main]  from __start::@1
  [5] *SCREEN = i
  to:main::@return
main::@return: scope:[main]  from main
  [6] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void __start()
__loadstore volatile const char i // 6.5
void main()

Initial phi equivalence classes
Added variable i to live range equivalence class [ i ]
Complete equivalence classes
[ i ]
Allocated zp[1]:2 [ i ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] i = 7 [ i ] (  [ i ] { }  ) always clobbers reg byte a 
Statement [5] *SCREEN = i [ ] ( main:3 [ ] { }  ) always clobbers reg byte a 
Potential registers zp[1]:2 [ i ] : zp[1]:2 , 

REGISTER UPLIFT SCOPES
Uplift Scope [] 6.5: zp[1]:2 [ i ] 
Uplift Scope [main] 
Uplift Scope [__start] 

Uplifting [] best 69 combination zp[1]:2 [ i ] 
Uplifting [main] best 69 combination 
Uplifting [__start] best 69 combination 
Attempting to uplift remaining variables inzp[1]:2 [ i ]
Uplifting [] best 69 combination zp[1]:2 [ i ] 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test that a volatile nomodify-variable works as expected
  // Upstart
  // Commodore 64 PRG executable file
.file [name="nomodify-3.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(__start)
  // Global Constants & labels
  .label SCREEN = $400
  .label i = 2
.segment Code
  // __start
__start: {
    jmp __init1
    // __start::__init1
  __init1:
    // [1] i = 7 -- vbuz1=vbuc1 
    lda #7
    sta.z i
    // [2] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1]
  __b1_from___init1:
    jmp __b1
    // __start::@1
  __b1:
    // [3] call main
    jsr main
    jmp __breturn
    // __start::@return
  __breturn:
    // [4] return 
    rts
}
  // main
main: {
    // [5] *SCREEN = i -- _deref_pbuc1=vbuz1 
    lda.z i
    sta SCREEN
    jmp __breturn
    // main::@return
  __breturn:
    // [6] return 
    rts
}
  // File Data

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

FINAL SYMBOL TABLE
__constant char * const SCREEN = (char *) 1024
void __start()
__loadstore volatile const char i // zp[1]:2 6.5
void main()

zp[1]:2 [ i ]


FINAL ASSEMBLER
Score: 30

  // File Comments
// Test that a volatile nomodify-variable works as expected
  // Upstart
  // Commodore 64 PRG executable file
.file [name="nomodify-3.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(__start)
  // Global Constants & labels
  .label SCREEN = $400
  .label i = 2
.segment Code
  // __start
__start: {
    // __start::__init1
    // const volatile char i = 7
    // [1] i = 7 -- vbuz1=vbuc1 
    lda #7
    sta.z i
    // [2] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1]
    // __start::@1
    // [3] call main
    jsr main
    // __start::@return
    // [4] return 
    rts
}
  // main
main: {
    // SCREEN[0] = i
    // [5] *SCREEN = i -- _deref_pbuc1=vbuz1 
    lda.z i
    sta SCREEN
    // main::@return
    // }
    // [6] return 
    rts
}
  // File Data

