	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ahci_write_fis_d2h
_ahci_write_fis_d2h:                    ## @ahci_write_fis_d2h
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movzbl	%ch, %eax
	movl	%eax, %r12d
	movl	%ecx, %r13d
	leaq	-128(%rbp), %rdi
	xorl	%esi, %esi
	movl	$80, %edx
	callq	_memset
	movl	%r12d, %edx
	movq	_FIS_TYPE_REGD2H@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%esi, -128(%rbp)
	movl	$64, -124(%rbp)
	movl	%r13d, %eax
	movzbl	%al, %eax
	movl	%eax, -120(%rbp)
	movl	%edx, -116(%rbp)
	movups	16(%rbx), %xmm0
	movaps	%xmm0, -112(%rbp)
	movups	32(%rbx), %xmm0
	movaps	%xmm0, -96(%rbp)
	movl	48(%rbx), %ecx
	movl	%ecx, -80(%rbp)
	movl	52(%rbx), %ecx
	movl	%ecx, -76(%rbp)
	movq	_ATA_S_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	addq	$16, %rbx
	movq	(%r14), %rdi
	movl	$128, (%rdi)
	movl	%eax, 8(%rdi)
	movl	%edx, 12(%rdi)
	addq	$16, %rdi
	movq	%rbx, %rsi
	movl	$16, %edx
	callq	_memcpy
	movl	(%r12), %esi
	jmp	LBB0_3
LBB0_2:
	movl	$-2, %eax
	movl	%r15d, %ecx
	roll	%cl, %eax
	andl	%eax, 8(%r14)
LBB0_3:
	movl	%r13d, 12(%r14)
	leaq	-128(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ahci_write_fis
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FIS_TYPE_REGD2H,4,2            ## @FIS_TYPE_REGD2H
	.comm	_ATA_S_ERROR,4,2                ## @ATA_S_ERROR
	.no_dead_strip	_ahci_write_fis_d2h
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ahci_write_fis_d2h
_ahci_write_fis_d2h:                    ; @ahci_write_fis_d2h
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	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, #-56]
	ubfx	w23, w3, #8, #8
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #80
	bl	_memset
Lloh3:
	adrp	x24, _FIS_TYPE_REGD2H@GOTPAGE
Lloh4:
	ldr	x24, [x24, _FIS_TYPE_REGD2H@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	w8, #64
	stp	w1, w8, [sp, #8]
	and	w8, w20, #0xff
	stp	w8, w23, [sp, #16]
	ldp	q0, q1, [x21, #16]!
	stur	q0, [sp, #24]
	stur	q1, [sp, #40]
	ldr	d0, [x21, #32]
	str	d0, [sp, #56]
Lloh5:
	adrp	x9, _ATA_S_ERROR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ATA_S_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	x9, [x19]
	mov	w10, #128
	str	w10, [x9]
	stp	w8, w23, [x9, #8]
	add	x0, x9, #16
	mov	x1, x21
	mov	w2, #16
	bl	_memcpy
	ldr	w1, [x24]
	b	LBB0_3
LBB0_2:
	mov	w8, #1
	lsl	w8, w8, w22
	ldr	w9, [x19, #8]
	bic	w8, w9, w8
	str	w8, [x19, #8]
LBB0_3:
	str	w20, [x19, #12]
	add	x2, sp, #8
	mov	x0, x19
	bl	_ahci_write_fis
	ldur	x8, [x29, #-56]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_FIS_TYPE_REGD2H,4,2            ; @FIS_TYPE_REGD2H
	.comm	_ATA_S_ERROR,4,2                ; @ATA_S_ERROR
	.no_dead_strip	_ahci_write_fis_d2h
.subsections_via_symbols
