
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/(char *) 1024, main::@2/main::sc#1 )
  [2] if(main::sc#2<$400+$3e8) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@1
  [3] phi()
  [4] call keyboard_init
  to:main::@4
main::@4: scope:[main]  from main::@16 main::@3 main::@4
  [5] if(*RASTER!=$ff) goto main::@4
  to:main::@5
main::@5: scope:[main]  from main::@10 main::@4
  [6] main::screen#13 = phi( main::@10/main::screen#1, main::@4/(char *) 1024 )
  [6] main::row#2 = phi( main::@10/main::row#1, main::@4/0 )
  [7] keyboard_matrix_read::rowid#1 = main::row#2
  [8] call keyboard_matrix_read
  [9] keyboard_matrix_read::return#3 = keyboard_matrix_read::return#0
  to:main::@17
main::@17: scope:[main]  from main::@5
  [10] main::row_pressed_bits#0 = keyboard_matrix_read::return#3
  to:main::@6
main::@6: scope:[main]  from main::@17 main::@8
  [11] main::col#2 = phi( main::@8/main::col#1, main::@17/0 )
  [11] main::row_pressed_bits#2 = phi( main::@8/main::row_pressed_bits#1, main::@17/main::row_pressed_bits#0 )
  [12] main::$4 = main::row_pressed_bits#2 & $80
  [13] if(main::$4!=0) goto main::@7
  to:main::@9
main::@9: scope:[main]  from main::@6
  [14] main::screen#13[main::col#2] = '0'
  to:main::@8
main::@8: scope:[main]  from main::@7 main::@9
  [15] main::row_pressed_bits#1 = main::row_pressed_bits#2 << 1
  [16] main::col#1 = ++ main::col#2
  [17] if(main::col#1!=8) goto main::@6
  to:main::@10
main::@10: scope:[main]  from main::@8
  [18] main::screen#1 = main::screen#13 + $28
  [19] main::row#1 = ++ main::row#2
  [20] if(main::row#1!=8) goto main::@5
  to:main::@11
main::@11: scope:[main]  from main::@10
  [21] main::screen#2 = main::screen#1 + $28
  to:main::@12
main::@12: scope:[main]  from main::@11 main::@13
  [22] main::i#3 = phi( main::@11/0, main::@13/main::i#6 )
  [22] main::ch#2 = phi( main::@11/0, main::@13/main::ch#1 )
  [23] keyboard_get_keycode::ch#0 = main::ch#2
  [24] call keyboard_get_keycode
  [25] keyboard_get_keycode::return#2 = keyboard_get_keycode::return#0
  to:main::@18
main::@18: scope:[main]  from main::@12
  [26] main::key#0 = keyboard_get_keycode::return#2
  [27] if(main::key#0==$3f) goto main::@13
  to:main::@14
main::@14: scope:[main]  from main::@18
  [28] keyboard_key_pressed::key#0 = main::key#0
  [29] call keyboard_key_pressed
  [30] keyboard_key_pressed::return#2 = keyboard_key_pressed::return#0
  to:main::@19
main::@19: scope:[main]  from main::@14
  [31] main::$14 = keyboard_key_pressed::return#2
  [32] if(main::$14==0) goto main::@13
  to:main::@15
main::@15: scope:[main]  from main::@19
  [33] main::screen#2[main::i#3] = main::ch#2
  [34] main::i#1 = ++ main::i#3
  to:main::@13
main::@13: scope:[main]  from main::@15 main::@18 main::@19
  [35] main::i#6 = phi( main::@15/main::i#1, main::@18/main::i#3, main::@19/main::i#3 )
  [36] main::ch#1 = ++ main::ch#2
  [37] if(main::ch#1!=$40) goto main::@12
  to:main::@16
main::@16: scope:[main]  from main::@13 main::@16
  [38] main::i#4 = phi( main::@13/main::i#6, main::@16/main::i#2 )
  [39] main::screen#2[main::i#4] = ' '
  [40] main::i#2 = ++ main::i#4
  [41] if(main::i#2<5) goto main::@16
  to:main::@4
main::@7: scope:[main]  from main::@6
  [42] main::screen#13[main::col#2] = '1'
  to:main::@8
main::@2: scope:[main]  from main::@1
  [43] *main::sc#2 = ' '
  [44] main::sc#1 = ++ main::sc#2
  to:main::@1

void keyboard_init()
keyboard_init: scope:[keyboard_init]  from main::@3
  [45] *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = $ff
  [46] *((char *)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) = 0
  to:keyboard_init::@return
keyboard_init::@return: scope:[keyboard_init]  from keyboard_init
  [47] return 
  to:@return

char keyboard_matrix_read(char rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read]  from keyboard_key_pressed main::@5
  [48] keyboard_matrix_read::rowid#2 = phi( keyboard_key_pressed/keyboard_matrix_read::rowid#0, main::@5/keyboard_matrix_read::rowid#1 )
  [49] *((char *)CIA1) = keyboard_matrix_row_bitmask[keyboard_matrix_read::rowid#2]
  [50] 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
  [51] return 
  to:@return

char keyboard_get_keycode(char ch)
keyboard_get_keycode: scope:[keyboard_get_keycode]  from main::@12
  [52] 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
  [53] return 
  to:@return

char keyboard_key_pressed(char key)
keyboard_key_pressed: scope:[keyboard_key_pressed]  from main::@14
  [54] keyboard_key_pressed::colidx#0 = keyboard_key_pressed::key#0 & 7
  [55] keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#0 >> 3
  [56] keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0
  [57] call keyboard_matrix_read
  [58] 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
  [59] keyboard_key_pressed::$2 = keyboard_matrix_read::return#2
  [60] 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
  [61] return 
  to:@return
