	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_emac_phy_config                ## -- Begin function emac_phy_config
	.p2align	4, 0x90
_emac_phy_config:                       ## @emac_phy_config
	.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, %r15
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	8(%rdi), %r12
	movq	%r14, %rdi
	callq	_devm_mdiobus_alloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	leaq	L_.str(%rip), %rax
	movq	%rax, (%r13)
	movl	32(%r13), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rcx
	leaq	L_.str.1(%rip), %rdx
	callq	_snprintf
	movq	_emac_mdio_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r13)
	movq	_emac_mdio_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r13)
	movq	%r14, 16(%r13)
	movq	%r15, 8(%r13)
	movq	%r14, %rdi
	callq	_has_acpi_companion
	movq	%r13, %rdi
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	callq	_mdiobus_register
	testl	%eax, %eax
	jne	LBB0_15
## %bb.4:
	leaq	L_.str.3(%rip), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_device_property_read_u32
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	callq	_phy_find_first
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_13:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_9:
	movq	%r12, %rsi
	callq	_of_mdiobus_register
	testl	%eax, %eax
	je	LBB0_10
LBB0_15:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_14
LBB0_10:
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_of_parse_phandle
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_of_phy_find_device
	movq	%rax, (%r15)
	movq	%rbx, %rdi
	callq	_of_node_put
	jmp	LBB0_11
LBB0_6:
	movl	-44(%rbp), %esi
	movq	%r13, %rdi
	callq	_mdiobus_get_phy
LBB0_7:
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	%rax, %rdi
	callq	_get_device
LBB0_11:
	xorl	%ebx, %ebx
	cmpq	$0, (%r15)
	je	LBB0_12
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	%r13, %rdi
	callq	_mdiobus_unregister
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"emac-mdio"

	.comm	_MII_BUS_ID_SIZE,4,2            ## @MII_BUS_ID_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"%s"

	.comm	_emac_mdio_read,4,2             ## @emac_mdio_read
	.comm	_emac_mdio_write,4,2            ## @emac_mdio_write
L_.str.2:                               ## @.str.2
	.asciz	"could not register mdio bus\n"

L_.str.3:                               ## @.str.3
	.asciz	"phy-channel"

L_.str.4:                               ## @.str.4
	.asciz	"phy-handle"

L_.str.5:                               ## @.str.5
	.asciz	"could not find external phy\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_emac_phy_config                ; -- Begin function emac_phy_config
	.p2align	2
_emac_phy_config:                       ; @emac_phy_config
	.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	x21, x1
	mov	x23, x0
	mov	x19, x0
	ldr	x22, [x19, #8]!
	mov	x0, x19
	bl	_devm_mdiobus_alloc
	str	x0, [x21, #8]
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x0]
	ldr	w0, [x0, #32]
Lloh2:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	x3, [x23]
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_snprintf
Lloh7:
	adrp	x8, _emac_mdio_read@GOTPAGE
Lloh8:
	ldr	x8, [x8, _emac_mdio_read@GOTPAGEOFF]
Lloh9:
	adrp	x9, _emac_mdio_write@GOTPAGE
Lloh10:
	ldr	x9, [x9, _emac_mdio_write@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #24]
	stp	x21, x19, [x20, #8]
	mov	x0, x19
	bl	_has_acpi_companion
	cbz	x0, LBB0_7
; %bb.2:
	mov	x0, x20
	bl	_mdiobus_register
	cbnz	w0, LBB0_8
; %bb.3:
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x2, sp, #12
	mov	x0, x19
	bl	_device_property_read_u32
	cbz	w0, LBB0_10
; %bb.4:
	mov	x0, x20
	bl	_phy_find_first
	str	x0, [x21]
	cbnz	x0, LBB0_11
	b	LBB0_12
LBB0_5:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_14
LBB0_7:
	mov	x0, x20
	mov	x1, x22
	bl	_of_mdiobus_register
	cbz	w0, LBB0_9
LBB0_8:
	mov	x23, x0
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_14
LBB0_9:
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x22
	mov	w2, #0
	bl	_of_parse_phandle
	mov	x22, x0
	bl	_of_phy_find_device
	str	x0, [x21]
	mov	x0, x22
	bl	_of_node_put
	b	LBB0_12
LBB0_10:
	ldr	w1, [sp, #12]
	mov	x0, x20
	bl	_mdiobus_get_phy
	str	x0, [x21]
	cbz	x0, LBB0_12
LBB0_11:
	bl	_get_device
LBB0_12:
	ldr	x8, [x21]
	cbz	x8, LBB0_15
; %bb.13:
	mov	w23, #0
LBB0_14:
	mov	x0, x23
	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:
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x20
	bl	_mdiobus_unregister
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"emac-mdio"

	.comm	_MII_BUS_ID_SIZE,4,2            ; @MII_BUS_ID_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"%s"

	.comm	_emac_mdio_read,4,2             ; @emac_mdio_read
	.comm	_emac_mdio_write,4,2            ; @emac_mdio_write
l_.str.2:                               ; @.str.2
	.asciz	"could not register mdio bus\n"

l_.str.3:                               ; @.str.3
	.asciz	"phy-channel"

l_.str.4:                               ; @.str.4
	.asciz	"phy-handle"

l_.str.5:                               ; @.str.5
	.asciz	"could not find external phy\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
.subsections_via_symbols
