Inlined call (byte~) main::$1 ← call toD018 (byte*) screen (byte*) charset1 
Inlined call (byte~) main::$3 ← call toD018 (byte*) screen (byte*) charset2 

CONTROL FLOW GRAPH SSA
@begin: scope:[]  from
  (byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) 53266
  (byte*) D018#0 ← ((byte*)) (word/dword/signed dword) 53272
  (byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) 53281
  (byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
  (byte*) charset1#0 ← ((byte*)) (word/signed word/dword/signed dword) 4096
  (byte*) charset2#0 ← ((byte*)) (word/signed word/dword/signed dword) 6144
  to:@2
main: scope:[main]  from @2
  (byte*) charset2#12 ← phi( @2/(byte*) charset2#14 )
  (byte*) BGCOL#15 ← phi( @2/(byte*) BGCOL#16 )
  (byte*) D018#15 ← phi( @2/(byte*) D018#16 )
  (byte*) charset1#6 ← phi( @2/(byte*) charset1#8 )
  (byte*) screen#11 ← phi( @2/(byte*) screen#14 )
  (byte*) RASTER#9 ← phi( @2/(byte*) RASTER#12 )
  asm { sei  }
  to:main::@1
main::@1: scope:[main]  from main main::@20
  (byte*) charset2#11 ← phi( main/(byte*) charset2#12 main::@20/(byte*) charset2#13 )
  (byte*) BGCOL#14 ← phi( main/(byte*) BGCOL#15 main::@20/(byte*) BGCOL#2 )
  (byte*) D018#14 ← phi( main/(byte*) D018#15 main::@20/(byte*) D018#2 )
  (byte*) charset1#5 ← phi( main/(byte*) charset1#6 main::@20/(byte*) charset1#7 )
  (byte*) screen#9 ← phi( main/(byte*) screen#11 main::@20/(byte*) screen#12 )
  (byte*) RASTER#7 ← phi( main/(byte*) RASTER#9 main::@20/(byte*) RASTER#10 )
  if(true) goto main::@2
  to:main::@return
main::@2: scope:[main]  from main::@1
  (byte*) charset2#9 ← phi( main::@1/(byte*) charset2#11 )
  (byte*) BGCOL#11 ← phi( main::@1/(byte*) BGCOL#14 )
  (byte*) D018#11 ← phi( main::@1/(byte*) D018#14 )
  (byte*) charset1#3 ← phi( main::@1/(byte*) charset1#5 )
  (byte*) screen#5 ← phi( main::@1/(byte*) screen#9 )
  (byte*) RASTER#3 ← phi( main::@1/(byte*) RASTER#7 )
  to:main::@4
main::@4: scope:[main]  from main::@2 main::@5
  (byte*) charset2#8 ← phi( main::@2/(byte*) charset2#9 main::@5/(byte*) charset2#10 )
  (byte*) BGCOL#9 ← phi( main::@2/(byte*) BGCOL#11 main::@5/(byte*) BGCOL#12 )
  (byte*) D018#9 ← phi( main::@2/(byte*) D018#11 main::@5/(byte*) D018#12 )
  (byte*) charset1#2 ← phi( main::@2/(byte*) charset1#3 main::@5/(byte*) charset1#4 )
  (byte*) screen#3 ← phi( main::@2/(byte*) screen#5 main::@5/(byte*) screen#6 )
  (byte*) RASTER#1 ← phi( main::@2/(byte*) RASTER#3 main::@5/(byte*) RASTER#4 )
  (bool~) main::$0 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) 255
  if((bool~) main::$0) goto main::@5
  to:main::@6
main::@5: scope:[main]  from main::@4
  (byte*) charset2#10 ← phi( main::@4/(byte*) charset2#8 )
  (byte*) BGCOL#12 ← phi( main::@4/(byte*) BGCOL#9 )
  (byte*) D018#12 ← phi( main::@4/(byte*) D018#9 )
  (byte*) charset1#4 ← phi( main::@4/(byte*) charset1#2 )
  (byte*) screen#6 ← phi( main::@4/(byte*) screen#3 )
  (byte*) RASTER#4 ← phi( main::@4/(byte*) RASTER#1 )
  to:main::@4
main::@6: scope:[main]  from main::@4
  (byte*) charset2#7 ← phi( main::@4/(byte*) charset2#8 )
  (byte*) RASTER#13 ← phi( main::@4/(byte*) RASTER#1 )
  (byte*) BGCOL#7 ← phi( main::@4/(byte*) BGCOL#9 )
  (byte*) D018#7 ← phi( main::@4/(byte*) D018#9 )
  (byte*) charset1#1 ← phi( main::@4/(byte*) charset1#2 )
  (byte*) screen#1 ← phi( main::@4/(byte*) screen#3 )
  (byte*) main::toD0181_screen#0 ← (byte*) screen#1
  (byte*) main::toD0181_charset#0 ← (byte*) charset1#1
  to:main::toD0181
main::toD0181: scope:[main]  from main::@6
  (byte*) charset1#16 ← phi( main::@6/(byte*) charset1#1 )
  (byte*) charset2#6 ← phi( main::@6/(byte*) charset2#7 )
  (byte*) screen#13 ← phi( main::@6/(byte*) screen#1 )
  (byte*) RASTER#11 ← phi( main::@6/(byte*) RASTER#13 )
  (byte*) BGCOL#5 ← phi( main::@6/(byte*) BGCOL#7 )
  (byte*) D018#5 ← phi( main::@6/(byte*) D018#7 )
  (byte*) main::toD0181_charset#1 ← phi( main::@6/(byte*) main::toD0181_charset#0 )
  (byte*) main::toD0181_screen#1 ← phi( main::@6/(byte*) main::toD0181_screen#0 )
  (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1
  (word/signed dword/dword) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 / (byte/signed byte/word/signed word/dword/signed dword) 64
  (word) main::toD0181_$2#0 ← ((word)) (byte*) main::toD0181_charset#1
  (word/signed dword/dword) main::toD0181_$3#0 ← (word) main::toD0181_$2#0 / (word/signed word/dword/signed dword) 1024
  (word/dword) main::toD0181_$4#0 ← (word/signed dword/dword) main::toD0181_$1#0 | (word/signed dword/dword) main::toD0181_$3#0
  (byte) main::toD0181_$5#0 ← ((byte)) (word/dword) main::toD0181_$4#0
  (byte) main::toD0181_return#0 ← (byte) main::toD0181_$5#0
  to:main::toD0181_@return
main::toD0181_@return: scope:[main]  from main::toD0181
  (byte*) charset1#15 ← phi( main::toD0181/(byte*) charset1#16 )
  (byte*) charset2#5 ← phi( main::toD0181/(byte*) charset2#6 )
  (byte*) screen#10 ← phi( main::toD0181/(byte*) screen#13 )
  (byte*) RASTER#8 ← phi( main::toD0181/(byte*) RASTER#11 )
  (byte*) BGCOL#3 ← phi( main::toD0181/(byte*) BGCOL#5 )
  (byte*) D018#3 ← phi( main::toD0181/(byte*) D018#5 )
  (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 )
  (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2
  to:main::@19
main::@19: scope:[main]  from main::toD0181_@return
  (byte*) charset1#13 ← phi( main::toD0181_@return/(byte*) charset1#15 )
  (byte*) charset2#3 ← phi( main::toD0181_@return/(byte*) charset2#5 )
  (byte*) screen#7 ← phi( main::toD0181_@return/(byte*) screen#10 )
  (byte*) RASTER#5 ← phi( main::toD0181_@return/(byte*) RASTER#8 )
  (byte*) BGCOL#1 ← phi( main::toD0181_@return/(byte*) BGCOL#3 )
  (byte*) D018#1 ← phi( main::toD0181_@return/(byte*) D018#3 )
  (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 )
  (byte~) main::$1 ← (byte) main::toD0181_return#3
  *((byte*) D018#1) ← (byte~) main::$1
  *((byte*) BGCOL#1) ← (byte/signed byte/word/signed word/dword/signed dword) 6
  to:main::@7
main::@7: scope:[main]  from main::@19 main::@8
  (byte*) charset1#12 ← phi( main::@19/(byte*) charset1#13 main::@8/(byte*) charset1#14 )
  (byte*) BGCOL#10 ← phi( main::@19/(byte*) BGCOL#1 main::@8/(byte*) BGCOL#13 )
  (byte*) D018#10 ← phi( main::@19/(byte*) D018#1 main::@8/(byte*) D018#13 )
  (byte*) charset2#2 ← phi( main::@19/(byte*) charset2#3 main::@8/(byte*) charset2#4 )
  (byte*) screen#4 ← phi( main::@19/(byte*) screen#7 main::@8/(byte*) screen#8 )
  (byte*) RASTER#2 ← phi( main::@19/(byte*) RASTER#5 main::@8/(byte*) RASTER#6 )
  (bool~) main::$2 ← *((byte*) RASTER#2) != (byte/signed byte/word/signed word/dword/signed dword) 98
  if((bool~) main::$2) goto main::@8
  to:main::@9
main::@8: scope:[main]  from main::@7
  (byte*) charset1#14 ← phi( main::@7/(byte*) charset1#12 )
  (byte*) BGCOL#13 ← phi( main::@7/(byte*) BGCOL#10 )
  (byte*) D018#13 ← phi( main::@7/(byte*) D018#10 )
  (byte*) charset2#4 ← phi( main::@7/(byte*) charset2#2 )
  (byte*) screen#8 ← phi( main::@7/(byte*) screen#4 )
  (byte*) RASTER#6 ← phi( main::@7/(byte*) RASTER#2 )
  to:main::@7
main::@9: scope:[main]  from main::@7
  (byte*) charset1#11 ← phi( main::@7/(byte*) charset1#12 )
  (byte*) RASTER#16 ← phi( main::@7/(byte*) RASTER#2 )
  (byte*) BGCOL#8 ← phi( main::@7/(byte*) BGCOL#10 )
  (byte*) D018#8 ← phi( main::@7/(byte*) D018#10 )
  (byte*) charset2#1 ← phi( main::@7/(byte*) charset2#2 )
  (byte*) screen#2 ← phi( main::@7/(byte*) screen#4 )
  (byte*) main::toD0182_screen#0 ← (byte*) screen#2
  (byte*) main::toD0182_charset#0 ← (byte*) charset2#1
  to:main::toD0182
main::toD0182: scope:[main]  from main::@9
  (byte*) charset2#16 ← phi( main::@9/(byte*) charset2#1 )
  (byte*) charset1#10 ← phi( main::@9/(byte*) charset1#11 )
  (byte*) screen#16 ← phi( main::@9/(byte*) screen#2 )
  (byte*) RASTER#15 ← phi( main::@9/(byte*) RASTER#16 )
  (byte*) BGCOL#6 ← phi( main::@9/(byte*) BGCOL#8 )
  (byte*) D018#6 ← phi( main::@9/(byte*) D018#8 )
  (byte*) main::toD0182_charset#1 ← phi( main::@9/(byte*) main::toD0182_charset#0 )
  (byte*) main::toD0182_screen#1 ← phi( main::@9/(byte*) main::toD0182_screen#0 )
  (word) main::toD0182_$0#0 ← ((word)) (byte*) main::toD0182_screen#1
  (word/signed dword/dword) main::toD0182_$1#0 ← (word) main::toD0182_$0#0 / (byte/signed byte/word/signed word/dword/signed dword) 64
  (word) main::toD0182_$2#0 ← ((word)) (byte*) main::toD0182_charset#1
  (word/signed dword/dword) main::toD0182_$3#0 ← (word) main::toD0182_$2#0 / (word/signed word/dword/signed dword) 1024
  (word/dword) main::toD0182_$4#0 ← (word/signed dword/dword) main::toD0182_$1#0 | (word/signed dword/dword) main::toD0182_$3#0
  (byte) main::toD0182_$5#0 ← ((byte)) (word/dword) main::toD0182_$4#0
  (byte) main::toD0182_return#0 ← (byte) main::toD0182_$5#0
  to:main::toD0182_@return
main::toD0182_@return: scope:[main]  from main::toD0182
  (byte*) charset2#15 ← phi( main::toD0182/(byte*) charset2#16 )
  (byte*) charset1#9 ← phi( main::toD0182/(byte*) charset1#10 )
  (byte*) screen#15 ← phi( main::toD0182/(byte*) screen#16 )
  (byte*) RASTER#14 ← phi( main::toD0182/(byte*) RASTER#15 )
  (byte*) BGCOL#4 ← phi( main::toD0182/(byte*) BGCOL#6 )
  (byte*) D018#4 ← phi( main::toD0182/(byte*) D018#6 )
  (byte) main::toD0182_return#2 ← phi( main::toD0182/(byte) main::toD0182_return#0 )
  (byte) main::toD0182_return#1 ← (byte) main::toD0182_return#2
  to:main::@20
main::@20: scope:[main]  from main::toD0182_@return
  (byte*) charset2#13 ← phi( main::toD0182_@return/(byte*) charset2#15 )
  (byte*) charset1#7 ← phi( main::toD0182_@return/(byte*) charset1#9 )
  (byte*) screen#12 ← phi( main::toD0182_@return/(byte*) screen#15 )
  (byte*) RASTER#10 ← phi( main::toD0182_@return/(byte*) RASTER#14 )
  (byte*) BGCOL#2 ← phi( main::toD0182_@return/(byte*) BGCOL#4 )
  (byte*) D018#2 ← phi( main::toD0182_@return/(byte*) D018#4 )
  (byte) main::toD0182_return#3 ← phi( main::toD0182_@return/(byte) main::toD0182_return#1 )
  (byte~) main::$3 ← (byte) main::toD0182_return#3
  *((byte*) D018#2) ← (byte~) main::$3
  *((byte*) BGCOL#2) ← (byte/signed byte/word/signed word/dword/signed dword) 11
  to:main::@1
main::@return: scope:[main]  from main::@1
  return 
  to:@return
@2: scope:[]  from @begin
  (byte*) charset2#14 ← phi( @begin/(byte*) charset2#0 )
  (byte*) BGCOL#16 ← phi( @begin/(byte*) BGCOL#0 )
  (byte*) D018#16 ← phi( @begin/(byte*) D018#0 )
  (byte*) charset1#8 ← phi( @begin/(byte*) charset1#0 )
  (byte*) screen#14 ← phi( @begin/(byte*) screen#0 )
  (byte*) RASTER#12 ← phi( @begin/(byte*) RASTER#0 )
  call main 
  to:@3
@3: scope:[]  from @2
  to:@end
@end: scope:[]  from @3

SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @begin
(label) @end
(byte*) BGCOL
(byte*) BGCOL#0
(byte*) BGCOL#1
(byte*) BGCOL#10
(byte*) BGCOL#11
(byte*) BGCOL#12
(byte*) BGCOL#13
(byte*) BGCOL#14
(byte*) BGCOL#15
(byte*) BGCOL#16
(byte*) BGCOL#2
(byte*) BGCOL#3
(byte*) BGCOL#4
(byte*) BGCOL#5
(byte*) BGCOL#6
(byte*) BGCOL#7
(byte*) BGCOL#8
(byte*) BGCOL#9
(byte*) D018
(byte*) D018#0
(byte*) D018#1
(byte*) D018#10
(byte*) D018#11
(byte*) D018#12
(byte*) D018#13
(byte*) D018#14
(byte*) D018#15
(byte*) D018#16
(byte*) D018#2
(byte*) D018#3
(byte*) D018#4
(byte*) D018#5
(byte*) D018#6
(byte*) D018#7
(byte*) D018#8
(byte*) D018#9
(byte*) RASTER
(byte*) RASTER#0
(byte*) RASTER#1
(byte*) RASTER#10
(byte*) RASTER#11
(byte*) RASTER#12
(byte*) RASTER#13
(byte*) RASTER#14
(byte*) RASTER#15
(byte*) RASTER#16
(byte*) RASTER#2
(byte*) RASTER#3
(byte*) RASTER#4
(byte*) RASTER#5
(byte*) RASTER#6
(byte*) RASTER#7
(byte*) RASTER#8
(byte*) RASTER#9
(byte*) charset1
(byte*) charset1#0
(byte*) charset1#1
(byte*) charset1#10
(byte*) charset1#11
(byte*) charset1#12
(byte*) charset1#13
(byte*) charset1#14
(byte*) charset1#15
(byte*) charset1#16
(byte*) charset1#2
(byte*) charset1#3
(byte*) charset1#4
(byte*) charset1#5
(byte*) charset1#6
(byte*) charset1#7
(byte*) charset1#8
(byte*) charset1#9
(byte*) charset2
(byte*) charset2#0
(byte*) charset2#1
(byte*) charset2#10
(byte*) charset2#11
(byte*) charset2#12
(byte*) charset2#13
(byte*) charset2#14
(byte*) charset2#15
(byte*) charset2#16
(byte*) charset2#2
(byte*) charset2#3
(byte*) charset2#4
(byte*) charset2#5
(byte*) charset2#6
(byte*) charset2#7
(byte*) charset2#8
(byte*) charset2#9
(void()) main()
(bool~) main::$0
(byte~) main::$1
(bool~) main::$2
(byte~) main::$3
(label) main::@1
(label) main::@19
(label) main::@2
(label) main::@20
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(label) main::@return
(label) main::toD0181
(word~) main::toD0181_$0
(word) main::toD0181_$0#0
(word/signed dword/dword~) main::toD0181_$1
(word/signed dword/dword) main::toD0181_$1#0
(word~) main::toD0181_$2
(word) main::toD0181_$2#0
(word/signed dword/dword~) main::toD0181_$3
(word/signed dword/dword) main::toD0181_$3#0
(word/dword~) main::toD0181_$4
(word/dword) main::toD0181_$4#0
(byte~) main::toD0181_$5
(byte) main::toD0181_$5#0
(label) main::toD0181_@return
(byte*) main::toD0181_charset
(byte*) main::toD0181_charset#0
(byte*) main::toD0181_charset#1
(byte) main::toD0181_return
(byte) main::toD0181_return#0
(byte) main::toD0181_return#1
(byte) main::toD0181_return#2
(byte) main::toD0181_return#3
(byte*) main::toD0181_screen
(byte*) main::toD0181_screen#0
(byte*) main::toD0181_screen#1
(label) main::toD0182
(word~) main::toD0182_$0
(word) main::toD0182_$0#0
(word/signed dword/dword~) main::toD0182_$1
(word/signed dword/dword) main::toD0182_$1#0
(word~) main::toD0182_$2
(word) main::toD0182_$2#0
(word/signed dword/dword~) main::toD0182_$3
(word/signed dword/dword) main::toD0182_$3#0
(word/dword~) main::toD0182_$4
(word/dword) main::toD0182_$4#0
(byte~) main::toD0182_$5
(byte) main::toD0182_$5#0
(label) main::toD0182_@return
(byte*) main::toD0182_charset
(byte*) main::toD0182_charset#0
(byte*) main::toD0182_charset#1
(byte) main::toD0182_return
(byte) main::toD0182_return#0
(byte) main::toD0182_return#1
(byte) main::toD0182_return#2
(byte) main::toD0182_return#3
(byte*) main::toD0182_screen
(byte*) main::toD0182_screen#0
(byte*) main::toD0182_screen#1
(byte*) screen
(byte*) screen#0
(byte*) screen#1
(byte*) screen#10
(byte*) screen#11
(byte*) screen#12
(byte*) screen#13
(byte*) screen#14
(byte*) screen#15
(byte*) screen#16
(byte*) screen#2
(byte*) screen#3
(byte*) screen#4
(byte*) screen#5
(byte*) screen#6
(byte*) screen#7
(byte*) screen#8
(byte*) screen#9

Culled Empty Block (label) @3
Successful SSA optimization Pass2CullEmptyBlocks
Alias (byte*) RASTER#3 = (byte*) RASTER#7 
Alias (byte*) screen#5 = (byte*) screen#9 
Alias (byte*) charset1#3 = (byte*) charset1#5 
Alias (byte*) D018#11 = (byte*) D018#14 
Alias (byte*) BGCOL#11 = (byte*) BGCOL#14 
Alias (byte*) charset2#11 = (byte*) charset2#9 
Alias (byte*) RASTER#1 = (byte*) RASTER#4 (byte*) RASTER#13 (byte*) RASTER#11 (byte*) RASTER#8 (byte*) RASTER#5 
Alias (byte*) screen#1 = (byte*) screen#6 (byte*) screen#3 (byte*) screen#13 (byte*) screen#10 (byte*) screen#7 
Alias (byte*) charset1#1 = (byte*) charset1#4 (byte*) charset1#2 (byte*) charset1#16 (byte*) charset1#15 (byte*) charset1#13 
Alias (byte*) D018#1 = (byte*) D018#12 (byte*) D018#9 (byte*) D018#7 (byte*) D018#5 (byte*) D018#3 
Alias (byte*) BGCOL#1 = (byte*) BGCOL#12 (byte*) BGCOL#9 (byte*) BGCOL#7 (byte*) BGCOL#5 (byte*) BGCOL#3 
Alias (byte*) charset2#10 = (byte*) charset2#8 (byte*) charset2#7 (byte*) charset2#6 (byte*) charset2#5 (byte*) charset2#3 
Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 
Alias (byte*) main::toD0181_charset#0 = (byte*) main::toD0181_charset#1 
Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$5#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1 
Alias (byte*) RASTER#10 = (byte*) RASTER#6 (byte*) RASTER#2 (byte*) RASTER#16 (byte*) RASTER#15 (byte*) RASTER#14 
Alias (byte*) screen#12 = (byte*) screen#8 (byte*) screen#4 (byte*) screen#2 (byte*) screen#16 (byte*) screen#15 
Alias (byte*) charset2#1 = (byte*) charset2#4 (byte*) charset2#2 (byte*) charset2#16 (byte*) charset2#15 (byte*) charset2#13 
Alias (byte*) D018#10 = (byte*) D018#13 (byte*) D018#8 (byte*) D018#6 (byte*) D018#4 (byte*) D018#2 
Alias (byte*) BGCOL#10 = (byte*) BGCOL#13 (byte*) BGCOL#8 (byte*) BGCOL#6 (byte*) BGCOL#4 (byte*) BGCOL#2 
Alias (byte*) charset1#10 = (byte*) charset1#14 (byte*) charset1#12 (byte*) charset1#11 (byte*) charset1#9 (byte*) charset1#7 
Alias (byte*) main::toD0182_screen#0 = (byte*) main::toD0182_screen#1 
Alias (byte*) main::toD0182_charset#0 = (byte*) main::toD0182_charset#1 
Alias (byte) main::toD0182_return#0 = (byte) main::toD0182_$5#0 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$3 
Alias (byte*) RASTER#0 = (byte*) RASTER#12 
Alias (byte*) screen#0 = (byte*) screen#14 
Alias (byte*) charset1#0 = (byte*) charset1#8 
Alias (byte*) D018#0 = (byte*) D018#16 
Alias (byte*) BGCOL#0 = (byte*) BGCOL#16 
Alias (byte*) charset2#0 = (byte*) charset2#14 
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) RASTER#1
Self Phi Eliminated (byte*) screen#1
Self Phi Eliminated (byte*) charset1#1
Self Phi Eliminated (byte*) D018#1
Self Phi Eliminated (byte*) BGCOL#1
Self Phi Eliminated (byte*) charset2#10
Self Phi Eliminated (byte*) RASTER#10
Self Phi Eliminated (byte*) screen#12
Self Phi Eliminated (byte*) charset2#1
Self Phi Eliminated (byte*) D018#10
Self Phi Eliminated (byte*) BGCOL#10
Self Phi Eliminated (byte*) charset1#10
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) RASTER#9 (byte*) RASTER#0
Redundant Phi (byte*) screen#11 (byte*) screen#0
Redundant Phi (byte*) charset1#6 (byte*) charset1#0
Redundant Phi (byte*) D018#15 (byte*) D018#0
Redundant Phi (byte*) BGCOL#15 (byte*) BGCOL#0
Redundant Phi (byte*) charset2#12 (byte*) charset2#0
Redundant Phi (byte*) RASTER#1 (byte*) RASTER#3
Redundant Phi (byte*) screen#1 (byte*) screen#5
Redundant Phi (byte*) charset1#1 (byte*) charset1#3
Redundant Phi (byte*) D018#1 (byte*) D018#11
Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#11
Redundant Phi (byte*) charset2#10 (byte*) charset2#11
Redundant Phi (byte*) RASTER#10 (byte*) RASTER#1
Redundant Phi (byte*) screen#12 (byte*) screen#1
Redundant Phi (byte*) charset2#1 (byte*) charset2#10
Redundant Phi (byte*) D018#10 (byte*) D018#1
Redundant Phi (byte*) BGCOL#10 (byte*) BGCOL#1
Redundant Phi (byte*) charset1#10 (byte*) charset1#1
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) main::$0 [13] if(*((byte*) RASTER#3)!=(byte/word/signed word/dword/signed dword) 255) goto main::@5
Simple Condition (bool~) main::$2 [34] if(*((byte*) RASTER#3)!=(byte/signed byte/word/signed word/dword/signed dword) 98) goto main::@8
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) RASTER#0 = ((byte*))53266
Constant (const byte*) D018#0 = ((byte*))53272
Constant (const byte*) BGCOL#0 = ((byte*))53281
Constant (const byte*) screen#0 = ((byte*))1024
Constant (const byte*) charset1#0 = ((byte*))4096
Constant (const byte*) charset2#0 = ((byte*))6144
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [2] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Eliminating Noop Cast (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#0
Eliminating Noop Cast (word) main::toD0181_$2#0 ← ((word)) (byte*) main::toD0181_charset#0
Eliminating Noop Cast (word) main::toD0182_$0#0 ← ((word)) (byte*) main::toD0182_screen#0
Eliminating Noop Cast (word) main::toD0182_$2#0 ← ((word)) (byte*) main::toD0182_charset#0
Successful SSA optimization Pass2NopCastElimination
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::toD0182_@return
Successful SSA optimization Pass2CullEmptyBlocks
Self Phi Eliminated (byte*) RASTER#3
Self Phi Eliminated (byte*) screen#5
Self Phi Eliminated (byte*) charset1#3
Self Phi Eliminated (byte*) D018#11
Self Phi Eliminated (byte*) BGCOL#11
Self Phi Eliminated (byte*) charset2#11
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) RASTER#3 (const byte*) RASTER#0
Redundant Phi (byte*) screen#5 (const byte*) screen#0
Redundant Phi (byte*) charset1#3 (const byte*) charset1#0
Redundant Phi (byte*) D018#11 (const byte*) D018#0
Redundant Phi (byte*) BGCOL#11 (const byte*) BGCOL#0
Redundant Phi (byte*) charset2#11 (const byte*) charset2#0
Successful SSA optimization Pass2RedundantPhiElimination
Constant (const byte*) main::toD0181_screen#0 = screen#0
Constant (const byte*) main::toD0181_charset#0 = charset1#0
Constant (const byte*) main::toD0182_screen#0 = screen#0
Constant (const byte*) main::toD0182_charset#0 = charset2#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const word/signed dword/dword) main::toD0181_$1#0 = (word)main::toD0181_screen#0/64
Constant (const word/signed dword/dword) main::toD0181_$3#0 = (word)main::toD0181_charset#0/1024
Constant (const word/signed dword/dword) main::toD0182_$1#0 = (word)main::toD0182_screen#0/64
Constant (const word/signed dword/dword) main::toD0182_$3#0 = (word)main::toD0182_charset#0/1024
Successful SSA optimization Pass2ConstantIdentification
Constant (const word/dword) main::toD0181_$4#0 = main::toD0181_$1#0|main::toD0181_$3#0
Constant (const word/dword) main::toD0182_$4#0 = main::toD0182_$1#0|main::toD0182_$3#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::toD0181_return#0 = ((byte))main::toD0181_$4#0
Constant (const byte) main::toD0182_return#0 = ((byte))main::toD0182_$4#0
Successful SSA optimization Pass2ConstantIdentification
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@6
Culled Empty Block (label) main::@9
Successful SSA optimization Pass2CullEmptyBlocks
Constant inlined main::toD0181_screen#0 = (const byte*) screen#0
Constant inlined main::toD0182_charset#0 = (const byte*) charset2#0
Constant inlined main::toD0181_$3#0 = (word)(const byte*) charset1#0/(word/signed word/dword/signed dword) 1024
Constant inlined main::toD0182_screen#0 = (const byte*) screen#0
Constant inlined main::toD0181_$4#0 = (word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) 64|(word)(const byte*) charset1#0/(word/signed word/dword/signed dword) 1024
Constant inlined main::toD0182_$1#0 = (word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) 64
Constant inlined main::toD0182_$4#0 = (word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) 64|(word)(const byte*) charset2#0/(word/signed word/dword/signed dword) 1024
Constant inlined main::toD0182_$3#0 = (word)(const byte*) charset2#0/(word/signed word/dword/signed dword) 1024
Constant inlined main::toD0181_$1#0 = (word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) 64
Constant inlined main::toD0181_charset#0 = (const byte*) charset1#0
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toD0182
CALL GRAPH
Calls in [] to main:2 

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toD0182

FINAL CONTROL FLOW GRAPH
@begin: scope:[]  from
  [0] phi()
  to:@2
@2: scope:[]  from @begin
  [1] phi()
  [2] call main 
  to:@end
@end: scope:[]  from @2
  [3] phi()
main: scope:[main]  from @2
  asm { sei  }
  to:main::@4
main::@4: scope:[main]  from main main::@20 main::@4
  [5] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4
  to:main::toD0181
main::toD0181: scope:[main]  from main::@4
  [6] phi()
  to:main::@19
main::@19: scope:[main]  from main::toD0181
  [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
  [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 6
  to:main::@7
main::@7: scope:[main]  from main::@19 main::@7
  [9] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 98) goto main::@7
  to:main::toD0182
main::toD0182: scope:[main]  from main::@7
  [10] phi()
  to:main::@20
main::@20: scope:[main]  from main::toD0182
  [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0
  [12] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 11
  to:main::@4


VARIABLE REGISTER WEIGHTS
(byte*) BGCOL
(byte*) D018
(byte*) RASTER
(byte*) charset1
(byte*) charset2
(void()) main()
(word~) main::toD0181_$0
(word/signed dword/dword~) main::toD0181_$1
(word~) main::toD0181_$2
(word/signed dword/dword~) main::toD0181_$3
(word/dword~) main::toD0181_$4
(byte~) main::toD0181_$5
(byte*) main::toD0181_charset
(byte) main::toD0181_return
(byte*) main::toD0181_screen
(word~) main::toD0182_$0
(word/signed dword/dword~) main::toD0182_$1
(word~) main::toD0182_$2
(word/signed dword/dword~) main::toD0182_$3
(word/dword~) main::toD0182_$4
(byte~) main::toD0182_$5
(byte*) main::toD0182_charset
(byte) main::toD0182_return
(byte*) main::toD0182_screen
(byte*) screen

Initial phi equivalence classes
Complete equivalence classes

INITIAL ASM
//SEG0 File Comments
// Test inline function
// Splits screen so upper half is lower case and lower half lower case
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label RASTER = $d012
  .label D018 = $d018
  .label BGCOL = $d021
  .label screen = $400
  .label charset1 = $1000
  .label charset2 = $1800
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
  jmp b2
//SEG5 @2
b2:
//SEG6 [2] call main 
  jsr main
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
    .const toD0181_return = screen/$40|charset1/$400
    .const toD0182_return = screen/$40|charset2/$400
  //SEG10 asm { sei  }
    sei
    jmp b4
  //SEG11 main::@4
  b4:
  //SEG12 [5] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b4
  //SEG13 [6] phi from main::@4 to main::toD0181 [phi:main::@4->main::toD0181]
  toD0181_from_b4:
    jmp toD0181
  //SEG14 main::toD0181
  toD0181:
    jmp b19
  //SEG15 main::@19
  b19:
  //SEG16 [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
  //SEG17 [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 6 -- _deref_pbuc1=vbuc2 
    lda #6
    sta BGCOL
    jmp b7
  //SEG18 main::@7
  b7:
  //SEG19 [9] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 98) goto main::@7 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$62
    bne b7
  //SEG20 [10] phi from main::@7 to main::toD0182 [phi:main::@7->main::toD0182]
  toD0182_from_b7:
    jmp toD0182
  //SEG21 main::toD0182
  toD0182:
    jmp b20
  //SEG22 main::@20
  b20:
  //SEG23 [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0182_return
    sta D018
  //SEG24 [12] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 11 -- _deref_pbuc1=vbuc2 
    lda #$b
    sta BGCOL
    jmp b4
}

REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 6 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [9] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 98) goto main::@7 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a 
Statement [12] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 11 [ ] ( main:2 [ ] ) always clobbers reg byte a 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [main] best 2137 combination 
Uplifting [] best 2137 combination 

ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
// Test inline function
// Splits screen so upper half is lower case and lower half lower case
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label RASTER = $d012
  .label D018 = $d018
  .label BGCOL = $d021
  .label screen = $400
  .label charset1 = $1000
  .label charset2 = $1800
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
  jmp b2
//SEG5 @2
b2:
//SEG6 [2] call main 
  jsr main
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
  jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
    .const toD0181_return = screen/$40|charset1/$400
    .const toD0182_return = screen/$40|charset2/$400
  //SEG10 asm { sei  }
    sei
    jmp b4
  //SEG11 main::@4
  b4:
  //SEG12 [5] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b4
  //SEG13 [6] phi from main::@4 to main::toD0181 [phi:main::@4->main::toD0181]
  toD0181_from_b4:
    jmp toD0181
  //SEG14 main::toD0181
  toD0181:
    jmp b19
  //SEG15 main::@19
  b19:
  //SEG16 [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
  //SEG17 [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 6 -- _deref_pbuc1=vbuc2 
    lda #6
    sta BGCOL
    jmp b7
  //SEG18 main::@7
  b7:
  //SEG19 [9] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 98) goto main::@7 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$62
    bne b7
  //SEG20 [10] phi from main::@7 to main::toD0182 [phi:main::@7->main::toD0182]
  toD0182_from_b7:
    jmp toD0182
  //SEG21 main::toD0182
  toD0182:
    jmp b20
  //SEG22 main::@20
  b20:
  //SEG23 [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0182_return
    sta D018
  //SEG24 [12] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 11 -- _deref_pbuc1=vbuc2 
    lda #$b
    sta BGCOL
    jmp b4
}

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp bend
Removing instruction jmp b4
Removing instruction jmp toD0181
Removing instruction jmp b19
Removing instruction jmp b7
Removing instruction jmp toD0182
Removing instruction jmp b20
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction b2_from_bbegin:
Removing instruction b2:
Removing instruction bend_from_b2:
Removing instruction toD0181_from_b4:
Removing instruction toD0181:
Removing instruction toD0182_from_b7:
Removing instruction toD0182:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b19:
Removing instruction b20:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(byte*) BGCOL
(const byte*) BGCOL#0 BGCOL = ((byte*))(word/dword/signed dword) 53281
(byte*) D018
(const byte*) D018#0 D018 = ((byte*))(word/dword/signed dword) 53272
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) 53266
(byte*) charset1
(const byte*) charset1#0 charset1 = ((byte*))(word/signed word/dword/signed dword) 4096
(byte*) charset2
(const byte*) charset2#0 charset2 = ((byte*))(word/signed word/dword/signed dword) 6144
(void()) main()
(label) main::@19
(label) main::@20
(label) main::@4
(label) main::@7
(label) main::toD0181
(word~) main::toD0181_$0
(word/signed dword/dword~) main::toD0181_$1
(word~) main::toD0181_$2
(word/signed dword/dword~) main::toD0181_$3
(word/dword~) main::toD0181_$4
(byte~) main::toD0181_$5
(byte*) main::toD0181_charset
(byte) main::toD0181_return
(const byte) main::toD0181_return#0 toD0181_return = ((byte))(word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) 64|(word)(const byte*) charset1#0/(word/signed word/dword/signed dword) 1024
(byte*) main::toD0181_screen
(label) main::toD0182
(word~) main::toD0182_$0
(word/signed dword/dword~) main::toD0182_$1
(word~) main::toD0182_$2
(word/signed dword/dword~) main::toD0182_$3
(word/dword~) main::toD0182_$4
(byte~) main::toD0182_$5
(byte*) main::toD0182_charset
(byte) main::toD0182_return
(const byte) main::toD0182_return#0 toD0182_return = ((byte))(word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) 64|(word)(const byte*) charset2#0/(word/signed word/dword/signed dword) 1024
(byte*) main::toD0182_screen
(byte*) screen
(const byte*) screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1024



FINAL ASSEMBLER
Score: 1972

//SEG0 File Comments
// Test inline function
// Splits screen so upper half is lower case and lower half lower case
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
  .label RASTER = $d012
  .label D018 = $d018
  .label BGCOL = $d021
  .label screen = $400
  .label charset1 = $1000
  .label charset2 = $1800
//SEG3 @begin
//SEG4 [1] phi from @begin to @2 [phi:@begin->@2]
//SEG5 @2
//SEG6 [2] call main 
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
//SEG8 @end
//SEG9 main
main: {
    .const toD0181_return = screen/$40|charset1/$400
    .const toD0182_return = screen/$40|charset2/$400
  //SEG10 asm { sei  }
    sei
  //SEG11 main::@4
  b4:
  //SEG12 [5] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$ff
    bne b4
  //SEG13 [6] phi from main::@4 to main::toD0181 [phi:main::@4->main::toD0181]
  //SEG14 main::toD0181
  //SEG15 main::@19
  //SEG16 [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0181_return
    sta D018
  //SEG17 [8] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 6 -- _deref_pbuc1=vbuc2 
    lda #6
    sta BGCOL
  //SEG18 main::@7
  b7:
  //SEG19 [9] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 98) goto main::@7 -- _deref_pbuc1_neq_vbuc2_then_la1 
    lda RASTER
    cmp #$62
    bne b7
  //SEG20 [10] phi from main::@7 to main::toD0182 [phi:main::@7->main::toD0182]
  //SEG21 main::toD0182
  //SEG22 main::@20
  //SEG23 [11] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 
    lda #toD0182_return
    sta D018
  //SEG24 [12] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 11 -- _deref_pbuc1=vbuc2 
    lda #$b
    sta BGCOL
    jmp b4
}

