	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_sdio_hostmail
_brcmf_sdio_hostmail:                   ## @brcmf_sdio_hostmail
	.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
	movq	32(%rdi), %r13
	movq	40(%rdi), %r15
	movq	_SDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	(%r13), %rbx
	movq	_tohostmailboxdata@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SD_REG
	addq	%rax, %rbx
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_brcmf_sdiod_readl
	movl	%eax, %r14d
	cmpl	$0, -44(%rbp)
	jne	LBB0_2
## %bb.1:
	movq	(%r13), %rbx
	movq	_tosbmailbox@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SD_REG
	addq	%rax, %rbx
	movq	_SMB_INT_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rcx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_brcmf_sdiod_writel
LBB0_2:
	addl	$2, 16(%r12)
	movq	_HMB_DATA_FWHALT@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_SDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	(%r15), %rdi
	callq	_brcmf_fw_crashed
LBB0_4:
	movq	_HMB_DATA_NAKHANDLED@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_5
## %bb.6:
	movq	_SDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
	cmpl	$0, 4(%r12)
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_brcmf_err
LBB0_8:
	movl	$0, 4(%r12)
	movq	_I_HMB_FRAME_IND@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_9
LBB0_5:
	xorl	%r13d, %r13d
LBB0_9:
	movq	_HMB_DATA_DEVREADY@GOTPCREL(%rip), %r15
	movq	_HMB_DATA_FWREADY@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	orl	(%r15), %eax
	testl	%r14d, %eax
	je	LBB0_14
## %bb.10:
	movq	_HMB_DATA_VERSION_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%r14d, %edx
	movq	_HMB_DATA_VERSION_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %edx
	movl	%edx, 8(%r12)
	movq	_SDPCM_PROT_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	LBB0_11
## %bb.12:
	movq	_SDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
	jmp	LBB0_13
LBB0_11:
	leaq	L_.str.4(%rip), %rdi
	movl	%edx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_brcmf_err
LBB0_13:
	movq	%r12, %rdi
	callq	_brcmf_sdio_get_console_addr
LBB0_14:
	movq	_HMB_DATA_FC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_HMB_DATA_FCDATA_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%r14d, %eax
	je	LBB0_20
## %bb.15:
	movl	%edx, %esi
	andl	%r14d, %esi
	movq	_HMB_DATA_FCDATA_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %esi
	movl	12(%r12), %ecx
	movl	%ecx, %edi
	notl	%edi
	testl	%edi, %esi
	je	LBB0_17
## %bb.16:
	incl	28(%r12)
LBB0_17:
	movl	%esi, %edi
	notl	%edi
	testl	%edi, %ecx
	je	LBB0_19
## %bb.18:
	incl	24(%r12)
LBB0_19:
	incl	20(%r12)
	movl	%esi, 12(%r12)
LBB0_20:
	orl	(%r15), %eax
	movq	_HMB_DATA_NAKHANDLED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	(%rbx), %eax
	movq	_HMB_DATA_VERSION_MASK@GOTPCREL(%rip), %rcx
	movq	_HMB_DATA_FWHALT@GOTPCREL(%rip), %rsi
	orl	(%rsi), %eax
	orl	%edx, %eax
	orl	(%rcx), %eax
	notl	%eax
	testl	%eax, %r14d
	je	LBB0_22
## %bb.21:
	leaq	L_.str.6(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_brcmf_err
LBB0_22:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDIO,4,2                       ## @SDIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Enter\n"

	.comm	_tohostmailboxdata,4,2          ## @tohostmailboxdata
	.comm	_tosbmailbox,4,2                ## @tosbmailbox
	.comm	_SMB_INT_ACK,4,2                ## @SMB_INT_ACK
	.comm	_HMB_DATA_FWHALT,4,2            ## @HMB_DATA_FWHALT
L_.str.1:                               ## @.str.1
	.asciz	"mailbox indicates firmware halted\n"

	.comm	_HMB_DATA_NAKHANDLED,4,2        ## @HMB_DATA_NAKHANDLED
L_.str.2:                               ## @.str.2
	.asciz	"Dongle reports NAK handled, expect rtx of %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"unexpected NAKHANDLED!\n"

	.comm	_I_HMB_FRAME_IND,4,2            ## @I_HMB_FRAME_IND
	.comm	_HMB_DATA_DEVREADY,4,2          ## @HMB_DATA_DEVREADY
	.comm	_HMB_DATA_FWREADY,4,2           ## @HMB_DATA_FWREADY
	.comm	_HMB_DATA_VERSION_MASK,4,2      ## @HMB_DATA_VERSION_MASK
	.comm	_HMB_DATA_VERSION_SHIFT,4,2     ## @HMB_DATA_VERSION_SHIFT
	.comm	_SDPCM_PROT_VERSION,4,2         ## @SDPCM_PROT_VERSION
L_.str.4:                               ## @.str.4
	.asciz	"Version mismatch, dongle reports %d, expecting %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"Dongle ready, protocol version %d\n"

	.comm	_HMB_DATA_FC,4,2                ## @HMB_DATA_FC
	.comm	_HMB_DATA_FCDATA_MASK,4,2       ## @HMB_DATA_FCDATA_MASK
	.comm	_HMB_DATA_FCDATA_SHIFT,4,2      ## @HMB_DATA_FCDATA_SHIFT
L_.str.6:                               ## @.str.6
	.asciz	"Unknown mailbox data content: 0x%02x\n"

	.no_dead_strip	_brcmf_sdio_hostmail
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_sdio_hostmail
_brcmf_sdio_hostmail:                   ; @brcmf_sdio_hostmail
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x0
	ldp	x22, x21, [x0, #32]
Lloh0:
	adrp	x23, _SDIO@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SDIO@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_brcmf_dbg
	ldr	x20, [x22]
Lloh4:
	adrp	x8, _tohostmailboxdata@GOTPAGE
Lloh5:
	ldr	x8, [x8, _tohostmailboxdata@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_SD_REG
	add	x1, x0, x20
	add	x2, sp, #28
	mov	x0, x21
	bl	_brcmf_sdiod_readl
	mov	x20, x0
	ldr	w8, [sp, #28]
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	x22, [x22]
Lloh7:
	adrp	x8, _tosbmailbox@GOTPAGE
Lloh8:
	ldr	x8, [x8, _tosbmailbox@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_SD_REG
	add	x1, x0, x22
Lloh10:
	adrp	x8, _SMB_INT_ACK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SMB_INT_ACK@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	add	x3, sp, #28
	mov	x0, x21
	bl	_brcmf_sdiod_writel
LBB0_2:
	ldr	w8, [x19, #16]
	add	w8, w8, #2
	str	w8, [x19, #16]
Lloh13:
	adrp	x22, _HMB_DATA_FWHALT@GOTPAGE
Lloh14:
	ldr	x22, [x22, _HMB_DATA_FWHALT@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_4
; %bb.3:
	ldr	w0, [x23]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_brcmf_dbg
	ldr	x0, [x21]
	bl	_brcmf_fw_crashed
LBB0_4:
Lloh17:
	adrp	x24, _HMB_DATA_NAKHANDLED@GOTPAGE
Lloh18:
	ldr	x24, [x24, _HMB_DATA_NAKHANDLED@GOTPAGEOFF]
	ldr	w8, [x24]
	tst	w8, w20
	b.eq	LBB0_8
; %bb.5:
	ldr	w0, [x23]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_brcmf_dbg
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_7
; %bb.6:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_brcmf_err
LBB0_7:
	str	wzr, [x19, #4]
Lloh23:
	adrp	x8, _I_HMB_FRAME_IND@GOTPAGE
Lloh24:
	ldr	x8, [x8, _I_HMB_FRAME_IND@GOTPAGEOFF]
Lloh25:
	ldr	w21, [x8]
	b	LBB0_9
LBB0_8:
	mov	w21, #0
LBB0_9:
Lloh26:
	adrp	x25, _HMB_DATA_DEVREADY@GOTPAGE
Lloh27:
	ldr	x25, [x25, _HMB_DATA_DEVREADY@GOTPAGEOFF]
Lloh28:
	adrp	x26, _HMB_DATA_FWREADY@GOTPAGE
Lloh29:
	ldr	x26, [x26, _HMB_DATA_FWREADY@GOTPAGEOFF]
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w8, w9, w8
Lloh30:
	adrp	x27, _HMB_DATA_VERSION_MASK@GOTPAGE
Lloh31:
	ldr	x27, [x27, _HMB_DATA_VERSION_MASK@GOTPAGEOFF]
	tst	w8, w20
	b.eq	LBB0_14
; %bb.10:
	ldr	w8, [x27]
	and	w8, w8, w20
Lloh32:
	adrp	x9, _HMB_DATA_VERSION_SHIFT@GOTPAGE
Lloh33:
	ldr	x9, [x9, _HMB_DATA_VERSION_SHIFT@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	asr	w8, w8, w9
	str	w8, [x19, #8]
Lloh35:
	adrp	x9, _SDPCM_PROT_VERSION@GOTPAGE
Lloh36:
	ldr	x9, [x9, _SDPCM_PROT_VERSION@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.11:
	ldr	w0, [x23]
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh38:
	adrp	x1, l_.str.5@PAGE
Lloh39:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_brcmf_dbg
	b	LBB0_13
LBB0_12:
	stp	x8, x9, [sp]
Lloh40:
	adrp	x0, l_.str.4@PAGE
Lloh41:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_brcmf_err
LBB0_13:
	mov	x0, x19
	bl	_brcmf_sdio_get_console_addr
LBB0_14:
Lloh42:
	adrp	x8, _HMB_DATA_FC@GOTPAGE
Lloh43:
	ldr	x8, [x8, _HMB_DATA_FC@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x8]
Lloh45:
	adrp	x8, _HMB_DATA_FCDATA_MASK@GOTPAGE
Lloh46:
	ldr	x8, [x8, _HMB_DATA_FCDATA_MASK@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	tst	w9, w20
	b.eq	LBB0_20
; %bb.15:
	and	w10, w8, w20
Lloh48:
	adrp	x11, _HMB_DATA_FCDATA_SHIFT@GOTPAGE
Lloh49:
	ldr	x11, [x11, _HMB_DATA_FCDATA_SHIFT@GOTPAGEOFF]
Lloh50:
	ldr	w11, [x11]
	asr	w10, w10, w11
	ldr	w11, [x19, #12]
	bics	wzr, w10, w11
	b.eq	LBB0_17
; %bb.16:
	ldr	w12, [x19, #28]
	add	w12, w12, #1
	str	w12, [x19, #28]
LBB0_17:
	bics	wzr, w11, w10
	b.eq	LBB0_19
; %bb.18:
	ldr	w11, [x19, #24]
	add	w11, w11, #1
	str	w11, [x19, #24]
LBB0_19:
	ldr	w11, [x19, #20]
	add	w11, w11, #1
	str	w11, [x19, #20]
	str	w10, [x19, #12]
LBB0_20:
	ldr	w10, [x25]
	ldr	w11, [x24]
	ldr	w12, [x26]
	ldr	w13, [x22]
	ldr	w14, [x27]
	orr	w9, w10, w9
	orr	w9, w9, w11
	orr	w9, w9, w12
	orr	w9, w9, w13
	orr	w8, w9, w8
	orr	w8, w8, w14
	bics	wzr, w20, w8
	b.eq	LBB0_22
; %bb.21:
	str	x20, [sp]
Lloh51:
	adrp	x0, l_.str.6@PAGE
Lloh52:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_brcmf_err
LBB0_22:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpAdd	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_SDIO,4,2                       ; @SDIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Enter\n"

	.comm	_tohostmailboxdata,4,2          ; @tohostmailboxdata
	.comm	_tosbmailbox,4,2                ; @tosbmailbox
	.comm	_SMB_INT_ACK,4,2                ; @SMB_INT_ACK
	.comm	_HMB_DATA_FWHALT,4,2            ; @HMB_DATA_FWHALT
l_.str.1:                               ; @.str.1
	.asciz	"mailbox indicates firmware halted\n"

	.comm	_HMB_DATA_NAKHANDLED,4,2        ; @HMB_DATA_NAKHANDLED
l_.str.2:                               ; @.str.2
	.asciz	"Dongle reports NAK handled, expect rtx of %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"unexpected NAKHANDLED!\n"

	.comm	_I_HMB_FRAME_IND,4,2            ; @I_HMB_FRAME_IND
	.comm	_HMB_DATA_DEVREADY,4,2          ; @HMB_DATA_DEVREADY
	.comm	_HMB_DATA_FWREADY,4,2           ; @HMB_DATA_FWREADY
	.comm	_HMB_DATA_VERSION_MASK,4,2      ; @HMB_DATA_VERSION_MASK
	.comm	_HMB_DATA_VERSION_SHIFT,4,2     ; @HMB_DATA_VERSION_SHIFT
	.comm	_SDPCM_PROT_VERSION,4,2         ; @SDPCM_PROT_VERSION
l_.str.4:                               ; @.str.4
	.asciz	"Version mismatch, dongle reports %d, expecting %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"Dongle ready, protocol version %d\n"

	.comm	_HMB_DATA_FC,4,2                ; @HMB_DATA_FC
	.comm	_HMB_DATA_FCDATA_MASK,4,2       ; @HMB_DATA_FCDATA_MASK
	.comm	_HMB_DATA_FCDATA_SHIFT,4,2      ; @HMB_DATA_FCDATA_SHIFT
l_.str.6:                               ; @.str.6
	.asciz	"Unknown mailbox data content: 0x%02x\n"

	.no_dead_strip	_brcmf_sdio_hostmail
.subsections_via_symbols
