	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ahci_port_reset
_ahci_port_reset:                       ## @ahci_port_reset
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rdi)
	movq	_ATA_UDMA6@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rdi)
	movl	$128, (%rdi)
	cmpl	$0, 24(%rdi)
	je	LBB0_7
## %bb.1:
	movq	_ATA_SS_DET_PHY_ONLINE@GOTPCREL(%rip), %rcx
	movq	_ATA_SS_IPM_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	_ATA_SC_SPD_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	16(%rdi), %ecx
	jne	LBB0_3
## %bb.2:
	movq	_ATA_SS_SPD_GEN3@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_3:
	orl	%eax, %ecx
	movl	%ecx, 4(%rdi)
	movq	_ATA_S_DSC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_ATA_S_DMA@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	$256, %eax                      ## imm = 0x100
	movl	%eax, 12(%rdi)
	cmpl	$0, 20(%rdi)
	je	LBB0_4
## %bb.5:
	movq	_PxSIG_ATAPI@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	jmp	LBB0_6
LBB0_7:
	movq	_ATA_SS_DET_NO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rdi)
	movabsq	$549755813887, %rax             ## imm = 0x7FFFFFFFFF
	movq	%rax, 8(%rdi)
	popq	%rbp
	retq
LBB0_4:
	movq	_PxSIG_ATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_ATA_S_READY@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, 12(%rdi)
LBB0_6:
	movl	%ecx, 8(%rdi)
	popq	%rbp
	jmp	_ahci_write_reset_fis_d2h       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_UDMA6,4,2                  ## @ATA_UDMA6
	.comm	_ATA_SS_DET_NO_DEVICE,4,2       ## @ATA_SS_DET_NO_DEVICE
	.comm	_ATA_SS_DET_PHY_ONLINE,4,2      ## @ATA_SS_DET_PHY_ONLINE
	.comm	_ATA_SS_IPM_ACTIVE,4,2          ## @ATA_SS_IPM_ACTIVE
	.comm	_ATA_SC_SPD_MASK,4,2            ## @ATA_SC_SPD_MASK
	.comm	_ATA_SS_SPD_GEN3,4,2            ## @ATA_SS_SPD_GEN3
	.comm	_ATA_S_DSC,4,2                  ## @ATA_S_DSC
	.comm	_ATA_S_DMA,4,2                  ## @ATA_S_DMA
	.comm	_PxSIG_ATA,4,2                  ## @PxSIG_ATA
	.comm	_ATA_S_READY,4,2                ## @ATA_S_READY
	.comm	_PxSIG_ATAPI,4,2                ## @PxSIG_ATAPI
	.no_dead_strip	_ahci_port_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function ahci_port_reset
lCPI0_0:
	.long	4294967295                      ; 0xffffffff
	.long	127                             ; 0x7f
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ahci_port_reset:                       ; @ahci_port_reset
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _ATA_UDMA6@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_UDMA6@GOTPAGEOFF]
	stp	xzr, xzr, [x0, #32]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #28]
	mov	w8, #128
	str	w8, [x0]
	ldr	w8, [x0, #24]
	cbz	w8, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _ATA_SS_DET_PHY_ONLINE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_SS_DET_PHY_ONLINE@GOTPAGEOFF]
Lloh5:
	adrp	x9, _ATA_SS_IPM_ACTIVE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ATA_SS_IPM_ACTIVE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _ATA_SC_SPD_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATA_SC_SPD_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	ldp	w10, w11, [x0, #16]
	ands	w9, w9, w10
Lloh12:
	adrp	x10, _ATA_SS_SPD_GEN3@GOTPAGE
Lloh13:
	ldr	x10, [x10, _ATA_SS_SPD_GEN3@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	csel	w9, w10, w9, eq
	orr	w8, w9, w8
	str	w8, [x0, #4]
Lloh15:
	adrp	x8, _ATA_S_DSC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ATA_S_DSC@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _ATA_S_DMA@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATA_S_DMA@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
	orr	w9, w8, #0x100
	str	w9, [x0, #12]
	cbz	w11, LBB0_4
; %bb.2:
Lloh21:
	adrp	x8, _PxSIG_ATAPI@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PxSIG_ATAPI@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	b	_ahci_write_reset_fis_d2h
LBB0_3:
Lloh24:
	adrp	x8, _ATA_SS_DET_NO_DEVICE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ATA_SS_DET_NO_DEVICE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x0, #4]
Lloh27:
	adrp	x8, lCPI0_0@PAGE
Lloh28:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x0, #8]
	ret
LBB0_4:
Lloh29:
	adrp	x8, _PxSIG_ATA@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PxSIG_ATA@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x10, _ATA_S_READY@GOTPAGE
Lloh33:
	ldr	x10, [x10, _ATA_S_READY@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	orr	w9, w10, w9
	stp	w8, w9, [x0, #8]
	b	_ahci_write_reset_fis_d2h
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdr	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_UDMA6,4,2                  ; @ATA_UDMA6
	.comm	_ATA_SS_DET_NO_DEVICE,4,2       ; @ATA_SS_DET_NO_DEVICE
	.comm	_ATA_SS_DET_PHY_ONLINE,4,2      ; @ATA_SS_DET_PHY_ONLINE
	.comm	_ATA_SS_IPM_ACTIVE,4,2          ; @ATA_SS_IPM_ACTIVE
	.comm	_ATA_SC_SPD_MASK,4,2            ; @ATA_SC_SPD_MASK
	.comm	_ATA_SS_SPD_GEN3,4,2            ; @ATA_SS_SPD_GEN3
	.comm	_ATA_S_DSC,4,2                  ; @ATA_S_DSC
	.comm	_ATA_S_DMA,4,2                  ; @ATA_S_DMA
	.comm	_PxSIG_ATA,4,2                  ; @PxSIG_ATA
	.comm	_ATA_S_READY,4,2                ; @ATA_S_READY
	.comm	_PxSIG_ATAPI,4,2                ; @PxSIG_ATAPI
	.no_dead_strip	_ahci_port_reset
.subsections_via_symbols
