	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_mci_prep_interface
_ar9003_mci_prep_interface:             ## @ar9003_mci_prep_interface
	.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, %r12
	callq	_ath9k_hw_common
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_MCI_BT_SLEEP@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	movq	_AR_MCI_INTERRUPT_EN@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_REG_READ
	movl	%eax, %r14d
	movl	(%r13), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	_AR_MCI_INTERRUPT_RX_MSG_RAW@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_REG_READ
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_REG_WRITE
	movq	_AR_MCI_INTERRUPT_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_REG_READ
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_REG_WRITE
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_ar9003_mci_remote_reset
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_ar9003_mci_send_req_wake
	movl	(%r15), %esi
	movq	_AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r12, %rdi
	movl	$500, %ecx                      ## imm = 0x1F4
	callq	_ar9003_mci_wait_for_interrupt
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	_MCI_BT_AWAKE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_ar9003_mci_send_sys_waking
	movl	$10, %edi
	callq	_udelay
	movq	_AR_MCI_BT_PRI0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_REG_WRITE
	movq	_AR_MCI_BT_PRI1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_REG_WRITE
	movq	_AR_MCI_BT_PRI2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_REG_WRITE
	movq	_AR_MCI_BT_PRI3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$-1, %edx
	callq	_REG_WRITE
	movq	_AR_MCI_BT_PRI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$255, %edx
	callq	_REG_WRITE
	movl	(%r15), %esi
	movq	_AR_MCI_INTERRUPT_RX_MSG_CONT_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_WRITE
	movq	_AR_MCI_INTERRUPT_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_MCI_INTERRUPT_BT_PRI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_WRITE
	cmpq	$0, 16(%r12)
	je	LBB0_8
## %bb.2:
	movq	%r12, %rdi
	callq	_MCI_ANT_ARCH_PA_LNA_SHARED
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_ar9003_mci_send_lna_transfer
	movl	$5, %edi
	callq	_udelay
LBB0_4:
	cmpq	$0, 16(%r12)
	je	LBB0_8
## %bb.5:
	cmpl	$0, 8(%r12)
	jne	LBB0_8
## %bb.6:
	movq	%r12, %rdi
	callq	_MCI_ANT_ARCH_PA_LNA_SHARED
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%r15), %esi
	movq	_AR_MCI_INTERRUPT_RX_MSG_LNA_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$150, %ecx
	callq	_ar9003_mci_wait_for_interrupt
	testq	%rax, %rax
	movq	_MCI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rdx
	cmoveq	%rax, %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ath_dbg
LBB0_8:
	movq	(%r12), %rax
	movq	_MCI_BT_AWAKE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.9:
	movl	(%r15), %esi
	movl	(%rbx), %edx
	movq	%r12, %rdi
	callq	_REG_READ_FIELD
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movl	(%r15), %esi
	movq	_AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_READ_FIELD
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movl	(%r15), %esi
	movl	(%rbx), %edx
	movq	%r12, %rdi
	callq	_REG_WRITE
	movq	_AR_MCI_INTERRUPT_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_WRITE
LBB0_12:
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	%r14d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_REG_WRITE                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MCI_BT_SLEEP,8,3               ## @MCI_BT_SLEEP
	.comm	_AR_MCI_INTERRUPT_EN,4,2        ## @AR_MCI_INTERRUPT_EN
	.comm	_AR_MCI_INTERRUPT_RX_MSG_RAW,4,2 ## @AR_MCI_INTERRUPT_RX_MSG_RAW
	.comm	_AR_MCI_INTERRUPT_RAW,4,2       ## @AR_MCI_INTERRUPT_RAW
	.comm	_AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING,4,2 ## @AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING
	.comm	_MCI_BT_AWAKE,8,3               ## @MCI_BT_AWAKE
	.comm	_AR_MCI_BT_PRI0,4,2             ## @AR_MCI_BT_PRI0
	.comm	_AR_MCI_BT_PRI1,4,2             ## @AR_MCI_BT_PRI1
	.comm	_AR_MCI_BT_PRI2,4,2             ## @AR_MCI_BT_PRI2
	.comm	_AR_MCI_BT_PRI3,4,2             ## @AR_MCI_BT_PRI3
	.comm	_AR_MCI_BT_PRI,4,2              ## @AR_MCI_BT_PRI
	.comm	_AR_MCI_INTERRUPT_RX_MSG_CONT_RST,4,2 ## @AR_MCI_INTERRUPT_RX_MSG_CONT_RST
	.comm	_AR_MCI_INTERRUPT_BT_PRI,4,2    ## @AR_MCI_INTERRUPT_BT_PRI
	.comm	_AR_MCI_INTERRUPT_RX_MSG_LNA_INFO,4,2 ## @AR_MCI_INTERRUPT_RX_MSG_LNA_INFO
	.comm	_MCI,4,2                        ## @MCI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MCI WLAN has control over the LNA & BT obeys it\n"

L_.str.1:                               ## @.str.1
	.asciz	"MCI BT didn't respond to LNA_TRANS\n"

	.comm	_AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING,4,2 ## @AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING
	.comm	_AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE,4,2 ## @AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE
	.no_dead_strip	_ar9003_mci_prep_interface
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9003_mci_prep_interface
_ar9003_mci_prep_interface:             ; @ar9003_mci_prep_interface
	.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, x0
	bl	_ath9k_hw_common
	mov	x21, x0
Lloh0:
	adrp	x8, _MCI_BT_SLEEP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MCI_BT_SLEEP@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x19]
Lloh3:
	adrp	x23, _AR_MCI_INTERRUPT_EN@GOTPAGE
Lloh4:
	ldr	x23, [x23, _AR_MCI_INTERRUPT_EN@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_REG_READ
	mov	x20, x0
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
Lloh5:
	adrp	x24, _AR_MCI_INTERRUPT_RX_MSG_RAW@GOTPAGE
Lloh6:
	ldr	x24, [x24, _AR_MCI_INTERRUPT_RX_MSG_RAW@GOTPAGEOFF]
	ldr	w22, [x24]
	mov	x0, x19
	mov	x1, x22
	bl	_REG_READ
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	bl	_REG_WRITE
Lloh7:
	adrp	x25, _AR_MCI_INTERRUPT_RAW@GOTPAGE
Lloh8:
	ldr	x25, [x25, _AR_MCI_INTERRUPT_RAW@GOTPAGEOFF]
	ldr	w22, [x25]
	mov	x0, x19
	mov	x1, x22
	bl	_REG_READ
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	bl	_REG_WRITE
	mov	x0, x19
	mov	w1, #1
	bl	_ar9003_mci_remote_reset
	mov	x0, x19
	mov	w1, #1
	bl	_ar9003_mci_send_req_wake
	ldr	w1, [x24]
Lloh9:
	adrp	x22, _AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING@GOTPAGE
Lloh10:
	ldr	x22, [x22, _AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	mov	w3, #500
	bl	_ar9003_mci_wait_for_interrupt
Lloh11:
	adrp	x26, _MCI_BT_AWAKE@GOTPAGE
Lloh12:
	ldr	x26, [x26, _MCI_BT_AWAKE@GOTPAGEOFF]
	cbz	x0, LBB0_8
; %bb.1:
	ldr	x8, [x26]
	str	x8, [x19]
	mov	x0, x19
	mov	w1, #1
	bl	_ar9003_mci_send_sys_waking
	mov	w0, #10
	bl	_udelay
Lloh13:
	adrp	x8, _AR_MCI_BT_PRI0@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AR_MCI_BT_PRI0@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_REG_WRITE
Lloh16:
	adrp	x8, _AR_MCI_BT_PRI1@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AR_MCI_BT_PRI1@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_REG_WRITE
Lloh19:
	adrp	x8, _AR_MCI_BT_PRI2@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AR_MCI_BT_PRI2@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_REG_WRITE
Lloh22:
	adrp	x8, _AR_MCI_BT_PRI3@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AR_MCI_BT_PRI3@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_REG_WRITE
Lloh25:
	adrp	x8, _AR_MCI_BT_PRI@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AR_MCI_BT_PRI@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #255
	bl	_REG_WRITE
	ldr	w1, [x24]
Lloh28:
	adrp	x8, _AR_MCI_INTERRUPT_RX_MSG_CONT_RST@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AR_MCI_INTERRUPT_RX_MSG_CONT_RST@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_WRITE
	ldr	w1, [x25]
Lloh31:
	adrp	x8, _AR_MCI_INTERRUPT_BT_PRI@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AR_MCI_INTERRUPT_BT_PRI@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_WRITE
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_8
; %bb.2:
	mov	x0, x19
	bl	_MCI_ANT_ARCH_PA_LNA_SHARED
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	w1, #1
	bl	_ar9003_mci_send_lna_transfer
	mov	w0, #5
	bl	_udelay
LBB0_4:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_8
; %bb.6:
	mov	x0, x19
	bl	_MCI_ANT_ARCH_PA_LNA_SHARED
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w1, [x24]
Lloh34:
	adrp	x8, _AR_MCI_INTERRUPT_RX_MSG_LNA_INFO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _AR_MCI_INTERRUPT_RX_MSG_LNA_INFO@GOTPAGEOFF]
Lloh36:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #150
	bl	_ar9003_mci_wait_for_interrupt
Lloh37:
	adrp	x8, _MCI@GOTPAGE
Lloh38:
	ldr	x8, [x8, _MCI@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
Lloh40:
	adrp	x8, l_.str@PAGE
Lloh41:
	add	x8, x8, l_.str@PAGEOFF
Lloh42:
	adrp	x9, l_.str.1@PAGE
Lloh43:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	x0, #0
	csel	x2, x9, x8, eq
	mov	x0, x21
	bl	_ath_dbg
LBB0_8:
	ldr	x8, [x19]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.9:
	ldr	w1, [x24]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_REG_READ_FIELD
	cbz	x0, LBB0_12
; %bb.10:
	ldr	w1, [x24]
Lloh44:
	adrp	x8, _AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING@GOTPAGE
Lloh45:
	ldr	x8, [x8, _AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_READ_FIELD
	cbnz	x0, LBB0_12
; %bb.11:
	ldr	w1, [x24]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_REG_WRITE
	ldr	w1, [x25]
Lloh47:
	adrp	x8, _AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE@GOTPAGE
Lloh48:
	ldr	x8, [x8, _AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE@GOTPAGEOFF]
Lloh49:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_WRITE
LBB0_12:
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, 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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_REG_WRITE
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_MCI_BT_SLEEP,8,3               ; @MCI_BT_SLEEP
	.comm	_AR_MCI_INTERRUPT_EN,4,2        ; @AR_MCI_INTERRUPT_EN
	.comm	_AR_MCI_INTERRUPT_RX_MSG_RAW,4,2 ; @AR_MCI_INTERRUPT_RX_MSG_RAW
	.comm	_AR_MCI_INTERRUPT_RAW,4,2       ; @AR_MCI_INTERRUPT_RAW
	.comm	_AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING,4,2 ; @AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING
	.comm	_MCI_BT_AWAKE,8,3               ; @MCI_BT_AWAKE
	.comm	_AR_MCI_BT_PRI0,4,2             ; @AR_MCI_BT_PRI0
	.comm	_AR_MCI_BT_PRI1,4,2             ; @AR_MCI_BT_PRI1
	.comm	_AR_MCI_BT_PRI2,4,2             ; @AR_MCI_BT_PRI2
	.comm	_AR_MCI_BT_PRI3,4,2             ; @AR_MCI_BT_PRI3
	.comm	_AR_MCI_BT_PRI,4,2              ; @AR_MCI_BT_PRI
	.comm	_AR_MCI_INTERRUPT_RX_MSG_CONT_RST,4,2 ; @AR_MCI_INTERRUPT_RX_MSG_CONT_RST
	.comm	_AR_MCI_INTERRUPT_BT_PRI,4,2    ; @AR_MCI_INTERRUPT_BT_PRI
	.comm	_AR_MCI_INTERRUPT_RX_MSG_LNA_INFO,4,2 ; @AR_MCI_INTERRUPT_RX_MSG_LNA_INFO
	.comm	_MCI,4,2                        ; @MCI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MCI WLAN has control over the LNA & BT obeys it\n"

l_.str.1:                               ; @.str.1
	.asciz	"MCI BT didn't respond to LNA_TRANS\n"

	.comm	_AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING,4,2 ; @AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING
	.comm	_AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE,4,2 ; @AR_MCI_INTERRUPT_REMOTE_SLEEP_UPDATE
	.no_dead_strip	_ar9003_mci_prep_interface
.subsections_via_symbols
