	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_pcie_init_scratchbuffers
_brcmf_pcie_init_scratchbuffers:        ## @brcmf_pcie_init_scratchbuffers
	.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, %rbx
	movq	40(%rdi), %rdi
	callq	_dev_get_drvdata
	movq	%rax, %r15
	movq	40(%rbx), %rdi
	movq	_BRCMF_DMA_D2H_SCRATCH_BUF_LEN@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	24(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	(%rbx), %r13
	movq	_BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	leaq	(%r14,%r13), %rsi
	movl	24(%rbx), %edx
	movq	%rbx, %rdi
	callq	_brcmf_pcie_write_tcm32
	leaq	(%r14,%r13), %rsi
	addq	$4, %rsi
	movq	%rbx, %rdi
	callq	_brcmf_pcie_write_tcm32
	movq	_BRCMF_SHARED_DMA_SCRATCH_LEN_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_brcmf_pcie_write_tcm32
	movq	40(%rbx), %rdi
	movq	_BRCMF_DMA_D2H_RINGUPD_BUF_LEN@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	8(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	(%rbx), %r14
	movq	_BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	leaq	(%r15,%r14), %rsi
	movl	8(%rbx), %edx
	movq	%rbx, %rdi
	callq	_brcmf_pcie_write_tcm32
	leaq	(%r15,%r14), %rsi
	addq	$4, %rsi
	movq	%rbx, %rdi
	callq	_brcmf_pcie_write_tcm32
	movq	_BRCMF_SHARED_DMA_RINGUPD_LEN_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_brcmf_pcie_write_tcm32
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_brcmf_err
	movq	%rbx, %rdi
	callq	_brcmf_pcie_release_scratchbuffers
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BRCMF_DMA_D2H_SCRATCH_BUF_LEN,4,2 ## @BRCMF_DMA_D2H_SCRATCH_BUF_LEN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET,8,3 ## @BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET
	.comm	_BRCMF_SHARED_DMA_SCRATCH_LEN_OFFSET,8,3 ## @BRCMF_SHARED_DMA_SCRATCH_LEN_OFFSET
	.comm	_BRCMF_DMA_D2H_RINGUPD_BUF_LEN,4,2 ## @BRCMF_DMA_D2H_RINGUPD_BUF_LEN
	.comm	_BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET,8,3 ## @BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET
	.comm	_BRCMF_SHARED_DMA_RINGUPD_LEN_OFFSET,8,3 ## @BRCMF_SHARED_DMA_RINGUPD_LEN_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Allocating scratch buffers failed\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_brcmf_pcie_init_scratchbuffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_pcie_init_scratchbuffers
_brcmf_pcie_init_scratchbuffers:        ; @brcmf_pcie_init_scratchbuffers
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x0, [x0, #40]
	bl	_dev_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x23, _BRCMF_DMA_D2H_SCRATCH_BUF_LEN@GOTPAGE
Lloh1:
	ldr	x23, [x23, _BRCMF_DMA_D2H_SCRATCH_BUF_LEN@GOTPAGEOFF]
	ldr	x0, [x19, #40]
	ldr	w1, [x23]
	add	x2, x19, #24
Lloh2:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x22]
	bl	_dma_alloc_coherent
	str	x0, [x19, #32]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19]
Lloh4:
	adrp	x9, _BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET@GOTPAGE
Lloh5:
	ldr	x9, [x9, _BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	add	x21, x9, x8
	ldr	w2, [x19, #24]
	mov	x0, x19
	mov	x1, x21
	bl	_brcmf_pcie_write_tcm32
	add	x1, x21, #4
	mov	x0, x19
	bl	_brcmf_pcie_write_tcm32
	ldr	x8, [x19]
Lloh7:
	adrp	x9, _BRCMF_SHARED_DMA_SCRATCH_LEN_OFFSET@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BRCMF_SHARED_DMA_SCRATCH_LEN_OFFSET@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	add	x1, x9, x8
	ldr	w2, [x23]
	mov	x0, x19
	bl	_brcmf_pcie_write_tcm32
	ldr	x0, [x19, #40]
Lloh10:
	adrp	x21, _BRCMF_DMA_D2H_RINGUPD_BUF_LEN@GOTPAGE
Lloh11:
	ldr	x21, [x21, _BRCMF_DMA_D2H_RINGUPD_BUF_LEN@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, x19, #8
	ldr	w3, [x22]
	bl	_dma_alloc_coherent
	str	x0, [x19, #16]
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x8, [x19]
Lloh12:
	adrp	x9, _BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET@GOTPAGE
Lloh13:
	ldr	x9, [x9, _BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x20, x9, x8
	ldr	w2, [x19, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_brcmf_pcie_write_tcm32
	add	x1, x20, #4
	mov	x0, x19
	bl	_brcmf_pcie_write_tcm32
	ldr	x8, [x19]
Lloh15:
	adrp	x9, _BRCMF_SHARED_DMA_RINGUPD_LEN_OFFSET@GOTPAGE
Lloh16:
	ldr	x9, [x9, _BRCMF_SHARED_DMA_RINGUPD_LEN_OFFSET@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	ldr	w2, [x21]
	mov	x0, x19
	bl	_brcmf_pcie_write_tcm32
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_brcmf_err
	mov	x0, x19
	bl	_brcmf_pcie_release_scratchbuffers
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_BRCMF_DMA_D2H_SCRATCH_BUF_LEN,4,2 ; @BRCMF_DMA_D2H_SCRATCH_BUF_LEN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET,8,3 ; @BRCMF_SHARED_DMA_SCRATCH_ADDR_OFFSET
	.comm	_BRCMF_SHARED_DMA_SCRATCH_LEN_OFFSET,8,3 ; @BRCMF_SHARED_DMA_SCRATCH_LEN_OFFSET
	.comm	_BRCMF_DMA_D2H_RINGUPD_BUF_LEN,4,2 ; @BRCMF_DMA_D2H_RINGUPD_BUF_LEN
	.comm	_BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET,8,3 ; @BRCMF_SHARED_DMA_RINGUPD_ADDR_OFFSET
	.comm	_BRCMF_SHARED_DMA_RINGUPD_LEN_OFFSET,8,3 ; @BRCMF_SHARED_DMA_RINGUPD_LEN_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Allocating scratch buffers failed\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_brcmf_pcie_init_scratchbuffers
.subsections_via_symbols
