	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_sdio_scat_rw
_ath6kl_sdio_scat_rw:                   ## @ath6kl_sdio_scat_rw
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %r13
	cmpq	$0, 48(%r13)
	je	LBB0_4
## %bb.1:
	movl	(%r13), %r8d
	movl	4(%r13), %esi
	movq	_HIF_BLOCK_BASIS@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_3
## %bb.2:
	movq	_HIF_MBOX_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r8d, %edi
	callq	_round_down
	movl	%eax, %r8d
	movl	4(%r13), %esi
LBB0_3:
	movq	8(%r14), %rdi
	movq	8(%r13), %rdx
	movl	40(%r13), %ecx
	callq	_ath6kl_sdio_io
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_4:
	leaq	-120(%rbp), %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	leaq	-80(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	leaq	-160(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_ath6kl_sdio_setup_scat_data
	movl	4(%r13), %ecx
	movq	_HIF_FIXED_ADDRESS@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	jne	LBB0_5
## %bb.6:
	movq	_CMD53_ARG_INCR_ADDRESS@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_CMD53_ARG_FIXED_ADDRESS@GOTPCREL(%rip), %rax
LBB0_7:
	movq	_HIF_WRITE@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	jne	LBB0_8
## %bb.9:
	movq	_CMD53_ARG_READ@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_8:
	movq	_CMD53_ARG_WRITE@GOTPCREL(%rip), %rcx
LBB0_10:
	movl	(%rax), %r8d
	movl	(%rcx), %esi
	movq	8(%r13), %r9
	je	LBB0_15
## %bb.11:
	movq	_HIF_MBOX_BASE_ADDR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r9
	jne	LBB0_12
## %bb.13:
	movq	_HIF_MBOX_WIDTH@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_12:
	movq	_HIF_MBOX0_EXT_WIDTH@GOTPCREL(%rip), %rax
LBB0_14:
	movslq	(%r13), %rcx
	addq	(%rax), %r9
	subq	%rcx, %r9
	movq	%r9, 8(%r13)
LBB0_15:
	leaq	-48(%rbp), %rdi
	movq	8(%r14), %rax
	movl	8(%rax), %edx
	movq	_CMD53_ARG_BLOCK_BASIS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-132(%rbp), %eax
	movl	%eax, (%rsp)
	callq	_ath6kl_sdio_set_cmd53_arg
	movq	_MMC_RSP_SPI_R5@GOTPCREL(%rip), %rax
	movq	_MMC_RSP_R5@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SD_IO_RW_EXTENDED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_MMC_CMD_ADTC@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, -80(%rbp)
	movq	%r12, -104(%rbp)
	movq	%r15, -112(%rbp)
	movq	8(%r14), %rdi
	callq	_sdio_claim_host
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_mmc_set_data_timeout
	movq	8(%r13), %rdi
	movl	4(%r13), %esi
	movslq	(%r13), %rdx
	movl	36(%r13), %ecx
	movl	32(%r13), %r8d
	callq	_trace_ath6kl_sdio_scat
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	leaq	-120(%rbp), %rsi
	callq	_mmc_wait_for_req
	movq	8(%r14), %rdi
	callq	_sdio_release_host
	movl	-76(%rbp), %ebx
	testl	%ebx, %ebx
	jne	LBB0_17
## %bb.16:
	movl	-156(%rbp), %ebx
LBB0_17:
	movl	%ebx, 16(%r13)
	testl	%ebx, %ebx
	je	LBB0_19
## %bb.18:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_ath6kl_err
LBB0_19:
	movq	_HIF_ASYNCHRONOUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13)
	je	LBB0_21
## %bb.20:
	movq	(%r14), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	*24(%r13)
LBB0_21:
	movl	%ebx, %eax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HIF_BLOCK_BASIS,4,2            ## @HIF_BLOCK_BASIS
	.comm	_HIF_MBOX_BLOCK_SIZE,4,2        ## @HIF_MBOX_BLOCK_SIZE
	.comm	_HIF_FIXED_ADDRESS,4,2          ## @HIF_FIXED_ADDRESS
	.comm	_CMD53_ARG_FIXED_ADDRESS,4,2    ## @CMD53_ARG_FIXED_ADDRESS
	.comm	_CMD53_ARG_INCR_ADDRESS,4,2     ## @CMD53_ARG_INCR_ADDRESS
	.comm	_HIF_WRITE,4,2                  ## @HIF_WRITE
	.comm	_CMD53_ARG_WRITE,4,2            ## @CMD53_ARG_WRITE
	.comm	_CMD53_ARG_READ,4,2             ## @CMD53_ARG_READ
	.comm	_HIF_MBOX_BASE_ADDR,8,3         ## @HIF_MBOX_BASE_ADDR
	.comm	_HIF_MBOX_WIDTH,8,3             ## @HIF_MBOX_WIDTH
	.comm	_HIF_MBOX0_EXT_WIDTH,8,3        ## @HIF_MBOX0_EXT_WIDTH
	.comm	_CMD53_ARG_BLOCK_BASIS,4,2      ## @CMD53_ARG_BLOCK_BASIS
	.comm	_SD_IO_RW_EXTENDED,4,2          ## @SD_IO_RW_EXTENDED
	.comm	_MMC_RSP_SPI_R5,4,2             ## @MMC_RSP_SPI_R5
	.comm	_MMC_RSP_R5,4,2                 ## @MMC_RSP_R5
	.comm	_MMC_CMD_ADTC,4,2               ## @MMC_CMD_ADTC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Scatter write request failed:%d\n"

	.comm	_HIF_ASYNCHRONOUS,4,2           ## @HIF_ASYNCHRONOUS
	.no_dead_strip	_ath6kl_sdio_scat_rw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_sdio_scat_rw
_ath6kl_sdio_scat_rw:                   ; @ath6kl_sdio_scat_rw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	mov	x20, x0
	ldr	x19, [x1]
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_8
; %bb.1:
	ldp	w4, w1, [x19]
Lloh0:
	adrp	x8, _HIF_BLOCK_BASIS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HIF_BLOCK_BASIS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _HIF_MBOX_BLOCK_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HIF_MBOX_BLOCK_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x4
	bl	_round_down
	mov	x4, x0
	ldr	w1, [x19, #4]
LBB0_3:
	ldr	x0, [x20, #8]
	ldr	x2, [x19, #8]
	ldr	w3, [x19, #40]
	bl	_ath6kl_sdio_io
	mov	x21, x0
	str	w21, [x19, #16]
	cbz	w21, LBB0_5
LBB0_4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_ath6kl_err
LBB0_5:
	ldr	w8, [x19, #4]
Lloh8:
	adrp	x9, _HIF_ASYNCHRONOUS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _HIF_ASYNCHRONOUS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	ldr	x8, [x19, #24]
	ldr	x9, [x20]
	ldr	w0, [x9]
	mov	x1, x19
	blr	x8
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_8:
	sub	x0, x29, #72
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	add	x21, sp, #48
	add	x0, sp, #48
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	add	x22, sp, #8
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	add	x1, sp, #8
	mov	x0, x19
	bl	_ath6kl_sdio_setup_scat_data
	ldr	w8, [x19, #4]
Lloh11:
	adrp	x9, _HIF_FIXED_ADDRESS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _HIF_FIXED_ADDRESS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _CMD53_ARG_FIXED_ADDRESS@GOTPAGE
Lloh15:
	ldr	x10, [x10, _CMD53_ARG_FIXED_ADDRESS@GOTPAGEOFF]
Lloh16:
	adrp	x11, _CMD53_ARG_INCR_ADDRESS@GOTPAGE
Lloh17:
	ldr	x11, [x11, _CMD53_ARG_INCR_ADDRESS@GOTPAGEOFF]
	tst	w9, w8
	csel	x9, x11, x10, eq
	ldr	w4, [x9]
Lloh18:
	adrp	x9, _HIF_WRITE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _HIF_WRITE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _CMD53_ARG_WRITE@GOTPAGE
Lloh22:
	ldr	x10, [x10, _CMD53_ARG_WRITE@GOTPAGEOFF]
Lloh23:
	adrp	x11, _CMD53_ARG_READ@GOTPAGE
Lloh24:
	ldr	x11, [x11, _CMD53_ARG_READ@GOTPAGEOFF]
	ands	w8, w9, w8
	csel	x9, x11, x10, eq
	ldr	w1, [x9]
	ldr	x5, [x19, #8]
	cbz	w8, LBB0_10
; %bb.9:
Lloh25:
	adrp	x8, _HIF_MBOX_BASE_ADDR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _HIF_MBOX_BASE_ADDR@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
Lloh28:
	adrp	x9, _HIF_MBOX_WIDTH@GOTPAGE
Lloh29:
	ldr	x9, [x9, _HIF_MBOX_WIDTH@GOTPAGEOFF]
Lloh30:
	adrp	x10, _HIF_MBOX0_EXT_WIDTH@GOTPAGE
Lloh31:
	ldr	x10, [x10, _HIF_MBOX0_EXT_WIDTH@GOTPAGEOFF]
	cmp	x5, x8
	csel	x8, x9, x10, eq
	ldr	x8, [x8]
	ldrsw	x9, [x19]
	add	x8, x8, x5
	sub	x5, x8, x9
	str	x5, [x19, #8]
LBB0_10:
	add	x0, x21, #32
	ldr	x8, [x20, #8]
	ldr	w2, [x8, #8]
Lloh32:
	adrp	x8, _CMD53_ARG_BLOCK_BASIS@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CMD53_ARG_BLOCK_BASIS@GOTPAGEOFF]
Lloh34:
	ldr	w3, [x8]
	ldr	w6, [sp, #36]
	bl	_ath6kl_sdio_set_cmd53_arg
Lloh35:
	adrp	x8, _MMC_RSP_SPI_R5@GOTPAGE
Lloh36:
	ldr	x8, [x8, _MMC_RSP_SPI_R5@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
Lloh38:
	adrp	x9, _MMC_RSP_R5@GOTPAGE
Lloh39:
	ldr	x9, [x9, _MMC_RSP_R5@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh41:
	adrp	x9, _MMC_CMD_ADTC@GOTPAGE
Lloh42:
	ldr	x9, [x9, _MMC_CMD_ADTC@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh44:
	adrp	x9, _SD_IO_RW_EXTENDED@GOTPAGE
Lloh45:
	ldr	x9, [x9, _SD_IO_RW_EXTENDED@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	str	w9, [sp, #72]
	str	w8, [sp, #48]
	stp	x22, x21, [x29, #-64]
	ldr	x0, [x20, #8]
	bl	_sdio_claim_host
	ldr	x8, [x20, #8]
	ldr	x1, [x8]
	add	x0, sp, #8
	bl	_mmc_set_data_timeout
	ldr	x0, [x19, #8]
	ldp	w2, w1, [x19]
                                        ; kill: def $w2 killed $w2 def $x2
	sxtw	x2, w2
	ldp	w4, w3, [x19, #32]
	bl	_trace_ath6kl_sdio_scat
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	sub	x1, x29, #72
	bl	_mmc_wait_for_req
	ldr	x0, [x20, #8]
	bl	_sdio_release_host
	ldr	w8, [sp, #52]
	ldr	w9, [sp, #12]
	cmp	w8, #0
	csel	w21, w9, w8, eq
	str	w21, [x19, #16]
	cbnz	w21, LBB0_4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_HIF_BLOCK_BASIS,4,2            ; @HIF_BLOCK_BASIS
	.comm	_HIF_MBOX_BLOCK_SIZE,4,2        ; @HIF_MBOX_BLOCK_SIZE
	.comm	_HIF_FIXED_ADDRESS,4,2          ; @HIF_FIXED_ADDRESS
	.comm	_CMD53_ARG_FIXED_ADDRESS,4,2    ; @CMD53_ARG_FIXED_ADDRESS
	.comm	_CMD53_ARG_INCR_ADDRESS,4,2     ; @CMD53_ARG_INCR_ADDRESS
	.comm	_HIF_WRITE,4,2                  ; @HIF_WRITE
	.comm	_CMD53_ARG_WRITE,4,2            ; @CMD53_ARG_WRITE
	.comm	_CMD53_ARG_READ,4,2             ; @CMD53_ARG_READ
	.comm	_HIF_MBOX_BASE_ADDR,8,3         ; @HIF_MBOX_BASE_ADDR
	.comm	_HIF_MBOX_WIDTH,8,3             ; @HIF_MBOX_WIDTH
	.comm	_HIF_MBOX0_EXT_WIDTH,8,3        ; @HIF_MBOX0_EXT_WIDTH
	.comm	_CMD53_ARG_BLOCK_BASIS,4,2      ; @CMD53_ARG_BLOCK_BASIS
	.comm	_SD_IO_RW_EXTENDED,4,2          ; @SD_IO_RW_EXTENDED
	.comm	_MMC_RSP_SPI_R5,4,2             ; @MMC_RSP_SPI_R5
	.comm	_MMC_RSP_R5,4,2                 ; @MMC_RSP_R5
	.comm	_MMC_CMD_ADTC,4,2               ; @MMC_CMD_ADTC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Scatter write request failed:%d\n"

	.comm	_HIF_ASYNCHRONOUS,4,2           ; @HIF_ASYNCHRONOUS
	.no_dead_strip	_ath6kl_sdio_scat_rw
.subsections_via_symbols
