	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdrom_open_write
_cdrom_open_write:                      ## @cdrom_open_write
	.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
	movq	%rdi, %r14
	leaq	-40(%rbp), %rsi
	callq	_cdrom_is_mrw
	movl	%eax, %ebx
	movq	_CDC_MO_DRIVE@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	$1, -36(%rbp)
	jmp	LBB0_3
LBB0_2:
	leaq	-36(%rbp), %rsi
	movq	%r14, %rdi
	callq	_cdrom_is_random_writable
LBB0_3:
	movq	_CDC_MRW@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.5:
	orl	(%r14), %eax
	jmp	LBB0_6
LBB0_4:
	notl	%eax
	andl	(%r14), %eax
LBB0_6:
	movl	%eax, (%r14)
	cmpl	$0, -40(%rbp)
	movq	_CDC_MRW_W@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	je	LBB0_8
## %bb.7:
	notl	%edx
	andl	%edx, %eax
	jmp	LBB0_9
LBB0_8:
	orl	%edx, %eax
LBB0_9:
	movl	%eax, (%r14)
	cmpl	$0, -36(%rbp)
	movq	_CDC_RAM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	je	LBB0_11
## %bb.10:
	notl	%edx
	andl	%edx, %eax
	jmp	LBB0_12
LBB0_11:
	orl	%edx, %eax
LBB0_12:
	movl	%eax, (%r14)
	movl	(%rcx), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%r14, %rdi
	callq	_cdrom_mrw_open_write
	jmp	LBB0_22
LBB0_14:
	movq	_CDC_DVD_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	_cdrom_dvdram_open_write
	jmp	LBB0_22
LBB0_16:
	movl	(%rbx), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_19
## %bb.17:
	movq	_CDC_CD_R@GOTPCREL(%rip), %rax
	movq	_CDC_CD_RW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_CDC_DVD@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_CDC_DVD_R@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	orl	(%r12), %edi
	orl	(%r15), %edi
	callq	_CDROM_CAN
	testq	%rax, %rax
	je	LBB0_18
LBB0_19:
	movl	(%r15), %edi
	callq	_CDROM_CAN
	movq	%r14, %rdi
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	callq	_mo_open_write
	jmp	LBB0_22
LBB0_21:
	callq	_cdrom_is_dvd_rw
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	setne	%al
	jmp	LBB0_22
LBB0_18:
	movq	%r14, %rdi
	callq	_cdrom_ram_open_write
LBB0_22:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CDC_MO_DRIVE,4,2               ## @CDC_MO_DRIVE
	.comm	_CDC_MRW,4,2                    ## @CDC_MRW
	.comm	_CDC_MRW_W,4,2                  ## @CDC_MRW_W
	.comm	_CDC_RAM,4,2                    ## @CDC_RAM
	.comm	_CDC_DVD_RAM,4,2                ## @CDC_DVD_RAM
	.comm	_CDC_CD_R,4,2                   ## @CDC_CD_R
	.comm	_CDC_CD_RW,4,2                  ## @CDC_CD_RW
	.comm	_CDC_DVD,4,2                    ## @CDC_DVD
	.comm	_CDC_DVD_R,4,2                  ## @CDC_DVD_R
	.no_dead_strip	_cdrom_open_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdrom_open_write
_cdrom_open_write:                      ; @cdrom_open_write
	.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
	mov	x19, x0
	add	x1, sp, #12
	bl	_cdrom_is_mrw
	mov	x20, x0
Lloh0:
	adrp	x21, _CDC_MO_DRIVE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _CDC_MO_DRIVE@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_CDROM_CAN
	cbz	x0, LBB0_2
; %bb.1:
	mov	w8, #1
	str	w8, [sp, #8]
	b	LBB0_3
LBB0_2:
	add	x1, sp, #8
	mov	x0, x19
	bl	_cdrom_is_random_writable
LBB0_3:
Lloh2:
	adrp	x22, _CDC_MRW@GOTPAGE
Lloh3:
	ldr	x22, [x22, _CDC_MRW@GOTPAGEOFF]
	ldr	w8, [x22]
	cbz	w20, LBB0_5
; %bb.4:
	ldr	w9, [x19]
	orr	w9, w9, w8
	b	LBB0_6
LBB0_5:
	ldr	w9, [x19]
	bic	w9, w9, w8
LBB0_6:
	str	w9, [x19]
	ldr	w11, [sp, #12]
Lloh4:
	adrp	x8, _CDC_MRW_W@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CDC_MRW_W@GOTPAGEOFF]
	ldr	w10, [x8]
	cbz	w11, LBB0_8
; %bb.7:
	bic	w9, w9, w10
	b	LBB0_9
LBB0_8:
	orr	w9, w9, w10
LBB0_9:
	str	w9, [x19]
	ldr	w11, [sp, #8]
Lloh6:
	adrp	x20, _CDC_RAM@GOTPAGE
Lloh7:
	ldr	x20, [x20, _CDC_RAM@GOTPAGEOFF]
	ldr	w10, [x20]
	cbz	w11, LBB0_11
; %bb.10:
	bic	w9, w9, w10
	b	LBB0_12
LBB0_11:
	orr	w9, w9, w10
LBB0_12:
	str	w9, [x19]
	ldr	w0, [x8]
	bl	_CDROM_CAN
	cbz	x0, LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_cdrom_mrw_open_write
	b	LBB0_22
LBB0_14:
Lloh8:
	adrp	x8, _CDC_DVD_RAM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CDC_DVD_RAM@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_CDROM_CAN
	cbz	x0, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_cdrom_dvdram_open_write
	b	LBB0_22
LBB0_16:
	ldr	w0, [x20]
	bl	_CDROM_CAN
	cbz	x0, LBB0_18
; %bb.17:
Lloh11:
	adrp	x8, _CDC_CD_R@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CDC_CD_R@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _CDC_CD_RW@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CDC_CD_RW@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh17:
	adrp	x9, _CDC_DVD@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CDC_DVD@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh20:
	adrp	x9, _CDC_DVD_R@GOTPAGE
Lloh21:
	ldr	x9, [x9, _CDC_DVD_R@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x22]
	orr	w8, w8, w9
	ldr	w9, [x21]
	orr	w0, w8, w9
	bl	_CDROM_CAN
	cbz	x0, LBB0_21
LBB0_18:
	ldr	w0, [x21]
	bl	_CDROM_CAN
	cbz	x0, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_mo_open_write
	b	LBB0_22
LBB0_20:
	mov	x0, x19
	bl	_cdrom_is_dvd_rw
	cmp	w0, #0
	cset	w0, ne
	b	LBB0_22
LBB0_21:
	mov	x0, x19
	bl	_cdrom_ram_open_write
LBB0_22:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_CDC_MO_DRIVE,4,2               ; @CDC_MO_DRIVE
	.comm	_CDC_MRW,4,2                    ; @CDC_MRW
	.comm	_CDC_MRW_W,4,2                  ; @CDC_MRW_W
	.comm	_CDC_RAM,4,2                    ; @CDC_RAM
	.comm	_CDC_DVD_RAM,4,2                ; @CDC_DVD_RAM
	.comm	_CDC_CD_R,4,2                   ; @CDC_CD_R
	.comm	_CDC_CD_RW,4,2                  ; @CDC_CD_RW
	.comm	_CDC_DVD,4,2                    ; @CDC_DVD
	.comm	_CDC_DVD_R,4,2                  ; @CDC_DVD_R
	.no_dead_strip	_cdrom_open_write
.subsections_via_symbols
