
__interrupt(hardware_all) void vblank()
vblank: scope:[vblank]  from
  [0] phi()
  [1] call readJoy1
  [2] readJoy1::return#2 = readJoy1::joy#2
  to:vblank::@9
vblank::@9: scope:[vblank]  from vblank
  [3] vblank::joy#0 = readJoy1::return#2
  [4] vblank::$1 = vblank::joy#0 & JOY_DOWN
  [5] if(0==vblank::$1) goto vblank::@1
  to:vblank::@4
vblank::@4: scope:[vblank]  from vblank::@9
  [6] *((char *)SPRITE_BUFFER) = ++ *((char *)SPRITE_BUFFER)
  [7] *((char *)SPRITE_BUFFER+1*SIZEOF_STRUCT_SPRITEDATA) = ++ *((char *)SPRITE_BUFFER+1*SIZEOF_STRUCT_SPRITEDATA)
  [8] *((char *)SPRITE_BUFFER+2*SIZEOF_STRUCT_SPRITEDATA) = ++ *((char *)SPRITE_BUFFER+2*SIZEOF_STRUCT_SPRITEDATA)
  [9] *((char *)SPRITE_BUFFER+3*SIZEOF_STRUCT_SPRITEDATA) = ++ *((char *)SPRITE_BUFFER+3*SIZEOF_STRUCT_SPRITEDATA)
  to:vblank::@1
vblank::@1: scope:[vblank]  from vblank::@4 vblank::@9
  [10] vblank::$3 = vblank::joy#0 & JOY_UP
  [11] if(0==vblank::$3) goto vblank::@2
  to:vblank::@5
vblank::@5: scope:[vblank]  from vblank::@1
  [12] *((char *)SPRITE_BUFFER) = -- *((char *)SPRITE_BUFFER)
  [13] *((char *)SPRITE_BUFFER+1*SIZEOF_STRUCT_SPRITEDATA) = -- *((char *)SPRITE_BUFFER+1*SIZEOF_STRUCT_SPRITEDATA)
  [14] *((char *)SPRITE_BUFFER+2*SIZEOF_STRUCT_SPRITEDATA) = -- *((char *)SPRITE_BUFFER+2*SIZEOF_STRUCT_SPRITEDATA)
  [15] *((char *)SPRITE_BUFFER+3*SIZEOF_STRUCT_SPRITEDATA) = -- *((char *)SPRITE_BUFFER+3*SIZEOF_STRUCT_SPRITEDATA)
  to:vblank::@2
vblank::@2: scope:[vblank]  from vblank::@1 vblank::@5
  [16] vblank::$5 = vblank::joy#0 & JOY_LEFT
  [17] if(0==vblank::$5) goto vblank::@3
  to:vblank::@6
vblank::@6: scope:[vblank]  from vblank::@2
  [18] *((char *)SPRITE_BUFFER+OFFSET_STRUCT_SPRITEDATA_X) = -- *((char *)SPRITE_BUFFER+OFFSET_STRUCT_SPRITEDATA_X)
  [19] *((char *)SPRITE_BUFFER+1*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X) = -- *((char *)SPRITE_BUFFER+1*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X)
  [20] *((char *)SPRITE_BUFFER+2*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X) = -- *((char *)SPRITE_BUFFER+2*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X)
  [21] *((char *)SPRITE_BUFFER+3*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X) = -- *((char *)SPRITE_BUFFER+3*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X)
  to:vblank::@3
vblank::@3: scope:[vblank]  from vblank::@2 vblank::@6
  [22] vblank::$7 = vblank::joy#0 & JOY_RIGHT
  [23] if(0==vblank::$7) goto vblank::ppuSpriteBufferDmaTransfer1
  to:vblank::@7
vblank::@7: scope:[vblank]  from vblank::@3
  [24] *((char *)SPRITE_BUFFER+OFFSET_STRUCT_SPRITEDATA_X) = ++ *((char *)SPRITE_BUFFER+OFFSET_STRUCT_SPRITEDATA_X)
  [25] *((char *)SPRITE_BUFFER+1*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X) = ++ *((char *)SPRITE_BUFFER+1*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X)
  [26] *((char *)SPRITE_BUFFER+2*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X) = ++ *((char *)SPRITE_BUFFER+2*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X)
  [27] *((char *)SPRITE_BUFFER+3*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X) = ++ *((char *)SPRITE_BUFFER+3*SIZEOF_STRUCT_SPRITEDATA+OFFSET_STRUCT_SPRITEDATA_X)
  to:vblank::ppuSpriteBufferDmaTransfer1
vblank::ppuSpriteBufferDmaTransfer1: scope:[vblank]  from vblank::@3 vblank::@7
  [28] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_OAMADDR) = 0
  [29] *((char *)APU+OFFSET_STRUCT_RICOH_2A03_OAMDMA) = byte1 SPRITE_BUFFER
  to:vblank::@8
vblank::@8: scope:[vblank]  from vblank::ppuSpriteBufferDmaTransfer1
  [30] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSCROLL) = 0
  [31] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSCROLL) = -8
  to:vblank::@return
vblank::@return: scope:[vblank]  from vblank::@8
  [32] return 
  to:@return

void main()
main: scope:[main]  from
  [33] phi()
  to:main::initNES1
main::initNES1: scope:[main]  from main
  asm { cld ldx#$ff txs  }
  to:main::initNES1_disableVideoOutput1
main::initNES1_disableVideoOutput1: scope:[main]  from main::initNES1
  [35] *((char *)PPU) = 0
  [36] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUMASK) = 0
  to:main::initNES1_disableAudioOutput1
main::initNES1_disableAudioOutput1: scope:[main]  from main::initNES1_disableVideoOutput1
  [37] *FR_COUNTER = $40
  [38] *((char *)APU+OFFSET_STRUCT_RICOH_2A03_DMC_FREQ) = $40
  to:main::initNES1_clearVBlankFlag1
main::initNES1_clearVBlankFlag1: scope:[main]  from main::initNES1_disableAudioOutput1
  asm { ldaPPU_PPUSTATUS  }
  to:main::initNES1_waitForVBlank1
main::initNES1_waitForVBlank1: scope:[main]  from main::initNES1_clearVBlankFlag1
  [40] phi()
  to:main::initNES1_waitForVBlank1_@1
main::initNES1_waitForVBlank1_@1: scope:[main]  from main::initNES1_waitForVBlank1 main::initNES1_waitForVBlank1_@1
  [41] main::initNES1_waitForVBlank1_$0 = *((volatile char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80
  [42] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1
  to:main::initNES1_@1
main::initNES1_@1: scope:[main]  from main::initNES1_@1 main::initNES1_waitForVBlank1_@1
  [43] main::initNES1_i#2 = phi( main::initNES1_@1/main::initNES1_i#1, main::initNES1_waitForVBlank1_@1/0 )
  [44] MEMORY[main::initNES1_i#2] = 0
  [45] (MEMORY+$100)[main::initNES1_i#2] = 0
  [46] (MEMORY+$200)[main::initNES1_i#2] = 0
  [47] (MEMORY+$300)[main::initNES1_i#2] = 0
  [48] (MEMORY+$400)[main::initNES1_i#2] = 0
  [49] (MEMORY+$500)[main::initNES1_i#2] = 0
  [50] (MEMORY+$600)[main::initNES1_i#2] = 0
  [51] (MEMORY+$700)[main::initNES1_i#2] = 0
  [52] main::initNES1_i#1 = ++ main::initNES1_i#2
  [53] if(0!=main::initNES1_i#1) goto main::initNES1_@1
  to:main::initNES1_waitForVBlank2
main::initNES1_waitForVBlank2: scope:[main]  from main::initNES1_@1
  [54] phi()
  to:main::initNES1_waitForVBlank2_@1
main::initNES1_waitForVBlank2_@1: scope:[main]  from main::initNES1_waitForVBlank2 main::initNES1_waitForVBlank2_@1
  [55] main::initNES1_waitForVBlank2_$0 = *((volatile char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80
  [56] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1
  to:main::initNES1_@7
main::initNES1_@7: scope:[main]  from main::initNES1_waitForVBlank2_@1
  asm { ldaPPU_PPUSTATUS  }
  to:main::@5
main::@5: scope:[main]  from main::initNES1_@7
  [58] phi()
  [59] call ppuDataTransfer
  to:main::@6
main::@6: scope:[main]  from main::@5
  [60] phi()
  [61] call ppuDataFill
  to:main::@7
main::@7: scope:[main]  from main::@6
  [62] phi()
  [63] call ppuDataFill
  to:main::@1
main::@1: scope:[main]  from main::@7 main::@8
  [64] main::x#2 = phi( main::@7/0, main::@8/main::x#1 )
  [65] if(main::x#2<$20) goto main::@2
  to:main::@3
main::@3: scope:[main]  from main::@1
  [66] phi()
  [67] call ppuDataPutTile
  to:main::@9
main::@9: scope:[main]  from main::@3
  [68] phi()
  [69] call memcpy
  to:main::enableVideoOutput1
main::enableVideoOutput1: scope:[main]  from main::@9
  [70] *((char *)PPU) = $80
  [71] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUMASK) = $1e
  to:main::@4
main::@4: scope:[main]  from main::@4 main::enableVideoOutput1
  [72] phi()
  to:main::@4
main::@2: scope:[main]  from main::@1
  [73] ppuDataPutTile::ppuData#0 = PPU_NAME_TABLE_0+(unsigned int)$14*$20 + main::x#2
  [74] ppuDataPutTile::ppuData#9 = (void * const )ppuDataPutTile::ppuData#0
  [75] call ppuDataPutTile
  to:main::@8
main::@8: scope:[main]  from main::@2
  [76] main::x#1 = main::x#2 + 2
  to:main::@1

char readJoy1()
readJoy1: scope:[readJoy1]  from vblank
  [77] *((char *)APU+OFFSET_STRUCT_RICOH_2A03_JOY1) = 1
  [78] *((char *)APU+OFFSET_STRUCT_RICOH_2A03_JOY1) = 0
  to:readJoy1::@1
readJoy1::@1: scope:[readJoy1]  from readJoy1 readJoy1::@2
  [79] readJoy1::joy#2 = phi( readJoy1/0, readJoy1::@2/readJoy1::joy#1 )
  [79] readJoy1::i#2 = phi( readJoy1/0, readJoy1::@2/readJoy1::i#1 )
  [80] if(readJoy1::i#2<8) goto readJoy1::@2
  to:readJoy1::@return
readJoy1::@return: scope:[readJoy1]  from readJoy1::@1
  [81] return 
  to:@return
readJoy1::@2: scope:[readJoy1]  from readJoy1::@1
  [82] readJoy1::$1 = readJoy1::joy#2 << 1
  [83] readJoy1::$2 = *((char *)APU+OFFSET_STRUCT_RICOH_2A03_JOY1) & 1
  [84] readJoy1::joy#1 = readJoy1::$1 | readJoy1::$2
  [85] readJoy1::i#1 = ++ readJoy1::i#2
  to:readJoy1::@1

void ppuDataTransfer(void * const ppuData , void * const cpuData , unsigned int size)
ppuDataTransfer: scope:[ppuDataTransfer]  from main::@5
  [86] phi()
  to:ppuDataTransfer::ppuDataPrepare1
ppuDataTransfer::ppuDataPrepare1: scope:[ppuDataTransfer]  from ppuDataTransfer
  [87] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = byte1 ppuDataTransfer::ppuData#0
  [88] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = 0
  to:ppuDataTransfer::@1
ppuDataTransfer::@1: scope:[ppuDataTransfer]  from ppuDataTransfer::@3 ppuDataTransfer::ppuDataPrepare1
  [89] ppuDataTransfer::cpuSrc#2 = phi( ppuDataTransfer::ppuDataPrepare1/(char *)ppuDataTransfer::cpuData#0, ppuDataTransfer::@3/ppuDataTransfer::cpuSrc#1 )
  [89] ppuDataTransfer::i#2 = phi( ppuDataTransfer::ppuDataPrepare1/0, ppuDataTransfer::@3/ppuDataTransfer::i#1 )
  [90] if(ppuDataTransfer::i#2<ppuDataTransfer::size#0) goto ppuDataTransfer::@2
  to:ppuDataTransfer::@return
ppuDataTransfer::@return: scope:[ppuDataTransfer]  from ppuDataTransfer::@1
  [91] return 
  to:@return
ppuDataTransfer::@2: scope:[ppuDataTransfer]  from ppuDataTransfer::@1
  [92] ppuDataTransfer::ppuDataPut1_val#0 = *ppuDataTransfer::cpuSrc#2
  to:ppuDataTransfer::ppuDataPut1
ppuDataTransfer::ppuDataPut1: scope:[ppuDataTransfer]  from ppuDataTransfer::@2
  [93] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUDATA) = ppuDataTransfer::ppuDataPut1_val#0
  to:ppuDataTransfer::@3
ppuDataTransfer::@3: scope:[ppuDataTransfer]  from ppuDataTransfer::ppuDataPut1
  [94] ppuDataTransfer::cpuSrc#1 = ++ ppuDataTransfer::cpuSrc#2
  [95] ppuDataTransfer::i#1 = ++ ppuDataTransfer::i#2
  to:ppuDataTransfer::@1

void ppuDataFill(void * const ppuData , char val , unsigned int size)
ppuDataFill: scope:[ppuDataFill]  from main::@6 main::@7
  [96] ppuDataFill::val#4 = phi( main::@6/$fc, main::@7/0 )
  [96] ppuDataFill::size#3 = phi( main::@6/$3c0, main::@7/$40 )
  [96] ppuDataFill::ppuDataPrepare1_ppuData#0 = phi( main::@6/(void * const )PPU_NAME_TABLE_0, main::@7/(void * const )PPU_ATTRIBUTE_TABLE_0 )
  to:ppuDataFill::ppuDataPrepare1
ppuDataFill::ppuDataPrepare1: scope:[ppuDataFill]  from ppuDataFill
  [97] ppuDataFill::ppuDataPrepare1_$0 = byte1  ppuDataFill::ppuDataPrepare1_ppuData#0
  [98] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = ppuDataFill::ppuDataPrepare1_$0
  [99] ppuDataFill::ppuDataPrepare1_$1 = byte0  ppuDataFill::ppuDataPrepare1_ppuData#0
  [100] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = ppuDataFill::ppuDataPrepare1_$1
  to:ppuDataFill::@1
ppuDataFill::@1: scope:[ppuDataFill]  from ppuDataFill::@2 ppuDataFill::ppuDataPrepare1
  [101] ppuDataFill::i#2 = phi( ppuDataFill::ppuDataPrepare1/0, ppuDataFill::@2/ppuDataFill::i#1 )
  [102] if(ppuDataFill::i#2<ppuDataFill::size#3) goto ppuDataFill::ppuDataPut1
  to:ppuDataFill::@return
ppuDataFill::@return: scope:[ppuDataFill]  from ppuDataFill::@1
  [103] return 
  to:@return
ppuDataFill::ppuDataPut1: scope:[ppuDataFill]  from ppuDataFill::@1
  [104] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUDATA) = ppuDataFill::val#4
  to:ppuDataFill::@2
ppuDataFill::@2: scope:[ppuDataFill]  from ppuDataFill::ppuDataPut1
  [105] ppuDataFill::i#1 = ++ ppuDataFill::i#2
  to:ppuDataFill::@1

void ppuDataPutTile(void * const ppuData , char *tile)
ppuDataPutTile: scope:[ppuDataPutTile]  from main::@2 main::@3
  [106] ppuDataPutTile::tile#10 = phi( main::@2/FLOOR, main::@3/FLAG )
  [106] ppuDataPutTile::ppuData#2 = phi( main::@2/ppuDataPutTile::ppuData#9, main::@3/(void * const )PPU_NAME_TABLE_0+(unsigned int)$12*$20+$1c )
  to:ppuDataPutTile::ppuDataPrepare1
ppuDataPutTile::ppuDataPrepare1: scope:[ppuDataPutTile]  from ppuDataPutTile
  [107] ppuDataPutTile::ppuDataPrepare1_$0 = byte1  ppuDataPutTile::ppuData#2
  [108] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = ppuDataPutTile::ppuDataPrepare1_$0
  [109] ppuDataPutTile::ppuDataPrepare1_$1 = byte0  ppuDataPutTile::ppuData#2
  [110] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = ppuDataPutTile::ppuDataPrepare1_$1
  to:ppuDataPutTile::@1
ppuDataPutTile::@1: scope:[ppuDataPutTile]  from ppuDataPutTile::ppuDataPrepare1
  [111] ppuDataPutTile::ppuDataPut1_val#0 = *ppuDataPutTile::tile#10
  to:ppuDataPutTile::ppuDataPut1
ppuDataPutTile::ppuDataPut1: scope:[ppuDataPutTile]  from ppuDataPutTile::@1
  [112] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUDATA) = ppuDataPutTile::ppuDataPut1_val#0
  to:ppuDataPutTile::@2
ppuDataPutTile::@2: scope:[ppuDataPutTile]  from ppuDataPutTile::ppuDataPut1
  [113] ppuDataPutTile::ppuDataPut2_val#0 = ppuDataPutTile::tile#10[1]
  to:ppuDataPutTile::ppuDataPut2
ppuDataPutTile::ppuDataPut2: scope:[ppuDataPutTile]  from ppuDataPutTile::@2
  [114] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUDATA) = ppuDataPutTile::ppuDataPut2_val#0
  to:ppuDataPutTile::@3
ppuDataPutTile::@3: scope:[ppuDataPutTile]  from ppuDataPutTile::ppuDataPut2
  [115] ppuDataPutTile::ppuDataPrepare2_ppuData#0 = (char *)ppuDataPutTile::ppuData#2 + $20
  to:ppuDataPutTile::ppuDataPrepare2
ppuDataPutTile::ppuDataPrepare2: scope:[ppuDataPutTile]  from ppuDataPutTile::@3
  [116] ppuDataPutTile::ppuDataPrepare2_$0 = byte1  (void * const )ppuDataPutTile::ppuDataPrepare2_ppuData#0
  [117] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = ppuDataPutTile::ppuDataPrepare2_$0
  [118] ppuDataPutTile::ppuDataPrepare2_$1 = byte0  (void * const )ppuDataPutTile::ppuDataPrepare2_ppuData#0
  [119] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = ppuDataPutTile::ppuDataPrepare2_$1
  to:ppuDataPutTile::@4
ppuDataPutTile::@4: scope:[ppuDataPutTile]  from ppuDataPutTile::ppuDataPrepare2
  [120] ppuDataPutTile::ppuDataPut3_val#0 = ppuDataPutTile::tile#10[2]
  to:ppuDataPutTile::ppuDataPut3
ppuDataPutTile::ppuDataPut3: scope:[ppuDataPutTile]  from ppuDataPutTile::@4
  [121] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUDATA) = ppuDataPutTile::ppuDataPut3_val#0
  to:ppuDataPutTile::@5
ppuDataPutTile::@5: scope:[ppuDataPutTile]  from ppuDataPutTile::ppuDataPut3
  [122] ppuDataPutTile::ppuDataPut4_val#0 = ppuDataPutTile::tile#10[3]
  to:ppuDataPutTile::ppuDataPut4
ppuDataPutTile::ppuDataPut4: scope:[ppuDataPutTile]  from ppuDataPutTile::@5
  [123] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUDATA) = ppuDataPutTile::ppuDataPut4_val#0
  to:ppuDataPutTile::@return
ppuDataPutTile::@return: scope:[ppuDataPutTile]  from ppuDataPutTile::ppuDataPut4
  [124] return 
  to:@return

void * memcpy(void *destination , void *source , unsigned int num)
memcpy: scope:[memcpy]  from main::@9
  [125] phi()
  to:memcpy::@1
memcpy::@1: scope:[memcpy]  from memcpy memcpy::@2
  [126] memcpy::dst#2 = phi( memcpy/(char *)memcpy::destination#0, memcpy::@2/memcpy::dst#1 )
  [126] memcpy::src#2 = phi( memcpy/(char *)memcpy::source#0, memcpy::@2/memcpy::src#1 )
  [127] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2
  to:memcpy::@return
memcpy::@return: scope:[memcpy]  from memcpy::@1
  [128] return 
  to:@return
memcpy::@2: scope:[memcpy]  from memcpy::@1
  [129] *memcpy::dst#2 = *memcpy::src#2
  [130] memcpy::dst#1 = ++ memcpy::dst#2
  [131] memcpy::src#1 = ++ memcpy::src#2
  to:memcpy::@1
