Resolved forward reference SINTABLE to SINTABLE
Updating intermediate variable memory area to MAIN_MEMORY main::$0

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  to:main::@1
main::@1: scope:[main]  from main main::@5
  if(true) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  main::c1a = c1A
  main::i = 0
  to:main::@3
main::@3: scope:[main]  from main::@2 main::@4
  main::$0 = main::i < $28
  if(main::$0) goto main::@4
  to:main::@5
main::@4: scope:[main]  from main::@3
  SCREEN[main::i] = SINTABLE[main::c1a]
  main::c1a = main::c1a + 4
  main::i = ++ main::i
  to:main::@3
main::@5: scope:[main]  from main::@3
  c1A = c1A + 3
  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 * const SCREEN = (char *)$400
__constant const char SINTABLE[$100] = kickasm {{ .for(var i=0;i<$100;i++)
        .byte round(127.5+127.5*sin(2*PI*i/256))
 }}
void __start()
__loadstore char c1A = 0
void main()
bool main::$0
__loadstore char main::c1a
__loadstore char main::i

Adding number conversion cast (unumber) $28 in main::$0 = main::i < $28
Adding number conversion cast (unumber) 4 in main::c1a = main::c1a + 4
Adding number conversion cast (unumber) 3 in c1A = c1A + 3
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast $28
Simplifying constant integer cast 4
Simplifying constant integer cast 3
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) 3
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simple Condition main::$0 [4] if(main::i<$28) goto main::@4
Successful SSA optimization Pass2ConditionalJumpSimplification
if() condition always true - replacing block destination [0] if(true) 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
Finalized unsigned number type (unsigned int) $100
Successful SSA optimization PassNFinalizeNumberTypeConversions
Adding NOP phi() at start of main
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
Renumbering block main::@3 to main::@2
Renumbering block main::@4 to main::@3
Renumbering block main::@5 to main::@4
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::@4
  [1] main::c1a = c1A
  [2] main::i = 0
  to:main::@2
main::@2: scope:[main]  from main::@1 main::@3
  [3] if(main::i<$28) goto main::@3
  to:main::@4
main::@4: scope:[main]  from main::@2
  [4] c1A = c1A + 3
  to:main::@1
main::@3: scope:[main]  from main::@2
  [5] SCREEN[main::i] = SINTABLE[main::c1a]
  [6] main::c1a = main::c1a + 4
  [7] main::i = ++ main::i
  to:main::@2


VARIABLE REGISTER WEIGHTS
__loadstore char c1A = 0 // 4.125
void main()
__loadstore char main::c1a // 52.33333333333333
__loadstore char main::i // 83.0

Initial phi equivalence classes
Added variable main::c1a to live range equivalence class [ main::c1a ]
Added variable main::i to live range equivalence class [ main::i ]
Added variable c1A to live range equivalence class [ c1A ]
Complete equivalence classes
[ main::c1a ]
[ main::i ]
[ c1A ]
Allocated mem[1] [ main::i ]
Allocated mem[1] [ main::c1a ]
Allocated mem[1] [ c1A ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] main::c1a = c1A [ main::c1a c1A ] (  [ main::c1a c1A ] { }  ) always clobbers reg byte a 
Statement [2] main::i = 0 [ main::c1a c1A main::i ] (  [ main::c1a c1A main::i ] { }  ) always clobbers reg byte a 
Statement [3] if(main::i<$28) goto main::@3 [ main::c1a c1A main::i ] (  [ main::c1a c1A main::i ] { }  ) always clobbers reg byte a 
Statement [4] c1A = c1A + 3 [ c1A ] (  [ c1A ] { }  ) always clobbers reg byte a reg byte x 
Statement [5] SCREEN[main::i] = SINTABLE[main::c1a] [ main::c1a c1A main::i ] (  [ main::c1a c1A main::i ] { }  ) always clobbers reg byte a reg byte y 
Statement [6] main::c1a = main::c1a + 4 [ main::c1a c1A main::i ] (  [ main::c1a c1A main::i ] { }  ) always clobbers reg byte a reg byte x 
Potential registers mem[1] [ main::c1a ] : mem[1] , 
Potential registers mem[1] [ main::i ] : mem[1] , 
Potential registers mem[1] [ c1A ] : mem[1] , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 83: mem[1] [ main::i ] 52.33: mem[1] [ main::c1a ] 
Uplift Scope [] 4.12: mem[1] [ c1A ] 

Uplifting [main] best 5130 combination mem[1] [ main::i ] mem[1] [ main::c1a ] 
Uplifting [] best 5130 combination mem[1] [ c1A ] 
Attempting to uplift remaining variables inmem[1] [ main::i ]
Uplifting [main] best 5130 combination mem[1] [ main::i ] 
Attempting to uplift remaining variables inmem[1] [ main::c1a ]
Uplifting [main] best 5130 combination mem[1] [ main::c1a ] 
Attempting to uplift remaining variables inmem[1] [ c1A ]
Uplifting [] best 5130 combination mem[1] [ c1A ] 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Demonstrates problem with __ma coalescing
// c1a is erroneously zp-coalesced with c1A
  // Upstart
  // Commodore 64 PRG executable file
.file [name="ma_coalesce_problem.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: {
    jmp __b1
    // main::@1
  __b1:
    // [1] main::c1a = c1A -- vbum1=vbum2 
    lda c1A
    sta c1a
    // [2] main::i = 0 -- vbum1=vbuc1 
    lda #0
    sta i
    jmp __b2
    // main::@2
  __b2:
    // [3] if(main::i<$28) goto main::@3 -- vbum1_lt_vbuc1_then_la1 
    lda i
    cmp #$28
    bcc __b3
    jmp __b4
    // main::@4
  __b4:
    // [4] c1A = c1A + 3 -- vbum1=vbum1_plus_vbuc1 
    lax c1A
    axs #-[3]
    stx c1A
    jmp __b1
    // main::@3
  __b3:
    // [5] SCREEN[main::i] = SINTABLE[main::c1a] -- pbuc1_derefidx_vbum1=pbuc2_derefidx_vbum2 
    ldy c1a
    lda SINTABLE,y
    ldy i
    sta SCREEN,y
    // [6] main::c1a = main::c1a + 4 -- vbum1=vbum1_plus_vbuc1 
    lax c1a
    axs #-[4]
    stx c1a
    // [7] main::i = ++ main::i -- vbum1=_inc_vbum1 
    inc i
    jmp __b2
  .segment Data
    c1a: .byte 0
    i: .byte 0
}
  // File Data
  .align $100
SINTABLE:
.for(var i=0;i<$100;i++)
        .byte round(127.5+127.5*sin(2*PI*i/256))

  // Plasma state variables
  c1A: .byte 0

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

FINAL SYMBOL TABLE
__constant char * const SCREEN = (char *) 1024
__constant const char SINTABLE[$100] = kickasm {{ .for(var i=0;i<$100;i++)
        .byte round(127.5+127.5*sin(2*PI*i/256))
 }}
__loadstore char c1A = 0 // mem[1] 4.125
void main()
__loadstore char main::c1a // mem[1] 52.33333333333333
__loadstore char main::i // mem[1] 83.0

mem[1] [ main::c1a ]
mem[1] [ main::i ]
mem[1] [ c1A ]


FINAL ASSEMBLER
Score: 4770

  // File Comments
// Demonstrates problem with __ma coalescing
// c1a is erroneously zp-coalesced with c1A
  // Upstart
  // Commodore 64 PRG executable file
.file [name="ma_coalesce_problem.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: {
    // main::@1
  __b1:
    // char c1a = c1A
    // [1] main::c1a = c1A -- vbum1=vbum2 
    lda c1A
    sta c1a
    // char i = 0
    // [2] main::i = 0 -- vbum1=vbuc1 
    lda #0
    sta i
    // main::@2
  __b2:
    // for (char i = 0; i < 40; ++i)
    // [3] if(main::i<$28) goto main::@3 -- vbum1_lt_vbuc1_then_la1 
    lda i
    cmp #$28
    bcc __b3
    // main::@4
    // c1A += 3
    // [4] c1A = c1A + 3 -- vbum1=vbum1_plus_vbuc1 
    lax c1A
    axs #-[3]
    stx c1A
    jmp __b1
    // main::@3
  __b3:
    // SCREEN[i] = SINTABLE[c1a]
    // [5] SCREEN[main::i] = SINTABLE[main::c1a] -- pbuc1_derefidx_vbum1=pbuc2_derefidx_vbum2 
    ldy c1a
    lda SINTABLE,y
    ldy i
    sta SCREEN,y
    // c1a += 4
    // [6] main::c1a = main::c1a + 4 -- vbum1=vbum1_plus_vbuc1 
    lax c1a
    axs #-[4]
    stx c1a
    // for (char i = 0; i < 40; ++i)
    // [7] main::i = ++ main::i -- vbum1=_inc_vbum1 
    inc i
    jmp __b2
  .segment Data
    c1a: .byte 0
    i: .byte 0
}
  // File Data
  .align $100
SINTABLE:
.for(var i=0;i<$100;i++)
        .byte round(127.5+127.5*sin(2*PI*i/256))

  // Plasma state variables
  c1A: .byte 0

