	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prepareCDVD
_prepareCDVD:                           ## @prepareCDVD
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_sceCdGetDiskType
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_sceCdGetDiskType
	movq	_SCECdUNKNOWN@GOTPCREL(%rip), %rcx
	movl	$1, %ebx
	cmpl	(%rcx), %eax
	jg	LBB0_10
## %bb.1:
	xorl	%eax, %eax
	callq	_cd_Timer
	movq	%rax, %rbx
	addq	$500, %rbx                      ## imm = 0x1F4
	movq	_SCECdNODISC@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_cd_Timer
	cmpq	%rbx, %rax
	jge	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_ps2_cdDiscValid
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	(%r15), %r14d
	jne	LBB0_2
## %bb.5:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_6:
	xorl	%ebx, %ebx
	cmpl	(%r15), %r14d
	je	LBB0_10
## %bb.7:
	movq	_SCECdPSCD@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jl	LBB0_9
## %bb.8:
	movq	_SCECdPS2DVD@GOTPCREL(%rip), %rax
	movl	$1, %ebx
	cmpl	(%rax), %r14d
	jle	LBB0_10
LBB0_9:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ps2_cdStop
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCECdUNKNOWN,4,2               ## @SCECdUNKNOWN
	.comm	_SCECdNODISC,4,2                ## @SCECdNODISC
	.comm	_SCECdPSCD,4,2                  ## @SCECdPSCD
	.comm	_SCECdPS2DVD,4,2                ## @SCECdPS2DVD
	.no_dead_strip	_prepareCDVD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prepareCDVD
_prepareCDVD:                           ; @prepareCDVD
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	bl	_sceCdGetDiskType
	mov	x19, x0
	bl	_sceCdGetDiskType
Lloh0:
	adrp	x8, _SCECdUNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCECdUNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_2
LBB0_1:
	mov	w0, #1
	b	LBB0_10
LBB0_2:
	bl	_cd_Timer
	add	x21, x0, #500
Lloh3:
	adrp	x20, _SCECdNODISC@GOTPAGE
Lloh4:
	ldr	x20, [x20, _SCECdNODISC@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	bl	_cd_Timer
	cmp	x0, x21
	b.ge	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_ps2_cdDiscValid
	cbnz	w0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x20]
	cmp	w19, w8
	b.ne	LBB0_3
	b	LBB0_9
LBB0_6:
	ldr	w8, [x20]
	cmp	w19, w8
	b.eq	LBB0_9
; %bb.7:
Lloh5:
	adrp	x8, _SCECdPSCD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SCECdPSCD@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _SCECdPS2DVD@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SCECdPS2DVD@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w19, w8
	ccmp	w19, w9, #0, ge
	b.le	LBB0_1
; %bb.8:
	bl	_ps2_cdStop
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SCECdUNKNOWN,4,2               ; @SCECdUNKNOWN
	.comm	_SCECdNODISC,4,2                ; @SCECdNODISC
	.comm	_SCECdPSCD,4,2                  ; @SCECdPSCD
	.comm	_SCECdPS2DVD,4,2                ; @SCECdPS2DVD
	.no_dead_strip	_prepareCDVD
.subsections_via_symbols
