	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_sdio_enable_scatter
_ath6kl_sdio_enable_scatter:            ## @ath6kl_sdio_enable_scatter
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_ath6kl_sdio_priv
	xorl	%r14d, %r14d
	cmpl	$0, (%rax)
	jne	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movq	(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	$1, (%rbx)
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	(%rax), %rsi
	movq	_MAX_SCATTER_ENTRIES_PER_REQ@GOTPCREL(%rip), %r13
	movq	(%r13), %rdx
	cmpq	%rdx, %rsi
	jge	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_ath6kl_err
	movl	$1, %r12d
	jmp	LBB0_5
LBB0_3:
	movq	_MAX_SCATTER_REQUESTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_ath6kl_sdio_alloc_prep_scat_req
	testl	%eax, %eax
	je	LBB0_9
## %bb.4:
	movq	%r15, %rdi
	callq	_ath6kl_sdio_cleanup_scatter
	leaq	L_.str.2(%rip), %rdi
	callq	_ath6kl_warn
LBB0_5:
	movq	_ATH6KL_SCATTER_ENTRIES_PER_REQ@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_ATH6KL_SCATTER_REQS@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movl	%r12d, %ecx
	callq	_ath6kl_sdio_alloc_prep_scat_req
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_ath6kl_err
	movq	%r15, %rdi
	callq	_ath6kl_sdio_cleanup_scatter
	movl	%ebx, %r14d
	jmp	LBB0_8
LBB0_7:
	movq	_ATH6KL_DBG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r13), %edx
	movq	_ATH6KL_SCATTER_ENTRIES_PER_REQ@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	leaq	L_.str.4(%rip), %rsi
	callq	_ath6kl_dbg
	movq	(%rbx), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%rcx)
	movq	_ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	jmp	LBB0_8
LBB0_9:
	movq	_ATH6KL_DBG_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MAX_SCATTER_REQUESTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	(%r13), %rcx
	leaq	L_.str.1(%rip), %rsi
	callq	_ath6kl_dbg
	movq	(%r13), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%rcx)
	movq	_MAX_SCATTER_REQ_TRANSFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	xorl	%r14d, %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SCATTER_ENTRIES_PER_REQ,8,3 ## @MAX_SCATTER_ENTRIES_PER_REQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"host only supports scatter of :%d entries, need: %d\n"

	.comm	_MAX_SCATTER_REQUESTS,4,2       ## @MAX_SCATTER_REQUESTS
	.comm	_ATH6KL_DBG_BOOT,4,2            ## @ATH6KL_DBG_BOOT
L_.str.1:                               ## @.str.1
	.asciz	"hif-scatter enabled requests %d entries %d\n"

	.comm	_MAX_SCATTER_REQ_TRANSFER_SIZE,4,2 ## @MAX_SCATTER_REQ_TRANSFER_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"hif scatter resource setup failed, trying virtual scatter method\n"

	.comm	_ATH6KL_SCATTER_ENTRIES_PER_REQ,8,3 ## @ATH6KL_SCATTER_ENTRIES_PER_REQ
	.comm	_ATH6KL_SCATTER_REQS,4,2        ## @ATH6KL_SCATTER_REQS
L_.str.3:                               ## @.str.3
	.asciz	"failed to alloc virtual scatter resources !\n"

L_.str.4:                               ## @.str.4
	.asciz	"virtual scatter enabled requests %d entries %d\n"

	.comm	_ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER,4,2 ## @ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER
	.no_dead_strip	_ath6kl_sdio_enable_scatter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_sdio_enable_scatter
_ath6kl_sdio_enable_scatter:            ; @ath6kl_sdio_enable_scatter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	bl	_ath6kl_sdio_priv
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_11
LBB0_2:
	mov	x20, x0
	ldr	x21, [x19]
	mov	w8, #1
	str	w8, [x0]
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh0:
	adrp	x22, _MAX_SCATTER_ENTRIES_PER_REQ@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MAX_SCATTER_ENTRIES_PER_REQ@GOTPAGEOFF]
	ldr	x1, [x22]
	cmp	x8, x1
	b.ge	LBB0_4
; %bb.3:
	stp	x8, x1, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ath6kl_err
	mov	w3, #1
	b	LBB0_6
LBB0_4:
Lloh4:
	adrp	x23, _MAX_SCATTER_REQUESTS@GOTPAGE
Lloh5:
	ldr	x23, [x23, _MAX_SCATTER_REQUESTS@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	mov	w3, #0
	bl	_ath6kl_sdio_alloc_prep_scat_req
	cbz	w0, LBB0_9
; %bb.5:
	mov	x0, x19
	bl	_ath6kl_sdio_cleanup_scatter
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_ath6kl_warn
	mov	w3, #0
LBB0_6:
Lloh8:
	adrp	x22, _ATH6KL_SCATTER_ENTRIES_PER_REQ@GOTPAGE
Lloh9:
	ldr	x22, [x22, _ATH6KL_SCATTER_ENTRIES_PER_REQ@GOTPAGEOFF]
	ldr	x1, [x22]
Lloh10:
	adrp	x23, _ATH6KL_SCATTER_REQS@GOTPAGE
Lloh11:
	ldr	x23, [x23, _ATH6KL_SCATTER_REQS@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	bl	_ath6kl_sdio_alloc_prep_scat_req
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.7:
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ath6kl_err
	mov	x0, x19
	bl	_ath6kl_sdio_cleanup_scatter
	b	LBB0_11
LBB0_8:
Lloh14:
	adrp	x8, _ATH6KL_DBG_BOOT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ATH6KL_DBG_BOOT@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	w2, [x23]
	ldr	x3, [x22]
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_ath6kl_dbg
	ldr	x8, [x22]
	str	x8, [x21, #8]
Lloh19:
	adrp	x8, _ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh21:
	adrp	x8, _ATH6KL_DBG_BOOT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ATH6KL_DBG_BOOT@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	w2, [x23]
	ldr	x3, [x22]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_ath6kl_dbg
	mov	w20, #0
	ldr	x8, [x22]
	str	x8, [x21, #8]
Lloh26:
	adrp	x8, _MAX_SCATTER_REQ_TRANSFER_SIZE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MAX_SCATTER_REQ_TRANSFER_SIZE@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	str	w8, [x21]
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SCATTER_ENTRIES_PER_REQ,8,3 ; @MAX_SCATTER_ENTRIES_PER_REQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"host only supports scatter of :%d entries, need: %d\n"

	.comm	_MAX_SCATTER_REQUESTS,4,2       ; @MAX_SCATTER_REQUESTS
	.comm	_ATH6KL_DBG_BOOT,4,2            ; @ATH6KL_DBG_BOOT
l_.str.1:                               ; @.str.1
	.asciz	"hif-scatter enabled requests %d entries %d\n"

	.comm	_MAX_SCATTER_REQ_TRANSFER_SIZE,4,2 ; @MAX_SCATTER_REQ_TRANSFER_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"hif scatter resource setup failed, trying virtual scatter method\n"

	.comm	_ATH6KL_SCATTER_ENTRIES_PER_REQ,8,3 ; @ATH6KL_SCATTER_ENTRIES_PER_REQ
	.comm	_ATH6KL_SCATTER_REQS,4,2        ; @ATH6KL_SCATTER_REQS
l_.str.3:                               ; @.str.3
	.asciz	"failed to alloc virtual scatter resources !\n"

l_.str.4:                               ; @.str.4
	.asciz	"virtual scatter enabled requests %d entries %d\n"

	.comm	_ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER,4,2 ; @ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER
	.no_dead_strip	_ath6kl_sdio_enable_scatter
.subsections_via_symbols
