	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __tg3_writephy
___tg3_writephy:                        ## @__tg3_writephy
	.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	%ecx, %r15d
	movl	%edx, %ebx
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	_TG3_PHYFLG_IS_FET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_3
## %bb.1:
	movq	_MII_CTRL1000@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	cmpl	%ebx, (%rax)
	je	LBB0_14
## %bb.2:
	movq	_MII_TG3_AUX_CTRL@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_14
LBB0_3:
	movl	4(%r14), %esi
	movq	_MAC_MI_MODE_AUTO_POLL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%esi, %eax
	je	LBB0_5
## %bb.4:
	movq	_MAC_MI_MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%eax
	andl	%eax, %esi
	callq	_tw32_f
	movl	$80, %edi
	callq	_udelay
LBB0_5:
	movl	8(%r14), %esi
	movq	%r14, %rdi
	callq	_tg3_ape_lock
	movq	_MI_COM_PHY_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	movq	_MI_COM_PHY_ADDR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	movq	_MI_COM_REG_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_MI_COM_REG_ADDR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	orl	%r12d, %ebx
	movq	_MI_COM_DATA_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	orl	%ebx, %r15d
	movq	_MI_COM_CMD_WRITE@GOTPCREL(%rip), %rax
	movq	_MI_COM_START@GOTPCREL(%rip), %rcx
	orl	(%rax), %r15d
	orl	(%rcx), %r15d
	movq	_MAC_MI_COM@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	%r15d, %esi
	callq	_tw32_f
	movq	_PHY_BUSY_LOOPS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.6:
	movq	_MI_COM_BUSY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	$10, %edi
	callq	_udelay
	movl	(%r12), %edi
	callq	_tr32
	testl	%eax, (%r15)
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	decl	%ebx
	jne	LBB0_8
LBB0_10:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_11
LBB0_9:
	movl	$5, %edi
	callq	_udelay
	movl	(%r12), %edi
	callq	_tr32
	xorl	%r13d, %r13d
LBB0_11:
	movl	4(%r14), %esi
	movq	_MAC_MI_MODE_AUTO_POLL@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_13
## %bb.12:
	movq	_MAC_MI_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_tw32_f
	movl	$80, %edi
	callq	_udelay
LBB0_13:
	movl	8(%r14), %esi
	movq	%r14, %rdi
	callq	_tg3_ape_unlock
LBB0_14:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TG3_PHYFLG_IS_FET,4,2          ## @TG3_PHYFLG_IS_FET
	.comm	_MII_CTRL1000,4,2               ## @MII_CTRL1000
	.comm	_MII_TG3_AUX_CTRL,4,2           ## @MII_TG3_AUX_CTRL
	.comm	_MAC_MI_MODE_AUTO_POLL,4,2      ## @MAC_MI_MODE_AUTO_POLL
	.comm	_MAC_MI_MODE,4,2                ## @MAC_MI_MODE
	.comm	_MI_COM_PHY_ADDR_SHIFT,4,2      ## @MI_COM_PHY_ADDR_SHIFT
	.comm	_MI_COM_PHY_ADDR_MASK,4,2       ## @MI_COM_PHY_ADDR_MASK
	.comm	_MI_COM_REG_ADDR_SHIFT,4,2      ## @MI_COM_REG_ADDR_SHIFT
	.comm	_MI_COM_REG_ADDR_MASK,4,2       ## @MI_COM_REG_ADDR_MASK
	.comm	_MI_COM_DATA_MASK,4,2           ## @MI_COM_DATA_MASK
	.comm	_MI_COM_CMD_WRITE,4,2           ## @MI_COM_CMD_WRITE
	.comm	_MI_COM_START,4,2               ## @MI_COM_START
	.comm	_MAC_MI_COM,4,2                 ## @MAC_MI_COM
	.comm	_PHY_BUSY_LOOPS,4,2             ## @PHY_BUSY_LOOPS
	.comm	_MI_COM_BUSY,4,2                ## @MI_COM_BUSY
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	___tg3_writephy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __tg3_writephy
___tg3_writephy:                        ; @__tg3_writephy
	.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	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _TG3_PHYFLG_IS_FET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TG3_PHYFLG_IS_FET@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _MII_CTRL1000@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MII_CTRL1000@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _MII_TG3_AUX_CTRL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MII_TG3_AUX_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w21
	ccmp	w9, w21, #4, ne
	b.ne	LBB0_3
; %bb.2:
	mov	w20, #0
	b	LBB0_14
LBB0_3:
	ldr	w8, [x19, #4]
Lloh9:
	adrp	x24, _MAC_MI_MODE_AUTO_POLL@GOTPAGE
Lloh10:
	ldr	x24, [x24, _MAC_MI_MODE_AUTO_POLL@GOTPAGEOFF]
	ldr	w9, [x24]
Lloh11:
	adrp	x23, _MAC_MI_MODE@GOTPAGE
Lloh12:
	ldr	x23, [x23, _MAC_MI_MODE@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	ldr	w0, [x23]
	bic	w1, w8, w9
	bl	_tw32_f
	mov	w0, #80
	bl	_udelay
LBB0_5:
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_tg3_ape_lock
Lloh13:
	adrp	x8, _MI_COM_PHY_ADDR_SHIFT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MI_COM_PHY_ADDR_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	lsl	w8, w22, w8
Lloh16:
	adrp	x9, _MI_COM_PHY_ADDR_MASK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MI_COM_PHY_ADDR_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _MI_COM_REG_ADDR_SHIFT@GOTPAGE
Lloh20:
	ldr	x10, [x10, _MI_COM_REG_ADDR_SHIFT@GOTPAGEOFF]
	and	w8, w8, w9
Lloh21:
	ldr	w9, [x10]
	lsl	w9, w21, w9
Lloh22:
	adrp	x10, _MI_COM_REG_ADDR_MASK@GOTPAGE
Lloh23:
	ldr	x10, [x10, _MI_COM_REG_ADDR_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	and	w9, w9, w10
Lloh25:
	adrp	x10, _MI_COM_DATA_MASK@GOTPAGE
Lloh26:
	ldr	x10, [x10, _MI_COM_DATA_MASK@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
Lloh28:
	adrp	x11, _MI_COM_CMD_WRITE@GOTPAGE
Lloh29:
	ldr	x11, [x11, _MI_COM_CMD_WRITE@GOTPAGEOFF]
	and	w10, w10, w20
Lloh30:
	ldr	w11, [x11]
Lloh31:
	adrp	x12, _MI_COM_START@GOTPAGE
Lloh32:
	ldr	x12, [x12, _MI_COM_START@GOTPAGEOFF]
Lloh33:
	ldr	w12, [x12]
	orr	w8, w9, w8
	orr	w8, w8, w10
	orr	w8, w8, w11
	orr	w1, w8, w12
Lloh34:
	adrp	x20, _MAC_MI_COM@GOTPAGE
Lloh35:
	ldr	x20, [x20, _MAC_MI_COM@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_tw32_f
Lloh36:
	adrp	x8, _PHY_BUSY_LOOPS@GOTPAGE
Lloh37:
	ldr	x8, [x8, _PHY_BUSY_LOOPS@GOTPAGEOFF]
Lloh38:
	ldr	w21, [x8]
	cbz	w21, LBB0_9
; %bb.6:
Lloh39:
	adrp	x22, _MI_COM_BUSY@GOTPAGE
Lloh40:
	ldr	x22, [x22, _MI_COM_BUSY@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #10
	bl	_udelay
	ldr	w0, [x20]
	bl	_tr32
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	subs	w21, w21, #1
	b.ne	LBB0_7
LBB0_9:
Lloh41:
	adrp	x8, _EBUSY@GOTPAGE
Lloh42:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_10:
	mov	w0, #5
	bl	_udelay
	ldr	w0, [x20]
	bl	_tr32
	mov	w20, #0
LBB0_11:
	ldr	w1, [x19, #4]
	ldr	w8, [x24]
	tst	w8, w1
	b.eq	LBB0_13
; %bb.12:
	ldr	w0, [x23]
	bl	_tw32_f
	mov	w0, #80
	bl	_udelay
LBB0_13:
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_tg3_ape_unlock
LBB0_14:
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.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 AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_TG3_PHYFLG_IS_FET,4,2          ; @TG3_PHYFLG_IS_FET
	.comm	_MII_CTRL1000,4,2               ; @MII_CTRL1000
	.comm	_MII_TG3_AUX_CTRL,4,2           ; @MII_TG3_AUX_CTRL
	.comm	_MAC_MI_MODE_AUTO_POLL,4,2      ; @MAC_MI_MODE_AUTO_POLL
	.comm	_MAC_MI_MODE,4,2                ; @MAC_MI_MODE
	.comm	_MI_COM_PHY_ADDR_SHIFT,4,2      ; @MI_COM_PHY_ADDR_SHIFT
	.comm	_MI_COM_PHY_ADDR_MASK,4,2       ; @MI_COM_PHY_ADDR_MASK
	.comm	_MI_COM_REG_ADDR_SHIFT,4,2      ; @MI_COM_REG_ADDR_SHIFT
	.comm	_MI_COM_REG_ADDR_MASK,4,2       ; @MI_COM_REG_ADDR_MASK
	.comm	_MI_COM_DATA_MASK,4,2           ; @MI_COM_DATA_MASK
	.comm	_MI_COM_CMD_WRITE,4,2           ; @MI_COM_CMD_WRITE
	.comm	_MI_COM_START,4,2               ; @MI_COM_START
	.comm	_MAC_MI_COM,4,2                 ; @MAC_MI_COM
	.comm	_PHY_BUSY_LOOPS,4,2             ; @PHY_BUSY_LOOPS
	.comm	_MI_COM_BUSY,4,2                ; @MI_COM_BUSY
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	___tg3_writephy
.subsections_via_symbols
