	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_msgbuf_rxbuf_ctrl_post
_brcmf_msgbuf_rxbuf_ctrl_post:          ## @brcmf_msgbuf_rxbuf_ctrl_post
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	8(%rdi), %r12
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %rax
	movq	_BRCMF_H2D_MSGRING_CONTROL_SUBMIT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rbx
	movq	%rbx, %rdi
	callq	_brcmf_commonring_lock
	leaq	-56(%rbp), %rdx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_brcmf_commonring_reserve_for_write_multiple
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	cmpq	$0, -56(%rbp)
	jle	LBB0_14
## %bb.2:
	movq	%rax, %r15
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rax), %eax
	movl	%eax, 32(%r15)
	movl	-88(%rbp), %edi
	callq	_cpu_to_le32
	movq	%rax, 24(%r15)
	movl	-96(%rbp), %ebx
	movq	%r12, %rdi
	callq	_cpu_to_le16
	movl	%eax, 16(%r15)
	callq	_cpu_to_le32
	movq	%rax, 8(%r15)
	movl	%ebx, %edi
	callq	_cpu_to_le32
	movq	%rax, (%r15)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_brcmf_commonring_len_item
	cltq
	addq	%rax, %r15
	incq	%r13
	cmpq	-56(%rbp), %r13
	jge	LBB0_13
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	_BRCMF_MSGBUF_MAX_PKT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_brcmu_pkt_buf_get_skb
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r14
	movq	(%rax), %r12
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	(%rcx), %esi
	movq	%r14, %rdx
	xorl	%ecx, %ecx
	leaq	-96(%rbp), %r8
	leaq	-88(%rbp), %r9
	callq	_brcmf_msgbuf_alloc_pktid
	testq	%rax, %rax
	jne	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_MSGBUF_TYPE_EVENT_BUF_POST@GOTPCREL(%rip), %rax
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_MSGBUF_TYPE_IOCTLRESP_BUF_POST@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_8:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_bphy_err
LBB0_14:
	xorl	%r13d, %r13d
	jmp	LBB0_15
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_12
LBB0_11:
	movq	%r14, %rdi
	callq	_dev_kfree_skb_any
	leaq	L_.str.2(%rip), %rsi
LBB0_12:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_bphy_err
	movq	-56(%rbp), %rsi
	subq	%r13, %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_brcmf_commonring_write_cancel
	testq	%r13, %r13
	je	LBB0_14
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_brcmf_commonring_write_complete
LBB0_15:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_brcmf_commonring_unlock
	movq	%r13, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BRCMF_H2D_MSGRING_CONTROL_SUBMIT,8,3 ## @BRCMF_H2D_MSGRING_CONTROL_SUBMIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to reserve space in commonring\n"

	.comm	_BRCMF_MSGBUF_MAX_PKT_SIZE,4,2  ## @BRCMF_MSGBUF_MAX_PKT_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to alloc SKB\n"

L_.str.2:                               ## @.str.2
	.asciz	"No PKTID available !!\n"

	.comm	_MSGBUF_TYPE_EVENT_BUF_POST,4,2 ## @MSGBUF_TYPE_EVENT_BUF_POST
	.comm	_MSGBUF_TYPE_IOCTLRESP_BUF_POST,4,2 ## @MSGBUF_TYPE_IOCTLRESP_BUF_POST
	.no_dead_strip	_brcmf_msgbuf_rxbuf_ctrl_post
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_msgbuf_rxbuf_ctrl_post
_brcmf_msgbuf_rxbuf_ctrl_post:          ; @brcmf_msgbuf_rxbuf_ctrl_post
	.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	x20, x2
	mov	x22, x1
	mov	x23, x0
	ldp	x21, x8, [x0, #8]
Lloh0:
	adrp	x9, _BRCMF_H2D_MSGRING_CONTROL_SUBMIT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BRCMF_H2D_MSGRING_CONTROL_SUBMIT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x19, [x8, x9, lsl #3]
	mov	x0, x19
	bl	_brcmf_commonring_lock
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x20
	bl	_brcmf_commonring_reserve_for_write_multiple
	cbz	x0, LBB0_6
; %bb.1:
	ldr	x8, [sp, #24]
	cmp	x8, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x24, x0
	str	x21, [sp]                       ; 8-byte Folded Spill
	mov	x20, #0
Lloh3:
	adrp	x28, _BRCMF_MSGBUF_MAX_PKT_SIZE@GOTPAGE
Lloh4:
	ldr	x28, [x28, _BRCMF_MSGBUF_MAX_PKT_SIZE@GOTPAGEOFF]
Lloh5:
	adrp	x25, _MSGBUF_TYPE_IOCTLRESP_BUF_POST@GOTPAGE
Lloh6:
	ldr	x25, [x25, _MSGBUF_TYPE_IOCTLRESP_BUF_POST@GOTPAGEOFF]
Lloh7:
	adrp	x21, _MSGBUF_TYPE_EVENT_BUF_POST@GOTPAGE
Lloh8:
	ldr	x21, [x21, _MSGBUF_TYPE_EVENT_BUF_POST@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	ldr	w0, [x28]
	bl	_brcmu_pkt_buf_get_skb
	cbz	x0, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x27, x0
	ldr	x26, [x0]
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	ldr	w1, [x23]
	add	x4, sp, #16
	add	x5, sp, #8
	mov	x2, x27
	mov	w3, #0
	bl	_brcmf_msgbuf_alloc_pktid
	cbnz	x0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w22, #0
	csel	x8, x25, x21, eq
	ldr	w8, [x8]
	str	w8, [x24, #32]
	ldr	w0, [sp, #8]
	bl	_cpu_to_le32
	str	x0, [x24, #24]
	ldr	w27, [sp, #16]
	mov	x0, x26
	bl	_cpu_to_le16
	str	w0, [x24, #16]
	bl	_cpu_to_le32
	str	x0, [x24, #8]
	mov	x0, x27
	bl	_cpu_to_le32
	str	x0, [x24]
	mov	x0, x19
	bl	_brcmf_commonring_len_item
	add	x24, x24, w0, sxtw
	add	x20, x20, #1
	ldr	x8, [sp, #24]
	cmp	x20, x8
	b.lt	LBB0_3
	b	LBB0_11
LBB0_6:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_bphy_err
LBB0_7:
	mov	x20, #0
	b	LBB0_12
LBB0_8:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_9:
	mov	x0, x27
	bl	_dev_kfree_skb_any
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	ldr	x0, [sp]                        ; 8-byte Folded Reload
LBB0_10:
	bl	_bphy_err
	ldr	x8, [sp, #24]
	sub	x1, x8, x20
	mov	x0, x19
	bl	_brcmf_commonring_write_cancel
	cbz	x20, LBB0_12
LBB0_11:
	mov	x0, x19
	bl	_brcmf_commonring_write_complete
LBB0_12:
	mov	x0, x19
	bl	_brcmf_commonring_unlock
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_BRCMF_H2D_MSGRING_CONTROL_SUBMIT,8,3 ; @BRCMF_H2D_MSGRING_CONTROL_SUBMIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to reserve space in commonring\n"

	.comm	_BRCMF_MSGBUF_MAX_PKT_SIZE,4,2  ; @BRCMF_MSGBUF_MAX_PKT_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to alloc SKB\n"

l_.str.2:                               ; @.str.2
	.asciz	"No PKTID available !!\n"

	.comm	_MSGBUF_TYPE_EVENT_BUF_POST,4,2 ; @MSGBUF_TYPE_EVENT_BUF_POST
	.comm	_MSGBUF_TYPE_IOCTLRESP_BUF_POST,4,2 ; @MSGBUF_TYPE_IOCTLRESP_BUF_POST
	.no_dead_strip	_brcmf_msgbuf_rxbuf_ctrl_post
.subsections_via_symbols
