
void __start()
__start: scope:[__start]  from
  [0] phi()
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  [1] conio_screen_width = 0
  [2] conio_screen_height = 0
  [3] conio_screen_layer = 1
  [4] conio_width = 0
  [5] conio_height = 0
  [6] conio_rowshift = 0
  [7] conio_rowskip = 0
  [8] call conio_x16_init
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  [9] phi()
  [10] call main
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  [11] return 
  to:@return

void conio_x16_init()
conio_x16_init: scope:[conio_x16_init]  from __start::__init1
  [12] conio_x16_init::line#0 = *conio_x16_init::BASIC_CURSOR_LINE
  [13] call vera_layer_mode_text
  to:conio_x16_init::@3
conio_x16_init::@3: scope:[conio_x16_init]  from conio_x16_init
  [14] phi()
  [15] call screensize
  to:conio_x16_init::@4
conio_x16_init::@4: scope:[conio_x16_init]  from conio_x16_init::@3
  [16] phi()
  [17] call screenlayer
  to:conio_x16_init::@5
conio_x16_init::@5: scope:[conio_x16_init]  from conio_x16_init::@4
  [18] phi()
  [19] call vera_layer_set_textcolor
  to:conio_x16_init::@6
conio_x16_init::@6: scope:[conio_x16_init]  from conio_x16_init::@5
  [20] phi()
  [21] call vera_layer_set_backcolor
  to:conio_x16_init::@7
conio_x16_init::@7: scope:[conio_x16_init]  from conio_x16_init::@6
  [22] phi()
  [23] call vera_layer_set_mapbase
  to:conio_x16_init::@8
conio_x16_init::@8: scope:[conio_x16_init]  from conio_x16_init::@7
  [24] phi()
  [25] call vera_layer_set_mapbase
  to:conio_x16_init::@9
conio_x16_init::@9: scope:[conio_x16_init]  from conio_x16_init::@8
  [26] if(conio_x16_init::line#0<conio_screen_height) goto conio_x16_init::@1
  to:conio_x16_init::@2
conio_x16_init::@2: scope:[conio_x16_init]  from conio_x16_init::@9
  [27] conio_x16_init::line#1 = conio_screen_height - 1
  to:conio_x16_init::@1
conio_x16_init::@1: scope:[conio_x16_init]  from conio_x16_init::@2 conio_x16_init::@9
  [28] conio_x16_init::line#3 = phi( conio_x16_init::@2/conio_x16_init::line#1, conio_x16_init::@9/conio_x16_init::line#0 )
  [29] gotoxy::y#1 = conio_x16_init::line#3
  [30] call gotoxy
  to:conio_x16_init::@return
conio_x16_init::@return: scope:[conio_x16_init]  from conio_x16_init::@1
  [31] return 
  to:@return

__stackcall void cputc(char c)
cputc: scope:[cputc]  from printf_str::@2
  [32] CONIO_SCREEN_BANK#11 = phi( )
  [32] CONIO_SCREEN_TEXT#11 = phi( )
  [33] cputc::c#0 = stackidx(char,cputc::OFFSET_STACK_C)
  [34] vera_layer_get_color::layer#0 = conio_screen_layer
  [35] call vera_layer_get_color
  [36] vera_layer_get_color::return#3 = vera_layer_get_color::return#2
  to:cputc::@7
cputc::@7: scope:[cputc]  from cputc
  [37] cputc::color#0 = vera_layer_get_color::return#3
  [38] cputc::$15 = conio_screen_layer << 1
  [39] cputc::conio_addr#0 = CONIO_SCREEN_TEXT#11 + conio_line_text[cputc::$15]
  [40] cputc::$2 = conio_cursor_x[conio_screen_layer] << 1
  [41] cputc::conio_addr#1 = cputc::conio_addr#0 + cputc::$2
  [42] if(cputc::c#0=='
') goto cputc::@1
  to:cputc::@2
cputc::@2: scope:[cputc]  from cputc::@7
  [43] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL
  [44] cputc::$4 = byte0  cputc::conio_addr#1
  [45] *VERA_ADDRX_L = cputc::$4
  [46] cputc::$5 = byte1  cputc::conio_addr#1
  [47] *VERA_ADDRX_M = cputc::$5
  [48] cputc::$6 = CONIO_SCREEN_BANK#11 | VERA_INC_1
  [49] *VERA_ADDRX_H = cputc::$6
  [50] *VERA_DATA0 = cputc::c#0
  [51] *VERA_DATA0 = cputc::color#0
  [52] conio_cursor_x[conio_screen_layer] = ++ conio_cursor_x[conio_screen_layer]
  [53] cputc::scroll_enable#0 = conio_scroll_enable[conio_screen_layer]
  [54] if(0!=cputc::scroll_enable#0) goto cputc::@5
  to:cputc::@3
cputc::@3: scope:[cputc]  from cputc::@2
  [55] cputc::$16 = (unsigned int)conio_cursor_x[conio_screen_layer]
  [56] if(cputc::$16!=conio_width) goto cputc::@return
  to:cputc::@4
cputc::@4: scope:[cputc]  from cputc::@3
  [57] phi()
  [58] call cputln
  to:cputc::@return
cputc::@return: scope:[cputc]  from cputc::@1 cputc::@3 cputc::@4 cputc::@5 cputc::@6
  [59] return 
  to:@return
cputc::@5: scope:[cputc]  from cputc::@2
  [60] if(conio_cursor_x[conio_screen_layer]!=conio_screen_width) goto cputc::@return
  to:cputc::@6
cputc::@6: scope:[cputc]  from cputc::@5
  [61] phi()
  [62] call cputln
  to:cputc::@return
cputc::@1: scope:[cputc]  from cputc::@7
  [63] phi()
  [64] call cputln
  to:cputc::@return

void main()
main: scope:[main]  from __start::@1
  [65] phi()
  [66] call vera_layer_set_text_color_mode
  to:main::@1
main::@1: scope:[main]  from main
  [67] phi()
  [68] call screenlayer
  to:main::@2
main::@2: scope:[main]  from main::@1
  [69] phi()
  [70] call clrscr
  to:main::@3
main::@3: scope:[main]  from main::@2
  [71] phi()
  [72] call printf_str
  to:main::@4
main::@4: scope:[main]  from main::@3
  [73] *(&main::SPRITE_ATTR) = memcpy(*(&$0), struct VERA_SPRITE, SIZEOF_STRUCT_VERA_SPRITE)
  [74] call load_to_bank
  to:main::@5
main::@5: scope:[main]  from main::@4
  [75] phi()
  [76] call memcpy_bank_to_vram
  to:main::@6
main::@6: scope:[main]  from main::@5
  [77] phi()
  [78] call memcpy_bank_to_vram
  to:main::@7
main::@7: scope:[main]  from main::@6
  [79] *((unsigned int *)&main::SPRITE_ATTR) = word0 main::VRAM_SPRITE/$20
  [80] *((unsigned int *)&main::SPRITE_ATTR+OFFSET_STRUCT_VERA_SPRITE_X) = $64
  [81] *((unsigned int *)&main::SPRITE_ATTR+OFFSET_STRUCT_VERA_SPRITE_Y) = $64
  [82] call memcpy_to_vram
  to:main::@8
main::@8: scope:[main]  from main::@7
  [83] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL
  [84] *VERA_DC_VIDEO = *VERA_DC_VIDEO | VERA_SPRITES_ENABLE
  to:main::@return
main::@return: scope:[main]  from main::@8
  [85] return 
  to:@return

void vera_layer_mode_text(char layer , unsigned long mapbase_address , unsigned long tilebase_address , unsigned int mapwidth , unsigned int mapheight , char tilewidth , char tileheight , unsigned int color_mode)
vera_layer_mode_text: scope:[vera_layer_mode_text]  from conio_x16_init
  [86] phi()
  [87] call vera_layer_mode_tile
  to:vera_layer_mode_text::@1
vera_layer_mode_text::@1: scope:[vera_layer_mode_text]  from vera_layer_mode_text
  [88] phi()
  [89] call vera_layer_set_text_color_mode
  to:vera_layer_mode_text::@return
vera_layer_mode_text::@return: scope:[vera_layer_mode_text]  from vera_layer_mode_text::@1
  [90] return 
  to:@return

void screensize(char *x , char *y)
screensize: scope:[screensize]  from conio_x16_init::@3
  [91] screensize::hscale#0 = *VERA_DC_HSCALE >> 7
  [92] screensize::$1 = $28 << screensize::hscale#0
  [93] *screensize::x#0 = screensize::$1
  [94] screensize::vscale#0 = *VERA_DC_VSCALE >> 7
  [95] screensize::$3 = $1e << screensize::vscale#0
  [96] *screensize::y#0 = screensize::$3
  to:screensize::@return
screensize::@return: scope:[screensize]  from screensize
  [97] return 
  to:@return

void screenlayer(char layer)
screenlayer: scope:[screenlayer]  from conio_x16_init::@4 main::@1
  [98] conio_screen_layer = 1
  [99] vera_layer_get_mapbase_bank::layer#0 = conio_screen_layer
  [100] call vera_layer_get_mapbase_bank
  [101] vera_layer_get_mapbase_bank::return#2 = vera_layer_get_mapbase_bank::return#0
  to:screenlayer::@3
screenlayer::@3: scope:[screenlayer]  from screenlayer
  [102] CONIO_SCREEN_BANK#14 = vera_layer_get_mapbase_bank::return#2
  [103] vera_layer_get_mapbase_offset::layer#0 = conio_screen_layer
  [104] call vera_layer_get_mapbase_offset
  [105] vera_layer_get_mapbase_offset::return#2 = vera_layer_get_mapbase_offset::return#0
  to:screenlayer::@4
screenlayer::@4: scope:[screenlayer]  from screenlayer::@3
  [106] CONIO_SCREEN_TEXT#16 = vera_layer_get_mapbase_offset::return#2
  [107] screenlayer::vera_layer_get_width1_layer#0 = conio_screen_layer
  to:screenlayer::vera_layer_get_width1
screenlayer::vera_layer_get_width1: scope:[screenlayer]  from screenlayer::@4
  [108] screenlayer::vera_layer_get_width1_$2 = screenlayer::vera_layer_get_width1_layer#0 << 1
  [109] screenlayer::vera_layer_get_width1_config#0 = vera_layer_config[screenlayer::vera_layer_get_width1_$2]
  [110] screenlayer::vera_layer_get_width1_$0 = *screenlayer::vera_layer_get_width1_config#0 & VERA_LAYER_WIDTH_MASK
  [111] screenlayer::vera_layer_get_width1_$1 = screenlayer::vera_layer_get_width1_$0 >> 4
  [112] screenlayer::vera_layer_get_width1_$3 = screenlayer::vera_layer_get_width1_$1 << 1
  [113] screenlayer::vera_layer_get_width1_return#0 = VERA_LAYER_WIDTH[screenlayer::vera_layer_get_width1_$3]
  to:screenlayer::vera_layer_get_width1_@return
screenlayer::vera_layer_get_width1_@return: scope:[screenlayer]  from screenlayer::vera_layer_get_width1
  [114] screenlayer::vera_layer_get_width1_return#1 = screenlayer::vera_layer_get_width1_return#0
  to:screenlayer::@1
screenlayer::@1: scope:[screenlayer]  from screenlayer::vera_layer_get_width1_@return
  [115] screenlayer::$2 = screenlayer::vera_layer_get_width1_return#1
  [116] conio_width = screenlayer::$2
  [117] vera_layer_get_rowshift::layer#0 = conio_screen_layer
  [118] call vera_layer_get_rowshift
  [119] vera_layer_get_rowshift::return#2 = vera_layer_get_rowshift::return#0
  to:screenlayer::@5
screenlayer::@5: scope:[screenlayer]  from screenlayer::@1
  [120] screenlayer::$3 = vera_layer_get_rowshift::return#2
  [121] conio_rowshift = screenlayer::$3
  [122] vera_layer_get_rowskip::layer#0 = conio_screen_layer
  [123] call vera_layer_get_rowskip
  [124] vera_layer_get_rowskip::return#2 = vera_layer_get_rowskip::return#0
  to:screenlayer::@6
screenlayer::@6: scope:[screenlayer]  from screenlayer::@5
  [125] screenlayer::$4 = vera_layer_get_rowskip::return#2
  [126] conio_rowskip = screenlayer::$4
  [127] screenlayer::vera_layer_get_height1_layer#0 = conio_screen_layer
  to:screenlayer::vera_layer_get_height1
screenlayer::vera_layer_get_height1: scope:[screenlayer]  from screenlayer::@6
  [128] screenlayer::vera_layer_get_height1_$2 = screenlayer::vera_layer_get_height1_layer#0 << 1
  [129] screenlayer::vera_layer_get_height1_config#0 = vera_layer_config[screenlayer::vera_layer_get_height1_$2]
  [130] screenlayer::vera_layer_get_height1_$0 = *screenlayer::vera_layer_get_height1_config#0 & VERA_LAYER_HEIGHT_MASK
  [131] screenlayer::vera_layer_get_height1_$1 = screenlayer::vera_layer_get_height1_$0 >> 6
  [132] screenlayer::vera_layer_get_height1_$3 = screenlayer::vera_layer_get_height1_$1 << 1
  [133] screenlayer::vera_layer_get_height1_return#0 = VERA_LAYER_HEIGHT[screenlayer::vera_layer_get_height1_$3]
  to:screenlayer::vera_layer_get_height1_@return
screenlayer::vera_layer_get_height1_@return: scope:[screenlayer]  from screenlayer::vera_layer_get_height1
  [134] screenlayer::vera_layer_get_height1_return#1 = screenlayer::vera_layer_get_height1_return#0
  to:screenlayer::@2
screenlayer::@2: scope:[screenlayer]  from screenlayer::vera_layer_get_height1_@return
  [135] screenlayer::$5 = screenlayer::vera_layer_get_height1_return#1
  [136] conio_height = screenlayer::$5
  to:screenlayer::@return
screenlayer::@return: scope:[screenlayer]  from screenlayer::@2
  [137] return 
  to:@return

char vera_layer_set_textcolor(char layer , char color)
vera_layer_set_textcolor: scope:[vera_layer_set_textcolor]  from conio_x16_init::@5
  [138] *(vera_layer_textcolor+vera_layer_set_textcolor::layer#0) = WHITE
  to:vera_layer_set_textcolor::@return
vera_layer_set_textcolor::@return: scope:[vera_layer_set_textcolor]  from vera_layer_set_textcolor
  [139] return 
  to:@return

char vera_layer_set_backcolor(char layer , char color)
vera_layer_set_backcolor: scope:[vera_layer_set_backcolor]  from conio_x16_init::@6
  [140] *(vera_layer_backcolor+vera_layer_set_backcolor::layer#0) = BLUE
  to:vera_layer_set_backcolor::@return
vera_layer_set_backcolor::@return: scope:[vera_layer_set_backcolor]  from vera_layer_set_backcolor
  [141] return 
  to:@return

void vera_layer_set_mapbase(char layer , char mapbase)
vera_layer_set_mapbase: scope:[vera_layer_set_mapbase]  from conio_x16_init::@7 conio_x16_init::@8 vera_layer_mode_tile::@4
  [142] vera_layer_set_mapbase::mapbase#3 = phi( conio_x16_init::@7/$20, conio_x16_init::@8/0, vera_layer_mode_tile::@4/vera_layer_mode_tile::mapbase#0 )
  [142] vera_layer_set_mapbase::layer#3 = phi( conio_x16_init::@7/0, conio_x16_init::@8/1, vera_layer_mode_tile::@4/vera_layer_mode_text::layer#0 )
  [143] vera_layer_set_mapbase::$0 = vera_layer_set_mapbase::layer#3 << 1
  [144] vera_layer_set_mapbase::addr#0 = vera_layer_mapbase[vera_layer_set_mapbase::$0]
  [145] *vera_layer_set_mapbase::addr#0 = vera_layer_set_mapbase::mapbase#3
  to:vera_layer_set_mapbase::@return
vera_layer_set_mapbase::@return: scope:[vera_layer_set_mapbase]  from vera_layer_set_mapbase
  [146] return 
  to:@return

void gotoxy(char x , char y)
gotoxy: scope:[gotoxy]  from conio_x16_init::@1 cscroll::@5
  [147] gotoxy::y#3 = phi( conio_x16_init::@1/gotoxy::y#1, cscroll::@5/gotoxy::y#2 )
  [148] if(gotoxy::y#3<=conio_screen_height) goto gotoxy::@4
  to:gotoxy::@1
gotoxy::@4: scope:[gotoxy]  from gotoxy
  [149] phi()
  to:gotoxy::@1
gotoxy::@1: scope:[gotoxy]  from gotoxy gotoxy::@4
  [150] gotoxy::y#4 = phi( gotoxy::@4/gotoxy::y#3, gotoxy/0 )
  [151] if(0<conio_screen_width) goto gotoxy::@2
  to:gotoxy::@3
gotoxy::@3: scope:[gotoxy]  from gotoxy::@1
  [152] phi()
  to:gotoxy::@2
gotoxy::@2: scope:[gotoxy]  from gotoxy::@1 gotoxy::@3
  [153] conio_cursor_x[conio_screen_layer] = 0
  [154] conio_cursor_y[conio_screen_layer] = gotoxy::y#4
  [155] gotoxy::$6 = (unsigned int)gotoxy::y#4
  [156] gotoxy::line_offset#0 = gotoxy::$6 << conio_rowshift
  [157] gotoxy::$5 = conio_screen_layer << 1
  [158] conio_line_text[gotoxy::$5] = gotoxy::line_offset#0
  to:gotoxy::@return
gotoxy::@return: scope:[gotoxy]  from gotoxy::@2
  [159] return 
  to:@return

char vera_layer_get_color(char layer)
vera_layer_get_color: scope:[vera_layer_get_color]  from clearline cputc
  [160] vera_layer_get_color::layer#2 = phi( clearline/vera_layer_get_color::layer#1, cputc/vera_layer_get_color::layer#0 )
  [161] vera_layer_get_color::$3 = vera_layer_get_color::layer#2 << 1
  [162] vera_layer_get_color::addr#0 = vera_layer_config[vera_layer_get_color::$3]
  [163] vera_layer_get_color::$0 = *vera_layer_get_color::addr#0 & VERA_LAYER_CONFIG_256C
  [164] if(0!=vera_layer_get_color::$0) goto vera_layer_get_color::@1
  to:vera_layer_get_color::@2
vera_layer_get_color::@2: scope:[vera_layer_get_color]  from vera_layer_get_color
  [165] vera_layer_get_color::$1 = vera_layer_backcolor[vera_layer_get_color::layer#2] << 4
  [166] vera_layer_get_color::return#1 = vera_layer_get_color::$1 | vera_layer_textcolor[vera_layer_get_color::layer#2]
  to:vera_layer_get_color::@return
vera_layer_get_color::@return: scope:[vera_layer_get_color]  from vera_layer_get_color::@1 vera_layer_get_color::@2
  [167] vera_layer_get_color::return#2 = phi( vera_layer_get_color::@1/vera_layer_get_color::return#0, vera_layer_get_color::@2/vera_layer_get_color::return#1 )
  [168] return 
  to:@return
vera_layer_get_color::@1: scope:[vera_layer_get_color]  from vera_layer_get_color
  [169] vera_layer_get_color::return#0 = vera_layer_textcolor[vera_layer_get_color::layer#2]
  to:vera_layer_get_color::@return

void cputln()
cputln: scope:[cputln]  from cputc::@1 cputc::@4 cputc::@6
  [170] cputln::$2 = conio_screen_layer << 1
  [171] cputln::temp#0 = conio_line_text[cputln::$2]
  [172] cputln::temp#1 = cputln::temp#0 + conio_rowskip
  [173] cputln::$3 = conio_screen_layer << 1
  [174] conio_line_text[cputln::$3] = cputln::temp#1
  [175] conio_cursor_x[conio_screen_layer] = 0
  [176] conio_cursor_y[conio_screen_layer] = ++ conio_cursor_y[conio_screen_layer]
  [177] call cscroll
  to:cputln::@return
cputln::@return: scope:[cputln]  from cputln
  [178] return 
  to:@return

void vera_layer_set_text_color_mode(char layer , char color_mode)
vera_layer_set_text_color_mode: scope:[vera_layer_set_text_color_mode]  from main vera_layer_mode_text::@1
  [179] vera_layer_set_text_color_mode::layer#3 = phi( main/1, vera_layer_mode_text::@1/vera_layer_mode_text::layer#0 )
  [180] vera_layer_set_text_color_mode::$0 = vera_layer_set_text_color_mode::layer#3 << 1
  [181] vera_layer_set_text_color_mode::addr#0 = vera_layer_config[vera_layer_set_text_color_mode::$0]
  [182] *vera_layer_set_text_color_mode::addr#0 = *vera_layer_set_text_color_mode::addr#0 & ~VERA_LAYER_CONFIG_256C
  [183] *vera_layer_set_text_color_mode::addr#0 = *vera_layer_set_text_color_mode::addr#0
  to:vera_layer_set_text_color_mode::@return
vera_layer_set_text_color_mode::@return: scope:[vera_layer_set_text_color_mode]  from vera_layer_set_text_color_mode
  [184] return 
  to:@return

void clrscr()
clrscr: scope:[clrscr]  from main::@2
  [185] clrscr::line_text#0 = (char *)CONIO_SCREEN_TEXT#16
  [186] vera_layer_get_backcolor::layer#0 = conio_screen_layer
  [187] call vera_layer_get_backcolor
  [188] vera_layer_get_backcolor::return#2 = vera_layer_get_backcolor::return#0
  to:clrscr::@7
clrscr::@7: scope:[clrscr]  from clrscr
  [189] clrscr::$0 = vera_layer_get_backcolor::return#2
  [190] clrscr::$1 = clrscr::$0 << 4
  [191] vera_layer_get_textcolor::layer#0 = conio_screen_layer
  [192] call vera_layer_get_textcolor
  [193] vera_layer_get_textcolor::return#2 = vera_layer_get_textcolor::return#0
  to:clrscr::@8
clrscr::@8: scope:[clrscr]  from clrscr::@7
  [194] clrscr::$2 = vera_layer_get_textcolor::return#2
  [195] clrscr::color#0 = clrscr::$1 | clrscr::$2
  to:clrscr::@1
clrscr::@1: scope:[clrscr]  from clrscr::@6 clrscr::@8
  [196] clrscr::line_text#2 = phi( clrscr::@6/clrscr::line_text#1, clrscr::@8/clrscr::line_text#0 )
  [196] clrscr::l#2 = phi( clrscr::@6/clrscr::l#1, clrscr::@8/0 )
  [197] if(clrscr::l#2<conio_height) goto clrscr::@2
  to:clrscr::@3
clrscr::@3: scope:[clrscr]  from clrscr::@1
  [198] conio_cursor_x[conio_screen_layer] = 0
  [199] conio_cursor_y[conio_screen_layer] = 0
  [200] clrscr::$9 = conio_screen_layer << 1
  [201] conio_line_text[clrscr::$9] = 0
  to:clrscr::@return
clrscr::@return: scope:[clrscr]  from clrscr::@3
  [202] return 
  to:@return
clrscr::@2: scope:[clrscr]  from clrscr::@1
  [203] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL
  [204] clrscr::$5 = byte0  clrscr::line_text#2
  [205] *VERA_ADDRX_L = clrscr::$5
  [206] clrscr::$6 = byte1  clrscr::line_text#2
  [207] *VERA_ADDRX_M = clrscr::$6
  [208] clrscr::$7 = CONIO_SCREEN_BANK#14 | VERA_INC_1
  [209] *VERA_ADDRX_H = clrscr::$7
  to:clrscr::@4
clrscr::@4: scope:[clrscr]  from clrscr::@2 clrscr::@5
  [210] clrscr::c#2 = phi( clrscr::@2/0, clrscr::@5/clrscr::c#1 )
  [211] if(clrscr::c#2<conio_width) goto clrscr::@5
  to:clrscr::@6
clrscr::@6: scope:[clrscr]  from clrscr::@4
  [212] clrscr::line_text#1 = clrscr::line_text#2 + conio_rowskip
  [213] clrscr::l#1 = ++ clrscr::l#2
  to:clrscr::@1
clrscr::@5: scope:[clrscr]  from clrscr::@4
  [214] *VERA_DATA0 = ' '
  [215] *VERA_DATA0 = clrscr::color#0
  [216] clrscr::c#1 = ++ clrscr::c#2
  to:clrscr::@4

void printf_str(void (*putc)(char) , const char *s)
printf_str: scope:[printf_str]  from main::@3
  [217] phi()
  to:printf_str::@1
printf_str::@1: scope:[printf_str]  from printf_str printf_str::@2
  [218] printf_str::s#2 = phi( printf_str/main::s, printf_str::@2/printf_str::s#0 )
  [219] printf_str::c#1 = *printf_str::s#2
  [220] printf_str::s#0 = ++ printf_str::s#2
  [221] if(0!=printf_str::c#1) goto printf_str::@2
  to:printf_str::@return
printf_str::@return: scope:[printf_str]  from printf_str::@1
  [222] return 
  to:@return
printf_str::@2: scope:[printf_str]  from printf_str::@1
  [223] stackpush(char) = printf_str::c#1
  [224] callexecute cputc 
  sideeffect stackpullbytes(1)
  to:printf_str::@1

char load_to_bank(char device , char *filename , unsigned long address)
load_to_bank: scope:[load_to_bank]  from main::@4
  [226] setnam::filename = main::filename
  [227] call setnam
  to:load_to_bank::@1
load_to_bank::@1: scope:[load_to_bank]  from load_to_bank
  [228] setlfs::device = load_to_bank::device#0
  [229] call setlfs
  to:load_to_bank::@2
load_to_bank::@2: scope:[load_to_bank]  from load_to_bank::@1
  [230] *((char *)VIA1+OFFSET_STRUCT_MOS6522_VIA_PORT_A) = load_to_bank::bank#0
  [231] load::address = (char *)0+$a000
  [232] load::verify = 0
  [233] call load
  to:load_to_bank::@return
load_to_bank::@return: scope:[load_to_bank]  from load_to_bank::@2
  [234] return 
  to:@return

void memcpy_bank_to_vram(unsigned long vdest , unsigned long src , unsigned long num)
memcpy_bank_to_vram: scope:[memcpy_bank_to_vram]  from main::@5 main::@6
  [235] memcpy_bank_to_vram::num#2 = phi( main::@5/$20, main::@6/(unsigned int)$40*$20 )
  [235] memcpy_bank_to_vram::beg#0 = phi( main::@5/main::BANK_SPRITE-2, main::@6/main::BANK_SPRITE+$20-2 )
  [235] memcpy_bank_to_vram::vdest#2 = phi( main::@5/VERA_PALETTE+$20, main::@6/main::VRAM_SPRITE )
  [236] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL
  [237] memcpy_bank_to_vram::$0 = byte0  memcpy_bank_to_vram::vdest#2
  [238] *VERA_ADDRX_L = memcpy_bank_to_vram::$0
  [239] memcpy_bank_to_vram::$1 = byte1  memcpy_bank_to_vram::vdest#2
  [240] *VERA_ADDRX_M = memcpy_bank_to_vram::$1
  [241] memcpy_bank_to_vram::$2 = byte2  memcpy_bank_to_vram::vdest#2
  [242] *VERA_ADDRX_H = memcpy_bank_to_vram::$2
  [243] *VERA_ADDRX_H = *VERA_ADDRX_H | VERA_INC_1
  [244] memcpy_bank_to_vram::end#0 = memcpy_bank_to_vram::beg#0 + memcpy_bank_to_vram::num#2
  [245] memcpy_bank_to_vram::$4 = byte2  memcpy_bank_to_vram::beg#0
  [246] memcpy_bank_to_vram::$5 = memcpy_bank_to_vram::$4 << 3
  [247] memcpy_bank_to_vram::$6 = byte1  memcpy_bank_to_vram::beg#0
  [248] memcpy_bank_to_vram::$7 = memcpy_bank_to_vram::$6 >> 5
  [249] memcpy_bank_to_vram::bank#0 = memcpy_bank_to_vram::$5 | memcpy_bank_to_vram::$7
  [250] memcpy_bank_to_vram::$9 = word0  memcpy_bank_to_vram::beg#0
  [251] memcpy_bank_to_vram::addr#0 = memcpy_bank_to_vram::$9 & $1fff
  [252] memcpy_bank_to_vram::addr#1 = (char *)memcpy_bank_to_vram::addr#0 + $a000
  [253] *((char *)VIA1+OFFSET_STRUCT_MOS6522_VIA_PORT_A) = memcpy_bank_to_vram::bank#0
  to:memcpy_bank_to_vram::@1
memcpy_bank_to_vram::@1: scope:[memcpy_bank_to_vram]  from memcpy_bank_to_vram memcpy_bank_to_vram::@3
  [254] memcpy_bank_to_vram::bank#2 = phi( memcpy_bank_to_vram/memcpy_bank_to_vram::bank#0, memcpy_bank_to_vram::@3/memcpy_bank_to_vram::bank#5 )
  [254] memcpy_bank_to_vram::addr#4 = phi( memcpy_bank_to_vram/memcpy_bank_to_vram::addr#1, memcpy_bank_to_vram::@3/memcpy_bank_to_vram::addr#2 )
  [254] memcpy_bank_to_vram::pos#2 = phi( memcpy_bank_to_vram/memcpy_bank_to_vram::beg#0, memcpy_bank_to_vram::@3/memcpy_bank_to_vram::pos#1 )
  [255] if(memcpy_bank_to_vram::pos#2<memcpy_bank_to_vram::end#0) goto memcpy_bank_to_vram::@2
  to:memcpy_bank_to_vram::@return
memcpy_bank_to_vram::@return: scope:[memcpy_bank_to_vram]  from memcpy_bank_to_vram::@1
  [256] return 
  to:@return
memcpy_bank_to_vram::@2: scope:[memcpy_bank_to_vram]  from memcpy_bank_to_vram::@1
  [257] if(memcpy_bank_to_vram::addr#4!=$c000) goto memcpy_bank_to_vram::@3
  to:memcpy_bank_to_vram::@4
memcpy_bank_to_vram::@4: scope:[memcpy_bank_to_vram]  from memcpy_bank_to_vram::@2
  [258] memcpy_bank_to_vram::bank#1 = ++ memcpy_bank_to_vram::bank#2
  [259] *((char *)VIA1+OFFSET_STRUCT_MOS6522_VIA_PORT_A) = memcpy_bank_to_vram::bank#1
  to:memcpy_bank_to_vram::@3
memcpy_bank_to_vram::@3: scope:[memcpy_bank_to_vram]  from memcpy_bank_to_vram::@2 memcpy_bank_to_vram::@4
  [260] memcpy_bank_to_vram::bank#5 = phi( memcpy_bank_to_vram::@2/memcpy_bank_to_vram::bank#2, memcpy_bank_to_vram::@4/memcpy_bank_to_vram::bank#1 )
  [260] memcpy_bank_to_vram::addr#5 = phi( memcpy_bank_to_vram::@2/memcpy_bank_to_vram::addr#4, memcpy_bank_to_vram::@4/(char *) 40960 )
  [261] *VERA_DATA0 = *memcpy_bank_to_vram::addr#5
  [262] memcpy_bank_to_vram::addr#2 = ++ memcpy_bank_to_vram::addr#5
  [263] memcpy_bank_to_vram::pos#1 = ++ memcpy_bank_to_vram::pos#2
  to:memcpy_bank_to_vram::@1

void memcpy_to_vram(char vbank , void *vdest , void *src , unsigned int num)
memcpy_to_vram: scope:[memcpy_to_vram]  from main::@7
  [264] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL
  [265] *VERA_ADDRX_L = 0
  [266] *VERA_ADDRX_M = byte1 memcpy_to_vram::vdest#0
  [267] *VERA_ADDRX_H = VERA_INC_1|memcpy_to_vram::vbank#0
  to:memcpy_to_vram::@1
memcpy_to_vram::@1: scope:[memcpy_to_vram]  from memcpy_to_vram memcpy_to_vram::@2
  [268] memcpy_to_vram::s#2 = phi( memcpy_to_vram/(char *)memcpy_to_vram::src#0, memcpy_to_vram::@2/memcpy_to_vram::s#1 )
  [269] if(memcpy_to_vram::s#2!=memcpy_to_vram::end#0) goto memcpy_to_vram::@2
  to:memcpy_to_vram::@return
memcpy_to_vram::@return: scope:[memcpy_to_vram]  from memcpy_to_vram::@1
  [270] return 
  to:@return
memcpy_to_vram::@2: scope:[memcpy_to_vram]  from memcpy_to_vram::@1
  [271] *VERA_DATA0 = *memcpy_to_vram::s#2
  [272] memcpy_to_vram::s#1 = ++ memcpy_to_vram::s#2
  to:memcpy_to_vram::@1

void vera_layer_mode_tile(char layer , unsigned long mapbase_address , unsigned long tilebase_address , unsigned int mapwidth , unsigned int mapheight , char tilewidth , char tileheight , char color_depth)
vera_layer_mode_tile: scope:[vera_layer_mode_tile]  from vera_layer_mode_text
  [273] phi()
  to:vera_layer_mode_tile::@1
vera_layer_mode_tile::@1: scope:[vera_layer_mode_tile]  from vera_layer_mode_tile
  [274] *(vera_layer_rowshift+vera_layer_mode_text::layer#0) = 8
  [275] *(vera_layer_rowskip+vera_layer_mode_text::layer#0*SIZEOF_UNSIGNED_INT) = $100
  to:vera_layer_mode_tile::@2
vera_layer_mode_tile::@2: scope:[vera_layer_mode_tile]  from vera_layer_mode_tile::@1
  [276] phi()
  [277] call vera_layer_set_config
  to:vera_layer_mode_tile::@4
vera_layer_mode_tile::@4: scope:[vera_layer_mode_tile]  from vera_layer_mode_tile::@2
  [278] *(vera_mapbase_offset+vera_layer_mode_text::layer#0*SIZEOF_UNSIGNED_INT) = 0
  [279] *(vera_mapbase_bank+vera_layer_mode_text::layer#0) = 0
  [280] *(vera_mapbase_address+vera_layer_mode_text::layer#0*SIZEOF_UNSIGNED_LONG) = vera_layer_mode_text::mapbase_address#0
  [281] call vera_layer_set_mapbase
  to:vera_layer_mode_tile::@5
vera_layer_mode_tile::@5: scope:[vera_layer_mode_tile]  from vera_layer_mode_tile::@4
  [282] *(vera_tilebase_offset+vera_layer_mode_text::layer#0*SIZEOF_UNSIGNED_INT) = word0 vera_layer_mode_text::tilebase_address#0
  [283] *(vera_tilebase_bank+vera_layer_mode_text::layer#0) = 0
  [284] *(vera_tilebase_address+vera_layer_mode_text::layer#0*SIZEOF_UNSIGNED_LONG) = vera_layer_mode_text::tilebase_address#0
  to:vera_layer_mode_tile::@3
vera_layer_mode_tile::@3: scope:[vera_layer_mode_tile]  from vera_layer_mode_tile::@5
  [285] phi()
  [286] call vera_layer_set_tilebase
  to:vera_layer_mode_tile::@return
vera_layer_mode_tile::@return: scope:[vera_layer_mode_tile]  from vera_layer_mode_tile::@3
  [287] return 
  to:@return

char vera_layer_get_mapbase_bank(char layer)
vera_layer_get_mapbase_bank: scope:[vera_layer_get_mapbase_bank]  from screenlayer
  [288] vera_layer_get_mapbase_bank::return#0 = vera_mapbase_bank[vera_layer_get_mapbase_bank::layer#0]
  to:vera_layer_get_mapbase_bank::@return
vera_layer_get_mapbase_bank::@return: scope:[vera_layer_get_mapbase_bank]  from vera_layer_get_mapbase_bank
  [289] return 
  to:@return

unsigned int vera_layer_get_mapbase_offset(char layer)
vera_layer_get_mapbase_offset: scope:[vera_layer_get_mapbase_offset]  from screenlayer::@3
  [290] vera_layer_get_mapbase_offset::$0 = vera_layer_get_mapbase_offset::layer#0 << 1
  [291] vera_layer_get_mapbase_offset::return#0 = vera_mapbase_offset[vera_layer_get_mapbase_offset::$0]
  to:vera_layer_get_mapbase_offset::@return
vera_layer_get_mapbase_offset::@return: scope:[vera_layer_get_mapbase_offset]  from vera_layer_get_mapbase_offset
  [292] return 
  to:@return

char vera_layer_get_rowshift(char layer)
vera_layer_get_rowshift: scope:[vera_layer_get_rowshift]  from screenlayer::@1
  [293] vera_layer_get_rowshift::return#0 = vera_layer_rowshift[vera_layer_get_rowshift::layer#0]
  to:vera_layer_get_rowshift::@return
vera_layer_get_rowshift::@return: scope:[vera_layer_get_rowshift]  from vera_layer_get_rowshift
  [294] return 
  to:@return

unsigned int vera_layer_get_rowskip(char layer)
vera_layer_get_rowskip: scope:[vera_layer_get_rowskip]  from screenlayer::@5
  [295] vera_layer_get_rowskip::$0 = vera_layer_get_rowskip::layer#0 << 1
  [296] vera_layer_get_rowskip::return#0 = vera_layer_rowskip[vera_layer_get_rowskip::$0]
  to:vera_layer_get_rowskip::@return
vera_layer_get_rowskip::@return: scope:[vera_layer_get_rowskip]  from vera_layer_get_rowskip
  [297] return 
  to:@return

void cscroll()
cscroll: scope:[cscroll]  from cputln
  [298] if(conio_cursor_y[conio_screen_layer]<conio_screen_height) goto cscroll::@return
  to:cscroll::@1
cscroll::@1: scope:[cscroll]  from cscroll
  [299] if(0!=conio_scroll_enable[conio_screen_layer]) goto cscroll::@4
  to:cscroll::@2
cscroll::@2: scope:[cscroll]  from cscroll::@1
  [300] if(conio_cursor_y[conio_screen_layer]<conio_height) goto cscroll::@return
  to:cscroll::@3
cscroll::@3: scope:[cscroll]  from cscroll::@2
  [301] phi()
  to:cscroll::@return
cscroll::@return: scope:[cscroll]  from cscroll cscroll::@2 cscroll::@3 cscroll::@5
  [302] return 
  to:@return
cscroll::@4: scope:[cscroll]  from cscroll::@1
  [303] phi()
  [304] call insertup
  to:cscroll::@5
cscroll::@5: scope:[cscroll]  from cscroll::@4
  [305] gotoxy::y#2 = conio_screen_height - 1
  [306] call gotoxy
  to:cscroll::@return

char vera_layer_get_backcolor(char layer)
vera_layer_get_backcolor: scope:[vera_layer_get_backcolor]  from clrscr
  [307] vera_layer_get_backcolor::return#0 = vera_layer_backcolor[vera_layer_get_backcolor::layer#0]
  to:vera_layer_get_backcolor::@return
vera_layer_get_backcolor::@return: scope:[vera_layer_get_backcolor]  from vera_layer_get_backcolor
  [308] return 
  to:@return

char vera_layer_get_textcolor(char layer)
vera_layer_get_textcolor: scope:[vera_layer_get_textcolor]  from clrscr::@7
  [309] vera_layer_get_textcolor::return#0 = vera_layer_textcolor[vera_layer_get_textcolor::layer#0]
  to:vera_layer_get_textcolor::@return
vera_layer_get_textcolor::@return: scope:[vera_layer_get_textcolor]  from vera_layer_get_textcolor
  [310] return 
  to:@return

void setnam(char * volatile filename)
setnam: scope:[setnam]  from load_to_bank
  [311] strlen::str#0 = setnam::filename
  [312] call strlen
  [313] strlen::return#0 = strlen::len#2
  to:setnam::@1
setnam::@1: scope:[setnam]  from setnam
  [314] setnam::$0 = strlen::return#0
  [315] setnam::filename_len = (char)setnam::$0
  asm { ldafilename_len ldxfilename ldyfilename+1 jsr$ffbd  }
  to:setnam::@return
setnam::@return: scope:[setnam]  from setnam::@1
  [317] return 
  to:@return

void setlfs(volatile char device)
setlfs: scope:[setlfs]  from load_to_bank::@1
  asm { ldxdevice lda#1 ldy#0 jsr$ffba  }
  to:setlfs::@return
setlfs::@return: scope:[setlfs]  from setlfs
  [319] return 
  to:@return

char load(char * volatile address , volatile char verify)
load: scope:[load]  from load_to_bank::@2
  [320] load::status = 0
  asm { ldxaddress ldyaddress+1 ldaverify jsr$ffd5 bcserror lda#$ff error: stastatus  }
  to:load::@return
load::@return: scope:[load]  from load
  [322] return 
  to:@return

void vera_layer_set_config(char layer , char config)
vera_layer_set_config: scope:[vera_layer_set_config]  from vera_layer_mode_tile::@2
  [323] vera_layer_set_config::addr#0 = *(vera_layer_config+vera_layer_mode_text::layer#0*SIZEOF_POINTER)
  [324] *vera_layer_set_config::addr#0 = vera_layer_mode_tile::config#10
  to:vera_layer_set_config::@return
vera_layer_set_config::@return: scope:[vera_layer_set_config]  from vera_layer_set_config
  [325] return 
  to:@return

void vera_layer_set_tilebase(char layer , char tilebase)
vera_layer_set_tilebase: scope:[vera_layer_set_tilebase]  from vera_layer_mode_tile::@3
  [326] vera_layer_set_tilebase::addr#0 = *(vera_layer_tilebase+vera_layer_mode_text::layer#0*SIZEOF_POINTER)
  [327] *vera_layer_set_tilebase::addr#0 = byte1 vera_layer_mode_tile::tilebase_address#0&VERA_LAYER_TILEBASE_MASK
  to:vera_layer_set_tilebase::@return
vera_layer_set_tilebase::@return: scope:[vera_layer_set_tilebase]  from vera_layer_set_tilebase
  [328] return 
  to:@return

void insertup()
insertup: scope:[insertup]  from cscroll::@4
  [329] insertup::cy#0 = conio_cursor_y[conio_screen_layer]
  [330] insertup::width#0 = conio_screen_width << 1
  to:insertup::@1
insertup::@1: scope:[insertup]  from insertup insertup::@4
  [331] insertup::i#2 = phi( insertup/1, insertup::@4/insertup::i#1 )
  [332] if(insertup::i#2<=insertup::cy#0) goto insertup::@2
  to:insertup::@3
insertup::@3: scope:[insertup]  from insertup::@1
  [333] phi()
  [334] call clearline
  to:insertup::@return
insertup::@return: scope:[insertup]  from insertup::@3
  [335] return 
  to:@return
insertup::@2: scope:[insertup]  from insertup::@1
  [336] insertup::$3 = insertup::i#2 - 1
  [337] insertup::line#0 = insertup::$3 << conio_rowshift
  [338] insertup::start#0 = CONIO_SCREEN_TEXT#11 + insertup::line#0
  [339] memcpy_in_vram::src#0 = insertup::start#0 + conio_rowskip
  [340] memcpy_in_vram::dest#0 = (void *)insertup::start#0
  [341] memcpy_in_vram::num#0 = insertup::width#0
  [342] call memcpy_in_vram
  to:insertup::@4
insertup::@4: scope:[insertup]  from insertup::@2
  [343] insertup::i#1 = ++ insertup::i#2
  to:insertup::@1

unsigned int strlen(char *str)
strlen: scope:[strlen]  from setnam
  [344] phi()
  to:strlen::@1
strlen::@1: scope:[strlen]  from strlen strlen::@2
  [345] strlen::len#2 = phi( strlen/0, strlen::@2/strlen::len#1 )
  [345] strlen::str#2 = phi( strlen/strlen::str#0, strlen::@2/strlen::str#1 )
  [346] if(0!=*strlen::str#2) goto strlen::@2
  to:strlen::@return
strlen::@return: scope:[strlen]  from strlen::@1
  [347] return 
  to:@return
strlen::@2: scope:[strlen]  from strlen::@1
  [348] strlen::len#1 = ++ strlen::len#2
  [349] strlen::str#1 = ++ strlen::str#2
  to:strlen::@1

void clearline()
clearline: scope:[clearline]  from insertup::@3
  [350] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL
  [351] clearline::$5 = conio_screen_layer << 1
  [352] clearline::addr#0 = CONIO_SCREEN_TEXT#11 + conio_line_text[clearline::$5]
  [353] clearline::$1 = byte0  clearline::addr#0
  [354] *VERA_ADDRX_L = clearline::$1
  [355] clearline::$2 = byte1  clearline::addr#0
  [356] *VERA_ADDRX_M = clearline::$2
  [357] *VERA_ADDRX_H = VERA_INC_1
  [358] vera_layer_get_color::layer#1 = conio_screen_layer
  [359] call vera_layer_get_color
  [360] vera_layer_get_color::return#4 = vera_layer_get_color::return#2
  to:clearline::@4
clearline::@4: scope:[clearline]  from clearline
  [361] clearline::color#0 = vera_layer_get_color::return#4
  to:clearline::@1
clearline::@1: scope:[clearline]  from clearline::@2 clearline::@4
  [362] clearline::c#2 = phi( clearline::@2/clearline::c#1, clearline::@4/0 )
  [363] if(clearline::c#2<conio_screen_width) goto clearline::@2
  to:clearline::@3
clearline::@3: scope:[clearline]  from clearline::@1
  [364] conio_cursor_x[conio_screen_layer] = 0
  to:clearline::@return
clearline::@return: scope:[clearline]  from clearline::@3
  [365] return 
  to:@return
clearline::@2: scope:[clearline]  from clearline::@1
  [366] *VERA_DATA0 = ' '
  [367] *VERA_DATA0 = clearline::color#0
  [368] clearline::c#1 = ++ clearline::c#2
  to:clearline::@1

void memcpy_in_vram(char dest_bank , void *dest , char dest_increment , char src_bank , void *src , char src_increment , unsigned int num)
memcpy_in_vram: scope:[memcpy_in_vram]  from insertup::@2
  [369] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL
  [370] memcpy_in_vram::$0 = byte0  (void *)memcpy_in_vram::src#0
  [371] *VERA_ADDRX_L = memcpy_in_vram::$0
  [372] memcpy_in_vram::$1 = byte1  (void *)memcpy_in_vram::src#0
  [373] *VERA_ADDRX_M = memcpy_in_vram::$1
  [374] *VERA_ADDRX_H = VERA_INC_1
  [375] *VERA_CTRL = *VERA_CTRL | VERA_ADDRSEL
  [376] memcpy_in_vram::$3 = byte0  memcpy_in_vram::dest#0
  [377] *VERA_ADDRX_L = memcpy_in_vram::$3
  [378] memcpy_in_vram::$4 = byte1  memcpy_in_vram::dest#0
  [379] *VERA_ADDRX_M = memcpy_in_vram::$4
  [380] *VERA_ADDRX_H = VERA_INC_1
  to:memcpy_in_vram::@1
memcpy_in_vram::@1: scope:[memcpy_in_vram]  from memcpy_in_vram memcpy_in_vram::@2
  [381] memcpy_in_vram::i#2 = phi( memcpy_in_vram/0, memcpy_in_vram::@2/memcpy_in_vram::i#1 )
  [382] if(memcpy_in_vram::i#2<memcpy_in_vram::num#0) goto memcpy_in_vram::@2
  to:memcpy_in_vram::@return
memcpy_in_vram::@return: scope:[memcpy_in_vram]  from memcpy_in_vram::@1
  [383] return 
  to:@return
memcpy_in_vram::@2: scope:[memcpy_in_vram]  from memcpy_in_vram::@1
  [384] *VERA_DATA1 = *VERA_DATA0
  [385] memcpy_in_vram::i#1 = ++ memcpy_in_vram::i#2
  to:memcpy_in_vram::@1
