	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ide_cd_do_request
_ide_cd_do_request:                     ## @ide_cd_do_request
	.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	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rcx
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_IDE_DBG_RQ@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	8(%rsi), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_ide_debug_log
	movl	(%r15), %eax
	testl	%eax, (%r14)
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_blk_dump_rq_flags
LBB0_2:
	movq	%rbx, %rdi
	callq	_req_op
                                        ## kill: def $eax killed $eax def $rax
	leal	-128(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_7
## %bb.3:
	addl	$-130, %eax
	cmpl	$2, %eax
	jae	LBB0_4
## %bb.10:
	movq	%rbx, %rdi
	callq	_ide_req
	movl	(%rax), %eax
	leal	-132(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_11
LBB0_7:
	cmpl	$0, (%rbx)
	jne	LBB0_9
## %bb.8:
	movq	_ATAPI_WAIT_PC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_9:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_cdrom_do_block_pc
LBB0_14:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ide_prep_sense
	leaq	-40(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%rbx, %rdi
	callq	_rq_data_dir
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	_IDE_TFLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -32(%rbp)
LBB0_16:
	movq	%rbx, -40(%rbp)
	movq	%rbx, %rdi
	callq	_blk_rq_is_passthrough
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movq	%rbx, %rdi
	callq	_blk_rq_bytes
	testq	%rax, %rax
	je	LBB0_19
LBB0_18:
	movq	%rbx, %rdi
	callq	_blk_rq_bytes
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ide_init_sg_cmd
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ide_map_sg
LBB0_19:
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ide_issue_pc
	jmp	LBB0_22
LBB0_11:
	cmpl	$134, %eax
	jne	LBB0_13
## %bb.12:
	xorl	%r15d, %r15d
	jmp	LBB0_5
LBB0_4:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_cdrom_start_rw
	movq	_ide_stopped@GOTPCREL(%rip), %rcx
	movb	$1, %r15b
	cmpl	(%rcx), %eax
	jne	LBB0_14
LBB0_5:
	movq	%rbx, %rdi
	callq	_blk_rq_sectors
	testb	%r15b, %r15b
	je	LBB0_6
## %bb.20:
	movq	_BLK_STS_IOERR@GOTPCREL(%rip), %rcx
	jmp	LBB0_21
LBB0_13:
	xorl	%eax, %eax
	callq	_BUG
	jmp	LBB0_14
LBB0_6:
	movq	_BLK_STS_OK@GOTPCREL(%rip), %rcx
LBB0_21:
	movl	%eax, %edi
	shll	$9, %edi
	testl	%eax, %eax
	movl	(%rcx), %esi
	movl	$512, %edx                      ## imm = 0x200
	cmovnel	%edi, %edx
	movq	%r14, %rdi
	callq	_ide_complete_rq
	movq	_ide_stopped@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_DBG_RQ,4,2                 ## @IDE_DBG_RQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cmd: 0x%x, block: %llu"

L_.str.1:                               ## @.str.1
	.asciz	"ide_cd_do_request"

	.comm	_ide_stopped,4,2                ## @ide_stopped
	.comm	_ATAPI_WAIT_PC,4,2              ## @ATAPI_WAIT_PC
	.comm	_IDE_TFLAG_WRITE,4,2            ## @IDE_TFLAG_WRITE
	.comm	_BLK_STS_OK,4,2                 ## @BLK_STS_OK
	.comm	_BLK_STS_IOERR,4,2              ## @BLK_STS_IOERR
	.no_dead_strip	_ide_cd_do_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ide_cd_do_request
_ide_cd_do_request:                     ; @ide_cd_do_request
	.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	x3, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _IDE_DBG_RQ@GOTPAGE
Lloh1:
	ldr	x21, [x21, _IDE_DBG_RQ@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	x8, [x1, #8]
	ldr	w2, [x8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ide_debug_log
	ldr	w8, [x19]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_blk_dump_rq_flags
LBB0_2:
	mov	x0, x20
	bl	_req_op
	sub	w8, w0, #128
	cmp	w8, #2
	b.lo	LBB0_5
; %bb.3:
	sub	w8, w0, #130
	cmp	w8, #2
	b.hs	LBB0_14
; %bb.4:
	mov	x0, x20
	bl	_ide_req
	ldr	w8, [x0]
	sub	w9, w8, #132
	cmp	w9, #2
	b.hs	LBB0_16
LBB0_5:
	ldr	w8, [x20]
	cbnz	w8, LBB0_7
; %bb.6:
Lloh6:
	adrp	x8, _ATAPI_WAIT_PC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATAPI_WAIT_PC@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	bl	_cdrom_do_block_pc
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	bl	_ide_prep_sense
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	x0, x20
	bl	_rq_data_dir
	cbz	x0, LBB0_10
; %bb.9:
Lloh9:
	adrp	x8, _IDE_TFLAG_WRITE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IDE_TFLAG_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [sp, #8]
	orr	w8, w9, w8
	str	w8, [sp, #8]
LBB0_10:
	str	x20, [sp]
	mov	x0, x20
	bl	_blk_rq_is_passthrough
	cbz	w0, LBB0_12
; %bb.11:
	mov	x0, x20
	bl	_blk_rq_bytes
	cbz	x0, LBB0_13
LBB0_12:
	mov	x0, x20
	bl	_blk_rq_bytes
	mov	x1, x0
	mov	x0, sp
	bl	_ide_init_sg_cmd
	mov	x1, sp
	mov	x0, x19
	bl	_ide_map_sg
LBB0_13:
	mov	x1, sp
	mov	x0, x19
	bl	_ide_issue_pc
	b	LBB0_19
LBB0_14:
	mov	x0, x19
	mov	x1, x20
	bl	_cdrom_start_rw
Lloh12:
	adrp	x8, _ide_stopped@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ide_stopped@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.15:
	mov	w21, #1
	b	LBB0_18
LBB0_16:
	cmp	w8, #134
	b.ne	LBB0_20
; %bb.17:
	mov	w21, #0
LBB0_18:
	mov	x0, x20
	bl	_blk_rq_sectors
Lloh15:
	adrp	x8, _BLK_STS_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BLK_STS_OK@GOTPAGEOFF]
Lloh17:
	adrp	x9, _BLK_STS_IOERR@GOTPAGE
Lloh18:
	ldr	x9, [x9, _BLK_STS_IOERR@GOTPAGEOFF]
	cmp	w21, #0
	csel	x8, x9, x8, ne
	ldr	w1, [x8]
	lsl	w8, w0, #9
	mov	w9, #512
	cmp	w0, #0
	csel	w2, w9, w8, eq
	mov	x0, x19
	bl	_ide_complete_rq
Lloh19:
	adrp	x8, _ide_stopped@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ide_stopped@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
LBB0_19:
	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
LBB0_20:
	bl	_BUG
	b	LBB0_8
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_DBG_RQ,4,2                 ; @IDE_DBG_RQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cmd: 0x%x, block: %llu"

l_.str.1:                               ; @.str.1
	.asciz	"ide_cd_do_request"

	.comm	_ide_stopped,4,2                ; @ide_stopped
	.comm	_ATAPI_WAIT_PC,4,2              ; @ATAPI_WAIT_PC
	.comm	_IDE_TFLAG_WRITE,4,2            ; @IDE_TFLAG_WRITE
	.comm	_BLK_STS_OK,4,2                 ; @BLK_STS_OK
	.comm	_BLK_STS_IOERR,4,2              ; @BLK_STS_IOERR
	.no_dead_strip	_ide_cd_do_request
.subsections_via_symbols
