	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_phy_attach_direct              ## -- Begin function phy_attach_direct
	.p2align	4, 0x90
_phy_attach_direct:                     ## @phy_attach_direct
	.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
	movl	%ecx, %r15d
	movl	%edx, %ebx
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	48(%rsi), %rcx
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	jmp	LBB0_3
LBB0_1:
	xorl	%r12d, %r12d
LBB0_3:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %rdi
	cmpq	%rdi, %r12
	je	LBB0_6
## %bb.4:
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_5
LBB0_6:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	leaq	32(%r13), %rbx
	movq	%rbx, %rdi
	callq	_get_device
	movq	(%rbx), %rax
	testq	%rax, %rax
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	je	LBB0_7
## %bb.13:
	movq	8(%rax), %rdi
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_14
LBB0_16:
	cmpq	$0, 8(%r13)
	je	LBB0_19
## %bb.17:
	addq	$8, %r14
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_18
LBB0_7:
	movq	_genphy_c45_driver@GOTPCREL(%rip), %rax
	movq	_genphy_driver@GOTPCREL(%rip), %rcx
	leaq	8(%rcx), %rdx
	leaq	8(%rax), %rsi
	cmpq	$0, 64(%r13)
	cmoveq	%rcx, %rax
	movq	%rax, 32(%r13)
	cmoveq	%rdx, %rsi
	movq	(%rsi), %rdi
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	js	LBB0_9
## %bb.15:
	movq	%rbx, %rdi
	callq	_device_bind_driver
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_10
	jmp	LBB0_16
LBB0_14:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_phydev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_11
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_phydev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_28
LBB0_19:
	movq	_phy_link_change@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r13)
	testq	%r14, %r14
	je	LBB0_21
## %bb.20:
	movq	%r14, 8(%r13)
	movq	%r13, (%r14)
LBB0_21:
	movl	$0, (%r13)
	movq	%r13, %rdi
	callq	_phy_sysfs_create_links
	cmpq	$0, 8(%r13)
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_24
## %bb.22:
	leaq	40(%r13), %rdi
	movq	_dev_attr_phy_standalone@GOTPCREL(%rip), %rsi
	callq	_sysfs_create_file
	testl	%eax, %eax
	je	LBB0_24
## %bb.23:
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	callq	_phydev_err
LBB0_24:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 24(%r13)
	movl	%ebx, 20(%r13)
	movq	_PHY_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r13)
	testq	%r14, %r14
	je	LBB0_26
## %bb.25:
	movq	8(%r13), %rdi
	callq	_netif_carrier_off
LBB0_26:
	movq	%r13, %rdi
	callq	_phy_init_hw
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_27
LBB0_18:
	movq	%r13, %rdi
	callq	_phy_detach
	jmp	LBB0_28
LBB0_9:
	movl	%eax, %r15d
LBB0_10:
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	callq	_module_put
LBB0_11:
	movq	%rbx, %rdi
	callq	_put_device
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	cmpq	%rdi, %r12
	je	LBB0_28
## %bb.12:
	callq	_module_put
LBB0_28:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	movq	%r13, %rdi
	callq	_phy_resume
	movq	%r13, %rdi
	callq	_phy_led_triggers_register
	xorl	%r15d, %r15d
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get the bus module\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_genphy_c45_driver,16,3         ## @genphy_c45_driver
	.comm	_genphy_driver,16,3             ## @genphy_driver
L_.str.1:                               ## @.str.1
	.asciz	"failed to get the device driver module\n"

L_.str.2:                               ## @.str.2
	.asciz	"PHY already attached\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_phy_link_change,4,2            ## @phy_link_change
	.comm	_dev_attr_phy_standalone,4,2    ## @dev_attr_phy_standalone
L_.str.3:                               ## @.str.3
	.asciz	"error creating 'phy_standalone' sysfs entry\n"

	.comm	_PHY_READY,4,2                  ## @PHY_READY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_phy_attach_direct              ; -- Begin function phy_attach_direct
	.p2align	2
_phy_attach_direct:                     ; @phy_attach_direct
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
	ldr	x25, [x1, #48]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	ldr	x26, [x8]
	b	LBB0_3
LBB0_2:
	mov	x26, #0
LBB0_3:
	ldr	x0, [x25]
	cmp	x26, x0
	b.eq	LBB0_5
; %bb.4:
	bl	_try_module_get
	cbz	w0, LBB0_13
LBB0_5:
	add	x23, x19, #32
	mov	x0, x23
	bl	_get_device
	ldr	x8, [x23]
	cbz	x8, LBB0_9
; %bb.6:
	ldr	x0, [x8, #8]
	bl	_try_module_get
	cbz	w0, LBB0_12
LBB0_7:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_14
; %bb.8:
	add	x0, x21, #8
Lloh0:
	adrp	x1, l_.str.2@PAGE
Lloh1:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_22
LBB0_9:
	ldr	x8, [x19, #64]
Lloh5:
	adrp	x9, _genphy_c45_driver@GOTPAGE
Lloh6:
	ldr	x9, [x9, _genphy_c45_driver@GOTPAGEOFF]
Lloh7:
	adrp	x10, _genphy_driver@GOTPAGE
Lloh8:
	ldr	x10, [x10, _genphy_driver@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	str	x8, [x19, #32]
	add	x8, x10, #8
	add	x9, x9, #8
	csel	x8, x8, x9, eq
	ldr	x0, [x8]
	bl	_try_module_get
	cbz	w0, LBB0_12
; %bb.10:
	ldr	x8, [x23]
	ldr	x8, [x8]
	mov	x0, x23
	blr	x8
	tbnz	w0, #31, LBB0_23
; %bb.11:
	mov	x0, x23
	bl	_device_bind_driver
	mov	x24, x0
	cbnz	w0, LBB0_24
	b	LBB0_7
LBB0_12:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_phydev_err
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_25
LBB0_13:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_phydev_err
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_27
LBB0_14:
Lloh19:
	adrp	x8, _phy_link_change@GOTPAGE
Lloh20:
	ldr	x8, [x8, _phy_link_change@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x19, #56]
	cbz	x21, LBB0_16
; %bb.15:
	str	x21, [x19, #8]
	str	x19, [x21]
LBB0_16:
	str	wzr, [x19]
	mov	x0, x19
	bl	_phy_sysfs_create_links
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_19
; %bb.17:
	add	x0, x19, #40
Lloh22:
	adrp	x1, _dev_attr_phy_standalone@GOTPAGE
Lloh23:
	ldr	x1, [x1, _dev_attr_phy_standalone@GOTPAGEOFF]
	bl	_sysfs_create_file
	cbz	w0, LBB0_19
; %bb.18:
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_phydev_err
LBB0_19:
	str	w22, [x19, #24]
Lloh26:
	adrp	x8, _PHY_READY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PHY_READY@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	stp	w8, w20, [x19, #16]
	cbz	x21, LBB0_21
; %bb.20:
	ldr	x0, [x19, #8]
	bl	_netif_carrier_off
LBB0_21:
	mov	x0, x19
	bl	_phy_init_hw
	mov	x24, x0
	cbz	w0, LBB0_28
LBB0_22:
	mov	x0, x19
	bl	_phy_detach
	b	LBB0_27
LBB0_23:
	mov	x24, x0
LBB0_24:
	ldr	x8, [x23]
	ldr	x0, [x8, #8]
	bl	_module_put
LBB0_25:
	mov	x0, x23
	bl	_put_device
	ldr	x0, [x25]
	cmp	x26, x0
	b.eq	LBB0_27
; %bb.26:
	bl	_module_put
LBB0_27:
	mov	x0, x24
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_28:
	mov	x0, x19
	bl	_phy_resume
	mov	x0, x19
	bl	_phy_led_triggers_register
	b	LBB0_27
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get the bus module\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_genphy_c45_driver,16,3         ; @genphy_c45_driver
	.comm	_genphy_driver,16,3             ; @genphy_driver
l_.str.1:                               ; @.str.1
	.asciz	"failed to get the device driver module\n"

l_.str.2:                               ; @.str.2
	.asciz	"PHY already attached\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_phy_link_change,4,2            ; @phy_link_change
	.comm	_dev_attr_phy_standalone,4,2    ; @dev_attr_phy_standalone
l_.str.3:                               ; @.str.3
	.asciz	"error creating 'phy_standalone' sysfs entry\n"

	.comm	_PHY_READY,4,2                  ; @PHY_READY
.subsections_via_symbols
