	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdrom_read_mech_status
_cdrom_read_mech_status:                ## @cdrom_read_mech_status
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.1:
	movl	$3, 8(%rsi)
	xorl	%eax, %eax
	cmpl	$3, %ecx
	cmovel	%eax, %ecx
	movl	%ecx, 12(%rsi)
	movq	(%rsi), %rcx
	movl	$1, (%rcx)
	movq	$0, 8(%rcx)
	movl	$1, 16(%rcx)
	movq	$0, 24(%rcx)
	movl	$1, 32(%rcx)
	movq	$0, 40(%rcx)
	jmp	LBB0_3
LBB0_2:
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	movl	4(%rdi), %eax
	leal	4(,%rax,4), %r12d
	movq	_CGC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-40(%rbp), %r14
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_init_cdrom_command
	movq	_GPCMD_MECHANISM_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-40(%rbp), %rcx
	movl	%eax, (%rcx)
	movl	%r12d, %edx
	movzbl	%dh, %eax
	movl	%eax, 32(%rcx)
	movzbl	%dl, %eax
	movl	%eax, 36(%rcx)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	*(%r15)
LBB0_3:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CGC_DATA_READ,4,2              ## @CGC_DATA_READ
	.comm	_GPCMD_MECHANISM_STATUS,4,2     ## @GPCMD_MECHANISM_STATUS
	.no_dead_strip	_cdrom_read_mech_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdrom_read_mech_status
_cdrom_read_mech_status:                ; @cdrom_read_mech_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w0, #0
	mov	w9, #3
	cmp	w8, #3
	csel	w8, wzr, w8, eq
	stp	w9, w8, [x1, #8]
	ldr	x8, [x1]
	mov	w9, #1
	str	w9, [x8]
	str	xzr, [x8, #8]
	str	w9, [x8, #16]
	str	xzr, [x8, #24]
	str	w9, [x8, #32]
	str	xzr, [x8, #40]
	b	LBB0_3
LBB0_2:
	mov	x19, x0
	ldr	x21, [x0, #8]
	ldr	w8, [x0, #4]
	lsl	w8, w8, #2
	add	w20, w8, #4
Lloh0:
	adrp	x8, _CGC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CGC_DATA_READ@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	add	x0, sp, #8
	mov	x2, x20
	bl	_init_cdrom_command
Lloh3:
	adrp	x8, _GPCMD_MECHANISM_STATUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GPCMD_MECHANISM_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	x9, [sp, #8]
	str	w8, [x9]
	ubfx	w8, w20, #8, #8
	and	w10, w20, #0xfc
	stp	w8, w10, [x9, #32]
	ldr	x8, [x21]
	add	x1, sp, #8
	mov	x0, x19
	blr	x8
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CGC_DATA_READ,4,2              ; @CGC_DATA_READ
	.comm	_GPCMD_MECHANISM_STATUS,4,2     ; @GPCMD_MECHANISM_STATUS
	.no_dead_strip	_cdrom_read_mech_status
.subsections_via_symbols
