	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netsec_register_mdio
_netsec_register_mdio:                  ## @netsec_register_mdio
	.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	%esi, %r12d
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_devm_mdiobus_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	32(%rax), %r15d
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	(%r14), %edi
	callq	_dev_name
	leaq	L_.str(%rip), %rdx
	movl	%r15d, %edi
	movl	%r13d, %esi
	movq	%rax, %rcx
	callq	_snprintf
	movq	%r14, 24(%rbx)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%rbx)
	movq	_netsec_phy_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_netsec_phy_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movl	(%r14), %edi
	movl	%edi, 12(%rbx)
	movq	%rbx, 16(%r14)
	callq	_dev_of_node
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movl	(%r14), %edi
	callq	_dev_of_node
	movq	%rax, %r15
	leaq	L_.str.2(%rip), %rsi
	movq	%rax, %rdi
	callq	_of_get_child_by_name
	movq	%rax, %r12
	movq	%rax, %rsi
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_info
	movq	%r15, %rsi
LBB0_5:
	movq	%rbx, %rdi
	callq	_of_mdiobus_register
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_of_node_put
	testl	%r15d, %r15d
	jne	LBB0_9
## %bb.6:
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_7:
	movl	$-1, 8(%rbx)
	movq	%rbx, %rdi
	callq	_mdiobus_register
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %r15d
LBB0_9:
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_err
LBB0_14:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_get_phy_device
	movq	%rax, 8(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	8(%r14), %rdi
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	callq	_PTR_ERR
	movl	(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	movq	$0, 8(%r14)
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_12:
	callq	_phy_device_register
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_mdiobus_unregister
	movl	(%r14), %edi
	leaq	L_.str.6(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_err
	movl	%r12d, %r15d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MII_BUS_ID_SIZE,4,2            ## @MII_BUS_ID_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

L_.str.1:                               ## @.str.1
	.asciz	"SNI NETSEC MDIO"

	.comm	_netsec_phy_read,4,2            ## @netsec_phy_read
	.comm	_netsec_phy_write,4,2           ## @netsec_phy_write
L_.str.2:                               ## @.str.2
	.asciz	"mdio"

L_.str.3:                               ## @.str.3
	.asciz	"Upgrade f/w for mdio subnode!\n"

L_.str.4:                               ## @.str.4
	.asciz	"mdiobus register err(%d)\n"

L_.str.5:                               ## @.str.5
	.asciz	"get_phy_device err(%d)\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.6:                               ## @.str.6
	.asciz	"phy_device_register err(%d)\n"

	.no_dead_strip	_netsec_register_mdio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netsec_register_mdio
_netsec_register_mdio:                  ; @netsec_register_mdio
	.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	x22, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_devm_mdiobus_alloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	w21, [x0, #32]
Lloh0:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	ldr	w0, [x19]
	bl	_dev_name
	mov	x3, x0
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	mov	x1, x23
	bl	_snprintf
	str	x19, [x20, #24]
Lloh5:
	adrp	x8, l_.str.1@PAGE
Lloh6:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x20]
Lloh7:
	adrp	x8, _netsec_phy_read@GOTPAGE
Lloh8:
	ldr	x8, [x8, _netsec_phy_read@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _netsec_phy_write@GOTPAGE
Lloh11:
	ldr	x9, [x9, _netsec_phy_write@GOTPAGEOFF]
	str	w8, [x20, #20]
Lloh12:
	ldr	w8, [x9]
	ldr	w0, [x19]
	stp	w0, w8, [x20, #12]
	str	x20, [x19, #16]
	bl	_dev_of_node
	cbz	x0, LBB0_7
; %bb.2:
	ldr	w0, [x19]
	bl	_dev_of_node
	mov	x21, x0
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_of_get_child_by_name
	mov	x22, x0
	mov	x1, x0
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	mov	x1, x21
LBB0_4:
	mov	x0, x20
	bl	_of_mdiobus_register
	mov	x21, x0
	mov	x0, x22
	bl	_of_node_put
	cbnz	w21, LBB0_9
	b	LBB0_11
LBB0_5:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_7:
	mov	w8, #-1
	str	w8, [x20, #8]
	mov	x0, x20
	bl	_mdiobus_register
	cbz	w0, LBB0_12
; %bb.8:
	mov	x21, x0
LBB0_9:
	ldr	w0, [x19]
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_10:
	mov	x2, x21
	bl	_dev_err
LBB0_11:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	bl	_get_phy_device
	str	x0, [x19, #8]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x19, #8]
	cbz	x8, LBB0_14
; %bb.13:
	bl	_PTR_ERR
	mov	x2, x0
	ldr	w0, [x19]
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
	str	xzr, [x19, #8]
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_14:
	bl	_phy_device_register
	mov	x21, x0
	cbz	w0, LBB0_11
; %bb.15:
	mov	x0, x20
	bl	_mdiobus_unregister
	ldr	w0, [x19]
Lloh25:
	adrp	x1, l_.str.6@PAGE
Lloh26:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MII_BUS_ID_SIZE,4,2            ; @MII_BUS_ID_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

l_.str.1:                               ; @.str.1
	.asciz	"SNI NETSEC MDIO"

	.comm	_netsec_phy_read,4,2            ; @netsec_phy_read
	.comm	_netsec_phy_write,4,2           ; @netsec_phy_write
l_.str.2:                               ; @.str.2
	.asciz	"mdio"

l_.str.3:                               ; @.str.3
	.asciz	"Upgrade f/w for mdio subnode!\n"

l_.str.4:                               ; @.str.4
	.asciz	"mdiobus register err(%d)\n"

l_.str.5:                               ; @.str.5
	.asciz	"get_phy_device err(%d)\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.6:                               ; @.str.6
	.asciz	"phy_device_register err(%d)\n"

	.no_dead_strip	_netsec_register_mdio
.subsections_via_symbols
