	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xgene_mdio_rgmii_write         ## -- Begin function xgene_mdio_rgmii_write
	.p2align	4, 0x90
_xgene_mdio_rgmii_write:                ## @xgene_mdio_rgmii_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	%ecx, %r15d
	movl	%edx, %r12d
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r14
	movq	_PHY_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SET_VAL
	movl	%eax, %r13d
	movq	_REG_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_SET_VAL
	orl	%eax, %r13d
	movq	_MII_MGMT_ADDRESS_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_xgene_mdio_wr_mac
	movq	_MII_MGMT_CONTROL_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_xgene_mdio_wr_mac
	movl	$-10, %ebx
	movq	_MII_MGMT_INDICATORS_ADDR@GOTPCREL(%rip), %r15
	movq	_BUSY_MASK@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$5, %edi
	movl	$10, %esi
	callq	_usleep_range
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_xgene_mdio_rd_mac
	andl	(%r12), %eax
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rbx), %ecx
	testl	%ebx, %ebx
	movl	%ecx, %ebx
	jne	LBB0_1
LBB0_3:
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_ADDR,4,2                   ## @PHY_ADDR
	.comm	_REG_ADDR,4,2                   ## @REG_ADDR
	.comm	_MII_MGMT_ADDRESS_ADDR,4,2      ## @MII_MGMT_ADDRESS_ADDR
	.comm	_MII_MGMT_CONTROL_ADDR,4,2      ## @MII_MGMT_CONTROL_ADDR
	.comm	_MII_MGMT_INDICATORS_ADDR,4,2   ## @MII_MGMT_INDICATORS_ADDR
	.comm	_BUSY_MASK,4,2                  ## @BUSY_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MII_MGMT write failed\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xgene_mdio_rgmii_write         ; -- Begin function xgene_mdio_rgmii_write
	.p2align	2
_xgene_mdio_rgmii_write:                ; @xgene_mdio_rgmii_write
	.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	x21, x3
	mov	x22, x2
	mov	x19, x0
	ldr	x20, [x0, #8]
Lloh0:
	adrp	x8, _PHY_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHY_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_SET_VAL
	mov	x23, x0
Lloh3:
	adrp	x8, _REG_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_SET_VAL
	orr	w2, w0, w23
Lloh6:
	adrp	x8, _MII_MGMT_ADDRESS_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MII_MGMT_ADDRESS_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_xgene_mdio_wr_mac
Lloh9:
	adrp	x8, _MII_MGMT_CONTROL_ADDR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MII_MGMT_CONTROL_ADDR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_xgene_mdio_wr_mac
	mov	w21, #-10
Lloh12:
	adrp	x22, _MII_MGMT_INDICATORS_ADDR@GOTPAGE
Lloh13:
	ldr	x22, [x22, _MII_MGMT_INDICATORS_ADDR@GOTPAGEOFF]
Lloh14:
	adrp	x23, _BUSY_MASK@GOTPAGE
Lloh15:
	ldr	x23, [x23, _BUSY_MASK@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #5
	mov	w1, #10
	bl	_usleep_range
	ldr	w1, [x22]
	mov	x0, x20
	bl	_xgene_mdio_rd_mac
	ldr	w8, [x23]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w21, #0, #4, ne
	add	w21, w21, #1
	b.ne	LBB0_1
; %bb.2:
	cbz	w8, LBB0_4
; %bb.3:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh18:
	adrp	x8, _EBUSY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	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 AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_ADDR,4,2                   ; @PHY_ADDR
	.comm	_REG_ADDR,4,2                   ; @REG_ADDR
	.comm	_MII_MGMT_ADDRESS_ADDR,4,2      ; @MII_MGMT_ADDRESS_ADDR
	.comm	_MII_MGMT_CONTROL_ADDR,4,2      ; @MII_MGMT_CONTROL_ADDR
	.comm	_MII_MGMT_INDICATORS_ADDR,4,2   ; @MII_MGMT_INDICATORS_ADDR
	.comm	_BUSY_MASK,4,2                  ; @BUSY_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MII_MGMT write failed\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
