Inlined call vicSelectGfxBank::$0 = call toDd00(vicSelectGfxBank::gfx)
Inlined call call __init
Eliminating unused variable with no statement keyboard_matrix_read::$0
Eliminating unused variable with no statement keyboard_key_pressed::$0
Eliminating unused variable with no statement keyboard_key_pressed::$1
Eliminating unused variable with no statement main::$29
Eliminating unused variable with no statement plot_chargen::$1
Eliminating unused variable with no statement plot_chargen::$6

CONTROL FLOW GRAPH SSA

char keyboard_matrix_read(char rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read]  from keyboard_key_pressed
  keyboard_matrix_read::rowid#1 = phi( keyboard_key_pressed/keyboard_matrix_read::rowid#0 )
  *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = keyboard_matrix_row_bitmask[keyboard_matrix_read::rowid#1]
  keyboard_matrix_read::row_pressed_bits#0 = ~ *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B)
  keyboard_matrix_read::return#0 = keyboard_matrix_read::row_pressed_bits#0
  to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read]  from keyboard_matrix_read
  keyboard_matrix_read::return#3 = phi( keyboard_matrix_read/keyboard_matrix_read::return#0 )
  keyboard_matrix_read::return#1 = keyboard_matrix_read::return#3
  return 
  to:@return

char keyboard_key_pressed(char key)
keyboard_key_pressed: scope:[keyboard_key_pressed]  from main::@10 main::@16 main::@6 main::@7 main::@8 main::@9
  keyboard_key_pressed::key#6 = phi( main::@10/keyboard_key_pressed::key#4, main::@16/keyboard_key_pressed::key#5, main::@6/keyboard_key_pressed::key#0, main::@7/keyboard_key_pressed::key#1, main::@8/keyboard_key_pressed::key#2, main::@9/keyboard_key_pressed::key#3 )
  keyboard_key_pressed::colidx#0 = keyboard_key_pressed::key#6 & 7
  keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#6 >> 3
  keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0
  call keyboard_matrix_read
  keyboard_matrix_read::return#2 = keyboard_matrix_read::return#1
  to:keyboard_key_pressed::@1
keyboard_key_pressed::@1: scope:[keyboard_key_pressed]  from keyboard_key_pressed
  keyboard_key_pressed::colidx#1 = phi( keyboard_key_pressed/keyboard_key_pressed::colidx#0 )
  keyboard_matrix_read::return#4 = phi( keyboard_key_pressed/keyboard_matrix_read::return#2 )
  keyboard_key_pressed::$2 = keyboard_matrix_read::return#4
  keyboard_key_pressed::$3 = keyboard_key_pressed::$2 & keyboard_matrix_col_bitmask[keyboard_key_pressed::colidx#1]
  keyboard_key_pressed::return#0 = keyboard_key_pressed::$3
  to:keyboard_key_pressed::@return
keyboard_key_pressed::@return: scope:[keyboard_key_pressed]  from keyboard_key_pressed::@1
  keyboard_key_pressed::return#8 = phi( keyboard_key_pressed::@1/keyboard_key_pressed::return#0 )
  keyboard_key_pressed::return#1 = keyboard_key_pressed::return#8
  return 
  to:@return

char keyboard_get_keycode(char ch)
keyboard_get_keycode: scope:[keyboard_get_keycode]  from main::@13
  keyboard_get_keycode::ch#1 = phi( main::@13/keyboard_get_keycode::ch#0 )
  keyboard_get_keycode::return#0 = keyboard_char_keycodes[keyboard_get_keycode::ch#1]
  to:keyboard_get_keycode::@return
keyboard_get_keycode::@return: scope:[keyboard_get_keycode]  from keyboard_get_keycode
  keyboard_get_keycode::return#3 = phi( keyboard_get_keycode/keyboard_get_keycode::return#0 )
  keyboard_get_keycode::return#1 = keyboard_get_keycode::return#3
  return 
  to:@return

void main()
main: scope:[main]  from __start::@1
  main::sc#0 = SCREEN
  to:main::@1
main::@1: scope:[main]  from main main::@2
  main::sc#2 = phi( main/main::sc#0, main::@2/main::sc#1 )
  main::$11 = SCREEN + $3e8
  main::$12 = main::sc#2 < main::$11
  if(main::$12) goto main::@2
  to:main::@3
main::@2: scope:[main]  from main::@1
  main::sc#3 = phi( main::@1/main::sc#2 )
  *main::sc#3 = ' '
  main::sc#1 = ++ main::sc#3
  to:main::@1
main::@3: scope:[main]  from main::@1
  main::$0 = SCREEN + 1
  print_str_at::str#0 = main::str
  print_str_at::at#0 = main::$0
  call print_str_at
  to:main::@24
main::@24: scope:[main]  from main::@3
  main::$2 = SCREEN + 1
  main::$3 = main::$2 + $a
  print_str_at::str#1 = main::str1
  print_str_at::at#1 = main::$3
  call print_str_at
  to:main::@25
main::@25: scope:[main]  from main::@24
  main::$5 = SCREEN + 1
  main::$6 = main::$5 + $14
  print_str_at::str#2 = main::str2
  print_str_at::at#2 = main::$6
  call print_str_at
  to:main::@26
main::@26: scope:[main]  from main::@25
  main::$8 = SCREEN + 1
  main::$9 = main::$8 + $1e
  print_str_at::str#3 = main::str3
  print_str_at::at#3 = main::$9
  call print_str_at
  to:main::@27
main::@27: scope:[main]  from main::@26
  main::i#0 = 0
  to:main::@4
main::@4: scope:[main]  from main::@27 main::@28
  main::i#2 = phi( main::@27/main::i#0, main::@28/main::i#1 )
  plot_chargen::pos#0 = main::i#2
  plot_chargen::ch#0 = $20
  plot_chargen::shift#0 = 0
  call plot_chargen
  to:main::@28
main::@28: scope:[main]  from main::@4
  main::i#3 = phi( main::@4/main::i#2 )
  main::i#1 = main::i#3 + rangenext(0,3)
  main::$14 = main::i#1 != rangelast(0,3)
  if(main::$14) goto main::@4
  to:main::@5
main::@5: scope:[main]  from main::@28
  main::cur_pos#0 = 0
  main::shift#0 = 0
  to:main::@6
main::@6: scope:[main]  from main::@18 main::@5
  main::cur_pos#25 = phi( main::@18/main::cur_pos#26, main::@5/main::cur_pos#0 )
  keyboard_key_pressed::key#0 = KEY_F1
  call keyboard_key_pressed
  keyboard_key_pressed::return#2 = keyboard_key_pressed::return#1
  to:main::@29
main::@29: scope:[main]  from main::@6
  main::cur_pos#24 = phi( main::@6/main::cur_pos#25 )
  keyboard_key_pressed::return#9 = phi( main::@6/keyboard_key_pressed::return#2 )
  main::$15 = keyboard_key_pressed::return#9
  main::$16 = main::$15 != 0
  main::$17 = ! main::$16
  if(main::$17) goto main::@7
  to:main::@19
main::@7: scope:[main]  from main::@19 main::@29
  main::cur_pos#23 = phi( main::@19/main::cur_pos#1, main::@29/main::cur_pos#24 )
  keyboard_key_pressed::key#1 = KEY_F3
  call keyboard_key_pressed
  keyboard_key_pressed::return#3 = keyboard_key_pressed::return#1
  to:main::@30
main::@30: scope:[main]  from main::@7
  main::cur_pos#22 = phi( main::@7/main::cur_pos#23 )
  keyboard_key_pressed::return#10 = phi( main::@7/keyboard_key_pressed::return#3 )
  main::$18 = keyboard_key_pressed::return#10
  main::$19 = main::$18 != 0
  main::$20 = ! main::$19
  if(main::$20) goto main::@8
  to:main::@20
main::@19: scope:[main]  from main::@29
  main::cur_pos#1 = 0
  to:main::@7
main::@8: scope:[main]  from main::@20 main::@30
  main::cur_pos#21 = phi( main::@20/main::cur_pos#2, main::@30/main::cur_pos#22 )
  keyboard_key_pressed::key#2 = KEY_F5
  call keyboard_key_pressed
  keyboard_key_pressed::return#4 = keyboard_key_pressed::return#1
  to:main::@31
main::@31: scope:[main]  from main::@8
  main::cur_pos#20 = phi( main::@8/main::cur_pos#21 )
  keyboard_key_pressed::return#11 = phi( main::@8/keyboard_key_pressed::return#4 )
  main::$21 = keyboard_key_pressed::return#11
  main::$22 = main::$21 != 0
  main::$23 = ! main::$22
  if(main::$23) goto main::@9
  to:main::@21
main::@20: scope:[main]  from main::@30
  main::cur_pos#2 = 1
  to:main::@8
main::@9: scope:[main]  from main::@21 main::@31
  main::cur_pos#19 = phi( main::@21/main::cur_pos#3, main::@31/main::cur_pos#20 )
  keyboard_key_pressed::key#3 = KEY_F7
  call keyboard_key_pressed
  keyboard_key_pressed::return#5 = keyboard_key_pressed::return#1
  to:main::@32
main::@32: scope:[main]  from main::@9
  main::cur_pos#18 = phi( main::@9/main::cur_pos#19 )
  keyboard_key_pressed::return#12 = phi( main::@9/keyboard_key_pressed::return#5 )
  main::$24 = keyboard_key_pressed::return#12
  main::$25 = main::$24 != 0
  main::$26 = ! main::$25
  if(main::$26) goto main::@10
  to:main::@22
main::@21: scope:[main]  from main::@31
  main::cur_pos#3 = 2
  to:main::@9
main::@10: scope:[main]  from main::@22 main::@32
  main::cur_pos#17 = phi( main::@22/main::cur_pos#4, main::@32/main::cur_pos#18 )
  keyboard_key_pressed::key#4 = KEY_LSHIFT
  call keyboard_key_pressed
  keyboard_key_pressed::return#6 = keyboard_key_pressed::return#1
  to:main::@33
main::@33: scope:[main]  from main::@10
  main::cur_pos#16 = phi( main::@10/main::cur_pos#17 )
  keyboard_key_pressed::return#13 = phi( main::@10/keyboard_key_pressed::return#6 )
  main::$27 = keyboard_key_pressed::return#13
  main::$28 = main::$27 != 0
  if(main::$28) goto main::@11
  to:main::@23
main::@22: scope:[main]  from main::@32
  main::cur_pos#4 = 3
  to:main::@10
main::@11: scope:[main]  from main::@33
  main::cur_pos#13 = phi( main::@33/main::cur_pos#16 )
  main::shift#1 = 1
  to:main::@12
main::@23: scope:[main]  from main::@33
  main::cur_pos#14 = phi( main::@33/main::cur_pos#16 )
  main::shift#2 = 0
  to:main::@12
main::@12: scope:[main]  from main::@11 main::@23
  main::shift#9 = phi( main::@11/main::shift#1, main::@23/main::shift#2 )
  main::cur_pos#11 = phi( main::@11/main::cur_pos#13, main::@23/main::cur_pos#14 )
  main::ch#0 = 0
  to:main::@13
main::@13: scope:[main]  from main::@12 main::@15
  main::shift#7 = phi( main::@12/main::shift#9, main::@15/main::shift#10 )
  main::cur_pos#9 = phi( main::@12/main::cur_pos#11, main::@15/main::cur_pos#12 )
  main::ch#2 = phi( main::@12/main::ch#0, main::@15/main::ch#1 )
  main::pressed#0 = 0
  keyboard_get_keycode::ch#0 = main::ch#2
  call keyboard_get_keycode
  keyboard_get_keycode::return#2 = keyboard_get_keycode::return#1
  to:main::@34
main::@34: scope:[main]  from main::@13
  main::shift#5 = phi( main::@13/main::shift#7 )
  main::cur_pos#7 = phi( main::@13/main::cur_pos#9 )
  main::ch#7 = phi( main::@13/main::ch#2 )
  main::pressed#3 = phi( main::@13/main::pressed#0 )
  keyboard_get_keycode::return#4 = phi( main::@13/keyboard_get_keycode::return#2 )
  main::key#0 = keyboard_get_keycode::return#4
  main::$30 = main::key#0 != $3f
  main::$31 = ! main::$30
  if(main::$31) goto main::@14
  to:main::@16
main::@14: scope:[main]  from main::@34 main::@35
  main::shift#4 = phi( main::@34/main::shift#5, main::@35/main::shift#6 )
  main::cur_pos#6 = phi( main::@34/main::cur_pos#7, main::@35/main::cur_pos#8 )
  main::ch#5 = phi( main::@34/main::ch#7, main::@35/main::ch#8 )
  main::pressed#2 = phi( main::@34/main::pressed#3, main::@35/main::pressed#1 )
  main::$33 = main::pressed#2 != 0
  main::$34 = ! main::$33
  if(main::$34) goto main::@15
  to:main::@17
main::@16: scope:[main]  from main::@34
  main::shift#8 = phi( main::@34/main::shift#5 )
  main::cur_pos#10 = phi( main::@34/main::cur_pos#7 )
  main::ch#9 = phi( main::@34/main::ch#7 )
  main::key#1 = phi( main::@34/main::key#0 )
  keyboard_key_pressed::key#5 = main::key#1
  call keyboard_key_pressed
  keyboard_key_pressed::return#7 = keyboard_key_pressed::return#1
  to:main::@35
main::@35: scope:[main]  from main::@16
  main::shift#6 = phi( main::@16/main::shift#8 )
  main::cur_pos#8 = phi( main::@16/main::cur_pos#10 )
  main::ch#8 = phi( main::@16/main::ch#9 )
  keyboard_key_pressed::return#14 = phi( main::@16/keyboard_key_pressed::return#7 )
  main::$32 = keyboard_key_pressed::return#14
  main::pressed#1 = main::$32
  to:main::@14
main::@15: scope:[main]  from main::@14 main::@36
  main::shift#10 = phi( main::@14/main::shift#4, main::@36/main::shift#11 )
  main::cur_pos#12 = phi( main::@14/main::cur_pos#6, main::@36/main::cur_pos#15 )
  main::ch#3 = phi( main::@14/main::ch#5, main::@36/main::ch#6 )
  main::ch#1 = main::ch#3 + rangenext(0,$3f)
  main::$36 = main::ch#1 != rangelast(0,$3f)
  if(main::$36) goto main::@13
  to:main::@18
main::@17: scope:[main]  from main::@14
  main::shift#3 = phi( main::@14/main::shift#4 )
  main::ch#4 = phi( main::@14/main::ch#5 )
  main::cur_pos#5 = phi( main::@14/main::cur_pos#6 )
  plot_chargen::pos#1 = main::cur_pos#5
  plot_chargen::ch#1 = main::ch#4
  plot_chargen::shift#1 = main::shift#3
  call plot_chargen
  to:main::@36
main::@36: scope:[main]  from main::@17
  main::shift#11 = phi( main::@17/main::shift#3 )
  main::cur_pos#15 = phi( main::@17/main::cur_pos#5 )
  main::ch#6 = phi( main::@17/main::ch#4 )
  to:main::@15
main::@18: scope:[main]  from main::@15
  main::cur_pos#26 = phi( main::@15/main::cur_pos#12 )
  if(true) goto main::@6
  to:main::@return
main::@return: scope:[main]  from main::@18
  return 
  to:@return

void print_str_at(char *str , char *at)
print_str_at: scope:[print_str_at]  from main::@24 main::@25 main::@26 main::@3
  print_str_at::at#7 = phi( main::@24/print_str_at::at#1, main::@25/print_str_at::at#2, main::@26/print_str_at::at#3, main::@3/print_str_at::at#0 )
  print_str_at::str#7 = phi( main::@24/print_str_at::str#1, main::@25/print_str_at::str#2, main::@26/print_str_at::str#3, main::@3/print_str_at::str#0 )
  to:print_str_at::@1
print_str_at::@1: scope:[print_str_at]  from print_str_at print_str_at::@2
  print_str_at::at#6 = phi( print_str_at/print_str_at::at#7, print_str_at::@2/print_str_at::at#4 )
  print_str_at::str#5 = phi( print_str_at/print_str_at::str#7, print_str_at::@2/print_str_at::str#4 )
  print_str_at::$0 = 0 != *print_str_at::str#5
  if(print_str_at::$0) goto print_str_at::@2
  to:print_str_at::@return
print_str_at::@2: scope:[print_str_at]  from print_str_at::@1
  print_str_at::at#5 = phi( print_str_at::@1/print_str_at::at#6 )
  print_str_at::str#6 = phi( print_str_at::@1/print_str_at::str#5 )
  *print_str_at::at#5 = *print_str_at::str#6
  print_str_at::at#4 = ++ print_str_at::at#5
  print_str_at::str#4 = ++ print_str_at::str#6
  to:print_str_at::@1
print_str_at::@return: scope:[print_str_at]  from print_str_at::@1
  return 
  to:@return

void plot_chargen(char pos , char ch , char shift)
plot_chargen: scope:[plot_chargen]  from main::@17 main::@4
  plot_chargen::pos#3 = phi( main::@17/plot_chargen::pos#1, main::@4/plot_chargen::pos#0 )
  plot_chargen::shift#2 = phi( main::@17/plot_chargen::shift#1, main::@4/plot_chargen::shift#0 )
  plot_chargen::ch#2 = phi( main::@17/plot_chargen::ch#1, main::@4/plot_chargen::ch#0 )
  asm { sei  }
  plot_chargen::$15 = (unsigned int)plot_chargen::ch#2
  plot_chargen::$0 = plot_chargen::$15 * 8
  plot_chargen::chargen#0 = CHARGEN + plot_chargen::$0
  plot_chargen::$2 = plot_chargen::shift#2 != 0
  plot_chargen::$3 = ! plot_chargen::$2
  if(plot_chargen::$3) goto plot_chargen::@1
  to:plot_chargen::@2
plot_chargen::@1: scope:[plot_chargen]  from plot_chargen plot_chargen::@2
  plot_chargen::chargen#4 = phi( plot_chargen/plot_chargen::chargen#0, plot_chargen::@2/plot_chargen::chargen#1 )
  plot_chargen::pos#2 = phi( plot_chargen/plot_chargen::pos#3, plot_chargen::@2/plot_chargen::pos#4 )
  *PROCPORT = $32
  plot_chargen::$4 = SCREEN + $29
  plot_chargen::$5 = plot_chargen::pos#2 * $a
  plot_chargen::sc#0 = plot_chargen::$4 + plot_chargen::$5
  plot_chargen::y#0 = 0
  to:plot_chargen::@3
plot_chargen::@2: scope:[plot_chargen]  from plot_chargen
  plot_chargen::pos#4 = phi( plot_chargen/plot_chargen::pos#3 )
  plot_chargen::chargen#2 = phi( plot_chargen/plot_chargen::chargen#0 )
  plot_chargen::$7 = plot_chargen::chargen#2 + $800
  plot_chargen::chargen#1 = plot_chargen::$7
  to:plot_chargen::@1
plot_chargen::@3: scope:[plot_chargen]  from plot_chargen::@1 plot_chargen::@7
  plot_chargen::sc#7 = phi( plot_chargen::@1/plot_chargen::sc#0, plot_chargen::@7/plot_chargen::sc#2 )
  plot_chargen::y#2 = phi( plot_chargen::@1/plot_chargen::y#0, plot_chargen::@7/plot_chargen::y#1 )
  plot_chargen::chargen#3 = phi( plot_chargen::@1/plot_chargen::chargen#4, plot_chargen::@7/plot_chargen::chargen#5 )
  plot_chargen::bits#0 = plot_chargen::chargen#3[plot_chargen::y#2]
  plot_chargen::x#0 = 0
  to:plot_chargen::@4
plot_chargen::@4: scope:[plot_chargen]  from plot_chargen::@3 plot_chargen::@5
  plot_chargen::chargen#7 = phi( plot_chargen::@3/plot_chargen::chargen#3, plot_chargen::@5/plot_chargen::chargen#6 )
  plot_chargen::y#5 = phi( plot_chargen::@3/plot_chargen::y#2, plot_chargen::@5/plot_chargen::y#4 )
  plot_chargen::x#3 = phi( plot_chargen::@3/plot_chargen::x#0, plot_chargen::@5/plot_chargen::x#1 )
  plot_chargen::sc#5 = phi( plot_chargen::@3/plot_chargen::sc#7, plot_chargen::@5/plot_chargen::sc#1 )
  plot_chargen::bits#2 = phi( plot_chargen::@3/plot_chargen::bits#0, plot_chargen::@5/plot_chargen::bits#1 )
  plot_chargen::c#0 = '.'
  plot_chargen::$8 = plot_chargen::bits#2 & $80
  plot_chargen::$9 = plot_chargen::$8 != 0
  plot_chargen::$10 = ! plot_chargen::$9
  if(plot_chargen::$10) goto plot_chargen::@5
  to:plot_chargen::@6
plot_chargen::@5: scope:[plot_chargen]  from plot_chargen::@4 plot_chargen::@6
  plot_chargen::chargen#6 = phi( plot_chargen::@4/plot_chargen::chargen#7, plot_chargen::@6/plot_chargen::chargen#8 )
  plot_chargen::y#4 = phi( plot_chargen::@4/plot_chargen::y#5, plot_chargen::@6/plot_chargen::y#6 )
  plot_chargen::x#2 = phi( plot_chargen::@4/plot_chargen::x#3, plot_chargen::@6/plot_chargen::x#4 )
  plot_chargen::bits#3 = phi( plot_chargen::@4/plot_chargen::bits#2, plot_chargen::@6/plot_chargen::bits#4 )
  plot_chargen::sc#3 = phi( plot_chargen::@4/plot_chargen::sc#5, plot_chargen::@6/plot_chargen::sc#6 )
  plot_chargen::c#2 = phi( plot_chargen::@4/plot_chargen::c#0, plot_chargen::@6/plot_chargen::c#1 )
  *plot_chargen::sc#3 = plot_chargen::c#2
  plot_chargen::sc#1 = ++ plot_chargen::sc#3
  plot_chargen::$11 = plot_chargen::bits#3 * 2
  plot_chargen::bits#1 = plot_chargen::$11
  plot_chargen::x#1 = plot_chargen::x#2 + rangenext(0,7)
  plot_chargen::$12 = plot_chargen::x#1 != rangelast(0,7)
  if(plot_chargen::$12) goto plot_chargen::@4
  to:plot_chargen::@7
plot_chargen::@6: scope:[plot_chargen]  from plot_chargen::@4
  plot_chargen::chargen#8 = phi( plot_chargen::@4/plot_chargen::chargen#7 )
  plot_chargen::y#6 = phi( plot_chargen::@4/plot_chargen::y#5 )
  plot_chargen::x#4 = phi( plot_chargen::@4/plot_chargen::x#3 )
  plot_chargen::bits#4 = phi( plot_chargen::@4/plot_chargen::bits#2 )
  plot_chargen::sc#6 = phi( plot_chargen::@4/plot_chargen::sc#5 )
  plot_chargen::c#1 = '*'
  to:plot_chargen::@5
plot_chargen::@7: scope:[plot_chargen]  from plot_chargen::@5
  plot_chargen::chargen#5 = phi( plot_chargen::@5/plot_chargen::chargen#6 )
  plot_chargen::y#3 = phi( plot_chargen::@5/plot_chargen::y#4 )
  plot_chargen::sc#4 = phi( plot_chargen::@5/plot_chargen::sc#1 )
  plot_chargen::$13 = plot_chargen::sc#4 + $20
  plot_chargen::sc#2 = plot_chargen::$13
  plot_chargen::y#1 = plot_chargen::y#3 + rangenext(0,7)
  plot_chargen::$14 = plot_chargen::y#1 != rangelast(0,7)
  if(plot_chargen::$14) goto plot_chargen::@3
  to:plot_chargen::@8
plot_chargen::@8: scope:[plot_chargen]  from plot_chargen::@7
  *PROCPORT = $37
  asm { cli  }
  to:plot_chargen::@return
plot_chargen::@return: scope:[plot_chargen]  from plot_chargen::@8
  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 char * const CHARGEN = (char *)$d000
__constant struct MOS6526_CIA * const CIA1 = (struct MOS6526_CIA *)$dc00
__constant const char KEY_0 = $23
__constant const char KEY_1 = $38
__constant const char KEY_2 = $3b
__constant const char KEY_3 = 8
__constant const char KEY_4 = $b
__constant const char KEY_5 = $10
__constant const char KEY_6 = $13
__constant const char KEY_7 = $18
__constant const char KEY_8 = $1b
__constant const char KEY_9 = $20
__constant const char KEY_A = $a
__constant const char KEY_ARROW_LEFT = $39
__constant const char KEY_ARROW_UP = $36
__constant const char KEY_ASTERISK = $31
__constant const char KEY_AT = $2e
__constant const char KEY_B = $1c
__constant const char KEY_C = $14
__constant const char KEY_COLON = $2d
__constant const char KEY_COMMA = $2f
__constant const char KEY_D = $12
__constant const char KEY_DOT = $2c
__constant const char KEY_E = $e
__constant const char KEY_EQUALS = $35
__constant const char KEY_F = $15
__constant const char KEY_F1 = 4
__constant const char KEY_F3 = 5
__constant const char KEY_F5 = 6
__constant const char KEY_F7 = 3
__constant const char KEY_G = $1a
__constant const char KEY_H = $1d
__constant const char KEY_I = $21
__constant const char KEY_J = $22
__constant const char KEY_K = $25
__constant const char KEY_L = $2a
__constant const char KEY_LSHIFT = $f
__constant const char KEY_M = $24
__constant const char KEY_MINUS = $2b
__constant const char KEY_N = $27
__constant const char KEY_O = $26
__constant const char KEY_P = $29
__constant const char KEY_PLUS = $28
__constant const char KEY_POUND = $30
__constant const char KEY_Q = $3e
__constant const char KEY_R = $11
__constant const char KEY_S = $d
__constant const char KEY_SEMICOLON = $32
__constant const char KEY_SLASH = $37
__constant const char KEY_SPACE = $3c
__constant const char KEY_T = $16
__constant const char KEY_U = $1e
__constant const char KEY_V = $1f
__constant const char KEY_W = 9
__constant const char KEY_X = $17
__constant const char KEY_Y = $19
__constant const char KEY_Z = $c
__constant char OFFSET_STRUCT_MOS6526_CIA_PORT_A = 0
__constant char OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
__constant char * const PROCPORT = (char *)1
__constant char *SCREEN = (char *)$400
void __start()
__constant const char keyboard_char_keycodes[] = { KEY_AT, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, $3f, KEY_POUND, $3f, KEY_ARROW_UP, KEY_ARROW_LEFT, KEY_SPACE, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, KEY_ASTERISK, KEY_PLUS, KEY_COMMA, KEY_MINUS, KEY_DOT, KEY_SLASH, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON, $3f, KEY_EQUALS, $3f, $3f }
char keyboard_get_keycode(char ch)
char keyboard_get_keycode::ch
char keyboard_get_keycode::ch#0
char keyboard_get_keycode::ch#1
char keyboard_get_keycode::return
char keyboard_get_keycode::return#0
char keyboard_get_keycode::return#1
char keyboard_get_keycode::return#2
char keyboard_get_keycode::return#3
char keyboard_get_keycode::return#4
char keyboard_key_pressed(char key)
char keyboard_key_pressed::$2
char keyboard_key_pressed::$3
char keyboard_key_pressed::colidx
char keyboard_key_pressed::colidx#0
char keyboard_key_pressed::colidx#1
char keyboard_key_pressed::key
char keyboard_key_pressed::key#0
char keyboard_key_pressed::key#1
char keyboard_key_pressed::key#2
char keyboard_key_pressed::key#3
char keyboard_key_pressed::key#4
char keyboard_key_pressed::key#5
char keyboard_key_pressed::key#6
char keyboard_key_pressed::return
char keyboard_key_pressed::return#0
char keyboard_key_pressed::return#1
char keyboard_key_pressed::return#10
char keyboard_key_pressed::return#11
char keyboard_key_pressed::return#12
char keyboard_key_pressed::return#13
char keyboard_key_pressed::return#14
char keyboard_key_pressed::return#2
char keyboard_key_pressed::return#3
char keyboard_key_pressed::return#4
char keyboard_key_pressed::return#5
char keyboard_key_pressed::return#6
char keyboard_key_pressed::return#7
char keyboard_key_pressed::return#8
char keyboard_key_pressed::return#9
char keyboard_key_pressed::rowidx
char keyboard_key_pressed::rowidx#0
__constant char keyboard_matrix_col_bitmask[8] = { 1, 2, 4, 8, $10, $20, $40, $80 }
char keyboard_matrix_read(char rowid)
char keyboard_matrix_read::return
char keyboard_matrix_read::return#0
char keyboard_matrix_read::return#1
char keyboard_matrix_read::return#2
char keyboard_matrix_read::return#3
char keyboard_matrix_read::return#4
char keyboard_matrix_read::row_pressed_bits
char keyboard_matrix_read::row_pressed_bits#0
char keyboard_matrix_read::rowid
char keyboard_matrix_read::rowid#0
char keyboard_matrix_read::rowid#1
__constant char keyboard_matrix_row_bitmask[8] = { $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f }
void main()
char *main::$0
char *main::$11
bool main::$12
bool main::$14
char main::$15
bool main::$16
bool main::$17
char main::$18
bool main::$19
char *main::$2
bool main::$20
char main::$21
bool main::$22
bool main::$23
char main::$24
bool main::$25
bool main::$26
char main::$27
bool main::$28
char *main::$3
bool main::$30
bool main::$31
char main::$32
bool main::$33
bool main::$34
bool main::$36
char *main::$5
char *main::$6
char *main::$8
char *main::$9
char main::ch
char main::ch#0
char main::ch#1
char main::ch#2
char main::ch#3
char main::ch#4
char main::ch#5
char main::ch#6
char main::ch#7
char main::ch#8
char main::ch#9
char main::cur_pos
char main::cur_pos#0
char main::cur_pos#1
char main::cur_pos#10
char main::cur_pos#11
char main::cur_pos#12
char main::cur_pos#13
char main::cur_pos#14
char main::cur_pos#15
char main::cur_pos#16
char main::cur_pos#17
char main::cur_pos#18
char main::cur_pos#19
char main::cur_pos#2
char main::cur_pos#20
char main::cur_pos#21
char main::cur_pos#22
char main::cur_pos#23
char main::cur_pos#24
char main::cur_pos#25
char main::cur_pos#26
char main::cur_pos#3
char main::cur_pos#4
char main::cur_pos#5
char main::cur_pos#6
char main::cur_pos#7
char main::cur_pos#8
char main::cur_pos#9
char main::i
char main::i#0
char main::i#1
char main::i#2
char main::i#3
char main::key
char main::key#0
char main::key#1
char main::pressed
char main::pressed#0
char main::pressed#1
char main::pressed#2
char main::pressed#3
char *main::sc
char *main::sc#0
char *main::sc#1
char *main::sc#2
char *main::sc#3
char main::shift
char main::shift#0
char main::shift#1
char main::shift#10
char main::shift#11
char main::shift#2
char main::shift#3
char main::shift#4
char main::shift#5
char main::shift#6
char main::shift#7
char main::shift#8
char main::shift#9
__constant char main::str[3] = "f1"
__constant char main::str1[3] = "f3"
__constant char main::str2[3] = "f5"
__constant char main::str3[3] = "f7"
void plot_chargen(char pos , char ch , char shift)
number plot_chargen::$0
bool plot_chargen::$10
number plot_chargen::$11
bool plot_chargen::$12
char *plot_chargen::$13
bool plot_chargen::$14
unsigned int plot_chargen::$15
bool plot_chargen::$2
bool plot_chargen::$3
char *plot_chargen::$4
number plot_chargen::$5
char *plot_chargen::$7
number plot_chargen::$8
bool plot_chargen::$9
char plot_chargen::bits
char plot_chargen::bits#0
char plot_chargen::bits#1
char plot_chargen::bits#2
char plot_chargen::bits#3
char plot_chargen::bits#4
char plot_chargen::c
char plot_chargen::c#0
char plot_chargen::c#1
char plot_chargen::c#2
char plot_chargen::ch
char plot_chargen::ch#0
char plot_chargen::ch#1
char plot_chargen::ch#2
char *plot_chargen::chargen
char *plot_chargen::chargen#0
char *plot_chargen::chargen#1
char *plot_chargen::chargen#2
char *plot_chargen::chargen#3
char *plot_chargen::chargen#4
char *plot_chargen::chargen#5
char *plot_chargen::chargen#6
char *plot_chargen::chargen#7
char *plot_chargen::chargen#8
char plot_chargen::pos
char plot_chargen::pos#0
char plot_chargen::pos#1
char plot_chargen::pos#2
char plot_chargen::pos#3
char plot_chargen::pos#4
char *plot_chargen::sc
char *plot_chargen::sc#0
char *plot_chargen::sc#1
char *plot_chargen::sc#2
char *plot_chargen::sc#3
char *plot_chargen::sc#4
char *plot_chargen::sc#5
char *plot_chargen::sc#6
char *plot_chargen::sc#7
char plot_chargen::shift
char plot_chargen::shift#0
char plot_chargen::shift#1
char plot_chargen::shift#2
char plot_chargen::x
char plot_chargen::x#0
char plot_chargen::x#1
char plot_chargen::x#2
char plot_chargen::x#3
char plot_chargen::x#4
char plot_chargen::y
char plot_chargen::y#0
char plot_chargen::y#1
char plot_chargen::y#2
char plot_chargen::y#3
char plot_chargen::y#4
char plot_chargen::y#5
char plot_chargen::y#6
void print_str_at(char *str , char *at)
bool print_str_at::$0
char *print_str_at::at
char *print_str_at::at#0
char *print_str_at::at#1
char *print_str_at::at#2
char *print_str_at::at#3
char *print_str_at::at#4
char *print_str_at::at#5
char *print_str_at::at#6
char *print_str_at::at#7
char *print_str_at::str
char *print_str_at::str#0
char *print_str_at::str#1
char *print_str_at::str#2
char *print_str_at::str#3
char *print_str_at::str#4
char *print_str_at::str#5
char *print_str_at::str#6
char *print_str_at::str#7

Adding number conversion cast (unumber) 7 in keyboard_key_pressed::colidx#0 = keyboard_key_pressed::key#6 & 7
Adding number conversion cast (unumber) 3 in keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#6 >> 3
Adding number conversion cast (unumber) $3e8 in main::$11 = SCREEN + $3e8
Adding number conversion cast (unumber) 1 in main::$0 = SCREEN + 1
Adding number conversion cast (unumber) 1 in main::$2 = SCREEN + 1
Adding number conversion cast (unumber) $a in main::$3 = main::$2 + $a
Adding number conversion cast (unumber) 1 in main::$5 = SCREEN + 1
Adding number conversion cast (unumber) $14 in main::$6 = main::$5 + $14
Adding number conversion cast (unumber) 1 in main::$8 = SCREEN + 1
Adding number conversion cast (unumber) $1e in main::$9 = main::$8 + $1e
Adding number conversion cast (unumber) $20 in plot_chargen::ch#0 = $20
Adding number conversion cast (unumber) 0 in plot_chargen::shift#0 = 0
Adding number conversion cast (unumber) 0 in main::$16 = main::$15 != 0
Adding number conversion cast (unumber) 0 in main::$19 = main::$18 != 0
Adding number conversion cast (unumber) 0 in main::cur_pos#1 = 0
Adding number conversion cast (unumber) 0 in main::$22 = main::$21 != 0
Adding number conversion cast (unumber) 1 in main::cur_pos#2 = 1
Adding number conversion cast (unumber) 0 in main::$25 = main::$24 != 0
Adding number conversion cast (unumber) 2 in main::cur_pos#3 = 2
Adding number conversion cast (unumber) 0 in main::$28 = main::$27 != 0
Adding number conversion cast (unumber) 3 in main::cur_pos#4 = 3
Adding number conversion cast (unumber) 1 in main::shift#1 = 1
Adding number conversion cast (unumber) 0 in main::shift#2 = 0
Adding number conversion cast (unumber) $3f in main::$30 = main::key#0 != $3f
Adding number conversion cast (unumber) 0 in main::$33 = main::pressed#2 != 0
Adding number conversion cast (unumber) 0 in print_str_at::$0 = 0 != *print_str_at::str#5
Adding number conversion cast (unumber) 8 in plot_chargen::$0 = plot_chargen::$15 * 8
Adding number conversion cast (unumber) plot_chargen::$0 in plot_chargen::$0 = plot_chargen::$15 * (unumber)8
Adding number conversion cast (unumber) 0 in plot_chargen::$2 = plot_chargen::shift#2 != 0
Adding number conversion cast (unumber) $32 in *PROCPORT = $32
Adding number conversion cast (unumber) $29 in plot_chargen::$4 = SCREEN + $29
Adding number conversion cast (unumber) $a in plot_chargen::$5 = plot_chargen::pos#2 * $a
Adding number conversion cast (unumber) plot_chargen::$5 in plot_chargen::$5 = plot_chargen::pos#2 * (unumber)$a
Adding number conversion cast (unumber) $800 in plot_chargen::$7 = plot_chargen::chargen#2 + $800
Adding number conversion cast (unumber) $80 in plot_chargen::$8 = plot_chargen::bits#2 & $80
Adding number conversion cast (unumber) plot_chargen::$8 in plot_chargen::$8 = plot_chargen::bits#2 & (unumber)$80
Adding number conversion cast (unumber) 0 in plot_chargen::$9 = plot_chargen::$8 != 0
Adding number conversion cast (unumber) 2 in plot_chargen::$11 = plot_chargen::bits#3 * 2
Adding number conversion cast (unumber) plot_chargen::$11 in plot_chargen::$11 = plot_chargen::bits#3 * (unumber)2
Adding number conversion cast (unumber) $20 in plot_chargen::$13 = plot_chargen::sc#4 + $20
Adding number conversion cast (unumber) $37 in *PROCPORT = $37
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast plot_chargen::ch#0 = (unumber)$20
Inlining cast plot_chargen::shift#0 = (unumber)0
Inlining cast main::cur_pos#1 = (unumber)0
Inlining cast main::cur_pos#2 = (unumber)1
Inlining cast main::cur_pos#3 = (unumber)2
Inlining cast main::cur_pos#4 = (unumber)3
Inlining cast main::shift#1 = (unumber)1
Inlining cast main::shift#2 = (unumber)0
Inlining cast *PROCPORT = (unumber)$32
Inlining cast *PROCPORT = (unumber)$37
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (char *) 1
Simplifying constant pointer cast (char *) 53248
Simplifying constant pointer cast (struct MOS6526_CIA *) 56320
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 7
Simplifying constant integer cast 3
Simplifying constant integer cast $3e8
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast $a
Simplifying constant integer cast 1
Simplifying constant integer cast $14
Simplifying constant integer cast 1
Simplifying constant integer cast $1e
Simplifying constant integer cast $20
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast 0
Simplifying constant integer cast 3
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast $3f
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 8
Simplifying constant integer cast 0
Simplifying constant integer cast $32
Simplifying constant integer cast $29
Simplifying constant integer cast $a
Simplifying constant integer cast $800
Simplifying constant integer cast $80
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast $20
Simplifying constant integer cast $37
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 7
Finalized unsigned number type (char) 3
Finalized unsigned number type (unsigned int) $3e8
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) $a
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) $14
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) $1e
Finalized unsigned number type (char) $20
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $3f
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) $29
Finalized unsigned number type (char) $a
Finalized unsigned number type (unsigned int) $800
Finalized unsigned number type (char) $80
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) $20
Finalized unsigned number type (char) $37
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to unsigned int in plot_chargen::$0 = plot_chargen::$15 * 8
Inferred type updated to char in plot_chargen::$5 = plot_chargen::pos#2 * $a
Inferred type updated to char in plot_chargen::$8 = plot_chargen::bits#2 & $80
Inferred type updated to char in plot_chargen::$11 = plot_chargen::bits#3 * 2
Inversing boolean not [71] main::$17 = main::$15 == 0 from [70] main::$16 = main::$15 != 0
Inversing boolean not [80] main::$20 = main::$18 == 0 from [79] main::$19 = main::$18 != 0
Inversing boolean not [90] main::$23 = main::$21 == 0 from [89] main::$22 = main::$21 != 0
Inversing boolean not [100] main::$26 = main::$24 == 0 from [99] main::$25 = main::$24 != 0
Inversing boolean not [126] main::$31 = main::key#0 == $3f from [125] main::$30 = main::key#0 != $3f
Inversing boolean not [130] main::$34 = main::pressed#2 == 0 from [129] main::$33 = main::pressed#2 != 0
Inversing boolean not [167] plot_chargen::$3 = plot_chargen::shift#2 == 0 from [166] plot_chargen::$2 = plot_chargen::shift#2 != 0
Inversing boolean not [185] plot_chargen::$10 = plot_chargen::$8 == 0 from [184] plot_chargen::$9 = plot_chargen::$8 != 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias keyboard_matrix_read::return#0 = keyboard_matrix_read::row_pressed_bits#0 keyboard_matrix_read::return#3 keyboard_matrix_read::return#1 
Alias keyboard_matrix_read::return#2 = keyboard_matrix_read::return#4 
Alias keyboard_key_pressed::colidx#0 = keyboard_key_pressed::colidx#1 
Alias keyboard_key_pressed::return#0 = keyboard_key_pressed::$3 keyboard_key_pressed::return#8 keyboard_key_pressed::return#1 
Alias keyboard_get_keycode::return#0 = keyboard_get_keycode::return#3 keyboard_get_keycode::return#1 
Alias main::sc#2 = main::sc#3 
Alias print_str_at::at#0 = main::$0 
Alias print_str_at::at#1 = main::$3 
Alias print_str_at::at#2 = main::$6 
Alias print_str_at::at#3 = main::$9 
Alias main::i#2 = main::i#3 
Alias keyboard_key_pressed::return#2 = keyboard_key_pressed::return#9 
Alias main::cur_pos#24 = main::cur_pos#25 
Alias keyboard_key_pressed::return#10 = keyboard_key_pressed::return#3 
Alias main::cur_pos#22 = main::cur_pos#23 
Alias keyboard_key_pressed::return#11 = keyboard_key_pressed::return#4 
Alias main::cur_pos#20 = main::cur_pos#21 
Alias keyboard_key_pressed::return#12 = keyboard_key_pressed::return#5 
Alias main::cur_pos#18 = main::cur_pos#19 
Alias keyboard_key_pressed::return#13 = keyboard_key_pressed::return#6 
Alias main::cur_pos#13 = main::cur_pos#16 main::cur_pos#17 main::cur_pos#14 
Alias keyboard_get_keycode::return#2 = keyboard_get_keycode::return#4 
Alias main::pressed#0 = main::pressed#3 
Alias main::ch#2 = main::ch#7 main::ch#9 main::ch#8 
Alias main::cur_pos#10 = main::cur_pos#7 main::cur_pos#9 main::cur_pos#8 
Alias main::shift#5 = main::shift#7 main::shift#8 main::shift#6 
Alias main::key#0 = main::key#1 
Alias keyboard_key_pressed::return#14 = keyboard_key_pressed::return#7 
Alias main::pressed#1 = main::$32 
Alias main::cur_pos#15 = main::cur_pos#5 main::cur_pos#6 
Alias main::ch#4 = main::ch#5 main::ch#6 
Alias main::shift#11 = main::shift#3 main::shift#4 
Alias main::cur_pos#12 = main::cur_pos#26 
Alias print_str_at::str#5 = print_str_at::str#6 
Alias print_str_at::at#5 = print_str_at::at#6 
Alias plot_chargen::chargen#0 = plot_chargen::chargen#2 
Alias plot_chargen::pos#3 = plot_chargen::pos#4 
Alias plot_chargen::chargen#1 = plot_chargen::$7 
Alias plot_chargen::bits#1 = plot_chargen::$11 
Alias plot_chargen::sc#5 = plot_chargen::sc#6 
Alias plot_chargen::bits#2 = plot_chargen::bits#4 
Alias plot_chargen::x#3 = plot_chargen::x#4 
Alias plot_chargen::y#5 = plot_chargen::y#6 
Alias plot_chargen::chargen#7 = plot_chargen::chargen#8 
Alias plot_chargen::sc#1 = plot_chargen::sc#4 
Alias plot_chargen::y#3 = plot_chargen::y#4 
Alias plot_chargen::chargen#5 = plot_chargen::chargen#6 
Alias plot_chargen::sc#2 = plot_chargen::$13 
Successful SSA optimization Pass2AliasElimination
Alias main::cur_pos#11 = main::cur_pos#13 
Alias main::ch#2 = main::ch#4 main::ch#3 
Alias main::cur_pos#10 = main::cur_pos#15 main::cur_pos#12 
Alias main::shift#10 = main::shift#11 main::shift#5 
Alias plot_chargen::pos#2 = plot_chargen::pos#3 
Alias plot_chargen::sc#3 = plot_chargen::sc#5 
Alias plot_chargen::bits#2 = plot_chargen::bits#3 
Alias plot_chargen::x#2 = plot_chargen::x#3 
Alias plot_chargen::y#3 = plot_chargen::y#5 
Alias plot_chargen::chargen#5 = plot_chargen::chargen#7 
Successful SSA optimization Pass2AliasElimination
Identical Phi Values keyboard_matrix_read::rowid#1 keyboard_matrix_read::rowid#0
Identical Phi Values keyboard_get_keycode::ch#1 keyboard_get_keycode::ch#0
Identical Phi Values main::cur_pos#10 main::cur_pos#11
Identical Phi Values main::shift#10 main::shift#9
Identical Phi Values plot_chargen::y#3 plot_chargen::y#2
Identical Phi Values plot_chargen::chargen#5 plot_chargen::chargen#3
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values plot_chargen::chargen#3 plot_chargen::chargen#4
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition main::$12 [20] if(main::sc#2<main::$11) goto main::@2
Simple Condition main::$14 [46] if(main::i#1!=rangelast(0,3)) goto main::@4
Simple Condition main::$17 [55] if(main::$15==0) goto main::@7
Simple Condition main::$20 [62] if(main::$18==0) goto main::@8
Simple Condition main::$23 [70] if(main::$21==0) goto main::@9
Simple Condition main::$26 [78] if(main::$24==0) goto main::@10
Simple Condition main::$28 [86] if(main::$27!=0) goto main::@11
Simple Condition main::$31 [99] if(main::key#0==$3f) goto main::@14
Simple Condition main::$34 [102] if(main::pressed#2==0) goto main::@15
Simple Condition main::$36 [109] if(main::ch#1!=rangelast(0,$3f)) goto main::@13
Simple Condition print_str_at::$0 [119] if(0!=*print_str_at::str#5) goto print_str_at::@2
Simple Condition plot_chargen::$3 [130] if(plot_chargen::shift#2==0) goto plot_chargen::@1
Simple Condition plot_chargen::$10 [145] if(plot_chargen::$8==0) goto plot_chargen::@5
Simple Condition plot_chargen::$12 [152] if(plot_chargen::x#1!=rangelast(0,7)) goto plot_chargen::@4
Simple Condition plot_chargen::$14 [157] if(plot_chargen::y#1!=rangelast(0,7)) goto plot_chargen::@3
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [18] main::$11 = SCREEN + $3e8
Constant right-side identified [23] print_str_at::at#0 = SCREEN + 1
Constant right-side identified [26] main::$2 = SCREEN + 1
Constant right-side identified [30] main::$5 = SCREEN + 1
Constant right-side identified [34] main::$8 = SCREEN + 1
Constant right-side identified [133] plot_chargen::$4 = SCREEN + $29
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant main::sc#0 = SCREEN
Constant main::$11 = SCREEN+$3e8
Constant print_str_at::at#0 = SCREEN+1
Constant print_str_at::str#0 = main::str
Constant main::$2 = SCREEN+1
Constant print_str_at::str#1 = main::str1
Constant main::$5 = SCREEN+1
Constant print_str_at::str#2 = main::str2
Constant main::$8 = SCREEN+1
Constant print_str_at::str#3 = main::str3
Constant main::i#0 = 0
Constant plot_chargen::ch#0 = $20
Constant plot_chargen::shift#0 = 0
Constant main::cur_pos#0 = 0
Constant main::shift#0 = 0
Constant keyboard_key_pressed::key#0 = KEY_F1
Constant keyboard_key_pressed::key#1 = KEY_F3
Constant main::cur_pos#1 = 0
Constant keyboard_key_pressed::key#2 = KEY_F5
Constant main::cur_pos#2 = 1
Constant keyboard_key_pressed::key#3 = KEY_F7
Constant main::cur_pos#3 = 2
Constant keyboard_key_pressed::key#4 = KEY_LSHIFT
Constant main::cur_pos#4 = 3
Constant main::shift#1 = 1
Constant main::shift#2 = 0
Constant main::ch#0 = 0
Constant main::pressed#0 = 0
Constant plot_chargen::$4 = SCREEN+$29
Constant plot_chargen::y#0 = 0
Constant plot_chargen::x#0 = 0
Constant plot_chargen::c#0 = '.'
Constant plot_chargen::c#1 = '*'
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [114] if(true) goto main::@6
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [44] main::i#1 = ++ main::i#2 to ++
Resolved ranged comparison value [46] if(main::i#1!=rangelast(0,3)) goto main::@4 to 4
Resolved ranged next value [107] main::ch#1 = ++ main::ch#2 to ++
Resolved ranged comparison value [109] if(main::ch#1!=rangelast(0,$3f)) goto main::@13 to $40
Resolved ranged next value [150] plot_chargen::x#1 = ++ plot_chargen::x#2 to ++
Resolved ranged comparison value [152] if(plot_chargen::x#1!=rangelast(0,7)) goto plot_chargen::@4 to 8
Resolved ranged next value [155] plot_chargen::y#1 = ++ plot_chargen::y#2 to ++
Resolved ranged comparison value [157] if(plot_chargen::y#1!=rangelast(0,7)) goto plot_chargen::@3 to 8
Simplifying expression containing zero (char *)CIA1 in [1] *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = keyboard_matrix_row_bitmask[keyboard_matrix_read::rowid#0]
Successful SSA optimization PassNSimplifyExpressionWithZero
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Eliminating unused constant main::shift#0
Eliminating unused constant OFFSET_STRUCT_MOS6526_CIA_PORT_A
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
Adding number conversion cast (unumber) 4 in [29] if(main::i#1!=4) goto main::@4
Adding number conversion cast (unumber) $40 in [69] if(main::ch#1!=$40) goto main::@13
Adding number conversion cast (unumber) 8 in [102] if(plot_chargen::x#1!=8) goto plot_chargen::@4
Adding number conversion cast (unumber) 8 in [105] if(plot_chargen::y#1!=8) goto plot_chargen::@3
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 4
Simplifying constant integer cast $40
Simplifying constant integer cast 8
Simplifying constant integer cast 8
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) $40
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [19] print_str_at::at#1 = main::$2 + $a
Constant right-side identified [21] print_str_at::at#2 = main::$5 + $14
Constant right-side identified [23] print_str_at::at#3 = main::$8 + $1e
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant print_str_at::at#1 = main::$2+$a
Constant print_str_at::at#2 = main::$5+$14
Constant print_str_at::at#3 = main::$8+$1e
Successful SSA optimization Pass2ConstantIdentification
Rewriting multiplication to use shift [81] plot_chargen::$0 = plot_chargen::$15 * 8
Rewriting multiplication to use shift and addition[86] plot_chargen::$5 = plot_chargen::pos#2 * $a
Rewriting multiplication to use shift [97] plot_chargen::bits#1 = plot_chargen::bits#2 * 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings keyboard_key_pressed::key#0
Inlining constant with var siblings keyboard_key_pressed::key#1
Inlining constant with var siblings keyboard_key_pressed::key#2
Inlining constant with var siblings keyboard_key_pressed::key#3
Inlining constant with var siblings keyboard_key_pressed::key#4
Inlining constant with var siblings main::sc#0
Inlining constant with var siblings main::i#0
Inlining constant with var siblings main::cur_pos#0
Inlining constant with var siblings main::cur_pos#1
Inlining constant with var siblings main::cur_pos#2
Inlining constant with var siblings main::cur_pos#3
Inlining constant with var siblings main::cur_pos#4
Inlining constant with var siblings main::shift#1
Inlining constant with var siblings main::shift#2
Inlining constant with var siblings main::ch#0
Inlining constant with var siblings main::pressed#0
Inlining constant with var siblings print_str_at::at#0
Inlining constant with var siblings print_str_at::str#0
Inlining constant with var siblings print_str_at::str#1
Inlining constant with var siblings print_str_at::str#2
Inlining constant with var siblings print_str_at::str#3
Inlining constant with var siblings print_str_at::at#1
Inlining constant with var siblings print_str_at::at#2
Inlining constant with var siblings print_str_at::at#3
Inlining constant with var siblings plot_chargen::ch#0
Inlining constant with var siblings plot_chargen::shift#0
Inlining constant with var siblings plot_chargen::y#0
Inlining constant with var siblings plot_chargen::x#0
Inlining constant with var siblings plot_chargen::c#0
Inlining constant with var siblings plot_chargen::c#1
Constant inlined print_str_at::str#1 = main::str1
Constant inlined main::shift#1 = 1
Constant inlined print_str_at::str#2 = main::str2
Constant inlined print_str_at::at#3 = SCREEN+1+$1e
Constant inlined print_str_at::str#3 = main::str3
Constant inlined print_str_at::at#2 = SCREEN+1+$14
Constant inlined plot_chargen::c#0 = '.'
Constant inlined print_str_at::at#1 = SCREEN+1+$a
Constant inlined plot_chargen::c#1 = '*'
Constant inlined print_str_at::at#0 = SCREEN+1
Constant inlined print_str_at::str#0 = main::str
Constant inlined main::$11 = SCREEN+$3e8
Constant inlined main::shift#2 = 0
Constant inlined main::i#0 = 0
Constant inlined plot_chargen::$4 = SCREEN+$29
Constant inlined plot_chargen::shift#0 = 0
Constant inlined main::ch#0 = 0
Constant inlined keyboard_key_pressed::key#0 = KEY_F1
Constant inlined plot_chargen::ch#0 = $20
Constant inlined keyboard_key_pressed::key#1 = KEY_F3
Constant inlined keyboard_key_pressed::key#4 = KEY_LSHIFT
Constant inlined keyboard_key_pressed::key#2 = KEY_F5
Constant inlined keyboard_key_pressed::key#3 = KEY_F7
Constant inlined main::sc#0 = SCREEN
Constant inlined main::cur_pos#3 = 2
Constant inlined main::cur_pos#4 = 3
Constant inlined main::cur_pos#1 = 0
Constant inlined main::$2 = SCREEN+1
Constant inlined main::cur_pos#2 = 1
Constant inlined main::cur_pos#0 = 0
Constant inlined main::$5 = SCREEN+1
Constant inlined plot_chargen::y#0 = 0
Constant inlined main::$8 = SCREEN+1
Constant inlined main::pressed#0 = 0
Constant inlined plot_chargen::x#0 = 0
Successful SSA optimization Pass2ConstantInlining
Alias plot_chargen::$5 = plot_chargen::$18 
Successful SSA optimization Pass2AliasElimination
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) 8
Successful SSA optimization PassNFinalizeNumberTypeConversions
Added new block during phi lifting main::@37(between main::@28 and main::@4)
Added new block during phi lifting main::@38(between main::@29 and main::@7)
Added new block during phi lifting main::@39(between main::@30 and main::@8)
Added new block during phi lifting main::@40(between main::@31 and main::@9)
Added new block during phi lifting main::@41(between main::@32 and main::@10)
Added new block during phi lifting main::@42(between main::@15 and main::@13)
Added new block during phi lifting plot_chargen::@9(between plot_chargen and plot_chargen::@1)
Added new block during phi lifting plot_chargen::@10(between plot_chargen::@7 and plot_chargen::@3)
Added new block during phi lifting plot_chargen::@11(between plot_chargen::@5 and plot_chargen::@4)
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@24
Adding NOP phi() at start of main::@25
Adding NOP phi() at start of main::@26
Adding NOP phi() at start of main::@27
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of main::@19
Adding NOP phi() at start of main::@20
Adding NOP phi() at start of main::@21
Adding NOP phi() at start of main::@22
Adding NOP phi() at start of main::@23
Adding NOP phi() at start of main::@36
Adding NOP phi() at start of main::@11
Adding NOP phi() at start of plot_chargen::@6
CALL GRAPH
Calls in [main] to print_str_at:4 print_str_at:6 print_str_at:8 print_str_at:10 plot_chargen:15 keyboard_key_pressed:20 keyboard_key_pressed:26 keyboard_key_pressed:32 keyboard_key_pressed:38 keyboard_key_pressed:44 keyboard_get_keycode:52 keyboard_key_pressed:58 plot_chargen:70 
Calls in [keyboard_key_pressed] to keyboard_matrix_read:141 

Created 25 initial phi equivalence classes
Coalesced [14] plot_chargen::pos#6 = plot_chargen::pos#0
Coalesced [57] keyboard_key_pressed::key#7 = keyboard_key_pressed::key#5
Coalesced [61] main::pressed#4 = main::pressed#1
Coalesced [67] plot_chargen::ch#3 = plot_chargen::ch#1
Coalesced [68] plot_chargen::shift#3 = plot_chargen::shift#1
Coalesced [69] plot_chargen::pos#5 = plot_chargen::pos#1
Coalesced [74] main::cur_pos#27 = main::cur_pos#11
Coalesced [75] main::ch#10 = main::ch#1
Coalesced [77] main::cur_pos#31 = main::cur_pos#18
Coalesced [78] main::cur_pos#30 = main::cur_pos#20
Coalesced [79] main::cur_pos#29 = main::cur_pos#22
Coalesced (already) [80] main::cur_pos#28 = main::cur_pos#24
Coalesced [81] main::i#4 = main::i#1
Coalesced [84] main::sc#4 = main::sc#1
Coalesced [86] print_str_at::str#8 = print_str_at::str#7
Coalesced [87] print_str_at::at#8 = print_str_at::at#7
Coalesced [94] print_str_at::str#9 = print_str_at::str#4
Coalesced [95] print_str_at::at#9 = print_str_at::at#4
Coalesced [103] plot_chargen::chargen#10 = plot_chargen::chargen#1
Coalesced [110] plot_chargen::sc#8 = plot_chargen::sc#0
Coalesced [113] plot_chargen::bits#5 = plot_chargen::bits#0
Coalesced [114] plot_chargen::sc#10 = plot_chargen::sc#7
Coalesced [131] plot_chargen::y#7 = plot_chargen::y#1
Coalesced [132] plot_chargen::sc#9 = plot_chargen::sc#2
Coalesced [133] plot_chargen::bits#6 = plot_chargen::bits#1
Coalesced [134] plot_chargen::sc#11 = plot_chargen::sc#1
Coalesced [135] plot_chargen::x#5 = plot_chargen::x#1
Coalesced [136] plot_chargen::chargen#9 = plot_chargen::chargen#0
Coalesced down to 18 phi equivalence classes
Culled Empty Block label main::@27
Culled Empty Block label main::@5
Culled Empty Block label main::@19
Culled Empty Block label main::@20
Culled Empty Block label main::@21
Culled Empty Block label main::@22
Culled Empty Block label main::@23
Culled Empty Block label main::@36
Culled Empty Block label main::@18
Culled Empty Block label main::@42
Culled Empty Block label main::@37
Culled Empty Block label plot_chargen::@10
Culled Empty Block label plot_chargen::@11
Culled Empty Block label plot_chargen::@9
Renumbering block main::@6 to main::@5
Renumbering block main::@7 to main::@6
Renumbering block main::@8 to main::@7
Renumbering block main::@9 to main::@8
Renumbering block main::@10 to main::@9
Renumbering block main::@11 to main::@10
Renumbering block main::@12 to main::@11
Renumbering block main::@13 to main::@12
Renumbering block main::@14 to main::@13
Renumbering block main::@15 to main::@14
Renumbering block main::@16 to main::@15
Renumbering block main::@17 to main::@16
Renumbering block main::@24 to main::@17
Renumbering block main::@25 to main::@18
Renumbering block main::@26 to main::@19
Renumbering block main::@28 to main::@20
Renumbering block main::@29 to main::@21
Renumbering block main::@30 to main::@22
Renumbering block main::@31 to main::@23
Renumbering block main::@32 to main::@24
Renumbering block main::@33 to main::@25
Renumbering block main::@34 to main::@26
Renumbering block main::@35 to main::@27
Renumbering block main::@38 to main::@28
Renumbering block main::@39 to main::@29
Renumbering block main::@40 to main::@30
Renumbering block main::@41 to main::@31
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@17
Adding NOP phi() at start of main::@18
Adding NOP phi() at start of main::@19
Adding NOP phi() at start of main::@28
Adding NOP phi() at start of main::@29
Adding NOP phi() at start of main::@30
Adding NOP phi() at start of main::@31
Adding NOP phi() at start of main::@10
Adding NOP phi() at start of plot_chargen::@6

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] phi()
  to:main::@1
main::@1: scope:[main]  from main main::@2
  [1] main::sc#2 = phi( main/SCREEN, main::@2/main::sc#1 )
  [2] if(main::sc#2<SCREEN+$3e8) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@1
  [3] phi()
  [4] call print_str_at
  to:main::@17
main::@17: scope:[main]  from main::@3
  [5] phi()
  [6] call print_str_at
  to:main::@18
main::@18: scope:[main]  from main::@17
  [7] phi()
  [8] call print_str_at
  to:main::@19
main::@19: scope:[main]  from main::@18
  [9] phi()
  [10] call print_str_at
  to:main::@4
main::@4: scope:[main]  from main::@19 main::@20
  [11] main::i#2 = phi( main::@19/0, main::@20/main::i#1 )
  [12] plot_chargen::pos#0 = main::i#2
  [13] call plot_chargen
  to:main::@20
main::@20: scope:[main]  from main::@4
  [14] main::i#1 = ++ main::i#2
  [15] if(main::i#1!=4) goto main::@4
  to:main::@5
main::@5: scope:[main]  from main::@14 main::@20
  [16] main::cur_pos#24 = phi( main::@14/main::cur_pos#11, main::@20/0 )
  [17] call keyboard_key_pressed
  [18] keyboard_key_pressed::return#2 = keyboard_key_pressed::return#0
  to:main::@21
main::@21: scope:[main]  from main::@5
  [19] main::$15 = keyboard_key_pressed::return#2
  [20] if(main::$15==0) goto main::@28
  to:main::@6
main::@28: scope:[main]  from main::@21
  [21] phi()
  to:main::@6
main::@6: scope:[main]  from main::@21 main::@28
  [22] main::cur_pos#22 = phi( main::@21/0, main::@28/main::cur_pos#24 )
  [23] call keyboard_key_pressed
  [24] keyboard_key_pressed::return#10 = keyboard_key_pressed::return#0
  to:main::@22
main::@22: scope:[main]  from main::@6
  [25] main::$18 = keyboard_key_pressed::return#10
  [26] if(main::$18==0) goto main::@29
  to:main::@7
main::@29: scope:[main]  from main::@22
  [27] phi()
  to:main::@7
main::@7: scope:[main]  from main::@22 main::@29
  [28] main::cur_pos#20 = phi( main::@22/1, main::@29/main::cur_pos#22 )
  [29] call keyboard_key_pressed
  [30] keyboard_key_pressed::return#11 = keyboard_key_pressed::return#0
  to:main::@23
main::@23: scope:[main]  from main::@7
  [31] main::$21 = keyboard_key_pressed::return#11
  [32] if(main::$21==0) goto main::@30
  to:main::@8
main::@30: scope:[main]  from main::@23
  [33] phi()
  to:main::@8
main::@8: scope:[main]  from main::@23 main::@30
  [34] main::cur_pos#18 = phi( main::@23/2, main::@30/main::cur_pos#20 )
  [35] call keyboard_key_pressed
  [36] keyboard_key_pressed::return#12 = keyboard_key_pressed::return#0
  to:main::@24
main::@24: scope:[main]  from main::@8
  [37] main::$24 = keyboard_key_pressed::return#12
  [38] if(main::$24==0) goto main::@31
  to:main::@9
main::@31: scope:[main]  from main::@24
  [39] phi()
  to:main::@9
main::@9: scope:[main]  from main::@24 main::@31
  [40] main::cur_pos#11 = phi( main::@24/3, main::@31/main::cur_pos#18 )
  [41] call keyboard_key_pressed
  [42] keyboard_key_pressed::return#13 = keyboard_key_pressed::return#0
  to:main::@25
main::@25: scope:[main]  from main::@9
  [43] main::$27 = keyboard_key_pressed::return#13
  [44] if(main::$27!=0) goto main::@10
  to:main::@11
main::@10: scope:[main]  from main::@25
  [45] phi()
  to:main::@11
main::@11: scope:[main]  from main::@10 main::@25
  [46] main::shift#9 = phi( main::@10/1, main::@25/0 )
  to:main::@12
main::@12: scope:[main]  from main::@11 main::@14
  [47] main::ch#2 = phi( main::@11/0, main::@14/main::ch#1 )
  [48] keyboard_get_keycode::ch#0 = main::ch#2
  [49] call keyboard_get_keycode
  [50] keyboard_get_keycode::return#2 = keyboard_get_keycode::return#0
  to:main::@26
main::@26: scope:[main]  from main::@12
  [51] main::key#0 = keyboard_get_keycode::return#2
  [52] if(main::key#0==$3f) goto main::@13
  to:main::@15
main::@15: scope:[main]  from main::@26
  [53] keyboard_key_pressed::key#5 = main::key#0
  [54] call keyboard_key_pressed
  [55] keyboard_key_pressed::return#14 = keyboard_key_pressed::return#0
  to:main::@27
main::@27: scope:[main]  from main::@15
  [56] main::pressed#1 = keyboard_key_pressed::return#14
  to:main::@13
main::@13: scope:[main]  from main::@26 main::@27
  [57] main::pressed#2 = phi( main::@26/0, main::@27/main::pressed#1 )
  [58] if(main::pressed#2==0) goto main::@14
  to:main::@16
main::@16: scope:[main]  from main::@13
  [59] plot_chargen::pos#1 = main::cur_pos#11
  [60] plot_chargen::ch#1 = main::ch#2
  [61] plot_chargen::shift#1 = main::shift#9
  [62] call plot_chargen
  to:main::@14
main::@14: scope:[main]  from main::@13 main::@16
  [63] main::ch#1 = ++ main::ch#2
  [64] if(main::ch#1!=$40) goto main::@12
  to:main::@5
main::@2: scope:[main]  from main::@1
  [65] *main::sc#2 = ' '
  [66] main::sc#1 = ++ main::sc#2
  to:main::@1

void print_str_at(char *str , char *at)
print_str_at: scope:[print_str_at]  from main::@17 main::@18 main::@19 main::@3
  [67] print_str_at::at#7 = phi( main::@17/SCREEN+1+$a, main::@18/SCREEN+1+$14, main::@19/SCREEN+1+$1e, main::@3/SCREEN+1 )
  [67] print_str_at::str#7 = phi( main::@17/main::str1, main::@18/main::str2, main::@19/main::str3, main::@3/main::str )
  to:print_str_at::@1
print_str_at::@1: scope:[print_str_at]  from print_str_at print_str_at::@2
  [68] print_str_at::at#5 = phi( print_str_at/print_str_at::at#7, print_str_at::@2/print_str_at::at#4 )
  [68] print_str_at::str#5 = phi( print_str_at/print_str_at::str#7, print_str_at::@2/print_str_at::str#4 )
  [69] if(0!=*print_str_at::str#5) goto print_str_at::@2
  to:print_str_at::@return
print_str_at::@return: scope:[print_str_at]  from print_str_at::@1
  [70] return 
  to:@return
print_str_at::@2: scope:[print_str_at]  from print_str_at::@1
  [71] *print_str_at::at#5 = *print_str_at::str#5
  [72] print_str_at::at#4 = ++ print_str_at::at#5
  [73] print_str_at::str#4 = ++ print_str_at::str#5
  to:print_str_at::@1

void plot_chargen(char pos , char ch , char shift)
plot_chargen: scope:[plot_chargen]  from main::@16 main::@4
  [74] plot_chargen::pos#2 = phi( main::@16/plot_chargen::pos#1, main::@4/plot_chargen::pos#0 )
  [74] plot_chargen::shift#2 = phi( main::@16/plot_chargen::shift#1, main::@4/0 )
  [74] plot_chargen::ch#2 = phi( main::@16/plot_chargen::ch#1, main::@4/$20 )
  asm { sei  }
  [76] plot_chargen::$15 = (unsigned int)plot_chargen::ch#2
  [77] plot_chargen::$0 = plot_chargen::$15 << 3
  [78] plot_chargen::chargen#0 = CHARGEN + plot_chargen::$0
  [79] if(plot_chargen::shift#2==0) goto plot_chargen::@1
  to:plot_chargen::@2
plot_chargen::@2: scope:[plot_chargen]  from plot_chargen
  [80] plot_chargen::chargen#1 = plot_chargen::chargen#0 + $800
  to:plot_chargen::@1
plot_chargen::@1: scope:[plot_chargen]  from plot_chargen plot_chargen::@2
  [81] plot_chargen::chargen#4 = phi( plot_chargen/plot_chargen::chargen#0, plot_chargen::@2/plot_chargen::chargen#1 )
  [82] *PROCPORT = $32
  [83] plot_chargen::$16 = plot_chargen::pos#2 << 2
  [84] plot_chargen::$17 = plot_chargen::$16 + plot_chargen::pos#2
  [85] plot_chargen::$5 = plot_chargen::$17 << 1
  [86] plot_chargen::sc#0 = SCREEN+$29 + plot_chargen::$5
  to:plot_chargen::@3
plot_chargen::@3: scope:[plot_chargen]  from plot_chargen::@1 plot_chargen::@7
  [87] plot_chargen::sc#7 = phi( plot_chargen::@1/plot_chargen::sc#0, plot_chargen::@7/plot_chargen::sc#2 )
  [87] plot_chargen::y#2 = phi( plot_chargen::@1/0, plot_chargen::@7/plot_chargen::y#1 )
  [88] plot_chargen::bits#0 = plot_chargen::chargen#4[plot_chargen::y#2]
  to:plot_chargen::@4
plot_chargen::@4: scope:[plot_chargen]  from plot_chargen::@3 plot_chargen::@5
  [89] plot_chargen::x#2 = phi( plot_chargen::@3/0, plot_chargen::@5/plot_chargen::x#1 )
  [89] plot_chargen::sc#3 = phi( plot_chargen::@3/plot_chargen::sc#7, plot_chargen::@5/plot_chargen::sc#1 )
  [89] plot_chargen::bits#2 = phi( plot_chargen::@3/plot_chargen::bits#0, plot_chargen::@5/plot_chargen::bits#1 )
  [90] plot_chargen::$8 = plot_chargen::bits#2 & $80
  [91] if(plot_chargen::$8==0) goto plot_chargen::@5
  to:plot_chargen::@6
plot_chargen::@6: scope:[plot_chargen]  from plot_chargen::@4
  [92] phi()
  to:plot_chargen::@5
plot_chargen::@5: scope:[plot_chargen]  from plot_chargen::@4 plot_chargen::@6
  [93] plot_chargen::c#2 = phi( plot_chargen::@4/'.', plot_chargen::@6/'*' )
  [94] *plot_chargen::sc#3 = plot_chargen::c#2
  [95] plot_chargen::sc#1 = ++ plot_chargen::sc#3
  [96] plot_chargen::bits#1 = plot_chargen::bits#2 << 1
  [97] plot_chargen::x#1 = ++ plot_chargen::x#2
  [98] if(plot_chargen::x#1!=8) goto plot_chargen::@4
  to:plot_chargen::@7
plot_chargen::@7: scope:[plot_chargen]  from plot_chargen::@5
  [99] plot_chargen::sc#2 = plot_chargen::sc#1 + $20
  [100] plot_chargen::y#1 = ++ plot_chargen::y#2
  [101] if(plot_chargen::y#1!=8) goto plot_chargen::@3
  to:plot_chargen::@8
plot_chargen::@8: scope:[plot_chargen]  from plot_chargen::@7
  [102] *PROCPORT = $37
  asm { cli  }
  to:plot_chargen::@return
plot_chargen::@return: scope:[plot_chargen]  from plot_chargen::@8
  [104] return 
  to:@return

char keyboard_key_pressed(char key)
keyboard_key_pressed: scope:[keyboard_key_pressed]  from main::@15 main::@5 main::@6 main::@7 main::@8 main::@9
  [105] keyboard_key_pressed::key#6 = phi( main::@9/KEY_LSHIFT, main::@15/keyboard_key_pressed::key#5, main::@5/KEY_F1, main::@6/KEY_F3, main::@7/KEY_F5, main::@8/KEY_F7 )
  [106] keyboard_key_pressed::colidx#0 = keyboard_key_pressed::key#6 & 7
  [107] keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#6 >> 3
  [108] keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0
  [109] call keyboard_matrix_read
  [110] keyboard_matrix_read::return#2 = keyboard_matrix_read::return#0
  to:keyboard_key_pressed::@1
keyboard_key_pressed::@1: scope:[keyboard_key_pressed]  from keyboard_key_pressed
  [111] keyboard_key_pressed::$2 = keyboard_matrix_read::return#2
  [112] keyboard_key_pressed::return#0 = keyboard_key_pressed::$2 & keyboard_matrix_col_bitmask[keyboard_key_pressed::colidx#0]
  to:keyboard_key_pressed::@return
keyboard_key_pressed::@return: scope:[keyboard_key_pressed]  from keyboard_key_pressed::@1
  [113] return 
  to:@return

char keyboard_get_keycode(char ch)
keyboard_get_keycode: scope:[keyboard_get_keycode]  from main::@12
  [114] keyboard_get_keycode::return#0 = keyboard_char_keycodes[keyboard_get_keycode::ch#0]
  to:keyboard_get_keycode::@return
keyboard_get_keycode::@return: scope:[keyboard_get_keycode]  from keyboard_get_keycode
  [115] return 
  to:@return

char keyboard_matrix_read(char rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read]  from keyboard_key_pressed
  [116] *((char *)CIA1) = keyboard_matrix_row_bitmask[keyboard_matrix_read::rowid#0]
  [117] keyboard_matrix_read::return#0 = ~ *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B)
  to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read]  from keyboard_matrix_read
  [118] return 
  to:@return


VARIABLE REGISTER WEIGHTS
char keyboard_get_keycode(char ch)
char keyboard_get_keycode::ch
char keyboard_get_keycode::ch#0 // 1102.0
char keyboard_get_keycode::return
char keyboard_get_keycode::return#0 // 367.33333333333337
char keyboard_get_keycode::return#2 // 202.0
char keyboard_key_pressed(char key)
char keyboard_key_pressed::$2 // 2002.0
char keyboard_key_pressed::colidx
char keyboard_key_pressed::colidx#0 // 333.6666666666667
char keyboard_key_pressed::key
char keyboard_key_pressed::key#5 // 202.0
char keyboard_key_pressed::key#6 // 1051.5
char keyboard_key_pressed::return
char keyboard_key_pressed::return#0 // 144.625
char keyboard_key_pressed::return#10 // 22.0
char keyboard_key_pressed::return#11 // 22.0
char keyboard_key_pressed::return#12 // 22.0
char keyboard_key_pressed::return#13 // 22.0
char keyboard_key_pressed::return#14 // 202.0
char keyboard_key_pressed::return#2 // 22.0
char keyboard_key_pressed::rowidx
char keyboard_key_pressed::rowidx#0 // 2002.0
char keyboard_matrix_read(char rowid)
char keyboard_matrix_read::return
char keyboard_matrix_read::return#0 // 3667.333333333333
char keyboard_matrix_read::return#2 // 2002.0
char keyboard_matrix_read::row_pressed_bits
char keyboard_matrix_read::rowid
char keyboard_matrix_read::rowid#0 // 11002.0
void main()
char main::$15 // 22.0
char main::$18 // 22.0
char main::$21 // 22.0
char main::$24 // 22.0
char main::$27 // 22.0
char main::ch
char main::ch#1 // 151.5
char main::ch#2 // 25.25
char main::cur_pos
char main::cur_pos#11 // 8.52
char main::cur_pos#18 // 3.6666666666666665
char main::cur_pos#20 // 3.6666666666666665
char main::cur_pos#22 // 3.6666666666666665
char main::cur_pos#24 // 18.666666666666664
char main::i
char main::i#1 // 16.5
char main::i#2 // 11.0
char main::key
char main::key#0 // 151.5
char main::pressed
char main::pressed#1 // 202.0
char main::pressed#2 // 202.0
char *main::sc
char *main::sc#1 // 22.0
char *main::sc#2 // 14.666666666666666
char main::shift
char main::shift#9 // 5.315789473684211
void plot_chargen(char pos , char ch , char shift)
unsigned int plot_chargen::$0 // 2002.0
unsigned int plot_chargen::$15 // 2002.0
char plot_chargen::$16 // 2002.0
char plot_chargen::$17 // 2002.0
char plot_chargen::$5 // 2002.0
char plot_chargen::$8 // 2.0000002E7
char plot_chargen::bits
char plot_chargen::bits#0 // 2000002.0
char plot_chargen::bits#1 // 6666667.333333333
char plot_chargen::bits#2 // 4428572.0
char plot_chargen::c
char plot_chargen::c#2 // 1.0000001E7
char plot_chargen::ch
char plot_chargen::ch#1 // 101.0
char plot_chargen::ch#2 // 50.5
char *plot_chargen::chargen
char *plot_chargen::chargen#0 // 1501.5
char *plot_chargen::chargen#1 // 2002.0
char *plot_chargen::chargen#4 // 47714.42857142857
char plot_chargen::pos
char plot_chargen::pos#0 // 22.0
char plot_chargen::pos#1 // 67.33333333333333
char plot_chargen::pos#2 // 211.39999999999998
char *plot_chargen::sc
char *plot_chargen::sc#0 // 2002.0
char *plot_chargen::sc#1 // 5250000.75
char *plot_chargen::sc#2 // 666667.3333333334
char *plot_chargen::sc#3 // 5166667.333333333
char *plot_chargen::sc#7 // 1000501.5
char plot_chargen::shift
char plot_chargen::shift#1 // 202.0
char plot_chargen::shift#2 // 220.39999999999998
char plot_chargen::x
char plot_chargen::x#1 // 1.50000015E7
char plot_chargen::x#2 // 2500000.25
char plot_chargen::y
char plot_chargen::y#1 // 1500001.5
char plot_chargen::y#2 // 230769.46153846153
void print_str_at(char *str , char *at)
char *print_str_at::at
char *print_str_at::at#4 // 101.0
char *print_str_at::at#5 // 104.66666666666666
char *print_str_at::at#7 // 11.0
char *print_str_at::str
char *print_str_at::str#4 // 202.0
char *print_str_at::str#5 // 103.75
char *print_str_at::str#7 // 11.0

Initial phi equivalence classes
[ main::sc#2 main::sc#1 ]
[ main::i#2 main::i#1 ]
[ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ]
[ main::shift#9 ]
[ main::ch#2 main::ch#1 ]
[ main::pressed#2 main::pressed#1 ]
[ print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ]
[ print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ]
[ plot_chargen::ch#2 plot_chargen::ch#1 ]
[ plot_chargen::shift#2 plot_chargen::shift#1 ]
[ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ]
[ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 ]
[ plot_chargen::y#2 plot_chargen::y#1 ]
[ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ]
[ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 ]
[ plot_chargen::x#2 plot_chargen::x#1 ]
[ plot_chargen::c#2 ]
[ keyboard_key_pressed::key#6 keyboard_key_pressed::key#5 ]
Added variable keyboard_key_pressed::return#2 to live range equivalence class [ keyboard_key_pressed::return#2 ]
Added variable main::$15 to live range equivalence class [ main::$15 ]
Added variable keyboard_key_pressed::return#10 to live range equivalence class [ keyboard_key_pressed::return#10 ]
Added variable main::$18 to live range equivalence class [ main::$18 ]
Added variable keyboard_key_pressed::return#11 to live range equivalence class [ keyboard_key_pressed::return#11 ]
Added variable main::$21 to live range equivalence class [ main::$21 ]
Added variable keyboard_key_pressed::return#12 to live range equivalence class [ keyboard_key_pressed::return#12 ]
Added variable main::$24 to live range equivalence class [ main::$24 ]
Added variable keyboard_key_pressed::return#13 to live range equivalence class [ keyboard_key_pressed::return#13 ]
Added variable main::$27 to live range equivalence class [ main::$27 ]
Added variable keyboard_get_keycode::ch#0 to live range equivalence class [ keyboard_get_keycode::ch#0 ]
Added variable keyboard_get_keycode::return#2 to live range equivalence class [ keyboard_get_keycode::return#2 ]
Added variable main::key#0 to live range equivalence class [ main::key#0 ]
Added variable keyboard_key_pressed::return#14 to live range equivalence class [ keyboard_key_pressed::return#14 ]
Added variable plot_chargen::$15 to live range equivalence class [ plot_chargen::$15 ]
Added variable plot_chargen::$0 to live range equivalence class [ plot_chargen::$0 ]
Added variable plot_chargen::$16 to live range equivalence class [ plot_chargen::$16 ]
Added variable plot_chargen::$17 to live range equivalence class [ plot_chargen::$17 ]
Added variable plot_chargen::$5 to live range equivalence class [ plot_chargen::$5 ]
Added variable plot_chargen::$8 to live range equivalence class [ plot_chargen::$8 ]
Added variable keyboard_key_pressed::colidx#0 to live range equivalence class [ keyboard_key_pressed::colidx#0 ]
Added variable keyboard_key_pressed::rowidx#0 to live range equivalence class [ keyboard_key_pressed::rowidx#0 ]
Added variable keyboard_matrix_read::rowid#0 to live range equivalence class [ keyboard_matrix_read::rowid#0 ]
Added variable keyboard_matrix_read::return#2 to live range equivalence class [ keyboard_matrix_read::return#2 ]
Added variable keyboard_key_pressed::$2 to live range equivalence class [ keyboard_key_pressed::$2 ]
Added variable keyboard_key_pressed::return#0 to live range equivalence class [ keyboard_key_pressed::return#0 ]
Added variable keyboard_get_keycode::return#0 to live range equivalence class [ keyboard_get_keycode::return#0 ]
Added variable keyboard_matrix_read::return#0 to live range equivalence class [ keyboard_matrix_read::return#0 ]
Complete equivalence classes
[ main::sc#2 main::sc#1 ]
[ main::i#2 main::i#1 ]
[ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ]
[ main::shift#9 ]
[ main::ch#2 main::ch#1 ]
[ main::pressed#2 main::pressed#1 ]
[ print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ]
[ print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ]
[ plot_chargen::ch#2 plot_chargen::ch#1 ]
[ plot_chargen::shift#2 plot_chargen::shift#1 ]
[ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ]
[ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 ]
[ plot_chargen::y#2 plot_chargen::y#1 ]
[ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ]
[ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 ]
[ plot_chargen::x#2 plot_chargen::x#1 ]
[ plot_chargen::c#2 ]
[ keyboard_key_pressed::key#6 keyboard_key_pressed::key#5 ]
[ keyboard_key_pressed::return#2 ]
[ main::$15 ]
[ keyboard_key_pressed::return#10 ]
[ main::$18 ]
[ keyboard_key_pressed::return#11 ]
[ main::$21 ]
[ keyboard_key_pressed::return#12 ]
[ main::$24 ]
[ keyboard_key_pressed::return#13 ]
[ main::$27 ]
[ keyboard_get_keycode::ch#0 ]
[ keyboard_get_keycode::return#2 ]
[ main::key#0 ]
[ keyboard_key_pressed::return#14 ]
[ plot_chargen::$15 ]
[ plot_chargen::$0 ]
[ plot_chargen::$16 ]
[ plot_chargen::$17 ]
[ plot_chargen::$5 ]
[ plot_chargen::$8 ]
[ keyboard_key_pressed::colidx#0 ]
[ keyboard_key_pressed::rowidx#0 ]
[ keyboard_matrix_read::rowid#0 ]
[ keyboard_matrix_read::return#2 ]
[ keyboard_key_pressed::$2 ]
[ keyboard_key_pressed::return#0 ]
[ keyboard_get_keycode::return#0 ]
[ keyboard_matrix_read::return#0 ]
Allocated zp[2]:2 [ main::sc#2 main::sc#1 ]
Allocated zp[1]:4 [ main::i#2 main::i#1 ]
Allocated zp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ]
Allocated zp[1]:6 [ main::shift#9 ]
Allocated zp[1]:7 [ main::ch#2 main::ch#1 ]
Allocated zp[1]:8 [ main::pressed#2 main::pressed#1 ]
Allocated zp[2]:9 [ print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ]
Allocated zp[2]:11 [ print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ]
Allocated zp[1]:13 [ plot_chargen::ch#2 plot_chargen::ch#1 ]
Allocated zp[1]:14 [ plot_chargen::shift#2 plot_chargen::shift#1 ]
Allocated zp[1]:15 [ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ]
Allocated zp[2]:16 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 ]
Allocated zp[1]:18 [ plot_chargen::y#2 plot_chargen::y#1 ]
Allocated zp[1]:19 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ]
Allocated zp[2]:20 [ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 ]
Allocated zp[1]:22 [ plot_chargen::x#2 plot_chargen::x#1 ]
Allocated zp[1]:23 [ plot_chargen::c#2 ]
Allocated zp[1]:24 [ keyboard_key_pressed::key#6 keyboard_key_pressed::key#5 ]
Allocated zp[1]:25 [ keyboard_key_pressed::return#2 ]
Allocated zp[1]:26 [ main::$15 ]
Allocated zp[1]:27 [ keyboard_key_pressed::return#10 ]
Allocated zp[1]:28 [ main::$18 ]
Allocated zp[1]:29 [ keyboard_key_pressed::return#11 ]
Allocated zp[1]:30 [ main::$21 ]
Allocated zp[1]:31 [ keyboard_key_pressed::return#12 ]
Allocated zp[1]:32 [ main::$24 ]
Allocated zp[1]:33 [ keyboard_key_pressed::return#13 ]
Allocated zp[1]:34 [ main::$27 ]
Allocated zp[1]:35 [ keyboard_get_keycode::ch#0 ]
Allocated zp[1]:36 [ keyboard_get_keycode::return#2 ]
Allocated zp[1]:37 [ main::key#0 ]
Allocated zp[1]:38 [ keyboard_key_pressed::return#14 ]
Allocated zp[2]:39 [ plot_chargen::$15 ]
Allocated zp[2]:41 [ plot_chargen::$0 ]
Allocated zp[1]:43 [ plot_chargen::$16 ]
Allocated zp[1]:44 [ plot_chargen::$17 ]
Allocated zp[1]:45 [ plot_chargen::$5 ]
Allocated zp[1]:46 [ plot_chargen::$8 ]
Allocated zp[1]:47 [ keyboard_key_pressed::colidx#0 ]
Allocated zp[1]:48 [ keyboard_key_pressed::rowidx#0 ]
Allocated zp[1]:49 [ keyboard_matrix_read::rowid#0 ]
Allocated zp[1]:50 [ keyboard_matrix_read::return#2 ]
Allocated zp[1]:51 [ keyboard_key_pressed::$2 ]
Allocated zp[1]:52 [ keyboard_key_pressed::return#0 ]
Allocated zp[1]:53 [ keyboard_get_keycode::return#0 ]
Allocated zp[1]:54 [ keyboard_matrix_read::return#0 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [2] if(main::sc#2<SCREEN+$3e8) goto main::@2 [ main::sc#2 ] (  [ main::sc#2 ] { }  ) always clobbers reg byte a 
Statement [65] *main::sc#2 = ' ' [ main::sc#2 ] (  [ main::sc#2 ] { }  ) always clobbers reg byte a reg byte y 
Statement [69] if(0!=*print_str_at::str#5) goto print_str_at::@2 [ print_str_at::str#5 print_str_at::at#5 ] ( print_str_at:4 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:6 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:8 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:10 [ print_str_at::str#5 print_str_at::at#5 ] { }  ) always clobbers reg byte a reg byte y 
Statement [71] *print_str_at::at#5 = *print_str_at::str#5 [ print_str_at::str#5 print_str_at::at#5 ] ( print_str_at:4 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:6 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:8 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:10 [ print_str_at::str#5 print_str_at::at#5 ] { }  ) always clobbers reg byte a reg byte y 
Statement [76] plot_chargen::$15 = (unsigned int)plot_chargen::ch#2 [ plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$15 ] ( plot_chargen:13 [ main::i#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$15 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$15 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:4 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:14 [ plot_chargen::shift#2 plot_chargen::shift#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:15 [ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ]
Removing always clobbered register reg byte a as potential for zp[1]:6 [ main::shift#9 ]
Removing always clobbered register reg byte a as potential for zp[1]:7 [ main::ch#2 main::ch#1 ]
Statement [77] plot_chargen::$0 = plot_chargen::$15 << 3 [ plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$0 ] ( plot_chargen:13 [ main::i#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$0 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$0 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [78] plot_chargen::chargen#0 = CHARGEN + plot_chargen::$0 [ plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::chargen#0 ] ( plot_chargen:13 [ main::i#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::chargen#0 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::chargen#0 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [80] plot_chargen::chargen#1 = plot_chargen::chargen#0 + $800 [ plot_chargen::pos#2 plot_chargen::chargen#1 ] ( plot_chargen:13 [ main::i#2 plot_chargen::pos#2 plot_chargen::chargen#1 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::pos#2 plot_chargen::chargen#1 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [82] *PROCPORT = $32 [ plot_chargen::pos#2 plot_chargen::chargen#4 ] ( plot_chargen:13 [ main::i#2 plot_chargen::pos#2 plot_chargen::chargen#4 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::pos#2 plot_chargen::chargen#4 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [83] plot_chargen::$16 = plot_chargen::pos#2 << 2 [ plot_chargen::pos#2 plot_chargen::chargen#4 plot_chargen::$16 ] ( plot_chargen:13 [ main::i#2 plot_chargen::pos#2 plot_chargen::chargen#4 plot_chargen::$16 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::pos#2 plot_chargen::chargen#4 plot_chargen::$16 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [84] plot_chargen::$17 = plot_chargen::$16 + plot_chargen::pos#2 [ plot_chargen::chargen#4 plot_chargen::$17 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::$17 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::$17 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [85] plot_chargen::$5 = plot_chargen::$17 << 1 [ plot_chargen::chargen#4 plot_chargen::$5 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::$5 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::$5 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [86] plot_chargen::sc#0 = SCREEN+$29 + plot_chargen::$5 [ plot_chargen::chargen#4 plot_chargen::sc#0 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::sc#0 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::sc#0 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [88] plot_chargen::bits#0 = plot_chargen::chargen#4[plot_chargen::y#2] [ plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#7 plot_chargen::bits#0 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#7 plot_chargen::bits#0 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#7 plot_chargen::bits#0 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:18 [ plot_chargen::y#2 plot_chargen::y#1 ]
Statement [94] *plot_chargen::sc#3 = plot_chargen::c#2 [ plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::bits#2 plot_chargen::sc#3 plot_chargen::x#2 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::bits#2 plot_chargen::sc#3 plot_chargen::x#2 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::bits#2 plot_chargen::sc#3 plot_chargen::x#2 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte y 
Removing always clobbered register reg byte y as potential for zp[1]:4 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:18 [ plot_chargen::y#2 plot_chargen::y#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:19 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:22 [ plot_chargen::x#2 plot_chargen::x#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ]
Removing always clobbered register reg byte y as potential for zp[1]:6 [ main::shift#9 ]
Removing always clobbered register reg byte y as potential for zp[1]:7 [ main::ch#2 main::ch#1 ]
Statement [99] plot_chargen::sc#2 = plot_chargen::sc#1 + $20 [ plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#2 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#2 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#2 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [102] *PROCPORT = $37 [ ] ( plot_chargen:13 [ main::i#2 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [107] keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#6 >> 3 [ keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] ( keyboard_key_pressed:17 [ main::cur_pos#24 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:23 [ main::cur_pos#22 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#10 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:29 [ main::cur_pos#20 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#11 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:35 [ main::cur_pos#18 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#12 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:41 [ main::cur_pos#11 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#13 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:54 [ main::cur_pos#11 main::shift#9 main::ch#2 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::key#5 = keyboard_key_pressed::key#6 main::key#0 } { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#14 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  ) always clobbers reg byte a 
Removing always clobbered register reg byte a as potential for zp[1]:47 [ keyboard_key_pressed::colidx#0 ]
Statement [116] *((char *)CIA1) = keyboard_matrix_row_bitmask[keyboard_matrix_read::rowid#0] [ ] ( keyboard_key_pressed:17::keyboard_matrix_read:109 [ main::cur_pos#24 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:23::keyboard_matrix_read:109 [ main::cur_pos#22 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#10 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:29::keyboard_matrix_read:109 [ main::cur_pos#20 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#11 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:35::keyboard_matrix_read:109 [ main::cur_pos#18 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#12 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:41::keyboard_matrix_read:109 [ main::cur_pos#11 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#13 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:54::keyboard_matrix_read:109 [ main::cur_pos#11 main::shift#9 main::ch#2 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::key#5 = keyboard_key_pressed::key#6 main::key#0 } { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#14 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  ) always clobbers reg byte a 
Statement [117] keyboard_matrix_read::return#0 = ~ *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( keyboard_key_pressed:17::keyboard_matrix_read:109 [ main::cur_pos#24 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:23::keyboard_matrix_read:109 [ main::cur_pos#22 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#10 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:29::keyboard_matrix_read:109 [ main::cur_pos#20 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#11 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:35::keyboard_matrix_read:109 [ main::cur_pos#18 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#12 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:41::keyboard_matrix_read:109 [ main::cur_pos#11 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#13 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:54::keyboard_matrix_read:109 [ main::cur_pos#11 main::shift#9 main::ch#2 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::key#5 = keyboard_key_pressed::key#6 main::key#0 } { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#14 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  ) always clobbers reg byte a 
Statement [2] if(main::sc#2<SCREEN+$3e8) goto main::@2 [ main::sc#2 ] (  [ main::sc#2 ] { }  ) always clobbers reg byte a 
Statement [65] *main::sc#2 = ' ' [ main::sc#2 ] (  [ main::sc#2 ] { }  ) always clobbers reg byte a reg byte y 
Statement [69] if(0!=*print_str_at::str#5) goto print_str_at::@2 [ print_str_at::str#5 print_str_at::at#5 ] ( print_str_at:4 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:6 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:8 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:10 [ print_str_at::str#5 print_str_at::at#5 ] { }  ) always clobbers reg byte a reg byte y 
Statement [71] *print_str_at::at#5 = *print_str_at::str#5 [ print_str_at::str#5 print_str_at::at#5 ] ( print_str_at:4 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:6 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:8 [ print_str_at::str#5 print_str_at::at#5 ] { }  print_str_at:10 [ print_str_at::str#5 print_str_at::at#5 ] { }  ) always clobbers reg byte a reg byte y 
Statement [76] plot_chargen::$15 = (unsigned int)plot_chargen::ch#2 [ plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$15 ] ( plot_chargen:13 [ main::i#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$15 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$15 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [77] plot_chargen::$0 = plot_chargen::$15 << 3 [ plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$0 ] ( plot_chargen:13 [ main::i#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$0 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::$0 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [78] plot_chargen::chargen#0 = CHARGEN + plot_chargen::$0 [ plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::chargen#0 ] ( plot_chargen:13 [ main::i#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::chargen#0 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::shift#2 plot_chargen::pos#2 plot_chargen::chargen#0 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [80] plot_chargen::chargen#1 = plot_chargen::chargen#0 + $800 [ plot_chargen::pos#2 plot_chargen::chargen#1 ] ( plot_chargen:13 [ main::i#2 plot_chargen::pos#2 plot_chargen::chargen#1 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::pos#2 plot_chargen::chargen#1 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [82] *PROCPORT = $32 [ plot_chargen::pos#2 plot_chargen::chargen#4 ] ( plot_chargen:13 [ main::i#2 plot_chargen::pos#2 plot_chargen::chargen#4 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::pos#2 plot_chargen::chargen#4 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [83] plot_chargen::$16 = plot_chargen::pos#2 << 2 [ plot_chargen::pos#2 plot_chargen::chargen#4 plot_chargen::$16 ] ( plot_chargen:13 [ main::i#2 plot_chargen::pos#2 plot_chargen::chargen#4 plot_chargen::$16 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::pos#2 plot_chargen::chargen#4 plot_chargen::$16 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [84] plot_chargen::$17 = plot_chargen::$16 + plot_chargen::pos#2 [ plot_chargen::chargen#4 plot_chargen::$17 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::$17 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::$17 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [85] plot_chargen::$5 = plot_chargen::$17 << 1 [ plot_chargen::chargen#4 plot_chargen::$5 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::$5 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::$5 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [86] plot_chargen::sc#0 = SCREEN+$29 + plot_chargen::$5 [ plot_chargen::chargen#4 plot_chargen::sc#0 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::sc#0 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::sc#0 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [88] plot_chargen::bits#0 = plot_chargen::chargen#4[plot_chargen::y#2] [ plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#7 plot_chargen::bits#0 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#7 plot_chargen::bits#0 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#7 plot_chargen::bits#0 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a reg byte y 
Statement [94] *plot_chargen::sc#3 = plot_chargen::c#2 [ plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::bits#2 plot_chargen::sc#3 plot_chargen::x#2 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::bits#2 plot_chargen::sc#3 plot_chargen::x#2 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::bits#2 plot_chargen::sc#3 plot_chargen::x#2 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte y 
Statement [99] plot_chargen::sc#2 = plot_chargen::sc#1 + $20 [ plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#2 ] ( plot_chargen:13 [ main::i#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#2 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 plot_chargen::chargen#4 plot_chargen::y#2 plot_chargen::sc#2 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [102] *PROCPORT = $37 [ ] ( plot_chargen:13 [ main::i#2 ] { { plot_chargen::pos#0 = plot_chargen::pos#2 main::i#2 } }  plot_chargen:62 [ main::cur_pos#11 main::shift#9 main::ch#2 ] { { plot_chargen::ch#1 = plot_chargen::ch#2 main::ch#2 } { plot_chargen::shift#1 = plot_chargen::shift#2 main::shift#9 } { plot_chargen::pos#1 = plot_chargen::pos#2 main::cur_pos#11 } }  ) always clobbers reg byte a 
Statement [107] keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#6 >> 3 [ keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] ( keyboard_key_pressed:17 [ main::cur_pos#24 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:23 [ main::cur_pos#22 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#10 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:29 [ main::cur_pos#20 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#11 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:35 [ main::cur_pos#18 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#12 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:41 [ main::cur_pos#11 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#13 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:54 [ main::cur_pos#11 main::shift#9 main::ch#2 keyboard_key_pressed::colidx#0 keyboard_key_pressed::rowidx#0 ] { { keyboard_key_pressed::key#5 = keyboard_key_pressed::key#6 main::key#0 } { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#14 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  ) always clobbers reg byte a 
Statement [116] *((char *)CIA1) = keyboard_matrix_row_bitmask[keyboard_matrix_read::rowid#0] [ ] ( keyboard_key_pressed:17::keyboard_matrix_read:109 [ main::cur_pos#24 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:23::keyboard_matrix_read:109 [ main::cur_pos#22 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#10 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:29::keyboard_matrix_read:109 [ main::cur_pos#20 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#11 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:35::keyboard_matrix_read:109 [ main::cur_pos#18 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#12 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:41::keyboard_matrix_read:109 [ main::cur_pos#11 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#13 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:54::keyboard_matrix_read:109 [ main::cur_pos#11 main::shift#9 main::ch#2 keyboard_key_pressed::colidx#0 ] { { keyboard_key_pressed::key#5 = keyboard_key_pressed::key#6 main::key#0 } { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#14 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  ) always clobbers reg byte a 
Statement [117] keyboard_matrix_read::return#0 = ~ *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( keyboard_key_pressed:17::keyboard_matrix_read:109 [ main::cur_pos#24 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:23::keyboard_matrix_read:109 [ main::cur_pos#22 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#10 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:29::keyboard_matrix_read:109 [ main::cur_pos#20 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#11 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:35::keyboard_matrix_read:109 [ main::cur_pos#18 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#12 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:41::keyboard_matrix_read:109 [ main::cur_pos#11 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#13 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  keyboard_key_pressed:54::keyboard_matrix_read:109 [ main::cur_pos#11 main::shift#9 main::ch#2 keyboard_key_pressed::colidx#0 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::key#5 = keyboard_key_pressed::key#6 main::key#0 } { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#14 } { keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } }  ) always clobbers reg byte a 
Potential registers zp[2]:2 [ main::sc#2 main::sc#1 ] : zp[2]:2 , 
Potential registers zp[1]:4 [ main::i#2 main::i#1 ] : zp[1]:4 , reg byte x , 
Potential registers zp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ] : zp[1]:5 , reg byte x , 
Potential registers zp[1]:6 [ main::shift#9 ] : zp[1]:6 , reg byte x , 
Potential registers zp[1]:7 [ main::ch#2 main::ch#1 ] : zp[1]:7 , reg byte x , 
Potential registers zp[1]:8 [ main::pressed#2 main::pressed#1 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:9 [ print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ] : zp[2]:9 , 
Potential registers zp[2]:11 [ print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ] : zp[2]:11 , 
Potential registers zp[1]:13 [ plot_chargen::ch#2 plot_chargen::ch#1 ] : zp[1]:13 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:14 [ plot_chargen::shift#2 plot_chargen::shift#1 ] : zp[1]:14 , reg byte x , reg byte y , 
Potential registers zp[1]:15 [ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ] : zp[1]:15 , reg byte x , reg byte y , 
Potential registers zp[2]:16 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 ] : zp[2]:16 , 
Potential registers zp[1]:18 [ plot_chargen::y#2 plot_chargen::y#1 ] : zp[1]:18 , reg byte x , 
Potential registers zp[1]:19 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ] : zp[1]:19 , reg byte a , reg byte x , 
Potential registers zp[2]:20 [ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 ] : zp[2]:20 , 
Potential registers zp[1]:22 [ plot_chargen::x#2 plot_chargen::x#1 ] : zp[1]:22 , reg byte a , reg byte x , 
Potential registers zp[1]:23 [ plot_chargen::c#2 ] : zp[1]:23 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:24 [ keyboard_key_pressed::key#6 keyboard_key_pressed::key#5 ] : zp[1]:24 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:25 [ keyboard_key_pressed::return#2 ] : zp[1]:25 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:26 [ main::$15 ] : zp[1]:26 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:27 [ keyboard_key_pressed::return#10 ] : zp[1]:27 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:28 [ main::$18 ] : zp[1]:28 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:29 [ keyboard_key_pressed::return#11 ] : zp[1]:29 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:30 [ main::$21 ] : zp[1]:30 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:31 [ keyboard_key_pressed::return#12 ] : zp[1]:31 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:32 [ main::$24 ] : zp[1]:32 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:33 [ keyboard_key_pressed::return#13 ] : zp[1]:33 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:34 [ main::$27 ] : zp[1]:34 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:35 [ keyboard_get_keycode::ch#0 ] : zp[1]:35 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:36 [ keyboard_get_keycode::return#2 ] : zp[1]:36 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:37 [ main::key#0 ] : zp[1]:37 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:38 [ keyboard_key_pressed::return#14 ] : zp[1]:38 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[2]:39 [ plot_chargen::$15 ] : zp[2]:39 , 
Potential registers zp[2]:41 [ plot_chargen::$0 ] : zp[2]:41 , 
Potential registers zp[1]:43 [ plot_chargen::$16 ] : zp[1]:43 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:44 [ plot_chargen::$17 ] : zp[1]:44 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:45 [ plot_chargen::$5 ] : zp[1]:45 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:46 [ plot_chargen::$8 ] : zp[1]:46 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:47 [ keyboard_key_pressed::colidx#0 ] : zp[1]:47 , reg byte x , reg byte y , 
Potential registers zp[1]:48 [ keyboard_key_pressed::rowidx#0 ] : zp[1]:48 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:49 [ keyboard_matrix_read::rowid#0 ] : zp[1]:49 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:50 [ keyboard_matrix_read::return#2 ] : zp[1]:50 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:51 [ keyboard_key_pressed::$2 ] : zp[1]:51 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:52 [ keyboard_key_pressed::return#0 ] : zp[1]:52 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:53 [ keyboard_get_keycode::return#0 ] : zp[1]:53 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:54 [ keyboard_matrix_read::return#0 ] : zp[1]:54 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [plot_chargen] 20,000,002: zp[1]:46 [ plot_chargen::$8 ] 17,500,001.75: zp[1]:22 [ plot_chargen::x#2 plot_chargen::x#1 ] 13,095,241.33: zp[1]:19 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ] 12,085,838.92: zp[2]:20 [ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 ] 10,000,001: zp[1]:23 [ plot_chargen::c#2 ] 1,730,770.96: zp[1]:18 [ plot_chargen::y#2 plot_chargen::y#1 ] 51,217.93: zp[2]:16 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 ] 2,002: zp[2]:39 [ plot_chargen::$15 ] 2,002: zp[2]:41 [ plot_chargen::$0 ] 2,002: zp[1]:43 [ plot_chargen::$16 ] 2,002: zp[1]:44 [ plot_chargen::$17 ] 2,002: zp[1]:45 [ plot_chargen::$5 ] 422.4: zp[1]:14 [ plot_chargen::shift#2 plot_chargen::shift#1 ] 300.73: zp[1]:15 [ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ] 151.5: zp[1]:13 [ plot_chargen::ch#2 plot_chargen::ch#1 ] 
Uplift Scope [keyboard_matrix_read] 11,002: zp[1]:49 [ keyboard_matrix_read::rowid#0 ] 3,667.33: zp[1]:54 [ keyboard_matrix_read::return#0 ] 2,002: zp[1]:50 [ keyboard_matrix_read::return#2 ] 
Uplift Scope [keyboard_key_pressed] 2,002: zp[1]:48 [ keyboard_key_pressed::rowidx#0 ] 2,002: zp[1]:51 [ keyboard_key_pressed::$2 ] 1,253.5: zp[1]:24 [ keyboard_key_pressed::key#6 keyboard_key_pressed::key#5 ] 333.67: zp[1]:47 [ keyboard_key_pressed::colidx#0 ] 202: zp[1]:38 [ keyboard_key_pressed::return#14 ] 144.62: zp[1]:52 [ keyboard_key_pressed::return#0 ] 22: zp[1]:25 [ keyboard_key_pressed::return#2 ] 22: zp[1]:27 [ keyboard_key_pressed::return#10 ] 22: zp[1]:29 [ keyboard_key_pressed::return#11 ] 22: zp[1]:31 [ keyboard_key_pressed::return#12 ] 22: zp[1]:33 [ keyboard_key_pressed::return#13 ] 
Uplift Scope [keyboard_get_keycode] 1,102: zp[1]:35 [ keyboard_get_keycode::ch#0 ] 367.33: zp[1]:53 [ keyboard_get_keycode::return#0 ] 202: zp[1]:36 [ keyboard_get_keycode::return#2 ] 
Uplift Scope [main] 404: zp[1]:8 [ main::pressed#2 main::pressed#1 ] 176.75: zp[1]:7 [ main::ch#2 main::ch#1 ] 151.5: zp[1]:37 [ main::key#0 ] 38.19: zp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ] 36.67: zp[2]:2 [ main::sc#2 main::sc#1 ] 27.5: zp[1]:4 [ main::i#2 main::i#1 ] 22: zp[1]:26 [ main::$15 ] 22: zp[1]:28 [ main::$18 ] 22: zp[1]:30 [ main::$21 ] 22: zp[1]:32 [ main::$24 ] 22: zp[1]:34 [ main::$27 ] 5.32: zp[1]:6 [ main::shift#9 ] 
Uplift Scope [print_str_at] 316.75: zp[2]:9 [ print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ] 216.67: zp[2]:11 [ print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ] 
Uplift Scope [MOS6526_CIA] 
Uplift Scope [MOS6569_VICII] 
Uplift Scope [MOS6581_SID] 
Uplift Scope [] 

Uplifting [plot_chargen] best 726298 combination reg byte a [ plot_chargen::$8 ] reg byte x [ plot_chargen::x#2 plot_chargen::x#1 ] zp[1]:19 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ] zp[2]:20 [ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 ] reg byte a [ plot_chargen::c#2 ] zp[1]:18 [ plot_chargen::y#2 plot_chargen::y#1 ] zp[2]:16 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 ] zp[2]:39 [ plot_chargen::$15 ] zp[2]:41 [ plot_chargen::$0 ] zp[1]:43 [ plot_chargen::$16 ] zp[1]:44 [ plot_chargen::$17 ] zp[1]:45 [ plot_chargen::$5 ] zp[1]:14 [ plot_chargen::shift#2 plot_chargen::shift#1 ] zp[1]:15 [ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ] zp[1]:13 [ plot_chargen::ch#2 plot_chargen::ch#1 ] 
Limited combination testing to 100 combinations of 663552 possible.
Uplifting [keyboard_matrix_read] best 726280 combination reg byte x [ keyboard_matrix_read::rowid#0 ] reg byte a [ keyboard_matrix_read::return#0 ] reg byte a [ keyboard_matrix_read::return#2 ] 
Uplifting [keyboard_key_pressed] best 725951 combination reg byte a [ keyboard_key_pressed::rowidx#0 ] reg byte a [ keyboard_key_pressed::$2 ] reg byte x [ keyboard_key_pressed::key#6 keyboard_key_pressed::key#5 ] zp[1]:47 [ keyboard_key_pressed::colidx#0 ] zp[1]:38 [ keyboard_key_pressed::return#14 ] zp[1]:52 [ keyboard_key_pressed::return#0 ] zp[1]:25 [ keyboard_key_pressed::return#2 ] zp[1]:27 [ keyboard_key_pressed::return#10 ] zp[1]:29 [ keyboard_key_pressed::return#11 ] zp[1]:31 [ keyboard_key_pressed::return#12 ] zp[1]:33 [ keyboard_key_pressed::return#13 ] 
Limited combination testing to 100 combinations of 3145728 possible.
Uplifting [keyboard_get_keycode] best 724745 combination reg byte x [ keyboard_get_keycode::ch#0 ] reg byte a [ keyboard_get_keycode::return#0 ] reg byte a [ keyboard_get_keycode::return#2 ] 
Uplifting [main] best 723345 combination reg byte a [ main::pressed#2 main::pressed#1 ] zp[1]:7 [ main::ch#2 main::ch#1 ] reg byte a [ main::key#0 ] zp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ] zp[2]:2 [ main::sc#2 main::sc#1 ] zp[1]:4 [ main::i#2 main::i#1 ] zp[1]:26 [ main::$15 ] zp[1]:28 [ main::$18 ] zp[1]:30 [ main::$21 ] zp[1]:32 [ main::$24 ] zp[1]:34 [ main::$27 ] zp[1]:6 [ main::shift#9 ] 
Limited combination testing to 100 combinations of 262144 possible.
Uplifting [print_str_at] best 723345 combination zp[2]:9 [ print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ] zp[2]:11 [ print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ] 
Uplifting [MOS6526_CIA] best 723345 combination 
Uplifting [MOS6569_VICII] best 723345 combination 
Uplifting [MOS6581_SID] best 723345 combination 
Uplifting [] best 723345 combination 
Attempting to uplift remaining variables inzp[1]:19 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ]
Uplifting [plot_chargen] best 723345 combination zp[1]:19 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ] 
Attempting to uplift remaining variables inzp[1]:18 [ plot_chargen::y#2 plot_chargen::y#1 ]
Uplifting [plot_chargen] best 723345 combination zp[1]:18 [ plot_chargen::y#2 plot_chargen::y#1 ] 
Attempting to uplift remaining variables inzp[1]:43 [ plot_chargen::$16 ]
Uplifting [plot_chargen] best 723339 combination reg byte a [ plot_chargen::$16 ] 
Attempting to uplift remaining variables inzp[1]:44 [ plot_chargen::$17 ]
Uplifting [plot_chargen] best 723333 combination reg byte a [ plot_chargen::$17 ] 
Attempting to uplift remaining variables inzp[1]:45 [ plot_chargen::$5 ]
Uplifting [plot_chargen] best 723327 combination reg byte a [ plot_chargen::$5 ] 
Attempting to uplift remaining variables inzp[1]:14 [ plot_chargen::shift#2 plot_chargen::shift#1 ]
Uplifting [plot_chargen] best 723023 combination reg byte x [ plot_chargen::shift#2 plot_chargen::shift#1 ] 
Attempting to uplift remaining variables inzp[1]:47 [ keyboard_key_pressed::colidx#0 ]
Uplifting [keyboard_key_pressed] best 723021 combination reg byte y [ keyboard_key_pressed::colidx#0 ] 
Attempting to uplift remaining variables inzp[1]:15 [ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ]
Uplifting [plot_chargen] best 722693 combination reg byte y [ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ] 
Attempting to uplift remaining variables inzp[1]:38 [ keyboard_key_pressed::return#14 ]
Uplifting [keyboard_key_pressed] best 722093 combination reg byte a [ keyboard_key_pressed::return#14 ] 
Attempting to uplift remaining variables inzp[1]:7 [ main::ch#2 main::ch#1 ]
Uplifting [main] best 722093 combination zp[1]:7 [ main::ch#2 main::ch#1 ] 
Attempting to uplift remaining variables inzp[1]:13 [ plot_chargen::ch#2 plot_chargen::ch#1 ]
Uplifting [plot_chargen] best 721787 combination reg byte a [ plot_chargen::ch#2 plot_chargen::ch#1 ] 
Attempting to uplift remaining variables inzp[1]:52 [ keyboard_key_pressed::return#0 ]
Uplifting [keyboard_key_pressed] best 721334 combination reg byte a [ keyboard_key_pressed::return#0 ] 
Attempting to uplift remaining variables inzp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ]
Uplifting [main] best 721334 combination zp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ] 
Attempting to uplift remaining variables inzp[1]:4 [ main::i#2 main::i#1 ]
Uplifting [main] best 721334 combination zp[1]:4 [ main::i#2 main::i#1 ] 
Attempting to uplift remaining variables inzp[1]:25 [ keyboard_key_pressed::return#2 ]
Uplifting [keyboard_key_pressed] best 721274 combination reg byte a [ keyboard_key_pressed::return#2 ] 
Attempting to uplift remaining variables inzp[1]:26 [ main::$15 ]
Uplifting [main] best 721234 combination reg byte a [ main::$15 ] 
Attempting to uplift remaining variables inzp[1]:27 [ keyboard_key_pressed::return#10 ]
Uplifting [keyboard_key_pressed] best 721174 combination reg byte a [ keyboard_key_pressed::return#10 ] 
Attempting to uplift remaining variables inzp[1]:28 [ main::$18 ]
Uplifting [main] best 721134 combination reg byte a [ main::$18 ] 
Attempting to uplift remaining variables inzp[1]:29 [ keyboard_key_pressed::return#11 ]
Uplifting [keyboard_key_pressed] best 721074 combination reg byte a [ keyboard_key_pressed::return#11 ] 
Attempting to uplift remaining variables inzp[1]:30 [ main::$21 ]
Uplifting [main] best 721034 combination reg byte a [ main::$21 ] 
Attempting to uplift remaining variables inzp[1]:31 [ keyboard_key_pressed::return#12 ]
Uplifting [keyboard_key_pressed] best 720974 combination reg byte a [ keyboard_key_pressed::return#12 ] 
Attempting to uplift remaining variables inzp[1]:32 [ main::$24 ]
Uplifting [main] best 720934 combination reg byte a [ main::$24 ] 
Attempting to uplift remaining variables inzp[1]:33 [ keyboard_key_pressed::return#13 ]
Uplifting [keyboard_key_pressed] best 720874 combination reg byte a [ keyboard_key_pressed::return#13 ] 
Attempting to uplift remaining variables inzp[1]:34 [ main::$27 ]
Uplifting [main] best 720834 combination reg byte a [ main::$27 ] 
Attempting to uplift remaining variables inzp[1]:6 [ main::shift#9 ]
Uplifting [main] best 720834 combination zp[1]:6 [ main::shift#9 ] 
Coalescing zero page register [ zp[2]:16 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 ] ] with [ zp[2]:41 [ plot_chargen::$0 ] ] - score: 1
Coalescing zero page register [ zp[2]:16 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 plot_chargen::$0 ] ] with [ zp[2]:39 [ plot_chargen::$15 ] ] - score: 1
Coalescing zero page register [ zp[2]:16 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 plot_chargen::$0 plot_chargen::$15 ] ] with [ zp[2]:9 [ print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ] ]
Coalescing zero page register [ zp[2]:20 [ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 ] ] with [ zp[2]:11 [ print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ] ]
Allocated (was zp[2]:16) zp[2]:8 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 plot_chargen::$0 plot_chargen::$15 print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ]
Allocated (was zp[1]:18) zp[1]:10 [ plot_chargen::y#2 plot_chargen::y#1 ]
Allocated (was zp[1]:19) zp[1]:11 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ]
Allocated (was zp[2]:20) zp[2]:12 [ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ]

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Allows analysis of the CHARGEN ROM font
/// @file
/// Commodore 64 Registers and Constants
/// @file
/// The MOS 6526 Complex Interface Adapter (CIA)
///
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
  // Upstart
  // Commodore 64 PRG executable file
.file [name="chargen-analysis.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
  .const KEY_F7 = 3
  .const KEY_F1 = 4
  .const KEY_F3 = 5
  .const KEY_F5 = 6
  .const KEY_3 = 8
  .const KEY_W = 9
  .const KEY_A = $a
  .const KEY_4 = $b
  .const KEY_Z = $c
  .const KEY_S = $d
  .const KEY_E = $e
  .const KEY_LSHIFT = $f
  .const KEY_5 = $10
  .const KEY_R = $11
  .const KEY_D = $12
  .const KEY_6 = $13
  .const KEY_C = $14
  .const KEY_F = $15
  .const KEY_T = $16
  .const KEY_X = $17
  .const KEY_7 = $18
  .const KEY_Y = $19
  .const KEY_G = $1a
  .const KEY_8 = $1b
  .const KEY_B = $1c
  .const KEY_H = $1d
  .const KEY_U = $1e
  .const KEY_V = $1f
  .const KEY_9 = $20
  .const KEY_I = $21
  .const KEY_J = $22
  .const KEY_0 = $23
  .const KEY_M = $24
  .const KEY_K = $25
  .const KEY_O = $26
  .const KEY_N = $27
  .const KEY_PLUS = $28
  .const KEY_P = $29
  .const KEY_L = $2a
  .const KEY_MINUS = $2b
  .const KEY_DOT = $2c
  .const KEY_COLON = $2d
  .const KEY_AT = $2e
  .const KEY_COMMA = $2f
  .const KEY_POUND = $30
  .const KEY_ASTERISK = $31
  .const KEY_SEMICOLON = $32
  .const KEY_EQUALS = $35
  .const KEY_ARROW_UP = $36
  .const KEY_SLASH = $37
  .const KEY_1 = $38
  .const KEY_ARROW_LEFT = $39
  .const KEY_2 = $3b
  .const KEY_SPACE = $3c
  .const KEY_Q = $3e
  .const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
  /// Processor Port Register controlling RAM/ROM configuration and the datasette
  .label PROCPORT = 1
  /// The address of the CHARGEN character set
  .label CHARGEN = $d000
  /// The CIA#1: keyboard matrix, joystick #1/#2
  .label CIA1 = $dc00
  .label SCREEN = $400
.segment Code
  // main
main: {
    .label sc = 2
    .label i = 4
    .label ch = 7
    // Which char canvas to use
    .label cur_pos = 5
    // Is shift pressed
    .label shift = 6
    // [1] phi from main to main::@1 [phi:main->main::@1]
  __b1_from_main:
    // [1] phi main::sc#2 = SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z sc
    lda #>SCREEN
    sta.z sc+1
    jmp __b1
  // Clear screen
    // main::@1
  __b1:
    // [2] if(main::sc#2<SCREEN+$3e8) goto main::@2 -- pbuz1_lt_pbuc1_then_la1 
    lda.z sc+1
    cmp #>SCREEN+$3e8
    bcc __b2
    bne !+
    lda.z sc
    cmp #<SCREEN+$3e8
    bcc __b2
  !:
    // [3] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
  __b3_from___b1:
    jmp __b3
    // main::@3
  __b3:
    // [4] call print_str_at
  // Plot 4 initial analysis chars
    // [67] phi from main::@3 to print_str_at [phi:main::@3->print_str_at]
  print_str_at_from___b3:
    // [67] phi print_str_at::at#7 = SCREEN+1 [phi:main::@3->print_str_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+1
    sta.z print_str_at.at
    lda #>SCREEN+1
    sta.z print_str_at.at+1
    // [67] phi print_str_at::str#7 = main::str [phi:main::@3->print_str_at#1] -- pbuz1=pbuc1 
    lda #<str
    sta.z print_str_at.str
    lda #>str
    sta.z print_str_at.str+1
    jsr print_str_at
    // [5] phi from main::@3 to main::@17 [phi:main::@3->main::@17]
  __b17_from___b3:
    jmp __b17
    // main::@17
  __b17:
    // [6] call print_str_at
    // [67] phi from main::@17 to print_str_at [phi:main::@17->print_str_at]
  print_str_at_from___b17:
    // [67] phi print_str_at::at#7 = SCREEN+1+$a [phi:main::@17->print_str_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+1+$a
    sta.z print_str_at.at
    lda #>SCREEN+1+$a
    sta.z print_str_at.at+1
    // [67] phi print_str_at::str#7 = main::str1 [phi:main::@17->print_str_at#1] -- pbuz1=pbuc1 
    lda #<str1
    sta.z print_str_at.str
    lda #>str1
    sta.z print_str_at.str+1
    jsr print_str_at
    // [7] phi from main::@17 to main::@18 [phi:main::@17->main::@18]
  __b18_from___b17:
    jmp __b18
    // main::@18
  __b18:
    // [8] call print_str_at
    // [67] phi from main::@18 to print_str_at [phi:main::@18->print_str_at]
  print_str_at_from___b18:
    // [67] phi print_str_at::at#7 = SCREEN+1+$14 [phi:main::@18->print_str_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+1+$14
    sta.z print_str_at.at
    lda #>SCREEN+1+$14
    sta.z print_str_at.at+1
    // [67] phi print_str_at::str#7 = main::str2 [phi:main::@18->print_str_at#1] -- pbuz1=pbuc1 
    lda #<str2
    sta.z print_str_at.str
    lda #>str2
    sta.z print_str_at.str+1
    jsr print_str_at
    // [9] phi from main::@18 to main::@19 [phi:main::@18->main::@19]
  __b19_from___b18:
    jmp __b19
    // main::@19
  __b19:
    // [10] call print_str_at
    // [67] phi from main::@19 to print_str_at [phi:main::@19->print_str_at]
  print_str_at_from___b19:
    // [67] phi print_str_at::at#7 = SCREEN+1+$1e [phi:main::@19->print_str_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+1+$1e
    sta.z print_str_at.at
    lda #>SCREEN+1+$1e
    sta.z print_str_at.at+1
    // [67] phi print_str_at::str#7 = main::str3 [phi:main::@19->print_str_at#1] -- pbuz1=pbuc1 
    lda #<str3
    sta.z print_str_at.str
    lda #>str3
    sta.z print_str_at.str+1
    jsr print_str_at
    // [11] phi from main::@19 to main::@4 [phi:main::@19->main::@4]
  __b4_from___b19:
    // [11] phi main::i#2 = 0 [phi:main::@19->main::@4#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    jmp __b4
    // [11] phi from main::@20 to main::@4 [phi:main::@20->main::@4]
  __b4_from___b20:
    // [11] phi main::i#2 = main::i#1 [phi:main::@20->main::@4#0] -- register_copy 
    jmp __b4
    // main::@4
  __b4:
    // [12] plot_chargen::pos#0 = main::i#2 -- vbuyy=vbuz1 
    ldy.z i
    // [13] call plot_chargen
    // [74] phi from main::@4 to plot_chargen [phi:main::@4->plot_chargen]
  plot_chargen_from___b4:
    // [74] phi plot_chargen::pos#2 = plot_chargen::pos#0 [phi:main::@4->plot_chargen#0] -- register_copy 
    // [74] phi plot_chargen::shift#2 = 0 [phi:main::@4->plot_chargen#1] -- vbuxx=vbuc1 
    ldx #0
    // [74] phi plot_chargen::ch#2 = $20 [phi:main::@4->plot_chargen#2] -- vbuaa=vbuc1 
    lda #$20
    jsr plot_chargen
    jmp __b20
    // main::@20
  __b20:
    // [14] main::i#1 = ++ main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [15] if(main::i#1!=4) goto main::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #4
    cmp.z i
    bne __b4_from___b20
    // [16] phi from main::@20 to main::@5 [phi:main::@20->main::@5]
  __b5_from___b20:
    // [16] phi main::cur_pos#24 = 0 [phi:main::@20->main::@5#0] -- vbuz1=vbuc1 
    lda #0
    sta.z cur_pos
    jmp __b5
    // main::@5
  __b5:
    // [17] call keyboard_key_pressed
    // [105] phi from main::@5 to keyboard_key_pressed [phi:main::@5->keyboard_key_pressed]
  keyboard_key_pressed_from___b5:
    // [105] phi keyboard_key_pressed::key#6 = KEY_F1 [phi:main::@5->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_F1
    jsr keyboard_key_pressed
    // [18] keyboard_key_pressed::return#2 = keyboard_key_pressed::return#0
    jmp __b21
    // main::@21
  __b21:
    // [19] main::$15 = keyboard_key_pressed::return#2
    // [20] if(main::$15==0) goto main::@28 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b28_from___b21
    // [22] phi from main::@21 to main::@6 [phi:main::@21->main::@6]
  __b6_from___b21:
    // [22] phi main::cur_pos#22 = 0 [phi:main::@21->main::@6#0] -- vbuz1=vbuc1 
    lda #0
    sta.z cur_pos
    jmp __b6
    // [21] phi from main::@21 to main::@28 [phi:main::@21->main::@28]
  __b28_from___b21:
    jmp __b28
    // main::@28
  __b28:
    // [22] phi from main::@28 to main::@6 [phi:main::@28->main::@6]
  __b6_from___b28:
    // [22] phi main::cur_pos#22 = main::cur_pos#24 [phi:main::@28->main::@6#0] -- register_copy 
    jmp __b6
    // main::@6
  __b6:
    // [23] call keyboard_key_pressed
    // [105] phi from main::@6 to keyboard_key_pressed [phi:main::@6->keyboard_key_pressed]
  keyboard_key_pressed_from___b6:
    // [105] phi keyboard_key_pressed::key#6 = KEY_F3 [phi:main::@6->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_F3
    jsr keyboard_key_pressed
    // [24] keyboard_key_pressed::return#10 = keyboard_key_pressed::return#0
    jmp __b22
    // main::@22
  __b22:
    // [25] main::$18 = keyboard_key_pressed::return#10
    // [26] if(main::$18==0) goto main::@29 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b29_from___b22
    // [28] phi from main::@22 to main::@7 [phi:main::@22->main::@7]
  __b7_from___b22:
    // [28] phi main::cur_pos#20 = 1 [phi:main::@22->main::@7#0] -- vbuz1=vbuc1 
    lda #1
    sta.z cur_pos
    jmp __b7
    // [27] phi from main::@22 to main::@29 [phi:main::@22->main::@29]
  __b29_from___b22:
    jmp __b29
    // main::@29
  __b29:
    // [28] phi from main::@29 to main::@7 [phi:main::@29->main::@7]
  __b7_from___b29:
    // [28] phi main::cur_pos#20 = main::cur_pos#22 [phi:main::@29->main::@7#0] -- register_copy 
    jmp __b7
    // main::@7
  __b7:
    // [29] call keyboard_key_pressed
    // [105] phi from main::@7 to keyboard_key_pressed [phi:main::@7->keyboard_key_pressed]
  keyboard_key_pressed_from___b7:
    // [105] phi keyboard_key_pressed::key#6 = KEY_F5 [phi:main::@7->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_F5
    jsr keyboard_key_pressed
    // [30] keyboard_key_pressed::return#11 = keyboard_key_pressed::return#0
    jmp __b23
    // main::@23
  __b23:
    // [31] main::$21 = keyboard_key_pressed::return#11
    // [32] if(main::$21==0) goto main::@30 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b30_from___b23
    // [34] phi from main::@23 to main::@8 [phi:main::@23->main::@8]
  __b8_from___b23:
    // [34] phi main::cur_pos#18 = 2 [phi:main::@23->main::@8#0] -- vbuz1=vbuc1 
    lda #2
    sta.z cur_pos
    jmp __b8
    // [33] phi from main::@23 to main::@30 [phi:main::@23->main::@30]
  __b30_from___b23:
    jmp __b30
    // main::@30
  __b30:
    // [34] phi from main::@30 to main::@8 [phi:main::@30->main::@8]
  __b8_from___b30:
    // [34] phi main::cur_pos#18 = main::cur_pos#20 [phi:main::@30->main::@8#0] -- register_copy 
    jmp __b8
    // main::@8
  __b8:
    // [35] call keyboard_key_pressed
    // [105] phi from main::@8 to keyboard_key_pressed [phi:main::@8->keyboard_key_pressed]
  keyboard_key_pressed_from___b8:
    // [105] phi keyboard_key_pressed::key#6 = KEY_F7 [phi:main::@8->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_F7
    jsr keyboard_key_pressed
    // [36] keyboard_key_pressed::return#12 = keyboard_key_pressed::return#0
    jmp __b24
    // main::@24
  __b24:
    // [37] main::$24 = keyboard_key_pressed::return#12
    // [38] if(main::$24==0) goto main::@31 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b31_from___b24
    // [40] phi from main::@24 to main::@9 [phi:main::@24->main::@9]
  __b9_from___b24:
    // [40] phi main::cur_pos#11 = 3 [phi:main::@24->main::@9#0] -- vbuz1=vbuc1 
    lda #3
    sta.z cur_pos
    jmp __b9
    // [39] phi from main::@24 to main::@31 [phi:main::@24->main::@31]
  __b31_from___b24:
    jmp __b31
    // main::@31
  __b31:
    // [40] phi from main::@31 to main::@9 [phi:main::@31->main::@9]
  __b9_from___b31:
    // [40] phi main::cur_pos#11 = main::cur_pos#18 [phi:main::@31->main::@9#0] -- register_copy 
    jmp __b9
    // main::@9
  __b9:
    // [41] call keyboard_key_pressed
    // [105] phi from main::@9 to keyboard_key_pressed [phi:main::@9->keyboard_key_pressed]
  keyboard_key_pressed_from___b9:
    // [105] phi keyboard_key_pressed::key#6 = KEY_LSHIFT [phi:main::@9->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_LSHIFT
    jsr keyboard_key_pressed
    // [42] keyboard_key_pressed::return#13 = keyboard_key_pressed::return#0
    jmp __b25
    // main::@25
  __b25:
    // [43] main::$27 = keyboard_key_pressed::return#13
    // [44] if(main::$27!=0) goto main::@10 -- vbuaa_neq_0_then_la1 
    cmp #0
    bne __b10_from___b25
    // [46] phi from main::@25 to main::@11 [phi:main::@25->main::@11]
  __b11_from___b25:
    // [46] phi main::shift#9 = 0 [phi:main::@25->main::@11#0] -- vbuz1=vbuc1 
    lda #0
    sta.z shift
    jmp __b11
    // [45] phi from main::@25 to main::@10 [phi:main::@25->main::@10]
  __b10_from___b25:
    jmp __b10
    // main::@10
  __b10:
    // [46] phi from main::@10 to main::@11 [phi:main::@10->main::@11]
  __b11_from___b10:
    // [46] phi main::shift#9 = 1 [phi:main::@10->main::@11#0] -- vbuz1=vbuc1 
    lda #1
    sta.z shift
    jmp __b11
    // main::@11
  __b11:
    // [47] phi from main::@11 to main::@12 [phi:main::@11->main::@12]
  __b12_from___b11:
    // [47] phi main::ch#2 = 0 [phi:main::@11->main::@12#0] -- vbuz1=vbuc1 
    lda #0
    sta.z ch
    jmp __b12
  // Check for key presses - and plot char if found
    // [47] phi from main::@14 to main::@12 [phi:main::@14->main::@12]
  __b12_from___b14:
    // [47] phi main::ch#2 = main::ch#1 [phi:main::@14->main::@12#0] -- register_copy 
    jmp __b12
    // main::@12
  __b12:
    // [48] keyboard_get_keycode::ch#0 = main::ch#2 -- vbuxx=vbuz1 
    ldx.z ch
    // [49] call keyboard_get_keycode
    jsr keyboard_get_keycode
    // [50] keyboard_get_keycode::return#2 = keyboard_get_keycode::return#0
    jmp __b26
    // main::@26
  __b26:
    // [51] main::key#0 = keyboard_get_keycode::return#2
    // [52] if(main::key#0==$3f) goto main::@13 -- vbuaa_eq_vbuc1_then_la1 
    cmp #$3f
    beq __b13_from___b26
    jmp __b15
    // main::@15
  __b15:
    // [53] keyboard_key_pressed::key#5 = main::key#0 -- vbuxx=vbuaa 
    tax
    // [54] call keyboard_key_pressed
    // [105] phi from main::@15 to keyboard_key_pressed [phi:main::@15->keyboard_key_pressed]
  keyboard_key_pressed_from___b15:
    // [105] phi keyboard_key_pressed::key#6 = keyboard_key_pressed::key#5 [phi:main::@15->keyboard_key_pressed#0] -- register_copy 
    jsr keyboard_key_pressed
    // [55] keyboard_key_pressed::return#14 = keyboard_key_pressed::return#0
    jmp __b27
    // main::@27
  __b27:
    // [56] main::pressed#1 = keyboard_key_pressed::return#14
    // [57] phi from main::@27 to main::@13 [phi:main::@27->main::@13]
  __b13_from___b27:
    // [57] phi main::pressed#2 = main::pressed#1 [phi:main::@27->main::@13#0] -- register_copy 
    jmp __b13
    // [57] phi from main::@26 to main::@13 [phi:main::@26->main::@13]
  __b13_from___b26:
    // [57] phi main::pressed#2 = 0 [phi:main::@26->main::@13#0] -- vbuaa=vbuc1 
    lda #0
    jmp __b13
    // main::@13
  __b13:
    // [58] if(main::pressed#2==0) goto main::@14 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b14
    jmp __b16
    // main::@16
  __b16:
    // [59] plot_chargen::pos#1 = main::cur_pos#11 -- vbuyy=vbuz1 
    ldy.z cur_pos
    // [60] plot_chargen::ch#1 = main::ch#2 -- vbuaa=vbuz1 
    lda.z ch
    // [61] plot_chargen::shift#1 = main::shift#9 -- vbuxx=vbuz1 
    ldx.z shift
    // [62] call plot_chargen
    // [74] phi from main::@16 to plot_chargen [phi:main::@16->plot_chargen]
  plot_chargen_from___b16:
    // [74] phi plot_chargen::pos#2 = plot_chargen::pos#1 [phi:main::@16->plot_chargen#0] -- register_copy 
    // [74] phi plot_chargen::shift#2 = plot_chargen::shift#1 [phi:main::@16->plot_chargen#1] -- register_copy 
    // [74] phi plot_chargen::ch#2 = plot_chargen::ch#1 [phi:main::@16->plot_chargen#2] -- register_copy 
    jsr plot_chargen
    jmp __b14
    // main::@14
  __b14:
    // [63] main::ch#1 = ++ main::ch#2 -- vbuz1=_inc_vbuz1 
    inc.z ch
    // [64] if(main::ch#1!=$40) goto main::@12 -- vbuz1_neq_vbuc1_then_la1 
    lda #$40
    cmp.z ch
    bne __b12_from___b14
    // [16] phi from main::@14 to main::@5 [phi:main::@14->main::@5]
  __b5_from___b14:
    // [16] phi main::cur_pos#24 = main::cur_pos#11 [phi:main::@14->main::@5#0] -- register_copy 
    jmp __b5
    // main::@2
  __b2:
    // [65] *main::sc#2 = ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // [66] main::sc#1 = ++ main::sc#2 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
  __b1_from___b2:
    // [1] phi main::sc#2 = main::sc#1 [phi:main::@2->main::@1#0] -- register_copy 
    jmp __b1
  .segment Data
    str: .text "f1"
    .byte 0
    str1: .text "f3"
    .byte 0
    str2: .text "f5"
    .byte 0
    str3: .text "f7"
    .byte 0
}
.segment Code
  // print_str_at
// Print a string at a specific screen position
// void print_str_at(__zp(8) char *str, __zp($c) char *at)
print_str_at: {
    .label at = $c
    .label str = 8
    // [68] phi from print_str_at print_str_at::@2 to print_str_at::@1 [phi:print_str_at/print_str_at::@2->print_str_at::@1]
  __b1_from_print_str_at:
  __b1_from___b2:
    // [68] phi print_str_at::at#5 = print_str_at::at#7 [phi:print_str_at/print_str_at::@2->print_str_at::@1#0] -- register_copy 
    // [68] phi print_str_at::str#5 = print_str_at::str#7 [phi:print_str_at/print_str_at::@2->print_str_at::@1#1] -- register_copy 
    jmp __b1
    // print_str_at::@1
  __b1:
    // [69] if(0!=*print_str_at::str#5) goto print_str_at::@2 -- 0_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (str),y
    cmp #0
    bne __b2
    jmp __breturn
    // print_str_at::@return
  __breturn:
    // [70] return 
    rts
    // print_str_at::@2
  __b2:
    // [71] *print_str_at::at#5 = *print_str_at::str#5 -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (str),y
    ldy #0
    sta (at),y
    // [72] print_str_at::at#4 = ++ print_str_at::at#5 -- pbuz1=_inc_pbuz1 
    inc.z at
    bne !+
    inc.z at+1
  !:
    // [73] print_str_at::str#4 = ++ print_str_at::str#5 -- pbuz1=_inc_pbuz1 
    inc.z str
    bne !+
    inc.z str+1
  !:
    jmp __b1_from___b2
}
  // plot_chargen
// Render 8x8 char (ch) as pixels on char canvas #pos
// void plot_chargen(__register(Y) char pos, __register(A) char ch, __register(X) char shift)
plot_chargen: {
    .label __0 = 8
    .label __15 = 8
    .label chargen = 8
    .label sc = $c
    .label bits = $b
    .label y = $a
    // asm { sei  }
    sei
    // [76] plot_chargen::$15 = (unsigned int)plot_chargen::ch#2 -- vwuz1=_word_vbuaa 
    sta.z __15
    lda #0
    sta.z __15+1
    // [77] plot_chargen::$0 = plot_chargen::$15 << 3 -- vwuz1=vwuz1_rol_3 
    asl.z __0
    rol.z __0+1
    asl.z __0
    rol.z __0+1
    asl.z __0
    rol.z __0+1
    // [78] plot_chargen::chargen#0 = CHARGEN + plot_chargen::$0 -- pbuz1=pbuc1_plus_vwuz1 
    lda.z chargen
    clc
    adc #<CHARGEN
    sta.z chargen
    lda.z chargen+1
    adc #>CHARGEN
    sta.z chargen+1
    // [79] if(plot_chargen::shift#2==0) goto plot_chargen::@1 -- vbuxx_eq_0_then_la1 
    cpx #0
    beq __b1_from_plot_chargen
    jmp __b2
    // plot_chargen::@2
  __b2:
    // [80] plot_chargen::chargen#1 = plot_chargen::chargen#0 + $800 -- pbuz1=pbuz1_plus_vwuc1 
    lda.z chargen
    clc
    adc #<$800
    sta.z chargen
    lda.z chargen+1
    adc #>$800
    sta.z chargen+1
    // [81] phi from plot_chargen plot_chargen::@2 to plot_chargen::@1 [phi:plot_chargen/plot_chargen::@2->plot_chargen::@1]
  __b1_from_plot_chargen:
  __b1_from___b2:
    // [81] phi plot_chargen::chargen#4 = plot_chargen::chargen#0 [phi:plot_chargen/plot_chargen::@2->plot_chargen::@1#0] -- register_copy 
    jmp __b1
    // plot_chargen::@1
  __b1:
    // [82] *PROCPORT = $32 -- _deref_pbuc1=vbuc2 
    lda #$32
    sta PROCPORT
    // [83] plot_chargen::$16 = plot_chargen::pos#2 << 2 -- vbuaa=vbuyy_rol_2 
    tya
    asl
    asl
    // [84] plot_chargen::$17 = plot_chargen::$16 + plot_chargen::pos#2 -- vbuaa=vbuaa_plus_vbuyy 
    sty.z $ff
    clc
    adc.z $ff
    // [85] plot_chargen::$5 = plot_chargen::$17 << 1 -- vbuaa=vbuaa_rol_1 
    asl
    // [86] plot_chargen::sc#0 = SCREEN+$29 + plot_chargen::$5 -- pbuz1=pbuc1_plus_vbuaa 
    clc
    adc #<SCREEN+$29
    sta.z sc
    lda #>SCREEN+$29
    adc #0
    sta.z sc+1
    // [87] phi from plot_chargen::@1 to plot_chargen::@3 [phi:plot_chargen::@1->plot_chargen::@3]
  __b3_from___b1:
    // [87] phi plot_chargen::sc#7 = plot_chargen::sc#0 [phi:plot_chargen::@1->plot_chargen::@3#0] -- register_copy 
    // [87] phi plot_chargen::y#2 = 0 [phi:plot_chargen::@1->plot_chargen::@3#1] -- vbuz1=vbuc1 
    lda #0
    sta.z y
    jmp __b3
    // [87] phi from plot_chargen::@7 to plot_chargen::@3 [phi:plot_chargen::@7->plot_chargen::@3]
  __b3_from___b7:
    // [87] phi plot_chargen::sc#7 = plot_chargen::sc#2 [phi:plot_chargen::@7->plot_chargen::@3#0] -- register_copy 
    // [87] phi plot_chargen::y#2 = plot_chargen::y#1 [phi:plot_chargen::@7->plot_chargen::@3#1] -- register_copy 
    jmp __b3
    // plot_chargen::@3
  __b3:
    // [88] plot_chargen::bits#0 = plot_chargen::chargen#4[plot_chargen::y#2] -- vbuz1=pbuz2_derefidx_vbuz3 
    ldy.z y
    lda (chargen),y
    sta.z bits
    // [89] phi from plot_chargen::@3 to plot_chargen::@4 [phi:plot_chargen::@3->plot_chargen::@4]
  __b4_from___b3:
    // [89] phi plot_chargen::x#2 = 0 [phi:plot_chargen::@3->plot_chargen::@4#0] -- vbuxx=vbuc1 
    ldx #0
    // [89] phi plot_chargen::sc#3 = plot_chargen::sc#7 [phi:plot_chargen::@3->plot_chargen::@4#1] -- register_copy 
    // [89] phi plot_chargen::bits#2 = plot_chargen::bits#0 [phi:plot_chargen::@3->plot_chargen::@4#2] -- register_copy 
    jmp __b4
    // [89] phi from plot_chargen::@5 to plot_chargen::@4 [phi:plot_chargen::@5->plot_chargen::@4]
  __b4_from___b5:
    // [89] phi plot_chargen::x#2 = plot_chargen::x#1 [phi:plot_chargen::@5->plot_chargen::@4#0] -- register_copy 
    // [89] phi plot_chargen::sc#3 = plot_chargen::sc#1 [phi:plot_chargen::@5->plot_chargen::@4#1] -- register_copy 
    // [89] phi plot_chargen::bits#2 = plot_chargen::bits#1 [phi:plot_chargen::@5->plot_chargen::@4#2] -- register_copy 
    jmp __b4
    // plot_chargen::@4
  __b4:
    // [90] plot_chargen::$8 = plot_chargen::bits#2 & $80 -- vbuaa=vbuz1_band_vbuc1 
    lda #$80
    and.z bits
    // [91] if(plot_chargen::$8==0) goto plot_chargen::@5 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b5_from___b4
    // [92] phi from plot_chargen::@4 to plot_chargen::@6 [phi:plot_chargen::@4->plot_chargen::@6]
  __b6_from___b4:
    jmp __b6
    // plot_chargen::@6
  __b6:
    // [93] phi from plot_chargen::@6 to plot_chargen::@5 [phi:plot_chargen::@6->plot_chargen::@5]
  __b5_from___b6:
    // [93] phi plot_chargen::c#2 = '*' [phi:plot_chargen::@6->plot_chargen::@5#0] -- vbuaa=vbuc1 
    lda #'*'
    jmp __b5
    // [93] phi from plot_chargen::@4 to plot_chargen::@5 [phi:plot_chargen::@4->plot_chargen::@5]
  __b5_from___b4:
    // [93] phi plot_chargen::c#2 = '.' [phi:plot_chargen::@4->plot_chargen::@5#0] -- vbuaa=vbuc1 
    lda #'.'
    jmp __b5
    // plot_chargen::@5
  __b5:
    // [94] *plot_chargen::sc#3 = plot_chargen::c#2 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (sc),y
    // [95] plot_chargen::sc#1 = ++ plot_chargen::sc#3 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [96] plot_chargen::bits#1 = plot_chargen::bits#2 << 1 -- vbuz1=vbuz1_rol_1 
    asl.z bits
    // [97] plot_chargen::x#1 = ++ plot_chargen::x#2 -- vbuxx=_inc_vbuxx 
    inx
    // [98] if(plot_chargen::x#1!=8) goto plot_chargen::@4 -- vbuxx_neq_vbuc1_then_la1 
    cpx #8
    bne __b4_from___b5
    jmp __b7
    // plot_chargen::@7
  __b7:
    // [99] plot_chargen::sc#2 = plot_chargen::sc#1 + $20 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$20
    clc
    adc.z sc
    sta.z sc
    bcc !+
    inc.z sc+1
  !:
    // [100] plot_chargen::y#1 = ++ plot_chargen::y#2 -- vbuz1=_inc_vbuz1 
    inc.z y
    // [101] if(plot_chargen::y#1!=8) goto plot_chargen::@3 -- vbuz1_neq_vbuc1_then_la1 
    lda #8
    cmp.z y
    bne __b3_from___b7
    jmp __b8
    // plot_chargen::@8
  __b8:
    // [102] *PROCPORT = $37 -- _deref_pbuc1=vbuc2 
    lda #$37
    sta PROCPORT
    // asm { cli  }
    cli
    jmp __breturn
    // plot_chargen::@return
  __breturn:
    // [104] return 
    rts
}
  // keyboard_key_pressed
// Determines whether a specific key is currently pressed by accessing the matrix directly
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// __register(A) char keyboard_key_pressed(__register(X) char key)
keyboard_key_pressed: {
    // [106] keyboard_key_pressed::colidx#0 = keyboard_key_pressed::key#6 & 7 -- vbuyy=vbuxx_band_vbuc1 
    txa
    and #7
    tay
    // [107] keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#6 >> 3 -- vbuaa=vbuxx_ror_3 
    txa
    lsr
    lsr
    lsr
    // [108] keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 -- vbuxx=vbuaa 
    tax
    // [109] call keyboard_matrix_read
    jsr keyboard_matrix_read
    // [110] keyboard_matrix_read::return#2 = keyboard_matrix_read::return#0
    jmp __b1
    // keyboard_key_pressed::@1
  __b1:
    // [111] keyboard_key_pressed::$2 = keyboard_matrix_read::return#2
    // [112] keyboard_key_pressed::return#0 = keyboard_key_pressed::$2 & keyboard_matrix_col_bitmask[keyboard_key_pressed::colidx#0] -- vbuaa=vbuaa_band_pbuc1_derefidx_vbuyy 
    and keyboard_matrix_col_bitmask,y
    jmp __breturn
    // keyboard_key_pressed::@return
  __breturn:
    // [113] return 
    rts
}
  // keyboard_get_keycode
// Get the keycode corresponding to a specific screen code character
// ch is the character to get the key code for ($00-$3f)
// Returns the key code corresponding to the passed character. Only characters with a non-shifted key are handled.
// If there is no non-shifted key representing the char $3f is returned (representing RUN/STOP) .
// __register(A) char keyboard_get_keycode(__register(X) char ch)
keyboard_get_keycode: {
    // [114] keyboard_get_keycode::return#0 = keyboard_char_keycodes[keyboard_get_keycode::ch#0] -- vbuaa=pbuc1_derefidx_vbuxx 
    lda keyboard_char_keycodes,x
    jmp __breturn
    // keyboard_get_keycode::@return
  __breturn:
    // [115] return 
    rts
}
  // keyboard_matrix_read
// Read a single row of the keyboard matrix
// The row ID (0-7) of the keyboard matrix row to read. See the C64 key matrix for row IDs.
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// __register(A) char keyboard_matrix_read(__register(X) char rowid)
keyboard_matrix_read: {
    // [116] *((char *)CIA1) = keyboard_matrix_row_bitmask[keyboard_matrix_read::rowid#0] -- _deref_pbuc1=pbuc2_derefidx_vbuxx 
    lda keyboard_matrix_row_bitmask,x
    sta CIA1
    // [117] keyboard_matrix_read::return#0 = ~ *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuaa=_bnot__deref_pbuc1 
    lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
    eor #$ff
    jmp __breturn
    // keyboard_matrix_read::@return
  __breturn:
    // [118] return 
    rts
}
  // File Data
.segment Data
  // Keycodes for each screen code character from $00-$3f.
  // Chars that do not have an unmodified keycode return $3f (representing RUN/STOP).
  keyboard_char_keycodes: .byte KEY_AT, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, $3f, KEY_POUND, $3f, KEY_ARROW_UP, KEY_ARROW_LEFT, KEY_SPACE, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, KEY_ASTERISK, KEY_PLUS, KEY_COMMA, KEY_MINUS, KEY_DOT, KEY_SLASH, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON, $3f, KEY_EQUALS, $3f, $3f
  // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7)
  keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f
  // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7)
  keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __b3
Removing instruction jmp __b17
Removing instruction jmp __b18
Removing instruction jmp __b19
Removing instruction jmp __b4
Removing instruction jmp __b20
Removing instruction jmp __b5
Removing instruction jmp __b21
Removing instruction jmp __b28
Removing instruction jmp __b6
Removing instruction jmp __b22
Removing instruction jmp __b29
Removing instruction jmp __b7
Removing instruction jmp __b23
Removing instruction jmp __b30
Removing instruction jmp __b8
Removing instruction jmp __b24
Removing instruction jmp __b31
Removing instruction jmp __b9
Removing instruction jmp __b25
Removing instruction jmp __b10
Removing instruction jmp __b11
Removing instruction jmp __b12
Removing instruction jmp __b26
Removing instruction jmp __b15
Removing instruction jmp __b27
Removing instruction jmp __b13
Removing instruction jmp __b16
Removing instruction jmp __b14
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b2
Removing instruction jmp __b1
Removing instruction jmp __b3
Removing instruction jmp __b4
Removing instruction jmp __b6
Removing instruction jmp __b5
Removing instruction jmp __b7
Removing instruction jmp __b8
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction ldy #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __b4_from___b20 with __b4
Replacing label __b28_from___b21 with __b6
Replacing label __b29_from___b22 with __b7
Replacing label __b30_from___b23 with __b8
Replacing label __b31_from___b24 with __b9
Replacing label __b10_from___b25 with __b10
Replacing label __b12_from___b14 with __b12
Replacing label __b1_from___b2 with __b1
Replacing label __b1_from_plot_chargen with __b1
Replacing label __b4_from___b5 with __b4
Replacing label __b3_from___b7 with __b3
Removing instruction __b3_from___b1:
Removing instruction __b17_from___b3:
Removing instruction print_str_at_from___b17:
Removing instruction __b18_from___b17:
Removing instruction print_str_at_from___b18:
Removing instruction __b19_from___b18:
Removing instruction print_str_at_from___b19:
Removing instruction __b4_from___b20:
Removing instruction keyboard_key_pressed_from___b5:
Removing instruction __b28_from___b21:
Removing instruction __b28:
Removing instruction __b6_from___b28:
Removing instruction keyboard_key_pressed_from___b6:
Removing instruction __b29_from___b22:
Removing instruction __b29:
Removing instruction __b7_from___b29:
Removing instruction keyboard_key_pressed_from___b7:
Removing instruction __b30_from___b23:
Removing instruction __b30:
Removing instruction __b8_from___b30:
Removing instruction keyboard_key_pressed_from___b8:
Removing instruction __b31_from___b24:
Removing instruction __b31:
Removing instruction __b9_from___b31:
Removing instruction keyboard_key_pressed_from___b9:
Removing instruction __b10_from___b25:
Removing instruction __b11_from___b10:
Removing instruction __b12_from___b11:
Removing instruction __b12_from___b14:
Removing instruction __b13_from___b27:
Removing instruction __b1_from_print_str_at:
Removing instruction __b1_from___b2:
Removing instruction __b1_from_plot_chargen:
Removing instruction __b1_from___b2:
Removing instruction __b3_from___b7:
Removing instruction __b4_from___b5:
Removing instruction __b6_from___b4:
Removing instruction __b5_from___b6:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __b1_from_main:
Removing instruction __b3:
Removing instruction print_str_at_from___b3:
Removing instruction __b17:
Removing instruction __b18:
Removing instruction __b19:
Removing instruction __b4_from___b19:
Removing instruction plot_chargen_from___b4:
Removing instruction __b20:
Removing instruction __b5_from___b20:
Removing instruction __b21:
Removing instruction __b6_from___b21:
Removing instruction __b22:
Removing instruction __b7_from___b22:
Removing instruction __b23:
Removing instruction __b8_from___b23:
Removing instruction __b24:
Removing instruction __b9_from___b24:
Removing instruction __b25:
Removing instruction __b11_from___b25:
Removing instruction __b26:
Removing instruction __b15:
Removing instruction keyboard_key_pressed_from___b15:
Removing instruction __b27:
Removing instruction __b16:
Removing instruction plot_chargen_from___b16:
Removing instruction __b5_from___b14:
Removing instruction __b1_from___b2:
Removing instruction __breturn:
Removing instruction __b2:
Removing instruction __b3_from___b1:
Removing instruction __b4_from___b3:
Removing instruction __b6:
Removing instruction __b7:
Removing instruction __b8:
Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Relabelling long label __b13_from___b26 to __b3
Relabelling long label __b5_from___b4 to __b2
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction jmp __b4
Removing instruction jmp __b6
Removing instruction jmp __b7
Removing instruction jmp __b8
Removing instruction jmp __b9
Removing instruction jmp __b12
Removing instruction jmp __b3
Removing instruction jmp __b4
Succesful ASM optimization Pass5NextJumpElimination
Fixing long branch [95] bcc __b2 to bcs
Fixing long branch [101] bcc __b2 to bcs

FINAL SYMBOL TABLE
__constant char * const CHARGEN = (char *) 53248
__constant struct MOS6526_CIA * const CIA1 = (struct MOS6526_CIA *) 56320
__constant const char KEY_0 = $23
__constant const char KEY_1 = $38
__constant const char KEY_2 = $3b
__constant const char KEY_3 = 8
__constant const char KEY_4 = $b
__constant const char KEY_5 = $10
__constant const char KEY_6 = $13
__constant const char KEY_7 = $18
__constant const char KEY_8 = $1b
__constant const char KEY_9 = $20
__constant const char KEY_A = $a
__constant const char KEY_ARROW_LEFT = $39
__constant const char KEY_ARROW_UP = $36
__constant const char KEY_ASTERISK = $31
__constant const char KEY_AT = $2e
__constant const char KEY_B = $1c
__constant const char KEY_C = $14
__constant const char KEY_COLON = $2d
__constant const char KEY_COMMA = $2f
__constant const char KEY_D = $12
__constant const char KEY_DOT = $2c
__constant const char KEY_E = $e
__constant const char KEY_EQUALS = $35
__constant const char KEY_F = $15
__constant const char KEY_F1 = 4
__constant const char KEY_F3 = 5
__constant const char KEY_F5 = 6
__constant const char KEY_F7 = 3
__constant const char KEY_G = $1a
__constant const char KEY_H = $1d
__constant const char KEY_I = $21
__constant const char KEY_J = $22
__constant const char KEY_K = $25
__constant const char KEY_L = $2a
__constant const char KEY_LSHIFT = $f
__constant const char KEY_M = $24
__constant const char KEY_MINUS = $2b
__constant const char KEY_N = $27
__constant const char KEY_O = $26
__constant const char KEY_P = $29
__constant const char KEY_PLUS = $28
__constant const char KEY_POUND = $30
__constant const char KEY_Q = $3e
__constant const char KEY_R = $11
__constant const char KEY_S = $d
__constant const char KEY_SEMICOLON = $32
__constant const char KEY_SLASH = $37
__constant const char KEY_SPACE = $3c
__constant const char KEY_T = $16
__constant const char KEY_U = $1e
__constant const char KEY_V = $1f
__constant const char KEY_W = 9
__constant const char KEY_X = $17
__constant const char KEY_Y = $19
__constant const char KEY_Z = $c
__constant char OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
__constant char * const PROCPORT = (char *) 1
__constant char *SCREEN = (char *) 1024
__constant const char keyboard_char_keycodes[] = { KEY_AT, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, $3f, KEY_POUND, $3f, KEY_ARROW_UP, KEY_ARROW_LEFT, KEY_SPACE, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, KEY_ASTERISK, KEY_PLUS, KEY_COMMA, KEY_MINUS, KEY_DOT, KEY_SLASH, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON, $3f, KEY_EQUALS, $3f, $3f }
char keyboard_get_keycode(char ch)
char keyboard_get_keycode::ch
char keyboard_get_keycode::ch#0 // reg byte x 1102.0
char keyboard_get_keycode::return
char keyboard_get_keycode::return#0 // reg byte a 367.33333333333337
char keyboard_get_keycode::return#2 // reg byte a 202.0
char keyboard_key_pressed(char key)
char keyboard_key_pressed::$2 // reg byte a 2002.0
char keyboard_key_pressed::colidx
char keyboard_key_pressed::colidx#0 // reg byte y 333.6666666666667
char keyboard_key_pressed::key
char keyboard_key_pressed::key#5 // reg byte x 202.0
char keyboard_key_pressed::key#6 // reg byte x 1051.5
char keyboard_key_pressed::return
char keyboard_key_pressed::return#0 // reg byte a 144.625
char keyboard_key_pressed::return#10 // reg byte a 22.0
char keyboard_key_pressed::return#11 // reg byte a 22.0
char keyboard_key_pressed::return#12 // reg byte a 22.0
char keyboard_key_pressed::return#13 // reg byte a 22.0
char keyboard_key_pressed::return#14 // reg byte a 202.0
char keyboard_key_pressed::return#2 // reg byte a 22.0
char keyboard_key_pressed::rowidx
char keyboard_key_pressed::rowidx#0 // reg byte a 2002.0
__constant char keyboard_matrix_col_bitmask[8] = { 1, 2, 4, 8, $10, $20, $40, $80 }
char keyboard_matrix_read(char rowid)
char keyboard_matrix_read::return
char keyboard_matrix_read::return#0 // reg byte a 3667.333333333333
char keyboard_matrix_read::return#2 // reg byte a 2002.0
char keyboard_matrix_read::row_pressed_bits
char keyboard_matrix_read::rowid
char keyboard_matrix_read::rowid#0 // reg byte x 11002.0
__constant char keyboard_matrix_row_bitmask[8] = { $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f }
void main()
char main::$15 // reg byte a 22.0
char main::$18 // reg byte a 22.0
char main::$21 // reg byte a 22.0
char main::$24 // reg byte a 22.0
char main::$27 // reg byte a 22.0
char main::ch
char main::ch#1 // ch zp[1]:7 151.5
char main::ch#2 // ch zp[1]:7 25.25
char main::cur_pos
char main::cur_pos#11 // cur_pos zp[1]:5 8.52
char main::cur_pos#18 // cur_pos zp[1]:5 3.6666666666666665
char main::cur_pos#20 // cur_pos zp[1]:5 3.6666666666666665
char main::cur_pos#22 // cur_pos zp[1]:5 3.6666666666666665
char main::cur_pos#24 // cur_pos zp[1]:5 18.666666666666664
char main::i
char main::i#1 // i zp[1]:4 16.5
char main::i#2 // i zp[1]:4 11.0
char main::key
char main::key#0 // reg byte a 151.5
char main::pressed
char main::pressed#1 // reg byte a 202.0
char main::pressed#2 // reg byte a 202.0
char *main::sc
char *main::sc#1 // sc zp[2]:2 22.0
char *main::sc#2 // sc zp[2]:2 14.666666666666666
char main::shift
char main::shift#9 // shift zp[1]:6 5.315789473684211
__constant char main::str[3] = "f1"
__constant char main::str1[3] = "f3"
__constant char main::str2[3] = "f5"
__constant char main::str3[3] = "f7"
void plot_chargen(char pos , char ch , char shift)
unsigned int plot_chargen::$0 // zp[2]:8 2002.0
unsigned int plot_chargen::$15 // zp[2]:8 2002.0
char plot_chargen::$16 // reg byte a 2002.0
char plot_chargen::$17 // reg byte a 2002.0
char plot_chargen::$5 // reg byte a 2002.0
char plot_chargen::$8 // reg byte a 2.0000002E7
char plot_chargen::bits
char plot_chargen::bits#0 // bits zp[1]:11 2000002.0
char plot_chargen::bits#1 // bits zp[1]:11 6666667.333333333
char plot_chargen::bits#2 // bits zp[1]:11 4428572.0
char plot_chargen::c
char plot_chargen::c#2 // reg byte a 1.0000001E7
char plot_chargen::ch
char plot_chargen::ch#1 // reg byte a 101.0
char plot_chargen::ch#2 // reg byte a 50.5
char *plot_chargen::chargen
char *plot_chargen::chargen#0 // chargen zp[2]:8 1501.5
char *plot_chargen::chargen#1 // chargen zp[2]:8 2002.0
char *plot_chargen::chargen#4 // chargen zp[2]:8 47714.42857142857
char plot_chargen::pos
char plot_chargen::pos#0 // reg byte y 22.0
char plot_chargen::pos#1 // reg byte y 67.33333333333333
char plot_chargen::pos#2 // reg byte y 211.39999999999998
char *plot_chargen::sc
char *plot_chargen::sc#0 // sc zp[2]:12 2002.0
char *plot_chargen::sc#1 // sc zp[2]:12 5250000.75
char *plot_chargen::sc#2 // sc zp[2]:12 666667.3333333334
char *plot_chargen::sc#3 // sc zp[2]:12 5166667.333333333
char *plot_chargen::sc#7 // sc zp[2]:12 1000501.5
char plot_chargen::shift
char plot_chargen::shift#1 // reg byte x 202.0
char plot_chargen::shift#2 // reg byte x 220.39999999999998
char plot_chargen::x
char plot_chargen::x#1 // reg byte x 1.50000015E7
char plot_chargen::x#2 // reg byte x 2500000.25
char plot_chargen::y
char plot_chargen::y#1 // y zp[1]:10 1500001.5
char plot_chargen::y#2 // y zp[1]:10 230769.46153846153
void print_str_at(char *str , char *at)
char *print_str_at::at
char *print_str_at::at#4 // at zp[2]:12 101.0
char *print_str_at::at#5 // at zp[2]:12 104.66666666666666
char *print_str_at::at#7 // at zp[2]:12 11.0
char *print_str_at::str
char *print_str_at::str#4 // str zp[2]:8 202.0
char *print_str_at::str#5 // str zp[2]:8 103.75
char *print_str_at::str#7 // str zp[2]:8 11.0

zp[2]:2 [ main::sc#2 main::sc#1 ]
zp[1]:4 [ main::i#2 main::i#1 ]
zp[1]:5 [ main::cur_pos#18 main::cur_pos#20 main::cur_pos#22 main::cur_pos#24 main::cur_pos#11 ]
zp[1]:6 [ main::shift#9 ]
zp[1]:7 [ main::ch#2 main::ch#1 ]
reg byte a [ main::pressed#2 main::pressed#1 ]
reg byte a [ plot_chargen::ch#2 plot_chargen::ch#1 ]
reg byte x [ plot_chargen::shift#2 plot_chargen::shift#1 ]
reg byte y [ plot_chargen::pos#2 plot_chargen::pos#1 plot_chargen::pos#0 ]
zp[2]:8 [ plot_chargen::chargen#4 plot_chargen::chargen#0 plot_chargen::chargen#1 plot_chargen::$0 plot_chargen::$15 print_str_at::str#5 print_str_at::str#7 print_str_at::str#4 ]
zp[1]:10 [ plot_chargen::y#2 plot_chargen::y#1 ]
zp[1]:11 [ plot_chargen::bits#2 plot_chargen::bits#0 plot_chargen::bits#1 ]
zp[2]:12 [ plot_chargen::sc#3 plot_chargen::sc#7 plot_chargen::sc#0 plot_chargen::sc#2 plot_chargen::sc#1 print_str_at::at#5 print_str_at::at#7 print_str_at::at#4 ]
reg byte x [ plot_chargen::x#2 plot_chargen::x#1 ]
reg byte a [ plot_chargen::c#2 ]
reg byte x [ keyboard_key_pressed::key#6 keyboard_key_pressed::key#5 ]
reg byte a [ keyboard_key_pressed::return#2 ]
reg byte a [ main::$15 ]
reg byte a [ keyboard_key_pressed::return#10 ]
reg byte a [ main::$18 ]
reg byte a [ keyboard_key_pressed::return#11 ]
reg byte a [ main::$21 ]
reg byte a [ keyboard_key_pressed::return#12 ]
reg byte a [ main::$24 ]
reg byte a [ keyboard_key_pressed::return#13 ]
reg byte a [ main::$27 ]
reg byte x [ keyboard_get_keycode::ch#0 ]
reg byte a [ keyboard_get_keycode::return#2 ]
reg byte a [ main::key#0 ]
reg byte a [ keyboard_key_pressed::return#14 ]
reg byte a [ plot_chargen::$16 ]
reg byte a [ plot_chargen::$17 ]
reg byte a [ plot_chargen::$5 ]
reg byte a [ plot_chargen::$8 ]
reg byte y [ keyboard_key_pressed::colidx#0 ]
reg byte a [ keyboard_key_pressed::rowidx#0 ]
reg byte x [ keyboard_matrix_read::rowid#0 ]
reg byte a [ keyboard_matrix_read::return#2 ]
reg byte a [ keyboard_key_pressed::$2 ]
reg byte a [ keyboard_key_pressed::return#0 ]
reg byte a [ keyboard_get_keycode::return#0 ]
reg byte a [ keyboard_matrix_read::return#0 ]


FINAL ASSEMBLER
Score: 558979

  // File Comments
// Allows analysis of the CHARGEN ROM font
/// @file
/// Commodore 64 Registers and Constants
/// @file
/// The MOS 6526 Complex Interface Adapter (CIA)
///
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
  // Upstart
  // Commodore 64 PRG executable file
.file [name="chargen-analysis.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
  .const KEY_F7 = 3
  .const KEY_F1 = 4
  .const KEY_F3 = 5
  .const KEY_F5 = 6
  .const KEY_3 = 8
  .const KEY_W = 9
  .const KEY_A = $a
  .const KEY_4 = $b
  .const KEY_Z = $c
  .const KEY_S = $d
  .const KEY_E = $e
  .const KEY_LSHIFT = $f
  .const KEY_5 = $10
  .const KEY_R = $11
  .const KEY_D = $12
  .const KEY_6 = $13
  .const KEY_C = $14
  .const KEY_F = $15
  .const KEY_T = $16
  .const KEY_X = $17
  .const KEY_7 = $18
  .const KEY_Y = $19
  .const KEY_G = $1a
  .const KEY_8 = $1b
  .const KEY_B = $1c
  .const KEY_H = $1d
  .const KEY_U = $1e
  .const KEY_V = $1f
  .const KEY_9 = $20
  .const KEY_I = $21
  .const KEY_J = $22
  .const KEY_0 = $23
  .const KEY_M = $24
  .const KEY_K = $25
  .const KEY_O = $26
  .const KEY_N = $27
  .const KEY_PLUS = $28
  .const KEY_P = $29
  .const KEY_L = $2a
  .const KEY_MINUS = $2b
  .const KEY_DOT = $2c
  .const KEY_COLON = $2d
  .const KEY_AT = $2e
  .const KEY_COMMA = $2f
  .const KEY_POUND = $30
  .const KEY_ASTERISK = $31
  .const KEY_SEMICOLON = $32
  .const KEY_EQUALS = $35
  .const KEY_ARROW_UP = $36
  .const KEY_SLASH = $37
  .const KEY_1 = $38
  .const KEY_ARROW_LEFT = $39
  .const KEY_2 = $3b
  .const KEY_SPACE = $3c
  .const KEY_Q = $3e
  .const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
  /// Processor Port Register controlling RAM/ROM configuration and the datasette
  .label PROCPORT = 1
  /// The address of the CHARGEN character set
  .label CHARGEN = $d000
  /// The CIA#1: keyboard matrix, joystick #1/#2
  .label CIA1 = $dc00
  .label SCREEN = $400
.segment Code
  // main
main: {
    .label sc = 2
    .label i = 4
    .label ch = 7
    // Which char canvas to use
    .label cur_pos = 5
    // Is shift pressed
    .label shift = 6
    // [1] phi from main to main::@1 [phi:main->main::@1]
    // [1] phi main::sc#2 = SCREEN [phi:main->main::@1#0] -- pbuz1=pbuc1 
    lda #<SCREEN
    sta.z sc
    lda #>SCREEN
    sta.z sc+1
  // Clear screen
    // main::@1
  __b1:
    // for( char* sc=SCREEN;sc<SCREEN+1000;sc++)
    // [2] if(main::sc#2<SCREEN+$3e8) goto main::@2 -- pbuz1_lt_pbuc1_then_la1 
    lda.z sc+1
    cmp #>SCREEN+$3e8
    bcs !__b2+
    jmp __b2
  !__b2:
    bne !+
    lda.z sc
    cmp #<SCREEN+$3e8
    bcs !__b2+
    jmp __b2
  !__b2:
  !:
    // [3] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
    // main::@3
    // print_str_at("f1", SCREEN+1)
    // [4] call print_str_at
  // Plot 4 initial analysis chars
    // [67] phi from main::@3 to print_str_at [phi:main::@3->print_str_at]
    // [67] phi print_str_at::at#7 = SCREEN+1 [phi:main::@3->print_str_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+1
    sta.z print_str_at.at
    lda #>SCREEN+1
    sta.z print_str_at.at+1
    // [67] phi print_str_at::str#7 = main::str [phi:main::@3->print_str_at#1] -- pbuz1=pbuc1 
    lda #<str
    sta.z print_str_at.str
    lda #>str
    sta.z print_str_at.str+1
    jsr print_str_at
    // [5] phi from main::@3 to main::@17 [phi:main::@3->main::@17]
    // main::@17
    // print_str_at("f3", SCREEN+1+10)
    // [6] call print_str_at
    // [67] phi from main::@17 to print_str_at [phi:main::@17->print_str_at]
    // [67] phi print_str_at::at#7 = SCREEN+1+$a [phi:main::@17->print_str_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+1+$a
    sta.z print_str_at.at
    lda #>SCREEN+1+$a
    sta.z print_str_at.at+1
    // [67] phi print_str_at::str#7 = main::str1 [phi:main::@17->print_str_at#1] -- pbuz1=pbuc1 
    lda #<str1
    sta.z print_str_at.str
    lda #>str1
    sta.z print_str_at.str+1
    jsr print_str_at
    // [7] phi from main::@17 to main::@18 [phi:main::@17->main::@18]
    // main::@18
    // print_str_at("f5", SCREEN+1+20)
    // [8] call print_str_at
    // [67] phi from main::@18 to print_str_at [phi:main::@18->print_str_at]
    // [67] phi print_str_at::at#7 = SCREEN+1+$14 [phi:main::@18->print_str_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+1+$14
    sta.z print_str_at.at
    lda #>SCREEN+1+$14
    sta.z print_str_at.at+1
    // [67] phi print_str_at::str#7 = main::str2 [phi:main::@18->print_str_at#1] -- pbuz1=pbuc1 
    lda #<str2
    sta.z print_str_at.str
    lda #>str2
    sta.z print_str_at.str+1
    jsr print_str_at
    // [9] phi from main::@18 to main::@19 [phi:main::@18->main::@19]
    // main::@19
    // print_str_at("f7", SCREEN+1+30)
    // [10] call print_str_at
    // [67] phi from main::@19 to print_str_at [phi:main::@19->print_str_at]
    // [67] phi print_str_at::at#7 = SCREEN+1+$1e [phi:main::@19->print_str_at#0] -- pbuz1=pbuc1 
    lda #<SCREEN+1+$1e
    sta.z print_str_at.at
    lda #>SCREEN+1+$1e
    sta.z print_str_at.at+1
    // [67] phi print_str_at::str#7 = main::str3 [phi:main::@19->print_str_at#1] -- pbuz1=pbuc1 
    lda #<str3
    sta.z print_str_at.str
    lda #>str3
    sta.z print_str_at.str+1
    jsr print_str_at
    // [11] phi from main::@19 to main::@4 [phi:main::@19->main::@4]
    // [11] phi main::i#2 = 0 [phi:main::@19->main::@4#0] -- vbuz1=vbuc1 
    lda #0
    sta.z i
    // [11] phi from main::@20 to main::@4 [phi:main::@20->main::@4]
    // [11] phi main::i#2 = main::i#1 [phi:main::@20->main::@4#0] -- register_copy 
    // main::@4
  __b4:
    // plot_chargen(i, $20, 0)
    // [12] plot_chargen::pos#0 = main::i#2 -- vbuyy=vbuz1 
    ldy.z i
    // [13] call plot_chargen
    // [74] phi from main::@4 to plot_chargen [phi:main::@4->plot_chargen]
    // [74] phi plot_chargen::pos#2 = plot_chargen::pos#0 [phi:main::@4->plot_chargen#0] -- register_copy 
    // [74] phi plot_chargen::shift#2 = 0 [phi:main::@4->plot_chargen#1] -- vbuxx=vbuc1 
    ldx #0
    // [74] phi plot_chargen::ch#2 = $20 [phi:main::@4->plot_chargen#2] -- vbuaa=vbuc1 
    lda #$20
    jsr plot_chargen
    // main::@20
    // for(char i : 0..3 )
    // [14] main::i#1 = ++ main::i#2 -- vbuz1=_inc_vbuz1 
    inc.z i
    // [15] if(main::i#1!=4) goto main::@4 -- vbuz1_neq_vbuc1_then_la1 
    lda #4
    cmp.z i
    bne __b4
    // [16] phi from main::@20 to main::@5 [phi:main::@20->main::@5]
    // [16] phi main::cur_pos#24 = 0 [phi:main::@20->main::@5#0] -- vbuz1=vbuc1 
    lda #0
    sta.z cur_pos
    // main::@5
  __b5:
    // keyboard_key_pressed(KEY_F1)
    // [17] call keyboard_key_pressed
    // [105] phi from main::@5 to keyboard_key_pressed [phi:main::@5->keyboard_key_pressed]
    // [105] phi keyboard_key_pressed::key#6 = KEY_F1 [phi:main::@5->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_F1
    jsr keyboard_key_pressed
    // keyboard_key_pressed(KEY_F1)
    // [18] keyboard_key_pressed::return#2 = keyboard_key_pressed::return#0
    // main::@21
    // [19] main::$15 = keyboard_key_pressed::return#2
    // if(keyboard_key_pressed(KEY_F1)!=0)
    // [20] if(main::$15==0) goto main::@28 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b6
    // [22] phi from main::@21 to main::@6 [phi:main::@21->main::@6]
    // [22] phi main::cur_pos#22 = 0 [phi:main::@21->main::@6#0] -- vbuz1=vbuc1 
    lda #0
    sta.z cur_pos
    // [21] phi from main::@21 to main::@28 [phi:main::@21->main::@28]
    // main::@28
    // [22] phi from main::@28 to main::@6 [phi:main::@28->main::@6]
    // [22] phi main::cur_pos#22 = main::cur_pos#24 [phi:main::@28->main::@6#0] -- register_copy 
    // main::@6
  __b6:
    // keyboard_key_pressed(KEY_F3)
    // [23] call keyboard_key_pressed
    // [105] phi from main::@6 to keyboard_key_pressed [phi:main::@6->keyboard_key_pressed]
    // [105] phi keyboard_key_pressed::key#6 = KEY_F3 [phi:main::@6->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_F3
    jsr keyboard_key_pressed
    // keyboard_key_pressed(KEY_F3)
    // [24] keyboard_key_pressed::return#10 = keyboard_key_pressed::return#0
    // main::@22
    // [25] main::$18 = keyboard_key_pressed::return#10
    // if(keyboard_key_pressed(KEY_F3)!=0)
    // [26] if(main::$18==0) goto main::@29 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b7
    // [28] phi from main::@22 to main::@7 [phi:main::@22->main::@7]
    // [28] phi main::cur_pos#20 = 1 [phi:main::@22->main::@7#0] -- vbuz1=vbuc1 
    lda #1
    sta.z cur_pos
    // [27] phi from main::@22 to main::@29 [phi:main::@22->main::@29]
    // main::@29
    // [28] phi from main::@29 to main::@7 [phi:main::@29->main::@7]
    // [28] phi main::cur_pos#20 = main::cur_pos#22 [phi:main::@29->main::@7#0] -- register_copy 
    // main::@7
  __b7:
    // keyboard_key_pressed(KEY_F5)
    // [29] call keyboard_key_pressed
    // [105] phi from main::@7 to keyboard_key_pressed [phi:main::@7->keyboard_key_pressed]
    // [105] phi keyboard_key_pressed::key#6 = KEY_F5 [phi:main::@7->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_F5
    jsr keyboard_key_pressed
    // keyboard_key_pressed(KEY_F5)
    // [30] keyboard_key_pressed::return#11 = keyboard_key_pressed::return#0
    // main::@23
    // [31] main::$21 = keyboard_key_pressed::return#11
    // if(keyboard_key_pressed(KEY_F5)!=0)
    // [32] if(main::$21==0) goto main::@30 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b8
    // [34] phi from main::@23 to main::@8 [phi:main::@23->main::@8]
    // [34] phi main::cur_pos#18 = 2 [phi:main::@23->main::@8#0] -- vbuz1=vbuc1 
    lda #2
    sta.z cur_pos
    // [33] phi from main::@23 to main::@30 [phi:main::@23->main::@30]
    // main::@30
    // [34] phi from main::@30 to main::@8 [phi:main::@30->main::@8]
    // [34] phi main::cur_pos#18 = main::cur_pos#20 [phi:main::@30->main::@8#0] -- register_copy 
    // main::@8
  __b8:
    // keyboard_key_pressed(KEY_F7)
    // [35] call keyboard_key_pressed
    // [105] phi from main::@8 to keyboard_key_pressed [phi:main::@8->keyboard_key_pressed]
    // [105] phi keyboard_key_pressed::key#6 = KEY_F7 [phi:main::@8->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_F7
    jsr keyboard_key_pressed
    // keyboard_key_pressed(KEY_F7)
    // [36] keyboard_key_pressed::return#12 = keyboard_key_pressed::return#0
    // main::@24
    // [37] main::$24 = keyboard_key_pressed::return#12
    // if(keyboard_key_pressed(KEY_F7)!=0)
    // [38] if(main::$24==0) goto main::@31 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b9
    // [40] phi from main::@24 to main::@9 [phi:main::@24->main::@9]
    // [40] phi main::cur_pos#11 = 3 [phi:main::@24->main::@9#0] -- vbuz1=vbuc1 
    lda #3
    sta.z cur_pos
    // [39] phi from main::@24 to main::@31 [phi:main::@24->main::@31]
    // main::@31
    // [40] phi from main::@31 to main::@9 [phi:main::@31->main::@9]
    // [40] phi main::cur_pos#11 = main::cur_pos#18 [phi:main::@31->main::@9#0] -- register_copy 
    // main::@9
  __b9:
    // keyboard_key_pressed(KEY_LSHIFT)
    // [41] call keyboard_key_pressed
    // [105] phi from main::@9 to keyboard_key_pressed [phi:main::@9->keyboard_key_pressed]
    // [105] phi keyboard_key_pressed::key#6 = KEY_LSHIFT [phi:main::@9->keyboard_key_pressed#0] -- vbuxx=vbuc1 
    ldx #KEY_LSHIFT
    jsr keyboard_key_pressed
    // keyboard_key_pressed(KEY_LSHIFT)
    // [42] keyboard_key_pressed::return#13 = keyboard_key_pressed::return#0
    // main::@25
    // [43] main::$27 = keyboard_key_pressed::return#13
    // if(keyboard_key_pressed(KEY_LSHIFT)!=0)
    // [44] if(main::$27!=0) goto main::@10 -- vbuaa_neq_0_then_la1 
    cmp #0
    bne __b10
    // [46] phi from main::@25 to main::@11 [phi:main::@25->main::@11]
    // [46] phi main::shift#9 = 0 [phi:main::@25->main::@11#0] -- vbuz1=vbuc1 
    lda #0
    sta.z shift
    jmp __b11
    // [45] phi from main::@25 to main::@10 [phi:main::@25->main::@10]
    // main::@10
  __b10:
    // [46] phi from main::@10 to main::@11 [phi:main::@10->main::@11]
    // [46] phi main::shift#9 = 1 [phi:main::@10->main::@11#0] -- vbuz1=vbuc1 
    lda #1
    sta.z shift
    // main::@11
  __b11:
    // [47] phi from main::@11 to main::@12 [phi:main::@11->main::@12]
    // [47] phi main::ch#2 = 0 [phi:main::@11->main::@12#0] -- vbuz1=vbuc1 
    lda #0
    sta.z ch
  // Check for key presses - and plot char if found
    // [47] phi from main::@14 to main::@12 [phi:main::@14->main::@12]
    // [47] phi main::ch#2 = main::ch#1 [phi:main::@14->main::@12#0] -- register_copy 
    // main::@12
  __b12:
    // char key = keyboard_get_keycode(ch)
    // [48] keyboard_get_keycode::ch#0 = main::ch#2 -- vbuxx=vbuz1 
    ldx.z ch
    // [49] call keyboard_get_keycode
    jsr keyboard_get_keycode
    // [50] keyboard_get_keycode::return#2 = keyboard_get_keycode::return#0
    // main::@26
    // [51] main::key#0 = keyboard_get_keycode::return#2
    // if(key!=$3f)
    // [52] if(main::key#0==$3f) goto main::@13 -- vbuaa_eq_vbuc1_then_la1 
    cmp #$3f
    beq __b3
    // main::@15
    // keyboard_key_pressed(key)
    // [53] keyboard_key_pressed::key#5 = main::key#0 -- vbuxx=vbuaa 
    tax
    // [54] call keyboard_key_pressed
    // [105] phi from main::@15 to keyboard_key_pressed [phi:main::@15->keyboard_key_pressed]
    // [105] phi keyboard_key_pressed::key#6 = keyboard_key_pressed::key#5 [phi:main::@15->keyboard_key_pressed#0] -- register_copy 
    jsr keyboard_key_pressed
    // keyboard_key_pressed(key)
    // [55] keyboard_key_pressed::return#14 = keyboard_key_pressed::return#0
    // main::@27
    // pressed = keyboard_key_pressed(key)
    // [56] main::pressed#1 = keyboard_key_pressed::return#14
    // [57] phi from main::@27 to main::@13 [phi:main::@27->main::@13]
    // [57] phi main::pressed#2 = main::pressed#1 [phi:main::@27->main::@13#0] -- register_copy 
    jmp __b13
    // [57] phi from main::@26 to main::@13 [phi:main::@26->main::@13]
  __b3:
    // [57] phi main::pressed#2 = 0 [phi:main::@26->main::@13#0] -- vbuaa=vbuc1 
    lda #0
    // main::@13
  __b13:
    // if(pressed!=0)
    // [58] if(main::pressed#2==0) goto main::@14 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b14
    // main::@16
    // plot_chargen(cur_pos, ch, shift)
    // [59] plot_chargen::pos#1 = main::cur_pos#11 -- vbuyy=vbuz1 
    ldy.z cur_pos
    // [60] plot_chargen::ch#1 = main::ch#2 -- vbuaa=vbuz1 
    lda.z ch
    // [61] plot_chargen::shift#1 = main::shift#9 -- vbuxx=vbuz1 
    ldx.z shift
    // [62] call plot_chargen
    // [74] phi from main::@16 to plot_chargen [phi:main::@16->plot_chargen]
    // [74] phi plot_chargen::pos#2 = plot_chargen::pos#1 [phi:main::@16->plot_chargen#0] -- register_copy 
    // [74] phi plot_chargen::shift#2 = plot_chargen::shift#1 [phi:main::@16->plot_chargen#1] -- register_copy 
    // [74] phi plot_chargen::ch#2 = plot_chargen::ch#1 [phi:main::@16->plot_chargen#2] -- register_copy 
    jsr plot_chargen
    // main::@14
  __b14:
    // for( char ch : 0..$3f)
    // [63] main::ch#1 = ++ main::ch#2 -- vbuz1=_inc_vbuz1 
    inc.z ch
    // [64] if(main::ch#1!=$40) goto main::@12 -- vbuz1_neq_vbuc1_then_la1 
    lda #$40
    cmp.z ch
    bne __b12
    // [16] phi from main::@14 to main::@5 [phi:main::@14->main::@5]
    // [16] phi main::cur_pos#24 = main::cur_pos#11 [phi:main::@14->main::@5#0] -- register_copy 
    jmp __b5
    // main::@2
  __b2:
    // *sc = ' '
    // [65] *main::sc#2 = ' ' -- _deref_pbuz1=vbuc1 
    lda #' '
    ldy #0
    sta (sc),y
    // for( char* sc=SCREEN;sc<SCREEN+1000;sc++)
    // [66] main::sc#1 = ++ main::sc#2 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
    // [1] phi main::sc#2 = main::sc#1 [phi:main::@2->main::@1#0] -- register_copy 
    jmp __b1
  .segment Data
    str: .text "f1"
    .byte 0
    str1: .text "f3"
    .byte 0
    str2: .text "f5"
    .byte 0
    str3: .text "f7"
    .byte 0
}
.segment Code
  // print_str_at
// Print a string at a specific screen position
// void print_str_at(__zp(8) char *str, __zp($c) char *at)
print_str_at: {
    .label at = $c
    .label str = 8
    // [68] phi from print_str_at print_str_at::@2 to print_str_at::@1 [phi:print_str_at/print_str_at::@2->print_str_at::@1]
    // [68] phi print_str_at::at#5 = print_str_at::at#7 [phi:print_str_at/print_str_at::@2->print_str_at::@1#0] -- register_copy 
    // [68] phi print_str_at::str#5 = print_str_at::str#7 [phi:print_str_at/print_str_at::@2->print_str_at::@1#1] -- register_copy 
    // print_str_at::@1
  __b1:
    // while(*str)
    // [69] if(0!=*print_str_at::str#5) goto print_str_at::@2 -- 0_neq__deref_pbuz1_then_la1 
    ldy #0
    lda (str),y
    cmp #0
    bne __b2
    // print_str_at::@return
    // }
    // [70] return 
    rts
    // print_str_at::@2
  __b2:
    // *(at++) = *(str++)
    // [71] *print_str_at::at#5 = *print_str_at::str#5 -- _deref_pbuz1=_deref_pbuz2 
    ldy #0
    lda (str),y
    sta (at),y
    // *(at++) = *(str++);
    // [72] print_str_at::at#4 = ++ print_str_at::at#5 -- pbuz1=_inc_pbuz1 
    inc.z at
    bne !+
    inc.z at+1
  !:
    // [73] print_str_at::str#4 = ++ print_str_at::str#5 -- pbuz1=_inc_pbuz1 
    inc.z str
    bne !+
    inc.z str+1
  !:
    jmp __b1
}
  // plot_chargen
// Render 8x8 char (ch) as pixels on char canvas #pos
// void plot_chargen(__register(Y) char pos, __register(A) char ch, __register(X) char shift)
plot_chargen: {
    .label __0 = 8
    .label __15 = 8
    .label chargen = 8
    .label sc = $c
    .label bits = $b
    .label y = $a
    // asm
    // asm { sei  }
    sei
    // (unsigned int)ch*8
    // [76] plot_chargen::$15 = (unsigned int)plot_chargen::ch#2 -- vwuz1=_word_vbuaa 
    sta.z __15
    lda #0
    sta.z __15+1
    // [77] plot_chargen::$0 = plot_chargen::$15 << 3 -- vwuz1=vwuz1_rol_3 
    asl.z __0
    rol.z __0+1
    asl.z __0
    rol.z __0+1
    asl.z __0
    rol.z __0+1
    // char* chargen = CHARGEN+(unsigned int)ch*8
    // [78] plot_chargen::chargen#0 = CHARGEN + plot_chargen::$0 -- pbuz1=pbuc1_plus_vwuz1 
    lda.z chargen
    clc
    adc #<CHARGEN
    sta.z chargen
    lda.z chargen+1
    adc #>CHARGEN
    sta.z chargen+1
    // if(shift!=0)
    // [79] if(plot_chargen::shift#2==0) goto plot_chargen::@1 -- vbuxx_eq_0_then_la1 
    cpx #0
    beq __b1
    // plot_chargen::@2
    // chargen = chargen + $0800
    // [80] plot_chargen::chargen#1 = plot_chargen::chargen#0 + $800 -- pbuz1=pbuz1_plus_vwuc1 
    lda.z chargen
    clc
    adc #<$800
    sta.z chargen
    lda.z chargen+1
    adc #>$800
    sta.z chargen+1
    // [81] phi from plot_chargen plot_chargen::@2 to plot_chargen::@1 [phi:plot_chargen/plot_chargen::@2->plot_chargen::@1]
    // [81] phi plot_chargen::chargen#4 = plot_chargen::chargen#0 [phi:plot_chargen/plot_chargen::@2->plot_chargen::@1#0] -- register_copy 
    // plot_chargen::@1
  __b1:
    // *PROCPORT = $32
    // [82] *PROCPORT = $32 -- _deref_pbuc1=vbuc2 
    lda #$32
    sta PROCPORT
    // pos*10
    // [83] plot_chargen::$16 = plot_chargen::pos#2 << 2 -- vbuaa=vbuyy_rol_2 
    tya
    asl
    asl
    // [84] plot_chargen::$17 = plot_chargen::$16 + plot_chargen::pos#2 -- vbuaa=vbuaa_plus_vbuyy 
    sty.z $ff
    clc
    adc.z $ff
    // [85] plot_chargen::$5 = plot_chargen::$17 << 1 -- vbuaa=vbuaa_rol_1 
    asl
    // char* sc = SCREEN + 41 + pos*10
    // [86] plot_chargen::sc#0 = SCREEN+$29 + plot_chargen::$5 -- pbuz1=pbuc1_plus_vbuaa 
    clc
    adc #<SCREEN+$29
    sta.z sc
    lda #>SCREEN+$29
    adc #0
    sta.z sc+1
    // [87] phi from plot_chargen::@1 to plot_chargen::@3 [phi:plot_chargen::@1->plot_chargen::@3]
    // [87] phi plot_chargen::sc#7 = plot_chargen::sc#0 [phi:plot_chargen::@1->plot_chargen::@3#0] -- register_copy 
    // [87] phi plot_chargen::y#2 = 0 [phi:plot_chargen::@1->plot_chargen::@3#1] -- vbuz1=vbuc1 
    lda #0
    sta.z y
    // [87] phi from plot_chargen::@7 to plot_chargen::@3 [phi:plot_chargen::@7->plot_chargen::@3]
    // [87] phi plot_chargen::sc#7 = plot_chargen::sc#2 [phi:plot_chargen::@7->plot_chargen::@3#0] -- register_copy 
    // [87] phi plot_chargen::y#2 = plot_chargen::y#1 [phi:plot_chargen::@7->plot_chargen::@3#1] -- register_copy 
    // plot_chargen::@3
  __b3:
    // char bits = chargen[y]
    // [88] plot_chargen::bits#0 = plot_chargen::chargen#4[plot_chargen::y#2] -- vbuz1=pbuz2_derefidx_vbuz3 
    ldy.z y
    lda (chargen),y
    sta.z bits
    // [89] phi from plot_chargen::@3 to plot_chargen::@4 [phi:plot_chargen::@3->plot_chargen::@4]
    // [89] phi plot_chargen::x#2 = 0 [phi:plot_chargen::@3->plot_chargen::@4#0] -- vbuxx=vbuc1 
    ldx #0
    // [89] phi plot_chargen::sc#3 = plot_chargen::sc#7 [phi:plot_chargen::@3->plot_chargen::@4#1] -- register_copy 
    // [89] phi plot_chargen::bits#2 = plot_chargen::bits#0 [phi:plot_chargen::@3->plot_chargen::@4#2] -- register_copy 
    // [89] phi from plot_chargen::@5 to plot_chargen::@4 [phi:plot_chargen::@5->plot_chargen::@4]
    // [89] phi plot_chargen::x#2 = plot_chargen::x#1 [phi:plot_chargen::@5->plot_chargen::@4#0] -- register_copy 
    // [89] phi plot_chargen::sc#3 = plot_chargen::sc#1 [phi:plot_chargen::@5->plot_chargen::@4#1] -- register_copy 
    // [89] phi plot_chargen::bits#2 = plot_chargen::bits#1 [phi:plot_chargen::@5->plot_chargen::@4#2] -- register_copy 
    // plot_chargen::@4
  __b4:
    // bits & $80
    // [90] plot_chargen::$8 = plot_chargen::bits#2 & $80 -- vbuaa=vbuz1_band_vbuc1 
    lda #$80
    and.z bits
    // if((bits & $80) != 0)
    // [91] if(plot_chargen::$8==0) goto plot_chargen::@5 -- vbuaa_eq_0_then_la1 
    cmp #0
    beq __b2
    // [92] phi from plot_chargen::@4 to plot_chargen::@6 [phi:plot_chargen::@4->plot_chargen::@6]
    // plot_chargen::@6
    // [93] phi from plot_chargen::@6 to plot_chargen::@5 [phi:plot_chargen::@6->plot_chargen::@5]
    // [93] phi plot_chargen::c#2 = '*' [phi:plot_chargen::@6->plot_chargen::@5#0] -- vbuaa=vbuc1 
    lda #'*'
    jmp __b5
    // [93] phi from plot_chargen::@4 to plot_chargen::@5 [phi:plot_chargen::@4->plot_chargen::@5]
  __b2:
    // [93] phi plot_chargen::c#2 = '.' [phi:plot_chargen::@4->plot_chargen::@5#0] -- vbuaa=vbuc1 
    lda #'.'
    // plot_chargen::@5
  __b5:
    // *sc = c
    // [94] *plot_chargen::sc#3 = plot_chargen::c#2 -- _deref_pbuz1=vbuaa 
    ldy #0
    sta (sc),y
    // sc++;
    // [95] plot_chargen::sc#1 = ++ plot_chargen::sc#3 -- pbuz1=_inc_pbuz1 
    inc.z sc
    bne !+
    inc.z sc+1
  !:
    // bits = bits*2
    // [96] plot_chargen::bits#1 = plot_chargen::bits#2 << 1 -- vbuz1=vbuz1_rol_1 
    asl.z bits
    // for(char x:0..7)
    // [97] plot_chargen::x#1 = ++ plot_chargen::x#2 -- vbuxx=_inc_vbuxx 
    inx
    // [98] if(plot_chargen::x#1!=8) goto plot_chargen::@4 -- vbuxx_neq_vbuc1_then_la1 
    cpx #8
    bne __b4
    // plot_chargen::@7
    // sc = sc+32
    // [99] plot_chargen::sc#2 = plot_chargen::sc#1 + $20 -- pbuz1=pbuz1_plus_vbuc1 
    lda #$20
    clc
    adc.z sc
    sta.z sc
    bcc !+
    inc.z sc+1
  !:
    // for(char y:0..7)
    // [100] plot_chargen::y#1 = ++ plot_chargen::y#2 -- vbuz1=_inc_vbuz1 
    inc.z y
    // [101] if(plot_chargen::y#1!=8) goto plot_chargen::@3 -- vbuz1_neq_vbuc1_then_la1 
    lda #8
    cmp.z y
    bne __b3
    // plot_chargen::@8
    // *PROCPORT = $37
    // [102] *PROCPORT = $37 -- _deref_pbuc1=vbuc2 
    lda #$37
    sta PROCPORT
    // asm
    // asm { cli  }
    cli
    // plot_chargen::@return
    // }
    // [104] return 
    rts
}
  // keyboard_key_pressed
// Determines whether a specific key is currently pressed by accessing the matrix directly
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// __register(A) char keyboard_key_pressed(__register(X) char key)
keyboard_key_pressed: {
    // char colidx = key&7
    // [106] keyboard_key_pressed::colidx#0 = keyboard_key_pressed::key#6 & 7 -- vbuyy=vbuxx_band_vbuc1 
    txa
    and #7
    tay
    // char rowidx = key>>3
    // [107] keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#6 >> 3 -- vbuaa=vbuxx_ror_3 
    txa
    lsr
    lsr
    lsr
    // keyboard_matrix_read(rowidx)
    // [108] keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 -- vbuxx=vbuaa 
    tax
    // [109] call keyboard_matrix_read
    jsr keyboard_matrix_read
    // [110] keyboard_matrix_read::return#2 = keyboard_matrix_read::return#0
    // keyboard_key_pressed::@1
    // [111] keyboard_key_pressed::$2 = keyboard_matrix_read::return#2
    // keyboard_matrix_read(rowidx) & keyboard_matrix_col_bitmask[colidx]
    // [112] keyboard_key_pressed::return#0 = keyboard_key_pressed::$2 & keyboard_matrix_col_bitmask[keyboard_key_pressed::colidx#0] -- vbuaa=vbuaa_band_pbuc1_derefidx_vbuyy 
    and keyboard_matrix_col_bitmask,y
    // keyboard_key_pressed::@return
    // }
    // [113] return 
    rts
}
  // keyboard_get_keycode
// Get the keycode corresponding to a specific screen code character
// ch is the character to get the key code for ($00-$3f)
// Returns the key code corresponding to the passed character. Only characters with a non-shifted key are handled.
// If there is no non-shifted key representing the char $3f is returned (representing RUN/STOP) .
// __register(A) char keyboard_get_keycode(__register(X) char ch)
keyboard_get_keycode: {
    // return keyboard_char_keycodes[ch];
    // [114] keyboard_get_keycode::return#0 = keyboard_char_keycodes[keyboard_get_keycode::ch#0] -- vbuaa=pbuc1_derefidx_vbuxx 
    lda keyboard_char_keycodes,x
    // keyboard_get_keycode::@return
    // }
    // [115] return 
    rts
}
  // keyboard_matrix_read
// Read a single row of the keyboard matrix
// The row ID (0-7) of the keyboard matrix row to read. See the C64 key matrix for row IDs.
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// __register(A) char keyboard_matrix_read(__register(X) char rowid)
keyboard_matrix_read: {
    // CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid]
    // [116] *((char *)CIA1) = keyboard_matrix_row_bitmask[keyboard_matrix_read::rowid#0] -- _deref_pbuc1=pbuc2_derefidx_vbuxx 
    lda keyboard_matrix_row_bitmask,x
    sta CIA1
    // char row_pressed_bits = ~CIA1->PORT_B
    // [117] keyboard_matrix_read::return#0 = ~ *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuaa=_bnot__deref_pbuc1 
    lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
    eor #$ff
    // keyboard_matrix_read::@return
    // }
    // [118] return 
    rts
}
  // File Data
.segment Data
  // Keycodes for each screen code character from $00-$3f.
  // Chars that do not have an unmodified keycode return $3f (representing RUN/STOP).
  keyboard_char_keycodes: .byte KEY_AT, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, $3f, KEY_POUND, $3f, KEY_ARROW_UP, KEY_ARROW_LEFT, KEY_SPACE, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, KEY_ASTERISK, KEY_PLUS, KEY_COMMA, KEY_MINUS, KEY_DOT, KEY_SLASH, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON, $3f, KEY_EQUALS, $3f, $3f
  // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7)
  keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f
  // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7)
  keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80

