	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mo_open_write
_mo_open_write:                         ## @mo_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	%rbx
	subq	$280, %rsp                      ## imm = 0x118
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_CGC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-296(%rbp), %rbx
	leaq	-288(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_init_cdrom_command
	movl	$1, -296(%rbp)
	movq	_GPMODE_ALL_PAGES@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_cdrom_mode_sense
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movq	_GPMODE_VENDOR_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-296(%rbp), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_cdrom_mode_sense
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	$255, -292(%rbp)
	movl	(%r15), %edx
	leaq	-296(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_cdrom_mode_sense
	testl	%eax, %eax
	jne	LBB0_4
LBB0_3:
	movzbl	-285(%rbp), %ebx
	andl	$-128, %ebx
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	movl	%ebx, %eax
	addq	$280, %rsp                      ## imm = 0x118
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CGC_DATA_READ,4,2              ## @CGC_DATA_READ
	.comm	_GPMODE_ALL_PAGES,4,2           ## @GPMODE_ALL_PAGES
	.comm	_GPMODE_VENDOR_PAGE,4,2         ## @GPMODE_VENDOR_PAGE
	.no_dead_strip	_mo_open_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mo_open_write
_mo_open_write:                         ; @mo_open_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #320
	.cfi_def_cfa_offset 320
	stp	x28, x27, [sp, #272]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #288]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #304]            ; 16-byte Folded Spill
	add	x29, sp, #304
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w27, -40
	.cfi_offset w28, -48
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _CGC_DATA_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CGC_DATA_READ@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, sp
	add	x1, sp, #9
	mov	w2, #4
	bl	_init_cdrom_command
	mov	w8, #1
	str	w8, [sp]
Lloh6:
	adrp	x20, _GPMODE_ALL_PAGES@GOTPAGE
Lloh7:
	ldr	x20, [x20, _GPMODE_ALL_PAGES@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x1, sp
	mov	x0, x19
	mov	w3, #0
	bl	_cdrom_mode_sense
	cbz	w0, LBB0_3
; %bb.1:
Lloh8:
	adrp	x8, _GPMODE_VENDOR_PAGE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GPMODE_VENDOR_PAGE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x1, sp
	mov	x0, x19
	mov	w3, #0
	bl	_cdrom_mode_sense
	cbz	w0, LBB0_3
; %bb.2:
	mov	w8, #255
	str	w8, [sp, #4]
	ldr	w2, [x20]
	mov	x1, sp
	mov	x0, x19
	mov	w3, #0
	bl	_cdrom_mode_sense
	mov	x8, x0
	mov	w0, #0
	cbnz	w8, LBB0_4
LBB0_3:
	ldrb	w8, [sp, #12]
	and	w0, w8, #0x80
LBB0_4:
	ldur	x8, [x29, #-40]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #304]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #288]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #272]            ; 16-byte Folded Reload
	add	sp, sp, #320
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_CGC_DATA_READ,4,2              ; @CGC_DATA_READ
	.comm	_GPMODE_ALL_PAGES,4,2           ; @GPMODE_ALL_PAGES
	.comm	_GPMODE_VENDOR_PAGE,4,2         ; @GPMODE_VENDOR_PAGE
	.no_dead_strip	_mo_open_write
.subsections_via_symbols
