.include "macros.inc"

.section .text, "ax"

.global Calculate__6CCRC32FPCvUi
Calculate__6CCRC32FPCvUi:
/* 80315590 003124F0  28 04 00 00 */	cmplwi r4, 0
/* 80315594 003124F4  3C A0 80 3D */	lis r5, gkCRC32Table@ha
/* 80315598 003124F8  38 A5 74 08 */	addi r5, r5, gkCRC32Table@l
/* 8031559C 003124FC  39 20 FF FF */	li r9, -1
/* 803155A0 00312500  41 82 00 B8 */	beq lbl_80315658
/* 803155A4 00312504  54 80 F0 BF */	rlwinm. r0, r4, 0x1e, 2, 0x1f
/* 803155A8 00312508  7C 09 03 A6 */	mtctr r0
/* 803155AC 0031250C  41 82 00 84 */	beq lbl_80315630
lbl_803155B0:
/* 803155B0 00312510  88 E3 00 00 */	lbz r7, 0(r3)
/* 803155B4 00312514  55 28 C2 3E */	srwi r8, r9, 8
/* 803155B8 00312518  7C E6 07 74 */	extsb r6, r7
/* 803155BC 0031251C  88 E3 00 01 */	lbz r7, 1(r3)
/* 803155C0 00312520  7D 20 32 78 */	xor r0, r9, r6
/* 803155C4 00312524  54 00 15 BA */	rlwinm r0, r0, 2, 0x16, 0x1d
/* 803155C8 00312528  7C E6 07 74 */	extsb r6, r7
/* 803155CC 0031252C  7C 05 00 2E */	lwzx r0, r5, r0
/* 803155D0 00312530  88 E3 00 02 */	lbz r7, 2(r3)
/* 803155D4 00312534  7D 09 02 78 */	xor r9, r8, r0
/* 803155D8 00312538  7D 20 32 78 */	xor r0, r9, r6
/* 803155DC 0031253C  7C E6 07 74 */	extsb r6, r7
/* 803155E0 00312540  54 00 15 BA */	rlwinm r0, r0, 2, 0x16, 0x1d
/* 803155E4 00312544  88 E3 00 03 */	lbz r7, 3(r3)
/* 803155E8 00312548  7C 05 00 2E */	lwzx r0, r5, r0
/* 803155EC 0031254C  55 28 C2 3E */	srwi r8, r9, 8
/* 803155F0 00312550  38 63 00 04 */	addi r3, r3, 4
/* 803155F4 00312554  7D 09 02 78 */	xor r9, r8, r0
/* 803155F8 00312558  7D 20 32 78 */	xor r0, r9, r6
/* 803155FC 0031255C  7C E6 07 74 */	extsb r6, r7
/* 80315600 00312560  54 00 15 BA */	rlwinm r0, r0, 2, 0x16, 0x1d
/* 80315604 00312564  55 28 C2 3E */	srwi r8, r9, 8
/* 80315608 00312568  7C 05 00 2E */	lwzx r0, r5, r0
/* 8031560C 0031256C  7D 09 02 78 */	xor r9, r8, r0
/* 80315610 00312570  7D 20 32 78 */	xor r0, r9, r6
/* 80315614 00312574  54 00 15 BA */	rlwinm r0, r0, 2, 0x16, 0x1d
/* 80315618 00312578  55 28 C2 3E */	srwi r8, r9, 8
/* 8031561C 0031257C  7C 05 00 2E */	lwzx r0, r5, r0
/* 80315620 00312580  7D 09 02 78 */	xor r9, r8, r0
/* 80315624 00312584  42 00 FF 8C */	bdnz lbl_803155B0
/* 80315628 00312588  70 84 00 03 */	andi. r4, r4, 3
/* 8031562C 0031258C  41 82 00 2C */	beq lbl_80315658
lbl_80315630:
/* 80315630 00312590  7C 89 03 A6 */	mtctr r4
lbl_80315634:
/* 80315634 00312594  88 E3 00 00 */	lbz r7, 0(r3)
/* 80315638 00312598  55 28 C2 3E */	srwi r8, r9, 8
/* 8031563C 0031259C  38 63 00 01 */	addi r3, r3, 1
/* 80315640 003125A0  7C E6 07 74 */	extsb r6, r7
/* 80315644 003125A4  7D 20 32 78 */	xor r0, r9, r6
/* 80315648 003125A8  54 00 15 BA */	rlwinm r0, r0, 2, 0x16, 0x1d
/* 8031564C 003125AC  7C 05 00 2E */	lwzx r0, r5, r0
/* 80315650 003125B0  7D 09 02 78 */	xor r9, r8, r0
/* 80315654 003125B4  42 00 FF E0 */	bdnz lbl_80315634
lbl_80315658:
/* 80315658 003125B8  7D 23 4B 78 */	mr r3, r9
/* 8031565C 003125BC  4E 80 00 20 */	blr

.section .rodata
.balign 8
.global gkCRC32Table
gkCRC32Table:
	# ROM: 0x3D4408
	.4byte 0
	.4byte 0x77073096
	.4byte 0xEE0E612C
	.4byte 0x990951BA
	.4byte 0x076DC419
	.4byte 0x706AF48F
	.4byte 0xE963A535
	.4byte 0x9E6495A3
	.4byte 0x0EDB8832
	.4byte 0x79DCB8A4
	.4byte 0xE0D5E91E
	.4byte 0x97D2D988
	.4byte 0x09B64C2B
	.4byte 0x7EB17CBD
	.4byte 0xE7B82D07
	.4byte 0x90BF1D91
	.4byte 0x1DB71064
	.4byte 0x6AB020F2
	.4byte 0xF3B97148
	.4byte 0x84BE41DE
	.4byte 0x1ADAD47D
	.4byte 0x6DDDE4EB
	.4byte 0xF4D4B551
	.4byte 0x83D385C7
	.4byte 0x136C9856
	.4byte 0x646BA8C0
	.4byte 0xFD62F97A
	.4byte 0x8A65C9EC
	.4byte 0x14015C4F
	.4byte 0x63066CD9
	.4byte 0xFA0F3D63
	.4byte 0x8D080DF5
	.4byte 0x3B6E20C8
	.4byte 0x4C69105E
	.4byte 0xD56041E4
	.4byte 0xA2677172
	.4byte 0x3C03E4D1
	.4byte 0x4B04D447
	.4byte 0xD20D85FD
	.4byte 0xA50AB56B
	.4byte 0x35B5A8FA
	.4byte 0x42B2986C
	.4byte 0xDBBBC9D6
	.4byte 0xACBCF940
	.4byte 0x32D86CE3
	.4byte 0x45DF5C75
	.4byte 0xDCD60DCF
	.4byte 0xABD13D59
	.4byte 0x26D930AC
	.4byte 0x51DE003A
	.4byte 0xC8D75180
	.4byte 0xBFD06116
	.4byte 0x21B4F4B5
	.4byte 0x56B3C423
	.4byte 0xCFBA9599
	.4byte 0xB8BDA50F
	.4byte 0x2802B89E
	.4byte 0x5F058808
	.4byte 0xC60CD9B2
	.4byte 0xB10BE924
	.4byte 0x2F6F7C87
	.4byte 0x58684C11
	.4byte 0xC1611DAB
	.4byte 0xB6662D3D
	.4byte 0x76DC4190
	.4byte 0x01DB7106
	.4byte 0x98D220BC
	.4byte 0xEFD5102A
	.4byte 0x71B18589
	.4byte 0x06B6B51F
	.4byte 0x9FBFE4A5
	.4byte 0xE8B8D433
	.4byte 0x7807C9A2
	.4byte 0x0F00F934
	.4byte 0x9609A88E
	.4byte 0xE10E9818
	.4byte 0x7F6A0DBB
	.4byte 0x086D3D2D
	.4byte 0x91646C97
	.4byte 0xE6635C01
	.4byte 0x6B6B51F4
	.4byte 0x1C6C6162
	.4byte 0x856530D8
	.4byte 0xF262004E
	.4byte 0x6C0695ED
	.4byte 0x1B01A57B
	.4byte 0x8208F4C1
	.4byte 0xF50FC457
	.4byte 0x65B0D9C6
	.4byte 0x12B7E950
	.4byte 0x8BBEB8EA
	.4byte 0xFCB9887C
	.4byte 0x62DD1DDF
	.4byte 0x15DA2D49
	.4byte 0x8CD37CF3
	.4byte 0xFBD44C65
	.4byte 0x4DB26158
	.4byte 0x3AB551CE
	.4byte 0xA3BC0074
	.4byte 0xD4BB30E2
	.4byte 0x4ADFA541
	.4byte 0x3DD895D7
	.4byte 0xA4D1C46D
	.4byte 0xD3D6F4FB
	.4byte 0x4369E96A
	.4byte 0x346ED9FC
	.4byte 0xAD678846
	.4byte 0xDA60B8D0
	.4byte 0x44042D73
	.4byte 0x33031DE5
	.4byte 0xAA0A4C5F
	.4byte 0xDD0D7CC9
	.4byte 0x5005713C
	.4byte 0x270241AA
	.4byte 0xBE0B1010
	.4byte 0xC90C2086
	.4byte 0x5768B525
	.4byte 0x206F85B3
	.4byte 0xB966D409
	.4byte 0xCE61E49F
	.4byte 0x5EDEF90E
	.4byte 0x29D9C998
	.4byte 0xB0D09822
	.4byte 0xC7D7A8B4
	.4byte 0x59B33D17
	.4byte 0x2EB40D81
	.4byte 0xB7BD5C3B
	.4byte 0xC0BA6CAD
	.4byte 0xEDB88320
	.4byte 0x9ABFB3B6
	.4byte 0x03B6E20C
	.4byte 0x74B1D29A
	.4byte 0xEAD54739
	.4byte 0x9DD277AF
	.4byte 0x04DB2615
	.4byte 0x73DC1683
	.4byte 0xE3630B12
	.4byte 0x94643B84
	.4byte 0x0D6D6A3E
	.4byte 0x7A6A5AA8
	.4byte 0xE40ECF0B
	.4byte 0x9309FF9D
	.4byte 0x0A00AE27
	.4byte 0x7D079EB1
	.4byte 0xF00F9344
	.4byte 0x8708A3D2
	.4byte 0x1E01F268
	.4byte 0x6906C2FE
	.4byte 0xF762575D
	.4byte 0x806567CB
	.4byte 0x196C3671
	.4byte 0x6E6B06E7
	.4byte 0xFED41B76
	.4byte 0x89D32BE0
	.4byte 0x10DA7A5A
	.4byte 0x67DD4ACC
	.4byte 0xF9B9DF6F
	.4byte 0x8EBEEFF9
	.4byte 0x17B7BE43
	.4byte 0x60B08ED5
	.4byte 0xD6D6A3E8
	.4byte 0xA1D1937E
	.4byte 0x38D8C2C4
	.4byte 0x4FDFF252
	.4byte 0xD1BB67F1
	.4byte 0xA6BC5767
	.4byte 0x3FB506DD
	.4byte 0x48B2364B
	.4byte 0xD80D2BDA
	.4byte 0xAF0A1B4C
	.4byte 0x36034AF6
	.4byte 0x41047A60
	.4byte 0xDF60EFC3
	.4byte 0xA867DF55
	.4byte 0x316E8EEF
	.4byte 0x4669BE79
	.4byte 0xCB61B38C
	.4byte 0xBC66831A
	.4byte 0x256FD2A0
	.4byte 0x5268E236
	.4byte 0xCC0C7795
	.4byte 0xBB0B4703
	.4byte 0x220216B9
	.4byte 0x5505262F
	.4byte 0xC5BA3BBE
	.4byte 0xB2BD0B28
	.4byte 0x2BB45A92
	.4byte 0x5CB36A04
	.4byte 0xC2D7FFA7
	.4byte 0xB5D0CF31
	.4byte 0x2CD99E8B
	.4byte 0x5BDEAE1D
	.4byte 0x9B64C2B0
	.4byte 0xEC63F226
	.4byte 0x756AA39C
	.4byte 0x026D930A
	.4byte 0x9C0906A9
	.4byte 0xEB0E363F
	.4byte 0x72076785
	.4byte 0x05005713
	.4byte 0x95BF4A82
	.4byte 0xE2B87A14
	.4byte 0x7BB12BAE
	.4byte 0x0CB61B38
	.4byte 0x92D28E9B
	.4byte 0xE5D5BE0D
	.4byte 0x7CDCEFB7
	.4byte 0x0BDBDF21
	.4byte 0x86D3D2D4
	.4byte 0xF1D4E242
	.4byte 0x68DDB3F8
	.4byte 0x1FDA836E
	.4byte 0x81BE16CD
	.4byte 0xF6B9265B
	.4byte 0x6FB077E1
	.4byte 0x18B74777
	.4byte 0x88085AE6
	.4byte 0xFF0F6A70
	.4byte 0x66063BCA
	.4byte 0x11010B5C
	.4byte 0x8F659EFF
	.4byte 0xF862AE69
	.4byte 0x616BFFD3
	.4byte 0x166CCF45
	.4byte 0xA00AE278
	.4byte 0xD70DD2EE
	.4byte 0x4E048354
	.4byte 0x3903B3C2
	.4byte 0xA7672661
	.4byte 0xD06016F7
	.4byte 0x4969474D
	.4byte 0x3E6E77DB
	.4byte 0xAED16A4A
	.4byte 0xD9D65ADC
	.4byte 0x40DF0B66
	.4byte 0x37D83BF0
	.4byte 0xA9BCAE53
	.4byte 0xDEBB9EC5
	.4byte 0x47B2CF7F
	.4byte 0x30B5FFE9
	.4byte 0xBDBDF21C
	.4byte 0xCABAC28A
	.4byte 0x53B39330
	.4byte 0x24B4A3A6
	.4byte 0xBAD03605
	.4byte 0xCDD70693
	.4byte 0x54DE5729
	.4byte 0x23D967BF
	.4byte 0xB3667A2E
	.4byte 0xC4614AB8
	.4byte 0x5D681B02
	.4byte 0x2A6F2B94
	.4byte 0xB40BBE37
	.4byte 0xC30C8EA1
	.4byte 0x5A05DF1B
	.4byte 0x2D02EF8D