
void __start()
__start: scope:[__start]  from
  [0] phi()
  to:__start::__init1
__start::__init1: scope:[__start]  from __start
  [1] y_sin_idx = 0
  [2] x_sin_idx = $49
  [3] x_sin_idx_2 = $52
  to:__start::@1
__start::@1: scope:[__start]  from __start::__init1
  [4] phi()
  [5] call main
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  [6] return 
  to:@return

__interrupt(hardware_all) void vblank()
vblank: scope:[vblank]  from
  [7] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSCROLL) = 0
  [8] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSCROLL) = 0
  to:vblank::ppuSpriteBufferDmaTransfer1
vblank::ppuSpriteBufferDmaTransfer1: scope:[vblank]  from vblank
  [9] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_OAMADDR) = 0
  [10] *((char *)APU+OFFSET_STRUCT_RICOH_2A03_OAMDMA) = byte1 SPRITE_BUFFER
  to:vblank::@14
vblank::@14: scope:[vblank]  from vblank::ppuSpriteBufferDmaTransfer1
  [11] phi()
  [12] call readJoy1
  [13] readJoy1::return#2 = readJoy1::joy#2
  to:vblank::@15
vblank::@15: scope:[vblank]  from vblank::@14
  [14] vblank::joy#0 = readJoy1::return#2
  [15] if(0==vblank::joy#0) goto vblank::@1
  to:vblank::@return
vblank::@return: scope:[vblank]  from vblank::@15 vblank::@6
  [16] return 
  to:@return
vblank::@1: scope:[vblank]  from vblank::@15
  [17] vblank::y_idx#0 = y_sin_idx
  [18] y_sin_idx = ++ y_sin_idx
  [19] if(x_sin_idx==$ee) goto vblank::@3
  to:vblank::@2
vblank::@2: scope:[vblank]  from vblank::@1
  [20] vblank::$5 = x_sin_idx + 1
  to:vblank::@3
vblank::@3: scope:[vblank]  from vblank::@1 vblank::@2
  [21] vblank::$7 = phi( vblank::@1/0, vblank::@2/vblank::$5 )
  [22] x_sin_idx = vblank::$7
  [23] vblank::x_idx#0 = x_sin_idx
  [24] if(x_sin_idx_2==$58) goto vblank::@5
  to:vblank::@4
vblank::@4: scope:[vblank]  from vblank::@3
  [25] vblank::$10 = x_sin_idx_2 + 1
  to:vblank::@5
vblank::@5: scope:[vblank]  from vblank::@3 vblank::@4
  [26] vblank::$12 = phi( vblank::@3/0, vblank::@4/vblank::$10 )
  [27] x_sin_idx_2 = vblank::$12
  [28] vblank::x_idx_2#0 = x_sin_idx_2
  to:vblank::@6
vblank::@6: scope:[vblank]  from vblank::@13 vblank::@5
  [29] vblank::x_idx_2#2 = phi( vblank::@13/vblank::x_idx_2#1, vblank::@5/vblank::x_idx_2#0 )
  [29] vblank::x_idx#2 = phi( vblank::@13/vblank::x_idx#1, vblank::@5/vblank::x_idx#0 )
  [29] vblank::y_idx#2 = phi( vblank::@13/vblank::y_idx#1, vblank::@5/vblank::y_idx#0 )
  [29] vblank::s#2 = phi( vblank::@13/vblank::s#1, vblank::@5/0 )
  [30] if(vblank::s#2<$40) goto vblank::@7
  to:vblank::@return
vblank::@7: scope:[vblank]  from vblank::@6
  [31] vblank::$28 = vblank::s#2 << 2
  [32] ((char *)SPRITE_BUFFER)[vblank::$28] = SINTABLE_240[vblank::y_idx#2]
  [33] vblank::y_idx#1 = vblank::y_idx#2 - 4
  [34] vblank::$14 = SINTABLE_184[vblank::x_idx#2] + SINTABLE_64[vblank::x_idx_2#2]
  [35] ((char *)SPRITE_BUFFER+OFFSET_STRUCT_SPRITEDATA_X)[vblank::$28] = vblank::$14
  [36] if(vblank::x_idx#2<3) goto vblank::@8
  to:vblank::@9
vblank::@9: scope:[vblank]  from vblank::@7
  [37] vblank::$17 = vblank::x_idx#2 - 3
  to:vblank::@10
vblank::@10: scope:[vblank]  from vblank::@8 vblank::@9
  [38] vblank::x_idx#1 = phi( vblank::@8/vblank::$19, vblank::@9/vblank::$17 )
  [39] if(vblank::x_idx_2#2>=$56) goto vblank::@11
  to:vblank::@12
vblank::@12: scope:[vblank]  from vblank::@10
  [40] vblank::$23 = vblank::x_idx_2#2 + 3
  to:vblank::@13
vblank::@13: scope:[vblank]  from vblank::@11 vblank::@12
  [41] vblank::x_idx_2#1 = phi( vblank::@11/vblank::$25, vblank::@12/vblank::$23 )
  [42] vblank::s#1 = ++ vblank::s#2
  to:vblank::@6
vblank::@11: scope:[vblank]  from vblank::@10
  [43] vblank::$25 = vblank::x_idx_2#2 - $56
  to:vblank::@13
vblank::@8: scope:[vblank]  from vblank::@7
  [44] vblank::$19 = vblank::x_idx#2 + $ec
  to:vblank::@10

void main()
main: scope:[main]  from __start::@1
  [45] 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
  [47] *((char *)PPU) = 0
  [48] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUMASK) = 0
  to:main::initNES1_disableAudioOutput1
main::initNES1_disableAudioOutput1: scope:[main]  from main::initNES1_disableVideoOutput1
  [49] *FR_COUNTER = $40
  [50] *((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
  [52] phi()
  to:main::initNES1_waitForVBlank1_@1
main::initNES1_waitForVBlank1_@1: scope:[main]  from main::initNES1_waitForVBlank1 main::initNES1_waitForVBlank1_@1
  [53] main::initNES1_waitForVBlank1_$0 = *((volatile char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80
  [54] 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
  [55] main::initNES1_i#2 = phi( main::initNES1_@1/main::initNES1_i#1, main::initNES1_waitForVBlank1_@1/0 )
  [56] MEMORY[main::initNES1_i#2] = 0
  [57] (MEMORY+$100)[main::initNES1_i#2] = 0
  [58] (MEMORY+$200)[main::initNES1_i#2] = 0
  [59] (MEMORY+$300)[main::initNES1_i#2] = 0
  [60] (MEMORY+$400)[main::initNES1_i#2] = 0
  [61] (MEMORY+$500)[main::initNES1_i#2] = 0
  [62] (MEMORY+$600)[main::initNES1_i#2] = 0
  [63] (MEMORY+$700)[main::initNES1_i#2] = 0
  [64] main::initNES1_i#1 = ++ main::initNES1_i#2
  [65] if(0!=main::initNES1_i#1) goto main::initNES1_@1
  to:main::initNES1_waitForVBlank2
main::initNES1_waitForVBlank2: scope:[main]  from main::initNES1_@1
  [66] phi()
  to:main::initNES1_waitForVBlank2_@1
main::initNES1_waitForVBlank2_@1: scope:[main]  from main::initNES1_waitForVBlank2 main::initNES1_waitForVBlank2_@1
  [67] main::initNES1_waitForVBlank2_$0 = *((volatile char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80
  [68] 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::@4
main::@4: scope:[main]  from main::initNES1_@7
  [70] phi()
  [71] call ppuDataTransfer
  to:main::@5
main::@5: scope:[main]  from main::@4
  [72] phi()
  [73] call ppuDataFill
  to:main::@6
main::@6: scope:[main]  from main::@5
  [74] phi()
  [75] call ppuDataFill
  to:main::@1
main::@1: scope:[main]  from main::@2 main::@6
  [76] main::s#2 = phi( main::@2/main::s#1, main::@6/0 )
  [77] if(main::s#2<$40) goto main::@2
  to:main::enableVideoOutput1
main::enableVideoOutput1: scope:[main]  from main::@1
  [78] *((char *)PPU) = $80
  [79] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUMASK) = $1e
  to:main::@3
main::@3: scope:[main]  from main::@3 main::enableVideoOutput1
  [80] phi()
  to:main::@3
main::@2: scope:[main]  from main::@1
  [81] main::$7 = main::s#2 << 2
  [82] ((char *)SPRITE_BUFFER)[main::$7] = 0
  [83] ((char *)SPRITE_BUFFER+OFFSET_STRUCT_SPRITEDATA_TILE)[main::$7] = MESSAGE[main::s#2]
  [84] ((char *)SPRITE_BUFFER+OFFSET_STRUCT_SPRITEDATA_ATTRIBUTES)[main::$7] = 2
  [85] ((char *)SPRITE_BUFFER+OFFSET_STRUCT_SPRITEDATA_X)[main::$7] = 0
  [86] main::s#1 = ++ main::s#2
  to:main::@1

char readJoy1()
readJoy1: scope:[readJoy1]  from vblank::@14
  [87] *((char *)APU+OFFSET_STRUCT_RICOH_2A03_JOY1) = 1
  [88] *((char *)APU+OFFSET_STRUCT_RICOH_2A03_JOY1) = 0
  to:readJoy1::@1
readJoy1::@1: scope:[readJoy1]  from readJoy1 readJoy1::@2
  [89] readJoy1::joy#2 = phi( readJoy1/0, readJoy1::@2/readJoy1::joy#1 )
  [89] readJoy1::i#2 = phi( readJoy1/0, readJoy1::@2/readJoy1::i#1 )
  [90] if(readJoy1::i#2<8) goto readJoy1::@2
  to:readJoy1::@return
readJoy1::@return: scope:[readJoy1]  from readJoy1::@1
  [91] return 
  to:@return
readJoy1::@2: scope:[readJoy1]  from readJoy1::@1
  [92] readJoy1::$1 = readJoy1::joy#2 << 1
  [93] readJoy1::$2 = *((char *)APU+OFFSET_STRUCT_RICOH_2A03_JOY1) & 1
  [94] readJoy1::joy#1 = readJoy1::$1 | readJoy1::$2
  [95] 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::@4
  [96] phi()
  to:ppuDataTransfer::ppuDataPrepare1
ppuDataTransfer::ppuDataPrepare1: scope:[ppuDataTransfer]  from ppuDataTransfer
  [97] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = byte1 ppuDataTransfer::ppuData#0
  [98] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = 0
  to:ppuDataTransfer::@1
ppuDataTransfer::@1: scope:[ppuDataTransfer]  from ppuDataTransfer::@3 ppuDataTransfer::ppuDataPrepare1
  [99] ppuDataTransfer::cpuSrc#2 = phi( ppuDataTransfer::ppuDataPrepare1/(char *)ppuDataTransfer::cpuData#0, ppuDataTransfer::@3/ppuDataTransfer::cpuSrc#1 )
  [99] ppuDataTransfer::i#2 = phi( ppuDataTransfer::ppuDataPrepare1/0, ppuDataTransfer::@3/ppuDataTransfer::i#1 )
  [100] if(ppuDataTransfer::i#2<ppuDataTransfer::size#0) goto ppuDataTransfer::@2
  to:ppuDataTransfer::@return
ppuDataTransfer::@return: scope:[ppuDataTransfer]  from ppuDataTransfer::@1
  [101] return 
  to:@return
ppuDataTransfer::@2: scope:[ppuDataTransfer]  from ppuDataTransfer::@1
  [102] ppuDataTransfer::ppuDataPut1_val#0 = *ppuDataTransfer::cpuSrc#2
  to:ppuDataTransfer::ppuDataPut1
ppuDataTransfer::ppuDataPut1: scope:[ppuDataTransfer]  from ppuDataTransfer::@2
  [103] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUDATA) = ppuDataTransfer::ppuDataPut1_val#0
  to:ppuDataTransfer::@3
ppuDataTransfer::@3: scope:[ppuDataTransfer]  from ppuDataTransfer::ppuDataPut1
  [104] ppuDataTransfer::cpuSrc#1 = ++ ppuDataTransfer::cpuSrc#2
  [105] ppuDataTransfer::i#1 = ++ ppuDataTransfer::i#2
  to:ppuDataTransfer::@1

void ppuDataFill(void * const ppuData , char val , unsigned int size)
ppuDataFill: scope:[ppuDataFill]  from main::@5 main::@6
  [106] ppuDataFill::val#4 = phi( main::@5/'*', main::@6/0 )
  [106] ppuDataFill::size#3 = phi( main::@5/(unsigned int)$20*$1e, main::@6/$40 )
  [106] ppuDataFill::ppuDataPrepare1_ppuData#0 = phi( main::@5/(void * const )PPU_NAME_TABLE_0, main::@6/(void * const )PPU_ATTRIBUTE_TABLE_0 )
  to:ppuDataFill::ppuDataPrepare1
ppuDataFill::ppuDataPrepare1: scope:[ppuDataFill]  from ppuDataFill
  [107] ppuDataFill::ppuDataPrepare1_$0 = byte1  ppuDataFill::ppuDataPrepare1_ppuData#0
  [108] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = ppuDataFill::ppuDataPrepare1_$0
  [109] ppuDataFill::ppuDataPrepare1_$1 = byte0  ppuDataFill::ppuDataPrepare1_ppuData#0
  [110] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUADDR) = ppuDataFill::ppuDataPrepare1_$1
  to:ppuDataFill::@1
ppuDataFill::@1: scope:[ppuDataFill]  from ppuDataFill::@2 ppuDataFill::ppuDataPrepare1
  [111] ppuDataFill::i#2 = phi( ppuDataFill::ppuDataPrepare1/0, ppuDataFill::@2/ppuDataFill::i#1 )
  [112] if(ppuDataFill::i#2<ppuDataFill::size#3) goto ppuDataFill::ppuDataPut1
  to:ppuDataFill::@return
ppuDataFill::@return: scope:[ppuDataFill]  from ppuDataFill::@1
  [113] return 
  to:@return
ppuDataFill::ppuDataPut1: scope:[ppuDataFill]  from ppuDataFill::@1
  [114] *((char *)PPU+OFFSET_STRUCT_RICOH_2C02_PPUDATA) = ppuDataFill::val#4
  to:ppuDataFill::@2
ppuDataFill::@2: scope:[ppuDataFill]  from ppuDataFill::ppuDataPut1
  [115] ppuDataFill::i#1 = ++ ppuDataFill::i#2
  to:ppuDataFill::@1
