	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netsec_phy_write
_netsec_phy_write:                      ## @netsec_phy_write
	.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
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	(%rdi), %r12
	movq	_GMAC_REG_GDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ecx, %edx
	callq	_netsec_mac_write
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	_GMAC_REG_GAR@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_NETSEC_GMAC_GAR_REG_SHIFT_PA@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r14d, %eax
	shll	%cl, %eax
	movq	_NETSEC_GMAC_GAR_REG_SHIFT_GR@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	movq	_NETSEC_GMAC_GAR_REG_GW@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_NETSEC_GMAC_GAR_REG_GB@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	(%r12), %edi
	callq	_netsec_clk_type
	movq	_GMAC_REG_SHIFT_CR_GAR@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, %ebx
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	callq	_netsec_mac_write
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	movq	_ETIMEDOUT@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
LBB0_3:
	movq	_GMAC_REG_GAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NETSEC_GMAC_GAR_REG_GB@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_netsec_mac_wait_while_busy
	movl	%eax, %ebx
	movq	_MII_PHYSID1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_netsec_phy_read
	movl	%ebx, %eax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_GMAC_REG_GDR,4,2               ## @GMAC_REG_GDR
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_GMAC_REG_GAR,4,2               ## @GMAC_REG_GAR
	.comm	_NETSEC_GMAC_GAR_REG_SHIFT_PA,4,2 ## @NETSEC_GMAC_GAR_REG_SHIFT_PA
	.comm	_NETSEC_GMAC_GAR_REG_SHIFT_GR,4,2 ## @NETSEC_GMAC_GAR_REG_SHIFT_GR
	.comm	_NETSEC_GMAC_GAR_REG_GW,4,2     ## @NETSEC_GMAC_GAR_REG_GW
	.comm	_NETSEC_GMAC_GAR_REG_GB,4,2     ## @NETSEC_GMAC_GAR_REG_GB
	.comm	_GMAC_REG_SHIFT_CR_GAR,4,2      ## @GMAC_REG_SHIFT_CR_GAR
	.comm	_MII_PHYSID1,4,2                ## @MII_PHYSID1
	.no_dead_strip	_netsec_phy_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netsec_phy_write
_netsec_phy_write:                      ; @netsec_phy_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _GMAC_REG_GDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GMAC_REG_GDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x3
	bl	_netsec_mac_write
	cbnz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x24, _GMAC_REG_GAR@GOTPAGE
Lloh4:
	ldr	x24, [x24, _GMAC_REG_GAR@GOTPAGEOFF]
	ldr	w23, [x24]
Lloh5:
	adrp	x8, _NETSEC_GMAC_GAR_REG_SHIFT_PA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NETSEC_GMAC_GAR_REG_SHIFT_PA@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	lsl	w8, w19, w8
Lloh8:
	adrp	x9, _NETSEC_GMAC_GAR_REG_SHIFT_GR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NETSEC_GMAC_GAR_REG_SHIFT_GR@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsl	w9, w22, w9
	orr	w8, w9, w8
Lloh11:
	adrp	x9, _NETSEC_GMAC_GAR_REG_GW@GOTPAGE
Lloh12:
	ldr	x9, [x9, _NETSEC_GMAC_GAR_REG_GW@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh14:
	adrp	x22, _NETSEC_GMAC_GAR_REG_GB@GOTPAGE
Lloh15:
	ldr	x22, [x22, _NETSEC_GMAC_GAR_REG_GB@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w25, w8, w9
	ldr	w0, [x21]
	bl	_netsec_clk_type
Lloh16:
	adrp	x8, _GMAC_REG_SHIFT_CR_GAR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GMAC_REG_SHIFT_CR_GAR@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	orr	w2, w25, w8
	mov	x0, x21
	mov	x1, x23
	bl	_netsec_mac_write
	cbz	x0, LBB0_4
LBB0_2:
Lloh19:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	w1, [x24]
	ldr	w2, [x22]
	mov	x0, x21
	bl	_netsec_mac_wait_while_busy
	mov	x21, x0
Lloh22:
	adrp	x8, _MII_PHYSID1@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MII_PHYSID1@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_netsec_phy_read
	mov	x0, x21
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_GMAC_REG_GDR,4,2               ; @GMAC_REG_GDR
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_GMAC_REG_GAR,4,2               ; @GMAC_REG_GAR
	.comm	_NETSEC_GMAC_GAR_REG_SHIFT_PA,4,2 ; @NETSEC_GMAC_GAR_REG_SHIFT_PA
	.comm	_NETSEC_GMAC_GAR_REG_SHIFT_GR,4,2 ; @NETSEC_GMAC_GAR_REG_SHIFT_GR
	.comm	_NETSEC_GMAC_GAR_REG_GW,4,2     ; @NETSEC_GMAC_GAR_REG_GW
	.comm	_NETSEC_GMAC_GAR_REG_GB,4,2     ; @NETSEC_GMAC_GAR_REG_GB
	.comm	_GMAC_REG_SHIFT_CR_GAR,4,2      ; @GMAC_REG_SHIFT_CR_GAR
	.comm	_MII_PHYSID1,4,2                ; @MII_PHYSID1
	.no_dead_strip	_netsec_phy_write
.subsections_via_symbols
