	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xemaclite_mdio_setup
_xemaclite_mdio_setup:                  ## @xemaclite_mdio_setup
	.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	%rsi, %r14
	movq	%rdi, %r12
	movq	16(%rdi), %rdi
	callq	_of_get_parent
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_of_get_parent
	leaq	-48(%rbp), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_of_address_to_resource
	movq	24(%r12), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_3
## %bb.6:
	movq	_XEL_MDIOCTRL_MDIOEN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_XEL_MDIOCTRL_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	callq	_xemaclite_writel
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mdiobus_alloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r13
	movl	32(%rax), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rcx
	leaq	L_.str.3(%rip), %rdx
	callq	_snprintf
	movq	%r12, 24(%r13)
	leaq	L_.str.4(%rip), %rax
	movq	%rax, (%r13)
	movq	_xemaclite_mdio_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r13)
	movq	_xemaclite_mdio_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r13)
	movq	%r14, 8(%r13)
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_of_mdiobus_register
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	%r13, %rdi
	callq	_mdiobus_free
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_3:
	movq	16(%r12), %rdi
	callq	_of_phy_find_device
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %rdi
	callq	_put_device
	jmp	LBB0_11
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	jmp	LBB0_11
LBB0_10:
	movq	%r13, (%r12)
LBB0_11:
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to register mdio bus.\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"MDIO of the phy is not registered yet\n"

	.comm	_XEL_MDIOCTRL_MDIOEN_MASK,4,2   ## @XEL_MDIOCTRL_MDIOEN_MASK
	.comm	_XEL_MDIOCTRL_OFFSET,8,3        ## @XEL_MDIOCTRL_OFFSET
L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate mdiobus\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MII_BUS_ID_SIZE,4,2            ## @MII_BUS_ID_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"%.8llx"

L_.str.4:                               ## @.str.4
	.asciz	"Xilinx Emaclite MDIO"

	.comm	_xemaclite_mdio_read,4,2        ## @xemaclite_mdio_read
	.comm	_xemaclite_mdio_write,4,2       ## @xemaclite_mdio_write
	.no_dead_strip	_xemaclite_mdio_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xemaclite_mdio_setup
_xemaclite_mdio_setup:                  ; @xemaclite_mdio_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x0, [x0, #16]
	bl	_of_get_parent
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x0
	bl	_of_get_parent
	add	x2, sp, #8
	mov	w1, #0
	bl	_of_address_to_resource
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _XEL_MDIOCTRL_MDIOEN_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XEL_MDIOCTRL_MDIOEN_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _XEL_MDIOCTRL_OFFSET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _XEL_MDIOCTRL_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_xemaclite_writel
	bl	_mdiobus_alloc
	cbz	x0, LBB0_8
; %bb.3:
	mov	x22, x0
	ldr	w0, [x0, #32]
Lloh6:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	x3, [sp, #8]
Lloh9:
	adrp	x2, l_.str.3@PAGE
Lloh10:
	add	x2, x2, l_.str.3@PAGEOFF
	bl	_snprintf
	str	x20, [x22, #24]
Lloh11:
	adrp	x8, l_.str.4@PAGE
Lloh12:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh13:
	adrp	x9, _xemaclite_mdio_read@GOTPAGE
Lloh14:
	ldr	x9, [x9, _xemaclite_mdio_read@GOTPAGEOFF]
Lloh15:
	adrp	x10, _xemaclite_mdio_write@GOTPAGE
Lloh16:
	ldr	x10, [x10, _xemaclite_mdio_write@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	ldr	w10, [x10]
	stp	w10, w9, [x22, #16]
	stp	x8, x19, [x22]
	mov	x0, x22
	mov	x1, x21
	bl	_of_mdiobus_register
	mov	x21, x0
	cbz	w0, LBB0_12
; %bb.4:
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x22
	bl	_mdiobus_free
	b	LBB0_10
LBB0_5:
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	ldr	x0, [x20, #16]
	bl	_of_phy_find_device
	cbz	x0, LBB0_11
; %bb.7:
	bl	_put_device
	mov	w21, #0
	b	LBB0_10
LBB0_8:
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_11:
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w21, #0
	b	LBB0_10
LBB0_12:
	str	x22, [x20]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh17
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to register mdio bus.\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"MDIO of the phy is not registered yet\n"

	.comm	_XEL_MDIOCTRL_MDIOEN_MASK,4,2   ; @XEL_MDIOCTRL_MDIOEN_MASK
	.comm	_XEL_MDIOCTRL_OFFSET,8,3        ; @XEL_MDIOCTRL_OFFSET
l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate mdiobus\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MII_BUS_ID_SIZE,4,2            ; @MII_BUS_ID_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"%.8llx"

l_.str.4:                               ; @.str.4
	.asciz	"Xilinx Emaclite MDIO"

	.comm	_xemaclite_mdio_read,4,2        ; @xemaclite_mdio_read
	.comm	_xemaclite_mdio_write,4,2       ; @xemaclite_mdio_write
	.no_dead_strip	_xemaclite_mdio_setup
.subsections_via_symbols
