	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netsec_mac_update_to_phy_state
_netsec_mac_update_to_phy_state:        ## @netsec_mac_update_to_phy_state
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %rcx
	cmpq	$0, 8(%rcx)
	jne	LBB0_1
## %bb.2:
	movq	_NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rcx), %rcx
	movq	_SPEED_1000@GOTPCREL(%rip), %rdx
	xorl	%r15d, %r15d
	movl	$0, %ebx
	cmpq	(%rdx), %rcx
	je	LBB0_5
## %bb.4:
	movq	_NETSEC_MCR_PS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
LBB0_5:
	movq	(%r14), %rdi
	movq	_PHY_INTERFACE_MODE_GMII@GOTPCREL(%rip), %r8
	movq	_SPEED_100@GOTPCREL(%rip), %rsi
	movl	$0, %edx
	cmpq	(%rsi), %rcx
	jne	LBB0_7
## %bb.6:
	movq	_NETSEC_GMAC_MCR_REG_FES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_7:
	cmpq	(%r8), %rdi
	cmovel	%r15d, %edx
	movq	_NETSEC_GMAC_MCR_REG_CST@GOTPCREL(%rip), %rcx
	orl	(%rax), %ebx
	orl	(%rcx), %ebx
	movq	_NETSEC_GMAC_MCR_REG_JE@GOTPCREL(%rip), %rax
	orl	%edx, %ebx
	orl	(%rax), %ebx
	callq	_phy_interface_mode_is_rgmii
	movl	$0, %ecx
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_NETSEC_GMAC_MCR_REG_IBN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_9:
	orl	%ecx, %ebx
	movq	_GMAC_REG_MCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_netsec_mac_write
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	subl	(%rdx), %ecx
	testq	%rax, %rax
	cmovel	%r15d, %ecx
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON,4,2 ## @NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON
	.comm	_NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON,4,2 ## @NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON
	.comm	_SPEED_1000,8,3                 ## @SPEED_1000
	.comm	_NETSEC_MCR_PS,4,2              ## @NETSEC_MCR_PS
	.comm	_PHY_INTERFACE_MODE_GMII,8,3    ## @PHY_INTERFACE_MODE_GMII
	.comm	_SPEED_100,8,3                  ## @SPEED_100
	.comm	_NETSEC_GMAC_MCR_REG_FES,4,2    ## @NETSEC_GMAC_MCR_REG_FES
	.comm	_NETSEC_GMAC_MCR_REG_CST,4,2    ## @NETSEC_GMAC_MCR_REG_CST
	.comm	_NETSEC_GMAC_MCR_REG_JE,4,2     ## @NETSEC_GMAC_MCR_REG_JE
	.comm	_NETSEC_GMAC_MCR_REG_IBN,4,2    ## @NETSEC_GMAC_MCR_REG_IBN
	.comm	_GMAC_REG_MCR,4,2               ## @GMAC_REG_MCR
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_netsec_mac_update_to_phy_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netsec_mac_update_to_phy_state
_netsec_mac_update_to_phy_state:        ; @netsec_mac_update_to_phy_state
	.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
	ldp	x0, x8, [x0]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON@GOTPAGEOFF]
Lloh2:
	adrp	x10, _NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON@GOTPAGE
Lloh3:
	ldr	x10, [x10, _NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON@GOTPAGEOFF]
	ldp	x8, x11, [x8]
	cmp	x11, #0
	csel	x9, x10, x9, eq
	ldr	w20, [x9]
Lloh4:
	adrp	x9, _SPEED_1000@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SPEED_1000@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
Lloh7:
	adrp	x10, _NETSEC_MCR_PS@GOTPAGE
Lloh8:
	ldr	x10, [x10, _NETSEC_MCR_PS@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	cmp	x8, x9
	csel	w21, wzr, w10, eq
Lloh10:
	adrp	x9, _PHY_INTERFACE_MODE_GMII@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PHY_INTERFACE_MODE_GMII@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
Lloh13:
	adrp	x10, _SPEED_100@GOTPAGE
Lloh14:
	ldr	x10, [x10, _SPEED_100@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	cmp	x8, x10
	ccmp	x0, x9, #4, eq
Lloh16:
	adrp	x8, _NETSEC_GMAC_MCR_REG_FES@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NETSEC_GMAC_MCR_REG_FES@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	csel	w22, w8, wzr, ne
Lloh19:
	adrp	x8, _NETSEC_GMAC_MCR_REG_CST@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NETSEC_GMAC_MCR_REG_CST@GOTPAGEOFF]
Lloh21:
	ldr	w23, [x8]
Lloh22:
	adrp	x8, _NETSEC_GMAC_MCR_REG_JE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _NETSEC_GMAC_MCR_REG_JE@GOTPAGEOFF]
Lloh24:
	ldr	w24, [x8]
	bl	_phy_interface_mode_is_rgmii
Lloh25:
	adrp	x8, _NETSEC_GMAC_MCR_REG_IBN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _NETSEC_GMAC_MCR_REG_IBN@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	orr	w9, w21, w20
	orr	w9, w9, w23
	orr	w9, w9, w22
	orr	w9, w9, w24
	orr	w2, w9, w8
Lloh28:
	adrp	x8, _GMAC_REG_MCR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _GMAC_REG_MCR@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_netsec_mac_write
Lloh31:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	cmp	x0, #0
	csneg	w0, wzr, w8, eq
	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 AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON,4,2 ; @NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON
	.comm	_NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON,4,2 ; @NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON
	.comm	_SPEED_1000,8,3                 ; @SPEED_1000
	.comm	_NETSEC_MCR_PS,4,2              ; @NETSEC_MCR_PS
	.comm	_PHY_INTERFACE_MODE_GMII,8,3    ; @PHY_INTERFACE_MODE_GMII
	.comm	_SPEED_100,8,3                  ; @SPEED_100
	.comm	_NETSEC_GMAC_MCR_REG_FES,4,2    ; @NETSEC_GMAC_MCR_REG_FES
	.comm	_NETSEC_GMAC_MCR_REG_CST,4,2    ; @NETSEC_GMAC_MCR_REG_CST
	.comm	_NETSEC_GMAC_MCR_REG_JE,4,2     ; @NETSEC_GMAC_MCR_REG_JE
	.comm	_NETSEC_GMAC_MCR_REG_IBN,4,2    ; @NETSEC_GMAC_MCR_REG_IBN
	.comm	_GMAC_REG_MCR,4,2               ; @GMAC_REG_MCR
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_netsec_mac_update_to_phy_state
.subsections_via_symbols
