	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar9003_mci_send_message        ## -- Begin function ar9003_mci_send_message
	.p2align	4, 0x90
_ar9003_mci_send_message:               ## @ar9003_mci_send_message
	.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	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r12d
	movq	%rcx, %r14
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_ath9k_hw_common
	movq	%rax, %r13
	movq	_AR_MCI_INTERRUPT_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_REG_READ
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_AR_BTCOEX_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_REG_READ
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	je	LBB0_2
## %bb.1:
	movq	_AR_BTCOEX_CTRL_MCI_MODE_EN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.3:
	cmpl	$0, 16(%rbp)
	je	LBB0_7
## %bb.4:
	movq	8(%r15), %rax
	movq	_MCI_BT_SLEEP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.5:
	movq	_MCI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	jmp	LBB0_6
LBB0_2:
	movq	_MCI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %rax
	movq	_ATH9K_PM_FULL_SLEEP@GOTPCREL(%rip), %rcx
	xorl	%r8d, %r8d
	cmpq	(%rcx), %rax
	sete	%r8b
	leaq	L_.str(%rip), %rdx
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
LBB0_6:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	_ar9003_mci_queue_unsent_gpm
LBB0_16:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_9
## %bb.8:
	movq	_AR_MCI_INTERRUPT_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_REG_WRITE
LBB0_9:
	movq	_AR_MCI_INTERRUPT_RAW@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_AR_MCI_INTERRUPT_SW_MSG_DONE@GOTPCREL(%rip), %rcx
	movq	_AR_MCI_INTERRUPT_MSG_FAIL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%rcx), %edx
	movq	%r15, %rdi
	callq	_REG_WRITE
	testq	%r14, %r14
	je	LBB0_13
## %bb.10:
	testl	%r12d, %r12d
	jle	LBB0_13
## %bb.11:
	xorl	%ebx, %ebx
	movq	_AR_MCI_TX_PAYLOAD0@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %esi
	addq	(%r13), %rsi
	movl	(%r14,%rbx), %edx
	movq	%r15, %rdi
	callq	_REG_WRITE
	addq	$4, %rbx
	cmpl	%r12d, %ebx
	jl	LBB0_12
LBB0_13:
	movq	_AR_MCI_COMMAND0@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_MCI_FLAG_DISABLE_TIMESTAMP@GOTPCREL(%rip), %rax
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	andl	(%rax), %edi
	movq	_AR_MCI_COMMAND0_DISABLE_TIMESTAMP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SM
	movl	%eax, %r13d
	movq	_AR_MCI_COMMAND0_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	callq	_SM
	movl	%eax, %r12d
	movq	_AR_MCI_COMMAND0_HEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_SM
	orl	%eax, %r12d
	orl	%r13d, %r12d
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_REG_WRITE
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_14
## %bb.15:
	movq	_AR_MCI_INTERRUPT_RAW@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_AR_MCI_INTERRUPT_SW_MSG_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$500, %ecx                      ## imm = 0x1F4
	callq	_ar9003_mci_wait_for_interrupt
	xorl	%r12d, %r12d
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setne	%r12b
	sete	%cl
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r14, %rdx
	callq	_ar9003_mci_queue_unsent_gpm
	movq	_AR_MCI_INTERRUPT_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_REG_WRITE
	jmp	LBB0_16
LBB0_14:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r14, %rdx
	xorl	%ecx, %ecx
	callq	_ar9003_mci_queue_unsent_gpm
	movl	$1, %r12d
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_AR_MCI_INTERRUPT_EN,8,3        ## @AR_MCI_INTERRUPT_EN
	.comm	_AR_BTCOEX_CTRL,8,3             ## @AR_BTCOEX_CTRL
	.comm	_AR_BTCOEX_CTRL_MCI_MODE_EN,4,2 ## @AR_BTCOEX_CTRL_MCI_MODE_EN
	.comm	_MCI,4,2                        ## @MCI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MCI Not sending 0x%x. MCI is not enabled. full_sleep = %d\n"

	.comm	_ATH9K_PM_FULL_SLEEP,8,3        ## @ATH9K_PM_FULL_SLEEP
	.comm	_MCI_BT_SLEEP,8,3               ## @MCI_BT_SLEEP
L_.str.1:                               ## @.str.1
	.asciz	"MCI Don't send message 0x%x. BT is in sleep state\n"

	.comm	_AR_MCI_INTERRUPT_RAW,8,3       ## @AR_MCI_INTERRUPT_RAW
	.comm	_AR_MCI_INTERRUPT_SW_MSG_DONE,4,2 ## @AR_MCI_INTERRUPT_SW_MSG_DONE
	.comm	_AR_MCI_INTERRUPT_MSG_FAIL_MASK,4,2 ## @AR_MCI_INTERRUPT_MSG_FAIL_MASK
	.comm	_AR_MCI_TX_PAYLOAD0,8,3         ## @AR_MCI_TX_PAYLOAD0
	.comm	_AR_MCI_COMMAND0,8,3            ## @AR_MCI_COMMAND0
	.comm	_MCI_FLAG_DISABLE_TIMESTAMP,4,2 ## @MCI_FLAG_DISABLE_TIMESTAMP
	.comm	_AR_MCI_COMMAND0_DISABLE_TIMESTAMP,4,2 ## @AR_MCI_COMMAND0_DISABLE_TIMESTAMP
	.comm	_AR_MCI_COMMAND0_LEN,4,2        ## @AR_MCI_COMMAND0_LEN
	.comm	_AR_MCI_COMMAND0_HEADER,4,2     ## @AR_MCI_COMMAND0_HEADER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar9003_mci_send_message        ; -- Begin function ar9003_mci_send_message
	.p2align	2
_ar9003_mci_send_message:               ; @ar9003_mci_send_message
	.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	x27, x6
	mov	x23, x5
	mov	x24, x4
	mov	x19, x3
	mov	x25, x2
	mov	x21, x1
	mov	x20, x0
	bl	_ath9k_hw_common
	mov	x26, x0
Lloh0:
	adrp	x28, _AR_MCI_INTERRUPT_EN@GOTPAGE
Lloh1:
	ldr	x28, [x28, _AR_MCI_INTERRUPT_EN@GOTPAGEOFF]
	ldr	x1, [x28]
	mov	x0, x20
	bl	_REG_READ
	mov	x22, x0
Lloh2:
	adrp	x8, _AR_BTCOEX_CTRL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AR_BTCOEX_CTRL@GOTPAGEOFF]
Lloh4:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_REG_READ
	mov	w8, #48879
	movk	w8, #57005, lsl #16
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.1:
Lloh5:
	adrp	x8, _AR_BTCOEX_CTRL_MCI_MODE_EN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AR_BTCOEX_CTRL_MCI_MODE_EN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.2:
	cbz	w27, LBB0_8
; %bb.3:
	ldr	x8, [x20, #8]
Lloh8:
	adrp	x9, _MCI_BT_SLEEP@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MCI_BT_SLEEP@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.4:
Lloh11:
	adrp	x8, _MCI@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MCI@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str.1@PAGE
Lloh15:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh16:
	adrp	x8, _MCI@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MCI@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	ldr	x8, [x20]
Lloh19:
	adrp	x9, _ATH9K_PM_FULL_SLEEP@GOTPAGE
Lloh20:
	ldr	x9, [x9, _ATH9K_PM_FULL_SLEEP@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, eq
	str	x8, [sp]
Lloh22:
	adrp	x2, l_.str@PAGE
Lloh23:
	add	x2, x2, l_.str@PAGEOFF
LBB0_6:
	mov	x0, x26
	mov	x3, x21
	bl	_ath_dbg
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	mov	w3, #1
	bl	_ar9003_mci_queue_unsent_gpm
	mov	w23, #0
LBB0_7:
	mov	x0, x23
	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_8:
	cbz	w23, LBB0_10
; %bb.9:
	ldr	x1, [x28]
	mov	x0, x20
	mov	w2, #0
	bl	_REG_WRITE
LBB0_10:
Lloh24:
	adrp	x8, _AR_MCI_INTERRUPT_RAW@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AR_MCI_INTERRUPT_RAW@GOTPAGEOFF]
Lloh26:
	adrp	x9, _AR_MCI_INTERRUPT_SW_MSG_DONE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _AR_MCI_INTERRUPT_SW_MSG_DONE@GOTPAGEOFF]
Lloh28:
	ldr	x1, [x8]
Lloh29:
	ldr	w8, [x9]
Lloh30:
	adrp	x9, _AR_MCI_INTERRUPT_MSG_FAIL_MASK@GOTPAGE
Lloh31:
	ldr	x9, [x9, _AR_MCI_INTERRUPT_MSG_FAIL_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_REG_WRITE
	cbz	x19, LBB0_14
; %bb.11:
	cmp	w24, #1
	b.lt	LBB0_14
; %bb.12:
	mov	x26, #0
Lloh33:
	adrp	x27, _AR_MCI_TX_PAYLOAD0@GOTPAGE
Lloh34:
	ldr	x27, [x27, _AR_MCI_TX_PAYLOAD0@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	add	x1, x8, w26, uxtw
	ldr	w2, [x19, x26]
	mov	x0, x20
	bl	_REG_WRITE
	add	x26, x26, #4
	cmp	w26, w24
	b.lt	LBB0_13
LBB0_14:
Lloh35:
	adrp	x8, _AR_MCI_COMMAND0@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AR_MCI_COMMAND0@GOTPAGEOFF]
Lloh37:
	adrp	x9, _MCI_FLAG_DISABLE_TIMESTAMP@GOTPAGE
Lloh38:
	ldr	x9, [x9, _MCI_FLAG_DISABLE_TIMESTAMP@GOTPAGEOFF]
Lloh39:
	ldr	x26, [x8]
Lloh40:
	ldr	w8, [x9]
	and	w0, w8, w25
Lloh41:
	adrp	x8, _AR_MCI_COMMAND0_DISABLE_TIMESTAMP@GOTPAGE
Lloh42:
	ldr	x8, [x8, _AR_MCI_COMMAND0_DISABLE_TIMESTAMP@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	bl	_SM
	mov	x25, x0
Lloh44:
	adrp	x8, _AR_MCI_COMMAND0_LEN@GOTPAGE
Lloh45:
	ldr	x8, [x8, _AR_MCI_COMMAND0_LEN@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_SM
	orr	w24, w0, w25
Lloh47:
	adrp	x8, _AR_MCI_COMMAND0_HEADER@GOTPAGE
Lloh48:
	ldr	x8, [x8, _AR_MCI_COMMAND0_HEADER@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_SM
	orr	w2, w24, w0
	mov	x0, x20
	mov	x1, x26
	bl	_REG_WRITE
	cbz	w23, LBB0_16
; %bb.15:
Lloh50:
	adrp	x8, _AR_MCI_INTERRUPT_RAW@GOTPAGE
Lloh51:
	ldr	x8, [x8, _AR_MCI_INTERRUPT_RAW@GOTPAGEOFF]
Lloh52:
	ldr	x1, [x8]
Lloh53:
	adrp	x8, _AR_MCI_INTERRUPT_SW_MSG_DONE@GOTPAGE
Lloh54:
	ldr	x8, [x8, _AR_MCI_INTERRUPT_SW_MSG_DONE@GOTPAGEOFF]
Lloh55:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w3, #500
	bl	_ar9003_mci_wait_for_interrupt
	cmp	w0, #0
	cset	w23, ne
	cset	w3, eq
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_ar9003_mci_queue_unsent_gpm
	ldr	x1, [x28]
	mov	x0, x20
	mov	x2, x22
	bl	_REG_WRITE
	b	LBB0_7
LBB0_16:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	mov	w3, #0
	bl	_ar9003_mci_queue_unsent_gpm
	mov	w23, #1
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh28
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh39
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_AR_MCI_INTERRUPT_EN,8,3        ; @AR_MCI_INTERRUPT_EN
	.comm	_AR_BTCOEX_CTRL,8,3             ; @AR_BTCOEX_CTRL
	.comm	_AR_BTCOEX_CTRL_MCI_MODE_EN,4,2 ; @AR_BTCOEX_CTRL_MCI_MODE_EN
	.comm	_MCI,4,2                        ; @MCI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MCI Not sending 0x%x. MCI is not enabled. full_sleep = %d\n"

	.comm	_ATH9K_PM_FULL_SLEEP,8,3        ; @ATH9K_PM_FULL_SLEEP
	.comm	_MCI_BT_SLEEP,8,3               ; @MCI_BT_SLEEP
l_.str.1:                               ; @.str.1
	.asciz	"MCI Don't send message 0x%x. BT is in sleep state\n"

	.comm	_AR_MCI_INTERRUPT_RAW,8,3       ; @AR_MCI_INTERRUPT_RAW
	.comm	_AR_MCI_INTERRUPT_SW_MSG_DONE,4,2 ; @AR_MCI_INTERRUPT_SW_MSG_DONE
	.comm	_AR_MCI_INTERRUPT_MSG_FAIL_MASK,4,2 ; @AR_MCI_INTERRUPT_MSG_FAIL_MASK
	.comm	_AR_MCI_TX_PAYLOAD0,8,3         ; @AR_MCI_TX_PAYLOAD0
	.comm	_AR_MCI_COMMAND0,8,3            ; @AR_MCI_COMMAND0
	.comm	_MCI_FLAG_DISABLE_TIMESTAMP,4,2 ; @MCI_FLAG_DISABLE_TIMESTAMP
	.comm	_AR_MCI_COMMAND0_DISABLE_TIMESTAMP,4,2 ; @AR_MCI_COMMAND0_DISABLE_TIMESTAMP
	.comm	_AR_MCI_COMMAND0_LEN,4,2        ; @AR_MCI_COMMAND0_LEN
	.comm	_AR_MCI_COMMAND0_HEADER,4,2     ; @AR_MCI_COMMAND0_HEADER
.subsections_via_symbols
