	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv_adma_slave_config
_nv_adma_slave_config:                  ## @nv_adma_slave_config
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	32(%rdi), %edi
	callq	_ata_shost_to_port
	movq	%rax, %r15
	movq	8(%rax), %rax
	movq	24(%r15), %r12
	movq	(%rax), %rdi
	callq	_to_pci_dev
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_ata_scsi_slave_config
	movl	%eax, %r14d
	movq	(%rbx), %rax
	movq	_ATA_MAX_DEVICES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jae	LBB0_23
## %bb.1:
	cmpq	$0, 24(%rbx)
	jne	LBB0_23
## %bb.2:
	cmpq	$0, 16(%rbx)
	jne	LBB0_23
## %bb.3:
	movl	4(%r15), %edi
	callq	_spin_lock_irqsave
	movq	16(%r15), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rcx
	movq	_ATA_DEV_ATAPI@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_5
## %bb.4:
	movq	_ATA_DMA_BOUNDARY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_LIBATA_MAX_PRD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_nv_adma_register_mode
	jmp	LBB0_6
LBB0_5:
	movq	_NV_ADMA_DMA_BOUNDARY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_NV_ADMA_SGTBL_TOTAL_LEN@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_6:
	movq	_NV_MCP_SATA_CFG_20@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	callq	_pci_read_config_dword
	movq	_NV_MCP_SATA_CFG_20_PORT1_EN@GOTPCREL(%rip), %rcx
	movq	_NV_MCP_SATA_CFG_20_PORT0_EN@GOTPCREL(%rip), %rdx
	movq	_NV_MCP_SATA_CFG_20_PORT1_PWB_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NV_MCP_SATA_CFG_20_PORT0_PWB_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %esi
	orl	(%rdx), %eax
	cmpl	$1, (%r15)
	cmovel	%esi, %eax
	movl	-48(%rbp), %edx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, -72(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_7
## %bb.8:
	notl	%eax
	andl	%eax, %edx
	movq	_NV_ADMA_ATAPI_SETUP_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
	jmp	LBB0_9
LBB0_7:
	orl	%eax, %edx
	movq	_NV_ADMA_ATAPI_SETUP_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%r12)
LBB0_9:
	cmpl	%edx, -48(%rbp)
	je	LBB0_11
## %bb.10:
	movq	_NV_MCP_SATA_CFG_20@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_pci_write_config_dword
LBB0_11:
	movq	8(%r15), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rax
	movq	(%rcx), %rdx
	movq	8(%rcx), %rsi
	movq	(%rdx), %rdi
	movq	(%rax), %rcx
	movq	(%rcx), %rdx
	movq	_NV_ADMA_ATAPI_SETUP_COMPLETE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rsi)
	jne	LBB0_13
## %bb.12:
	movq	8(%rax), %rax
	testl	%ecx, (%rax)
	je	LBB0_18
LBB0_13:
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	movl	8(%rdi), %edi
	movq	_ATA_DMA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdx, %r12
	callq	_blk_queue_bounce_limit
	movq	%r12, %rdx
LBB0_15:
	testq	%rdx, %rdx
	je	LBB0_17
## %bb.16:
	movl	8(%rdx), %edi
	movq	_ATA_DMA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_blk_queue_bounce_limit
LBB0_17:
	movq	_ATA_DMA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_pci_set_dma_mask
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_22:
	movl	8(%rbx), %edi
	movq	%r13, %rsi
	callq	_blk_queue_segment_boundary
	movl	8(%rbx), %edi
	movzwl	-44(%rbp), %ebx                 ## 2-byte Folded Reload
	movl	%ebx, %esi
	callq	_blk_queue_max_segments
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	(%rax), %rcx
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movq	%r13, %r8
	movl	%ebx, %r9d
	callq	_ata_port_printk
	movl	4(%r15), %edi
	callq	_spin_unlock_irqrestore
LBB0_23:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	4(%r12), %esi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_pci_set_dma_mask
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	movl	8(%rax), %edi
	movl	4(%r12), %esi
	callq	_blk_queue_bounce_limit
LBB0_20:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_22
## %bb.21:
	movl	8(%rax), %edi
	movl	4(%r12), %esi
	callq	_blk_queue_bounce_limit
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_MAX_DEVICES,8,3            ## @ATA_MAX_DEVICES
	.comm	_ATA_DEV_ATAPI,8,3              ## @ATA_DEV_ATAPI
	.comm	_ATA_DMA_BOUNDARY,8,3           ## @ATA_DMA_BOUNDARY
	.comm	_LIBATA_MAX_PRD,4,2             ## @LIBATA_MAX_PRD
	.comm	_NV_ADMA_DMA_BOUNDARY,8,3       ## @NV_ADMA_DMA_BOUNDARY
	.comm	_NV_ADMA_SGTBL_TOTAL_LEN,2,1    ## @NV_ADMA_SGTBL_TOTAL_LEN
	.comm	_NV_MCP_SATA_CFG_20,4,2         ## @NV_MCP_SATA_CFG_20
	.comm	_NV_MCP_SATA_CFG_20_PORT1_EN,4,2 ## @NV_MCP_SATA_CFG_20_PORT1_EN
	.comm	_NV_MCP_SATA_CFG_20_PORT1_PWB_EN,4,2 ## @NV_MCP_SATA_CFG_20_PORT1_PWB_EN
	.comm	_NV_MCP_SATA_CFG_20_PORT0_EN,4,2 ## @NV_MCP_SATA_CFG_20_PORT0_EN
	.comm	_NV_MCP_SATA_CFG_20_PORT0_PWB_EN,4,2 ## @NV_MCP_SATA_CFG_20_PORT0_PWB_EN
	.comm	_NV_ADMA_ATAPI_SETUP_COMPLETE,4,2 ## @NV_ADMA_ATAPI_SETUP_COMPLETE
	.comm	_ATA_DMA_MASK,4,2               ## @ATA_DMA_MASK
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n"

	.no_dead_strip	_nv_adma_slave_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv_adma_slave_config
_nv_adma_slave_config:                  ; @nv_adma_slave_config
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x0
	ldr	w0, [x0, #32]
	bl	_ata_shost_to_port
	mov	x19, x0
	ldr	x24, [x0, #24]
	ldr	x8, [x0, #8]
	ldr	x0, [x8]
	bl	_to_pci_dev
	mov	x23, x0
	mov	x0, x21
	bl	_ata_scsi_slave_config
	mov	x20, x0
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _ATA_MAX_DEVICES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_MAX_DEVICES@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_19
; %bb.1:
	ldr	x8, [x21, #24]
	cbnz	x8, LBB0_19
; %bb.2:
	ldr	x8, [x21, #16]
	cbnz	x8, LBB0_19
; %bb.3:
	ldr	w0, [x19, #4]
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	ldr	x26, [x8, x9, lsl #3]
Lloh3:
	adrp	x8, _ATA_DEV_ATAPI@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_DEV_ATAPI@GOTPAGEOFF]
Lloh5:
	ldr	x27, [x8]
	cmp	x26, x27
	b.ne	LBB0_5
; %bb.4:
Lloh6:
	adrp	x8, _ATA_DMA_BOUNDARY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATA_DMA_BOUNDARY@GOTPAGEOFF]
Lloh8:
	ldr	x22, [x8]
Lloh9:
	adrp	x8, _LIBATA_MAX_PRD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LIBATA_MAX_PRD@GOTPAGEOFF]
	ldrh	w8, [x8]
	sub	w8, w8, #1
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	mov	x0, x19
	bl	_nv_adma_register_mode
	b	LBB0_6
LBB0_5:
Lloh11:
	adrp	x8, _NV_ADMA_DMA_BOUNDARY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NV_ADMA_DMA_BOUNDARY@GOTPAGEOFF]
Lloh13:
	ldr	x22, [x8]
Lloh14:
	adrp	x8, _NV_ADMA_SGTBL_TOTAL_LEN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NV_ADMA_SGTBL_TOTAL_LEN@GOTPAGEOFF]
	ldrh	w8, [x8]
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
LBB0_6:
Lloh16:
	adrp	x28, _NV_MCP_SATA_CFG_20@GOTPAGE
Lloh17:
	ldr	x28, [x28, _NV_MCP_SATA_CFG_20@GOTPAGEOFF]
	ldr	w1, [x28]
	add	x2, sp, #12
	mov	x0, x23
	bl	_pci_read_config_dword
	ldr	w8, [x19]
Lloh18:
	adrp	x9, _NV_MCP_SATA_CFG_20_PORT1_EN@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NV_MCP_SATA_CFG_20_PORT1_EN@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _NV_MCP_SATA_CFG_20_PORT0_EN@GOTPAGE
Lloh22:
	ldr	x10, [x10, _NV_MCP_SATA_CFG_20_PORT0_EN@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
Lloh24:
	adrp	x11, _NV_MCP_SATA_CFG_20_PORT1_PWB_EN@GOTPAGE
Lloh25:
	ldr	x11, [x11, _NV_MCP_SATA_CFG_20_PORT1_PWB_EN@GOTPAGEOFF]
Lloh26:
	ldr	w11, [x11]
Lloh27:
	adrp	x12, _NV_MCP_SATA_CFG_20_PORT0_PWB_EN@GOTPAGE
Lloh28:
	ldr	x12, [x12, _NV_MCP_SATA_CFG_20_PORT0_PWB_EN@GOTPAGEOFF]
Lloh29:
	ldr	w12, [x12]
	orr	w9, w11, w9
	orr	w10, w12, w10
	cmp	w8, #1
	csel	w8, w9, w10, eq
	ldr	w9, [sp, #12]
Lloh30:
	adrp	x25, _NV_ADMA_ATAPI_SETUP_COMPLETE@GOTPAGE
Lloh31:
	ldr	x25, [x25, _NV_ADMA_ATAPI_SETUP_COMPLETE@GOTPAGEOFF]
	cmp	x26, x27
	b.ne	LBB0_8
; %bb.7:
	bic	w2, w9, w8
	ldr	w8, [x25]
	ldr	w9, [x24]
	orr	w8, w9, w8
	b	LBB0_9
LBB0_8:
	orr	w2, w9, w8
	ldr	w8, [x25]
	ldr	w9, [x24]
	bic	w8, w9, w8
LBB0_9:
	str	w8, [x24]
	ldr	w8, [sp, #12]
	cmp	w8, w2
	b.eq	LBB0_11
; %bb.10:
	ldr	w1, [x28]
	mov	x0, x23
	bl	_pci_write_config_dword
LBB0_11:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldp	x9, x8, [x8]
	ldp	x9, x10, [x9]
	ldr	x27, [x9]
	ldr	x9, [x8]
	ldr	x26, [x9]
	ldr	w10, [x10]
	ldr	w9, [x25]
	tst	w9, w10
	b.ne	LBB0_13
; %bb.12:
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_20
LBB0_13:
Lloh32:
	adrp	x24, _ATA_DMA_MASK@GOTPAGE
Lloh33:
	ldr	x24, [x24, _ATA_DMA_MASK@GOTPAGEOFF]
	cbz	x27, LBB0_15
; %bb.14:
	ldr	w0, [x27, #8]
	ldr	w1, [x24]
	bl	_blk_queue_bounce_limit
LBB0_15:
	cbz	x26, LBB0_17
; %bb.16:
	ldr	w0, [x26, #8]
	ldr	w1, [x24]
	bl	_blk_queue_bounce_limit
LBB0_17:
	ldr	w1, [x24]
	mov	x0, x23
	bl	_pci_set_dma_mask
	ldr	w23, [sp, #8]                   ; 4-byte Folded Reload
LBB0_18:
	ldr	w0, [x21, #8]
	mov	x1, x22
	bl	_blk_queue_segment_boundary
	ldr	w0, [x21, #8]
	and	w21, w23, #0xffff
	mov	x1, x21
	bl	_blk_queue_max_segments
Lloh34:
	adrp	x8, _KERN_INFO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _KERN_INFO@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x3, [x8]
Lloh37:
	adrp	x2, l_.str@PAGE
Lloh38:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x4, x22
	mov	x5, x21
	bl	_ata_port_printk
	ldr	w0, [x19, #4]
	bl	_spin_unlock_irqrestore
LBB0_19:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
	ldr	w1, [x24, #4]
	mov	x0, x23
	bl	_pci_set_dma_mask
	cbz	x27, LBB0_22
; %bb.21:
	ldr	w0, [x27, #8]
	ldr	w1, [x24, #4]
	bl	_blk_queue_bounce_limit
LBB0_22:
	ldr	w23, [sp, #8]                   ; 4-byte Folded Reload
	cbz	x26, LBB0_18
; %bb.23:
	ldr	w0, [x26, #8]
	ldr	w1, [x24, #4]
	bl	_blk_queue_bounce_limit
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_MAX_DEVICES,8,3            ; @ATA_MAX_DEVICES
	.comm	_ATA_DEV_ATAPI,8,3              ; @ATA_DEV_ATAPI
	.comm	_ATA_DMA_BOUNDARY,8,3           ; @ATA_DMA_BOUNDARY
	.comm	_LIBATA_MAX_PRD,4,2             ; @LIBATA_MAX_PRD
	.comm	_NV_ADMA_DMA_BOUNDARY,8,3       ; @NV_ADMA_DMA_BOUNDARY
	.comm	_NV_ADMA_SGTBL_TOTAL_LEN,2,1    ; @NV_ADMA_SGTBL_TOTAL_LEN
	.comm	_NV_MCP_SATA_CFG_20,4,2         ; @NV_MCP_SATA_CFG_20
	.comm	_NV_MCP_SATA_CFG_20_PORT1_EN,4,2 ; @NV_MCP_SATA_CFG_20_PORT1_EN
	.comm	_NV_MCP_SATA_CFG_20_PORT1_PWB_EN,4,2 ; @NV_MCP_SATA_CFG_20_PORT1_PWB_EN
	.comm	_NV_MCP_SATA_CFG_20_PORT0_EN,4,2 ; @NV_MCP_SATA_CFG_20_PORT0_EN
	.comm	_NV_MCP_SATA_CFG_20_PORT0_PWB_EN,4,2 ; @NV_MCP_SATA_CFG_20_PORT0_PWB_EN
	.comm	_NV_ADMA_ATAPI_SETUP_COMPLETE,4,2 ; @NV_ADMA_ATAPI_SETUP_COMPLETE
	.comm	_ATA_DMA_MASK,4,2               ; @ATA_DMA_MASK
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n"

	.no_dead_strip	_nv_adma_slave_config
.subsections_via_symbols
