Identified constant variable (bool) bool_const_if::b
Identified constant variable (byte) bool_const_vars::a
Identified constant variable (byte) bool_const_inline::a
Culled Empty Block (label) @1
Culled Empty Block (label) bool_const_if::@2
Culled Empty Block (label) bool_const_if::@4
Culled Empty Block (label) @2
Culled Empty Block (label) bool_const_vars::@2
Culled Empty Block (label) bool_const_vars::@4
Culled Empty Block (label) @3
Culled Empty Block (label) bool_const_inline::@2
Culled Empty Block (label) bool_const_inline::@4

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@4

(void()) main()
main: scope:[main]  from @4
  call bool_const_if 
  to:main::@1
main::@1: scope:[main]  from main
  call bool_const_vars 
  to:main::@2
main::@2: scope:[main]  from main::@1
  call bool_const_inline 
  to:main::@3
main::@3: scope:[main]  from main::@2
  to:main::@return
main::@return: scope:[main]  from main::@3
  return 
  to:@return

(void()) bool_const_if()
bool_const_if: scope:[bool_const_if]  from main
  if((const bool) bool_const_if::b) goto bool_const_if::@1
  to:bool_const_if::@3
bool_const_if::@1: scope:[bool_const_if]  from bool_const_if
  *((const byte*) SCREEN + (number) 0) ← (byte) 't'
  to:bool_const_if::@return
bool_const_if::@3: scope:[bool_const_if]  from bool_const_if
  *((const byte*) SCREEN + (number) 0) ← (byte) 'f'
  to:bool_const_if::@return
bool_const_if::@return: scope:[bool_const_if]  from bool_const_if::@1 bool_const_if::@3
  return 
  to:@return

(void()) bool_const_vars()
bool_const_vars: scope:[bool_const_vars]  from main::@1
  (bool~) bool_const_vars::$0 ← (const byte) bool_const_vars::a == (number) $f
  (bool~) bool_const_vars::$1 ← (number) $15 < (const byte) bool_const_vars::a
  (bool~) bool_const_vars::$2 ← ! (bool~) bool_const_vars::$1
  (bool~) bool_const_vars::$3 ← (bool~) bool_const_vars::$0 || (bool~) bool_const_vars::$2
  (bool) bool_const_vars::b1#0 ← (bool~) bool_const_vars::$3
  (bool~) bool_const_vars::$4 ← (const byte) bool_const_vars::a != (number) $2c
  (bool~) bool_const_vars::$5 ← (const byte) bool_const_vars::a >= (number) -8
  (bool~) bool_const_vars::$6 ← (bool~) bool_const_vars::$4 || (bool~) bool_const_vars::$5
  (bool) bool_const_vars::b2#0 ← (bool~) bool_const_vars::$6
  (bool~) bool_const_vars::$7 ← ! (bool) bool_const_vars::b2#0
  (bool~) bool_const_vars::$8 ← (bool) bool_const_vars::b1#0 && (bool~) bool_const_vars::$7
  (bool~) bool_const_vars::$9 ← (bool~) bool_const_vars::$8 || false
  (bool) bool_const_vars::b#0 ← (bool~) bool_const_vars::$9
  if((bool) bool_const_vars::b#0) goto bool_const_vars::@1
  to:bool_const_vars::@3
bool_const_vars::@1: scope:[bool_const_vars]  from bool_const_vars
  *((const byte*) SCREEN + (number) 1) ← (byte) 't'
  to:bool_const_vars::@return
bool_const_vars::@3: scope:[bool_const_vars]  from bool_const_vars
  *((const byte*) SCREEN + (number) 1) ← (byte) 'f'
  to:bool_const_vars::@return
bool_const_vars::@return: scope:[bool_const_vars]  from bool_const_vars::@1 bool_const_vars::@3
  return 
  to:@return

(void()) bool_const_inline()
bool_const_inline: scope:[bool_const_inline]  from main::@2
  (bool~) bool_const_inline::$0 ← (const byte) bool_const_inline::a != (number) $2c
  (bool~) bool_const_inline::$1 ← (const byte) bool_const_inline::a >= (number) -8
  (bool~) bool_const_inline::$2 ← (const byte) bool_const_inline::a == (number) $f
  (bool~) bool_const_inline::$3 ← (bool~) bool_const_inline::$1 && (bool~) bool_const_inline::$2
  (bool~) bool_const_inline::$4 ← (bool~) bool_const_inline::$0 || (bool~) bool_const_inline::$3
  (bool~) bool_const_inline::$5 ← (number) $15 < (const byte) bool_const_inline::a
  (bool~) bool_const_inline::$6 ← ! (bool~) bool_const_inline::$5
  (bool~) bool_const_inline::$7 ← (bool~) bool_const_inline::$4 || (bool~) bool_const_inline::$6
  if((bool~) bool_const_inline::$7) goto bool_const_inline::@1
  to:bool_const_inline::@3
bool_const_inline::@1: scope:[bool_const_inline]  from bool_const_inline
  *((const byte*) SCREEN + (number) 2) ← (byte) 't'
  to:bool_const_inline::@return
bool_const_inline::@3: scope:[bool_const_inline]  from bool_const_inline
  *((const byte*) SCREEN + (number) 2) ← (byte) 'f'
  to:bool_const_inline::@return
bool_const_inline::@return: scope:[bool_const_inline]  from bool_const_inline::@1 bool_const_inline::@3
  return 
  to:@return
@4: scope:[]  from @begin
  call main 
  to:@5
@5: scope:[]  from @4
  to:@end
@end: scope:[]  from @5

SYMBOL TABLE SSA
(label) @4
(label) @5
(label) @begin
(label) @end
(const byte*) SCREEN = (byte*)(number) $400
(void()) bool_const_if()
(label) bool_const_if::@1
(label) bool_const_if::@3
(label) bool_const_if::@return
(const bool) bool_const_if::b = true
(void()) bool_const_inline()
(bool~) bool_const_inline::$0
(bool~) bool_const_inline::$1
(bool~) bool_const_inline::$2
(bool~) bool_const_inline::$3
(bool~) bool_const_inline::$4
(bool~) bool_const_inline::$5
(bool~) bool_const_inline::$6
(bool~) bool_const_inline::$7
(label) bool_const_inline::@1
(label) bool_const_inline::@3
(label) bool_const_inline::@return
(const byte) bool_const_inline::a = (byte) $17
(void()) bool_const_vars()
(bool~) bool_const_vars::$0
(bool~) bool_const_vars::$1
(bool~) bool_const_vars::$2
(bool~) bool_const_vars::$3
(bool~) bool_const_vars::$4
(bool~) bool_const_vars::$5
(bool~) bool_const_vars::$6
(bool~) bool_const_vars::$7
(bool~) bool_const_vars::$8
(bool~) bool_const_vars::$9
(label) bool_const_vars::@1
(label) bool_const_vars::@3
(label) bool_const_vars::@return
(const byte) bool_const_vars::a = (byte) $e
(bool) bool_const_vars::b
(bool) bool_const_vars::b#0
(bool) bool_const_vars::b1
(bool) bool_const_vars::b1#0
(bool) bool_const_vars::b2
(bool) bool_const_vars::b2#0
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return

Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← (byte) 't'
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← (byte) 'f'
Adding number conversion cast (unumber) $f in (bool~) bool_const_vars::$0 ← (const byte) bool_const_vars::a == (number) $f
Adding number conversion cast (unumber) $15 in (bool~) bool_const_vars::$1 ← (number) $15 < (const byte) bool_const_vars::a
Adding number conversion cast (unumber) $2c in (bool~) bool_const_vars::$4 ← (const byte) bool_const_vars::a != (number) $2c
Adding number conversion cast (unumber) -8 in (bool~) bool_const_vars::$5 ← (const byte) bool_const_vars::a >= (number) -8
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← (byte) 't'
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← (byte) 'f'
Adding number conversion cast (unumber) $2c in (bool~) bool_const_inline::$0 ← (const byte) bool_const_inline::a != (number) $2c
Adding number conversion cast (unumber) -8 in (bool~) bool_const_inline::$1 ← (const byte) bool_const_inline::a >= (number) -8
Adding number conversion cast (unumber) $f in (bool~) bool_const_inline::$2 ← (const byte) bool_const_inline::a == (number) $f
Adding number conversion cast (unumber) $15 in (bool~) bool_const_inline::$5 ← (number) $15 < (const byte) bool_const_inline::a
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← (byte) 't'
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← (byte) 'f'
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $f
Simplifying constant integer cast $15
Simplifying constant integer cast $2c
Simplifying constant integer cast -8
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast $2c
Simplifying constant integer cast -8
Simplifying constant integer cast $f
Simplifying constant integer cast $15
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) $2c
Finalized unsigned number type (byte) -8
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) $2c
Finalized unsigned number type (byte) -8
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) $15
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 2
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inversing boolean not [10] (bool~) bool_const_vars::$2 ← (byte) $15 >= (const byte) bool_const_vars::a from [9] (bool~) bool_const_vars::$1 ← (byte) $15 < (const byte) bool_const_vars::a
Inversing boolean not [31] (bool~) bool_const_inline::$6 ← (byte) $15 >= (const byte) bool_const_inline::a from [30] (bool~) bool_const_inline::$5 ← (byte) $15 < (const byte) bool_const_inline::a
Successful SSA optimization Pass2UnaryNotSimplification
Alias (bool) bool_const_vars::b1#0 = (bool~) bool_const_vars::$3 
Alias (bool) bool_const_vars::b2#0 = (bool~) bool_const_vars::$6 
Alias (bool) bool_const_vars::b#0 = (bool~) bool_const_vars::$9 
Successful SSA optimization Pass2AliasElimination
Rewriting || if()-condition to two if()s [19] (bool) bool_const_vars::b#0 ← (bool~) bool_const_vars::$8 || false
Rewriting && if()-condition to two if()s [18] (bool~) bool_const_vars::$8 ← (bool) bool_const_vars::b1#0 && (bool~) bool_const_vars::$7
Rewriting || if()-condition to two if()s [11] (bool) bool_const_vars::b1#0 ← (bool~) bool_const_vars::$0 || (bool~) bool_const_vars::$2
Rewriting || if()-condition to two if()s [32] (bool~) bool_const_inline::$7 ← (bool~) bool_const_inline::$4 || (bool~) bool_const_inline::$6
Rewriting || if()-condition to two if()s [29] (bool~) bool_const_inline::$4 ← (bool~) bool_const_inline::$0 || (bool~) bool_const_inline::$3
Rewriting ! if()-condition to reversed if() [17] (bool~) bool_const_vars::$7 ← ! (bool) bool_const_vars::b2#0
Rewriting || if()-condition to two if()s [15] (bool) bool_const_vars::b2#0 ← (bool~) bool_const_vars::$4 || (bool~) bool_const_vars::$5
Rewriting && if()-condition to two if()s [28] (bool~) bool_const_inline::$3 ← (bool~) bool_const_inline::$1 && (bool~) bool_const_inline::$2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant right-side identified [8] (bool~) bool_const_vars::$0 ← (const byte) bool_const_vars::a == (byte) $f
Constant right-side identified [10] (bool~) bool_const_vars::$2 ← (byte) $15 >= (const byte) bool_const_vars::a
Constant right-side identified [13] (bool~) bool_const_vars::$4 ← (const byte) bool_const_vars::a != (byte) $2c
Constant right-side identified [14] (bool~) bool_const_vars::$5 ← (const byte) bool_const_vars::a >= (byte) -8
Constant right-side identified [25] (bool~) bool_const_inline::$0 ← (const byte) bool_const_inline::a != (byte) $2c
Constant right-side identified [26] (bool~) bool_const_inline::$1 ← (const byte) bool_const_inline::a >= (byte) -8
Constant right-side identified [27] (bool~) bool_const_inline::$2 ← (const byte) bool_const_inline::a == (byte) $f
Constant right-side identified [31] (bool~) bool_const_inline::$6 ← (byte) $15 >= (const byte) bool_const_inline::a
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const bool) bool_const_vars::$0 = bool_const_vars::a==$f
Constant (const bool) bool_const_vars::$2 = $15>=bool_const_vars::a
Constant (const bool) bool_const_vars::$4 = bool_const_vars::a!=$2c
Constant (const bool) bool_const_vars::$5 = bool_const_vars::a>=-8
Constant (const bool) bool_const_inline::$0 = bool_const_inline::a!=$2c
Constant (const bool) bool_const_inline::$1 = bool_const_inline::a>=-8
Constant (const bool) bool_const_inline::$2 = bool_const_inline::a==$f
Constant (const bool) bool_const_inline::$6 = $15>=bool_const_inline::a
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [4] if((const bool) bool_const_if::b) goto bool_const_if::@1
if() condition always false - eliminating [21] if((const bool) bool_const_vars::$0) goto bool_const_vars::@6
if() condition always true - replacing block destination [33] if((const bool) bool_const_inline::$0) goto bool_const_inline::@1
if() condition always false - eliminating if(false) goto bool_const_vars::@1
if() condition always true - replacing block destination if((const bool) bool_const_vars::$4) goto bool_const_vars::@5
if() condition always true - replacing block destination if((const bool) bool_const_vars::$2) goto bool_const_vars::@6
if() condition always false - eliminating if((const bool) bool_const_inline::$6) goto bool_const_inline::@1
if() condition always true - replacing block destination if((const bool) bool_const_inline::$1) goto bool_const_inline::@7
if() condition always true - replacing block destination if((const bool) bool_const_vars::$5) goto bool_const_vars::@5
if() condition always false - eliminating if((const bool) bool_const_inline::$2) goto bool_const_inline::@1
Successful SSA optimization Pass2ConstantIfs
Simplifying expression containing zero SCREEN in [5] *((const byte*) SCREEN + (byte) 0) ← (byte) 't'
Simplifying expression containing zero SCREEN in [6] *((const byte*) SCREEN + (byte) 0) ← (byte) 'f'
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const bool) bool_const_if::b
Eliminating unused constant (const bool) bool_const_vars::$0
Eliminating unused constant (const bool) bool_const_vars::$2
Eliminating unused constant (const bool) bool_const_vars::$4
Eliminating unused constant (const bool) bool_const_vars::$5
Eliminating unused constant (const bool) bool_const_inline::$0
Eliminating unused constant (const bool) bool_const_inline::$1
Eliminating unused constant (const bool) bool_const_inline::$2
Eliminating unused constant (const bool) bool_const_inline::$6
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte) bool_const_vars::a
Eliminating unused constant (const byte) bool_const_inline::a
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block bool_const_if::@3
Removing unused block bool_const_vars::@1
Removing unused block bool_const_inline::@3
Removing unused block bool_const_inline::@5
Removing unused block bool_const_inline::@6
Removing unused block bool_const_vars::@8
Removing unused block bool_const_inline::@7
Successful SSA optimization Pass2EliminateUnusedBlocks
Consolidated array index constant in *(SCREEN+1)
Consolidated array index constant in *(SCREEN+2)
Successful SSA optimization Pass2ConstantAdditionElimination
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @4
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of bool_const_inline
Adding NOP phi() at start of bool_const_vars
Adding NOP phi() at start of bool_const_vars::@7
Adding NOP phi() at start of bool_const_vars::@6
Adding NOP phi() at start of bool_const_vars::@5
Adding NOP phi() at start of bool_const_if
CALL GRAPH
Calls in [] to main:2 
Calls in [main] to bool_const_if:6 bool_const_vars:8 bool_const_inline:10 

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @5
Culled Empty Block (label) main::@3
Culled Empty Block (label) bool_const_vars::@7
Culled Empty Block (label) bool_const_vars::@6
Culled Empty Block (label) bool_const_vars::@5
Renumbering block @4 to @1
Renumbering block bool_const_vars::@3 to bool_const_vars::@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
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of bool_const_inline
Adding NOP phi() at start of bool_const_vars
Adding NOP phi() at start of bool_const_if

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()

(void()) main()
main: scope:[main]  from @1
  [4] phi()
  [5] call bool_const_if 
  to:main::@1
main::@1: scope:[main]  from main
  [6] phi()
  [7] call bool_const_vars 
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] phi()
  [9] call bool_const_inline 
  to:main::@return
main::@return: scope:[main]  from main::@2
  [10] return 
  to:@return

(void()) bool_const_inline()
bool_const_inline: scope:[bool_const_inline]  from main::@2
  [11] phi()
  to:bool_const_inline::@1
bool_const_inline::@1: scope:[bool_const_inline]  from bool_const_inline
  [12] *((const byte*) SCREEN+(byte) 2) ← (byte) 't'
  to:bool_const_inline::@return
bool_const_inline::@return: scope:[bool_const_inline]  from bool_const_inline::@1
  [13] return 
  to:@return

(void()) bool_const_vars()
bool_const_vars: scope:[bool_const_vars]  from main::@1
  [14] phi()
  to:bool_const_vars::@1
bool_const_vars::@1: scope:[bool_const_vars]  from bool_const_vars
  [15] *((const byte*) SCREEN+(byte) 1) ← (byte) 'f'
  to:bool_const_vars::@return
bool_const_vars::@return: scope:[bool_const_vars]  from bool_const_vars::@1
  [16] return 
  to:@return

(void()) bool_const_if()
bool_const_if: scope:[bool_const_if]  from main
  [17] phi()
  to:bool_const_if::@1
bool_const_if::@1: scope:[bool_const_if]  from bool_const_if
  [18] *((const byte*) SCREEN) ← (byte) 't'
  to:bool_const_if::@return
bool_const_if::@return: scope:[bool_const_if]  from bool_const_if::@1
  [19] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(void()) bool_const_if()
(void()) bool_const_inline()
(void()) bool_const_vars()
(bool) bool_const_vars::b
(bool) bool_const_vars::b1
(bool) bool_const_vars::b2
(void()) main()

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
Target platform is c64basic / MOS6502X
  // File Comments
// A Minimal test of boolean constants.
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  // @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 bool_const_if 
    // [17] phi from main to bool_const_if [phi:main->bool_const_if]
  bool_const_if_from_main:
    jsr bool_const_if
    // [6] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    jmp __b1
    // main::@1
  __b1:
    // [7] call bool_const_vars 
    // [14] phi from main::@1 to bool_const_vars [phi:main::@1->bool_const_vars]
  bool_const_vars_from___b1:
    jsr bool_const_vars
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    jmp __b2
    // main::@2
  __b2:
    // [9] call bool_const_inline 
    // [11] phi from main::@2 to bool_const_inline [phi:main::@2->bool_const_inline]
  bool_const_inline_from___b2:
    jsr bool_const_inline
    jmp __breturn
    // main::@return
  __breturn:
    // [10] return 
    rts
}
  // bool_const_inline
// A constant boolean inside an if()
bool_const_inline: {
    jmp __b1
    // bool_const_inline::@1
  __b1:
    // [12] *((const byte*) SCREEN+(byte) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2 
    lda #'t'
    sta SCREEN+2
    jmp __breturn
    // bool_const_inline::@return
  __breturn:
    // [13] return 
    rts
}
  // bool_const_vars
// A bunch of constant boolean vars (used in an if)
bool_const_vars: {
    jmp __b1
    // bool_const_vars::@1
  __b1:
    // [15] *((const byte*) SCREEN+(byte) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2 
    lda #'f'
    sta SCREEN+1
    jmp __breturn
    // bool_const_vars::@return
  __breturn:
    // [16] return 
    rts
}
  // bool_const_if
// A constant boolean inside an if()
bool_const_if: {
    jmp __b1
    // bool_const_if::@1
  __b1:
    // [18] *((const byte*) SCREEN) ← (byte) 't' -- _deref_pbuc1=vbuc2 
    lda #'t'
    sta SCREEN
    jmp __breturn
    // bool_const_if::@return
  __breturn:
    // [19] return 
    rts
}
  // File Data

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [12] *((const byte*) SCREEN+(byte) 2) ← (byte) 't' [ ] ( main:2::bool_const_inline:9 [ ] ) always clobbers reg byte a 
Statement [15] *((const byte*) SCREEN+(byte) 1) ← (byte) 'f' [ ] ( main:2::bool_const_vars:7 [ ] ) always clobbers reg byte a 
Statement [18] *((const byte*) SCREEN) ← (byte) 't' [ ] ( main:2::bool_const_if:5 [ ] ) always clobbers reg byte a 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 
Uplift Scope [bool_const_if] 
Uplift Scope [bool_const_vars] 
Uplift Scope [bool_const_inline] 
Uplift Scope [] 

Uplifting [main] best 180 combination 
Uplifting [bool_const_if] best 180 combination 
Uplifting [bool_const_vars] best 180 combination 
Uplifting [bool_const_inline] best 180 combination 
Uplifting [] best 180 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// A Minimal test of boolean constants.
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  // @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 bool_const_if 
    // [17] phi from main to bool_const_if [phi:main->bool_const_if]
  bool_const_if_from_main:
    jsr bool_const_if
    // [6] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    jmp __b1
    // main::@1
  __b1:
    // [7] call bool_const_vars 
    // [14] phi from main::@1 to bool_const_vars [phi:main::@1->bool_const_vars]
  bool_const_vars_from___b1:
    jsr bool_const_vars
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
  __b2_from___b1:
    jmp __b2
    // main::@2
  __b2:
    // [9] call bool_const_inline 
    // [11] phi from main::@2 to bool_const_inline [phi:main::@2->bool_const_inline]
  bool_const_inline_from___b2:
    jsr bool_const_inline
    jmp __breturn
    // main::@return
  __breturn:
    // [10] return 
    rts
}
  // bool_const_inline
// A constant boolean inside an if()
bool_const_inline: {
    jmp __b1
    // bool_const_inline::@1
  __b1:
    // [12] *((const byte*) SCREEN+(byte) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2 
    lda #'t'
    sta SCREEN+2
    jmp __breturn
    // bool_const_inline::@return
  __breturn:
    // [13] return 
    rts
}
  // bool_const_vars
// A bunch of constant boolean vars (used in an if)
bool_const_vars: {
    jmp __b1
    // bool_const_vars::@1
  __b1:
    // [15] *((const byte*) SCREEN+(byte) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2 
    lda #'f'
    sta SCREEN+1
    jmp __breturn
    // bool_const_vars::@return
  __breturn:
    // [16] return 
    rts
}
  // bool_const_if
// A constant boolean inside an if()
bool_const_if: {
    jmp __b1
    // bool_const_if::@1
  __b1:
    // [18] *((const byte*) SCREEN) ← (byte) 't' -- _deref_pbuc1=vbuc2 
    lda #'t'
    sta SCREEN
    jmp __breturn
    // bool_const_if::@return
  __breturn:
    // [19] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from_main:
Removing instruction bool_const_vars_from___b1:
Removing instruction __b2_from___b1:
Removing instruction bool_const_inline_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction bool_const_if_from_main:
Removing instruction __b1:
Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte*) SCREEN = (byte*) 1024
(void()) bool_const_if()
(label) bool_const_if::@1
(label) bool_const_if::@return
(void()) bool_const_inline()
(label) bool_const_inline::@1
(label) bool_const_inline::@return
(void()) bool_const_vars()
(label) bool_const_vars::@1
(label) bool_const_vars::@return
(bool) bool_const_vars::b
(bool) bool_const_vars::b1
(bool) bool_const_vars::b2
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return



FINAL ASSEMBLER
Score: 60

  // File Comments
// A Minimal test of boolean constants.
  // Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
  // Global Constants & labels
  .label SCREEN = $400
  // @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: {
    // bool_const_if()
    // [5] call bool_const_if 
    // [17] phi from main to bool_const_if [phi:main->bool_const_if]
    jsr bool_const_if
    // [6] phi from main to main::@1 [phi:main->main::@1]
    // main::@1
    // bool_const_vars()
    // [7] call bool_const_vars 
    // [14] phi from main::@1 to bool_const_vars [phi:main::@1->bool_const_vars]
    jsr bool_const_vars
    // [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
    // main::@2
    // bool_const_inline()
    // [9] call bool_const_inline 
    // [11] phi from main::@2 to bool_const_inline [phi:main::@2->bool_const_inline]
    jsr bool_const_inline
    // main::@return
    // }
    // [10] return 
    rts
}
  // bool_const_inline
// A constant boolean inside an if()
bool_const_inline: {
    // bool_const_inline::@1
    // SCREEN[2] = 't'
    // [12] *((const byte*) SCREEN+(byte) 2) ← (byte) 't' -- _deref_pbuc1=vbuc2 
    lda #'t'
    sta SCREEN+2
    // bool_const_inline::@return
    // }
    // [13] return 
    rts
}
  // bool_const_vars
// A bunch of constant boolean vars (used in an if)
bool_const_vars: {
    // bool_const_vars::@1
    // SCREEN[1] = 'f'
    // [15] *((const byte*) SCREEN+(byte) 1) ← (byte) 'f' -- _deref_pbuc1=vbuc2 
    lda #'f'
    sta SCREEN+1
    // bool_const_vars::@return
    // }
    // [16] return 
    rts
}
  // bool_const_if
// A constant boolean inside an if()
bool_const_if: {
    // bool_const_if::@1
    // SCREEN[0] = 't'
    // [18] *((const byte*) SCREEN) ← (byte) 't' -- _deref_pbuc1=vbuc2 
    lda #'t'
    sta SCREEN
    // bool_const_if::@return
    // }
    // [19] return 
    rts
}
  // File Data

