Setting inferred volatile on symbol affected by address-of (byte**~) utoa16w::$2 ← & (byte*) utoa16w::dst
Setting inferred volatile on symbol affected by address-of (byte**~) utoa16w::$6 ← & (byte*) utoa16w::dst
Setting inferred volatile on symbol affected by address-of (byte**~) utoa16w::$10 ← & (byte*) utoa16w::dst
Setting inferred volatile on symbol affected by address-of (byte**~) utoa16w::$14 ← & (byte*) utoa16w::dst
Identified constant variable (byte*) cls::screen
Culled Empty Block (label) @1
Culled Empty Block (label) cls::@2
Culled Empty Block (label) @3
Culled Empty Block (label) utoa16n::@5

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  to:@2
main: scope:[main]  from @4
  call cls 
  to:main::@1
main::@1: scope:[main]  from main
  (byte*) main::screen#0 ← ((byte*)) (number) $400
  (word) utoa16w::value#0 ← (number) 0
  (byte*) utoa16w::dst#0 ← (byte*) main::screen#0
  call utoa16w 
  to:main::@2
main::@2: scope:[main]  from main::@1
  (byte*) main::screen#5 ← phi( main::@1/(byte*) main::screen#0 )
  (byte*) main::screen#1 ← (byte*) main::screen#5 + (number) $28
  (word) utoa16w::value#1 ← (number) $4d2
  (byte*) utoa16w::dst#1 ← (byte*) main::screen#1
  call utoa16w 
  to:main::@3
main::@3: scope:[main]  from main::@2
  (byte*) main::screen#6 ← phi( main::@2/(byte*) main::screen#1 )
  (byte*) main::screen#2 ← (byte*) main::screen#6 + (number) $28
  (word) utoa16w::value#2 ← (number) $162e
  (byte*) utoa16w::dst#2 ← (byte*) main::screen#2
  call utoa16w 
  to:main::@4
main::@4: scope:[main]  from main::@3
  (byte*) main::screen#7 ← phi( main::@3/(byte*) main::screen#2 )
  (byte*) main::screen#3 ← (byte*) main::screen#7 + (number) $28
  (word) utoa16w::value#3 ← (number) $270f
  (byte*) utoa16w::dst#3 ← (byte*) main::screen#3
  call utoa16w 
  to:main::@5
main::@5: scope:[main]  from main::@4
  (byte*) main::screen#8 ← phi( main::@4/(byte*) main::screen#3 )
  (byte*) main::screen#4 ← (byte*) main::screen#8 + (number) $28
  (word) utoa16w::value#4 ← (number) $e608
  (byte*) utoa16w::dst#4 ← (byte*) main::screen#4
  call utoa16w 
  to:main::@6
main::@6: scope:[main]  from main::@5
  to:main::@return
main::@return: scope:[main]  from main::@6
  return 
  to:@return
cls: scope:[cls]  from main
  (byte*) cls::screen#0 ← ((byte*)) (number) $400
  (byte*~) cls::$0 ← (byte*) cls::screen#0 + (number) $3e7
  (byte*) cls::sc#0 ← (byte*) cls::screen#0
  to:cls::@1
cls::@1: scope:[cls]  from cls cls::@1
  (byte*) cls::sc#2 ← phi( cls/(byte*) cls::sc#0 cls::@1/(byte*) cls::sc#1 )
  *((byte*) cls::sc#2) ← (byte) ' '
  (byte*) cls::sc#1 ← (byte*) cls::sc#2 + rangenext(cls::screen#0,cls::$0)
  (bool~) cls::$1 ← (byte*) cls::sc#1 != rangelast(cls::screen#0,cls::$0)
  if((bool~) cls::$1) goto cls::@1
  to:cls::@return
cls::@return: scope:[cls]  from cls::@1
  return 
  to:@return
@2: scope:[]  from @begin
  (byte[]) DIGITS#0 ← (const string) $0
  to:@4
utoa16w: scope:[utoa16w]  from main::@1 main::@2 main::@3 main::@4 main::@5
  (byte*) utoa16w::dst#5 ← phi( main::@1/(byte*) utoa16w::dst#0 main::@2/(byte*) utoa16w::dst#1 main::@3/(byte*) utoa16w::dst#2 main::@4/(byte*) utoa16w::dst#3 main::@5/(byte*) utoa16w::dst#4 )
  (word) utoa16w::value#5 ← phi( main::@1/(word) utoa16w::value#0 main::@2/(word) utoa16w::value#1 main::@3/(word) utoa16w::value#2 main::@4/(word) utoa16w::value#3 main::@5/(word) utoa16w::value#4 )
  (byte) utoa16w::started#0 ← (number) 0
  (byte~) utoa16w::$0 ← > (word) utoa16w::value#5
  (byte~) utoa16w::$1 ← (byte~) utoa16w::$0 >> (number) 4
  (byte**~) utoa16w::$2 ← & (byte*) utoa16w::dst#5
  (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$1
  (word**) utoa16n::dst#0 ← (byte**~) utoa16w::$2
  (byte) utoa16n::started#0 ← (byte) utoa16w::started#0
  call utoa16n 
  (byte) utoa16n::return#0 ← (byte) utoa16n::return#5
  to:utoa16w::@1
utoa16w::@1: scope:[utoa16w]  from utoa16w
  (byte*) utoa16w::dst#6 ← phi( utoa16w/(byte*) utoa16w::dst#5 )
  (word) utoa16w::value#6 ← phi( utoa16w/(word) utoa16w::value#5 )
  (byte) utoa16n::return#6 ← phi( utoa16w/(byte) utoa16n::return#0 )
  (byte~) utoa16w::$3 ← (byte) utoa16n::return#6
  (byte) utoa16w::started#1 ← (byte~) utoa16w::$3
  (byte~) utoa16w::$4 ← > (word) utoa16w::value#6
  (number~) utoa16w::$5 ← (byte~) utoa16w::$4 & (number) $f
  (byte**~) utoa16w::$6 ← & (byte*) utoa16w::dst#6
  (byte) utoa16n::nybble#1 ← (number~) utoa16w::$5
  (word**) utoa16n::dst#1 ← (byte**~) utoa16w::$6
  (byte) utoa16n::started#1 ← (byte) utoa16w::started#1
  call utoa16n 
  (byte) utoa16n::return#1 ← (byte) utoa16n::return#5
  to:utoa16w::@2
utoa16w::@2: scope:[utoa16w]  from utoa16w::@1
  (byte*) utoa16w::dst#7 ← phi( utoa16w::@1/(byte*) utoa16w::dst#6 )
  (word) utoa16w::value#7 ← phi( utoa16w::@1/(word) utoa16w::value#6 )
  (byte) utoa16n::return#7 ← phi( utoa16w::@1/(byte) utoa16n::return#1 )
  (byte~) utoa16w::$7 ← (byte) utoa16n::return#7
  (byte) utoa16w::started#2 ← (byte~) utoa16w::$7
  (byte~) utoa16w::$8 ← < (word) utoa16w::value#7
  (byte~) utoa16w::$9 ← (byte~) utoa16w::$8 >> (number) 4
  (byte**~) utoa16w::$10 ← & (byte*) utoa16w::dst#7
  (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$9
  (word**) utoa16n::dst#2 ← (byte**~) utoa16w::$10
  (byte) utoa16n::started#2 ← (byte) utoa16w::started#2
  call utoa16n 
  (byte) utoa16n::return#2 ← (byte) utoa16n::return#5
  to:utoa16w::@3
utoa16w::@3: scope:[utoa16w]  from utoa16w::@2
  (byte*) utoa16w::dst#8 ← phi( utoa16w::@2/(byte*) utoa16w::dst#7 )
  (word) utoa16w::value#8 ← phi( utoa16w::@2/(word) utoa16w::value#7 )
  (byte) utoa16n::return#8 ← phi( utoa16w::@2/(byte) utoa16n::return#2 )
  (byte~) utoa16w::$11 ← (byte) utoa16n::return#8
  (byte) utoa16w::started#3 ← (byte~) utoa16w::$11
  (byte~) utoa16w::$12 ← < (word) utoa16w::value#8
  (number~) utoa16w::$13 ← (byte~) utoa16w::$12 & (number) $f
  (byte**~) utoa16w::$14 ← & (byte*) utoa16w::dst#8
  (byte) utoa16n::nybble#3 ← (number~) utoa16w::$13
  (word**) utoa16n::dst#3 ← (byte**~) utoa16w::$14
  (byte) utoa16n::started#3 ← (number) 1
  call utoa16n 
  (byte) utoa16n::return#3 ← (byte) utoa16n::return#5
  to:utoa16w::@4
utoa16w::@4: scope:[utoa16w]  from utoa16w::@3
  (byte*) utoa16w::dst#9 ← phi( utoa16w::@3/(byte*) utoa16w::dst#8 )
  *((byte*) utoa16w::dst#9) ← (number) 0
  to:utoa16w::@return
utoa16w::@return: scope:[utoa16w]  from utoa16w::@4
  return 
  to:@return
utoa16n: scope:[utoa16n]  from utoa16w utoa16w::@1 utoa16w::@2 utoa16w::@3
  (word**) utoa16n::dst#6 ← phi( utoa16w/(word**) utoa16n::dst#0 utoa16w::@1/(word**) utoa16n::dst#1 utoa16w::@2/(word**) utoa16n::dst#2 utoa16w::@3/(word**) utoa16n::dst#3 )
  (byte) utoa16n::started#7 ← phi( utoa16w/(byte) utoa16n::started#0 utoa16w::@1/(byte) utoa16n::started#1 utoa16w::@2/(byte) utoa16n::started#2 utoa16w::@3/(byte) utoa16n::started#3 )
  (byte) utoa16n::nybble#4 ← phi( utoa16w/(byte) utoa16n::nybble#0 utoa16w::@1/(byte) utoa16n::nybble#1 utoa16w::@2/(byte) utoa16n::nybble#2 utoa16w::@3/(byte) utoa16n::nybble#3 )
  (bool~) utoa16n::$0 ← (byte) utoa16n::nybble#4 != (number) 0
  (bool~) utoa16n::$1 ← ! (bool~) utoa16n::$0
  if((bool~) utoa16n::$1) goto utoa16n::@1
  to:utoa16n::@3
utoa16n::@1: scope:[utoa16n]  from utoa16n utoa16n::@3
  (word**) utoa16n::dst#5 ← phi( utoa16n/(word**) utoa16n::dst#6 utoa16n::@3/(word**) utoa16n::dst#7 )
  (byte) utoa16n::nybble#6 ← phi( utoa16n/(byte) utoa16n::nybble#4 utoa16n::@3/(byte) utoa16n::nybble#7 )
  (byte) utoa16n::started#5 ← phi( utoa16n/(byte) utoa16n::started#7 utoa16n::@3/(byte) utoa16n::started#4 )
  (bool~) utoa16n::$2 ← (byte) utoa16n::started#5 != (number) 0
  (bool~) utoa16n::$3 ← ! (bool~) utoa16n::$2
  if((bool~) utoa16n::$3) goto utoa16n::@2
  to:utoa16n::@4
utoa16n::@3: scope:[utoa16n]  from utoa16n
  (word**) utoa16n::dst#7 ← phi( utoa16n/(word**) utoa16n::dst#6 )
  (byte) utoa16n::nybble#7 ← phi( utoa16n/(byte) utoa16n::nybble#4 )
  (byte) utoa16n::started#4 ← (number) 1
  to:utoa16n::@1
utoa16n::@2: scope:[utoa16n]  from utoa16n::@1 utoa16n::@4
  (byte) utoa16n::started#6 ← phi( utoa16n::@1/(byte) utoa16n::started#5 utoa16n::@4/(byte) utoa16n::started#8 )
  (byte) utoa16n::return#4 ← (byte) utoa16n::started#6
  to:utoa16n::@return
utoa16n::@4: scope:[utoa16n]  from utoa16n::@1
  (byte) utoa16n::started#8 ← phi( utoa16n::@1/(byte) utoa16n::started#5 )
  (word**) utoa16n::dst#4 ← phi( utoa16n::@1/(word**) utoa16n::dst#5 )
  (byte) utoa16n::nybble#5 ← phi( utoa16n::@1/(byte) utoa16n::nybble#6 )
  *(*((word**) utoa16n::dst#4)) ← *((byte[]) DIGITS#0 + (byte) utoa16n::nybble#5)
  *((word**) utoa16n::dst#4) ← ++ *((word**) utoa16n::dst#4)
  to:utoa16n::@2
utoa16n::@return: scope:[utoa16n]  from utoa16n::@2
  (byte) utoa16n::return#9 ← phi( utoa16n::@2/(byte) utoa16n::return#4 )
  (byte) utoa16n::return#5 ← (byte) utoa16n::return#9
  return 
  to:@return
@4: scope:[]  from @2
  call main 
  to:@5
@5: scope:[]  from @4
  to:@end
@end: scope:[]  from @5

SYMBOL TABLE SSA
(const string) $0 = (string) "0123456789abcdef@"
(label) @2
(label) @4
(label) @5
(label) @begin
(label) @end
(byte[]) DIGITS
(byte[]) DIGITS#0
(void()) cls()
(byte*~) cls::$0
(bool~) cls::$1
(label) cls::@1
(label) cls::@return
(byte*) cls::sc
(byte*) cls::sc#0
(byte*) cls::sc#1
(byte*) cls::sc#2
(byte*) cls::screen
(byte*) cls::screen#0
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
(byte*) main::screen
(byte*) main::screen#0
(byte*) main::screen#1
(byte*) main::screen#2
(byte*) main::screen#3
(byte*) main::screen#4
(byte*) main::screen#5
(byte*) main::screen#6
(byte*) main::screen#7
(byte*) main::screen#8
(byte()) utoa16n((byte) utoa16n::nybble , (word**) utoa16n::dst , (byte) utoa16n::started)
(bool~) utoa16n::$0
(bool~) utoa16n::$1
(bool~) utoa16n::$2
(bool~) utoa16n::$3
(label) utoa16n::@1
(label) utoa16n::@2
(label) utoa16n::@3
(label) utoa16n::@4
(label) utoa16n::@return
(word**) utoa16n::dst
(word**) utoa16n::dst#0
(word**) utoa16n::dst#1
(word**) utoa16n::dst#2
(word**) utoa16n::dst#3
(word**) utoa16n::dst#4
(word**) utoa16n::dst#5
(word**) utoa16n::dst#6
(word**) utoa16n::dst#7
(byte) utoa16n::nybble
(byte) utoa16n::nybble#0
(byte) utoa16n::nybble#1
(byte) utoa16n::nybble#2
(byte) utoa16n::nybble#3
(byte) utoa16n::nybble#4
(byte) utoa16n::nybble#5
(byte) utoa16n::nybble#6
(byte) utoa16n::nybble#7
(byte) utoa16n::return
(byte) utoa16n::return#0
(byte) utoa16n::return#1
(byte) utoa16n::return#2
(byte) utoa16n::return#3
(byte) utoa16n::return#4
(byte) utoa16n::return#5
(byte) utoa16n::return#6
(byte) utoa16n::return#7
(byte) utoa16n::return#8
(byte) utoa16n::return#9
(byte) utoa16n::started
(byte) utoa16n::started#0
(byte) utoa16n::started#1
(byte) utoa16n::started#2
(byte) utoa16n::started#3
(byte) utoa16n::started#4
(byte) utoa16n::started#5
(byte) utoa16n::started#6
(byte) utoa16n::started#7
(byte) utoa16n::started#8
(void()) utoa16w((word) utoa16w::value , (byte*) utoa16w::dst)
(byte~) utoa16w::$0
(byte~) utoa16w::$1
(byte**~) utoa16w::$10
(byte~) utoa16w::$11
(byte~) utoa16w::$12
(number~) utoa16w::$13
(byte**~) utoa16w::$14
(byte**~) utoa16w::$2
(byte~) utoa16w::$3
(byte~) utoa16w::$4
(number~) utoa16w::$5
(byte**~) utoa16w::$6
(byte~) utoa16w::$7
(byte~) utoa16w::$8
(byte~) utoa16w::$9
(label) utoa16w::@1
(label) utoa16w::@2
(label) utoa16w::@3
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#0
(byte*) utoa16w::dst#1
(byte*) utoa16w::dst#2
(byte*) utoa16w::dst#3
(byte*) utoa16w::dst#4
(byte*) utoa16w::dst#5
(byte*) utoa16w::dst#6
(byte*) utoa16w::dst#7
(byte*) utoa16w::dst#8
(byte*) utoa16w::dst#9
(byte) utoa16w::started
(byte) utoa16w::started#0
(byte) utoa16w::started#1
(byte) utoa16w::started#2
(byte) utoa16w::started#3
(word) utoa16w::value
(word) utoa16w::value#0
(word) utoa16w::value#1
(word) utoa16w::value#2
(word) utoa16w::value#3
(word) utoa16w::value#4
(word) utoa16w::value#5
(word) utoa16w::value#6
(word) utoa16w::value#7
(word) utoa16w::value#8

Adding number conversion cast (unumber) 0 in (word) utoa16w::value#0 ← (number) 0
Adding number conversion cast (unumber) $28 in (byte*) main::screen#1 ← (byte*) main::screen#5 + (number) $28
Adding number conversion cast (unumber) $4d2 in (word) utoa16w::value#1 ← (number) $4d2
Adding number conversion cast (unumber) $28 in (byte*) main::screen#2 ← (byte*) main::screen#6 + (number) $28
Adding number conversion cast (unumber) $162e in (word) utoa16w::value#2 ← (number) $162e
Adding number conversion cast (unumber) $28 in (byte*) main::screen#3 ← (byte*) main::screen#7 + (number) $28
Adding number conversion cast (unumber) $270f in (word) utoa16w::value#3 ← (number) $270f
Adding number conversion cast (unumber) $28 in (byte*) main::screen#4 ← (byte*) main::screen#8 + (number) $28
Adding number conversion cast (unumber) $e608 in (word) utoa16w::value#4 ← (number) $e608
Adding number conversion cast (unumber) $3e7 in (byte*~) cls::$0 ← (byte*) cls::screen#0 + (number) $3e7
Adding number conversion cast (unumber) 0 in (byte) utoa16w::started#0 ← (number) 0
Adding number conversion cast (unumber) 4 in (byte~) utoa16w::$1 ← (byte~) utoa16w::$0 >> (number) 4
Adding number conversion cast (unumber) $f in (number~) utoa16w::$5 ← (byte~) utoa16w::$4 & (number) $f
Adding number conversion cast (unumber) utoa16w::$5 in (number~) utoa16w::$5 ← (byte~) utoa16w::$4 & (unumber)(number) $f
Adding number conversion cast (unumber) 4 in (byte~) utoa16w::$9 ← (byte~) utoa16w::$8 >> (number) 4
Adding number conversion cast (unumber) $f in (number~) utoa16w::$13 ← (byte~) utoa16w::$12 & (number) $f
Adding number conversion cast (unumber) utoa16w::$13 in (number~) utoa16w::$13 ← (byte~) utoa16w::$12 & (unumber)(number) $f
Adding number conversion cast (unumber) 1 in (byte) utoa16n::started#3 ← (number) 1
Adding number conversion cast (unumber) 0 in *((byte*) utoa16w::dst#9) ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) utoa16n::$0 ← (byte) utoa16n::nybble#4 != (number) 0
Adding number conversion cast (unumber) 0 in (bool~) utoa16n::$2 ← (byte) utoa16n::started#5 != (number) 0
Adding number conversion cast (unumber) 1 in (byte) utoa16n::started#4 ← (number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (word) utoa16w::value#0 ← (unumber)(number) 0
Inlining cast (word) utoa16w::value#1 ← (unumber)(number) $4d2
Inlining cast (word) utoa16w::value#2 ← (unumber)(number) $162e
Inlining cast (word) utoa16w::value#3 ← (unumber)(number) $270f
Inlining cast (word) utoa16w::value#4 ← (unumber)(number) $e608
Inlining cast (byte*) cls::screen#0 ← (byte*)(number) $400
Inlining cast (byte) utoa16w::started#0 ← (unumber)(number) 0
Inlining cast (byte) utoa16n::started#3 ← (unumber)(number) 1
Inlining cast *((byte*) utoa16w::dst#9) ← (unumber)(number) 0
Inlining cast (byte) utoa16n::started#4 ← (unumber)(number) 1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Simplifying constant integer cast $4d2
Simplifying constant integer cast $28
Simplifying constant integer cast $162e
Simplifying constant integer cast $28
Simplifying constant integer cast $270f
Simplifying constant integer cast $28
Simplifying constant integer cast $e608
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $3e7
Simplifying constant integer cast 0
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $28
Finalized unsigned number type (word) $4d2
Finalized unsigned number type (byte) $28
Finalized unsigned number type (word) $162e
Finalized unsigned number type (byte) $28
Finalized unsigned number type (word) $270f
Finalized unsigned number type (byte) $28
Finalized unsigned number type (word) $e608
Finalized unsigned number type (word) $3e7
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) utoa16w::$5 ← (byte~) utoa16w::$4 & (byte) $f
Inferred type updated to byte in (unumber~) utoa16w::$13 ← (byte~) utoa16w::$12 & (byte) $f
Inversing boolean not [84] (bool~) utoa16n::$1 ← (byte) utoa16n::nybble#4 == (byte) 0 from [83] (bool~) utoa16n::$0 ← (byte) utoa16n::nybble#4 != (byte) 0
Inversing boolean not [88] (bool~) utoa16n::$3 ← (byte) utoa16n::started#5 == (byte) 0 from [87] (bool~) utoa16n::$2 ← (byte) utoa16n::started#5 != (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) main::screen#0 = (byte*) main::screen#5 
Alias (byte*) main::screen#1 = (byte*) main::screen#6 
Alias (byte*) main::screen#2 = (byte*) main::screen#7 
Alias (byte*) main::screen#3 = (byte*) main::screen#8 
Alias (byte*) cls::screen#0 = (byte*) cls::sc#0 
Alias (byte) utoa16n::nybble#0 = (byte~) utoa16w::$1 
Alias (word**) utoa16n::dst#0 = (byte**~) utoa16w::$2 
Alias (byte) utoa16n::return#0 = (byte) utoa16n::return#6 
Alias (word) utoa16w::value#5 = (word) utoa16w::value#6 (word) utoa16w::value#7 (word) utoa16w::value#8 
Alias (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#6 (byte*) utoa16w::dst#7 (byte*) utoa16w::dst#8 (byte*) utoa16w::dst#9 
Alias (byte) utoa16w::started#1 = (byte~) utoa16w::$3 
Alias (byte) utoa16n::nybble#1 = (byte~) utoa16w::$5 
Alias (word**) utoa16n::dst#1 = (byte**~) utoa16w::$6 
Alias (byte) utoa16n::return#1 = (byte) utoa16n::return#7 
Alias (byte) utoa16w::started#2 = (byte~) utoa16w::$7 
Alias (byte) utoa16n::nybble#2 = (byte~) utoa16w::$9 
Alias (word**) utoa16n::dst#2 = (byte**~) utoa16w::$10 
Alias (byte) utoa16n::return#2 = (byte) utoa16n::return#8 
Alias (byte) utoa16w::started#3 = (byte~) utoa16w::$11 
Alias (byte) utoa16n::nybble#3 = (byte~) utoa16w::$13 
Alias (word**) utoa16n::dst#3 = (byte**~) utoa16w::$14 
Alias (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#7 
Alias (word**) utoa16n::dst#6 = (word**) utoa16n::dst#7 
Alias (byte) utoa16n::return#4 = (byte) utoa16n::started#6 (byte) utoa16n::return#9 (byte) utoa16n::return#5 
Alias (byte) utoa16n::nybble#5 = (byte) utoa16n::nybble#6 
Alias (word**) utoa16n::dst#4 = (word**) utoa16n::dst#5 
Alias (byte) utoa16n::started#5 = (byte) utoa16n::started#8 
Successful SSA optimization Pass2AliasElimination
Alias (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#5 
Alias (word**) utoa16n::dst#4 = (word**) utoa16n::dst#6 
Alias (byte) utoa16n::return#4 = (byte) utoa16n::started#5 
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) cls::$1 [33] if((byte*) cls::sc#1!=rangelast(cls::screen#0,cls::$0)) goto cls::@1
Simple Condition (bool~) utoa16n::$1 [85] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@1
Simple Condition (bool~) utoa16n::$3 [89] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [40] (word**) utoa16n::dst#0 ← & (byte*) utoa16w::dst#5
Constant right-side identified [51] (word**) utoa16n::dst#1 ← & (byte*) utoa16w::dst#5
Constant right-side identified [62] (word**) utoa16n::dst#2 ← & (byte*) utoa16w::dst#5
Constant right-side identified [73] (word**) utoa16n::dst#3 ← & (byte*) utoa16w::dst#5
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#0 = (byte*) 1024
Constant (const word) utoa16w::value#0 = 0
Constant (const word) utoa16w::value#1 = $4d2
Constant (const word) utoa16w::value#2 = $162e
Constant (const word) utoa16w::value#3 = $270f
Constant (const word) utoa16w::value#4 = $e608
Constant (const byte*) cls::screen#0 = (byte*) 1024
Constant (const byte[]) DIGITS#0 = $0
Constant (const byte) utoa16w::started#0 = 0
Constant (const word**) utoa16n::dst#0 = &utoa16w::dst#5
Constant (const word**) utoa16n::dst#1 = &utoa16w::dst#5
Constant (const word**) utoa16n::dst#2 = &utoa16w::dst#5
Constant (const word**) utoa16n::dst#3 = &utoa16w::dst#5
Constant (const byte) utoa16n::started#3 = 1
Constant (const byte) utoa16n::started#4 = 1
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) utoa16n::started#0 = utoa16w::started#0
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused variable (byte) utoa16w::started#3 and assignment [39] (byte) utoa16w::started#3 ← (byte) utoa16n::return#2
Eliminating unused variable (byte) utoa16n::return#3 and assignment [43] (byte) utoa16n::return#3 ← (byte) utoa16n::return#4
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused variable (byte) utoa16n::return#2 and assignment [38] (byte) utoa16n::return#2 ← (byte) utoa16n::return#4
Successful SSA optimization PassNEliminateUnusedVars
Constant right-side identified [3] (byte*) main::screen#1 ← (const byte*) main::screen#0 + (byte) $28
Constant right-side identified [16] (byte*~) cls::$0 ← (const byte*) cls::screen#0 + (word) $3e7
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#1 = main::screen#0+$28
Constant (const byte*) cls::$0 = cls::screen#0+$3e7
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [19] cls::sc#1 ← ++ cls::sc#2 to ++
Resolved ranged comparison value [20] if(cls::sc#1!=rangelast(cls::screen#0,cls::$0)) goto cls::@1 to (byte*)(const byte*) cls::$0+(number) 1
Adding number conversion cast (unumber) 1 in if((byte*) cls::sc#1!=(byte*)(const byte*) cls::$0+(number) 1) goto cls::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte*) cls::$0+(unumber)(number) 1
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [5] (byte*) main::screen#2 ← (const byte*) main::screen#1 + (byte) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#2 = main::screen#1+$28
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [7] (byte*) main::screen#3 ← (const byte*) main::screen#2 + (byte) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#3 = main::screen#2+$28
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [9] (byte*) main::screen#4 ← (const byte*) main::screen#3 + (byte) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::screen#4 = main::screen#3+$28
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with different constant siblings (const byte*) main::screen#0
Inlining constant with different constant siblings (const byte*) main::screen#1
Inlining constant with different constant siblings (const byte*) main::screen#2
Inlining constant with different constant siblings (const byte*) main::screen#3
Inlining constant with different constant siblings (const byte*) main::screen#4
Inlining constant with var siblings (const word) utoa16w::value#0
Inlining constant with var siblings (const word) utoa16w::value#1
Inlining constant with var siblings (const word) utoa16w::value#2
Inlining constant with var siblings (const word) utoa16w::value#3
Inlining constant with var siblings (const word) utoa16w::value#4
Inlining constant with var siblings (const byte) utoa16w::started#0
Inlining constant with var siblings (const word**) utoa16n::dst#0
Inlining constant with var siblings (const word**) utoa16n::dst#1
Inlining constant with var siblings (const word**) utoa16n::dst#2
Inlining constant with var siblings (const word**) utoa16n::dst#3
Inlining constant with var siblings (const byte) utoa16n::started#3
Inlining constant with var siblings (const byte) utoa16n::started#4
Inlining constant with var siblings (const byte) utoa16n::started#0
Constant inlined main::screen#0 = (byte*) 1024
Constant inlined main::screen#1 = (byte*) 1024+(byte) $28
Constant inlined main::screen#4 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
Constant inlined utoa16w::value#2 = (word) $162e
Constant inlined utoa16w::value#1 = (word) $4d2
Constant inlined main::screen#2 = (byte*) 1024+(byte) $28+(byte) $28
Constant inlined utoa16w::value#0 = (byte) 0
Constant inlined main::screen#3 = (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
Constant inlined $0 = (const byte[]) DIGITS#0
Constant inlined utoa16w::started#0 = (byte) 0
Constant inlined utoa16n::started#0 = (byte) 0
Constant inlined cls::$0 = (const byte*) cls::screen#0+(word) $3e7
Constant inlined utoa16n::dst#1 = &(byte*) utoa16w::dst#5
Constant inlined utoa16n::dst#0 = &(byte*) utoa16w::dst#5
Constant inlined utoa16w::value#4 = (word) $e608
Constant inlined utoa16w::value#3 = (word) $270f
Constant inlined utoa16n::started#3 = (byte) 1
Constant inlined utoa16n::dst#3 = &(byte*) utoa16w::dst#5
Constant inlined utoa16n::started#4 = (byte) 1
Constant inlined utoa16n::dst#2 = &(byte*) utoa16w::dst#5
Successful SSA optimization Pass2ConstantInlining
Identical Phi Values (word**) utoa16n::dst#4 &(byte*) utoa16w::dst#5
Successful SSA optimization Pass2IdenticalPhiElimination
Added new block during phi lifting cls::@3(between cls::@1 and cls::@1)
Added new block during phi lifting utoa16n::@6(between utoa16n and utoa16n::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
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::@6
Adding NOP phi() at start of utoa16n::@3
Adding NOP phi() at start of utoa16n::@2
Adding NOP phi() at start of cls
CALL GRAPH
Calls in [] to main:3 
Calls in [main] to cls:7 utoa16w:10 utoa16w:13 utoa16w:16 utoa16w:19 utoa16w:22 
Calls in [utoa16w] to utoa16n:29 utoa16n:37 utoa16n:45 utoa16n:49 

Created 6 initial phi equivalence classes
Coalesced [9] utoa16w::dst#10 ← utoa16w::dst#0
Coalesced [12] utoa16w::dst#11 ← utoa16w::dst#1
Coalesced [15] utoa16w::dst#12 ← utoa16w::dst#2
Coalesced [18] utoa16w::dst#13 ← utoa16w::dst#3
Coalesced [21] utoa16w::dst#14 ← utoa16w::dst#4
Coalesced [28] utoa16n::nybble#8 ← utoa16n::nybble#0
Coalesced [35] utoa16n::nybble#9 ← utoa16n::nybble#1
Coalesced [36] utoa16n::started#9 ← utoa16n::started#1
Coalesced [43] utoa16n::nybble#10 ← utoa16n::nybble#2
Coalesced [44] utoa16n::started#10 ← utoa16n::started#2
Coalesced [48] utoa16n::nybble#11 ← utoa16n::nybble#3
Coalesced [61] utoa16n::return#10 ← utoa16n::started#7
Coalesced [68] cls::sc#3 ← cls::sc#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) @5
Culled Empty Block (label) main::@6
Culled Empty Block (label) utoa16n::@3
Culled Empty Block (label) utoa16n::@2
Culled Empty Block (label) cls::@3
Renumbering block @4 to @1
Renumbering block utoa16n::@4 to utoa16n::@2
Renumbering block utoa16n::@6 to utoa16n::@3
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 utoa16n::@3
Adding NOP phi() at start of cls

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 cls 
  to:main::@1
main::@1: scope:[main]  from main
  [6] (byte*) utoa16w::dst#0 ← (byte*) 1024
  [7] call utoa16w 
  to:main::@2
main::@2: scope:[main]  from main::@1
  [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28
  [9] call utoa16w 
  to:main::@3
main::@3: scope:[main]  from main::@2
  [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28
  [11] call utoa16w 
  to:main::@4
main::@4: scope:[main]  from main::@3
  [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28
  [13] call utoa16w 
  to:main::@5
main::@5: scope:[main]  from main::@4
  [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28
  [15] call utoa16w 
  to:main::@return
main::@return: scope:[main]  from main::@5
  [16] return 
  to:@return
utoa16w: scope:[utoa16w]  from main::@1 main::@2 main::@3 main::@4 main::@5
  [17] (byte*) utoa16w::dst#5 ← phi( main::@1/(byte*) utoa16w::dst#0 main::@2/(byte*) utoa16w::dst#1 main::@3/(byte*) utoa16w::dst#2 main::@4/(byte*) utoa16w::dst#3 main::@5/(byte*) utoa16w::dst#4 )
  [17] (word) utoa16w::value#5 ← phi( main::@1/(byte) 0 main::@2/(word) $4d2 main::@3/(word) $162e main::@4/(word) $270f main::@5/(word) $e608 )
  [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5
  [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4
  [20] call utoa16n 
  [21] (byte) utoa16n::return#0 ← (byte) utoa16n::return#4
  to:utoa16w::@1
utoa16w::@1: scope:[utoa16w]  from utoa16w
  [22] (byte) utoa16w::started#1 ← (byte) utoa16n::return#0
  [23] (byte~) utoa16w::$4 ← > (word) utoa16w::value#5
  [24] (byte) utoa16n::nybble#1 ← (byte~) utoa16w::$4 & (byte) $f
  [25] (byte) utoa16n::started#1 ← (byte) utoa16w::started#1
  [26] call utoa16n 
  [27] (byte) utoa16n::return#1 ← (byte) utoa16n::return#4
  to:utoa16w::@2
utoa16w::@2: scope:[utoa16w]  from utoa16w::@1
  [28] (byte) utoa16w::started#2 ← (byte) utoa16n::return#1
  [29] (byte~) utoa16w::$8 ← < (word) utoa16w::value#5
  [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$8 >> (byte) 4
  [31] (byte) utoa16n::started#2 ← (byte) utoa16w::started#2
  [32] call utoa16n 
  to:utoa16w::@3
utoa16w::@3: scope:[utoa16w]  from utoa16w::@2
  [33] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5
  [34] (byte) utoa16n::nybble#3 ← (byte~) utoa16w::$12 & (byte) $f
  [35] call utoa16n 
  to:utoa16w::@4
utoa16w::@4: scope:[utoa16w]  from utoa16w::@3
  [36] *((byte*) utoa16w::dst#5) ← (byte) 0
  to:utoa16w::@return
utoa16w::@return: scope:[utoa16w]  from utoa16w::@4
  [37] return 
  to:@return
utoa16n: scope:[utoa16n]  from utoa16w utoa16w::@1 utoa16w::@2 utoa16w::@3
  [38] (byte) utoa16n::started#7 ← phi( utoa16w/(byte) 0 utoa16w::@1/(byte) utoa16n::started#1 utoa16w::@2/(byte) utoa16n::started#2 utoa16w::@3/(byte) 1 )
  [38] (byte) utoa16n::nybble#4 ← phi( utoa16w/(byte) utoa16n::nybble#0 utoa16w::@1/(byte) utoa16n::nybble#1 utoa16w::@2/(byte) utoa16n::nybble#2 utoa16w::@3/(byte) utoa16n::nybble#3 )
  [39] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@3
  to:utoa16n::@1
utoa16n::@3: scope:[utoa16n]  from utoa16n
  [40] phi()
  to:utoa16n::@1
utoa16n::@1: scope:[utoa16n]  from utoa16n utoa16n::@3
  [41] (byte) utoa16n::return#4 ← phi( utoa16n::@3/(byte) utoa16n::started#7 utoa16n/(byte) 1 )
  [42] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return
  to:utoa16n::@2
utoa16n::@2: scope:[utoa16n]  from utoa16n::@1
  [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (byte) utoa16n::nybble#4)
  [44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5)
  to:utoa16n::@return
utoa16n::@return: scope:[utoa16n]  from utoa16n::@1 utoa16n::@2
  [45] return 
  to:@return
cls: scope:[cls]  from main
  [46] phi()
  to:cls::@1
cls::@1: scope:[cls]  from cls cls::@1
  [47] (byte*) cls::sc#2 ← phi( cls/(const byte*) cls::screen#0 cls::@1/(byte*) cls::sc#1 )
  [48] *((byte*) cls::sc#2) ← (byte) ' '
  [49] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2
  [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1
  to:cls::@return
cls::@return: scope:[cls]  from cls::@1
  [51] return 
  to:@return


VARIABLE REGISTER WEIGHTS
(byte[]) DIGITS
(void()) cls()
(byte*) cls::sc
(byte*) cls::sc#1 16.5
(byte*) cls::sc#2 16.5
(byte*) cls::screen
(void()) main()
(byte*) main::screen
(byte()) utoa16n((byte) utoa16n::nybble , (word**) utoa16n::dst , (byte) utoa16n::started)
(word**) utoa16n::dst
(byte) utoa16n::nybble
(byte) utoa16n::nybble#0 4.0
(byte) utoa16n::nybble#1 2.0
(byte) utoa16n::nybble#2 2.0
(byte) utoa16n::nybble#3 4.0
(byte) utoa16n::nybble#4 2.4
(byte) utoa16n::return
(byte) utoa16n::return#0 4.0
(byte) utoa16n::return#1 4.0
(byte) utoa16n::return#4 1.1428571428571428
(byte) utoa16n::started
(byte) utoa16n::started#1 4.0
(byte) utoa16n::started#2 4.0
(byte) utoa16n::started#7 2.0
(void()) utoa16w((word) utoa16w::value , (byte*) utoa16w::dst)
(byte~) utoa16w::$0 4.0
(byte~) utoa16w::$12 4.0
(byte~) utoa16w::$4 4.0
(byte~) utoa16w::$8 4.0
(byte*) utoa16w::dst
(byte*) utoa16w::dst#0 4.0
(byte*) utoa16w::dst#1 4.0
(byte*) utoa16w::dst#2 4.0
(byte*) utoa16w::dst#3 4.0
(byte*) utoa16w::dst#4 4.0
(byte*) utoa16w::dst#5 0.4444444444444444
(byte) utoa16w::started
(byte) utoa16w::started#1 1.3333333333333333
(byte) utoa16w::started#2 1.3333333333333333
(word) utoa16w::value
(word) utoa16w::value#5 0.5

Initial phi equivalence classes
[ utoa16w::value#5 ]
[ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
[ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
[ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
[ cls::sc#2 cls::sc#1 ]
Added variable utoa16w::$0 to zero page equivalence class [ utoa16w::$0 ]
Added variable utoa16n::return#0 to zero page equivalence class [ utoa16n::return#0 ]
Added variable utoa16w::started#1 to zero page equivalence class [ utoa16w::started#1 ]
Added variable utoa16w::$4 to zero page equivalence class [ utoa16w::$4 ]
Added variable utoa16n::return#1 to zero page equivalence class [ utoa16n::return#1 ]
Added variable utoa16w::started#2 to zero page equivalence class [ utoa16w::started#2 ]
Added variable utoa16w::$8 to zero page equivalence class [ utoa16w::$8 ]
Added variable utoa16w::$12 to zero page equivalence class [ utoa16w::$12 ]
Complete equivalence classes
[ utoa16w::value#5 ]
[ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
[ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
[ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
[ cls::sc#2 cls::sc#1 ]
[ utoa16w::$0 ]
[ utoa16n::return#0 ]
[ utoa16w::started#1 ]
[ utoa16w::$4 ]
[ utoa16n::return#1 ]
[ utoa16w::started#2 ]
[ utoa16w::$8 ]
[ utoa16w::$12 ]
Allocated zp ZP_WORD:2 [ utoa16w::value#5 ]
Allocated zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
Allocated zp ZP_BYTE:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
Allocated zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Allocated zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ]
Allocated zp ZP_BYTE:10 [ utoa16w::$0 ]
Allocated zp ZP_BYTE:11 [ utoa16n::return#0 ]
Allocated zp ZP_BYTE:12 [ utoa16w::started#1 ]
Allocated zp ZP_BYTE:13 [ utoa16w::$4 ]
Allocated zp ZP_BYTE:14 [ utoa16n::return#1 ]
Allocated zp ZP_BYTE:15 [ utoa16w::started#2 ]
Allocated zp ZP_BYTE:16 [ utoa16w::$8 ]
Allocated zp ZP_BYTE:17 [ utoa16w::$12 ]

INITIAL ASM
  // File Comments
// Testing binary to hex conversion using pointer to pointer
  // 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 cls 
    // [46] phi from main to cls [phi:main->cls]
  cls_from_main:
    jsr cls
    jmp b1
    // main::@1
  b1:
    // [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1 
    lda #<$400
    sta utoa16w.dst
    lda #>$400
    sta utoa16w.dst+1
    // [7] call utoa16w 
    // [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
  utoa16w_from_b1:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1 
    lda #<0
    sta utoa16w.value
    lda #>0
    sta utoa16w.value+1
    jsr utoa16w
    jmp b2
    // main::@2
  b2:
    // [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28
    sta utoa16w.dst
    lda #>$400+$28
    sta utoa16w.dst+1
    // [9] call utoa16w 
    // [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
  utoa16w_from_b2:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$4d2
    sta utoa16w.value
    lda #>$4d2
    sta utoa16w.value+1
    jsr utoa16w
    jmp b3
    // main::@3
  b3:
    // [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28
    sta utoa16w.dst+1
    // [11] call utoa16w 
    // [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
  utoa16w_from_b3:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$162e
    sta utoa16w.value
    lda #>$162e
    sta utoa16w.value+1
    jsr utoa16w
    jmp b4
    // main::@4
  b4:
    // [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28+$28
    sta utoa16w.dst+1
    // [13] call utoa16w 
    // [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
  utoa16w_from_b4:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$270f
    sta utoa16w.value
    lda #>$270f
    sta utoa16w.value+1
    jsr utoa16w
    jmp b5
    // main::@5
  b5:
    // [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28+$28+$28
    sta utoa16w.dst+1
    // [15] call utoa16w 
    // [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
  utoa16w_from_b5:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$e608
    sta utoa16w.value
    lda #>$e608
    sta utoa16w.value+1
    jsr utoa16w
    jmp breturn
    // main::@return
  breturn:
    // [16] return 
    rts
}
  // utoa16w
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zeropage(2) value, byte* zeropage(4) dst)
utoa16w: {
    .label _0 = $a
    .label _4 = $d
    .label _8 = $10
    .label _12 = $11
    .label dst = 4
    .label started = $c
    .label started_2 = $f
    .label value = 2
    // [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 -- vbuz1=_hi_vwuz2 
    lda value+1
    sta _0
    // [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 -- vbuz1=vbuz2_ror_4 
    lda _0
    lsr
    lsr
    lsr
    lsr
    sta utoa16n.nybble
    // [20] call utoa16n 
    // [38] phi from utoa16w to utoa16n [phi:utoa16w->utoa16n]
  utoa16n_from_utoa16w:
    // [38] phi (byte) utoa16n::started#7 = (byte) 0 [phi:utoa16w->utoa16n#0] -- vbuz1=vbuc1 
    lda #0
    sta utoa16n.started
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#0 [phi:utoa16w->utoa16n#1] -- register_copy 
    jsr utoa16n
    // [21] (byte) utoa16n::return#0 ← (byte) utoa16n::return#4 -- vbuz1=vbuz2 
    lda utoa16n.return_4
    sta utoa16n.return
    jmp b1
    // utoa16w::@1
  b1:
    // [22] (byte) utoa16w::started#1 ← (byte) utoa16n::return#0 -- vbuz1=vbuz2 
    lda utoa16n.return
    sta started
    // [23] (byte~) utoa16w::$4 ← > (word) utoa16w::value#5 -- vbuz1=_hi_vwuz2 
    lda value+1
    sta _4
    // [24] (byte) utoa16n::nybble#1 ← (byte~) utoa16w::$4 & (byte) $f -- vbuz1=vbuz2_band_vbuc1 
    lda #$f
    and _4
    sta utoa16n.nybble
    // [25] (byte) utoa16n::started#1 ← (byte) utoa16w::started#1 -- vbuz1=vbuz2 
    lda started
    sta utoa16n.started
    // [26] call utoa16n 
    // [38] phi from utoa16w::@1 to utoa16n [phi:utoa16w::@1->utoa16n]
  utoa16n_from_b1:
    // [38] phi (byte) utoa16n::started#7 = (byte) utoa16n::started#1 [phi:utoa16w::@1->utoa16n#0] -- register_copy 
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#1 [phi:utoa16w::@1->utoa16n#1] -- register_copy 
    jsr utoa16n
    // [27] (byte) utoa16n::return#1 ← (byte) utoa16n::return#4 -- vbuz1=vbuz2 
    lda utoa16n.return_4
    sta utoa16n.return_1
    jmp b2
    // utoa16w::@2
  b2:
    // [28] (byte) utoa16w::started#2 ← (byte) utoa16n::return#1 -- vbuz1=vbuz2 
    lda utoa16n.return_1
    sta started_2
    // [29] (byte~) utoa16w::$8 ← < (word) utoa16w::value#5 -- vbuz1=_lo_vwuz2 
    lda value
    sta _8
    // [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$8 >> (byte) 4 -- vbuz1=vbuz2_ror_4 
    lda _8
    lsr
    lsr
    lsr
    lsr
    sta utoa16n.nybble
    // [31] (byte) utoa16n::started#2 ← (byte) utoa16w::started#2 -- vbuz1=vbuz2 
    lda started_2
    sta utoa16n.started
    // [32] call utoa16n 
    // [38] phi from utoa16w::@2 to utoa16n [phi:utoa16w::@2->utoa16n]
  utoa16n_from_b2:
    // [38] phi (byte) utoa16n::started#7 = (byte) utoa16n::started#2 [phi:utoa16w::@2->utoa16n#0] -- register_copy 
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#2 [phi:utoa16w::@2->utoa16n#1] -- register_copy 
    jsr utoa16n
    jmp b3
    // utoa16w::@3
  b3:
    // [33] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5 -- vbuz1=_lo_vwuz2 
    lda value
    sta _12
    // [34] (byte) utoa16n::nybble#3 ← (byte~) utoa16w::$12 & (byte) $f -- vbuz1=vbuz2_band_vbuc1 
    lda #$f
    and _12
    sta utoa16n.nybble
    // [35] call utoa16n 
    // [38] phi from utoa16w::@3 to utoa16n [phi:utoa16w::@3->utoa16n]
  utoa16n_from_b3:
    // [38] phi (byte) utoa16n::started#7 = (byte) 1 [phi:utoa16w::@3->utoa16n#0] -- vbuz1=vbuc1 
    lda #1
    sta utoa16n.started
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#3 [phi:utoa16w::@3->utoa16n#1] -- register_copy 
    jsr utoa16n
    jmp b4
    // utoa16w::@4
  b4:
    // [36] *((byte*) utoa16w::dst#5) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    ldy #0
    sta (dst),y
    jmp breturn
    // utoa16w::@return
  breturn:
    // [37] return 
    rts
}
  // utoa16n
// Hexadecimal utoa() for a single nybble
// utoa16n(byte zeropage(6) nybble, byte zeropage(7) started)
utoa16n: {
    .label nybble = 6
    .label return = $b
    .label started = 7
    .label return_1 = $e
    .label return_4 = 7
    // [39] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@3 -- vbuz1_eq_0_then_la1 
    lda nybble
    cmp #0
    beq b3_from_utoa16n
    // [41] phi from utoa16n to utoa16n::@1 [phi:utoa16n->utoa16n::@1]
  b1_from_utoa16n:
    // [41] phi (byte) utoa16n::return#4 = (byte) 1 [phi:utoa16n->utoa16n::@1#0] -- vbuz1=vbuc1 
    lda #1
    sta return_4
    jmp b1
    // [40] phi from utoa16n to utoa16n::@3 [phi:utoa16n->utoa16n::@3]
  b3_from_utoa16n:
    jmp b3
    // utoa16n::@3
  b3:
    // [41] phi from utoa16n::@3 to utoa16n::@1 [phi:utoa16n::@3->utoa16n::@1]
  b1_from_b3:
    // [41] phi (byte) utoa16n::return#4 = (byte) utoa16n::started#7 [phi:utoa16n::@3->utoa16n::@1#0] -- register_copy 
    jmp b1
    // utoa16n::@1
  b1:
    // [42] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return -- vbuz1_eq_0_then_la1 
    lda return_4
    cmp #0
    beq breturn
    jmp b2
    // utoa16n::@2
  b2:
    // [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (byte) utoa16n::nybble#4) -- _deref__deref_pptc1=pbuc2_derefidx_vbuz1 
    ldy nybble
    lda DIGITS,y
    ldy #0
    sta (utoa16w.dst),y
    // [44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5) -- _deref_pptc1=_inc__deref_pptc1 
    inc utoa16w.dst
    bne !+
    inc utoa16w.dst+1
  !:
    jmp breturn
    // utoa16n::@return
  breturn:
    // [45] return 
    rts
}
  // cls
cls: {
    .label screen = $400
    .label sc = 8
    // [47] phi from cls to cls::@1 [phi:cls->cls::@1]
  b1_from_cls:
    // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 
    lda #<screen
    sta sc
    lda #>screen
    sta sc+1
    jmp b1
    // [47] phi from cls::@1 to cls::@1 [phi:cls::@1->cls::@1]
  b1_from_b1:
    // [47] phi (byte*) cls::sc#2 = (byte*) cls::sc#1 [phi:cls::@1->cls::@1#0] -- register_copy 
    jmp b1
    // cls::@1
  b1:
    // [48] *((byte*) cls::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [49] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2 -- pbuz1=_inc_pbuz1 
    inc sc
    bne !+
    inc sc+1
  !:
    // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda sc+1
    cmp #>screen+$3e7+1
    bne b1_from_b1
    lda sc
    cmp #<screen+$3e7+1
    bne b1_from_b1
    jmp breturn
    // cls::@return
  breturn:
    // [51] return 
    rts
}
  // File Data
  // Digits used for utoa()
  DIGITS: .text "0123456789abcdef@"

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 [ utoa16w::dst#0 ] ( main:2 [ utoa16w::dst#0 ] ) always clobbers reg byte a 
Statement [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 [ utoa16w::dst#1 ] ( main:2 [ utoa16w::dst#1 ] ) always clobbers reg byte a 
Statement [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 [ utoa16w::dst#2 ] ( main:2 [ utoa16w::dst#2 ] ) always clobbers reg byte a 
Statement [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst#3 ] ( main:2 [ utoa16w::dst#3 ] ) always clobbers reg byte a 
Statement [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst#4 ] ( main:2 [ utoa16w::dst#4 ] ) always clobbers reg byte a 
Statement [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] ) always clobbers reg byte a 
Statement [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] ) always clobbers reg byte a 
Statement [23] (byte~) utoa16w::$4 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ utoa16w::started#1 ]
Statement [29] (byte~) utoa16w::$8 ← < (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:15 [ utoa16w::started#2 ]
Statement [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$8 >> (byte) 4 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] ) always clobbers reg byte a 
Statement [33] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5 [ utoa16w::dst#5 utoa16w::$12 ] ( main:2::utoa16w:7 [ utoa16w::dst#5 utoa16w::$12 ] main:2::utoa16w:9 [ utoa16w::dst#5 utoa16w::$12 ] main:2::utoa16w:11 [ utoa16w::dst#5 utoa16w::$12 ] main:2::utoa16w:13 [ utoa16w::dst#5 utoa16w::$12 ] main:2::utoa16w:15 [ utoa16w::dst#5 utoa16w::$12 ] ) always clobbers reg byte a 
Statement [36] *((byte*) utoa16w::dst#5) ← (byte) 0 [ ] ( main:2::utoa16w:7 [ ] main:2::utoa16w:9 [ ] main:2::utoa16w:11 [ ] main:2::utoa16w:13 [ ] main:2::utoa16w:15 [ ] ) always clobbers reg byte a reg byte y 
Statement [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (byte) utoa16n::nybble#4) [ utoa16w::dst#5 utoa16n::return#4 ] ( main:2::utoa16w:7::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
Statement [48] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y 
Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a 
Statement [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 [ utoa16w::dst#0 ] ( main:2 [ utoa16w::dst#0 ] ) always clobbers reg byte a 
Statement [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 [ utoa16w::dst#1 ] ( main:2 [ utoa16w::dst#1 ] ) always clobbers reg byte a 
Statement [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 [ utoa16w::dst#2 ] ( main:2 [ utoa16w::dst#2 ] ) always clobbers reg byte a 
Statement [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst#3 ] ( main:2 [ utoa16w::dst#3 ] ) always clobbers reg byte a 
Statement [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 [ utoa16w::dst#4 ] ( main:2 [ utoa16w::dst#4 ] ) always clobbers reg byte a 
Statement [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::$0 ] ) always clobbers reg byte a 
Statement [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::nybble#0 ] ) always clobbers reg byte a 
Statement [23] (byte~) utoa16w::$4 ← > (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#1 utoa16w::$4 ] ) always clobbers reg byte a 
Statement [29] (byte~) utoa16w::$8 ← < (word) utoa16w::value#5 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16w::$8 ] ) always clobbers reg byte a 
Statement [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$8 >> (byte) 4 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] ( main:2::utoa16w:7 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:9 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:11 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:13 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] main:2::utoa16w:15 [ utoa16w::value#5 utoa16w::dst#5 utoa16w::started#2 utoa16n::nybble#2 ] ) always clobbers reg byte a 
Statement [33] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5 [ utoa16w::dst#5 utoa16w::$12 ] ( main:2::utoa16w:7 [ utoa16w::dst#5 utoa16w::$12 ] main:2::utoa16w:9 [ utoa16w::dst#5 utoa16w::$12 ] main:2::utoa16w:11 [ utoa16w::dst#5 utoa16w::$12 ] main:2::utoa16w:13 [ utoa16w::dst#5 utoa16w::$12 ] main:2::utoa16w:15 [ utoa16w::dst#5 utoa16w::$12 ] ) always clobbers reg byte a 
Statement [36] *((byte*) utoa16w::dst#5) ← (byte) 0 [ ] ( main:2::utoa16w:7 [ ] main:2::utoa16w:9 [ ] main:2::utoa16w:11 [ ] main:2::utoa16w:13 [ ] main:2::utoa16w:15 [ ] ) always clobbers reg byte a reg byte y 
Statement [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (byte) utoa16n::nybble#4) [ utoa16w::dst#5 utoa16n::return#4 ] ( main:2::utoa16w:7::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:20 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:26 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:32 [ utoa16w::value#5 utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:7::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:9::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:11::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:13::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] main:2::utoa16w:15::utoa16n:35 [ utoa16w::dst#5 utoa16n::return#4 ] ) always clobbers reg byte a reg byte y 
Statement [48] *((byte*) cls::sc#2) ← (byte) ' ' [ cls::sc#2 ] ( main:2::cls:5 [ cls::sc#2 ] ) always clobbers reg byte a reg byte y 
Statement [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 [ cls::sc#1 ] ( main:2::cls:5 [ cls::sc#1 ] ) always clobbers reg byte a 
Potential registers zp ZP_WORD:2 [ utoa16w::value#5 ] : zp ZP_WORD:2 , 
Potential registers zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] : zp ZP_WORD:4 , 
Potential registers zp ZP_BYTE:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] : zp ZP_BYTE:7 , reg byte x , 
Potential registers zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ] : zp ZP_WORD:8 , 
Potential registers zp ZP_BYTE:10 [ utoa16w::$0 ] : zp ZP_BYTE:10 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:11 [ utoa16n::return#0 ] : zp ZP_BYTE:11 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:12 [ utoa16w::started#1 ] : zp ZP_BYTE:12 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:13 [ utoa16w::$4 ] : zp ZP_BYTE:13 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:14 [ utoa16n::return#1 ] : zp ZP_BYTE:14 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:15 [ utoa16w::started#2 ] : zp ZP_BYTE:15 , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:16 [ utoa16w::$8 ] : zp ZP_BYTE:16 , reg byte a , reg byte x , reg byte y , 
Potential registers zp ZP_BYTE:17 [ utoa16w::$12 ] : zp ZP_BYTE:17 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [utoa16w] 20.44: zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] 4: zp ZP_BYTE:10 [ utoa16w::$0 ] 4: zp ZP_BYTE:13 [ utoa16w::$4 ] 4: zp ZP_BYTE:16 [ utoa16w::$8 ] 4: zp ZP_BYTE:17 [ utoa16w::$12 ] 1.33: zp ZP_BYTE:12 [ utoa16w::started#1 ] 1.33: zp ZP_BYTE:15 [ utoa16w::started#2 ] 0.5: zp ZP_WORD:2 [ utoa16w::value#5 ] 
Uplift Scope [utoa16n] 14.4: zp ZP_BYTE:6 [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] 11.14: zp ZP_BYTE:7 [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] 4: zp ZP_BYTE:11 [ utoa16n::return#0 ] 4: zp ZP_BYTE:14 [ utoa16n::return#1 ] 
Uplift Scope [cls] 33: zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [utoa16w] best 957 combination zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ] reg byte a [ utoa16w::$0 ] reg byte a [ utoa16w::$4 ] reg byte a [ utoa16w::$8 ] reg byte a [ utoa16w::$12 ] zp ZP_BYTE:12 [ utoa16w::started#1 ] zp ZP_BYTE:15 [ utoa16w::started#2 ] zp ZP_WORD:2 [ utoa16w::value#5 ] 
Limited combination testing to 100 combinations of 2304 possible.
Uplifting [utoa16n] best 905 combination reg byte a [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ] reg byte x [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ] reg byte x [ utoa16n::return#0 ] reg byte x [ utoa16n::return#1 ] 
Limited combination testing to 100 combinations of 128 possible.
Uplifting [cls] best 905 combination zp ZP_WORD:8 [ cls::sc#2 cls::sc#1 ] 
Uplifting [main] best 905 combination 
Uplifting [] best 905 combination 
Attempting to uplift remaining variables inzp ZP_BYTE:12 [ utoa16w::started#1 ]
Uplifting [utoa16w] best 899 combination reg byte x [ utoa16w::started#1 ] 
Attempting to uplift remaining variables inzp ZP_BYTE:15 [ utoa16w::started#2 ]
Uplifting [utoa16w] best 893 combination reg byte x [ utoa16w::started#2 ] 
Allocated (was zp ZP_WORD:8) zp ZP_WORD:6 [ cls::sc#2 cls::sc#1 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Testing binary to hex conversion using pointer to pointer
  // 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 cls 
    // [46] phi from main to cls [phi:main->cls]
  cls_from_main:
    jsr cls
    jmp b1
    // main::@1
  b1:
    // [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1 
    lda #<$400
    sta utoa16w.dst
    lda #>$400
    sta utoa16w.dst+1
    // [7] call utoa16w 
    // [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
  utoa16w_from_b1:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1 
    lda #<0
    sta utoa16w.value
    lda #>0
    sta utoa16w.value+1
    jsr utoa16w
    jmp b2
    // main::@2
  b2:
    // [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28
    sta utoa16w.dst
    lda #>$400+$28
    sta utoa16w.dst+1
    // [9] call utoa16w 
    // [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
  utoa16w_from_b2:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$4d2
    sta utoa16w.value
    lda #>$4d2
    sta utoa16w.value+1
    jsr utoa16w
    jmp b3
    // main::@3
  b3:
    // [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28
    sta utoa16w.dst+1
    // [11] call utoa16w 
    // [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
  utoa16w_from_b3:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$162e
    sta utoa16w.value
    lda #>$162e
    sta utoa16w.value+1
    jsr utoa16w
    jmp b4
    // main::@4
  b4:
    // [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28+$28
    sta utoa16w.dst+1
    // [13] call utoa16w 
    // [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
  utoa16w_from_b4:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$270f
    sta utoa16w.value
    lda #>$270f
    sta utoa16w.value+1
    jsr utoa16w
    jmp b5
    // main::@5
  b5:
    // [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28+$28+$28
    sta utoa16w.dst+1
    // [15] call utoa16w 
    // [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
  utoa16w_from_b5:
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$e608
    sta utoa16w.value
    lda #>$e608
    sta utoa16w.value+1
    jsr utoa16w
    jmp breturn
    // main::@return
  breturn:
    // [16] return 
    rts
}
  // utoa16w
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zeropage(2) value, byte* zeropage(4) dst)
utoa16w: {
    .label dst = 4
    .label value = 2
    // [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 -- vbuaa=_hi_vwuz1 
    lda value+1
    // [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 -- vbuaa=vbuaa_ror_4 
    lsr
    lsr
    lsr
    lsr
    // [20] call utoa16n 
    // [38] phi from utoa16w to utoa16n [phi:utoa16w->utoa16n]
  utoa16n_from_utoa16w:
    // [38] phi (byte) utoa16n::started#7 = (byte) 0 [phi:utoa16w->utoa16n#0] -- vbuxx=vbuc1 
    ldx #0
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#0 [phi:utoa16w->utoa16n#1] -- register_copy 
    jsr utoa16n
    // [21] (byte) utoa16n::return#0 ← (byte) utoa16n::return#4
    jmp b1
    // utoa16w::@1
  b1:
    // [22] (byte) utoa16w::started#1 ← (byte) utoa16n::return#0
    // [23] (byte~) utoa16w::$4 ← > (word) utoa16w::value#5 -- vbuaa=_hi_vwuz1 
    lda value+1
    // [24] (byte) utoa16n::nybble#1 ← (byte~) utoa16w::$4 & (byte) $f -- vbuaa=vbuaa_band_vbuc1 
    and #$f
    // [25] (byte) utoa16n::started#1 ← (byte) utoa16w::started#1
    // [26] call utoa16n 
    // [38] phi from utoa16w::@1 to utoa16n [phi:utoa16w::@1->utoa16n]
  utoa16n_from_b1:
    // [38] phi (byte) utoa16n::started#7 = (byte) utoa16n::started#1 [phi:utoa16w::@1->utoa16n#0] -- register_copy 
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#1 [phi:utoa16w::@1->utoa16n#1] -- register_copy 
    jsr utoa16n
    // [27] (byte) utoa16n::return#1 ← (byte) utoa16n::return#4
    jmp b2
    // utoa16w::@2
  b2:
    // [28] (byte) utoa16w::started#2 ← (byte) utoa16n::return#1
    // [29] (byte~) utoa16w::$8 ← < (word) utoa16w::value#5 -- vbuaa=_lo_vwuz1 
    lda value
    // [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$8 >> (byte) 4 -- vbuaa=vbuaa_ror_4 
    lsr
    lsr
    lsr
    lsr
    // [31] (byte) utoa16n::started#2 ← (byte) utoa16w::started#2
    // [32] call utoa16n 
    // [38] phi from utoa16w::@2 to utoa16n [phi:utoa16w::@2->utoa16n]
  utoa16n_from_b2:
    // [38] phi (byte) utoa16n::started#7 = (byte) utoa16n::started#2 [phi:utoa16w::@2->utoa16n#0] -- register_copy 
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#2 [phi:utoa16w::@2->utoa16n#1] -- register_copy 
    jsr utoa16n
    jmp b3
    // utoa16w::@3
  b3:
    // [33] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5 -- vbuaa=_lo_vwuz1 
    lda value
    // [34] (byte) utoa16n::nybble#3 ← (byte~) utoa16w::$12 & (byte) $f -- vbuaa=vbuaa_band_vbuc1 
    and #$f
    // [35] call utoa16n 
    // [38] phi from utoa16w::@3 to utoa16n [phi:utoa16w::@3->utoa16n]
  utoa16n_from_b3:
    // [38] phi (byte) utoa16n::started#7 = (byte) 1 [phi:utoa16w::@3->utoa16n#0] -- vbuxx=vbuc1 
    ldx #1
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#3 [phi:utoa16w::@3->utoa16n#1] -- register_copy 
    jsr utoa16n
    jmp b4
    // utoa16w::@4
  b4:
    // [36] *((byte*) utoa16w::dst#5) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    ldy #0
    sta (dst),y
    jmp breturn
    // utoa16w::@return
  breturn:
    // [37] return 
    rts
}
  // utoa16n
// Hexadecimal utoa() for a single nybble
// utoa16n(byte register(A) nybble, byte register(X) started)
utoa16n: {
    // [39] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@3 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq b3_from_utoa16n
    // [41] phi from utoa16n to utoa16n::@1 [phi:utoa16n->utoa16n::@1]
  b1_from_utoa16n:
    // [41] phi (byte) utoa16n::return#4 = (byte) 1 [phi:utoa16n->utoa16n::@1#0] -- vbuxx=vbuc1 
    ldx #1
    jmp b1
    // [40] phi from utoa16n to utoa16n::@3 [phi:utoa16n->utoa16n::@3]
  b3_from_utoa16n:
    jmp b3
    // utoa16n::@3
  b3:
    // [41] phi from utoa16n::@3 to utoa16n::@1 [phi:utoa16n::@3->utoa16n::@1]
  b1_from_b3:
    // [41] phi (byte) utoa16n::return#4 = (byte) utoa16n::started#7 [phi:utoa16n::@3->utoa16n::@1#0] -- register_copy 
    jmp b1
    // utoa16n::@1
  b1:
    // [42] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return -- vbuxx_eq_0_then_la1 
    cpx #0
    beq breturn
    jmp b2
    // utoa16n::@2
  b2:
    // [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (byte) utoa16n::nybble#4) -- _deref__deref_pptc1=pbuc2_derefidx_vbuaa 
    tay
    lda DIGITS,y
    ldy #0
    sta (utoa16w.dst),y
    // [44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5) -- _deref_pptc1=_inc__deref_pptc1 
    inc utoa16w.dst
    bne !+
    inc utoa16w.dst+1
  !:
    jmp breturn
    // utoa16n::@return
  breturn:
    // [45] return 
    rts
}
  // cls
cls: {
    .label screen = $400
    .label sc = 6
    // [47] phi from cls to cls::@1 [phi:cls->cls::@1]
  b1_from_cls:
    // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 
    lda #<screen
    sta sc
    lda #>screen
    sta sc+1
    jmp b1
    // [47] phi from cls::@1 to cls::@1 [phi:cls::@1->cls::@1]
  b1_from_b1:
    // [47] phi (byte*) cls::sc#2 = (byte*) cls::sc#1 [phi:cls::@1->cls::@1#0] -- register_copy 
    jmp b1
    // cls::@1
  b1:
    // [48] *((byte*) cls::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [49] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2 -- pbuz1=_inc_pbuz1 
    inc sc
    bne !+
    inc sc+1
  !:
    // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda sc+1
    cmp #>screen+$3e7+1
    bne b1_from_b1
    lda sc
    cmp #<screen+$3e7+1
    bne b1_from_b1
    jmp breturn
    // cls::@return
  breturn:
    // [51] return 
    rts
}
  // File Data
  // Digits used for utoa()
  DIGITS: .text "0123456789abcdef@"

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b5
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp breturn
Removing instruction jmp b3
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #>0
Replacing instruction ldy #0 with TAY
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b3_from_utoa16n with b1
Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b3_from_utoa16n:
Removing instruction b3:
Removing instruction b1_from_b3:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction cls_from_main:
Removing instruction b1:
Removing instruction utoa16w_from_b1:
Removing instruction b2:
Removing instruction utoa16w_from_b2:
Removing instruction b3:
Removing instruction utoa16w_from_b3:
Removing instruction b4:
Removing instruction utoa16w_from_b4:
Removing instruction b5:
Removing instruction utoa16w_from_b5:
Removing instruction breturn:
Removing instruction utoa16n_from_utoa16w:
Removing instruction b1:
Removing instruction utoa16n_from_b1:
Removing instruction b2:
Removing instruction utoa16n_from_b2:
Removing instruction b3:
Removing instruction utoa16n_from_b3:
Removing instruction b4:
Removing instruction breturn:
Removing instruction b1_from_utoa16n:
Removing instruction b2:
Removing instruction b1_from_cls:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte[]) DIGITS
(const byte[]) DIGITS#0 DIGITS = (string) "0123456789abcdef@"
(void()) cls()
(label) cls::@1
(label) cls::@return
(byte*) cls::sc
(byte*) cls::sc#1 sc zp ZP_WORD:6 16.5
(byte*) cls::sc#2 sc zp ZP_WORD:6 16.5
(byte*) cls::screen
(const byte*) cls::screen#0 screen = (byte*) 1024
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@return
(byte*) main::screen
(byte()) utoa16n((byte) utoa16n::nybble , (word**) utoa16n::dst , (byte) utoa16n::started)
(label) utoa16n::@1
(label) utoa16n::@2
(label) utoa16n::@3
(label) utoa16n::@return
(word**) utoa16n::dst
(byte) utoa16n::nybble
(byte) utoa16n::nybble#0 reg byte a 4.0
(byte) utoa16n::nybble#1 reg byte a 2.0
(byte) utoa16n::nybble#2 reg byte a 2.0
(byte) utoa16n::nybble#3 reg byte a 4.0
(byte) utoa16n::nybble#4 reg byte a 2.4
(byte) utoa16n::return
(byte) utoa16n::return#0 reg byte x 4.0
(byte) utoa16n::return#1 reg byte x 4.0
(byte) utoa16n::return#4 reg byte x 1.1428571428571428
(byte) utoa16n::started
(byte) utoa16n::started#1 reg byte x 4.0
(byte) utoa16n::started#2 reg byte x 4.0
(byte) utoa16n::started#7 reg byte x 2.0
(void()) utoa16w((word) utoa16w::value , (byte*) utoa16w::dst)
(byte~) utoa16w::$0 reg byte a 4.0
(byte~) utoa16w::$12 reg byte a 4.0
(byte~) utoa16w::$4 reg byte a 4.0
(byte~) utoa16w::$8 reg byte a 4.0
(label) utoa16w::@1
(label) utoa16w::@2
(label) utoa16w::@3
(label) utoa16w::@4
(label) utoa16w::@return
(byte*) utoa16w::dst
(byte*) utoa16w::dst#0 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#1 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#2 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#3 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#4 dst zp ZP_WORD:4 4.0
(byte*) utoa16w::dst#5 dst zp ZP_WORD:4 0.4444444444444444
(byte) utoa16w::started
(byte) utoa16w::started#1 reg byte x 1.3333333333333333
(byte) utoa16w::started#2 reg byte x 1.3333333333333333
(word) utoa16w::value
(word) utoa16w::value#5 value zp ZP_WORD:2 0.5

zp ZP_WORD:2 [ utoa16w::value#5 ]
zp ZP_WORD:4 [ utoa16w::dst#5 utoa16w::dst#0 utoa16w::dst#1 utoa16w::dst#2 utoa16w::dst#3 utoa16w::dst#4 ]
reg byte a [ utoa16n::nybble#4 utoa16n::nybble#0 utoa16n::nybble#1 utoa16n::nybble#2 utoa16n::nybble#3 ]
reg byte x [ utoa16n::return#4 utoa16n::started#7 utoa16n::started#1 utoa16n::started#2 ]
zp ZP_WORD:6 [ cls::sc#2 cls::sc#1 ]
reg byte a [ utoa16w::$0 ]
reg byte x [ utoa16n::return#0 ]
reg byte x [ utoa16w::started#1 ]
reg byte a [ utoa16w::$4 ]
reg byte x [ utoa16n::return#1 ]
reg byte x [ utoa16w::started#2 ]
reg byte a [ utoa16w::$8 ]
reg byte a [ utoa16w::$12 ]


FINAL ASSEMBLER
Score: 741

  // File Comments
// Testing binary to hex conversion using pointer to pointer
  // 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: {
    // cls()
    // [5] call cls 
    // [46] phi from main to cls [phi:main->cls]
    jsr cls
    // main::@1
    // utoa16w(00000, screen)
    // [6] (byte*) utoa16w::dst#0 ← (byte*) 1024 -- pbuz1=pbuc1 
    lda #<$400
    sta utoa16w.dst
    lda #>$400
    sta utoa16w.dst+1
    // [7] call utoa16w 
    // [17] phi from main::@1 to utoa16w [phi:main::@1->utoa16w]
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#0 [phi:main::@1->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (byte) 0 [phi:main::@1->utoa16w#1] -- vwuz1=vbuc1 
    lda #<0
    sta utoa16w.value
    sta utoa16w.value+1
    jsr utoa16w
    // main::@2
    // utoa16w(01234, screen)
    // [8] (byte*) utoa16w::dst#1 ← (byte*) 1024+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28
    sta utoa16w.dst
    lda #>$400+$28
    sta utoa16w.dst+1
    // [9] call utoa16w 
    // [17] phi from main::@2 to utoa16w [phi:main::@2->utoa16w]
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#1 [phi:main::@2->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $4d2 [phi:main::@2->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$4d2
    sta utoa16w.value
    lda #>$4d2
    sta utoa16w.value+1
    jsr utoa16w
    // main::@3
    // utoa16w(05678, screen)
    // [10] (byte*) utoa16w::dst#2 ← (byte*) 1024+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28
    sta utoa16w.dst+1
    // [11] call utoa16w 
    // [17] phi from main::@3 to utoa16w [phi:main::@3->utoa16w]
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#2 [phi:main::@3->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $162e [phi:main::@3->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$162e
    sta utoa16w.value
    lda #>$162e
    sta utoa16w.value+1
    jsr utoa16w
    // main::@4
    // utoa16w(09999, screen)
    // [12] (byte*) utoa16w::dst#3 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28+$28
    sta utoa16w.dst+1
    // [13] call utoa16w 
    // [17] phi from main::@4 to utoa16w [phi:main::@4->utoa16w]
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#3 [phi:main::@4->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $270f [phi:main::@4->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$270f
    sta utoa16w.value
    lda #>$270f
    sta utoa16w.value+1
    jsr utoa16w
    // main::@5
    // utoa16w(58888, screen)
    // [14] (byte*) utoa16w::dst#4 ← (byte*) 1024+(byte) $28+(byte) $28+(byte) $28+(byte) $28 -- pbuz1=pbuc1 
    lda #<$400+$28+$28+$28+$28
    sta utoa16w.dst
    lda #>$400+$28+$28+$28+$28
    sta utoa16w.dst+1
    // [15] call utoa16w 
    // [17] phi from main::@5 to utoa16w [phi:main::@5->utoa16w]
    // [17] phi (byte*) utoa16w::dst#5 = (byte*) utoa16w::dst#4 [phi:main::@5->utoa16w#0] -- register_copy 
    // [17] phi (word) utoa16w::value#5 = (word) $e608 [phi:main::@5->utoa16w#1] -- vwuz1=vwuc1 
    lda #<$e608
    sta utoa16w.value
    lda #>$e608
    sta utoa16w.value+1
    jsr utoa16w
    // main::@return
    // }
    // [16] return 
    rts
}
  // utoa16w
// Hexadecimal utoa() for an unsigned int (16bits)
// utoa16w(word zeropage(2) value, byte* zeropage(4) dst)
utoa16w: {
    .label dst = 4
    .label value = 2
    // >value
    // [18] (byte~) utoa16w::$0 ← > (word) utoa16w::value#5 -- vbuaa=_hi_vwuz1 
    lda value+1
    // utoa16n((>value)>>4, &dst, started)
    // [19] (byte) utoa16n::nybble#0 ← (byte~) utoa16w::$0 >> (byte) 4 -- vbuaa=vbuaa_ror_4 
    lsr
    lsr
    lsr
    lsr
    // [20] call utoa16n 
    // [38] phi from utoa16w to utoa16n [phi:utoa16w->utoa16n]
    // [38] phi (byte) utoa16n::started#7 = (byte) 0 [phi:utoa16w->utoa16n#0] -- vbuxx=vbuc1 
    ldx #0
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#0 [phi:utoa16w->utoa16n#1] -- register_copy 
    jsr utoa16n
    // utoa16n((>value)>>4, &dst, started)
    // [21] (byte) utoa16n::return#0 ← (byte) utoa16n::return#4
    // utoa16w::@1
    // started = utoa16n((>value)>>4, &dst, started)
    // [22] (byte) utoa16w::started#1 ← (byte) utoa16n::return#0
    // >value
    // [23] (byte~) utoa16w::$4 ← > (word) utoa16w::value#5 -- vbuaa=_hi_vwuz1 
    lda value+1
    // utoa16n((>value)&0x0f, &dst, started)
    // [24] (byte) utoa16n::nybble#1 ← (byte~) utoa16w::$4 & (byte) $f -- vbuaa=vbuaa_band_vbuc1 
    and #$f
    // [25] (byte) utoa16n::started#1 ← (byte) utoa16w::started#1
    // [26] call utoa16n 
    // [38] phi from utoa16w::@1 to utoa16n [phi:utoa16w::@1->utoa16n]
    // [38] phi (byte) utoa16n::started#7 = (byte) utoa16n::started#1 [phi:utoa16w::@1->utoa16n#0] -- register_copy 
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#1 [phi:utoa16w::@1->utoa16n#1] -- register_copy 
    jsr utoa16n
    // utoa16n((>value)&0x0f, &dst, started)
    // [27] (byte) utoa16n::return#1 ← (byte) utoa16n::return#4
    // utoa16w::@2
    // started = utoa16n((>value)&0x0f, &dst, started)
    // [28] (byte) utoa16w::started#2 ← (byte) utoa16n::return#1
    // <value
    // [29] (byte~) utoa16w::$8 ← < (word) utoa16w::value#5 -- vbuaa=_lo_vwuz1 
    lda value
    // utoa16n((<value)>>4, &dst, started)
    // [30] (byte) utoa16n::nybble#2 ← (byte~) utoa16w::$8 >> (byte) 4 -- vbuaa=vbuaa_ror_4 
    lsr
    lsr
    lsr
    lsr
    // [31] (byte) utoa16n::started#2 ← (byte) utoa16w::started#2
    // [32] call utoa16n 
    // [38] phi from utoa16w::@2 to utoa16n [phi:utoa16w::@2->utoa16n]
    // [38] phi (byte) utoa16n::started#7 = (byte) utoa16n::started#2 [phi:utoa16w::@2->utoa16n#0] -- register_copy 
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#2 [phi:utoa16w::@2->utoa16n#1] -- register_copy 
    jsr utoa16n
    // utoa16w::@3
    // <value
    // [33] (byte~) utoa16w::$12 ← < (word) utoa16w::value#5 -- vbuaa=_lo_vwuz1 
    lda value
    // utoa16n((<value)&0x0f, &dst, 1)
    // [34] (byte) utoa16n::nybble#3 ← (byte~) utoa16w::$12 & (byte) $f -- vbuaa=vbuaa_band_vbuc1 
    and #$f
    // [35] call utoa16n 
    // [38] phi from utoa16w::@3 to utoa16n [phi:utoa16w::@3->utoa16n]
    // [38] phi (byte) utoa16n::started#7 = (byte) 1 [phi:utoa16w::@3->utoa16n#0] -- vbuxx=vbuc1 
    ldx #1
    // [38] phi (byte) utoa16n::nybble#4 = (byte) utoa16n::nybble#3 [phi:utoa16w::@3->utoa16n#1] -- register_copy 
    jsr utoa16n
    // utoa16w::@4
    // *dst = 0
    // [36] *((byte*) utoa16w::dst#5) ← (byte) 0 -- _deref_pbuz1=vbuc1 
    lda #0
    tay
    sta (dst),y
    // utoa16w::@return
    // }
    // [37] return 
    rts
}
  // utoa16n
// Hexadecimal utoa() for a single nybble
// utoa16n(byte register(A) nybble, byte register(X) started)
utoa16n: {
    // if(nybble!=0)
    // [39] if((byte) utoa16n::nybble#4==(byte) 0) goto utoa16n::@3 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq b1
    // [41] phi from utoa16n to utoa16n::@1 [phi:utoa16n->utoa16n::@1]
    // [41] phi (byte) utoa16n::return#4 = (byte) 1 [phi:utoa16n->utoa16n::@1#0] -- vbuxx=vbuc1 
    ldx #1
    // [40] phi from utoa16n to utoa16n::@3 [phi:utoa16n->utoa16n::@3]
    // utoa16n::@3
    // [41] phi from utoa16n::@3 to utoa16n::@1 [phi:utoa16n::@3->utoa16n::@1]
    // [41] phi (byte) utoa16n::return#4 = (byte) utoa16n::started#7 [phi:utoa16n::@3->utoa16n::@1#0] -- register_copy 
    // utoa16n::@1
  b1:
    // if(started!=0)
    // [42] if((byte) utoa16n::return#4==(byte) 0) goto utoa16n::@return -- vbuxx_eq_0_then_la1 
    cpx #0
    beq breturn
    // utoa16n::@2
    // *(*dst)++ = DIGITS[nybble]
    // [43] *(*(&(byte*) utoa16w::dst#5)) ← *((const byte[]) DIGITS#0 + (byte) utoa16n::nybble#4) -- _deref__deref_pptc1=pbuc2_derefidx_vbuaa 
    tay
    lda DIGITS,y
    ldy #0
    sta (utoa16w.dst),y
    // *(*dst)++ = DIGITS[nybble];
    // [44] *(&(byte*) utoa16w::dst#5) ← ++ *(&(byte*) utoa16w::dst#5) -- _deref_pptc1=_inc__deref_pptc1 
    inc utoa16w.dst
    bne !+
    inc utoa16w.dst+1
  !:
    // utoa16n::@return
  breturn:
    // }
    // [45] return 
    rts
}
  // cls
cls: {
    .label screen = $400
    .label sc = 6
    // [47] phi from cls to cls::@1 [phi:cls->cls::@1]
    // [47] phi (byte*) cls::sc#2 = (const byte*) cls::screen#0 [phi:cls->cls::@1#0] -- pbuz1=pbuc1 
    lda #<screen
    sta sc
    lda #>screen
    sta sc+1
    // [47] phi from cls::@1 to cls::@1 [phi:cls::@1->cls::@1]
    // [47] phi (byte*) cls::sc#2 = (byte*) cls::sc#1 [phi:cls::@1->cls::@1#0] -- register_copy 
    // cls::@1
  b1:
    // *sc=' '
    // [48] *((byte*) cls::sc#2) ← (byte) ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // for( unsigned char *sc: screen..screen+999)
    // [49] (byte*) cls::sc#1 ← ++ (byte*) cls::sc#2 -- pbuz1=_inc_pbuz1 
    inc sc
    bne !+
    inc sc+1
  !:
    // [50] if((byte*) cls::sc#1!=(const byte*) cls::screen#0+(word) $3e7+(byte) 1) goto cls::@1 -- pbuz1_neq_pbuc1_then_la1 
    lda sc+1
    cmp #>screen+$3e7+1
    bne b1
    lda sc
    cmp #<screen+$3e7+1
    bne b1
    // cls::@return
    // }
    // [51] return 
    rts
}
  // File Data
  // Digits used for utoa()
  DIGITS: .text "0123456789abcdef@"

