	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdrom_release                  ## -- Begin function cdrom_release
	.p2align	4, 0x90
_cdrom_release:                         ## @cdrom_release
	.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
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	32(%rdi), %r15
	movq	_CD_CLOSE@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_cdinfo
	movq	(%rbx), %rax
	testq	%rax, %rax
	jle	LBB0_3
## %bb.2:
	decq	%rax
	movq	%rax, (%rbx)
LBB0_3:
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movl	(%r12), %edi
	movl	24(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_cdinfo
	movq	%rbx, %rdi
	callq	_cdrom_dvd_rw_close_write
	movq	_CDC_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_7
## %bb.5:
	movq	_keeplocked@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_7
## %bb.6:
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_cdinfo
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	*24(%r15)
LBB0_7:
	movq	_CDO_USE_FFLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%rbx), %eax
	sete	%al
	movq	_FMODE_NDELAY@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r14d
	sete	%r14b
	orb	%al, %r14b
	movq	_CDC_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	cmpq	$0, (%rbx)
	jne	LBB0_11
## %bb.9:
	cmpq	$0, 16(%rbx)
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_cdrom_close_write
LBB0_11:
	movq	%rbx, %rdi
	callq	*16(%r15)
	cmpq	$0, (%rbx)
	sete	%al
	andb	%r14b, %al
	cmpb	$1, %al
	jne	LBB0_14
## %bb.12:
	movq	_CDO_AUTO_EJECT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_14
## %bb.13:
	movq	_CDC_OPEN_TRAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	8(%r15), %rax
	movq	%rbx, %rdi
	movl	$1, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_14:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CD_CLOSE,4,2                   ## @CD_CLOSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entering cdrom_release\n"

L_.str.1:                               ## @.str.1
	.asciz	"Use count for \"/dev/%s\" now zero\n"

	.comm	_CDC_LOCK,4,2                   ## @CDC_LOCK
	.comm	_keeplocked,4,2                 ## @keeplocked
L_.str.2:                               ## @.str.2
	.asciz	"Unlocking door!\n"

	.comm	_CDO_USE_FFLAGS,4,2             ## @CDO_USE_FFLAGS
	.comm	_FMODE_NDELAY,4,2               ## @FMODE_NDELAY
	.comm	_CDC_RAM,4,2                    ## @CDC_RAM
	.comm	_CDO_AUTO_EJECT,4,2             ## @CDO_AUTO_EJECT
	.comm	_CDC_OPEN_TRAY,4,2              ## @CDC_OPEN_TRAY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdrom_release                  ; -- Begin function cdrom_release
	.p2align	2
_cdrom_release:                         ; @cdrom_release
	.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
	cbz	x0, LBB0_14
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #32]
Lloh0:
	adrp	x22, _CD_CLOSE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CD_CLOSE@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_cdinfo
	ldr	x8, [x19]
	subs	x9, x8, #1
	b.lt	LBB0_3
; %bb.2:
	str	x9, [x19]
	mov	x8, x9
LBB0_3:
	cbnz	x8, LBB0_6
; %bb.4:
	ldr	w0, [x22]
	ldr	w8, [x19, #24]
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_cdinfo
	mov	x0, x19
	bl	_cdrom_dvd_rw_close_write
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _CDC_LOCK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CDC_LOCK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh9:
	adrp	x9, _keeplocked@GOTPAGE
Lloh10:
	ldr	x9, [x9, _keeplocked@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, #0
	ccmp	w9, #0, #0, ne
	b.ne	LBB0_6
; %bb.5:
	ldr	w0, [x22]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_cdinfo
	ldr	x8, [x21, #24]
	mov	x0, x19
	mov	w1, #0
	blr	x8
LBB0_6:
	ldr	w8, [x19, #8]
Lloh14:
	adrp	x9, _CDO_USE_FFLAGS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CDO_USE_FFLAGS@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, eq
Lloh17:
	adrp	x9, _FMODE_NDELAY@GOTPAGE
Lloh18:
	ldr	x9, [x9, _FMODE_NDELAY@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w20
	cset	w9, eq
	orr	w20, w8, w9
Lloh20:
	adrp	x8, _CDC_RAM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CDC_RAM@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_CDROM_CAN
	cbz	x0, LBB0_10
; %bb.7:
	ldr	x8, [x19]
	cbnz	x8, LBB0_10
; %bb.8:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_cdrom_close_write
LBB0_10:
	ldr	x8, [x21, #16]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w8, eq
	and	w8, w8, w20
	cmp	w8, #1
	b.ne	LBB0_14
; %bb.11:
	ldr	w8, [x19, #8]
Lloh23:
	adrp	x9, _CDO_AUTO_EJECT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _CDO_AUTO_EJECT@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.12:
Lloh26:
	adrp	x8, _CDC_OPEN_TRAY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CDC_OPEN_TRAY@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_CDROM_CAN
	cbz	x0, LBB0_14
; %bb.13:
	ldr	x2, [x21, #8]
	mov	x0, x19
	mov	w1, #1
	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
	br	x2
LBB0_14:
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CD_CLOSE,4,2                   ; @CD_CLOSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entering cdrom_release\n"

l_.str.1:                               ; @.str.1
	.asciz	"Use count for \"/dev/%s\" now zero\n"

	.comm	_CDC_LOCK,4,2                   ; @CDC_LOCK
	.comm	_keeplocked,4,2                 ; @keeplocked
l_.str.2:                               ; @.str.2
	.asciz	"Unlocking door!\n"

	.comm	_CDO_USE_FFLAGS,4,2             ; @CDO_USE_FFLAGS
	.comm	_FMODE_NDELAY,4,2               ; @FMODE_NDELAY
	.comm	_CDC_RAM,4,2                    ; @CDC_RAM
	.comm	_CDO_AUTO_EJECT,4,2             ; @CDO_AUTO_EJECT
	.comm	_CDC_OPEN_TRAY,4,2              ; @CDC_OPEN_TRAY
.subsections_via_symbols
