summaryrefslogtreecommitdiff
path: root/asm/Dolphin/gx/GXLight.s
blob: 526d56d59628623e92f1d1c7f5b59d1172dc3d82 (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
.include "macros.inc"

.section .text, "ax"  # 0x80005600 - 0x8036FBA0
.global GXInitLightAttn
GXInitLightAttn:
/* 800A9944 000A6884  D0 23 00 10 */	stfs f1, 0x10(r3)
/* 800A9948 000A6888  D0 43 00 14 */	stfs f2, 0x14(r3)
/* 800A994C 000A688C  D0 63 00 18 */	stfs f3, 0x18(r3)
/* 800A9950 000A6890  D0 83 00 1C */	stfs f4, 0x1c(r3)
/* 800A9954 000A6894  D0 A3 00 20 */	stfs f5, 0x20(r3)
/* 800A9958 000A6898  D0 C3 00 24 */	stfs f6, 0x24(r3)
/* 800A995C 000A689C  4E 80 00 20 */	blr 

.global GXInitLightAttnA
GXInitLightAttnA:
/* 800A9960 000A68A0  D0 23 00 10 */	stfs f1, 0x10(r3)
/* 800A9964 000A68A4  D0 43 00 14 */	stfs f2, 0x14(r3)
/* 800A9968 000A68A8  D0 63 00 18 */	stfs f3, 0x18(r3)
/* 800A996C 000A68AC  4E 80 00 20 */	blr 

.global GXInitLightAttnK
GXInitLightAttnK:
/* 800A9970 000A68B0  D0 23 00 1C */	stfs f1, 0x1c(r3)
/* 800A9974 000A68B4  D0 43 00 20 */	stfs f2, 0x20(r3)
/* 800A9978 000A68B8  D0 63 00 24 */	stfs f3, 0x24(r3)
/* 800A997C 000A68BC  4E 80 00 20 */	blr 

.global GXInitLightDistAttn
GXInitLightDistAttn:
/* 800A9980 000A68C0  C0 02 8B 00 */	lfs f0, "@121"@sda21(r2)
/* 800A9984 000A68C4  FC 01 00 40 */	fcmpo cr0, f1, f0
/* 800A9988 000A68C8  40 80 00 08 */	bge lbl_800A9990
/* 800A998C 000A68CC  38 80 00 00 */	li r4, 0
lbl_800A9990:
/* 800A9990 000A68D0  C0 02 8B 00 */	lfs f0, "@121"@sda21(r2)
/* 800A9994 000A68D4  FC 02 00 40 */	fcmpo cr0, f2, f0
/* 800A9998 000A68D8  4C 40 13 82 */	cror 2, 0, 2
/* 800A999C 000A68DC  41 82 00 14 */	beq lbl_800A99B0
/* 800A99A0 000A68E0  C0 02 8B 04 */	lfs f0, "@127"@sda21(r2)
/* 800A99A4 000A68E4  FC 02 00 40 */	fcmpo cr0, f2, f0
/* 800A99A8 000A68E8  4C 41 13 82 */	cror 2, 1, 2
/* 800A99AC 000A68EC  40 82 00 08 */	bne lbl_800A99B4
lbl_800A99B0:
/* 800A99B0 000A68F0  38 80 00 00 */	li r4, 0
lbl_800A99B4:
/* 800A99B4 000A68F4  2C 04 00 02 */	cmpwi r4, 2
/* 800A99B8 000A68F8  41 82 00 3C */	beq lbl_800A99F4
/* 800A99BC 000A68FC  40 80 00 14 */	bge lbl_800A99D0
/* 800A99C0 000A6900  2C 04 00 00 */	cmpwi r4, 0
/* 800A99C4 000A6904  41 82 00 70 */	beq lbl_800A9A34
/* 800A99C8 000A6908  40 80 00 14 */	bge lbl_800A99DC
/* 800A99CC 000A690C  48 00 00 68 */	b lbl_800A9A34
lbl_800A99D0:
/* 800A99D0 000A6910  2C 04 00 04 */	cmpwi r4, 4
/* 800A99D4 000A6914  40 80 00 60 */	bge lbl_800A9A34
/* 800A99D8 000A6918  48 00 00 40 */	b lbl_800A9A18
lbl_800A99DC:
/* 800A99DC 000A691C  C0 A2 8B 04 */	lfs f5, "@127"@sda21(r2)
/* 800A99E0 000A6920  EC 02 00 72 */	fmuls f0, f2, f1
/* 800A99E4 000A6924  C0 82 8B 00 */	lfs f4, "@121"@sda21(r2)
/* 800A99E8 000A6928  EC 25 10 28 */	fsubs f1, f5, f2
/* 800A99EC 000A692C  EC 61 00 24 */	fdivs f3, f1, f0
/* 800A99F0 000A6930  48 00 00 50 */	b lbl_800A9A40
lbl_800A99F4:
/* 800A99F4 000A6934  C0 A2 8B 04 */	lfs f5, "@127"@sda21(r2)
/* 800A99F8 000A6938  EC 82 00 72 */	fmuls f4, f2, f1
/* 800A99FC 000A693C  C0 62 8B 08 */	lfs f3, "@148"@sda21(r2)
/* 800A9A00 000A6940  EC 45 10 28 */	fsubs f2, f5, f2
/* 800A9A04 000A6944  EC 01 01 32 */	fmuls f0, f1, f4
/* 800A9A08 000A6948  EC 23 00 B2 */	fmuls f1, f3, f2
/* 800A9A0C 000A694C  EC 61 20 24 */	fdivs f3, f1, f4
/* 800A9A10 000A6950  EC 81 00 24 */	fdivs f4, f1, f0
/* 800A9A14 000A6954  48 00 00 2C */	b lbl_800A9A40
lbl_800A9A18:
/* 800A9A18 000A6958  EC 02 00 72 */	fmuls f0, f2, f1
/* 800A9A1C 000A695C  C0 A2 8B 04 */	lfs f5, "@127"@sda21(r2)
/* 800A9A20 000A6960  C0 62 8B 00 */	lfs f3, "@121"@sda21(r2)
/* 800A9A24 000A6964  EC 45 10 28 */	fsubs f2, f5, f2
/* 800A9A28 000A6968  EC 01 00 32 */	fmuls f0, f1, f0
/* 800A9A2C 000A696C  EC 82 00 24 */	fdivs f4, f2, f0
/* 800A9A30 000A6970  48 00 00 10 */	b lbl_800A9A40
lbl_800A9A34:
/* 800A9A34 000A6974  C0 62 8B 00 */	lfs f3, "@121"@sda21(r2)
/* 800A9A38 000A6978  C0 A2 8B 04 */	lfs f5, "@127"@sda21(r2)
/* 800A9A3C 000A697C  FC 80 18 90 */	fmr f4, f3
lbl_800A9A40:
/* 800A9A40 000A6980  D0 A3 00 1C */	stfs f5, 0x1c(r3)
/* 800A9A44 000A6984  D0 63 00 20 */	stfs f3, 0x20(r3)
/* 800A9A48 000A6988  D0 83 00 24 */	stfs f4, 0x24(r3)
/* 800A9A4C 000A698C  4E 80 00 20 */	blr 

.global GXInitLightPos
GXInitLightPos:
/* 800A9A50 000A6990  D0 23 00 28 */	stfs f1, 0x28(r3)
/* 800A9A54 000A6994  D0 43 00 2C */	stfs f2, 0x2c(r3)
/* 800A9A58 000A6998  D0 63 00 30 */	stfs f3, 0x30(r3)
/* 800A9A5C 000A699C  4E 80 00 20 */	blr 

.global GXInitSpecularDir
GXInitSpecularDir:
/* 800A9A60 000A69A0  94 21 FF E0 */	stwu r1, -0x20(r1)
/* 800A9A64 000A69A4  FC 00 08 50 */	fneg f0, f1
/* 800A9A68 000A69A8  FC 20 10 50 */	fneg f1, f2
/* 800A9A6C 000A69AC  C0 A2 8B 04 */	lfs f5, "@127"@sda21(r2)
/* 800A9A70 000A69B0  EC C0 00 32 */	fmuls f6, f0, f0
/* 800A9A74 000A69B4  C0 82 8B 00 */	lfs f4, "@121"@sda21(r2)
/* 800A9A78 000A69B8  EC 45 18 28 */	fsubs f2, f5, f3
/* 800A9A7C 000A69BC  EC A1 00 72 */	fmuls f5, f1, f1
/* 800A9A80 000A69C0  EC E2 00 B2 */	fmuls f7, f2, f2
/* 800A9A84 000A69C4  EC A6 28 2A */	fadds f5, f6, f5
/* 800A9A88 000A69C8  ED 07 28 2A */	fadds f8, f7, f5
/* 800A9A8C 000A69CC  FC 08 20 40 */	fcmpo cr0, f8, f4
/* 800A9A90 000A69D0  40 81 00 5C */	ble lbl_800A9AEC
/* 800A9A94 000A69D4  FC A0 40 34 */	frsqrte f5, f8
/* 800A9A98 000A69D8  C8 E2 8B 10 */	lfd f7, "@165"@sda21(r2)
/* 800A9A9C 000A69DC  C8 C2 8B 18 */	lfd f6, "@166"@sda21(r2)
/* 800A9AA0 000A69E0  FC 85 01 72 */	fmul f4, f5, f5
/* 800A9AA4 000A69E4  FC A7 01 72 */	fmul f5, f7, f5
/* 800A9AA8 000A69E8  FC 88 01 32 */	fmul f4, f8, f4
/* 800A9AAC 000A69EC  FC 86 20 28 */	fsub f4, f6, f4
/* 800A9AB0 000A69F0  FC A5 01 32 */	fmul f5, f5, f4
/* 800A9AB4 000A69F4  FC 85 01 72 */	fmul f4, f5, f5
/* 800A9AB8 000A69F8  FC A7 01 72 */	fmul f5, f7, f5
/* 800A9ABC 000A69FC  FC 88 01 32 */	fmul f4, f8, f4
/* 800A9AC0 000A6A00  FC 86 20 28 */	fsub f4, f6, f4
/* 800A9AC4 000A6A04  FC A5 01 32 */	fmul f5, f5, f4
/* 800A9AC8 000A6A08  FC 85 01 72 */	fmul f4, f5, f5
/* 800A9ACC 000A6A0C  FC A7 01 72 */	fmul f5, f7, f5
/* 800A9AD0 000A6A10  FC 88 01 32 */	fmul f4, f8, f4
/* 800A9AD4 000A6A14  FC 86 20 28 */	fsub f4, f6, f4
/* 800A9AD8 000A6A18  FC 85 01 32 */	fmul f4, f5, f4
/* 800A9ADC 000A6A1C  FC 88 01 32 */	fmul f4, f8, f4
/* 800A9AE0 000A6A20  FC 80 20 18 */	frsp f4, f4
/* 800A9AE4 000A6A24  D0 81 00 18 */	stfs f4, 0x18(r1)
/* 800A9AE8 000A6A28  C1 01 00 18 */	lfs f8, 0x18(r1)
lbl_800A9AEC:
/* 800A9AEC 000A6A2C  C0 82 8B 04 */	lfs f4, "@127"@sda21(r2)
/* 800A9AF0 000A6A30  FC 60 18 50 */	fneg f3, f3
/* 800A9AF4 000A6A34  EC C4 40 24 */	fdivs f6, f4, f8
/* 800A9AF8 000A6A38  EC A0 01 B2 */	fmuls f5, f0, f6
/* 800A9AFC 000A6A3C  EC 81 01 B2 */	fmuls f4, f1, f6
/* 800A9B00 000A6A40  EC 42 01 B2 */	fmuls f2, f2, f6
/* 800A9B04 000A6A44  D0 A3 00 34 */	stfs f5, 0x34(r3)
/* 800A9B08 000A6A48  D0 83 00 38 */	stfs f4, 0x38(r3)
/* 800A9B0C 000A6A4C  D0 43 00 3C */	stfs f2, 0x3c(r3)
/* 800A9B10 000A6A50  C0 82 8B 20 */	lfs f4, "@167"@sda21(r2)
/* 800A9B14 000A6A54  EC 44 00 32 */	fmuls f2, f4, f0
/* 800A9B18 000A6A58  EC 24 00 72 */	fmuls f1, f4, f1
/* 800A9B1C 000A6A5C  EC 04 00 F2 */	fmuls f0, f4, f3
/* 800A9B20 000A6A60  D0 43 00 28 */	stfs f2, 0x28(r3)
/* 800A9B24 000A6A64  D0 23 00 2C */	stfs f1, 0x2c(r3)
/* 800A9B28 000A6A68  D0 03 00 30 */	stfs f0, 0x30(r3)
/* 800A9B2C 000A6A6C  38 21 00 20 */	addi r1, r1, 0x20
/* 800A9B30 000A6A70  4E 80 00 20 */	blr 

.global GXInitLightColor
GXInitLightColor:
/* 800A9B34 000A6A74  88 04 00 01 */	lbz r0, 1(r4)
/* 800A9B38 000A6A78  88 A4 00 00 */	lbz r5, 0(r4)
/* 800A9B3C 000A6A7C  88 C4 00 02 */	lbz r6, 2(r4)
/* 800A9B40 000A6A80  54 00 80 1E */	slwi r0, r0, 0x10
/* 800A9B44 000A6A84  50 A0 C0 0E */	rlwimi r0, r5, 0x18, 0, 7
/* 800A9B48 000A6A88  88 84 00 03 */	lbz r4, 3(r4)
/* 800A9B4C 000A6A8C  50 C0 44 2E */	rlwimi r0, r6, 8, 0x10, 0x17
/* 800A9B50 000A6A90  7C 80 03 78 */	or r0, r4, r0
/* 800A9B54 000A6A94  90 03 00 0C */	stw r0, 0xc(r3)
/* 800A9B58 000A6A98  4E 80 00 20 */	blr 

.global GXGetLightColor
GXGetLightColor:
/* 800A9B5C 000A6A9C  80 03 00 0C */	lwz r0, 0xc(r3)
/* 800A9B60 000A6AA0  54 00 46 3E */	srwi r0, r0, 0x18
/* 800A9B64 000A6AA4  98 04 00 00 */	stb r0, 0(r4)
/* 800A9B68 000A6AA8  80 03 00 0C */	lwz r0, 0xc(r3)
/* 800A9B6C 000A6AAC  54 00 86 3E */	rlwinm r0, r0, 0x10, 0x18, 0x1f
/* 800A9B70 000A6AB0  98 04 00 01 */	stb r0, 1(r4)
/* 800A9B74 000A6AB4  80 03 00 0C */	lwz r0, 0xc(r3)
/* 800A9B78 000A6AB8  54 00 C6 3E */	rlwinm r0, r0, 0x18, 0x18, 0x1f
/* 800A9B7C 000A6ABC  98 04 00 02 */	stb r0, 2(r4)
/* 800A9B80 000A6AC0  80 03 00 0C */	lwz r0, 0xc(r3)
/* 800A9B84 000A6AC4  98 04 00 03 */	stb r0, 3(r4)
/* 800A9B88 000A6AC8  4E 80 00 20 */	blr 

.global GXLoadLightObjImm
GXLoadLightObjImm:
/* 800A9B8C 000A6ACC  2C 04 00 10 */	cmpwi r4, 0x10
/* 800A9B90 000A6AD0  41 82 00 7C */	beq lbl_800A9C0C
/* 800A9B94 000A6AD4  40 80 00 34 */	bge lbl_800A9BC8
/* 800A9B98 000A6AD8  2C 04 00 04 */	cmpwi r4, 4
/* 800A9B9C 000A6ADC  41 82 00 60 */	beq lbl_800A9BFC
/* 800A9BA0 000A6AE0  40 80 00 1C */	bge lbl_800A9BBC
/* 800A9BA4 000A6AE4  2C 04 00 02 */	cmpwi r4, 2
/* 800A9BA8 000A6AE8  41 82 00 4C */	beq lbl_800A9BF4
/* 800A9BAC 000A6AEC  40 80 00 80 */	bge lbl_800A9C2C
/* 800A9BB0 000A6AF0  2C 04 00 01 */	cmpwi r4, 1
/* 800A9BB4 000A6AF4  40 80 00 38 */	bge lbl_800A9BEC
/* 800A9BB8 000A6AF8  48 00 00 74 */	b lbl_800A9C2C
lbl_800A9BBC:
/* 800A9BBC 000A6AFC  2C 04 00 08 */	cmpwi r4, 8
/* 800A9BC0 000A6B00  41 82 00 44 */	beq lbl_800A9C04
/* 800A9BC4 000A6B04  48 00 00 68 */	b lbl_800A9C2C
lbl_800A9BC8:
/* 800A9BC8 000A6B08  2C 04 00 40 */	cmpwi r4, 0x40
/* 800A9BCC 000A6B0C  41 82 00 50 */	beq lbl_800A9C1C
/* 800A9BD0 000A6B10  40 80 00 10 */	bge lbl_800A9BE0
/* 800A9BD4 000A6B14  2C 04 00 20 */	cmpwi r4, 0x20
/* 800A9BD8 000A6B18  41 82 00 3C */	beq lbl_800A9C14
/* 800A9BDC 000A6B1C  48 00 00 50 */	b lbl_800A9C2C
lbl_800A9BE0:
/* 800A9BE0 000A6B20  2C 04 00 80 */	cmpwi r4, 0x80
/* 800A9BE4 000A6B24  41 82 00 40 */	beq lbl_800A9C24
/* 800A9BE8 000A6B28  48 00 00 44 */	b lbl_800A9C2C
lbl_800A9BEC:
/* 800A9BEC 000A6B2C  38 00 00 00 */	li r0, 0
/* 800A9BF0 000A6B30  48 00 00 40 */	b lbl_800A9C30
lbl_800A9BF4:
/* 800A9BF4 000A6B34  38 00 00 01 */	li r0, 1
/* 800A9BF8 000A6B38  48 00 00 38 */	b lbl_800A9C30
lbl_800A9BFC:
/* 800A9BFC 000A6B3C  38 00 00 02 */	li r0, 2
/* 800A9C00 000A6B40  48 00 00 30 */	b lbl_800A9C30
lbl_800A9C04:
/* 800A9C04 000A6B44  38 00 00 03 */	li r0, 3
/* 800A9C08 000A6B48  48 00 00 28 */	b lbl_800A9C30
lbl_800A9C0C:
/* 800A9C0C 000A6B4C  38 00 00 04 */	li r0, 4
/* 800A9C10 000A6B50  48 00 00 20 */	b lbl_800A9C30
lbl_800A9C14:
/* 800A9C14 000A6B54  38 00 00 05 */	li r0, 5
/* 800A9C18 000A6B58  48 00 00 18 */	b lbl_800A9C30
lbl_800A9C1C:
/* 800A9C1C 000A6B5C  38 00 00 06 */	li r0, 6
/* 800A9C20 000A6B60  48 00 00 10 */	b lbl_800A9C30
lbl_800A9C24:
/* 800A9C24 000A6B64  38 00 00 07 */	li r0, 7
/* 800A9C28 000A6B68  48 00 00 08 */	b lbl_800A9C30
lbl_800A9C2C:
/* 800A9C2C 000A6B6C  38 00 00 00 */	li r0, 0
lbl_800A9C30:
/* 800A9C30 000A6B70  54 05 20 36 */	slwi r5, r0, 4
/* 800A9C34 000A6B74  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800A9C38 000A6B78  38 05 06 00 */	addi r0, r5, 0x600
/* 800A9C3C 000A6B7C  38 A0 00 10 */	li r5, 0x10
/* 800A9C40 000A6B80  3C C0 CC 01 */	lis r6, 0xCC008000@ha
/* 800A9C44 000A6B84  98 A6 80 00 */	stb r5, 0xCC008000@l(r6)
/* 800A9C48 000A6B88  64 00 00 0F */	oris r0, r0, 0xf
/* 800A9C4C 000A6B8C  38 A0 00 00 */	li r5, 0
/* 800A9C50 000A6B90  90 06 80 00 */	stw r0, -0x8000(r6)
/* 800A9C54 000A6B94  38 00 00 01 */	li r0, 1
/* 800A9C58 000A6B98  90 A6 80 00 */	stw r5, -0x8000(r6)
/* 800A9C5C 000A6B9C  90 A6 80 00 */	stw r5, -0x8000(r6)
/* 800A9C60 000A6BA0  90 A6 80 00 */	stw r5, -0x8000(r6)
/* 800A9C64 000A6BA4  80 A3 00 0C */	lwz r5, 0xc(r3)
/* 800A9C68 000A6BA8  90 A6 80 00 */	stw r5, -0x8000(r6)
/* 800A9C6C 000A6BAC  C0 03 00 10 */	lfs f0, 0x10(r3)
/* 800A9C70 000A6BB0  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9C74 000A6BB4  C0 03 00 14 */	lfs f0, 0x14(r3)
/* 800A9C78 000A6BB8  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9C7C 000A6BBC  C0 03 00 18 */	lfs f0, 0x18(r3)
/* 800A9C80 000A6BC0  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9C84 000A6BC4  C0 03 00 1C */	lfs f0, 0x1c(r3)
/* 800A9C88 000A6BC8  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9C8C 000A6BCC  C0 03 00 20 */	lfs f0, 0x20(r3)
/* 800A9C90 000A6BD0  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9C94 000A6BD4  C0 03 00 24 */	lfs f0, 0x24(r3)
/* 800A9C98 000A6BD8  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9C9C 000A6BDC  C0 03 00 28 */	lfs f0, 0x28(r3)
/* 800A9CA0 000A6BE0  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9CA4 000A6BE4  C0 03 00 2C */	lfs f0, 0x2c(r3)
/* 800A9CA8 000A6BE8  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9CAC 000A6BEC  C0 03 00 30 */	lfs f0, 0x30(r3)
/* 800A9CB0 000A6BF0  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9CB4 000A6BF4  C0 03 00 34 */	lfs f0, 0x34(r3)
/* 800A9CB8 000A6BF8  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9CBC 000A6BFC  C0 03 00 38 */	lfs f0, 0x38(r3)
/* 800A9CC0 000A6C00  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9CC4 000A6C04  C0 03 00 3C */	lfs f0, 0x3c(r3)
/* 800A9CC8 000A6C08  D0 06 80 00 */	stfs f0, -0x8000(r6)
/* 800A9CCC 000A6C0C  B0 04 00 02 */	sth r0, 2(r4)
/* 800A9CD0 000A6C10  4E 80 00 20 */	blr 

.global GXSetChanAmbColor
GXSetChanAmbColor:
/* 800A9CD4 000A6C14  2C 03 00 03 */	cmpwi r3, 3
/* 800A9CD8 000A6C18  41 82 00 B0 */	beq lbl_800A9D88
/* 800A9CDC 000A6C1C  40 80 00 1C */	bge lbl_800A9CF8
/* 800A9CE0 000A6C20  2C 03 00 01 */	cmpwi r3, 1
/* 800A9CE4 000A6C24  41 82 00 58 */	beq lbl_800A9D3C
/* 800A9CE8 000A6C28  40 80 00 88 */	bge lbl_800A9D70
/* 800A9CEC 000A6C2C  2C 03 00 00 */	cmpwi r3, 0
/* 800A9CF0 000A6C30  40 80 00 18 */	bge lbl_800A9D08
/* 800A9CF4 000A6C34  4E 80 00 20 */	blr 
lbl_800A9CF8:
/* 800A9CF8 000A6C38  2C 03 00 05 */	cmpwi r3, 5
/* 800A9CFC 000A6C3C  41 82 00 D4 */	beq lbl_800A9DD0
/* 800A9D00 000A6C40  4C 80 00 20 */	bgelr 
/* 800A9D04 000A6C44  48 00 00 9C */	b lbl_800A9DA0
lbl_800A9D08:
/* 800A9D08 000A6C48  80 AD 82 C8 */	lwz r5, gx@sda21(r13)
/* 800A9D0C 000A6C4C  38 60 00 00 */	li r3, 0
/* 800A9D10 000A6C50  88 C4 00 02 */	lbz r6, 2(r4)
/* 800A9D14 000A6C54  80 E5 00 A8 */	lwz r7, 0xa8(r5)
/* 800A9D18 000A6C58  88 A4 00 01 */	lbz r5, 1(r4)
/* 800A9D1C 000A6C5C  88 04 00 00 */	lbz r0, 0(r4)
/* 800A9D20 000A6C60  54 E7 06 3E */	clrlwi r7, r7, 0x18
/* 800A9D24 000A6C64  50 C7 44 2E */	rlwimi r7, r6, 8, 0x10, 0x17
/* 800A9D28 000A6C68  54 A4 80 1E */	slwi r4, r5, 0x10
/* 800A9D2C 000A6C6C  50 E4 04 3E */	rlwimi r4, r7, 0, 0x10, 0x1f
/* 800A9D30 000A6C70  54 07 C0 0E */	slwi r7, r0, 0x18
/* 800A9D34 000A6C74  50 87 02 3E */	rlwimi r7, r4, 0, 8, 0x1f
/* 800A9D38 000A6C78  48 00 00 CC */	b lbl_800A9E04
lbl_800A9D3C:
/* 800A9D3C 000A6C7C  80 AD 82 C8 */	lwz r5, gx@sda21(r13)
/* 800A9D40 000A6C80  38 60 00 01 */	li r3, 1
/* 800A9D44 000A6C84  88 C4 00 02 */	lbz r6, 2(r4)
/* 800A9D48 000A6C88  80 E5 00 AC */	lwz r7, 0xac(r5)
/* 800A9D4C 000A6C8C  88 A4 00 01 */	lbz r5, 1(r4)
/* 800A9D50 000A6C90  88 04 00 00 */	lbz r0, 0(r4)
/* 800A9D54 000A6C94  54 E7 06 3E */	clrlwi r7, r7, 0x18
/* 800A9D58 000A6C98  50 C7 44 2E */	rlwimi r7, r6, 8, 0x10, 0x17
/* 800A9D5C 000A6C9C  54 A4 80 1E */	slwi r4, r5, 0x10
/* 800A9D60 000A6CA0  50 E4 04 3E */	rlwimi r4, r7, 0, 0x10, 0x1f
/* 800A9D64 000A6CA4  54 07 C0 0E */	slwi r7, r0, 0x18
/* 800A9D68 000A6CA8  50 87 02 3E */	rlwimi r7, r4, 0, 8, 0x1f
/* 800A9D6C 000A6CAC  48 00 00 98 */	b lbl_800A9E04
lbl_800A9D70:
/* 800A9D70 000A6CB0  80 AD 82 C8 */	lwz r5, gx@sda21(r13)
/* 800A9D74 000A6CB4  38 60 00 00 */	li r3, 0
/* 800A9D78 000A6CB8  88 E4 00 03 */	lbz r7, 3(r4)
/* 800A9D7C 000A6CBC  80 05 00 A8 */	lwz r0, 0xa8(r5)
/* 800A9D80 000A6CC0  50 07 00 2E */	rlwimi r7, r0, 0, 0, 0x17
/* 800A9D84 000A6CC4  48 00 00 80 */	b lbl_800A9E04
lbl_800A9D88:
/* 800A9D88 000A6CC8  80 AD 82 C8 */	lwz r5, gx@sda21(r13)
/* 800A9D8C 000A6CCC  38 60 00 01 */	li r3, 1
/* 800A9D90 000A6CD0  88 E4 00 03 */	lbz r7, 3(r4)
/* 800A9D94 000A6CD4  80 05 00 AC */	lwz r0, 0xac(r5)
/* 800A9D98 000A6CD8  50 07 00 2E */	rlwimi r7, r0, 0, 0, 0x17
/* 800A9D9C 000A6CDC  48 00 00 68 */	b lbl_800A9E04
lbl_800A9DA0:
/* 800A9DA0 000A6CE0  88 04 00 02 */	lbz r0, 2(r4)
/* 800A9DA4 000A6CE4  38 60 00 00 */	li r3, 0
/* 800A9DA8 000A6CE8  88 E4 00 03 */	lbz r7, 3(r4)
/* 800A9DAC 000A6CEC  54 06 40 2E */	slwi r6, r0, 8
/* 800A9DB0 000A6CF0  88 A4 00 01 */	lbz r5, 1(r4)
/* 800A9DB4 000A6CF4  88 04 00 00 */	lbz r0, 0(r4)
/* 800A9DB8 000A6CF8  50 E6 06 3E */	rlwimi r6, r7, 0, 0x18, 0x1f
/* 800A9DBC 000A6CFC  54 A4 80 1E */	slwi r4, r5, 0x10
/* 800A9DC0 000A6D00  50 C4 04 3E */	rlwimi r4, r6, 0, 0x10, 0x1f
/* 800A9DC4 000A6D04  54 07 C0 0E */	slwi r7, r0, 0x18
/* 800A9DC8 000A6D08  50 87 02 3E */	rlwimi r7, r4, 0, 8, 0x1f
/* 800A9DCC 000A6D0C  48 00 00 38 */	b lbl_800A9E04
lbl_800A9DD0:
/* 800A9DD0 000A6D10  88 04 00 02 */	lbz r0, 2(r4)
/* 800A9DD4 000A6D14  38 60 00 01 */	li r3, 1
/* 800A9DD8 000A6D18  88 E4 00 03 */	lbz r7, 3(r4)
/* 800A9DDC 000A6D1C  54 06 40 2E */	slwi r6, r0, 8
/* 800A9DE0 000A6D20  88 A4 00 01 */	lbz r5, 1(r4)
/* 800A9DE4 000A6D24  88 04 00 00 */	lbz r0, 0(r4)
/* 800A9DE8 000A6D28  50 E6 06 3E */	rlwimi r6, r7, 0, 0x18, 0x1f
/* 800A9DEC 000A6D2C  54 A4 80 1E */	slwi r4, r5, 0x10
/* 800A9DF0 000A6D30  50 C4 04 3E */	rlwimi r4, r6, 0, 0x10, 0x1f
/* 800A9DF4 000A6D34  54 07 C0 0E */	slwi r7, r0, 0x18
/* 800A9DF8 000A6D38  50 87 02 3E */	rlwimi r7, r4, 0, 8, 0x1f
/* 800A9DFC 000A6D3C  48 00 00 08 */	b lbl_800A9E04
/* 800A9E00 000A6D40  4E 80 00 20 */	blr 
lbl_800A9E04:
/* 800A9E04 000A6D44  38 00 00 10 */	li r0, 0x10
/* 800A9E08 000A6D48  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800A9E0C 000A6D4C  3C C0 CC 01 */	lis r6, 0xCC008000@ha
/* 800A9E10 000A6D50  98 06 80 00 */	stb r0, 0xCC008000@l(r6)
/* 800A9E14 000A6D54  38 03 10 0A */	addi r0, r3, 0x100a
/* 800A9E18 000A6D58  38 A0 00 01 */	li r5, 1
/* 800A9E1C 000A6D5C  90 06 80 00 */	stw r0, -0x8000(r6)
/* 800A9E20 000A6D60  54 60 10 3A */	slwi r0, r3, 2
/* 800A9E24 000A6D64  90 E6 80 00 */	stw r7, -0x8000(r6)
/* 800A9E28 000A6D68  B0 A4 00 02 */	sth r5, 2(r4)
/* 800A9E2C 000A6D6C  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800A9E30 000A6D70  7C 63 02 14 */	add r3, r3, r0
/* 800A9E34 000A6D74  90 E3 00 A8 */	stw r7, 0xa8(r3)
/* 800A9E38 000A6D78  4E 80 00 20 */	blr 

.global GXSetChanMatColor
GXSetChanMatColor:
/* 800A9E3C 000A6D7C  2C 03 00 03 */	cmpwi r3, 3
/* 800A9E40 000A6D80  41 82 00 B0 */	beq lbl_800A9EF0
/* 800A9E44 000A6D84  40 80 00 1C */	bge lbl_800A9E60
/* 800A9E48 000A6D88  2C 03 00 01 */	cmpwi r3, 1
/* 800A9E4C 000A6D8C  41 82 00 58 */	beq lbl_800A9EA4
/* 800A9E50 000A6D90  40 80 00 88 */	bge lbl_800A9ED8
/* 800A9E54 000A6D94  2C 03 00 00 */	cmpwi r3, 0
/* 800A9E58 000A6D98  40 80 00 18 */	bge lbl_800A9E70
/* 800A9E5C 000A6D9C  4E 80 00 20 */	blr 
lbl_800A9E60:
/* 800A9E60 000A6DA0  2C 03 00 05 */	cmpwi r3, 5
/* 800A9E64 000A6DA4  41 82 00 D4 */	beq lbl_800A9F38
/* 800A9E68 000A6DA8  4C 80 00 20 */	bgelr 
/* 800A9E6C 000A6DAC  48 00 00 9C */	b lbl_800A9F08
lbl_800A9E70:
/* 800A9E70 000A6DB0  80 AD 82 C8 */	lwz r5, gx@sda21(r13)
/* 800A9E74 000A6DB4  38 60 00 00 */	li r3, 0
/* 800A9E78 000A6DB8  88 C4 00 02 */	lbz r6, 2(r4)
/* 800A9E7C 000A6DBC  80 E5 00 B0 */	lwz r7, 0xb0(r5)
/* 800A9E80 000A6DC0  88 A4 00 01 */	lbz r5, 1(r4)
/* 800A9E84 000A6DC4  88 04 00 00 */	lbz r0, 0(r4)
/* 800A9E88 000A6DC8  54 E7 06 3E */	clrlwi r7, r7, 0x18
/* 800A9E8C 000A6DCC  50 C7 44 2E */	rlwimi r7, r6, 8, 0x10, 0x17
/* 800A9E90 000A6DD0  54 A4 80 1E */	slwi r4, r5, 0x10
/* 800A9E94 000A6DD4  50 E4 04 3E */	rlwimi r4, r7, 0, 0x10, 0x1f
/* 800A9E98 000A6DD8  54 07 C0 0E */	slwi r7, r0, 0x18
/* 800A9E9C 000A6DDC  50 87 02 3E */	rlwimi r7, r4, 0, 8, 0x1f
/* 800A9EA0 000A6DE0  48 00 00 CC */	b lbl_800A9F6C
lbl_800A9EA4:
/* 800A9EA4 000A6DE4  80 AD 82 C8 */	lwz r5, gx@sda21(r13)
/* 800A9EA8 000A6DE8  38 60 00 01 */	li r3, 1
/* 800A9EAC 000A6DEC  88 C4 00 02 */	lbz r6, 2(r4)
/* 800A9EB0 000A6DF0  80 E5 00 B4 */	lwz r7, 0xb4(r5)
/* 800A9EB4 000A6DF4  88 A4 00 01 */	lbz r5, 1(r4)
/* 800A9EB8 000A6DF8  88 04 00 00 */	lbz r0, 0(r4)
/* 800A9EBC 000A6DFC  54 E7 06 3E */	clrlwi r7, r7, 0x18
/* 800A9EC0 000A6E00  50 C7 44 2E */	rlwimi r7, r6, 8, 0x10, 0x17
/* 800A9EC4 000A6E04  54 A4 80 1E */	slwi r4, r5, 0x10
/* 800A9EC8 000A6E08  50 E4 04 3E */	rlwimi r4, r7, 0, 0x10, 0x1f
/* 800A9ECC 000A6E0C  54 07 C0 0E */	slwi r7, r0, 0x18
/* 800A9ED0 000A6E10  50 87 02 3E */	rlwimi r7, r4, 0, 8, 0x1f
/* 800A9ED4 000A6E14  48 00 00 98 */	b lbl_800A9F6C
lbl_800A9ED8:
/* 800A9ED8 000A6E18  80 AD 82 C8 */	lwz r5, gx@sda21(r13)
/* 800A9EDC 000A6E1C  38 60 00 00 */	li r3, 0
/* 800A9EE0 000A6E20  88 E4 00 03 */	lbz r7, 3(r4)
/* 800A9EE4 000A6E24  80 05 00 B0 */	lwz r0, 0xb0(r5)
/* 800A9EE8 000A6E28  50 07 00 2E */	rlwimi r7, r0, 0, 0, 0x17
/* 800A9EEC 000A6E2C  48 00 00 80 */	b lbl_800A9F6C
lbl_800A9EF0:
/* 800A9EF0 000A6E30  80 AD 82 C8 */	lwz r5, gx@sda21(r13)
/* 800A9EF4 000A6E34  38 60 00 01 */	li r3, 1
/* 800A9EF8 000A6E38  88 E4 00 03 */	lbz r7, 3(r4)
/* 800A9EFC 000A6E3C  80 05 00 B4 */	lwz r0, 0xb4(r5)
/* 800A9F00 000A6E40  50 07 00 2E */	rlwimi r7, r0, 0, 0, 0x17
/* 800A9F04 000A6E44  48 00 00 68 */	b lbl_800A9F6C
lbl_800A9F08:
/* 800A9F08 000A6E48  88 04 00 02 */	lbz r0, 2(r4)
/* 800A9F0C 000A6E4C  38 60 00 00 */	li r3, 0
/* 800A9F10 000A6E50  88 E4 00 03 */	lbz r7, 3(r4)
/* 800A9F14 000A6E54  54 06 40 2E */	slwi r6, r0, 8
/* 800A9F18 000A6E58  88 A4 00 01 */	lbz r5, 1(r4)
/* 800A9F1C 000A6E5C  88 04 00 00 */	lbz r0, 0(r4)
/* 800A9F20 000A6E60  50 E6 06 3E */	rlwimi r6, r7, 0, 0x18, 0x1f
/* 800A9F24 000A6E64  54 A4 80 1E */	slwi r4, r5, 0x10
/* 800A9F28 000A6E68  50 C4 04 3E */	rlwimi r4, r6, 0, 0x10, 0x1f
/* 800A9F2C 000A6E6C  54 07 C0 0E */	slwi r7, r0, 0x18
/* 800A9F30 000A6E70  50 87 02 3E */	rlwimi r7, r4, 0, 8, 0x1f
/* 800A9F34 000A6E74  48 00 00 38 */	b lbl_800A9F6C
lbl_800A9F38:
/* 800A9F38 000A6E78  88 04 00 02 */	lbz r0, 2(r4)
/* 800A9F3C 000A6E7C  38 60 00 01 */	li r3, 1
/* 800A9F40 000A6E80  88 E4 00 03 */	lbz r7, 3(r4)
/* 800A9F44 000A6E84  54 06 40 2E */	slwi r6, r0, 8
/* 800A9F48 000A6E88  88 A4 00 01 */	lbz r5, 1(r4)
/* 800A9F4C 000A6E8C  88 04 00 00 */	lbz r0, 0(r4)
/* 800A9F50 000A6E90  50 E6 06 3E */	rlwimi r6, r7, 0, 0x18, 0x1f
/* 800A9F54 000A6E94  54 A4 80 1E */	slwi r4, r5, 0x10
/* 800A9F58 000A6E98  50 C4 04 3E */	rlwimi r4, r6, 0, 0x10, 0x1f
/* 800A9F5C 000A6E9C  54 07 C0 0E */	slwi r7, r0, 0x18
/* 800A9F60 000A6EA0  50 87 02 3E */	rlwimi r7, r4, 0, 8, 0x1f
/* 800A9F64 000A6EA4  48 00 00 08 */	b lbl_800A9F6C
/* 800A9F68 000A6EA8  4E 80 00 20 */	blr 
lbl_800A9F6C:
/* 800A9F6C 000A6EAC  38 00 00 10 */	li r0, 0x10
/* 800A9F70 000A6EB0  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800A9F74 000A6EB4  3C C0 CC 01 */	lis r6, 0xCC008000@ha
/* 800A9F78 000A6EB8  98 06 80 00 */	stb r0, 0xCC008000@l(r6)
/* 800A9F7C 000A6EBC  38 03 10 0C */	addi r0, r3, 0x100c
/* 800A9F80 000A6EC0  38 A0 00 01 */	li r5, 1
/* 800A9F84 000A6EC4  90 06 80 00 */	stw r0, -0x8000(r6)
/* 800A9F88 000A6EC8  54 60 10 3A */	slwi r0, r3, 2
/* 800A9F8C 000A6ECC  90 E6 80 00 */	stw r7, -0x8000(r6)
/* 800A9F90 000A6ED0  B0 A4 00 02 */	sth r5, 2(r4)
/* 800A9F94 000A6ED4  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800A9F98 000A6ED8  7C 63 02 14 */	add r3, r3, r0
/* 800A9F9C 000A6EDC  90 E3 00 B0 */	stw r7, 0xb0(r3)
/* 800A9FA0 000A6EE0  4E 80 00 20 */	blr 

.global GXSetNumChans
GXSetNumChans:
/* 800A9FA4 000A6EE4  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800A9FA8 000A6EE8  54 67 06 3E */	clrlwi r7, r3, 0x18
/* 800A9FAC 000A6EEC  54 60 25 36 */	rlwinm r0, r3, 4, 0x14, 0x1b
/* 800A9FB0 000A6EF0  38 C4 02 04 */	addi r6, r4, 0x204
/* 800A9FB4 000A6EF4  80 A4 02 04 */	lwz r5, 0x204(r4)
/* 800A9FB8 000A6EF8  38 60 00 10 */	li r3, 0x10
/* 800A9FBC 000A6EFC  3C 80 CC 01 */	lis r4, 0xCC008000@ha
/* 800A9FC0 000A6F00  54 A5 07 30 */	rlwinm r5, r5, 0, 0x1c, 0x18
/* 800A9FC4 000A6F04  7C A0 03 78 */	or r0, r5, r0
/* 800A9FC8 000A6F08  90 06 00 00 */	stw r0, 0(r6)
/* 800A9FCC 000A6F0C  38 00 10 09 */	li r0, 0x1009
/* 800A9FD0 000A6F10  98 64 80 00 */	stb r3, 0xCC008000@l(r4)
/* 800A9FD4 000A6F14  80 6D 82 C8 */	lwz r3, gx@sda21(r13)
/* 800A9FD8 000A6F18  90 04 80 00 */	stw r0, -0x8000(r4)
/* 800A9FDC 000A6F1C  90 E4 80 00 */	stw r7, -0x8000(r4)
/* 800A9FE0 000A6F20  80 03 04 F4 */	lwz r0, 0x4f4(r3)
/* 800A9FE4 000A6F24  60 00 00 04 */	ori r0, r0, 4
/* 800A9FE8 000A6F28  90 03 04 F4 */	stw r0, 0x4f4(r3)
/* 800A9FEC 000A6F2C  4E 80 00 20 */	blr 

.global GXSetChanCtrl
GXSetChanCtrl:
/* 800A9FF0 000A6F30  94 21 FF C8 */	stwu r1, -0x38(r1)
/* 800A9FF4 000A6F34  2C 03 00 04 */	cmpwi r3, 4
/* 800A9FF8 000A6F38  93 E1 00 34 */	stw r31, 0x34(r1)
/* 800A9FFC 000A6F3C  93 C1 00 30 */	stw r30, 0x30(r1)
/* 800AA000 000A6F40  93 A1 00 2C */	stw r29, 0x2c(r1)
/* 800AA004 000A6F44  93 81 00 28 */	stw r28, 0x28(r1)
/* 800AA008 000A6F48  40 82 00 0C */	bne lbl_800AA014
/* 800AA00C 000A6F4C  39 60 00 00 */	li r11, 0
/* 800AA010 000A6F50  48 00 00 18 */	b lbl_800AA028
lbl_800AA014:
/* 800AA014 000A6F54  2C 03 00 05 */	cmpwi r3, 5
/* 800AA018 000A6F58  40 82 00 0C */	bne lbl_800AA024
/* 800AA01C 000A6F5C  39 60 00 01 */	li r11, 1
/* 800AA020 000A6F60  48 00 00 08 */	b lbl_800AA028
lbl_800AA024:
/* 800AA024 000A6F64  7C 6B 1B 78 */	mr r11, r3
lbl_800AA028:
/* 800AA028 000A6F68  54 84 0D FC */	rlwinm r4, r4, 1, 0x17, 0x1e
/* 800AA02C 000A6F6C  7C 8A 33 78 */	or r10, r4, r6
/* 800AA030 000A6F70  54 E0 07 FE */	clrlwi r0, r7, 0x1f
/* 800AA034 000A6F74  7C C0 00 D0 */	neg r6, r0
/* 800AA038 000A6F78  30 86 FF FF */	addic r4, r6, -1
/* 800AA03C 000A6F7C  54 E0 07 BC */	rlwinm r0, r7, 0, 0x1e, 0x1e
/* 800AA040 000A6F80  7D 80 00 D0 */	neg r12, r0
/* 800AA044 000A6F84  7C C4 31 10 */	subfe r6, r4, r6
/* 800AA048 000A6F88  30 8C FF FF */	addic r4, r12, -1
/* 800AA04C 000A6F8C  7C 84 61 10 */	subfe r4, r4, r12
/* 800AA050 000A6F90  54 E0 07 7A */	rlwinm r0, r7, 0, 0x1d, 0x1d
/* 800AA054 000A6F94  7F 80 00 D0 */	neg r28, r0
/* 800AA058 000A6F98  30 1C FF FF */	addic r0, r28, -1
/* 800AA05C 000A6F9C  54 EC 07 38 */	rlwinm r12, r7, 0, 0x1c, 0x1c
/* 800AA060 000A6FA0  7C 00 E1 10 */	subfe r0, r0, r28
/* 800AA064 000A6FA4  7F AC 00 D0 */	neg r29, r12
/* 800AA068 000A6FA8  33 9D FF FF */	addic r28, r29, -1
/* 800AA06C 000A6FAC  54 EC 06 F6 */	rlwinm r12, r7, 0, 0x1b, 0x1b
/* 800AA070 000A6FB0  7F CC 00 D0 */	neg r30, r12
/* 800AA074 000A6FB4  7F 9C E9 10 */	subfe r28, r28, r29
/* 800AA078 000A6FB8  33 BE FF FF */	addic r29, r30, -1
/* 800AA07C 000A6FBC  54 EC 06 B4 */	rlwinm r12, r7, 0, 0x1a, 0x1a
/* 800AA080 000A6FC0  7F EC 00 D0 */	neg r31, r12
/* 800AA084 000A6FC4  7F BD F1 10 */	subfe r29, r29, r30
/* 800AA088 000A6FC8  33 DF FF FF */	addic r30, r31, -1
/* 800AA08C 000A6FCC  54 EC 06 72 */	rlwinm r12, r7, 0, 0x19, 0x19
/* 800AA090 000A6FD0  7F DE F9 10 */	subfe r30, r30, r31
/* 800AA094 000A6FD4  7F EC 00 D0 */	neg r31, r12
/* 800AA098 000A6FD8  31 9F FF FF */	addic r12, r31, -1
/* 800AA09C 000A6FDC  55 4A 06 B0 */	rlwinm r10, r10, 0, 0x1a, 0x18
/* 800AA0A0 000A6FE0  54 A5 30 32 */	slwi r5, r5, 6
/* 800AA0A4 000A6FE4  7D 45 2B 78 */	or r5, r10, r5
/* 800AA0A8 000A6FE8  54 AA 07 B8 */	rlwinm r10, r5, 0, 0x1e, 0x1c
/* 800AA0AC 000A6FEC  54 C5 10 3A */	slwi r5, r6, 2
/* 800AA0B0 000A6FF0  7D 45 2B 78 */	or r5, r10, r5
/* 800AA0B4 000A6FF4  54 A5 07 76 */	rlwinm r5, r5, 0, 0x1d, 0x1b
/* 800AA0B8 000A6FF8  54 84 18 38 */	slwi r4, r4, 3
/* 800AA0BC 000A6FFC  7C A4 23 78 */	or r4, r5, r4
/* 800AA0C0 000A7000  54 84 07 34 */	rlwinm r4, r4, 0, 0x1c, 0x1a
/* 800AA0C4 000A7004  54 00 20 36 */	slwi r0, r0, 4
/* 800AA0C8 000A7008  7C 80 03 78 */	or r0, r4, r0
/* 800AA0CC 000A700C  54 04 06 F2 */	rlwinm r4, r0, 0, 0x1b, 0x19
/* 800AA0D0 000A7010  57 80 28 34 */	slwi r0, r28, 5
/* 800AA0D4 000A7014  7C 80 03 78 */	or r0, r4, r0
/* 800AA0D8 000A7018  54 04 05 66 */	rlwinm r4, r0, 0, 0x15, 0x13
/* 800AA0DC 000A701C  57 A0 58 28 */	slwi r0, r29, 0xb
/* 800AA0E0 000A7020  7C 80 03 78 */	or r0, r4, r0
/* 800AA0E4 000A7024  54 04 05 24 */	rlwinm r4, r0, 0, 0x14, 0x12
/* 800AA0E8 000A7028  57 C0 60 26 */	slwi r0, r30, 0xc
/* 800AA0EC 000A702C  7C 80 03 78 */	or r0, r4, r0
/* 800AA0F0 000A7030  54 E7 06 30 */	rlwinm r7, r7, 0, 0x18, 0x18
/* 800AA0F4 000A7034  7F EC F9 10 */	subfe r31, r12, r31
/* 800AA0F8 000A7038  7D 87 00 D0 */	neg r12, r7
/* 800AA0FC 000A703C  30 EC FF FF */	addic r7, r12, -1
/* 800AA100 000A7040  54 04 04 E2 */	rlwinm r4, r0, 0, 0x13, 0x11
/* 800AA104 000A7044  57 E0 68 24 */	slwi r0, r31, 0xd
/* 800AA108 000A7048  7C 80 03 78 */	or r0, r4, r0
/* 800AA10C 000A704C  7C E7 61 10 */	subfe r7, r7, r12
/* 800AA110 000A7050  54 04 04 A0 */	rlwinm r4, r0, 0, 0x12, 0x10
/* 800AA114 000A7054  54 E0 70 22 */	slwi r0, r7, 0xe
/* 800AA118 000A7058  2C 09 00 00 */	cmpwi r9, 0
/* 800AA11C 000A705C  7C 86 03 78 */	or r6, r4, r0
/* 800AA120 000A7060  40 82 00 08 */	bne lbl_800AA128
/* 800AA124 000A7064  39 00 00 00 */	li r8, 0
lbl_800AA128:
/* 800AA128 000A7068  20 A9 00 02 */	subfic r5, r9, 2
/* 800AA12C 000A706C  80 8D 82 C8 */	lwz r4, gx@sda21(r13)
/* 800AA130 000A7070  30 05 FF FF */	addic r0, r5, -1
/* 800AA134 000A7074  7D 40 29 10 */	subfe r10, r0, r5
/* 800AA138 000A7078  7C A9 00 D0 */	neg r5, r9
/* 800AA13C 000A707C  30 05 FF FF */	addic r0, r5, -1
/* 800AA140 000A7080  7C E0 29 10 */	subfe r7, r0, r5
/* 800AA144 000A7084  54 C5 06 6C */	rlwinm r5, r6, 0, 0x19, 0x16
/* 800AA148 000A7088  55 00 38 30 */	slwi r0, r8, 7
/* 800AA14C 000A708C  7C A8 03 78 */	or r8, r5, r0
/* 800AA150 000A7090  38 C0 00 10 */	li r6, 0x10
/* 800AA154 000A7094  3C A0 CC 01 */	lis r5, 0xCC008000@ha
/* 800AA158 000A7098  98 C5 80 00 */	stb r6, 0xCC008000@l(r5)
/* 800AA15C 000A709C  38 0B 10 0E */	addi r0, r11, 0x100e
/* 800AA160 000A70A0  55 09 05 EA */	rlwinm r9, r8, 0, 0x17, 0x15
/* 800AA164 000A70A4  55 48 48 2C */	slwi r8, r10, 9
/* 800AA168 000A70A8  90 05 80 00 */	stw r0, -0x8000(r5)
/* 800AA16C 000A70AC  7D 20 43 78 */	or r0, r9, r8
/* 800AA170 000A70B0  54 08 05 A8 */	rlwinm r8, r0, 0, 0x16, 0x14
/* 800AA174 000A70B4  54 E0 50 2A */	slwi r0, r7, 0xa
/* 800AA178 000A70B8  7D 07 03 78 */	or r7, r8, r0
/* 800AA17C 000A70BC  90 E5 80 00 */	stw r7, -0x8000(r5)
/* 800AA180 000A70C0  38 00 00 01 */	li r0, 1
/* 800AA184 000A70C4  2C 03 00 04 */	cmpwi r3, 4
/* 800AA188 000A70C8  B0 04 00 02 */	sth r0, 2(r4)
/* 800AA18C 000A70CC  40 82 00 18 */	bne lbl_800AA1A4
/* 800AA190 000A70D0  98 C5 80 00 */	stb r6, -0x8000(r5)
/* 800AA194 000A70D4  38 00 10 10 */	li r0, 0x1010
/* 800AA198 000A70D8  90 05 80 00 */	stw r0, -0x8000(r5)
/* 800AA19C 000A70DC  90 E5 80 00 */	stw r7, -0x8000(r5)
/* 800AA1A0 000A70E0  48 00 00 1C */	b lbl_800AA1BC
lbl_800AA1A4:
/* 800AA1A4 000A70E4  2C 03 00 05 */	cmpwi r3, 5
/* 800AA1A8 000A70E8  40 82 00 14 */	bne lbl_800AA1BC
/* 800AA1AC 000A70EC  98 C5 80 00 */	stb r6, -0x8000(r5)
/* 800AA1B0 000A70F0  38 00 10 11 */	li r0, 0x1011
/* 800AA1B4 000A70F4  90 05 80 00 */	stw r0, -0x8000(r5)
/* 800AA1B8 000A70F8  90 E5 80 00 */	stw r7, -0x8000(r5)
lbl_800AA1BC:
/* 800AA1BC 000A70FC  83 E1 00 34 */	lwz r31, 0x34(r1)
/* 800AA1C0 000A7100  83 C1 00 30 */	lwz r30, 0x30(r1)
/* 800AA1C4 000A7104  83 A1 00 2C */	lwz r29, 0x2c(r1)
/* 800AA1C8 000A7108  83 81 00 28 */	lwz r28, 0x28(r1)
/* 800AA1CC 000A710C  38 21 00 38 */	addi r1, r1, 0x38
/* 800AA1D0 000A7110  4E 80 00 20 */	blr 

.section .sdata2, "a"  # 0x8040B460 - 0x80414020
.balign 8
"@121":
  .4byte 0
"@127":
	.4byte 0x3F800000
"@148":
	.4byte 0x3F000000
	.4byte 0
"@165":
	.4byte 0x3FE00000
	.4byte 0
"@166":
	.4byte 0x40080000
	.4byte 0
"@167":
	.4byte 0x49800000
	.4byte 0