	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function idecd_open
_idecd_open:                            ## @idecd_open
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	callq	_check_disk_change
	movq	_ide_cd_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	(%r15), %edi
	callq	_ide_cd_get
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r12
	movq	%rax, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_cdrom_open
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_3
## %bb.2:
	movq	%r12, %rdi
	callq	_ide_cd_put
LBB0_3:
	movq	_ide_cd_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_ide_cd_mutex,4,2               ## @ide_cd_mutex
	.no_dead_strip	_idecd_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function idecd_open
_idecd_open:                            ; @idecd_open
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	bl	_check_disk_change
Lloh3:
	adrp	x0, _ide_cd_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _ide_cd_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	w0, [x20]
	bl	_ide_cd_get
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	x1, x20
	mov	x2, x19
	bl	_cdrom_open
	mov	x19, x0
	tbz	w0, #31, LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_ide_cd_put
	b	LBB0_4
LBB0_3:
	neg	w19, w22
LBB0_4:
Lloh5:
	adrp	x0, _ide_cd_mutex@GOTPAGE
Lloh6:
	ldr	x0, [x0, _ide_cd_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_ide_cd_mutex,4,2               ; @ide_cd_mutex
	.no_dead_strip	_idecd_open
.subsections_via_symbols
