Inlined call vicSelectGfxBank::$0 = call toDd00(vicSelectGfxBank::gfx)
Inlined call call __init
Eliminating unused variable with no statement clock::$0

CONTROL FLOW GRAPH SSA

unsigned long clock()
clock: scope:[clock]  from main::@2
  *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES
  clock::ticks#0 = $ffffffff - *CIA2_TIMER_AB
  *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES
  clock::return#0 = clock::ticks#0
  to:clock::@return
clock::@return: scope:[clock]  from clock
  clock::return#3 = phi( clock/clock::return#0 )
  clock::return#1 = clock::return#3
  return 
  to:@return

void clock_start()
clock_start: scope:[clock_start]  from main
  *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES
  *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
  *CIA2_TIMER_AB = $ffffffff
  *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
  *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES
  to:clock_start::@return
clock_start::@return: scope:[clock_start]  from clock_start
  return 
  to:@return

void print_uint_at(unsigned int w , char *at)
print_uint_at: scope:[print_uint_at]  from print_ulong_at print_ulong_at::@1
  print_uint_at::at#2 = phi( print_ulong_at/print_uint_at::at#0, print_ulong_at::@1/print_uint_at::at#1 )
  print_uint_at::w#2 = phi( print_ulong_at/print_uint_at::w#0, print_ulong_at::@1/print_uint_at::w#1 )
  print_uint_at::$0 = byte1  print_uint_at::w#2
  print_uchar_at::b#0 = print_uint_at::$0
  print_uchar_at::at#0 = print_uint_at::at#2
  call print_uchar_at
  to:print_uint_at::@1
print_uint_at::@1: scope:[print_uint_at]  from print_uint_at
  print_uint_at::at#3 = phi( print_uint_at/print_uint_at::at#2 )
  print_uint_at::w#3 = phi( print_uint_at/print_uint_at::w#2 )
  print_uint_at::$2 = byte0  print_uint_at::w#3
  print_uint_at::$3 = print_uint_at::at#3 + 2
  print_uchar_at::b#1 = print_uint_at::$2
  print_uchar_at::at#1 = print_uint_at::$3
  call print_uchar_at
  to:print_uint_at::@2
print_uint_at::@2: scope:[print_uint_at]  from print_uint_at::@1
  to:print_uint_at::@return
print_uint_at::@return: scope:[print_uint_at]  from print_uint_at::@2
  return 
  to:@return

void print_ulong_at(unsigned long dw , char *at)
print_ulong_at: scope:[print_ulong_at]  from main::@4
  print_ulong_at::at#1 = phi( main::@4/print_ulong_at::at#0 )
  print_ulong_at::dw#1 = phi( main::@4/print_ulong_at::dw#0 )
  print_ulong_at::$0 = word1  print_ulong_at::dw#1
  print_uint_at::w#0 = print_ulong_at::$0
  print_uint_at::at#0 = print_ulong_at::at#1
  call print_uint_at
  to:print_ulong_at::@1
print_ulong_at::@1: scope:[print_ulong_at]  from print_ulong_at
  print_ulong_at::at#2 = phi( print_ulong_at/print_ulong_at::at#1 )
  print_ulong_at::dw#2 = phi( print_ulong_at/print_ulong_at::dw#1 )
  print_ulong_at::$2 = word0  print_ulong_at::dw#2
  print_ulong_at::$3 = print_ulong_at::at#2 + 4
  print_uint_at::w#1 = print_ulong_at::$2
  print_uint_at::at#1 = print_ulong_at::$3
  call print_uint_at
  to:print_ulong_at::@2
print_ulong_at::@2: scope:[print_ulong_at]  from print_ulong_at::@1
  to:print_ulong_at::@return
print_ulong_at::@return: scope:[print_ulong_at]  from print_ulong_at::@2
  return 
  to:@return

void print_uchar_at(char b , char *at)
print_uchar_at: scope:[print_uchar_at]  from print_uint_at print_uint_at::@1
  print_uchar_at::at#2 = phi( print_uint_at/print_uchar_at::at#0, print_uint_at::@1/print_uchar_at::at#1 )
  print_uchar_at::b#2 = phi( print_uint_at/print_uchar_at::b#0, print_uint_at::@1/print_uchar_at::b#1 )
  print_uchar_at::$0 = print_uchar_at::b#2 >> 4
  print_char_at::ch#0 = print_hextab[print_uchar_at::$0]
  print_char_at::at#0 = print_uchar_at::at#2
  call print_char_at
  to:print_uchar_at::@1
print_uchar_at::@1: scope:[print_uchar_at]  from print_uchar_at
  print_uchar_at::at#3 = phi( print_uchar_at/print_uchar_at::at#2 )
  print_uchar_at::b#3 = phi( print_uchar_at/print_uchar_at::b#2 )
  print_uchar_at::$2 = print_uchar_at::b#3 & $f
  print_uchar_at::$3 = print_uchar_at::at#3 + 1
  print_char_at::ch#1 = print_hextab[print_uchar_at::$2]
  print_char_at::at#1 = print_uchar_at::$3
  call print_char_at
  to:print_uchar_at::@2
print_uchar_at::@2: scope:[print_uchar_at]  from print_uchar_at::@1
  to:print_uchar_at::@return
print_uchar_at::@return: scope:[print_uchar_at]  from print_uchar_at::@2
  return 
  to:@return

void print_char_at(char ch , char *at)
print_char_at: scope:[print_char_at]  from print_uchar_at print_uchar_at::@1
  print_char_at::at#2 = phi( print_uchar_at/print_char_at::at#0, print_uchar_at::@1/print_char_at::at#1 )
  print_char_at::ch#2 = phi( print_uchar_at/print_char_at::ch#0, print_uchar_at::@1/print_char_at::ch#1 )
  *print_char_at::at#2 = print_char_at::ch#2
  to:print_char_at::@return
print_char_at::@return: scope:[print_char_at]  from print_char_at
  return 
  to:@return

void main()
main: scope:[main]  from __start::@1
  call clock_start
  to:main::@3
main::@3: scope:[main]  from main
  to:main::@1
main::@1: scope:[main]  from main::@3 main::@5
  if(true) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  call clock
  clock::return#2 = clock::return#1
  to:main::@4
main::@4: scope:[main]  from main::@2
  clock::return#4 = phi( main::@2/clock::return#2 )
  main::$1 = clock::return#4
  print_ulong_at::dw#0 = main::$1
  print_ulong_at::at#0 = SCREEN
  call print_ulong_at
  to:main::@5
main::@5: scope:[main]  from main::@4
  to:main::@1
main::@return: scope:[main]  from main::@1
  return 
  to:@return

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

SYMBOL TABLE SSA
__constant struct MOS6526_CIA * const CIA2 = (struct MOS6526_CIA *)$dd00
__constant unsigned long * const CIA2_TIMER_AB = (unsigned long *)$dd04
__constant const char CIA_TIMER_CONTROL_A_COUNT_CYCLES = 0
__constant const char CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
__constant const char CIA_TIMER_CONTROL_CONTINUOUS = 0
__constant const char CIA_TIMER_CONTROL_START = 1
__constant const char CIA_TIMER_CONTROL_STOP = 0
__constant char OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
__constant char OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
__constant char RADIX::BINARY = 2
__constant char RADIX::DECIMAL = $a
__constant char RADIX::HEXADECIMAL = $10
__constant char RADIX::OCTAL = 8
__constant char * const SCREEN = (char *)$400
void __start()
unsigned long clock()
unsigned long clock::return
unsigned long clock::return#0
unsigned long clock::return#1
unsigned long clock::return#2
unsigned long clock::return#3
unsigned long clock::return#4
unsigned long clock::ticks
unsigned long clock::ticks#0
void clock_start()
void main()
unsigned long main::$1
void print_char_at(char ch , char *at)
char *print_char_at::at
char *print_char_at::at#0
char *print_char_at::at#1
char *print_char_at::at#2
char print_char_at::ch
char print_char_at::ch#0
char print_char_at::ch#1
char print_char_at::ch#2
__constant const char print_hextab[] = "0123456789abcdef"z
void print_uchar_at(char b , char *at)
char print_uchar_at::$0
number print_uchar_at::$2
char *print_uchar_at::$3
char *print_uchar_at::at
char *print_uchar_at::at#0
char *print_uchar_at::at#1
char *print_uchar_at::at#2
char *print_uchar_at::at#3
char print_uchar_at::b
char print_uchar_at::b#0
char print_uchar_at::b#1
char print_uchar_at::b#2
char print_uchar_at::b#3
void print_uint_at(unsigned int w , char *at)
char print_uint_at::$0
char print_uint_at::$2
char *print_uint_at::$3
char *print_uint_at::at
char *print_uint_at::at#0
char *print_uint_at::at#1
char *print_uint_at::at#2
char *print_uint_at::at#3
unsigned int print_uint_at::w
unsigned int print_uint_at::w#0
unsigned int print_uint_at::w#1
unsigned int print_uint_at::w#2
unsigned int print_uint_at::w#3
void print_ulong_at(unsigned long dw , char *at)
unsigned int print_ulong_at::$0
unsigned int print_ulong_at::$2
char *print_ulong_at::$3
char *print_ulong_at::at
char *print_ulong_at::at#0
char *print_ulong_at::at#1
char *print_ulong_at::at#2
unsigned long print_ulong_at::dw
unsigned long print_ulong_at::dw#0
unsigned long print_ulong_at::dw#1
unsigned long print_ulong_at::dw#2

Adding number conversion cast (unumber) $ffffffff in clock::ticks#0 = $ffffffff - *CIA2_TIMER_AB
Adding number conversion cast (unumber) $ffffffff in *CIA2_TIMER_AB = $ffffffff
Adding number conversion cast (unumber) 2 in print_uint_at::$3 = print_uint_at::at#3 + 2
Adding number conversion cast (unumber) 4 in print_ulong_at::$3 = print_ulong_at::at#2 + 4
Adding number conversion cast (unumber) 4 in print_uchar_at::$0 = print_uchar_at::b#2 >> 4
Adding number conversion cast (unumber) $f in print_uchar_at::$2 = print_uchar_at::b#3 & $f
Adding number conversion cast (unumber) print_uchar_at::$2 in print_uchar_at::$2 = print_uchar_at::b#3 & (unumber)$f
Adding number conversion cast (unumber) 1 in print_uchar_at::$3 = print_uchar_at::at#3 + 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *CIA2_TIMER_AB = (unumber)$ffffffff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (struct MOS6526_CIA *) 56576
Simplifying constant pointer cast (unsigned long *) 56580
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast $ffffffff
Simplifying constant integer cast $ffffffff
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (unsigned long) $ffffffff
Finalized unsigned number type (unsigned long) $ffffffff
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) $f
Finalized unsigned number type (char) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to char in print_uchar_at::$2 = print_uchar_at::b#3 & $f
Alias clock::return#0 = clock::ticks#0 clock::return#3 clock::return#1 
Alias print_uchar_at::b#0 = print_uint_at::$0 
Alias print_uint_at::w#2 = print_uint_at::w#3 
Alias print_uint_at::at#2 = print_uint_at::at#3 
Alias print_uchar_at::b#1 = print_uint_at::$2 
Alias print_uchar_at::at#1 = print_uint_at::$3 
Alias print_uint_at::w#0 = print_ulong_at::$0 
Alias print_ulong_at::dw#1 = print_ulong_at::dw#2 
Alias print_ulong_at::at#1 = print_ulong_at::at#2 
Alias print_uint_at::w#1 = print_ulong_at::$2 
Alias print_uint_at::at#1 = print_ulong_at::$3 
Alias print_uchar_at::b#2 = print_uchar_at::b#3 
Alias print_uchar_at::at#2 = print_uchar_at::at#3 
Alias print_char_at::at#1 = print_uchar_at::$3 
Alias clock::return#2 = clock::return#4 
Alias print_ulong_at::dw#0 = main::$1 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values print_ulong_at::dw#1 print_ulong_at::dw#0
Identical Phi Values print_ulong_at::at#1 print_ulong_at::at#0
Successful SSA optimization Pass2IdenticalPhiElimination
Constant print_ulong_at::at#0 = SCREEN
Successful SSA optimization Pass2ConstantIdentification
Constant print_uint_at::at#0 = print_ulong_at::at#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [40] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Simplifying constant evaluating to zero CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES in [0] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying constant evaluating to zero CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES in [4] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying constant evaluating to zero CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS in [5] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_STOP|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS in [2] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying expression containing zero CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A in [5] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = 0|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [7] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS in [8] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS|CIA_TIMER_CONTROL_A_COUNT_CYCLES
Successful SSA optimization PassNSimplifyExpressionWithZero
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [2] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [8] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS
Successful SSA optimization PassNSimplifyExpressionWithZero
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Eliminating unused constant CIA_TIMER_CONTROL_STOP
Eliminating unused constant CIA_TIMER_CONTROL_CONTINUOUS
Eliminating unused constant CIA_TIMER_CONTROL_A_COUNT_CYCLES
Successful SSA optimization PassNEliminateUnusedVars
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::__init1
Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Constant right-side identified [21] print_uint_at::at#1 = print_ulong_at::at#0 + 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant print_uint_at::at#1 = print_ulong_at::at#0+4
Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings print_uint_at::at#0
Inlining constant with var siblings print_uint_at::at#1
Constant inlined print_ulong_at::at#0 = SCREEN
Constant inlined print_uint_at::at#1 = SCREEN+4
Constant inlined print_uint_at::at#0 = SCREEN
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) $a
Finalized unsigned number type (char) $10
Successful SSA optimization PassNFinalizeNumberTypeConversions
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@1
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of print_ulong_at::@2
Adding NOP phi() at start of print_uint_at::@2
Adding NOP phi() at start of print_uchar_at::@2
CALL GRAPH
Calls in [main] to clock_start:1 clock:5 print_ulong_at:8 
Calls in [print_ulong_at] to print_uint_at:22 print_uint_at:25 
Calls in [print_uint_at] to print_uchar_at:33 print_uchar_at:38 
Calls in [print_uchar_at] to print_char_at:47 print_char_at:53 

Created 6 initial phi equivalence classes
Coalesced [21] print_uint_at::w#4 = print_uint_at::w#0
Coalesced [24] print_uint_at::w#5 = print_uint_at::w#1
Coalesced [31] print_uchar_at::b#4 = print_uchar_at::b#0
Coalesced [32] print_uchar_at::at#4 = print_uchar_at::at#0
Coalesced [36] print_uchar_at::b#5 = print_uchar_at::b#1
Coalesced [37] print_uchar_at::at#5 = print_uchar_at::at#1
Coalesced [45] print_char_at::ch#3 = print_char_at::ch#0
Coalesced [46] print_char_at::at#3 = print_char_at::at#0
Coalesced [51] print_char_at::ch#4 = print_char_at::ch#1
Coalesced [52] print_char_at::at#4 = print_char_at::at#1
Coalesced down to 6 phi equivalence classes
Culled Empty Block label main::@3
Culled Empty Block label main::@1
Culled Empty Block label main::@5
Culled Empty Block label print_ulong_at::@2
Culled Empty Block label print_uint_at::@2
Culled Empty Block label print_uchar_at::@2
Renumbering block main::@2 to main::@1
Renumbering block main::@4 to main::@2
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@1

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] phi()
  [1] call clock_start
  to:main::@1
main::@1: scope:[main]  from main main::@2
  [2] phi()
  [3] call clock
  [4] clock::return#2 = clock::return#0
  to:main::@2
main::@2: scope:[main]  from main::@1
  [5] print_ulong_at::dw#0 = clock::return#2
  [6] call print_ulong_at
  to:main::@1

void clock_start()
clock_start: scope:[clock_start]  from main
  [7] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0
  [8] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
  [9] *CIA2_TIMER_AB = $ffffffff
  [10] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
  [11] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START
  to:clock_start::@return
clock_start::@return: scope:[clock_start]  from clock_start
  [12] return 
  to:@return

unsigned long clock()
clock: scope:[clock]  from main::@1
  [13] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0
  [14] clock::return#0 = $ffffffff - *CIA2_TIMER_AB
  [15] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START
  to:clock::@return
clock::@return: scope:[clock]  from clock
  [16] return 
  to:@return

void print_ulong_at(unsigned long dw , char *at)
print_ulong_at: scope:[print_ulong_at]  from main::@2
  [17] print_uint_at::w#0 = word1  print_ulong_at::dw#0
  [18] call print_uint_at
  to:print_ulong_at::@1
print_ulong_at::@1: scope:[print_ulong_at]  from print_ulong_at
  [19] print_uint_at::w#1 = word0  print_ulong_at::dw#0
  [20] call print_uint_at
  to:print_ulong_at::@return
print_ulong_at::@return: scope:[print_ulong_at]  from print_ulong_at::@1
  [21] return 
  to:@return

void print_uint_at(unsigned int w , char *at)
print_uint_at: scope:[print_uint_at]  from print_ulong_at print_ulong_at::@1
  [22] print_uint_at::at#2 = phi( print_ulong_at/SCREEN, print_ulong_at::@1/SCREEN+4 )
  [22] print_uint_at::w#2 = phi( print_ulong_at/print_uint_at::w#0, print_ulong_at::@1/print_uint_at::w#1 )
  [23] print_uchar_at::b#0 = byte1  print_uint_at::w#2
  [24] print_uchar_at::at#0 = print_uint_at::at#2
  [25] call print_uchar_at
  to:print_uint_at::@1
print_uint_at::@1: scope:[print_uint_at]  from print_uint_at
  [26] print_uchar_at::b#1 = byte0  print_uint_at::w#2
  [27] print_uchar_at::at#1 = print_uint_at::at#2 + 2
  [28] call print_uchar_at
  to:print_uint_at::@return
print_uint_at::@return: scope:[print_uint_at]  from print_uint_at::@1
  [29] return 
  to:@return

void print_uchar_at(char b , char *at)
print_uchar_at: scope:[print_uchar_at]  from print_uint_at print_uint_at::@1
  [30] print_uchar_at::at#2 = phi( print_uint_at/print_uchar_at::at#0, print_uint_at::@1/print_uchar_at::at#1 )
  [30] print_uchar_at::b#2 = phi( print_uint_at/print_uchar_at::b#0, print_uint_at::@1/print_uchar_at::b#1 )
  [31] print_uchar_at::$0 = print_uchar_at::b#2 >> 4
  [32] print_char_at::ch#0 = print_hextab[print_uchar_at::$0]
  [33] print_char_at::at#0 = print_uchar_at::at#2
  [34] call print_char_at
  to:print_uchar_at::@1
print_uchar_at::@1: scope:[print_uchar_at]  from print_uchar_at
  [35] print_uchar_at::$2 = print_uchar_at::b#2 & $f
  [36] print_char_at::at#1 = print_uchar_at::at#2 + 1
  [37] print_char_at::ch#1 = print_hextab[print_uchar_at::$2]
  [38] call print_char_at
  to:print_uchar_at::@return
print_uchar_at::@return: scope:[print_uchar_at]  from print_uchar_at::@1
  [39] return 
  to:@return

void print_char_at(char ch , char *at)
print_char_at: scope:[print_char_at]  from print_uchar_at print_uchar_at::@1
  [40] print_char_at::at#2 = phi( print_uchar_at/print_char_at::at#0, print_uchar_at::@1/print_char_at::at#1 )
  [40] print_char_at::ch#2 = phi( print_uchar_at/print_char_at::ch#0, print_uchar_at::@1/print_char_at::ch#1 )
  [41] *print_char_at::at#2 = print_char_at::ch#2
  to:print_char_at::@return
print_char_at::@return: scope:[print_char_at]  from print_char_at
  [42] return 
  to:@return


VARIABLE REGISTER WEIGHTS
unsigned long clock()
unsigned long clock::return
unsigned long clock::return#0 // 28.0
unsigned long clock::return#2 // 22.0
unsigned long clock::ticks
void clock_start()
void main()
void print_char_at(char ch , char *at)
char *print_char_at::at
char *print_char_at::at#0 // 20002.0
char *print_char_at::at#1 // 10001.0
char *print_char_at::at#2 // 120003.0
char print_char_at::ch
char print_char_at::ch#0 // 10001.0
char print_char_at::ch#1 // 20002.0
char print_char_at::ch#2 // 120003.0
void print_uchar_at(char b , char *at)
char print_uchar_at::$0 // 20002.0
char print_uchar_at::$2 // 10001.0
char *print_uchar_at::at
char *print_uchar_at::at#0 // 2002.0
char *print_uchar_at::at#1 // 2002.0
char *print_uchar_at::at#2 // 3667.333333333333
char print_uchar_at::b
char print_uchar_at::b#0 // 1001.0
char print_uchar_at::b#1 // 1001.0
char print_uchar_at::b#2 // 4400.8
void print_uint_at(unsigned int w , char *at)
char *print_uint_at::at
char *print_uint_at::at#2 // 400.4
unsigned int print_uint_at::w
unsigned int print_uint_at::w#0 // 202.0
unsigned int print_uint_at::w#1 // 202.0
unsigned int print_uint_at::w#2 // 551.0
void print_ulong_at(unsigned long dw , char *at)
char *print_ulong_at::at
unsigned long print_ulong_at::dw
unsigned long print_ulong_at::dw#0 // 71.0

Initial phi equivalence classes
[ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ]
[ print_uint_at::at#2 ]
[ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
[ print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ]
[ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
[ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
Added variable clock::return#2 to live range equivalence class [ clock::return#2 ]
Added variable print_ulong_at::dw#0 to live range equivalence class [ print_ulong_at::dw#0 ]
Added variable clock::return#0 to live range equivalence class [ clock::return#0 ]
Added variable print_uchar_at::$0 to live range equivalence class [ print_uchar_at::$0 ]
Added variable print_uchar_at::$2 to live range equivalence class [ print_uchar_at::$2 ]
Complete equivalence classes
[ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ]
[ print_uint_at::at#2 ]
[ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
[ print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ]
[ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
[ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
[ clock::return#2 ]
[ print_ulong_at::dw#0 ]
[ clock::return#0 ]
[ print_uchar_at::$0 ]
[ print_uchar_at::$2 ]
Allocated zp[1]:2 [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
Allocated zp[2]:3 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
Allocated zp[1]:5 [ print_uchar_at::$0 ]
Allocated zp[1]:6 [ print_uchar_at::$2 ]
Allocated zp[2]:7 [ print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ]
Allocated zp[1]:9 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
Allocated zp[2]:10 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ]
Allocated zp[2]:12 [ print_uint_at::at#2 ]
Allocated zp[4]:14 [ print_ulong_at::dw#0 ]
Allocated zp[4]:18 [ clock::return#0 ]
Allocated zp[4]:22 [ clock::return#2 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] clock::return#2 = clock::return#0 [ clock::return#2 ] (  [ clock::return#2 ] { { clock::return#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [5] print_ulong_at::dw#0 = clock::return#2 [ print_ulong_at::dw#0 ] (  [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [7] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0 [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [8] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [9] *CIA2_TIMER_AB = $ffffffff [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [10] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [11] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [13] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0 [ ] ( clock:3 [ ] { { clock::return#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [14] clock::return#0 = $ffffffff - *CIA2_TIMER_AB [ clock::return#0 ] ( clock:3 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [15] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START [ clock::return#0 ] ( clock:3 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [17] print_uint_at::w#0 = word1  print_ulong_at::dw#0 [ print_ulong_at::dw#0 print_uint_at::w#0 ] ( print_ulong_at:6 [ print_ulong_at::dw#0 print_uint_at::w#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } }  ) always clobbers reg byte a 
Statement [19] print_uint_at::w#1 = word0  print_ulong_at::dw#0 [ print_uint_at::w#1 ] ( print_ulong_at:6 [ print_uint_at::w#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } }  ) always clobbers reg byte a 
Statement [24] print_uchar_at::at#0 = print_uint_at::at#2 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] ( print_ulong_at:6::print_uint_at:18 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:20 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:9 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
Statement [27] print_uchar_at::at#1 = print_uint_at::at#2 + 2 [ print_uchar_at::b#1 print_uchar_at::at#1 ] ( print_ulong_at:6::print_uint_at:18 [ print_ulong_at::dw#0 print_uchar_at::b#1 print_uchar_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } }  print_ulong_at:6::print_uint_at:20 [ print_uchar_at::b#1 print_uchar_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } }  ) always clobbers reg byte a 
Statement [31] print_uchar_at::$0 = print_uchar_at::b#2 >> 4 [ print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28 [ print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  ) always clobbers reg byte a 
Statement [33] print_char_at::at#0 = print_uchar_at::at#2 [ print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28 [ print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:2 [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
Statement [35] print_uchar_at::$2 = print_uchar_at::b#2 & $f [ print_uchar_at::at#2 print_uchar_at::$2 ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::at#2 print_uchar_at::$2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::at#2 print_uchar_at::$2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28 [ print_ulong_at::dw#0 print_uchar_at::at#2 print_uchar_at::$2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28 [ print_uchar_at::at#2 print_uchar_at::$2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  ) always clobbers reg byte a 
Statement [36] print_char_at::at#1 = print_uchar_at::at#2 + 1 [ print_uchar_at::$2 print_char_at::at#1 ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28 [ print_ulong_at::dw#0 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28 [ print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:6 [ print_uchar_at::$2 ]
Statement [41] *print_char_at::at#2 = print_char_at::ch#2 [ ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25::print_char_at:34 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25::print_char_at:34 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28::print_char_at:34 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28::print_char_at:34 [ print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:25::print_char_at:38 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25::print_char_at:38 [ print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28::print_char_at:38 [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28::print_char_at:38 [ ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  ) always clobbers reg byte a reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:9 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
Statement [4] clock::return#2 = clock::return#0 [ clock::return#2 ] (  [ clock::return#2 ] { { clock::return#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [5] print_ulong_at::dw#0 = clock::return#2 [ print_ulong_at::dw#0 ] (  [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [7] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0 [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [8] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [9] *CIA2_TIMER_AB = $ffffffff [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [10] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [11] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START [ ] ( clock_start:1 [ ] { }  ) always clobbers reg byte a 
Statement [13] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0 [ ] ( clock:3 [ ] { { clock::return#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [14] clock::return#0 = $ffffffff - *CIA2_TIMER_AB [ clock::return#0 ] ( clock:3 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [15] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START [ clock::return#0 ] ( clock:3 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } }  ) always clobbers reg byte a 
Statement [17] print_uint_at::w#0 = word1  print_ulong_at::dw#0 [ print_ulong_at::dw#0 print_uint_at::w#0 ] ( print_ulong_at:6 [ print_ulong_at::dw#0 print_uint_at::w#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } }  ) always clobbers reg byte a 
Statement [19] print_uint_at::w#1 = word0  print_ulong_at::dw#0 [ print_uint_at::w#1 ] ( print_ulong_at:6 [ print_uint_at::w#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } }  ) always clobbers reg byte a 
Statement [24] print_uchar_at::at#0 = print_uint_at::at#2 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] ( print_ulong_at:6::print_uint_at:18 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:20 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } }  ) always clobbers reg byte a 
Statement [27] print_uchar_at::at#1 = print_uint_at::at#2 + 2 [ print_uchar_at::b#1 print_uchar_at::at#1 ] ( print_ulong_at:6::print_uint_at:18 [ print_ulong_at::dw#0 print_uchar_at::b#1 print_uchar_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } }  print_ulong_at:6::print_uint_at:20 [ print_uchar_at::b#1 print_uchar_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } }  ) always clobbers reg byte a 
Statement [31] print_uchar_at::$0 = print_uchar_at::b#2 >> 4 [ print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28 [ print_uchar_at::b#2 print_uchar_at::at#2 print_uchar_at::$0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  ) always clobbers reg byte a 
Statement [33] print_char_at::at#0 = print_uchar_at::at#2 [ print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28 [ print_uchar_at::b#2 print_uchar_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  ) always clobbers reg byte a 
Statement [35] print_uchar_at::$2 = print_uchar_at::b#2 & $f [ print_uchar_at::at#2 print_uchar_at::$2 ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::at#2 print_uchar_at::$2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::at#2 print_uchar_at::$2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28 [ print_ulong_at::dw#0 print_uchar_at::at#2 print_uchar_at::$2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28 [ print_uchar_at::at#2 print_uchar_at::$2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  ) always clobbers reg byte a 
Statement [36] print_char_at::at#1 = print_uchar_at::at#2 + 1 [ print_uchar_at::$2 print_char_at::at#1 ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28 [ print_ulong_at::dw#0 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28 [ print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  ) always clobbers reg byte a 
Statement [41] *print_char_at::at#2 = print_char_at::ch#2 [ ] ( print_ulong_at:6::print_uint_at:18::print_uchar_at:25::print_char_at:34 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25::print_char_at:34 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28::print_char_at:34 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28::print_char_at:34 [ print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:25::print_char_at:38 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:25::print_char_at:38 [ print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:18::print_uchar_at:28::print_char_at:38 [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  print_ulong_at:6::print_uint_at:20::print_uchar_at:28::print_char_at:38 [ ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } }  ) always clobbers reg byte a reg byte y 
Potential registers zp[2]:10 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ] : zp[2]:10 , 
Potential registers zp[2]:12 [ print_uint_at::at#2 ] : zp[2]:12 , 
Potential registers zp[1]:9 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ] : zp[1]:9 , reg byte x , 
Potential registers zp[2]:7 [ print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ] : zp[2]:7 , 
Potential registers zp[1]:2 [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] : zp[1]:2 , reg byte x , reg byte y , 
Potential registers zp[2]:3 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] : zp[2]:3 , 
Potential registers zp[4]:22 [ clock::return#2 ] : zp[4]:22 , 
Potential registers zp[4]:14 [ print_ulong_at::dw#0 ] : zp[4]:14 , 
Potential registers zp[4]:18 [ clock::return#0 ] : zp[4]:18 , 
Potential registers zp[1]:5 [ print_uchar_at::$0 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:6 [ print_uchar_at::$2 ] : zp[1]:6 , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [print_char_at] 150,006: zp[1]:2 [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] 150,006: zp[2]:3 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] 
Uplift Scope [print_uchar_at] 20,002: zp[1]:5 [ print_uchar_at::$0 ] 10,001: zp[1]:6 [ print_uchar_at::$2 ] 7,671.33: zp[2]:7 [ print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ] 6,402.8: zp[1]:9 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ] 
Uplift Scope [print_uint_at] 955: zp[2]:10 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ] 400.4: zp[2]:12 [ print_uint_at::at#2 ] 
Uplift Scope [print_ulong_at] 71: zp[4]:14 [ print_ulong_at::dw#0 ] 
Uplift Scope [clock] 28: zp[4]:18 [ clock::return#0 ] 22: zp[4]:22 [ clock::return#2 ] 
Uplift Scope [MOS6526_CIA] 
Uplift Scope [MOS6569_VICII] 
Uplift Scope [MOS6581_SID] 
Uplift Scope [clock_start] 
Uplift Scope [RADIX] 
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [print_char_at] best 1055 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp[2]:3 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] 
Uplifting [print_uchar_at] best 1047 combination reg byte a [ print_uchar_at::$0 ] reg byte y [ print_uchar_at::$2 ] zp[2]:7 [ print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ] zp[1]:9 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ] 
Uplifting [print_uint_at] best 1047 combination zp[2]:10 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ] zp[2]:12 [ print_uint_at::at#2 ] 
Uplifting [print_ulong_at] best 1047 combination zp[4]:14 [ print_ulong_at::dw#0 ] 
Uplifting [clock] best 1047 combination zp[4]:18 [ clock::return#0 ] zp[4]:22 [ clock::return#2 ] 
Uplifting [MOS6526_CIA] best 1047 combination 
Uplifting [MOS6569_VICII] best 1047 combination 
Uplifting [MOS6581_SID] best 1047 combination 
Uplifting [clock_start] best 1047 combination 
Uplifting [RADIX] best 1047 combination 
Uplifting [main] best 1047 combination 
Uplifting [] best 1047 combination 
Attempting to uplift remaining variables inzp[1]:9 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
Uplifting [print_uchar_at] best 1047 combination zp[1]:9 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ] 
Coalescing zero page register [ zp[2]:12 [ print_uint_at::at#2 ] ] with [ zp[2]:7 [ print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ] ] - score: 2
Coalescing zero page register [ zp[4]:22 [ clock::return#2 ] ] with [ zp[4]:14 [ print_ulong_at::dw#0 ] ] - score: 1
Coalescing zero page register [ zp[4]:22 [ clock::return#2 print_ulong_at::dw#0 ] ] with [ zp[4]:18 [ clock::return#0 ] ] - score: 1
Allocated (was zp[2]:3) zp[2]:2 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
Allocated (was zp[2]:12) zp[2]:4 [ print_uint_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ]
Allocated (was zp[1]:9) zp[1]:6 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
Allocated (was zp[2]:10) zp[2]:7 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ]
Allocated (was zp[4]:22) zp[4]:9 [ clock::return#2 print_ulong_at::dw#0 clock::return#0 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Setup and run a simple CIA-timer
  // Upstart
  // Commodore 64 PRG executable file
.file [name="cia-timer-simple.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  /// Timer Control - Start/stop timer (0:stop, 1: start)
  .const CIA_TIMER_CONTROL_START = 1
  /// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
  .const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
  .const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
  .const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
  /// The CIA#2: Serial bus, RS-232, VIC memory bank
  .label CIA2 = $dd00
  /// CIA#2 timer A&B as one single 32-bit value
  .label CIA2_TIMER_AB = $dd04
  .label SCREEN = $400
.segment Code
  // main
main: {
    // [1] call clock_start
    // Reset & start the CIA#2 timer A+B
    jsr clock_start
    // [2] phi from main main::@2 to main::@1 [phi:main/main::@2->main::@1]
  __b1_from_main:
  __b1_from___b2:
    jmp __b1
    // main::@1
  __b1:
    // [3] call clock
    jsr clock
    // [4] clock::return#2 = clock::return#0
    jmp __b2
    // main::@2
  __b2:
    // [5] print_ulong_at::dw#0 = clock::return#2
    // [6] call print_ulong_at
    jsr print_ulong_at
    jmp __b1_from___b2
}
  // clock_start
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
    // [7] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0 -- _deref_pbuc1=vbuc2 
    // Setup CIA#2 timer A to count (down) CPU cycles
    lda #0
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
    // [8] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2 
    lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
    // [9] *CIA2_TIMER_AB = $ffffffff -- _deref_pduc1=vduc2 
    lda #<$ffffffff
    sta CIA2_TIMER_AB
    lda #>$ffffffff
    sta CIA2_TIMER_AB+1
    lda #<$ffffffff>>$10
    sta CIA2_TIMER_AB+2
    lda #>$ffffffff>>$10
    sta CIA2_TIMER_AB+3
    // [10] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2 
    lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
    // [11] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2 
    lda #CIA_TIMER_CONTROL_START
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
    jmp __breturn
    // clock_start::@return
  __breturn:
    // [12] return 
    rts
}
  // clock
// Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
// This uses CIA #2 Timer A+B on the C64, and must be initialized using clock_start()
clock: {
    .label return = 9
    // [13] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0 -- _deref_pbuc1=vbuc2 
    // Stop the timer
    lda #0
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
    // [14] clock::return#0 = $ffffffff - *CIA2_TIMER_AB -- vduz1=vduc1_minus__deref_pduc2 
    lda #<$ffffffff
    sec
    sbc CIA2_TIMER_AB
    sta.z return
    lda #>$ffffffff
    sbc CIA2_TIMER_AB+1
    sta.z return+1
    lda #<$ffffffff>>$10
    sbc CIA2_TIMER_AB+2
    sta.z return+2
    lda #>$ffffffff>>$10
    sbc CIA2_TIMER_AB+3
    sta.z return+3
    // [15] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2 
    // Start the timer
    lda #CIA_TIMER_CONTROL_START
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
    jmp __breturn
    // clock::@return
  __breturn:
    // [16] return 
    rts
}
  // print_ulong_at
// Print a unsigned long as HEX at a specific position
// void print_ulong_at(__zp(9) unsigned long dw, char *at)
print_ulong_at: {
    .label dw = 9
    // [17] print_uint_at::w#0 = word1  print_ulong_at::dw#0 -- vwuz1=_word1_vduz2 
    lda.z dw+2
    sta.z print_uint_at.w
    lda.z dw+3
    sta.z print_uint_at.w+1
    // [18] call print_uint_at
    // [22] phi from print_ulong_at to print_uint_at [phi:print_ulong_at->print_uint_at]
  print_uint_at_from_print_ulong_at:
    // [22] phi print_uint_at::at#2 = SCREEN [phi:print_ulong_at->print_uint_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z print_uint_at.at
    lda #>SCREEN
    sta.z print_uint_at.at+1
    // [22] phi print_uint_at::w#2 = print_uint_at::w#0 [phi:print_ulong_at->print_uint_at#1] -- register_copy 
    jsr print_uint_at
    jmp __b1
    // print_ulong_at::@1
  __b1:
    // [19] print_uint_at::w#1 = word0  print_ulong_at::dw#0 -- vwuz1=_word0_vduz2 
    lda.z dw
    sta.z print_uint_at.w
    lda.z dw+1
    sta.z print_uint_at.w+1
    // [20] call print_uint_at
    // [22] phi from print_ulong_at::@1 to print_uint_at [phi:print_ulong_at::@1->print_uint_at]
  print_uint_at_from___b1:
    // [22] phi print_uint_at::at#2 = SCREEN+4 [phi:print_ulong_at::@1->print_uint_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+4
    sta.z print_uint_at.at
    lda #>SCREEN+4
    sta.z print_uint_at.at+1
    // [22] phi print_uint_at::w#2 = print_uint_at::w#1 [phi:print_ulong_at::@1->print_uint_at#1] -- register_copy 
    jsr print_uint_at
    jmp __breturn
    // print_ulong_at::@return
  __breturn:
    // [21] return 
    rts
}
  // print_uint_at
// Print a unsigned int as HEX at a specific position
// void print_uint_at(__zp(7) unsigned int w, __zp(4) char *at)
print_uint_at: {
    .label w = 7
    .label at = 4
    // [23] print_uchar_at::b#0 = byte1  print_uint_at::w#2 -- vbuz1=_byte1_vwuz2 
    lda.z w+1
    sta.z print_uchar_at.b
    // [24] print_uchar_at::at#0 = print_uint_at::at#2
    // [25] call print_uchar_at
    // [30] phi from print_uint_at to print_uchar_at [phi:print_uint_at->print_uchar_at]
  print_uchar_at_from_print_uint_at:
    // [30] phi print_uchar_at::at#2 = print_uchar_at::at#0 [phi:print_uint_at->print_uchar_at#0] -- register_copy 
    // [30] phi print_uchar_at::b#2 = print_uchar_at::b#0 [phi:print_uint_at->print_uchar_at#1] -- register_copy 
    jsr print_uchar_at
    jmp __b1
    // print_uint_at::@1
  __b1:
    // [26] print_uchar_at::b#1 = byte0  print_uint_at::w#2 -- vbuz1=_byte0_vwuz2 
    lda.z w
    sta.z print_uchar_at.b
    // [27] print_uchar_at::at#1 = print_uint_at::at#2 + 2 -- pbuz1=pbuz1_plus_vbuc1 
    lda #2
    clc
    adc.z print_uchar_at.at
    sta.z print_uchar_at.at
    bcc !+
    inc.z print_uchar_at.at+1
  !:
    // [28] call print_uchar_at
    // [30] phi from print_uint_at::@1 to print_uchar_at [phi:print_uint_at::@1->print_uchar_at]
  print_uchar_at_from___b1:
    // [30] phi print_uchar_at::at#2 = print_uchar_at::at#1 [phi:print_uint_at::@1->print_uchar_at#0] -- register_copy 
    // [30] phi print_uchar_at::b#2 = print_uchar_at::b#1 [phi:print_uint_at::@1->print_uchar_at#1] -- register_copy 
    jsr print_uchar_at
    jmp __breturn
    // print_uint_at::@return
  __breturn:
    // [29] return 
    rts
}
  // print_uchar_at
// Print a char as HEX at a specific position
// void print_uchar_at(__zp(6) char b, __zp(4) char *at)
print_uchar_at: {
    .label b = 6
    .label at = 4
    // [31] print_uchar_at::$0 = print_uchar_at::b#2 >> 4 -- vbuaa=vbuz1_ror_4 
    lda.z b
    lsr
    lsr
    lsr
    lsr
    // [32] print_char_at::ch#0 = print_hextab[print_uchar_at::$0] -- vbuxx=pbuc1_derefidx_vbuaa 
    tay
    ldx print_hextab,y
    // [33] print_char_at::at#0 = print_uchar_at::at#2 -- pbuz1=pbuz2 
    lda.z at
    sta.z print_char_at.at
    lda.z at+1
    sta.z print_char_at.at+1
    // [34] call print_char_at
  // Table of hexadecimal digits
    // [40] phi from print_uchar_at to print_char_at [phi:print_uchar_at->print_char_at]
  print_char_at_from_print_uchar_at:
    // [40] phi print_char_at::at#2 = print_char_at::at#0 [phi:print_uchar_at->print_char_at#0] -- register_copy 
    // [40] phi print_char_at::ch#2 = print_char_at::ch#0 [phi:print_uchar_at->print_char_at#1] -- register_copy 
    jsr print_char_at
    jmp __b1
    // print_uchar_at::@1
  __b1:
    // [35] print_uchar_at::$2 = print_uchar_at::b#2 & $f -- vbuyy=vbuz1_band_vbuc1 
    lda #$f
    and.z b
    tay
    // [36] print_char_at::at#1 = print_uchar_at::at#2 + 1 -- pbuz1=pbuz2_plus_1 
    clc
    lda.z at
    adc #1
    sta.z print_char_at.at
    lda.z at+1
    adc #0
    sta.z print_char_at.at+1
    // [37] print_char_at::ch#1 = print_hextab[print_uchar_at::$2] -- vbuxx=pbuc1_derefidx_vbuyy 
    ldx print_hextab,y
    // [38] call print_char_at
    // [40] phi from print_uchar_at::@1 to print_char_at [phi:print_uchar_at::@1->print_char_at]
  print_char_at_from___b1:
    // [40] phi print_char_at::at#2 = print_char_at::at#1 [phi:print_uchar_at::@1->print_char_at#0] -- register_copy 
    // [40] phi print_char_at::ch#2 = print_char_at::ch#1 [phi:print_uchar_at::@1->print_char_at#1] -- register_copy 
    jsr print_char_at
    jmp __breturn
    // print_uchar_at::@return
  __breturn:
    // [39] return 
    rts
}
  // print_char_at
// Print a single char
// void print_char_at(__register(X) char ch, __zp(2) char *at)
print_char_at: {
    .label at = 2
    // [41] *print_char_at::at#2 = print_char_at::ch#2 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (at),y
    jmp __breturn
    // print_char_at::@return
  __breturn:
    // [42] return 
    rts
}
  // File Data
.segment Data
  print_hextab: .text "0123456789abcdef"

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
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
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __b1_from___b2 with __b1
Removing instruction __b1_from_main:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction print_uint_at_from_print_ulong_at:
Removing instruction __b1:
Removing instruction print_uint_at_from___b1:
Removing instruction __breturn:
Removing instruction print_uchar_at_from_print_uint_at:
Removing instruction __b1:
Removing instruction print_uchar_at_from___b1:
Removing instruction __breturn:
Removing instruction print_char_at_from_print_uchar_at:
Removing instruction __b1:
Removing instruction print_char_at_from___b1:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
__constant struct MOS6526_CIA * const CIA2 = (struct MOS6526_CIA *) 56576
__constant unsigned long * const CIA2_TIMER_AB = (unsigned long *) 56580
__constant const char CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
__constant const char CIA_TIMER_CONTROL_START = 1
__constant char OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
__constant char OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
__constant char RADIX::BINARY = 2
__constant char RADIX::DECIMAL = $a
__constant char RADIX::HEXADECIMAL = $10
__constant char RADIX::OCTAL = 8
__constant char * const SCREEN = (char *) 1024
unsigned long clock()
unsigned long clock::return
unsigned long clock::return#0 // return zp[4]:9 28.0
unsigned long clock::return#2 // return zp[4]:9 22.0
unsigned long clock::ticks
void clock_start()
void main()
void print_char_at(char ch , char *at)
char *print_char_at::at
char *print_char_at::at#0 // at zp[2]:2 20002.0
char *print_char_at::at#1 // at zp[2]:2 10001.0
char *print_char_at::at#2 // at zp[2]:2 120003.0
char print_char_at::ch
char print_char_at::ch#0 // reg byte x 10001.0
char print_char_at::ch#1 // reg byte x 20002.0
char print_char_at::ch#2 // reg byte x 120003.0
__constant const char print_hextab[] = "0123456789abcdef"z
void print_uchar_at(char b , char *at)
char print_uchar_at::$0 // reg byte a 20002.0
char print_uchar_at::$2 // reg byte y 10001.0
char *print_uchar_at::at
char *print_uchar_at::at#0 // at zp[2]:4 2002.0
char *print_uchar_at::at#1 // at zp[2]:4 2002.0
char *print_uchar_at::at#2 // at zp[2]:4 3667.333333333333
char print_uchar_at::b
char print_uchar_at::b#0 // b zp[1]:6 1001.0
char print_uchar_at::b#1 // b zp[1]:6 1001.0
char print_uchar_at::b#2 // b zp[1]:6 4400.8
void print_uint_at(unsigned int w , char *at)
char *print_uint_at::at
char *print_uint_at::at#2 // at zp[2]:4 400.4
unsigned int print_uint_at::w
unsigned int print_uint_at::w#0 // w zp[2]:7 202.0
unsigned int print_uint_at::w#1 // w zp[2]:7 202.0
unsigned int print_uint_at::w#2 // w zp[2]:7 551.0
void print_ulong_at(unsigned long dw , char *at)
char *print_ulong_at::at
unsigned long print_ulong_at::dw
unsigned long print_ulong_at::dw#0 // dw zp[4]:9 71.0

zp[2]:7 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ]
zp[2]:4 [ print_uint_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ]
zp[1]:6 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
zp[2]:2 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
zp[4]:9 [ clock::return#2 print_ulong_at::dw#0 clock::return#0 ]
reg byte a [ print_uchar_at::$0 ]
reg byte y [ print_uchar_at::$2 ]


FINAL ASSEMBLER
Score: 467

  // File Comments
// Setup and run a simple CIA-timer
  // Upstart
  // Commodore 64 PRG executable file
.file [name="cia-timer-simple.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
  /// Timer Control - Start/stop timer (0:stop, 1: start)
  .const CIA_TIMER_CONTROL_START = 1
  /// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
  .const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
  .const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
  .const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
  /// The CIA#2: Serial bus, RS-232, VIC memory bank
  .label CIA2 = $dd00
  /// CIA#2 timer A&B as one single 32-bit value
  .label CIA2_TIMER_AB = $dd04
  .label SCREEN = $400
.segment Code
  // main
main: {
    // clock_start()
    // [1] call clock_start
    // Reset & start the CIA#2 timer A+B
    jsr clock_start
    // [2] phi from main main::@2 to main::@1 [phi:main/main::@2->main::@1]
    // main::@1
  __b1:
    // clock()
    // [3] call clock
    jsr clock
    // [4] clock::return#2 = clock::return#0
    // main::@2
    // print_ulong_at(clock(), SCREEN)
    // [5] print_ulong_at::dw#0 = clock::return#2
    // [6] call print_ulong_at
    jsr print_ulong_at
    jmp __b1
}
  // clock_start
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
    // CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
    // [7] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0 -- _deref_pbuc1=vbuc2 
    // Setup CIA#2 timer A to count (down) CPU cycles
    lda #0
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
    // CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
    // [8] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2 
    lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
    // *CIA2_TIMER_AB = 0xffffffff
    // [9] *CIA2_TIMER_AB = $ffffffff -- _deref_pduc1=vduc2 
    lda #<$ffffffff
    sta CIA2_TIMER_AB
    lda #>$ffffffff
    sta CIA2_TIMER_AB+1
    lda #<$ffffffff>>$10
    sta CIA2_TIMER_AB+2
    lda #>$ffffffff>>$10
    sta CIA2_TIMER_AB+3
    // CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
    // [10] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) = CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2 
    lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
    // CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
    // [11] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2 
    lda #CIA_TIMER_CONTROL_START
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
    // clock_start::@return
    // }
    // [12] return 
    rts
}
  // clock
// Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
// This uses CIA #2 Timer A+B on the C64, and must be initialized using clock_start()
clock: {
    .label return = 9
    // CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
    // [13] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = 0 -- _deref_pbuc1=vbuc2 
    // Stop the timer
    lda #0
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
    // clock_t ticks = 0xffffffff - *CIA2_TIMER_AB
    // [14] clock::return#0 = $ffffffff - *CIA2_TIMER_AB -- vduz1=vduc1_minus__deref_pduc2 
    lda #<$ffffffff
    sec
    sbc CIA2_TIMER_AB
    sta.z return
    lda #>$ffffffff
    sbc CIA2_TIMER_AB+1
    sta.z return+1
    lda #<$ffffffff>>$10
    sbc CIA2_TIMER_AB+2
    sta.z return+2
    lda #>$ffffffff>>$10
    sbc CIA2_TIMER_AB+3
    sta.z return+3
    // CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
    // [15] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) = CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2 
    // Start the timer
    lda #CIA_TIMER_CONTROL_START
    sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
    // clock::@return
    // }
    // [16] return 
    rts
}
  // print_ulong_at
// Print a unsigned long as HEX at a specific position
// void print_ulong_at(__zp(9) unsigned long dw, char *at)
print_ulong_at: {
    .label dw = 9
    // print_uint_at(WORD1(dw), at)
    // [17] print_uint_at::w#0 = word1  print_ulong_at::dw#0 -- vwuz1=_word1_vduz2 
    lda.z dw+2
    sta.z print_uint_at.w
    lda.z dw+3
    sta.z print_uint_at.w+1
    // [18] call print_uint_at
    // [22] phi from print_ulong_at to print_uint_at [phi:print_ulong_at->print_uint_at]
    // [22] phi print_uint_at::at#2 = SCREEN [phi:print_ulong_at->print_uint_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z print_uint_at.at
    lda #>SCREEN
    sta.z print_uint_at.at+1
    // [22] phi print_uint_at::w#2 = print_uint_at::w#0 [phi:print_ulong_at->print_uint_at#1] -- register_copy 
    jsr print_uint_at
    // print_ulong_at::@1
    // print_uint_at(WORD0(dw), at+4)
    // [19] print_uint_at::w#1 = word0  print_ulong_at::dw#0 -- vwuz1=_word0_vduz2 
    lda.z dw
    sta.z print_uint_at.w
    lda.z dw+1
    sta.z print_uint_at.w+1
    // [20] call print_uint_at
    // [22] phi from print_ulong_at::@1 to print_uint_at [phi:print_ulong_at::@1->print_uint_at]
    // [22] phi print_uint_at::at#2 = SCREEN+4 [phi:print_ulong_at::@1->print_uint_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+4
    sta.z print_uint_at.at
    lda #>SCREEN+4
    sta.z print_uint_at.at+1
    // [22] phi print_uint_at::w#2 = print_uint_at::w#1 [phi:print_ulong_at::@1->print_uint_at#1] -- register_copy 
    jsr print_uint_at
    // print_ulong_at::@return
    // }
    // [21] return 
    rts
}
  // print_uint_at
// Print a unsigned int as HEX at a specific position
// void print_uint_at(__zp(7) unsigned int w, __zp(4) char *at)
print_uint_at: {
    .label w = 7
    .label at = 4
    // print_uchar_at(BYTE1(w), at)
    // [23] print_uchar_at::b#0 = byte1  print_uint_at::w#2 -- vbuz1=_byte1_vwuz2 
    lda.z w+1
    sta.z print_uchar_at.b
    // [24] print_uchar_at::at#0 = print_uint_at::at#2
    // [25] call print_uchar_at
    // [30] phi from print_uint_at to print_uchar_at [phi:print_uint_at->print_uchar_at]
    // [30] phi print_uchar_at::at#2 = print_uchar_at::at#0 [phi:print_uint_at->print_uchar_at#0] -- register_copy 
    // [30] phi print_uchar_at::b#2 = print_uchar_at::b#0 [phi:print_uint_at->print_uchar_at#1] -- register_copy 
    jsr print_uchar_at
    // print_uint_at::@1
    // print_uchar_at(BYTE0(w), at+2)
    // [26] print_uchar_at::b#1 = byte0  print_uint_at::w#2 -- vbuz1=_byte0_vwuz2 
    lda.z w
    sta.z print_uchar_at.b
    // [27] print_uchar_at::at#1 = print_uint_at::at#2 + 2 -- pbuz1=pbuz1_plus_vbuc1 
    lda #2
    clc
    adc.z print_uchar_at.at
    sta.z print_uchar_at.at
    bcc !+
    inc.z print_uchar_at.at+1
  !:
    // [28] call print_uchar_at
    // [30] phi from print_uint_at::@1 to print_uchar_at [phi:print_uint_at::@1->print_uchar_at]
    // [30] phi print_uchar_at::at#2 = print_uchar_at::at#1 [phi:print_uint_at::@1->print_uchar_at#0] -- register_copy 
    // [30] phi print_uchar_at::b#2 = print_uchar_at::b#1 [phi:print_uint_at::@1->print_uchar_at#1] -- register_copy 
    jsr print_uchar_at
    // print_uint_at::@return
    // }
    // [29] return 
    rts
}
  // print_uchar_at
// Print a char as HEX at a specific position
// void print_uchar_at(__zp(6) char b, __zp(4) char *at)
print_uchar_at: {
    .label b = 6
    .label at = 4
    // b>>4
    // [31] print_uchar_at::$0 = print_uchar_at::b#2 >> 4 -- vbuaa=vbuz1_ror_4 
    lda.z b
    lsr
    lsr
    lsr
    lsr
    // print_char_at(print_hextab[b>>4], at)
    // [32] print_char_at::ch#0 = print_hextab[print_uchar_at::$0] -- vbuxx=pbuc1_derefidx_vbuaa 
    tay
    ldx print_hextab,y
    // [33] print_char_at::at#0 = print_uchar_at::at#2 -- pbuz1=pbuz2 
    lda.z at
    sta.z print_char_at.at
    lda.z at+1
    sta.z print_char_at.at+1
    // [34] call print_char_at
  // Table of hexadecimal digits
    // [40] phi from print_uchar_at to print_char_at [phi:print_uchar_at->print_char_at]
    // [40] phi print_char_at::at#2 = print_char_at::at#0 [phi:print_uchar_at->print_char_at#0] -- register_copy 
    // [40] phi print_char_at::ch#2 = print_char_at::ch#0 [phi:print_uchar_at->print_char_at#1] -- register_copy 
    jsr print_char_at
    // print_uchar_at::@1
    // b&$f
    // [35] print_uchar_at::$2 = print_uchar_at::b#2 & $f -- vbuyy=vbuz1_band_vbuc1 
    lda #$f
    and.z b
    tay
    // print_char_at(print_hextab[b&$f], at+1)
    // [36] print_char_at::at#1 = print_uchar_at::at#2 + 1 -- pbuz1=pbuz2_plus_1 
    clc
    lda.z at
    adc #1
    sta.z print_char_at.at
    lda.z at+1
    adc #0
    sta.z print_char_at.at+1
    // [37] print_char_at::ch#1 = print_hextab[print_uchar_at::$2] -- vbuxx=pbuc1_derefidx_vbuyy 
    ldx print_hextab,y
    // [38] call print_char_at
    // [40] phi from print_uchar_at::@1 to print_char_at [phi:print_uchar_at::@1->print_char_at]
    // [40] phi print_char_at::at#2 = print_char_at::at#1 [phi:print_uchar_at::@1->print_char_at#0] -- register_copy 
    // [40] phi print_char_at::ch#2 = print_char_at::ch#1 [phi:print_uchar_at::@1->print_char_at#1] -- register_copy 
    jsr print_char_at
    // print_uchar_at::@return
    // }
    // [39] return 
    rts
}
  // print_char_at
// Print a single char
// void print_char_at(__register(X) char ch, __zp(2) char *at)
print_char_at: {
    .label at = 2
    // *(at) = ch
    // [41] *print_char_at::at#2 = print_char_at::ch#2 -- _deref_pbuz1=vbuxx 
    txa
    ldy #0
    sta (at),y
    // print_char_at::@return
    // }
    // [42] return 
    rts
}
  // File Data
.segment Data
  print_hextab: .text "0123456789abcdef"

