	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brcms_b_write_template_ram     ## -- Begin function brcms_b_write_template_ram
	.p2align	4, 0x90
_brcms_b_write_template_ram:            ## @brcms_b_write_template_ram
	.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	%rcx, %r14
	movl	%edx, %ebx
	movl	%esi, %r12d
	movq	8(%rdi), %r15
	movl	(%rdi), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_brcms_dbg_info
	movq	_tplatewrptr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_D11REGOFFS
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_bcma_write32
	movq	_maccontrol@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_D11REGOFFS
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_bcma_read32
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.1:
	movl	%eax, %r12d
	movq	_MCTL_BIGEND@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	addl	$4, %ebx
	movq	_tplatewrdata@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	callq	_cpu_to_le32
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, -44(%rbp)
	movl	(%r13), %edi
	callq	_D11REGOFFS
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_bcma_write32
	addq	$16, %r14
	addl	$-4, %ebx
	cmpl	$4, %ebx
	jle	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-44(%rbp), %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	callq	_memcpy
	movl	-44(%rbp), %edi
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_cpu_to_be32
	jmp	LBB0_5
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wl%d\n"

	.comm	_tplatewrptr,4,2                ## @tplatewrptr
	.comm	_maccontrol,4,2                 ## @maccontrol
	.comm	_MCTL_BIGEND,4,2                ## @MCTL_BIGEND
	.comm	_tplatewrdata,4,2               ## @tplatewrdata
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_brcms_b_write_template_ram     ; -- Begin function brcms_b_write_template_ram
	.p2align	2
_brcms_b_write_template_ram:            ; @brcms_b_write_template_ram
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x3
	mov	x21, x2
	mov	x22, x1
	ldr	x20, [x0, #8]
	ldr	w2, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_brcms_dbg_info
Lloh2:
	adrp	x8, _tplatewrptr@GOTPAGE
Lloh3:
	ldr	x8, [x8, _tplatewrptr@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_D11REGOFFS
	mov	x1, x0
	mov	x0, x20
	mov	x2, x22
	bl	_bcma_write32
Lloh5:
	adrp	x8, _maccontrol@GOTPAGE
Lloh6:
	ldr	x8, [x8, _maccontrol@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_D11REGOFFS
	mov	x1, x0
	mov	x0, x20
	bl	_bcma_read32
	cmp	w21, #1
	b.lt	LBB0_6
; %bb.1:
Lloh8:
	adrp	x8, _MCTL_BIGEND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MCTL_BIGEND@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	and	w22, w8, w0
	add	w21, w21, #4
Lloh11:
	adrp	x23, _tplatewrdata@GOTPAGE
Lloh12:
	ldr	x23, [x23, _tplatewrdata@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_cpu_to_le32
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	w0, [sp, #12]
	ldr	w0, [x23]
	bl	_D11REGOFFS
	mov	x1, x0
	ldr	w2, [sp, #12]
	mov	x0, x20
	bl	_bcma_write32
	add	x19, x19, #16
	sub	w21, w21, #4
	cmp	w21, #4
	b.le	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #12
	mov	x1, x19
	mov	w2, #4
	bl	_memcpy
	ldr	w0, [sp, #12]
	cbz	w22, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_cpu_to_be32
	b	LBB0_3
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wl%d\n"

	.comm	_tplatewrptr,4,2                ; @tplatewrptr
	.comm	_maccontrol,4,2                 ; @maccontrol
	.comm	_MCTL_BIGEND,4,2                ; @MCTL_BIGEND
	.comm	_tplatewrdata,4,2               ; @tplatewrdata
.subsections_via_symbols
