Resolved forward reference fn1 to (void()) fn1()
Culled Empty Block (label) @1

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@2
main: scope:[main]  from @2
  (void()*~) main::$0 ← & (void()) fn1()
  (void()*) main::f#0 ← (void()*~) main::$0
  call *((void()*) main::f#0) 
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return
fn1: scope:[fn1]  from
  (byte*) fn1::BORDERCOL#0 ← ((byte*)) (number) $d020
  *((byte*) fn1::BORDERCOL#0) ← ++ *((byte*) fn1::BORDERCOL#0)
  to:fn1::@return
fn1::@return: scope:[fn1]  from fn1
  return 
  to:@return
@2: scope:[]  from @begin
  call main 
  to:@3
@3: scope:[]  from @2
  to:@end
@end: scope:[]  from @3

SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @begin
(label) @end
(void()) fn1()
(label) fn1::@return
(byte*) fn1::BORDERCOL
(byte*) fn1::BORDERCOL#0
(void()) main()
(void()*~) main::$0
(label) main::@return
(void()*) main::f
(void()*) main::f#0

Inlining cast (byte*) fn1::BORDERCOL#0 ← (byte*)(number) $d020
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Successful SSA optimization PassNCastSimplification
Alias (void()*) main::f#0 = (void()*~) main::$0 
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [0] (void()*) main::f#0 ← & (void()) fn1()
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const void()*) main::f#0 = &fn1
Constant (const byte*) fn1::BORDERCOL#0 = (byte*) 53280
Successful SSA optimization Pass2ConstantIdentification
Replacing constant pointer function [2] call fn1 
Successful SSA optimization Pass2ConstantCallPointerIdentification
Eliminating unused constant (const void()*) main::f#0
Successful SSA optimization PassNEliminateUnusedVars
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @3
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to fn1:6 

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @3
Renumbering block @2 to @1
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@1
@1: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @1
  [3] phi()
main: scope:[main]  from @1
  [4] phi()
  [5] call fn1 
  to:main::@return
main::@return: scope:[main]  from main
  [6] return 
  to:@return
fn1: scope:[fn1]  from main
  [7] *((const byte*) fn1::BORDERCOL#0) ← ++ *((const byte*) fn1::BORDERCOL#0)
  to:fn1::@return
fn1::@return: scope:[fn1]  from fn1
  [8] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) fn1()
(byte*) fn1::BORDERCOL
(void()) main()
(void()*) main::f

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
  // File Comments
// Tests creating, assigning and calling pointers to non-args no-return functions
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call fn1 
    jsr fn1
    jmp breturn
    // main::@return
  breturn:
    // [6] return 
    rts
}
  // fn1
fn1: {
    .label BORDERCOL = $d020
    // [7] *((const byte*) fn1::BORDERCOL#0) ← ++ *((const byte*) fn1::BORDERCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BORDERCOL
    jmp breturn
    // fn1::@return
  breturn:
    // [8] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS

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

Uplifting [main] best 42 combination 
Uplifting [fn1] best 42 combination 
Uplifting [] best 42 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Tests creating, assigning and calling pointers to non-args no-return functions
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
bbegin:
  // [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
  jmp b1
  // @1
b1:
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
main_from_b1:
  jsr main
  // [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
  jmp bend
  // @end
bend:
  // main
main: {
    // [5] call fn1 
    jsr fn1
    jmp breturn
    // main::@return
  breturn:
    // [6] return 
    rts
}
  // fn1
fn1: {
    .label BORDERCOL = $d020
    // [7] *((const byte*) fn1::BORDERCOL#0) ← ++ *((const byte*) fn1::BORDERCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BORDERCOL
    jmp breturn
    // fn1::@return
  breturn:
    // [8] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) fn1()
(label) fn1::@return
(byte*) fn1::BORDERCOL
(const byte*) fn1::BORDERCOL#0 BORDERCOL = (byte*) 53280
(void()) main()
(label) main::@return
(void()*) main::f



FINAL ASSEMBLER
Score: 24

  // File Comments
// Tests creating, assigning and calling pointers to non-args no-return functions
  // Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  // @begin
  // [1] phi from @begin to @1 [phi:@begin->@1]
  // @1
  // [2] call main 
  // [4] phi from @1 to main [phi:@1->main]
  // [3] phi from @1 to @end [phi:@1->@end]
  // @end
  // main
main: {
    // (*f)()
    // [5] call fn1 
    jsr fn1
    // main::@return
    // }
    // [6] return 
    rts
}
  // fn1
fn1: {
    .label BORDERCOL = $d020
    // (*BORDERCOL)++;
    // [7] *((const byte*) fn1::BORDERCOL#0) ← ++ *((const byte*) fn1::BORDERCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 
    inc BORDERCOL
    // fn1::@return
    // }
    // [8] return 
    rts
}
  // File Data

