	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function igc_write_phy_reg_mdic
_igc_write_phy_reg_mdic:                ## @igc_write_phy_reg_mdic
	.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	_MAX_PHY_REG_ADDRESS@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jge	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_hw_dbg
	movq	_IGC_ERR_PARAM@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_2:
	movq	_IGC_MDIC_REG_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %rsi
	movq	(%rdi), %r12
	movq	_IGC_MDIC_PHY_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %r12
	orq	%rdx, %rsi
	orq	%rsi, %r12
	movq	_IGC_MDIC_OP_WRITE@GOTPCREL(%rip), %rax
	orq	(%rax), %r12
	movq	_IGC_MDIC@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	%r12, %rsi
	callq	_wr32
	movq	_IGC_GEN_POLL_TIMEOUT@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	jle	LBB0_4
## %bb.3:
	xorl	%ebx, %ebx
	movq	_IGC_MDIC_READY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$500, %edi                      ## imm = 0x1F4
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usleep_range
	movl	(%r14), %edi
	callq	_rd32
	movq	%rax, %r12
	movq	(%r13), %rax
	testq	%r12, %rax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	cmpq	(%r15), %rbx
	jl	LBB0_6
LBB0_7:
	testq	%r12, %rax
	je	LBB0_8
LBB0_9:
	movq	_IGC_MDIC_ERROR@GOTPCREL(%rip), %rax
	testq	%r12, (%rax)
	je	LBB0_10
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_12
LBB0_4:
	movq	_IGC_MDIC_READY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%r12, %rax
	jne	LBB0_9
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
LBB0_12:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_hw_dbg
	movq	_IGC_ERR_PHY@GOTPCREL(%rip), %rax
LBB0_13:
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_PHY_REG_ADDRESS,8,3        ## @MAX_PHY_REG_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PHY Address %d is out of range\n"

	.comm	_IGC_ERR_PARAM,4,2              ## @IGC_ERR_PARAM
	.comm	_IGC_MDIC_REG_SHIFT,8,3         ## @IGC_MDIC_REG_SHIFT
	.comm	_IGC_MDIC_PHY_SHIFT,8,3         ## @IGC_MDIC_PHY_SHIFT
	.comm	_IGC_MDIC_OP_WRITE,8,3          ## @IGC_MDIC_OP_WRITE
	.comm	_IGC_MDIC,4,2                   ## @IGC_MDIC
	.comm	_IGC_GEN_POLL_TIMEOUT,8,3       ## @IGC_GEN_POLL_TIMEOUT
	.comm	_IGC_MDIC_READY,8,3             ## @IGC_MDIC_READY
L_.str.1:                               ## @.str.1
	.asciz	"MDI Write did not complete\n"

	.comm	_IGC_ERR_PHY,4,2                ## @IGC_ERR_PHY
	.comm	_IGC_MDIC_ERROR,8,3             ## @IGC_MDIC_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"MDI Error\n"

	.no_dead_strip	_igc_write_phy_reg_mdic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function igc_write_phy_reg_mdic
_igc_write_phy_reg_mdic:                ; @igc_write_phy_reg_mdic
	.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
Lloh0:
	adrp	x8, _MAX_PHY_REG_ADDRESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_PHY_REG_ADDRESS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	b.ge	LBB0_2
; %bb.1:
	str	x1, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_hw_dbg
Lloh5:
	adrp	x8, _IGC_ERR_PARAM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IGC_ERR_PARAM@GOTPAGEOFF]
	b	LBB0_12
LBB0_2:
Lloh7:
	adrp	x8, _IGC_MDIC_REG_SHIFT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IGC_MDIC_REG_SHIFT@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	lsl	x8, x1, x8
	orr	x8, x8, x2
	ldr	x9, [x0]
Lloh10:
	adrp	x10, _IGC_MDIC_PHY_SHIFT@GOTPAGE
Lloh11:
	ldr	x10, [x10, _IGC_MDIC_PHY_SHIFT@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	lsl	x9, x9, x10
Lloh13:
	adrp	x10, _IGC_MDIC_OP_WRITE@GOTPAGE
Lloh14:
	ldr	x10, [x10, _IGC_MDIC_OP_WRITE@GOTPAGEOFF]
	orr	x8, x8, x9
Lloh15:
	ldr	x9, [x10]
	orr	x19, x8, x9
Lloh16:
	adrp	x20, _IGC_MDIC@GOTPAGE
Lloh17:
	ldr	x20, [x20, _IGC_MDIC@GOTPAGEOFF]
	ldr	w0, [x20]
	mov	x1, x19
	bl	_wr32
Lloh18:
	adrp	x21, _IGC_GEN_POLL_TIMEOUT@GOTPAGE
Lloh19:
	ldr	x21, [x21, _IGC_GEN_POLL_TIMEOUT@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	x22, #0
Lloh20:
	adrp	x23, _IGC_MDIC_READY@GOTPAGE
Lloh21:
	ldr	x23, [x23, _IGC_MDIC_READY@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #500
	mov	w1, #1000
	bl	_usleep_range
	ldr	w0, [x20]
	bl	_rd32
	mov	x19, x0
	ldr	x8, [x23]
	tst	x8, x0
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
	ldr	x9, [x21]
	cmp	x22, x9
	b.lt	LBB0_4
LBB0_6:
	tst	x8, x19
	b.eq	LBB0_10
LBB0_7:
Lloh22:
	adrp	x8, _IGC_MDIC_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IGC_MDIC_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	tst	x8, x19
	b.eq	LBB0_14
; %bb.8:
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_9:
Lloh27:
	adrp	x8, _IGC_MDIC_READY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IGC_MDIC_READY@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	tst	x8, x19
	b.ne	LBB0_7
LBB0_10:
Lloh30:
	adrp	x0, l_.str.1@PAGE
Lloh31:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
	bl	_hw_dbg
Lloh32:
	adrp	x8, _IGC_ERR_PHY@GOTPAGE
Lloh33:
	ldr	x8, [x8, _IGC_ERR_PHY@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
LBB0_14:
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_PHY_REG_ADDRESS,8,3        ; @MAX_PHY_REG_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PHY Address %d is out of range\n"

	.comm	_IGC_ERR_PARAM,4,2              ; @IGC_ERR_PARAM
	.comm	_IGC_MDIC_REG_SHIFT,8,3         ; @IGC_MDIC_REG_SHIFT
	.comm	_IGC_MDIC_PHY_SHIFT,8,3         ; @IGC_MDIC_PHY_SHIFT
	.comm	_IGC_MDIC_OP_WRITE,8,3          ; @IGC_MDIC_OP_WRITE
	.comm	_IGC_MDIC,4,2                   ; @IGC_MDIC
	.comm	_IGC_GEN_POLL_TIMEOUT,8,3       ; @IGC_GEN_POLL_TIMEOUT
	.comm	_IGC_MDIC_READY,8,3             ; @IGC_MDIC_READY
l_.str.1:                               ; @.str.1
	.asciz	"MDI Write did not complete\n"

	.comm	_IGC_ERR_PHY,4,2                ; @IGC_ERR_PHY
	.comm	_IGC_MDIC_ERROR,8,3             ; @IGC_MDIC_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"MDI Error\n"

	.no_dead_strip	_igc_write_phy_reg_mdic
.subsections_via_symbols
