summaryrefslogtreecommitdiff
path: root/asm/Dolphin/gd/GDTev.s
blob: c9ec42f028e05f69d30c0486b7779260469a885a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
.include "macros.inc"

.section .text, "ax"  # 0x80005600 - 0x8036FBA0
.global GDSetTevOp
GDSetTevOp:
/* 800B1EA4 000AEDE4  7C 08 02 A6 */	mflr r0
/* 800B1EA8 000AEDE8  38 C0 00 0A */	li r6, 0xa
/* 800B1EAC 000AEDEC  90 01 00 04 */	stw r0, 4(r1)
/* 800B1EB0 000AEDF0  94 21 FF D0 */	stwu r1, -0x30(r1)
/* 800B1EB4 000AEDF4  93 E1 00 2C */	stw r31, 0x2c(r1)
/* 800B1EB8 000AEDF8  93 C1 00 28 */	stw r30, 0x28(r1)
/* 800B1EBC 000AEDFC  93 A1 00 24 */	stw r29, 0x24(r1)
/* 800B1EC0 000AEE00  3B A0 00 05 */	li r29, 5
/* 800B1EC4 000AEE04  93 81 00 20 */	stw r28, 0x20(r1)
/* 800B1EC8 000AEE08  7C 7C 1B 79 */	or. r28, r3, r3
/* 800B1ECC 000AEE0C  41 82 00 0C */	beq lbl_800B1ED8
/* 800B1ED0 000AEE10  38 C0 00 00 */	li r6, 0
/* 800B1ED4 000AEE14  3B A0 00 00 */	li r29, 0
lbl_800B1ED8:
/* 800B1ED8 000AEE18  2C 04 00 02 */	cmpwi r4, 2
/* 800B1EDC 000AEE1C  41 82 00 FC */	beq lbl_800B1FD8
/* 800B1EE0 000AEE20  40 80 00 14 */	bge lbl_800B1EF4
/* 800B1EE4 000AEE24  2C 04 00 00 */	cmpwi r4, 0
/* 800B1EE8 000AEE28  41 82 00 1C */	beq lbl_800B1F04
/* 800B1EEC 000AEE2C  40 80 00 80 */	bge lbl_800B1F6C
/* 800B1EF0 000AEE30  48 00 02 28 */	b lbl_800B2118
lbl_800B1EF4:
/* 800B1EF4 000AEE34  2C 04 00 04 */	cmpwi r4, 4
/* 800B1EF8 000AEE38  41 82 01 B8 */	beq lbl_800B20B0
/* 800B1EFC 000AEE3C  40 80 02 1C */	bge lbl_800B2118
/* 800B1F00 000AEE40  48 00 01 44 */	b lbl_800B2044
lbl_800B1F04:
/* 800B1F04 000AEE44  3B E0 00 01 */	li r31, 1
/* 800B1F08 000AEE48  93 E1 00 08 */	stw r31, 8(r1)
/* 800B1F0C 000AEE4C  3B C0 00 00 */	li r30, 0
/* 800B1F10 000AEE50  38 7C 00 00 */	addi r3, r28, 0
/* 800B1F14 000AEE54  93 C1 00 0C */	stw r30, 0xc(r1)
/* 800B1F18 000AEE58  38 80 00 0F */	li r4, 0xf
/* 800B1F1C 000AEE5C  38 A0 00 08 */	li r5, 8
/* 800B1F20 000AEE60  38 E0 00 0F */	li r7, 0xf
/* 800B1F24 000AEE64  39 00 00 00 */	li r8, 0
/* 800B1F28 000AEE68  39 20 00 00 */	li r9, 0
/* 800B1F2C 000AEE6C  39 40 00 00 */	li r10, 0
/* 800B1F30 000AEE70  48 00 02 09 */	bl GDSetTevColorCalc
/* 800B1F34 000AEE74  93 E1 00 08 */	stw r31, 8(r1)
/* 800B1F38 000AEE78  38 7C 00 00 */	addi r3, r28, 0
/* 800B1F3C 000AEE7C  38 DD 00 00 */	addi r6, r29, 0
/* 800B1F40 000AEE80  93 C1 00 0C */	stw r30, 0xc(r1)
/* 800B1F44 000AEE84  38 80 00 07 */	li r4, 7
/* 800B1F48 000AEE88  38 A0 00 04 */	li r5, 4
/* 800B1F4C 000AEE8C  93 C1 00 10 */	stw r30, 0x10(r1)
/* 800B1F50 000AEE90  38 E0 00 07 */	li r7, 7
/* 800B1F54 000AEE94  39 00 00 00 */	li r8, 0
/* 800B1F58 000AEE98  93 C1 00 14 */	stw r30, 0x14(r1)
/* 800B1F5C 000AEE9C  39 20 00 00 */	li r9, 0
/* 800B1F60 000AEEA0  39 40 00 00 */	li r10, 0
/* 800B1F64 000AEEA4  48 00 04 21 */	bl GDSetTevAlphaCalcAndSwap
/* 800B1F68 000AEEA8  48 00 01 B0 */	b lbl_800B2118
lbl_800B1F6C:
/* 800B1F6C 000AEEAC  3B E0 00 01 */	li r31, 1
/* 800B1F70 000AEEB0  93 E1 00 08 */	stw r31, 8(r1)
/* 800B1F74 000AEEB4  3B C0 00 00 */	li r30, 0
/* 800B1F78 000AEEB8  38 7C 00 00 */	addi r3, r28, 0
/* 800B1F7C 000AEEBC  93 C1 00 0C */	stw r30, 0xc(r1)
/* 800B1F80 000AEEC0  38 86 00 00 */	addi r4, r6, 0
/* 800B1F84 000AEEC4  38 A0 00 08 */	li r5, 8
/* 800B1F88 000AEEC8  38 C0 00 09 */	li r6, 9
/* 800B1F8C 000AEECC  38 E0 00 0F */	li r7, 0xf
/* 800B1F90 000AEED0  39 00 00 00 */	li r8, 0
/* 800B1F94 000AEED4  39 20 00 00 */	li r9, 0
/* 800B1F98 000AEED8  39 40 00 00 */	li r10, 0
/* 800B1F9C 000AEEDC  48 00 01 9D */	bl GDSetTevColorCalc
/* 800B1FA0 000AEEE0  93 E1 00 08 */	stw r31, 8(r1)
/* 800B1FA4 000AEEE4  38 7C 00 00 */	addi r3, r28, 0
/* 800B1FA8 000AEEE8  38 FD 00 00 */	addi r7, r29, 0
/* 800B1FAC 000AEEEC  93 C1 00 0C */	stw r30, 0xc(r1)
/* 800B1FB0 000AEEF0  38 80 00 07 */	li r4, 7
/* 800B1FB4 000AEEF4  38 A0 00 07 */	li r5, 7
/* 800B1FB8 000AEEF8  93 C1 00 10 */	stw r30, 0x10(r1)
/* 800B1FBC 000AEEFC  38 C0 00 07 */	li r6, 7
/* 800B1FC0 000AEF00  39 00 00 00 */	li r8, 0
/* 800B1FC4 000AEF04  93 C1 00 14 */	stw r30, 0x14(r1)
/* 800B1FC8 000AEF08  39 20 00 00 */	li r9, 0
/* 800B1FCC 000AEF0C  39 40 00 00 */	li r10, 0
/* 800B1FD0 000AEF10  48 00 03 B5 */	bl GDSetTevAlphaCalcAndSwap
/* 800B1FD4 000AEF14  48 00 01 44 */	b lbl_800B2118
lbl_800B1FD8:
/* 800B1FD8 000AEF18  3B E0 00 01 */	li r31, 1
/* 800B1FDC 000AEF1C  93 E1 00 08 */	stw r31, 8(r1)
/* 800B1FE0 000AEF20  3B C0 00 00 */	li r30, 0
/* 800B1FE4 000AEF24  38 7C 00 00 */	addi r3, r28, 0
/* 800B1FE8 000AEF28  93 C1 00 0C */	stw r30, 0xc(r1)
/* 800B1FEC 000AEF2C  38 86 00 00 */	addi r4, r6, 0
/* 800B1FF0 000AEF30  38 A0 00 0C */	li r5, 0xc
/* 800B1FF4 000AEF34  38 C0 00 08 */	li r6, 8
/* 800B1FF8 000AEF38  38 E0 00 0F */	li r7, 0xf
/* 800B1FFC 000AEF3C  39 00 00 00 */	li r8, 0
/* 800B2000 000AEF40  39 20 00 00 */	li r9, 0
/* 800B2004 000AEF44  39 40 00 00 */	li r10, 0
/* 800B2008 000AEF48  48 00 01 31 */	bl GDSetTevColorCalc
/* 800B200C 000AEF4C  93 E1 00 08 */	stw r31, 8(r1)
/* 800B2010 000AEF50  38 7C 00 00 */	addi r3, r28, 0
/* 800B2014 000AEF54  38 DD 00 00 */	addi r6, r29, 0
/* 800B2018 000AEF58  93 C1 00 0C */	stw r30, 0xc(r1)
/* 800B201C 000AEF5C  38 80 00 07 */	li r4, 7
/* 800B2020 000AEF60  38 A0 00 04 */	li r5, 4
/* 800B2024 000AEF64  93 C1 00 10 */	stw r30, 0x10(r1)
/* 800B2028 000AEF68  38 E0 00 07 */	li r7, 7
/* 800B202C 000AEF6C  39 00 00 00 */	li r8, 0
/* 800B2030 000AEF70  93 C1 00 14 */	stw r30, 0x14(r1)
/* 800B2034 000AEF74  39 20 00 00 */	li r9, 0
/* 800B2038 000AEF78  39 40 00 00 */	li r10, 0
/* 800B203C 000AEF7C  48 00 03 49 */	bl GDSetTevAlphaCalcAndSwap
/* 800B2040 000AEF80  48 00 00 D8 */	b lbl_800B2118
lbl_800B2044:
/* 800B2044 000AEF84  3B E0 00 01 */	li r31, 1
/* 800B2048 000AEF88  93 E1 00 08 */	stw r31, 8(r1)
/* 800B204C 000AEF8C  3B C0 00 00 */	li r30, 0
/* 800B2050 000AEF90  38 7C 00 00 */	addi r3, r28, 0
/* 800B2054 000AEF94  93 C1 00 0C */	stw r30, 0xc(r1)
/* 800B2058 000AEF98  38 80 00 0F */	li r4, 0xf
/* 800B205C 000AEF9C  38 A0 00 0F */	li r5, 0xf
/* 800B2060 000AEFA0  38 C0 00 0F */	li r6, 0xf
/* 800B2064 000AEFA4  38 E0 00 08 */	li r7, 8
/* 800B2068 000AEFA8  39 00 00 00 */	li r8, 0
/* 800B206C 000AEFAC  39 20 00 00 */	li r9, 0
/* 800B2070 000AEFB0  39 40 00 00 */	li r10, 0
/* 800B2074 000AEFB4  48 00 00 C5 */	bl GDSetTevColorCalc
/* 800B2078 000AEFB8  93 E1 00 08 */	stw r31, 8(r1)
/* 800B207C 000AEFBC  38 7C 00 00 */	addi r3, r28, 0
/* 800B2080 000AEFC0  38 80 00 07 */	li r4, 7
/* 800B2084 000AEFC4  93 C1 00 0C */	stw r30, 0xc(r1)
/* 800B2088 000AEFC8  38 A0 00 07 */	li r5, 7
/* 800B208C 000AEFCC  38 C0 00 07 */	li r6, 7
/* 800B2090 000AEFD0  93 C1 00 10 */	stw r30, 0x10(r1)
/* 800B2094 000AEFD4  38 E0 00 04 */	li r7, 4
/* 800B2098 000AEFD8  39 00 00 00 */	li r8, 0
/* 800B209C 000AEFDC  93 C1 00 14 */	stw r30, 0x14(r1)
/* 800B20A0 000AEFE0  39 20 00 00 */	li r9, 0
/* 800B20A4 000AEFE4  39 40 00 00 */	li r10, 0
/* 800B20A8 000AEFE8  48 00 02 DD */	bl GDSetTevAlphaCalcAndSwap
/* 800B20AC 000AEFEC  48 00 00 6C */	b lbl_800B2118
lbl_800B20B0:
/* 800B20B0 000AEFF0  3B C0 00 01 */	li r30, 1
/* 800B20B4 000AEFF4  93 C1 00 08 */	stw r30, 8(r1)
/* 800B20B8 000AEFF8  3B E0 00 00 */	li r31, 0
/* 800B20BC 000AEFFC  38 7C 00 00 */	addi r3, r28, 0
/* 800B20C0 000AF000  93 E1 00 0C */	stw r31, 0xc(r1)
/* 800B20C4 000AF004  38 E6 00 00 */	addi r7, r6, 0
/* 800B20C8 000AF008  38 80 00 0F */	li r4, 0xf
/* 800B20CC 000AF00C  38 A0 00 0F */	li r5, 0xf
/* 800B20D0 000AF010  38 C0 00 0F */	li r6, 0xf
/* 800B20D4 000AF014  39 00 00 00 */	li r8, 0
/* 800B20D8 000AF018  39 20 00 00 */	li r9, 0
/* 800B20DC 000AF01C  39 40 00 00 */	li r10, 0
/* 800B20E0 000AF020  48 00 00 59 */	bl GDSetTevColorCalc
/* 800B20E4 000AF024  93 C1 00 08 */	stw r30, 8(r1)
/* 800B20E8 000AF028  38 7C 00 00 */	addi r3, r28, 0
/* 800B20EC 000AF02C  38 FD 00 00 */	addi r7, r29, 0
/* 800B20F0 000AF030  93 E1 00 0C */	stw r31, 0xc(r1)
/* 800B20F4 000AF034  38 80 00 07 */	li r4, 7
/* 800B20F8 000AF038  38 A0 00 07 */	li r5, 7
/* 800B20FC 000AF03C  93 E1 00 10 */	stw r31, 0x10(r1)
/* 800B2100 000AF040  38 C0 00 07 */	li r6, 7
/* 800B2104 000AF044  39 00 00 00 */	li r8, 0
/* 800B2108 000AF048  93 E1 00 14 */	stw r31, 0x14(r1)
/* 800B210C 000AF04C  39 20 00 00 */	li r9, 0
/* 800B2110 000AF050  39 40 00 00 */	li r10, 0
/* 800B2114 000AF054  48 00 02 71 */	bl GDSetTevAlphaCalcAndSwap
lbl_800B2118:
/* 800B2118 000AF058  80 01 00 34 */	lwz r0, 0x34(r1)
/* 800B211C 000AF05C  83 E1 00 2C */	lwz r31, 0x2c(r1)
/* 800B2120 000AF060  83 C1 00 28 */	lwz r30, 0x28(r1)
/* 800B2124 000AF064  83 A1 00 24 */	lwz r29, 0x24(r1)
/* 800B2128 000AF068  83 81 00 20 */	lwz r28, 0x20(r1)
/* 800B212C 000AF06C  38 21 00 30 */	addi r1, r1, 0x30
/* 800B2130 000AF070  7C 08 03 A6 */	mtlr r0
/* 800B2134 000AF074  4E 80 00 20 */	blr 

.global GDSetTevColorCalc
GDSetTevColorCalc:
/* 800B2138 000AF078  7C 08 02 A6 */	mflr r0
/* 800B213C 000AF07C  90 01 00 04 */	stw r0, 4(r1)
/* 800B2140 000AF080  94 21 FF B0 */	stwu r1, -0x50(r1)
/* 800B2144 000AF084  BE C1 00 28 */	stmw r22, 0x28(r1)
/* 800B2148 000AF088  7D 1B 43 78 */	mr r27, r8
/* 800B214C 000AF08C  2C 1B 00 01 */	cmpwi r27, 1
/* 800B2150 000AF090  8B C1 00 5B */	lbz r30, 0x5b(r1)
/* 800B2154 000AF094  83 E1 00 5C */	lwz r31, 0x5c(r1)
/* 800B2158 000AF098  3A C3 00 00 */	addi r22, r3, 0
/* 800B215C 000AF09C  3A E4 00 00 */	addi r23, r4, 0
/* 800B2160 000AF0A0  3B 05 00 00 */	addi r24, r5, 0
/* 800B2164 000AF0A4  3B 26 00 00 */	addi r25, r6, 0
/* 800B2168 000AF0A8  3B 47 00 00 */	addi r26, r7, 0
/* 800B216C 000AF0AC  3B 89 00 00 */	addi r28, r9, 0
/* 800B2170 000AF0B0  3B AA 00 00 */	addi r29, r10, 0
/* 800B2174 000AF0B4  41 81 01 04 */	bgt lbl_800B2278
/* 800B2178 000AF0B8  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B217C 000AF0BC  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2180 000AF0C0  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B2184 000AF0C4  38 63 00 01 */	addi r3, r3, 1
/* 800B2188 000AF0C8  7C 03 00 40 */	cmplw r3, r0
/* 800B218C 000AF0CC  40 81 00 08 */	ble lbl_800B2194
/* 800B2190 000AF0D0  4B FF CF C5 */	bl GDOverflowed
lbl_800B2194:
/* 800B2194 000AF0D4  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2198 000AF0D8  38 A0 00 61 */	li r5, 0x61
/* 800B219C 000AF0DC  80 64 00 08 */	lwz r3, 8(r4)
/* 800B21A0 000AF0E0  38 03 00 01 */	addi r0, r3, 1
/* 800B21A4 000AF0E4  90 04 00 08 */	stw r0, 8(r4)
/* 800B21A8 000AF0E8  98 A3 00 00 */	stb r5, 0(r3)
/* 800B21AC 000AF0EC  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B21B0 000AF0F0  80 64 00 08 */	lwz r3, 8(r4)
/* 800B21B4 000AF0F4  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B21B8 000AF0F8  38 63 00 04 */	addi r3, r3, 4
/* 800B21BC 000AF0FC  7C 03 00 40 */	cmplw r3, r0
/* 800B21C0 000AF100  40 81 00 08 */	ble lbl_800B21C8
/* 800B21C4 000AF104  4B FF CF 91 */	bl GDOverflowed
lbl_800B21C8:
/* 800B21C8 000AF108  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B21CC 000AF10C  57 20 20 36 */	slwi r0, r25, 4
/* 800B21D0 000AF110  57 05 40 2E */	slwi r5, r24, 8
/* 800B21D4 000AF114  80 64 00 08 */	lwz r3, 8(r4)
/* 800B21D8 000AF118  7F 40 03 78 */	or r0, r26, r0
/* 800B21DC 000AF11C  7C A6 03 78 */	or r6, r5, r0
/* 800B21E0 000AF120  38 03 00 01 */	addi r0, r3, 1
/* 800B21E4 000AF124  90 04 00 08 */	stw r0, 8(r4)
/* 800B21E8 000AF128  56 E7 60 26 */	slwi r7, r23, 0xc
/* 800B21EC 000AF12C  7C E0 33 78 */	or r0, r7, r6
/* 800B21F0 000AF130  57 88 80 1E */	slwi r8, r28, 0x10
/* 800B21F4 000AF134  56 C5 08 3C */	slwi r5, r22, 1
/* 800B21F8 000AF138  57 64 93 5A */	rlwinm r4, r27, 0x12, 0xd, 0xd
/* 800B21FC 000AF13C  7D 00 03 78 */	or r0, r8, r0
/* 800B2200 000AF140  7C 80 03 78 */	or r0, r4, r0
/* 800B2204 000AF144  57 C6 98 18 */	slwi r6, r30, 0x13
/* 800B2208 000AF148  7C C0 03 78 */	or r0, r6, r0
/* 800B220C 000AF14C  57 A4 A0 16 */	slwi r4, r29, 0x14
/* 800B2210 000AF150  38 A5 00 C0 */	addi r5, r5, 0xc0
/* 800B2214 000AF154  57 E6 B0 12 */	slwi r6, r31, 0x16
/* 800B2218 000AF158  7C 80 03 78 */	or r0, r4, r0
/* 800B221C 000AF15C  7C C4 03 78 */	or r4, r6, r0
/* 800B2220 000AF160  54 A0 C0 0E */	slwi r0, r5, 0x18
/* 800B2224 000AF164  7C 87 03 78 */	or r7, r4, r0
/* 800B2228 000AF168  54 E0 46 3E */	srwi r0, r7, 0x18
/* 800B222C 000AF16C  98 03 00 00 */	stb r0, 0(r3)
/* 800B2230 000AF170  54 E6 86 3E */	rlwinm r6, r7, 0x10, 0x18, 0x1f
/* 800B2234 000AF174  54 E5 C6 3E */	rlwinm r5, r7, 0x18, 0x18, 0x1f
/* 800B2238 000AF178  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B223C 000AF17C  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2240 000AF180  38 03 00 01 */	addi r0, r3, 1
/* 800B2244 000AF184  90 04 00 08 */	stw r0, 8(r4)
/* 800B2248 000AF188  98 C3 00 00 */	stb r6, 0(r3)
/* 800B224C 000AF18C  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2250 000AF190  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2254 000AF194  38 03 00 01 */	addi r0, r3, 1
/* 800B2258 000AF198  90 04 00 08 */	stw r0, 8(r4)
/* 800B225C 000AF19C  98 A3 00 00 */	stb r5, 0(r3)
/* 800B2260 000AF1A0  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2264 000AF1A4  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2268 000AF1A8  38 03 00 01 */	addi r0, r3, 1
/* 800B226C 000AF1AC  90 04 00 08 */	stw r0, 8(r4)
/* 800B2270 000AF1B0  98 E3 00 00 */	stb r7, 0(r3)
/* 800B2274 000AF1B4  48 00 00 FC */	b lbl_800B2370
lbl_800B2278:
/* 800B2278 000AF1B8  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B227C 000AF1BC  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2280 000AF1C0  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B2284 000AF1C4  38 63 00 01 */	addi r3, r3, 1
/* 800B2288 000AF1C8  7C 03 00 40 */	cmplw r3, r0
/* 800B228C 000AF1CC  40 81 00 08 */	ble lbl_800B2294
/* 800B2290 000AF1D0  4B FF CE C5 */	bl GDOverflowed
lbl_800B2294:
/* 800B2294 000AF1D4  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2298 000AF1D8  38 A0 00 61 */	li r5, 0x61
/* 800B229C 000AF1DC  80 64 00 08 */	lwz r3, 8(r4)
/* 800B22A0 000AF1E0  38 03 00 01 */	addi r0, r3, 1
/* 800B22A4 000AF1E4  90 04 00 08 */	stw r0, 8(r4)
/* 800B22A8 000AF1E8  98 A3 00 00 */	stb r5, 0(r3)
/* 800B22AC 000AF1EC  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B22B0 000AF1F0  80 64 00 08 */	lwz r3, 8(r4)
/* 800B22B4 000AF1F4  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B22B8 000AF1F8  38 63 00 04 */	addi r3, r3, 4
/* 800B22BC 000AF1FC  7C 03 00 40 */	cmplw r3, r0
/* 800B22C0 000AF200  40 81 00 08 */	ble lbl_800B22C8
/* 800B22C4 000AF204  4B FF CE 91 */	bl GDOverflowed
lbl_800B22C8:
/* 800B22C8 000AF208  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B22CC 000AF20C  57 20 20 36 */	slwi r0, r25, 4
/* 800B22D0 000AF210  57 05 40 2E */	slwi r5, r24, 8
/* 800B22D4 000AF214  7F 40 03 78 */	or r0, r26, r0
/* 800B22D8 000AF218  80 64 00 08 */	lwz r3, 8(r4)
/* 800B22DC 000AF21C  7C A0 03 78 */	or r0, r5, r0
/* 800B22E0 000AF220  56 E6 60 26 */	slwi r6, r23, 0xc
/* 800B22E4 000AF224  7C C6 03 78 */	or r6, r6, r0
/* 800B22E8 000AF228  38 03 00 01 */	addi r0, r3, 1
/* 800B22EC 000AF22C  90 04 00 08 */	stw r0, 8(r4)
/* 800B22F0 000AF230  64 C0 00 03 */	oris r0, r6, 3
/* 800B22F4 000AF234  57 67 93 5A */	rlwinm r7, r27, 0x12, 0xd, 0xd
/* 800B22F8 000AF238  56 C5 08 3C */	slwi r5, r22, 1
/* 800B22FC 000AF23C  57 C4 98 18 */	slwi r4, r30, 0x13
/* 800B2300 000AF240  7C E0 03 78 */	or r0, r7, r0
/* 800B2304 000AF244  7C 80 03 78 */	or r0, r4, r0
/* 800B2308 000AF248  57 66 9A 96 */	rlwinm r6, r27, 0x13, 0xa, 0xb
/* 800B230C 000AF24C  38 A5 00 C0 */	addi r5, r5, 0xc0
/* 800B2310 000AF250  57 E4 B0 12 */	slwi r4, r31, 0x16
/* 800B2314 000AF254  7C C0 03 78 */	or r0, r6, r0
/* 800B2318 000AF258  7C 84 03 78 */	or r4, r4, r0
/* 800B231C 000AF25C  54 A0 C0 0E */	slwi r0, r5, 0x18
/* 800B2320 000AF260  7C 87 03 78 */	or r7, r4, r0
/* 800B2324 000AF264  54 E0 46 3E */	srwi r0, r7, 0x18
/* 800B2328 000AF268  98 03 00 00 */	stb r0, 0(r3)
/* 800B232C 000AF26C  54 E6 86 3E */	rlwinm r6, r7, 0x10, 0x18, 0x1f
/* 800B2330 000AF270  54 E5 C6 3E */	rlwinm r5, r7, 0x18, 0x18, 0x1f
/* 800B2334 000AF274  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2338 000AF278  80 64 00 08 */	lwz r3, 8(r4)
/* 800B233C 000AF27C  38 03 00 01 */	addi r0, r3, 1
/* 800B2340 000AF280  90 04 00 08 */	stw r0, 8(r4)
/* 800B2344 000AF284  98 C3 00 00 */	stb r6, 0(r3)
/* 800B2348 000AF288  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B234C 000AF28C  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2350 000AF290  38 03 00 01 */	addi r0, r3, 1
/* 800B2354 000AF294  90 04 00 08 */	stw r0, 8(r4)
/* 800B2358 000AF298  98 A3 00 00 */	stb r5, 0(r3)
/* 800B235C 000AF29C  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2360 000AF2A0  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2364 000AF2A4  38 03 00 01 */	addi r0, r3, 1
/* 800B2368 000AF2A8  90 04 00 08 */	stw r0, 8(r4)
/* 800B236C 000AF2AC  98 E3 00 00 */	stb r7, 0(r3)
lbl_800B2370:
/* 800B2370 000AF2B0  BA C1 00 28 */	lmw r22, 0x28(r1)
/* 800B2374 000AF2B4  80 01 00 54 */	lwz r0, 0x54(r1)
/* 800B2378 000AF2B8  38 21 00 50 */	addi r1, r1, 0x50
/* 800B237C 000AF2BC  7C 08 03 A6 */	mtlr r0
/* 800B2380 000AF2C0  4E 80 00 20 */	blr 

.global GDSetTevAlphaCalcAndSwap
GDSetTevAlphaCalcAndSwap:
/* 800B2384 000AF2C4  7C 08 02 A6 */	mflr r0
/* 800B2388 000AF2C8  90 01 00 04 */	stw r0, 4(r1)
/* 800B238C 000AF2CC  94 21 FF A8 */	stwu r1, -0x58(r1)
/* 800B2390 000AF2D0  BE 81 00 28 */	stmw r20, 0x28(r1)
/* 800B2394 000AF2D4  7D 19 43 78 */	mr r25, r8
/* 800B2398 000AF2D8  2C 19 00 01 */	cmpwi r25, 1
/* 800B239C 000AF2DC  8B 81 00 63 */	lbz r28, 0x63(r1)
/* 800B23A0 000AF2E0  83 A1 00 64 */	lwz r29, 0x64(r1)
/* 800B23A4 000AF2E4  83 C1 00 68 */	lwz r30, 0x68(r1)
/* 800B23A8 000AF2E8  7C 74 1B 78 */	mr r20, r3
/* 800B23AC 000AF2EC  83 E1 00 6C */	lwz r31, 0x6c(r1)
/* 800B23B0 000AF2F0  3A A4 00 00 */	addi r21, r4, 0
/* 800B23B4 000AF2F4  3A C5 00 00 */	addi r22, r5, 0
/* 800B23B8 000AF2F8  3A E6 00 00 */	addi r23, r6, 0
/* 800B23BC 000AF2FC  3B 07 00 00 */	addi r24, r7, 0
/* 800B23C0 000AF300  3B 49 00 00 */	addi r26, r9, 0
/* 800B23C4 000AF304  3B 6A 00 00 */	addi r27, r10, 0
/* 800B23C8 000AF308  41 81 01 14 */	bgt lbl_800B24DC
/* 800B23CC 000AF30C  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B23D0 000AF310  80 64 00 08 */	lwz r3, 8(r4)
/* 800B23D4 000AF314  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B23D8 000AF318  38 63 00 01 */	addi r3, r3, 1
/* 800B23DC 000AF31C  7C 03 00 40 */	cmplw r3, r0
/* 800B23E0 000AF320  40 81 00 08 */	ble lbl_800B23E8
/* 800B23E4 000AF324  4B FF CD 71 */	bl GDOverflowed
lbl_800B23E8:
/* 800B23E8 000AF328  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B23EC 000AF32C  38 A0 00 61 */	li r5, 0x61
/* 800B23F0 000AF330  80 64 00 08 */	lwz r3, 8(r4)
/* 800B23F4 000AF334  38 03 00 01 */	addi r0, r3, 1
/* 800B23F8 000AF338  90 04 00 08 */	stw r0, 8(r4)
/* 800B23FC 000AF33C  98 A3 00 00 */	stb r5, 0(r3)
/* 800B2400 000AF340  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2404 000AF344  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2408 000AF348  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B240C 000AF34C  38 63 00 04 */	addi r3, r3, 4
/* 800B2410 000AF350  7C 03 00 40 */	cmplw r3, r0
/* 800B2414 000AF354  40 81 00 08 */	ble lbl_800B241C
/* 800B2418 000AF358  4B FF CD 3D */	bl GDOverflowed
lbl_800B241C:
/* 800B241C 000AF35C  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2420 000AF360  57 E0 10 3A */	slwi r0, r31, 2
/* 800B2424 000AF364  57 05 20 36 */	slwi r5, r24, 4
/* 800B2428 000AF368  7F C0 03 78 */	or r0, r30, r0
/* 800B242C 000AF36C  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2430 000AF370  7C A0 03 78 */	or r0, r5, r0
/* 800B2434 000AF374  56 E6 38 30 */	slwi r6, r23, 7
/* 800B2438 000AF378  7C C6 03 78 */	or r6, r6, r0
/* 800B243C 000AF37C  38 03 00 01 */	addi r0, r3, 1
/* 800B2440 000AF380  90 04 00 08 */	stw r0, 8(r4)
/* 800B2444 000AF384  56 C7 50 2A */	slwi r7, r22, 0xa
/* 800B2448 000AF388  7C E0 33 78 */	or r0, r7, r6
/* 800B244C 000AF38C  56 A8 68 24 */	slwi r8, r21, 0xd
/* 800B2450 000AF390  56 85 08 3C */	slwi r5, r20, 1
/* 800B2454 000AF394  57 44 80 1E */	slwi r4, r26, 0x10
/* 800B2458 000AF398  7D 00 03 78 */	or r0, r8, r0
/* 800B245C 000AF39C  7C 80 03 78 */	or r0, r4, r0
/* 800B2460 000AF3A0  57 26 93 5A */	rlwinm r6, r25, 0x12, 0xd, 0xd
/* 800B2464 000AF3A4  7C C0 03 78 */	or r0, r6, r0
/* 800B2468 000AF3A8  57 84 98 18 */	slwi r4, r28, 0x13
/* 800B246C 000AF3AC  7C 80 03 78 */	or r0, r4, r0
/* 800B2470 000AF3B0  57 66 A0 16 */	slwi r6, r27, 0x14
/* 800B2474 000AF3B4  38 A5 00 C1 */	addi r5, r5, 0xc1
/* 800B2478 000AF3B8  57 A4 B0 12 */	slwi r4, r29, 0x16
/* 800B247C 000AF3BC  7C C0 03 78 */	or r0, r6, r0
/* 800B2480 000AF3C0  7C 84 03 78 */	or r4, r4, r0
/* 800B2484 000AF3C4  54 A0 C0 0E */	slwi r0, r5, 0x18
/* 800B2488 000AF3C8  7C 87 03 78 */	or r7, r4, r0
/* 800B248C 000AF3CC  54 E0 46 3E */	srwi r0, r7, 0x18
/* 800B2490 000AF3D0  98 03 00 00 */	stb r0, 0(r3)
/* 800B2494 000AF3D4  54 E6 86 3E */	rlwinm r6, r7, 0x10, 0x18, 0x1f
/* 800B2498 000AF3D8  54 E5 C6 3E */	rlwinm r5, r7, 0x18, 0x18, 0x1f
/* 800B249C 000AF3DC  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B24A0 000AF3E0  80 64 00 08 */	lwz r3, 8(r4)
/* 800B24A4 000AF3E4  38 03 00 01 */	addi r0, r3, 1
/* 800B24A8 000AF3E8  90 04 00 08 */	stw r0, 8(r4)
/* 800B24AC 000AF3EC  98 C3 00 00 */	stb r6, 0(r3)
/* 800B24B0 000AF3F0  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B24B4 000AF3F4  80 64 00 08 */	lwz r3, 8(r4)
/* 800B24B8 000AF3F8  38 03 00 01 */	addi r0, r3, 1
/* 800B24BC 000AF3FC  90 04 00 08 */	stw r0, 8(r4)
/* 800B24C0 000AF400  98 A3 00 00 */	stb r5, 0(r3)
/* 800B24C4 000AF404  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B24C8 000AF408  80 64 00 08 */	lwz r3, 8(r4)
/* 800B24CC 000AF40C  38 03 00 01 */	addi r0, r3, 1
/* 800B24D0 000AF410  90 04 00 08 */	stw r0, 8(r4)
/* 800B24D4 000AF414  98 E3 00 00 */	stb r7, 0(r3)
/* 800B24D8 000AF418  48 00 01 0C */	b lbl_800B25E4
lbl_800B24DC:
/* 800B24DC 000AF41C  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B24E0 000AF420  80 64 00 08 */	lwz r3, 8(r4)
/* 800B24E4 000AF424  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B24E8 000AF428  38 63 00 01 */	addi r3, r3, 1
/* 800B24EC 000AF42C  7C 03 00 40 */	cmplw r3, r0
/* 800B24F0 000AF430  40 81 00 08 */	ble lbl_800B24F8
/* 800B24F4 000AF434  4B FF CC 61 */	bl GDOverflowed
lbl_800B24F8:
/* 800B24F8 000AF438  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B24FC 000AF43C  38 A0 00 61 */	li r5, 0x61
/* 800B2500 000AF440  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2504 000AF444  38 03 00 01 */	addi r0, r3, 1
/* 800B2508 000AF448  90 04 00 08 */	stw r0, 8(r4)
/* 800B250C 000AF44C  98 A3 00 00 */	stb r5, 0(r3)
/* 800B2510 000AF450  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2514 000AF454  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2518 000AF458  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B251C 000AF45C  38 63 00 04 */	addi r3, r3, 4
/* 800B2520 000AF460  7C 03 00 40 */	cmplw r3, r0
/* 800B2524 000AF464  40 81 00 08 */	ble lbl_800B252C
/* 800B2528 000AF468  4B FF CC 2D */	bl GDOverflowed
lbl_800B252C:
/* 800B252C 000AF46C  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2530 000AF470  57 E0 10 3A */	slwi r0, r31, 2
/* 800B2534 000AF474  57 05 20 36 */	slwi r5, r24, 4
/* 800B2538 000AF478  7F C0 03 78 */	or r0, r30, r0
/* 800B253C 000AF47C  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2540 000AF480  7C A0 03 78 */	or r0, r5, r0
/* 800B2544 000AF484  56 E6 38 30 */	slwi r6, r23, 7
/* 800B2548 000AF488  7C C6 03 78 */	or r6, r6, r0
/* 800B254C 000AF48C  38 03 00 01 */	addi r0, r3, 1
/* 800B2550 000AF490  90 04 00 08 */	stw r0, 8(r4)
/* 800B2554 000AF494  56 C7 50 2A */	slwi r7, r22, 0xa
/* 800B2558 000AF498  7C E0 33 78 */	or r0, r7, r6
/* 800B255C 000AF49C  56 A8 68 24 */	slwi r8, r21, 0xd
/* 800B2560 000AF4A0  7D 00 03 78 */	or r0, r8, r0
/* 800B2564 000AF4A4  56 85 08 3C */	slwi r5, r20, 1
/* 800B2568 000AF4A8  57 24 93 5A */	rlwinm r4, r25, 0x12, 0xd, 0xd
/* 800B256C 000AF4AC  64 00 00 03 */	oris r0, r0, 3
/* 800B2570 000AF4B0  7C 80 03 78 */	or r0, r4, r0
/* 800B2574 000AF4B4  57 86 98 18 */	slwi r6, r28, 0x13
/* 800B2578 000AF4B8  7C C0 03 78 */	or r0, r6, r0
/* 800B257C 000AF4BC  57 24 9A 96 */	rlwinm r4, r25, 0x13, 0xa, 0xb
/* 800B2580 000AF4C0  38 A5 00 C1 */	addi r5, r5, 0xc1
/* 800B2584 000AF4C4  57 A6 B0 12 */	slwi r6, r29, 0x16
/* 800B2588 000AF4C8  7C 80 03 78 */	or r0, r4, r0
/* 800B258C 000AF4CC  7C C4 03 78 */	or r4, r6, r0
/* 800B2590 000AF4D0  54 A0 C0 0E */	slwi r0, r5, 0x18
/* 800B2594 000AF4D4  7C 87 03 78 */	or r7, r4, r0
/* 800B2598 000AF4D8  54 E0 46 3E */	srwi r0, r7, 0x18
/* 800B259C 000AF4DC  98 03 00 00 */	stb r0, 0(r3)
/* 800B25A0 000AF4E0  54 E6 86 3E */	rlwinm r6, r7, 0x10, 0x18, 0x1f
/* 800B25A4 000AF4E4  54 E5 C6 3E */	rlwinm r5, r7, 0x18, 0x18, 0x1f
/* 800B25A8 000AF4E8  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B25AC 000AF4EC  80 64 00 08 */	lwz r3, 8(r4)
/* 800B25B0 000AF4F0  38 03 00 01 */	addi r0, r3, 1
/* 800B25B4 000AF4F4  90 04 00 08 */	stw r0, 8(r4)
/* 800B25B8 000AF4F8  98 C3 00 00 */	stb r6, 0(r3)
/* 800B25BC 000AF4FC  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B25C0 000AF500  80 64 00 08 */	lwz r3, 8(r4)
/* 800B25C4 000AF504  38 03 00 01 */	addi r0, r3, 1
/* 800B25C8 000AF508  90 04 00 08 */	stw r0, 8(r4)
/* 800B25CC 000AF50C  98 A3 00 00 */	stb r5, 0(r3)
/* 800B25D0 000AF510  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B25D4 000AF514  80 64 00 08 */	lwz r3, 8(r4)
/* 800B25D8 000AF518  38 03 00 01 */	addi r0, r3, 1
/* 800B25DC 000AF51C  90 04 00 08 */	stw r0, 8(r4)
/* 800B25E0 000AF520  98 E3 00 00 */	stb r7, 0(r3)
lbl_800B25E4:
/* 800B25E4 000AF524  BA 81 00 28 */	lmw r20, 0x28(r1)
/* 800B25E8 000AF528  80 01 00 5C */	lwz r0, 0x5c(r1)
/* 800B25EC 000AF52C  38 21 00 58 */	addi r1, r1, 0x58
/* 800B25F0 000AF530  7C 08 03 A6 */	mtlr r0
/* 800B25F4 000AF534  4E 80 00 20 */	blr 

.global GDSetAlphaCompare
GDSetAlphaCompare:
/* 800B25F8 000AF538  7C 08 02 A6 */	mflr r0
/* 800B25FC 000AF53C  90 01 00 04 */	stw r0, 4(r1)
/* 800B2600 000AF540  94 21 FF C8 */	stwu r1, -0x38(r1)
/* 800B2604 000AF544  BF 61 00 24 */	stmw r27, 0x24(r1)
/* 800B2608 000AF548  3B 83 00 00 */	addi r28, r3, 0
/* 800B260C 000AF54C  3B A4 00 00 */	addi r29, r4, 0
/* 800B2610 000AF550  7C BE 2B 78 */	mr r30, r5
/* 800B2614 000AF554  3B E6 00 00 */	addi r31, r6, 0
/* 800B2618 000AF558  3B 67 00 00 */	addi r27, r7, 0
/* 800B261C 000AF55C  81 0D 95 B8 */	lwz r8, __GDCurrentDL@sda21(r13)
/* 800B2620 000AF560  80 68 00 08 */	lwz r3, 8(r8)
/* 800B2624 000AF564  80 08 00 0C */	lwz r0, 0xc(r8)
/* 800B2628 000AF568  38 63 00 01 */	addi r3, r3, 1
/* 800B262C 000AF56C  7C 03 00 40 */	cmplw r3, r0
/* 800B2630 000AF570  40 81 00 08 */	ble lbl_800B2638
/* 800B2634 000AF574  4B FF CB 21 */	bl GDOverflowed
lbl_800B2638:
/* 800B2638 000AF578  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B263C 000AF57C  38 A0 00 61 */	li r5, 0x61
/* 800B2640 000AF580  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2644 000AF584  38 03 00 01 */	addi r0, r3, 1
/* 800B2648 000AF588  90 04 00 08 */	stw r0, 8(r4)
/* 800B264C 000AF58C  98 A3 00 00 */	stb r5, 0(r3)
/* 800B2650 000AF590  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2654 000AF594  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2658 000AF598  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B265C 000AF59C  38 63 00 04 */	addi r3, r3, 4
/* 800B2660 000AF5A0  7C 03 00 40 */	cmplw r3, r0
/* 800B2664 000AF5A4  40 81 00 08 */	ble lbl_800B266C
/* 800B2668 000AF5A8  4B FF CA ED */	bl GDOverflowed
lbl_800B266C:
/* 800B266C 000AF5AC  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2670 000AF5B0  57 65 44 2E */	rlwinm r5, r27, 8, 0x10, 0x17
/* 800B2674 000AF5B4  53 A5 06 3E */	rlwimi r5, r29, 0, 0x18, 0x1f
/* 800B2678 000AF5B8  80 64 00 08 */	lwz r3, 8(r4)
/* 800B267C 000AF5BC  57 E6 98 18 */	slwi r6, r31, 0x13
/* 800B2680 000AF5C0  53 85 80 1E */	rlwimi r5, r28, 0x10, 0, 0xf
/* 800B2684 000AF5C4  38 03 00 01 */	addi r0, r3, 1
/* 800B2688 000AF5C8  90 04 00 08 */	stw r0, 8(r4)
/* 800B268C 000AF5CC  57 C4 B0 12 */	slwi r4, r30, 0x16
/* 800B2690 000AF5D0  7C C0 2B 78 */	or r0, r6, r5
/* 800B2694 000AF5D4  7C 80 03 78 */	or r0, r4, r0
/* 800B2698 000AF5D8  64 07 F3 00 */	oris r7, r0, 0xf300
/* 800B269C 000AF5DC  54 E0 46 3E */	srwi r0, r7, 0x18
/* 800B26A0 000AF5E0  98 03 00 00 */	stb r0, 0(r3)
/* 800B26A4 000AF5E4  54 E6 86 3E */	rlwinm r6, r7, 0x10, 0x18, 0x1f
/* 800B26A8 000AF5E8  54 E5 C6 3E */	rlwinm r5, r7, 0x18, 0x18, 0x1f
/* 800B26AC 000AF5EC  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B26B0 000AF5F0  80 64 00 08 */	lwz r3, 8(r4)
/* 800B26B4 000AF5F4  38 03 00 01 */	addi r0, r3, 1
/* 800B26B8 000AF5F8  90 04 00 08 */	stw r0, 8(r4)
/* 800B26BC 000AF5FC  98 C3 00 00 */	stb r6, 0(r3)
/* 800B26C0 000AF600  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B26C4 000AF604  80 64 00 08 */	lwz r3, 8(r4)
/* 800B26C8 000AF608  38 03 00 01 */	addi r0, r3, 1
/* 800B26CC 000AF60C  90 04 00 08 */	stw r0, 8(r4)
/* 800B26D0 000AF610  98 A3 00 00 */	stb r5, 0(r3)
/* 800B26D4 000AF614  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B26D8 000AF618  80 64 00 08 */	lwz r3, 8(r4)
/* 800B26DC 000AF61C  38 03 00 01 */	addi r0, r3, 1
/* 800B26E0 000AF620  90 04 00 08 */	stw r0, 8(r4)
/* 800B26E4 000AF624  98 E3 00 00 */	stb r7, 0(r3)
/* 800B26E8 000AF628  BB 61 00 24 */	lmw r27, 0x24(r1)
/* 800B26EC 000AF62C  80 01 00 3C */	lwz r0, 0x3c(r1)
/* 800B26F0 000AF630  38 21 00 38 */	addi r1, r1, 0x38
/* 800B26F4 000AF634  7C 08 03 A6 */	mtlr r0
/* 800B26F8 000AF638  4E 80 00 20 */	blr 

.global GDSetTevOrder
GDSetTevOrder:
/* 800B26FC 000AF63C  7C 08 02 A6 */	mflr r0
/* 800B2700 000AF640  2C 05 00 FF */	cmpwi r5, 0xff
/* 800B2704 000AF644  90 01 00 04 */	stw r0, 4(r1)
/* 800B2708 000AF648  94 21 FF D0 */	stwu r1, -0x30(r1)
/* 800B270C 000AF64C  93 E1 00 2C */	stw r31, 0x2c(r1)
/* 800B2710 000AF650  3B E0 00 00 */	li r31, 0
/* 800B2714 000AF654  93 C1 00 28 */	stw r30, 0x28(r1)
/* 800B2718 000AF658  41 82 00 10 */	beq lbl_800B2728
/* 800B271C 000AF65C  54 A0 05 EF */	rlwinm. r0, r5, 0, 0x17, 0x17
/* 800B2720 000AF660  40 82 00 08 */	bne lbl_800B2728
/* 800B2724 000AF664  3B E0 00 01 */	li r31, 1
lbl_800B2728:
/* 800B2728 000AF668  2C 08 00 FF */	cmpwi r8, 0xff
/* 800B272C 000AF66C  38 00 00 00 */	li r0, 0
/* 800B2730 000AF670  41 82 00 10 */	beq lbl_800B2740
/* 800B2734 000AF674  55 0A 05 EF */	rlwinm. r10, r8, 0, 0x17, 0x17
/* 800B2738 000AF678  40 82 00 08 */	bne lbl_800B2740
/* 800B273C 000AF67C  38 00 00 01 */	li r0, 1
lbl_800B2740:
/* 800B2740 000AF680  3D 40 80 3B */	lis r10, c2r$382@ha
/* 800B2744 000AF684  83 CD 95 B8 */	lwz r30, __GDCurrentDL@sda21(r13)
/* 800B2748 000AF688  39 8A 1C F8 */	addi r12, r10, c2r$382@l
/* 800B274C 000AF68C  54 C6 07 3E */	clrlwi r6, r6, 0x1c
/* 800B2750 000AF690  81 5E 00 08 */	lwz r10, 8(r30)
/* 800B2754 000AF694  7D 6C 32 14 */	add r11, r12, r6
/* 800B2758 000AF698  80 DE 00 0C */	lwz r6, 0xc(r30)
/* 800B275C 000AF69C  89 6B 00 00 */	lbz r11, 0(r11)
/* 800B2760 000AF6A0  55 29 07 3E */	clrlwi r9, r9, 0x1c
/* 800B2764 000AF6A4  54 84 1E B8 */	rlwinm r4, r4, 3, 0x1a, 0x1c
/* 800B2768 000AF6A8  50 A4 07 7E */	rlwimi r4, r5, 0, 0x1d, 0x1f
/* 800B276C 000AF6AC  7D 2C 4A 14 */	add r9, r12, r9
/* 800B2770 000AF6B0  7C 6C 0E 70 */	srawi r12, r3, 1
/* 800B2774 000AF6B4  89 29 00 00 */	lbz r9, 0(r9)
/* 800B2778 000AF6B8  38 6A 00 01 */	addi r3, r10, 1
/* 800B277C 000AF6BC  7D 8C 01 94 */	addze r12, r12
/* 800B2780 000AF6C0  7C 03 30 40 */	cmplw r3, r6
/* 800B2784 000AF6C4  55 65 38 30 */	slwi r5, r11, 7
/* 800B2788 000AF6C8  53 E4 30 32 */	rlwimi r4, r31, 6, 0, 0x19
/* 800B278C 000AF6CC  7C A4 23 78 */	or r4, r5, r4
/* 800B2790 000AF6D0  55 08 64 66 */	rlwinm r8, r8, 0xc, 0x11, 0x13
/* 800B2794 000AF6D4  54 E5 7B A0 */	rlwinm r5, r7, 0xf, 0xe, 0x10
/* 800B2798 000AF6D8  7D 04 23 78 */	or r4, r8, r4
/* 800B279C 000AF6DC  54 07 90 1A */	slwi r7, r0, 0x12
/* 800B27A0 000AF6E0  7C A0 23 78 */	or r0, r5, r4
/* 800B27A4 000AF6E4  39 4C 00 28 */	addi r10, r12, 0x28
/* 800B27A8 000AF6E8  55 23 98 18 */	slwi r3, r9, 0x13
/* 800B27AC 000AF6EC  7C E0 03 78 */	or r0, r7, r0
/* 800B27B0 000AF6F0  55 44 C0 0E */	slwi r4, r10, 0x18
/* 800B27B4 000AF6F4  7C 60 03 78 */	or r0, r3, r0
/* 800B27B8 000AF6F8  7C 9F 03 78 */	or r31, r4, r0
/* 800B27BC 000AF6FC  40 81 00 08 */	ble lbl_800B27C4
/* 800B27C0 000AF700  4B FF C9 95 */	bl GDOverflowed
lbl_800B27C4:
/* 800B27C4 000AF704  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B27C8 000AF708  38 A0 00 61 */	li r5, 0x61
/* 800B27CC 000AF70C  80 64 00 08 */	lwz r3, 8(r4)
/* 800B27D0 000AF710  38 03 00 01 */	addi r0, r3, 1
/* 800B27D4 000AF714  90 04 00 08 */	stw r0, 8(r4)
/* 800B27D8 000AF718  98 A3 00 00 */	stb r5, 0(r3)
/* 800B27DC 000AF71C  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B27E0 000AF720  80 64 00 08 */	lwz r3, 8(r4)
/* 800B27E4 000AF724  80 04 00 0C */	lwz r0, 0xc(r4)
/* 800B27E8 000AF728  38 63 00 04 */	addi r3, r3, 4
/* 800B27EC 000AF72C  7C 03 00 40 */	cmplw r3, r0
/* 800B27F0 000AF730  40 81 00 08 */	ble lbl_800B27F8
/* 800B27F4 000AF734  4B FF C9 61 */	bl GDOverflowed
lbl_800B27F8:
/* 800B27F8 000AF738  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B27FC 000AF73C  57 E7 46 3E */	srwi r7, r31, 0x18
/* 800B2800 000AF740  57 E6 86 3E */	rlwinm r6, r31, 0x10, 0x18, 0x1f
/* 800B2804 000AF744  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2808 000AF748  57 E5 C6 3E */	rlwinm r5, r31, 0x18, 0x18, 0x1f
/* 800B280C 000AF74C  38 03 00 01 */	addi r0, r3, 1
/* 800B2810 000AF750  90 04 00 08 */	stw r0, 8(r4)
/* 800B2814 000AF754  98 E3 00 00 */	stb r7, 0(r3)
/* 800B2818 000AF758  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B281C 000AF75C  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2820 000AF760  38 03 00 01 */	addi r0, r3, 1
/* 800B2824 000AF764  90 04 00 08 */	stw r0, 8(r4)
/* 800B2828 000AF768  98 C3 00 00 */	stb r6, 0(r3)
/* 800B282C 000AF76C  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2830 000AF770  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2834 000AF774  38 03 00 01 */	addi r0, r3, 1
/* 800B2838 000AF778  90 04 00 08 */	stw r0, 8(r4)
/* 800B283C 000AF77C  98 A3 00 00 */	stb r5, 0(r3)
/* 800B2840 000AF780  80 8D 95 B8 */	lwz r4, __GDCurrentDL@sda21(r13)
/* 800B2844 000AF784  80 64 00 08 */	lwz r3, 8(r4)
/* 800B2848 000AF788  38 03 00 01 */	addi r0, r3, 1
/* 800B284C 000AF78C  90 04 00 08 */	stw r0, 8(r4)
/* 800B2850 000AF790  9B E3 00 00 */	stb r31, 0(r3)
/* 800B2854 000AF794  80 01 00 34 */	lwz r0, 0x34(r1)
/* 800B2858 000AF798  83 E1 00 2C */	lwz r31, 0x2c(r1)
/* 800B285C 000AF79C  83 C1 00 28 */	lwz r30, 0x28(r1)
/* 800B2860 000AF7A0  38 21 00 30 */	addi r1, r1, 0x30
/* 800B2864 000AF7A4  7C 08 03 A6 */	mtlr r0
/* 800B2868 000AF7A8  4E 80 00 20 */	blr 

.section .data, "wa"  # 0x803A8380 - 0x803E6000
    .balign 8
c2r$382:
	.4byte 0x00010001
	.4byte 0x00010705
	.4byte 0x06000000
	.4byte 0x00000007