	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv88e6xxx_mdio_register
_mv88e6xxx_mdio_register:               ## @mv88e6xxx_mdio_register
	.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	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	testl	%edx, %edx
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_mv88e6xxx_reg_lock
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_mv88e6xxx_g2_scratch_gpio_set_smi
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_mv88e6xxx_reg_unlock
	testl	%r13d, %r13d
	jne	LBB0_15
LBB0_2:
	movl	4(%r15), %edi
	movl	$24, %esi
	callq	_devm_mdiobus_alloc_size
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movq	%rbx, %r13
	movq	24(%rax), %rbx
	movq	%rax, 16(%rbx)
	movq	%r15, 8(%rbx)
	leaq	4(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_INIT_LIST_HEAD
	movl	%r12d, (%rbx)
	movq	%r13, %rbx
	testq	%r13, %r13
	je	LBB0_6
## %bb.5:
	movq	(%rbx), %rax
	movq	%rax, (%r14)
	movl	20(%r14), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rcx
	jmp	LBB0_7
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_15
LBB0_6:
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%r14)
	movl	20(%r14), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	_mv88e6xxx_mdio_register.index(%rip), %rcx
	leal	1(%rcx), %eax
	movl	%eax, _mv88e6xxx_mdio_register.index(%rip)
	leaq	L_.str.2(%rip), %rdx
LBB0_7:
	callq	_snprintf
	movq	_mv88e6xxx_mdio_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movq	_mv88e6xxx_mdio_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movl	4(%r15), %eax
	movl	%eax, 8(%r14)
	testl	%r12d, %r12d
	je	LBB0_8
## %bb.11:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_of_mdiobus_register
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_13
LBB0_12:
	movl	4(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%r13d, %edx
	callq	_dev_err
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mv88e6xxx_g2_irq_mdio_free
	jmp	LBB0_15
LBB0_8:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mv88e6xxx_g2_irq_mdio_setup
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.9:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_of_mdiobus_register
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_list_add
	jmp	LBB0_14
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_list_add_tail
LBB0_14:
	xorl	%r13d, %r13d
LBB0_15:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_mv88e6xxx_mdio_register.index,4,2 ## @mv88e6xxx_mdio_register.index
	.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	"%pOF"

L_.str.1:                               ## @.str.1
	.asciz	"mv88e6xxx SMI"

L_.str.2:                               ## @.str.2
	.asciz	"mv88e6xxx-%d"

	.comm	_mv88e6xxx_mdio_read,4,2        ## @mv88e6xxx_mdio_read
	.comm	_mv88e6xxx_mdio_write,4,2       ## @mv88e6xxx_mdio_write
L_.str.3:                               ## @.str.3
	.asciz	"Cannot register MDIO bus (%d)\n"

	.no_dead_strip	_mv88e6xxx_mdio_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv88e6xxx_mdio_register
_mv88e6xxx_mdio_register:               ; @mv88e6xxx_mdio_register
	.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, x2
	mov	x20, x1
	mov	x19, x0
	cbz	w2, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_mv88e6xxx_reg_lock
	mov	x0, x19
	mov	w1, #1
	bl	_mv88e6xxx_g2_scratch_gpio_set_smi
	mov	x24, x0
	mov	x0, x19
	bl	_mv88e6xxx_reg_unlock
	cbnz	w24, LBB0_14
LBB0_2:
	ldr	w0, [x19, #4]
	mov	w1, #24
	bl	_devm_mdiobus_alloc_size
	cbz	x0, LBB0_5
; %bb.3:
	mov	x21, x0
	ldr	x24, [x0, #24]
	stp	x19, x0, [x24, #8]
	add	x23, x24, #4
	mov	x0, x23
	bl	_INIT_LIST_HEAD
	str	w22, [x24]
	cbz	x20, LBB0_6
; %bb.4:
	ldr	x8, [x20]
	str	x8, [x21]
	ldr	w0, [x21, #20]
Lloh0:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x20
	b	LBB0_7
LBB0_5:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_14
LBB0_6:
Lloh8:
	adrp	x8, l_.str.1@PAGE
Lloh9:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x21]
Lloh10:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
	ldr	w0, [x21, #20]
Lloh12:
	ldr	w1, [x8]
	adrp	x8, _mv88e6xxx_mdio_register.index@PAGE
	ldrsw	x3, [x8, _mv88e6xxx_mdio_register.index@PAGEOFF]
	add	w9, w3, #1
	str	w9, [x8, _mv88e6xxx_mdio_register.index@PAGEOFF]
Lloh13:
	adrp	x2, l_.str.2@PAGE
Lloh14:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_7:
	bl	_snprintf
Lloh15:
	adrp	x8, _mv88e6xxx_mdio_read@GOTPAGE
Lloh16:
	ldr	x8, [x8, _mv88e6xxx_mdio_read@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x21, #16]
Lloh18:
	adrp	x8, _mv88e6xxx_mdio_write@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mv88e6xxx_mdio_write@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	stp	w9, w8, [x21, #8]
	cbz	w22, LBB0_10
; %bb.8:
	mov	x0, x21
	mov	x1, x20
	bl	_of_mdiobus_register
	mov	x24, x0
	cbz	w0, LBB0_13
LBB0_9:
	ldr	w0, [x19, #4]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x24
	bl	_dev_err
	mov	x0, x19
	mov	x1, x21
	bl	_mv88e6xxx_g2_irq_mdio_free
	b	LBB0_14
LBB0_10:
	mov	x0, x19
	mov	x1, x21
	bl	_mv88e6xxx_g2_irq_mdio_setup
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.11:
	mov	x0, x21
	mov	x1, x20
	bl	_of_mdiobus_register
	mov	x24, x0
	cbnz	w0, LBB0_9
; %bb.12:
	mov	x0, x23
	mov	x1, x19
	bl	_list_add
	b	LBB0_14
LBB0_13:
	mov	x0, x23
	mov	x1, x19
	bl	_list_add_tail
LBB0_14:
	mov	x0, x24
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_mv88e6xxx_mdio_register.index,4,2 ; @mv88e6xxx_mdio_register.index
	.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	"%pOF"

l_.str.1:                               ; @.str.1
	.asciz	"mv88e6xxx SMI"

l_.str.2:                               ; @.str.2
	.asciz	"mv88e6xxx-%d"

	.comm	_mv88e6xxx_mdio_read,4,2        ; @mv88e6xxx_mdio_read
	.comm	_mv88e6xxx_mdio_write,4,2       ; @mv88e6xxx_mdio_write
l_.str.3:                               ; @.str.3
	.asciz	"Cannot register MDIO bus (%d)\n"

	.no_dead_strip	_mv88e6xxx_mdio_register
.subsections_via_symbols
