	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_sdio_io
_ath6kl_sdio_io:                        ## @ath6kl_sdio_io
	.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	%r8d, %r12d
	movq	%rcx, %r14
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	%rdi, %r13
	callq	_sdio_claim_host
	movq	_HIF_WRITE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_4
## %bb.1:
	movq	_HIF_MBOX_BASE_ADDR@GOTPCREL(%rip), %rax
	movq	_HIF_MBOX_END_ADDR@GOTPCREL(%rip), %rcx
	movq	_HIF_MBOX_WIDTH@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	subl	%r12d, %edx
	xorl	%esi, %esi
	cmpl	%ebx, (%rcx)
	cmovll	%esi, %edx
	cmpl	%ebx, (%rax)
	cmovgl	%esi, %edx
	addl	%ebx, %edx
	movq	_HIF_MBOX0_EXT_BASE_ADDR@GOTPCREL(%rip), %rax
	movq	_HIF_MBOX0_EXT_WIDTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	subl	%r12d, %ebx
	cmpl	(%rax), %edx
	cmovnel	%esi, %ebx
	addl	%edx, %ebx
	movq	_HIF_FIXED_ADDRESS@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%r14, %rdx
	movl	%r12d, %ecx
	callq	_sdio_writesb
	jmp	LBB0_7
LBB0_4:
	movq	_HIF_FIXED_ADDRESS@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	callq	_sdio_readsb
	jmp	LBB0_7
LBB0_3:
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%r14, %rdx
	movl	%r12d, %ecx
	callq	_sdio_memcpy_toio
	jmp	LBB0_7
LBB0_6:
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	callq	_sdio_memcpy_fromio
LBB0_7:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_sdio_release_host
	movq	_ATH6KL_DBG_SDIO@GOTPCREL(%rip), %rax
	movq	_HIF_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r15d, %ecx
	leaq	L_.str.2(%rip), %rcx
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rcx, %rdx
	movl	(%rax), %edi
	movq	_HIF_FIXED_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %r8
	cmoveq	%rax, %r8
	movl	%r12d, (%rsp)
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %ecx
	movq	%r14, %r9
	callq	_ath6kl_dbg
	movq	_ATH6KL_DBG_SDIO_DUMP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rdx
	xorl	%esi, %esi
	movq	%r14, %rcx
	movl	%r12d, %r8d
	callq	_ath6kl_dbg_dump
	movl	%ebx, %edi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movl	%r12d, %ecx
	callq	_trace_ath6kl_sdio
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HIF_WRITE,4,2                  ## @HIF_WRITE
	.comm	_HIF_MBOX_BASE_ADDR,4,2         ## @HIF_MBOX_BASE_ADDR
	.comm	_HIF_MBOX_END_ADDR,4,2          ## @HIF_MBOX_END_ADDR
	.comm	_HIF_MBOX_WIDTH,4,2             ## @HIF_MBOX_WIDTH
	.comm	_HIF_MBOX0_EXT_BASE_ADDR,4,2    ## @HIF_MBOX0_EXT_BASE_ADDR
	.comm	_HIF_MBOX0_EXT_WIDTH,4,2        ## @HIF_MBOX0_EXT_WIDTH
	.comm	_HIF_FIXED_ADDRESS,4,2          ## @HIF_FIXED_ADDRESS
	.comm	_ATH6KL_DBG_SDIO,4,2            ## @ATH6KL_DBG_SDIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s addr 0x%x%s buf 0x%p len %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"wr"

L_.str.2:                               ## @.str.2
	.asciz	"rd"

L_.str.3:                               ## @.str.3
	.asciz	" (fixed)"

L_.str.4:                               ## @.str.4
	.space	1

	.comm	_ATH6KL_DBG_SDIO_DUMP,4,2       ## @ATH6KL_DBG_SDIO_DUMP
L_.str.5:                               ## @.str.5
	.asciz	"sdio "

	.no_dead_strip	_ath6kl_sdio_io
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_sdio_io
_ath6kl_sdio_io:                        ; @ath6kl_sdio_io
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x4
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x23, x0
	bl	_sdio_claim_host
Lloh0:
	adrp	x26, _HIF_WRITE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _HIF_WRITE@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh2:
	adrp	x25, _HIF_FIXED_ADDRESS@GOTPAGE
Lloh3:
	ldr	x25, [x25, _HIF_FIXED_ADDRESS@GOTPAGEOFF]
	tst	w8, w21
	b.eq	LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _HIF_MBOX_BASE_ADDR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HIF_MBOX_BASE_ADDR@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _HIF_MBOX_END_ADDR@GOTPAGE
Lloh8:
	ldr	x9, [x9, _HIF_MBOX_END_ADDR@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _HIF_MBOX_WIDTH@GOTPAGE
Lloh11:
	ldr	x10, [x10, _HIF_MBOX_WIDTH@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	sub	w10, w10, w19
	cmp	w9, w22
	ccmp	w8, w22, #0, ge
Lloh13:
	adrp	x8, _HIF_MBOX0_EXT_BASE_ADDR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HIF_MBOX0_EXT_BASE_ADDR@GOTPAGEOFF]
	csel	w9, wzr, w10, gt
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x10, _HIF_MBOX0_EXT_WIDTH@GOTPAGE
Lloh17:
	ldr	x10, [x10, _HIF_MBOX0_EXT_WIDTH@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	sub	w10, w10, w19
	add	w9, w9, w22
	cmp	w9, w8
	csel	w8, w10, wzr, eq
	add	w22, w8, w9
	ldr	w8, [x25]
	mov	x0, x23
	mov	x1, x22
	mov	x2, x20
	mov	x3, x19
	tst	w8, w21
	b.eq	LBB0_5
; %bb.2:
	bl	_sdio_writesb
	b	LBB0_7
LBB0_3:
	ldr	w8, [x25]
	mov	x0, x23
	mov	x1, x20
	mov	x2, x22
	mov	x3, x19
	tst	w8, w21
	b.eq	LBB0_6
; %bb.4:
	bl	_sdio_readsb
	b	LBB0_7
LBB0_5:
	bl	_sdio_memcpy_toio
	b	LBB0_7
LBB0_6:
	bl	_sdio_memcpy_fromio
LBB0_7:
	mov	x24, x0
	mov	x0, x23
	bl	_sdio_release_host
Lloh19:
	adrp	x8, _ATH6KL_DBG_SDIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ATH6KL_DBG_SDIO@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	adrp	x8, l_.str.1@PAGE
Lloh23:
	add	x8, x8, l_.str.1@PAGEOFF
	ldr	w9, [x26]
Lloh24:
	adrp	x10, l_.str.2@PAGE
Lloh25:
	add	x10, x10, l_.str.2@PAGEOFF
	tst	w9, w21
	csel	x2, x10, x8, eq
	ldr	w8, [x25]
Lloh26:
	adrp	x9, l_.str.3@PAGE
Lloh27:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh28:
	adrp	x10, l_.str.4@PAGE
Lloh29:
	add	x10, x10, l_.str.4@PAGEOFF
	tst	w8, w21
	csel	x4, x10, x9, eq
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x22
	mov	x5, x20
	mov	x6, x19
	bl	_ath6kl_dbg
Lloh32:
	adrp	x8, _ATH6KL_DBG_SDIO_DUMP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ATH6KL_DBG_SDIO_DUMP@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
Lloh35:
	adrp	x2, l_.str.5@PAGE
Lloh36:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x1, #0
	mov	x3, x20
	mov	x4, x19
	bl	_ath6kl_dbg_dump
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_trace_ath6kl_sdio
	mov	x0, x24
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_HIF_WRITE,4,2                  ; @HIF_WRITE
	.comm	_HIF_MBOX_BASE_ADDR,4,2         ; @HIF_MBOX_BASE_ADDR
	.comm	_HIF_MBOX_END_ADDR,4,2          ; @HIF_MBOX_END_ADDR
	.comm	_HIF_MBOX_WIDTH,4,2             ; @HIF_MBOX_WIDTH
	.comm	_HIF_MBOX0_EXT_BASE_ADDR,4,2    ; @HIF_MBOX0_EXT_BASE_ADDR
	.comm	_HIF_MBOX0_EXT_WIDTH,4,2        ; @HIF_MBOX0_EXT_WIDTH
	.comm	_HIF_FIXED_ADDRESS,4,2          ; @HIF_FIXED_ADDRESS
	.comm	_ATH6KL_DBG_SDIO,4,2            ; @ATH6KL_DBG_SDIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s addr 0x%x%s buf 0x%p len %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"wr"

l_.str.2:                               ; @.str.2
	.asciz	"rd"

l_.str.3:                               ; @.str.3
	.asciz	" (fixed)"

l_.str.4:                               ; @.str.4
	.space	1

	.comm	_ATH6KL_DBG_SDIO_DUMP,4,2       ; @ATH6KL_DBG_SDIO_DUMP
l_.str.5:                               ; @.str.5
	.asciz	"sdio "

	.no_dead_strip	_ath6kl_sdio_io
.subsections_via_symbols
