	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sata_pmp_configure
_sata_pmp_configure:                    ## @sata_pmp_configure
	.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
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	(%rdi), %r15
	movq	16(%rdi), %rax
	movq	(%rax), %rbx
	movq	%r15, %rdi
	callq	_sata_pmp_gscr_ports
	movl	%eax, %r14d
	movq	_EINVAL@GOTPCREL(%rip), %rax
	leaq	L_.str(%rip), %rcx
	testl	%r14d, %r14d
	jle	LBB0_1
## %bb.2:
	movq	_SATA_PMP_MAX_PORTS@GOTPCREL(%rip), %rdx
	movl	$0, %r8d
	cmpl	(%rdx), %r14d
	jg	LBB0_8
## %bb.3:
	movq	_ATA_FLAG_AN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_6
## %bb.4:
	movq	_SATA_PMP_GSCR_FEAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_SATA_PMP_FEAT_NOTIFY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r15,%rax,4)
	je	LBB0_6
## %bb.5:
	movq	_ATA_DFLAG_AN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r13)
LBB0_6:
	movq	16(%r13), %rdi
	movq	_SATA_PMP_GSCR_ERROR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SERR_PHYRDY_CHG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_sata_pmp_write
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movl	%eax, %r8d
	movq	_EIO@GOTPCREL(%rip), %rax
	leaq	L_.str.1(%rip), %rcx
	jmp	LBB0_8
LBB0_1:
	xorl	%r8d, %r8d
LBB0_8:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_ata_dev_printk
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	testl	%r12d, %r12d
	je	LBB0_10
## %bb.11:
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_sata_pmp_spec_rev_str
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_sata_pmp_gscr_vendor
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_sata_pmp_gscr_devid
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_sata_pmp_gscr_rev
	movl	%eax, %r10d
	movq	_SATA_PMP_GSCR_FEAT_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r15,%rax,4), %r11d
	movq	_SATA_PMP_GSCR_FEAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r15,%rax,4), %r15d
	leaq	L_.str.2(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r12d, %r9d
	xorl	%eax, %eax
	pushq	%r15
	pushq	%r11
	pushq	%r14
	pushq	%r10
	callq	_ata_dev_printk
	addq	$32, %rsp
	movq	_ATA_DFLAG_AN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r13)
	jne	LBB0_13
## %bb.12:
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_ata_dev_printk
	jmp	LBB0_13
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_SATA_PMP_MAX_PORTS,4,2         ## @SATA_PMP_MAX_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid nr_ports"

	.comm	_ATA_FLAG_AN,4,2                ## @ATA_FLAG_AN
	.comm	_SATA_PMP_GSCR_FEAT,8,3         ## @SATA_PMP_GSCR_FEAT
	.comm	_SATA_PMP_FEAT_NOTIFY,4,2       ## @SATA_PMP_FEAT_NOTIFY
	.comm	_ATA_DFLAG_AN,4,2               ## @ATA_DFLAG_AN
	.comm	_SATA_PMP_GSCR_ERROR_EN,4,2     ## @SATA_PMP_GSCR_ERROR_EN
	.comm	_SERR_PHYRDY_CHG,4,2            ## @SERR_PHYRDY_CHG
	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"failed to write GSCR_ERROR_EN"

	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
L_.str.2:                               ## @.str.2
	.asciz	"Port Multiplier %s, 0x%04x:0x%04x r%d, %d ports, feat 0x%x/0x%x\n"

	.comm	_SATA_PMP_GSCR_FEAT_EN,8,3      ## @SATA_PMP_GSCR_FEAT_EN
L_.str.3:                               ## @.str.3
	.asciz	"Asynchronous notification not supported, hotplug won't\n         work on fan-out ports. Use warm-plug instead.\n"

	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
L_.str.4:                               ## @.str.4
	.asciz	"failed to configure Port Multiplier (%s, Emask=0x%x)\n"

	.no_dead_strip	_sata_pmp_configure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sata_pmp_configure
_sata_pmp_configure:                    ; @sata_pmp_configure
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x22, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x23, [x8]
	ldr	x21, [x0]
	mov	x0, x21
	bl	_sata_pmp_gscr_ports
Lloh0:
	adrp	x8, _SATA_PMP_MAX_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SATA_PMP_MAX_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, #1
	ccmp	w0, w8, #0, ge
	b.le	LBB0_2
; %bb.1:
	mov	w0, #0
Lloh3:
	adrp	x9, _EINVAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh5:
	adrp	x8, l_.str@PAGE
Lloh6:
	add	x8, x8, l_.str@PAGEOFF
	b	LBB0_7
LBB0_2:
	mov	x20, x0
	ldr	w8, [x23]
Lloh7:
	adrp	x9, _ATA_FLAG_AN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ATA_FLAG_AN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
Lloh10:
	adrp	x8, _SATA_PMP_GSCR_FEAT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SATA_PMP_GSCR_FEAT@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	w8, [x21, x8, lsl #2]
Lloh13:
	adrp	x9, _SATA_PMP_FEAT_NOTIFY@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SATA_PMP_FEAT_NOTIFY@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh16:
	adrp	x8, _ATA_DFLAG_AN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ATA_DFLAG_AN@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
LBB0_5:
	ldr	x0, [x19, #16]
Lloh19:
	adrp	x8, _SATA_PMP_GSCR_ERROR_EN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SATA_PMP_GSCR_ERROR_EN@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x8, _SERR_PHYRDY_CHG@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SERR_PHYRDY_CHG@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	bl	_sata_pmp_write
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_9
; %bb.6:
Lloh25:
	adrp	x9, _EIO@GOTPAGE
Lloh26:
	ldr	x9, [x9, _EIO@GOTPAGEOFF]
Lloh27:
	adrp	x8, l_.str.1@PAGE
Lloh28:
	add	x8, x8, l_.str.1@PAGEOFF
LBB0_7:
	ldr	w9, [x9]
	neg	w20, w9
Lloh29:
	adrp	x9, _KERN_ERR@GOTPAGE
Lloh30:
	ldr	x9, [x9, _KERN_ERR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x9]
	stp	x8, x0, [sp]
Lloh32:
	adrp	x2, l_.str.4@PAGE
Lloh33:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_ata_dev_printk
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_9:
	cbz	w22, LBB0_12
; %bb.10:
Lloh34:
	adrp	x26, _KERN_INFO@GOTPAGE
Lloh35:
	ldr	x26, [x26, _KERN_INFO@GOTPAGEOFF]
	ldr	w22, [x26]
	mov	x0, x21
	bl	_sata_pmp_spec_rev_str
	mov	x23, x0
	mov	x0, x21
	bl	_sata_pmp_gscr_vendor
	mov	x24, x0
	mov	x0, x21
	bl	_sata_pmp_gscr_devid
	mov	x25, x0
	mov	x0, x21
	bl	_sata_pmp_gscr_rev
                                        ; kill: def $w0 killed $w0 def $x0
Lloh36:
	adrp	x8, _SATA_PMP_GSCR_FEAT_EN@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SATA_PMP_GSCR_FEAT_EN@GOTPAGEOFF]
Lloh38:
	adrp	x9, _SATA_PMP_GSCR_FEAT@GOTPAGE
Lloh39:
	ldr	x9, [x9, _SATA_PMP_GSCR_FEAT@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
Lloh41:
	ldr	x9, [x9]
	ldr	w8, [x21, x8, lsl #2]
	ldr	w9, [x21, x9, lsl #2]
	stp	x8, x9, [sp, #40]
	stp	x0, x20, [sp, #24]
Lloh42:
	adrp	x2, l_.str.2@PAGE
Lloh43:
	add	x2, x2, l_.str.2@PAGEOFF
	stp	x24, x25, [sp, #8]
	str	x23, [sp]
	mov	x0, x19
	mov	x1, x22
	bl	_ata_dev_printk
	ldr	w8, [x19, #8]
Lloh44:
	adrp	x9, _ATA_DFLAG_AN@GOTPAGE
Lloh45:
	ldr	x9, [x9, _ATA_DFLAG_AN@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_12
; %bb.11:
	ldr	w1, [x26]
Lloh47:
	adrp	x2, l_.str.3@PAGE
Lloh48:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_ata_dev_printk
LBB0_12:
	mov	w20, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh40
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_SATA_PMP_MAX_PORTS,4,2         ; @SATA_PMP_MAX_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid nr_ports"

	.comm	_ATA_FLAG_AN,4,2                ; @ATA_FLAG_AN
	.comm	_SATA_PMP_GSCR_FEAT,8,3         ; @SATA_PMP_GSCR_FEAT
	.comm	_SATA_PMP_FEAT_NOTIFY,4,2       ; @SATA_PMP_FEAT_NOTIFY
	.comm	_ATA_DFLAG_AN,4,2               ; @ATA_DFLAG_AN
	.comm	_SATA_PMP_GSCR_ERROR_EN,4,2     ; @SATA_PMP_GSCR_ERROR_EN
	.comm	_SERR_PHYRDY_CHG,4,2            ; @SERR_PHYRDY_CHG
	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"failed to write GSCR_ERROR_EN"

	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
l_.str.2:                               ; @.str.2
	.asciz	"Port Multiplier %s, 0x%04x:0x%04x r%d, %d ports, feat 0x%x/0x%x\n"

	.comm	_SATA_PMP_GSCR_FEAT_EN,8,3      ; @SATA_PMP_GSCR_FEAT_EN
l_.str.3:                               ; @.str.3
	.asciz	"Asynchronous notification not supported, hotplug won't\n         work on fan-out ports. Use warm-plug instead.\n"

	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
l_.str.4:                               ; @.str.4
	.asciz	"failed to configure Port Multiplier (%s, Emask=0x%x)\n"

	.no_dead_strip	_sata_pmp_configure
.subsections_via_symbols
