.include "macros.inc"

.section .bss
.global lbl_80540BF8
lbl_80540BF8:
	.skip 0x20
	
.section .text, "ax"

.global __DVDClearWaitingQueue
__DVDClearWaitingQueue:
/* 803748B8 00371818  3C 60 80 54 */	lis r3, lbl_80540BF8@ha
/* 803748BC 0037181C  38 63 0B F8 */	addi r3, r3, lbl_80540BF8@l
/* 803748C0 00371820  90 63 00 00 */	stw r3, 0(r3)
/* 803748C4 00371824  38 A3 00 08 */	addi r5, r3, 8
/* 803748C8 00371828  38 83 00 10 */	addi r4, r3, 0x10
/* 803748CC 0037182C  90 63 00 04 */	stw r3, 4(r3)
/* 803748D0 00371830  38 63 00 18 */	addi r3, r3, 0x18
/* 803748D4 00371834  90 A5 00 00 */	stw r5, 0(r5)
/* 803748D8 00371838  90 A5 00 04 */	stw r5, 4(r5)
/* 803748DC 0037183C  90 84 00 00 */	stw r4, 0(r4)
/* 803748E0 00371840  90 84 00 04 */	stw r4, 4(r4)
/* 803748E4 00371844  90 63 00 00 */	stw r3, 0(r3)
/* 803748E8 00371848  90 63 00 04 */	stw r3, 4(r3)
/* 803748EC 0037184C  4E 80 00 20 */	blr 

.global __DVDPushWaitingQueue
__DVDPushWaitingQueue:
/* 803748F0 00371850  7C 08 02 A6 */	mflr r0
/* 803748F4 00371854  90 01 00 04 */	stw r0, 4(r1)
/* 803748F8 00371858  94 21 FF E8 */	stwu r1, -0x18(r1)
/* 803748FC 0037185C  93 E1 00 14 */	stw r31, 0x14(r1)
/* 80374900 00371860  3B E4 00 00 */	addi r31, r4, 0
/* 80374904 00371864  93 C1 00 10 */	stw r30, 0x10(r1)
/* 80374908 00371868  3B C3 00 00 */	addi r30, r3, 0
/* 8037490C 0037186C  48 00 CD 55 */	bl OSDisableInterrupts
/* 80374910 00371870  3C 80 80 54 */	lis r4, lbl_80540BF8@ha
/* 80374914 00371874  57 C5 18 38 */	slwi r5, r30, 3
/* 80374918 00371878  38 04 0B F8 */	addi r0, r4, lbl_80540BF8@l
/* 8037491C 0037187C  7C A0 2A 14 */	add r5, r0, r5
/* 80374920 00371880  80 85 00 04 */	lwz r4, 4(r5)
/* 80374924 00371884  93 E4 00 00 */	stw r31, 0(r4)
/* 80374928 00371888  80 05 00 04 */	lwz r0, 4(r5)
/* 8037492C 0037188C  90 1F 00 04 */	stw r0, 4(r31)
/* 80374930 00371890  90 BF 00 00 */	stw r5, 0(r31)
/* 80374934 00371894  93 E5 00 04 */	stw r31, 4(r5)
/* 80374938 00371898  48 00 CD 51 */	bl OSRestoreInterrupts
/* 8037493C 0037189C  80 01 00 1C */	lwz r0, 0x1c(r1)
/* 80374940 003718A0  38 60 00 01 */	li r3, 1
/* 80374944 003718A4  83 E1 00 14 */	lwz r31, 0x14(r1)
/* 80374948 003718A8  83 C1 00 10 */	lwz r30, 0x10(r1)
/* 8037494C 003718AC  38 21 00 18 */	addi r1, r1, 0x18
/* 80374950 003718B0  7C 08 03 A6 */	mtlr r0
/* 80374954 003718B4  4E 80 00 20 */	blr 

.global __DVDPopWaitingQueue
__DVDPopWaitingQueue:
/* 80374958 003718B8  7C 08 02 A6 */	mflr r0
/* 8037495C 003718BC  90 01 00 04 */	stw r0, 4(r1)
/* 80374960 003718C0  94 21 FF F0 */	stwu r1, -0x10(r1)
/* 80374964 003718C4  93 E1 00 0C */	stw r31, 0xc(r1)
/* 80374968 003718C8  48 00 CC F9 */	bl OSDisableInterrupts
/* 8037496C 003718CC  38 00 00 04 */	li r0, 4
/* 80374970 003718D0  3C 80 80 54 */	lis r4, lbl_80540BF8@ha
/* 80374974 003718D4  7C 09 03 A6 */	mtctr r0
/* 80374978 003718D8  38 84 0B F8 */	addi r4, r4, lbl_80540BF8@l
/* 8037497C 003718DC  3B E0 00 00 */	li r31, 0
lbl_80374980:
/* 80374980 003718E0  80 04 00 00 */	lwz r0, 0(r4)
/* 80374984 003718E4  7C 00 20 40 */	cmplw r0, r4
/* 80374988 003718E8  41 82 00 48 */	beq lbl_803749D0
/* 8037498C 003718EC  48 00 CC FD */	bl OSRestoreInterrupts
/* 80374990 003718F0  48 00 CC D1 */	bl OSDisableInterrupts
/* 80374994 003718F4  3C 80 80 54 */	lis r4, lbl_80540BF8@ha
/* 80374998 003718F8  57 E5 18 38 */	slwi r5, r31, 3
/* 8037499C 003718FC  38 04 0B F8 */	addi r0, r4, lbl_80540BF8@l
/* 803749A0 00371900  7C A0 2A 14 */	add r5, r0, r5
/* 803749A4 00371904  83 E5 00 00 */	lwz r31, 0(r5)
/* 803749A8 00371908  80 1F 00 00 */	lwz r0, 0(r31)
/* 803749AC 0037190C  90 05 00 00 */	stw r0, 0(r5)
/* 803749B0 00371910  80 9F 00 00 */	lwz r4, 0(r31)
/* 803749B4 00371914  90 A4 00 04 */	stw r5, 4(r4)
/* 803749B8 00371918  48 00 CC D1 */	bl OSRestoreInterrupts
/* 803749BC 0037191C  38 00 00 00 */	li r0, 0
/* 803749C0 00371920  90 1F 00 00 */	stw r0, 0(r31)
/* 803749C4 00371924  7F E3 FB 78 */	mr r3, r31
/* 803749C8 00371928  90 1F 00 04 */	stw r0, 4(r31)
/* 803749CC 0037192C  48 00 00 18 */	b lbl_803749E4
lbl_803749D0:
/* 803749D0 00371930  38 84 00 08 */	addi r4, r4, 8
/* 803749D4 00371934  3B FF 00 01 */	addi r31, r31, 1
/* 803749D8 00371938  42 00 FF A8 */	bdnz lbl_80374980
/* 803749DC 0037193C  48 00 CC AD */	bl OSRestoreInterrupts
/* 803749E0 00371940  38 60 00 00 */	li r3, 0
lbl_803749E4:
/* 803749E4 00371944  80 01 00 14 */	lwz r0, 0x14(r1)
/* 803749E8 00371948  83 E1 00 0C */	lwz r31, 0xc(r1)
/* 803749EC 0037194C  38 21 00 10 */	addi r1, r1, 0x10
/* 803749F0 00371950  7C 08 03 A6 */	mtlr r0
/* 803749F4 00371954  4E 80 00 20 */	blr 

.global __DVDCheckWaitingQueue
__DVDCheckWaitingQueue:
/* 803749F8 00371958  7C 08 02 A6 */	mflr r0
/* 803749FC 0037195C  90 01 00 04 */	stw r0, 4(r1)
/* 80374A00 00371960  94 21 FF F8 */	stwu r1, -8(r1)
/* 80374A04 00371964  48 00 CC 5D */	bl OSDisableInterrupts
/* 80374A08 00371968  38 00 00 04 */	li r0, 4
/* 80374A0C 0037196C  3C 80 80 54 */	lis r4, lbl_80540BF8@ha
/* 80374A10 00371970  7C 09 03 A6 */	mtctr r0
/* 80374A14 00371974  38 84 0B F8 */	addi r4, r4, lbl_80540BF8@l
lbl_80374A18:
/* 80374A18 00371978  80 04 00 00 */	lwz r0, 0(r4)
/* 80374A1C 0037197C  7C 00 20 40 */	cmplw r0, r4
/* 80374A20 00371980  41 82 00 10 */	beq lbl_80374A30
/* 80374A24 00371984  48 00 CC 65 */	bl OSRestoreInterrupts
/* 80374A28 00371988  38 60 00 01 */	li r3, 1
/* 80374A2C 0037198C  48 00 00 14 */	b lbl_80374A40
lbl_80374A30:
/* 80374A30 00371990  38 84 00 08 */	addi r4, r4, 8
/* 80374A34 00371994  42 00 FF E4 */	bdnz lbl_80374A18
/* 80374A38 00371998  48 00 CC 51 */	bl OSRestoreInterrupts
/* 80374A3C 0037199C  38 60 00 00 */	li r3, 0
lbl_80374A40:
/* 80374A40 003719A0  80 01 00 0C */	lwz r0, 0xc(r1)
/* 80374A44 003719A4  38 21 00 08 */	addi r1, r1, 8
/* 80374A48 003719A8  7C 08 03 A6 */	mtlr r0
/* 80374A4C 003719AC  4E 80 00 20 */	blr 

.global __DVDDequeueWaitingQueue
__DVDDequeueWaitingQueue:
/* 80374A50 003719B0  7C 08 02 A6 */	mflr r0
/* 80374A54 003719B4  90 01 00 04 */	stw r0, 4(r1)
/* 80374A58 003719B8  94 21 FF E8 */	stwu r1, -0x18(r1)
/* 80374A5C 003719BC  93 E1 00 14 */	stw r31, 0x14(r1)
/* 80374A60 003719C0  7C 7F 1B 78 */	mr r31, r3
/* 80374A64 003719C4  48 00 CB FD */	bl OSDisableInterrupts
/* 80374A68 003719C8  80 9F 00 04 */	lwz r4, 4(r31)
/* 80374A6C 003719CC  80 BF 00 00 */	lwz r5, 0(r31)
/* 80374A70 003719D0  28 04 00 00 */	cmplwi r4, 0
/* 80374A74 003719D4  41 82 00 0C */	beq lbl_80374A80
/* 80374A78 003719D8  28 05 00 00 */	cmplwi r5, 0
/* 80374A7C 003719DC  40 82 00 10 */	bne lbl_80374A8C
lbl_80374A80:
/* 80374A80 003719E0  48 00 CC 09 */	bl OSRestoreInterrupts
/* 80374A84 003719E4  38 60 00 00 */	li r3, 0
/* 80374A88 003719E8  48 00 00 14 */	b lbl_80374A9C
lbl_80374A8C:
/* 80374A8C 003719EC  90 A4 00 00 */	stw r5, 0(r4)
/* 80374A90 003719F0  90 85 00 04 */	stw r4, 4(r5)
/* 80374A94 003719F4  48 00 CB F5 */	bl OSRestoreInterrupts
/* 80374A98 003719F8  38 60 00 01 */	li r3, 1
lbl_80374A9C:
/* 80374A9C 003719FC  80 01 00 1C */	lwz r0, 0x1c(r1)
/* 80374AA0 00371A00  83 E1 00 14 */	lwz r31, 0x14(r1)
/* 80374AA4 00371A04  38 21 00 18 */	addi r1, r1, 0x18
/* 80374AA8 00371A08  7C 08 03 A6 */	mtlr r0
/* 80374AAC 00371A0C  4E 80 00 20 */	blr