	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_temac_mdio_setup               ## -- Begin function temac_mdio_setup
	.p2align	4, 0x90
_temac_mdio_setup:                      ## @temac_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_dev_get_platdata
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_dev_of_node
	movq	%rax, %r12
	movl	$0, -44(%rbp)
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_of_property_read_u32
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	LBB0_2
	jmp	LBB0_6
LBB0_3:
	testq	%r15, %r15
	je	LBB0_6
## %bb.4:
	movl	(%r15), %eax
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	je	LBB0_6
LBB0_2:
	cltq
	imulq	$1801439851, %rax, %rax         ## imm = 0x6B5FCA6B
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$53, %rax
	addl	%ecx, %eax
	cmpl	$3, %eax
	movl	$2, %ecx
	cmovgel	%eax, %ecx
	cmpl	$64, %ecx
	movl	$64, %edx
	cmovll	%ecx, %edx
	decl	%edx
	orl	$64, %edx
	jmp	LBB0_7
LBB0_6:
	movl	$127, %edx
LBB0_7:
	movq	_XTE_MC_OFFSET@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_temac_indirect_out32
	movq	%rbx, %rdi
	callq	_devm_mdiobus_alloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%rax, %rbx
	testq	%r12, %r12
	je	LBB0_11
## %bb.9:
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_of_address_to_resource
	movl	32(%rbx), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rcx
	jmp	LBB0_13
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_16
LBB0_11:
	testq	%r15, %r15
	je	LBB0_14
## %bb.12:
	movl	32(%rbx), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r15), %rcx
LBB0_13:
	leaq	L_.str.1(%rip), %rdx
	callq	_snprintf
LBB0_14:
	movq	%r14, 24(%rbx)
	leaq	L_.str.2(%rip), %rax
	movq	%rax, (%rbx)
	movq	_temac_mdio_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_temac_mdio_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movl	(%r14), %eax
	movl	%eax, 8(%rbx)
	movq	%rbx, 8(%r14)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_of_mdiobus_register
	testl	%eax, %eax
	jne	LBB0_16
## %bb.15:
	movl	(%r14), %ebx
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_temac_indirect_in32
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_dev_dbg
	xorl	%eax, %eax
LBB0_16:
	addq	$24, %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	"clock-frequency"

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

L_.str.2:                               ## @.str.2
	.asciz	"Xilinx TEMAC MDIO"

	.comm	_temac_mdio_read,4,2            ## @temac_mdio_read
	.comm	_temac_mdio_write,4,2           ## @temac_mdio_write
L_.str.3:                               ## @.str.3
	.asciz	"MDIO bus registered;  MC:%x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_temac_mdio_setup               ; -- Begin function temac_mdio_setup
	.p2align	2
_temac_mdio_setup:                      ; @temac_mdio_setup
	.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
	mov	x22, x1
	mov	x19, x0
	mov	x0, x1
	bl	_dev_get_platdata
	mov	x21, x0
	mov	x0, x22
	bl	_dev_of_node
	mov	x20, x0
	str	wzr, [sp, #12]
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	mov	x0, x20
	bl	_of_property_read_u32
	ldr	w8, [sp, #12]
	b	LBB0_4
LBB0_2:
	cbz	x21, LBB0_15
; %bb.3:
	ldr	w8, [x21]
	str	w8, [sp, #12]
LBB0_4:
	mov	w9, #127
	mov	w10, #51819
	movk	w10, #27487, lsl #16
	smull	x10, w8, w10
	lsr	x11, x10, #63
	asr	x10, x10, #53
	add	w10, w10, w11
	mov	w11, #2
	cmp	w10, #2
	csel	w10, w10, w11, gt
	mov	w11, #64
	cmp	w10, #64
	csel	w10, w10, w11, lt
	sub	w10, w10, #1
	orr	w10, w10, #0x40
	cmp	w8, #0
	csel	w2, w9, w10, eq
LBB0_5:
Lloh2:
	adrp	x23, _XTE_MC_OFFSET@GOTPAGE
Lloh3:
	ldr	x23, [x23, _XTE_MC_OFFSET@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_temac_indirect_out32
	mov	x0, x22
	bl	_devm_mdiobus_alloc
	cbz	x0, LBB0_8
; %bb.6:
	mov	x22, x0
	cbz	x20, LBB0_9
; %bb.7:
	mov	x2, sp
	mov	x0, x20
	mov	w1, #0
	bl	_of_address_to_resource
	ldr	w0, [x22, #32]
Lloh4:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	x3, [sp]
	b	LBB0_11
LBB0_8:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_9:
	cbz	x21, LBB0_12
; %bb.10:
	ldr	w0, [x22, #32]
Lloh10:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	x3, [x21, #8]
LBB0_11:
Lloh13:
	adrp	x2, l_.str.1@PAGE
Lloh14:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_snprintf
LBB0_12:
	str	x19, [x22, #24]
Lloh15:
	adrp	x8, l_.str.2@PAGE
Lloh16:
	add	x8, x8, l_.str.2@PAGEOFF
	str	x8, [x22]
Lloh17:
	adrp	x8, _temac_mdio_read@GOTPAGE
Lloh18:
	ldr	x8, [x8, _temac_mdio_read@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _temac_mdio_write@GOTPAGE
Lloh21:
	ldr	x9, [x9, _temac_mdio_write@GOTPAGEOFF]
	str	w8, [x22, #16]
Lloh22:
	ldr	w8, [x9]
	ldr	w9, [x19]
	stp	w9, w8, [x22, #8]
	str	x22, [x19, #8]
	mov	x0, x22
	mov	x1, x20
	bl	_of_mdiobus_register
	cbnz	w0, LBB0_14
; %bb.13:
	ldr	w20, [x19]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_temac_indirect_in32
	mov	x2, x0
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	mov	w0, #0
LBB0_14:
	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_15:
	mov	w2, #127
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"clock-frequency"

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

l_.str.2:                               ; @.str.2
	.asciz	"Xilinx TEMAC MDIO"

	.comm	_temac_mdio_read,4,2            ; @temac_mdio_read
	.comm	_temac_mdio_write,4,2           ; @temac_mdio_write
l_.str.3:                               ; @.str.3
	.asciz	"MDIO bus registered;  MC:%x\n"

.subsections_via_symbols
