	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_rwcmd_protocol
_ata_rwcmd_protocol:                    ## @ata_rwcmd_protocol
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %edx
	movq	_ATA_TFLAG_FUA@GOTPCREL(%rip), %rcx
	xorl	%r11d, %r11d
	testl	%edx, (%rcx)
	setne	%r11b
	shlq	$2, %r11
	movq	_ATA_TFLAG_LBA48@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	xorl	%ecx, %ecx
	testl	%edx, %r9d
	setne	%cl
	addq	%rcx, %rcx
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %r10
	xorl	%r8d, %r8d
	testl	%edx, (%r10)
	setne	%r8b
	movq	_ATA_DFLAG_PIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_2
LBB0_1:
	movq	_ATA_PROT_PIO@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rdi)
	xorl	%edx, %edx
	cmpq	$0, 8(%rsi)
	sete	%dl
	shlq	$3, %rdx
	jmp	LBB0_5
LBB0_2:
	testl	%edx, %r9d
	je	LBB0_4
## %bb.3:
	movq	16(%rsi), %rax
	movq	(%rax), %rax
	movq	_ATA_FLAG_PIO_LBA48@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rax)
	jne	LBB0_1
LBB0_4:
	movq	_ATA_PROT_DMA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rdi)
	movl	$16, %edx
LBB0_5:
	movq	_ata_rw_cmds@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	orq	%r11, %rcx
	orq	%r8, %rcx
	orq	%rdx, %rcx
	movq	(%rax,%rcx,8), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, 8(%rdi)
	xorl	%eax, %eax
	popq	%rbp
	retq
LBB0_6:
	movl	$-1, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_TFLAG_FUA,4,2              ## @ATA_TFLAG_FUA
	.comm	_ATA_TFLAG_LBA48,4,2            ## @ATA_TFLAG_LBA48
	.comm	_ATA_TFLAG_WRITE,4,2            ## @ATA_TFLAG_WRITE
	.comm	_ATA_DFLAG_PIO,4,2              ## @ATA_DFLAG_PIO
	.comm	_ATA_PROT_PIO,8,3               ## @ATA_PROT_PIO
	.comm	_ATA_FLAG_PIO_LBA48,4,2         ## @ATA_FLAG_PIO_LBA48
	.comm	_ATA_PROT_DMA,8,3               ## @ATA_PROT_DMA
	.comm	_ata_rw_cmds,8,3                ## @ata_rw_cmds
	.no_dead_strip	_ata_rwcmd_protocol
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_rwcmd_protocol
_ata_rwcmd_protocol:                    ; @ata_rwcmd_protocol
	.cfi_startproc
; %bb.0:
	ldr	w10, [x0]
Lloh0:
	adrp	x8, _ATA_TFLAG_FUA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_TFLAG_FUA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w10
	cset	w8, ne
	lsl	x8, x8, #2
Lloh3:
	adrp	x9, _ATA_TFLAG_LBA48@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATA_TFLAG_LBA48@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	ands	w11, w9, w10
	cset	w9, ne
	lsl	x9, x9, #1
Lloh6:
	adrp	x12, _ATA_TFLAG_WRITE@GOTPAGE
Lloh7:
	ldr	x12, [x12, _ATA_TFLAG_WRITE@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	tst	w12, w10
	cset	w10, ne
	ldr	w12, [x1]
Lloh9:
	adrp	x13, _ATA_DFLAG_PIO@GOTPAGE
Lloh10:
	ldr	x13, [x13, _ATA_DFLAG_PIO@GOTPAGEOFF]
Lloh11:
	ldr	w13, [x13]
	tst	w13, w12
	b.eq	LBB0_2
LBB0_1:
Lloh12:
	adrp	x11, _ATA_PROT_PIO@GOTPAGE
Lloh13:
	ldr	x11, [x11, _ATA_PROT_PIO@GOTPAGEOFF]
Lloh14:
	ldr	x11, [x11]
	str	x11, [x0, #16]
	ldr	x11, [x1, #8]
	cmp	x11, #0
	cset	w11, eq
	lsl	x11, x11, #3
	b	LBB0_5
LBB0_2:
	cbz	w11, LBB0_4
; %bb.3:
	ldr	x11, [x1, #16]
	ldr	x11, [x11]
	ldr	w11, [x11]
Lloh15:
	adrp	x12, _ATA_FLAG_PIO_LBA48@GOTPAGE
Lloh16:
	ldr	x12, [x12, _ATA_FLAG_PIO_LBA48@GOTPAGEOFF]
Lloh17:
	ldr	w12, [x12]
	tst	w12, w11
	b.ne	LBB0_1
LBB0_4:
Lloh18:
	adrp	x11, _ATA_PROT_DMA@GOTPAGE
Lloh19:
	ldr	x11, [x11, _ATA_PROT_DMA@GOTPAGEOFF]
Lloh20:
	ldr	x11, [x11]
	str	x11, [x0, #16]
	mov	w11, #16
LBB0_5:
Lloh21:
	adrp	x12, _ata_rw_cmds@GOTPAGE
Lloh22:
	ldr	x12, [x12, _ata_rw_cmds@GOTPAGEOFF]
Lloh23:
	ldr	x12, [x12]
	orr	x8, x9, x8
	orr	x8, x8, x10
	orr	x8, x8, x11
	ldr	x9, [x12, x8, lsl #3]
	cbz	x9, LBB0_7
; %bb.6:
	str	x9, [x0, #8]
	mov	w0, #0
	ret
LBB0_7:
	mov	w0, #-1
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_TFLAG_FUA,4,2              ; @ATA_TFLAG_FUA
	.comm	_ATA_TFLAG_LBA48,4,2            ; @ATA_TFLAG_LBA48
	.comm	_ATA_TFLAG_WRITE,4,2            ; @ATA_TFLAG_WRITE
	.comm	_ATA_DFLAG_PIO,4,2              ; @ATA_DFLAG_PIO
	.comm	_ATA_PROT_PIO,8,3               ; @ATA_PROT_PIO
	.comm	_ATA_FLAG_PIO_LBA48,4,2         ; @ATA_FLAG_PIO_LBA48
	.comm	_ATA_PROT_DMA,8,3               ; @ATA_PROT_DMA
	.comm	_ata_rw_cmds,8,3                ; @ata_rw_cmds
	.no_dead_strip	_ata_rwcmd_protocol
.subsections_via_symbols
