	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_pcie_alloc_dma_and_ring
_brcmf_pcie_alloc_dma_and_ring:         ## @brcmf_pcie_alloc_dma_and_ring
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	_BRCMF_PCIE_SHARED_VERSION_7@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.1:
	movq	_brcmf_ring_itemsize_pre_v7@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_brcmf_ring_itemsize@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %r13
	movq	_brcmf_ring_max_item@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r13,%r15,8), %r12
	imulq	(%rax,%r15,8), %r12
	movq	_BRCMF_RING_MEM_BASE_ADDR_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	addq	%rbx, %rdx
	leaq	-44(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_brcmf_pcie_init_dmabuffer_for_device
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_BRCMF_RING_MAX_ITEM_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	movq	_brcmf_ring_max_item@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rdx
	movq	%r14, %rdi
	callq	_brcmf_pcie_write_tcm16
	movq	_BRCMF_RING_LEN_ITEMS_OFFSET@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movq	(%r13,%r15,8), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_brcmf_pcie_write_tcm16
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%rax, %rbx
	movq	_brcmf_ring_max_item@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rsi
	movq	(%r13,%r15,8), %rdx
	movq	%rbx, %rdi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_brcmf_commonring_config
	movl	-44(%rbp), %eax
	movl	%eax, 16(%rbx)
	movq	%r14, 8(%rbx)
	movq	_brcmf_pcie_ring_mb_ring_bell@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_brcmf_pcie_ring_mb_update_rptr@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_brcmf_pcie_ring_mb_update_wptr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_brcmf_pcie_ring_mb_write_rptr@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_brcmf_pcie_ring_mb_write_wptr@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%rbx, (%rsp)
	movq	%rbx, %rdi
	callq	_brcmf_commonring_register_cb
	jmp	LBB0_9
LBB0_7:
	movq	(%r14), %rdi
	movl	-44(%rbp), %ecx
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_dma_free_coherent
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BRCMF_PCIE_SHARED_VERSION_7,8,3 ## @BRCMF_PCIE_SHARED_VERSION_7
	.comm	_brcmf_ring_itemsize_pre_v7,8,3 ## @brcmf_ring_itemsize_pre_v7
	.comm	_brcmf_ring_itemsize,8,3        ## @brcmf_ring_itemsize
	.comm	_brcmf_ring_max_item,8,3        ## @brcmf_ring_max_item
	.comm	_BRCMF_RING_MEM_BASE_ADDR_OFFSET,8,3 ## @BRCMF_RING_MEM_BASE_ADDR_OFFSET
	.comm	_BRCMF_RING_MAX_ITEM_OFFSET,8,3 ## @BRCMF_RING_MAX_ITEM_OFFSET
	.comm	_BRCMF_RING_LEN_ITEMS_OFFSET,8,3 ## @BRCMF_RING_LEN_ITEMS_OFFSET
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_brcmf_pcie_ring_mb_ring_bell,4,2 ## @brcmf_pcie_ring_mb_ring_bell
	.comm	_brcmf_pcie_ring_mb_update_rptr,4,2 ## @brcmf_pcie_ring_mb_update_rptr
	.comm	_brcmf_pcie_ring_mb_update_wptr,4,2 ## @brcmf_pcie_ring_mb_update_wptr
	.comm	_brcmf_pcie_ring_mb_write_rptr,4,2 ## @brcmf_pcie_ring_mb_write_rptr
	.comm	_brcmf_pcie_ring_mb_write_wptr,4,2 ## @brcmf_pcie_ring_mb_write_wptr
	.no_dead_strip	_brcmf_pcie_alloc_dma_and_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_pcie_alloc_dma_and_ring
_brcmf_pcie_alloc_dma_and_ring:         ; @brcmf_pcie_alloc_dma_and_ring
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x2
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _BRCMF_PCIE_SHARED_VERSION_7@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BRCMF_PCIE_SHARED_VERSION_7@GOTPAGEOFF]
Lloh2:
	adrp	x10, _brcmf_ring_itemsize_pre_v7@GOTPAGE
Lloh3:
	ldr	x10, [x10, _brcmf_ring_itemsize_pre_v7@GOTPAGEOFF]
Lloh4:
	adrp	x11, _brcmf_ring_itemsize@GOTPAGE
Lloh5:
	ldr	x11, [x11, _brcmf_ring_itemsize@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, x10, x11, lt
	ldr	x23, [x8]
Lloh7:
	adrp	x24, _brcmf_ring_max_item@GOTPAGE
Lloh8:
	ldr	x24, [x24, _brcmf_ring_max_item@GOTPAGEOFF]
	ldr	x8, [x24]
	lsl	x25, x1, #3
	ldr	x8, [x8, x25]
	ldr	x9, [x23, x25]
	mul	x20, x9, x8
Lloh9:
	adrp	x8, _BRCMF_RING_MEM_BASE_ADDR_OFFSET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BRCMF_RING_MEM_BASE_ADDR_OFFSET@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	add	x2, x8, x2
	add	x3, sp, #12
	mov	x1, x20
	bl	_brcmf_pcie_init_dmabuffer_for_device
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
Lloh12:
	adrp	x8, _BRCMF_RING_MAX_ITEM_OFFSET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BRCMF_RING_MAX_ITEM_OFFSET@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x1, x8, x22
	ldr	x8, [x24]
	ldr	x2, [x8, x25]
	mov	x0, x19
	bl	_brcmf_pcie_write_tcm16
Lloh15:
	adrp	x8, _BRCMF_RING_LEN_ITEMS_OFFSET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BRCMF_RING_LEN_ITEMS_OFFSET@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	add	x1, x8, x22
	ldr	x2, [x23, x25]
	mov	x0, x19
	bl	_brcmf_pcie_write_tcm16
Lloh18:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	mov	x22, x0
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x24]
	ldr	x1, [x8, x25]
	ldr	x2, [x23, x25]
	mov	x0, x22
	mov	x3, x21
	bl	_brcmf_commonring_config
	ldr	w8, [sp, #12]
	str	w8, [x22, #16]
	str	x19, [x22, #8]
Lloh21:
	adrp	x8, _brcmf_pcie_ring_mb_ring_bell@GOTPAGE
Lloh22:
	ldr	x8, [x8, _brcmf_pcie_ring_mb_ring_bell@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _brcmf_pcie_ring_mb_update_rptr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _brcmf_pcie_ring_mb_update_rptr@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
Lloh27:
	adrp	x8, _brcmf_pcie_ring_mb_update_wptr@GOTPAGE
Lloh28:
	ldr	x8, [x8, _brcmf_pcie_ring_mb_update_wptr@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
Lloh30:
	adrp	x8, _brcmf_pcie_ring_mb_write_rptr@GOTPAGE
Lloh31:
	ldr	x8, [x8, _brcmf_pcie_ring_mb_write_rptr@GOTPAGEOFF]
Lloh32:
	ldr	w4, [x8]
Lloh33:
	adrp	x8, _brcmf_pcie_ring_mb_write_wptr@GOTPAGE
Lloh34:
	ldr	x8, [x8, _brcmf_pcie_ring_mb_write_wptr@GOTPAGEOFF]
Lloh35:
	ldr	w5, [x8]
	mov	x0, x22
	mov	x6, x22
	bl	_brcmf_commonring_register_cb
	b	LBB0_5
LBB0_3:
	mov	x22, #0
	b	LBB0_5
LBB0_4:
	ldr	x0, [x19]
	ldr	w3, [sp, #12]
	mov	x1, x20
	mov	x2, x21
	bl	_dma_free_coherent
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh6
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_BRCMF_PCIE_SHARED_VERSION_7,8,3 ; @BRCMF_PCIE_SHARED_VERSION_7
	.comm	_brcmf_ring_itemsize_pre_v7,8,3 ; @brcmf_ring_itemsize_pre_v7
	.comm	_brcmf_ring_itemsize,8,3        ; @brcmf_ring_itemsize
	.comm	_brcmf_ring_max_item,8,3        ; @brcmf_ring_max_item
	.comm	_BRCMF_RING_MEM_BASE_ADDR_OFFSET,8,3 ; @BRCMF_RING_MEM_BASE_ADDR_OFFSET
	.comm	_BRCMF_RING_MAX_ITEM_OFFSET,8,3 ; @BRCMF_RING_MAX_ITEM_OFFSET
	.comm	_BRCMF_RING_LEN_ITEMS_OFFSET,8,3 ; @BRCMF_RING_LEN_ITEMS_OFFSET
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_brcmf_pcie_ring_mb_ring_bell,4,2 ; @brcmf_pcie_ring_mb_ring_bell
	.comm	_brcmf_pcie_ring_mb_update_rptr,4,2 ; @brcmf_pcie_ring_mb_update_rptr
	.comm	_brcmf_pcie_ring_mb_update_wptr,4,2 ; @brcmf_pcie_ring_mb_update_wptr
	.comm	_brcmf_pcie_ring_mb_write_rptr,4,2 ; @brcmf_pcie_ring_mb_write_rptr
	.comm	_brcmf_pcie_ring_mb_write_wptr,4,2 ; @brcmf_pcie_ring_mb_write_wptr
	.no_dead_strip	_brcmf_pcie_alloc_dma_and_ring
.subsections_via_symbols
