	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_phy_reg                  ## -- Begin function write_phy_reg
	.p2align	4, 0x90
_write_phy_reg:                         ## @write_phy_reg
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	16(%rdi), %r12
	movq	_phyregaddr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_D11REGOFFS
	shll	$16, %ebx
	orl	%r14d, %ebx
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_bcma_write32
	movq	16(%r15), %r14
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	_BCMA_HOSTTYPE_PCI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	(%r15), %rax
	incq	%rax
	movq	%rax, (%r15)
	cmpq	8(%r15), %rax
	jge	LBB0_3
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	$0, (%r15)
	movq	_phyversion@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_D11REGOFFS
	movq	%r14, %rdi
	movl	%eax, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bcma_read16                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_phyregaddr,4,2                 ## @phyregaddr
	.comm	_BCMA_HOSTTYPE_PCI,8,3          ## @BCMA_HOSTTYPE_PCI
	.comm	_phyversion,4,2                 ## @phyversion
	.comm	_phyregdata,4,2                 ## @phyregdata
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_phy_reg                  ; -- Begin function write_phy_reg
	.p2align	2
_write_phy_reg:                         ; @write_phy_reg
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #16]
Lloh0:
	adrp	x8, _phyregaddr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _phyregaddr@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_D11REGOFFS
	mov	x1, x0
	orr	w2, w21, w20, lsl #16
	mov	x0, x22
	bl	_bcma_write32
	ldr	x20, [x19, #16]
	ldr	x8, [x20]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _BCMA_HOSTTYPE_PCI@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BCMA_HOSTTYPE_PCI@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldp	x8, x9, [x19]
	add	x8, x8, #1
	str	x8, [x19]
	cmp	x8, x9
	b.ge	LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
	str	xzr, [x19]
Lloh6:
	adrp	x8, _phyversion@GOTPAGE
Lloh7:
	ldr	x8, [x8, _phyversion@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_D11REGOFFS
	mov	x1, x0
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_bcma_read16
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_phyregaddr,4,2                 ; @phyregaddr
	.comm	_BCMA_HOSTTYPE_PCI,8,3          ; @BCMA_HOSTTYPE_PCI
	.comm	_phyversion,4,2                 ; @phyversion
	.comm	_phyregdata,4,2                 ; @phyregdata
.subsections_via_symbols
