	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdrom_open                     ## -- Begin function cdrom_open
	.p2align	4, 0x90
_cdrom_open:                            ## @cdrom_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_CD_OPEN@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_cdinfo
	incl	4(%rbx)
	movq	_FMODE_NDELAY@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_CDO_USE_FFLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.7:
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	*(%rax)
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
	jmp	LBB0_8
LBB0_2:
	movq	%rbx, %rdi
	callq	_open_for_data
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.3:
	movq	%rbx, %rdi
	callq	_cdrom_mmc3_profile
	movq	_FMODE_WRITE@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_8
## %bb.4:
	movq	_EROFS@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_cdrom_open_write
	testq	%rax, %rax
	je	LBB0_5
LBB0_9:
	movq	_CDC_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movq	_CDO_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.11:
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	*16(%rax)
	movl	(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_cdinfo
LBB0_12:
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	callq	*8(%rax)
LBB0_13:
	decl	4(%rbx)
	jmp	LBB0_14
LBB0_5:
	movq	_CDC_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	$0, 24(%rbx)
LBB0_8:
	movl	(%r13), %edi
	movl	4(%rbx), %ecx
	movl	16(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_cdinfo
	movq	%r14, %rdi
	callq	_check_disk_change
LBB0_14:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CD_OPEN,4,2                    ## @CD_OPEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entering cdrom_open\n"

	.comm	_FMODE_NDELAY,4,2               ## @FMODE_NDELAY
	.comm	_CDO_USE_FFLAGS,4,2             ## @CDO_USE_FFLAGS
	.comm	_FMODE_WRITE,4,2                ## @FMODE_WRITE
	.comm	_EROFS,4,2                      ## @EROFS
	.comm	_CDC_RAM,4,2                    ## @CDC_RAM
L_.str.1:                               ## @.str.1
	.asciz	"Use count for \"/dev/%s\" now %d\n"

	.comm	_CDC_LOCK,4,2                   ## @CDC_LOCK
	.comm	_CDO_LOCK,4,2                   ## @CDO_LOCK
L_.str.2:                               ## @.str.2
	.asciz	"door unlocked.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdrom_open                     ; -- Begin function cdrom_open
	.p2align	2
_cdrom_open:                            ; @cdrom_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _CD_OPEN@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CD_OPEN@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_cdinfo
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
Lloh4:
	adrp	x8, _FMODE_NDELAY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FMODE_NDELAY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_3
; %bb.1:
	ldr	w8, [x19]
Lloh7:
	adrp	x9, _CDO_USE_FFLAGS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _CDO_USE_FFLAGS@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	w1, #1
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_10
	b	LBB0_13
LBB0_3:
	mov	x0, x19
	bl	_open_for_data
	mov	x21, x0
	cbnz	w0, LBB0_10
; %bb.4:
	mov	x0, x19
	bl	_cdrom_mmc3_profile
Lloh10:
	adrp	x8, _FMODE_WRITE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FMODE_WRITE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_13
; %bb.5:
Lloh13:
	adrp	x8, _EROFS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_cdrom_open_write
	cbz	x0, LBB0_11
LBB0_6:
	neg	w21, w21
Lloh16:
	adrp	x8, _CDC_LOCK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CDC_LOCK@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_CDROM_CAN
	cbz	x0, LBB0_9
; %bb.7:
	ldr	w8, [x19]
Lloh19:
	adrp	x9, _CDO_LOCK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CDO_LOCK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #16]
	mov	x0, x19
	mov	w1, #0
	blr	x8
	ldr	w0, [x23]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_cdinfo
LBB0_9:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
LBB0_10:
	ldr	w8, [x19, #4]
	sub	w8, w8, #1
	str	w8, [x19, #4]
	b	LBB0_14
LBB0_11:
Lloh24:
	adrp	x8, _CDC_RAM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CDC_RAM@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	bl	_CDROM_CAN
	cbz	x0, LBB0_6
; %bb.12:
	str	xzr, [x19, #24]
LBB0_13:
	ldr	w0, [x23]
	ldr	w8, [x19, #16]
	ldr	w9, [x19, #4]
	stp	x8, x9, [sp]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_cdinfo
	mov	x0, x20
	bl	_check_disk_change
	mov	w21, #0
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CD_OPEN,4,2                    ; @CD_OPEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entering cdrom_open\n"

	.comm	_FMODE_NDELAY,4,2               ; @FMODE_NDELAY
	.comm	_CDO_USE_FFLAGS,4,2             ; @CDO_USE_FFLAGS
	.comm	_FMODE_WRITE,4,2                ; @FMODE_WRITE
	.comm	_EROFS,4,2                      ; @EROFS
	.comm	_CDC_RAM,4,2                    ; @CDC_RAM
l_.str.1:                               ; @.str.1
	.asciz	"Use count for \"/dev/%s\" now %d\n"

	.comm	_CDC_LOCK,4,2                   ; @CDC_LOCK
	.comm	_CDO_LOCK,4,2                   ; @CDO_LOCK
l_.str.2:                               ; @.str.2
	.asciz	"door unlocked.\n"

.subsections_via_symbols
