	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdrom_start_rw
_cdrom_start_rw:                        ## @cdrom_start_rw
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	8(%rdi), %r13
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_rq_data_dir
	movq	%rax, %r15
	movq	_WRITE@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	%r13, %rdi
	callq	_queue_logical_block_size
	movzwl	%ax, %ebx
	movq	_SECTOR_BITS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrl	%cl, %ebx
	movq	_IDE_DBG_RQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r12), %rax
	movl	(%rax), %edx
	movl	4(%r12), %ecx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %r8d
	callq	_ide_debug_log
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	cmpq	%r14, %r15
	jne	LBB0_3
## %bb.1:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edi
	callq	_get_disk_ro
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	_ide_stopped@GOTPCREL(%rip), %r13
	jmp	LBB0_9
LBB0_3:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	*(%r13)
LBB0_4:
	movq	%r12, %rdi
	callq	_blk_rq_sectors
	movzwl	%ax, %eax
	decl	%ebx
	movq	_ide_stopped@GOTPCREL(%rip), %r13
	testl	%eax, %ebx
	jne	LBB0_9
## %bb.5:
	movq	%r12, %rdi
	callq	_blk_rq_pos
	movzwl	%ax, %eax
	testl	%eax, %ebx
	jne	LBB0_9
## %bb.6:
	movq	_IDE_DFLAG_USING_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	andl	4(%rdx), %eax
	setne	%cl
	movl	%ecx, (%rdx)
	cmpq	%r14, -64(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_8
## %bb.7:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
LBB0_8:
	movq	_ATAPI_WAIT_PC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movq	_ide_started@GOTPCREL(%rip), %r13
LBB0_9:
	movl	(%r13), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WRITE,8,3                      ## @WRITE
	.comm	_SECTOR_BITS,2,1                ## @SECTOR_BITS
	.comm	_IDE_DBG_RQ,4,2                 ## @IDE_DBG_RQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rq->cmd[0]: 0x%x, rq->cmd_flags: 0x%x, secs_per_frame: %u"

	.comm	_ide_stopped,4,2                ## @ide_stopped
	.comm	_IDE_DFLAG_USING_DMA,4,2        ## @IDE_DFLAG_USING_DMA
	.comm	_ATAPI_WAIT_PC,4,2              ## @ATAPI_WAIT_PC
	.comm	_ide_started,4,2                ## @ide_started
	.no_dead_strip	_cdrom_start_rw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdrom_start_rw
_cdrom_start_rw:                        ; @cdrom_start_rw
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
	ldp	x23, x24, [x0, #8]
	mov	x0, x1
	bl	_rq_data_dir
	mov	x21, x0
Lloh0:
	adrp	x8, _WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WRITE@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x8]
	mov	x0, x23
	bl	_queue_logical_block_size
Lloh3:
	adrp	x8, _SECTOR_BITS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SECTOR_BITS@GOTPAGEOFF]
	ldrh	w8, [x8]
	lsr	w22, w0, w8
Lloh5:
	adrp	x8, _IDE_DBG_RQ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IDE_DBG_RQ@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
	ldr	w3, [x19, #4]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x4, x22
	bl	_ide_debug_log
	cmp	x21, x25
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x24, #4]
	bl	_get_disk_ro
	cbnz	x0, LBB0_5
	b	LBB0_3
LBB0_2:
	ldr	x8, [x23]
	mov	x0, x23
	mov	x1, x19
	blr	x8
LBB0_3:
	mov	x0, x19
	bl	_blk_rq_sectors
	sub	w22, w22, #1
	tst	w22, w0
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_blk_rq_pos
	tst	w22, w0
	b.eq	LBB0_7
LBB0_5:
Lloh10:
	adrp	x8, _ide_stopped@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ide_stopped@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
Lloh12:
	adrp	x8, _IDE_DFLAG_USING_DMA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IDE_DFLAG_USING_DMA@GOTPAGEOFF]
	ldr	w9, [x20, #4]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w9
	cset	w8, ne
	str	w8, [x20]
	cmp	x21, x25
	b.ne	LBB0_9
; %bb.8:
	mov	w8, #1
	str	w8, [x24]
LBB0_9:
Lloh15:
	adrp	x8, _ATAPI_WAIT_PC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ATAPI_WAIT_PC@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x19]
Lloh18:
	adrp	x8, _ide_started@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ide_started@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_WRITE,8,3                      ; @WRITE
	.comm	_SECTOR_BITS,2,1                ; @SECTOR_BITS
	.comm	_IDE_DBG_RQ,4,2                 ; @IDE_DBG_RQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rq->cmd[0]: 0x%x, rq->cmd_flags: 0x%x, secs_per_frame: %u"

	.comm	_ide_stopped,4,2                ; @ide_stopped
	.comm	_IDE_DFLAG_USING_DMA,4,2        ; @IDE_DFLAG_USING_DMA
	.comm	_ATAPI_WAIT_PC,4,2              ; @ATAPI_WAIT_PC
	.comm	_ide_started,4,2                ; @ide_started
	.no_dead_strip	_cdrom_start_rw
.subsections_via_symbols
