	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_sf2_mdio_register
_bcm_sf2_mdio_register:                 ## @bcm_sf2_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_bcm_sf2_to_priv
	movq	%rax, %r12
	leaq	L_.str(%rip), %rdx
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_of_find_compatible_node
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_of_mdio_find_bus
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rdi
	callq	_get_device
	movq	%r15, 16(%r12)
	movq	8(%r14), %rdi
	callq	_devm_mdiobus_alloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%r12, 40(%rax)
	leaq	L_.str.1(%rip), %rcx
	movq	%rcx, (%rax)
	movq	_bcm_sf2_sw_mdio_read@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%rax)
	movq	_bcm_sf2_sw_mdio_write@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rax)
	movl	24(%rax), %edi
	movq	_MII_BUS_ID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	_bcm_sf2_mdio_register.index(%rip), %ecx
	leal	1(%rcx), %eax
	movl	%eax, _bcm_sf2_mdio_register.index(%rip)
	leaq	L_.str.2(%rip), %rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_snprintf
	movq	8(%r12), %rax
	movq	%r15, 16(%rax)
	leaq	L_.str.3(%rip), %rdi
	callq	_of_machine_is_compatible
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_BRCM_PSEUDO_PHY_ADDR@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	(%r12), %eax
	btsl	%ecx, %eax
	movl	%eax, (%r12)
	jmp	LBB0_7
LBB0_1:
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_6:
	movl	$0, (%r12)
	xorl	%eax, %eax
LBB0_7:
	movl	%eax, (%r14)
	movq	8(%r12), %rdi
	movq	%rdi, 16(%r14)
	movq	8(%r14), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%rdi)
	notl	%eax
	movl	%eax, 8(%rdi)
	movq	%r15, %rsi
	callq	_of_mdiobus_register
	movl	%eax, %ebx
	testq	%r15, %r15
	je	LBB0_10
## %bb.8:
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_of_node_put
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_bcm_sf2_mdio_register.index,4,2 ## @bcm_sf2_mdio_register.index
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"brcm,unimac-mdio"

	.comm	_EPROBE_DEFER,4,2               ## @EPROBE_DEFER
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"sf2 slave mii"

	.comm	_bcm_sf2_sw_mdio_read,4,2       ## @bcm_sf2_sw_mdio_read
	.comm	_bcm_sf2_sw_mdio_write,4,2      ## @bcm_sf2_sw_mdio_write
	.comm	_MII_BUS_ID_SIZE,4,2            ## @MII_BUS_ID_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"sf2-%d"

L_.str.3:                               ## @.str.3
	.asciz	"brcm,bcm7445d0"

	.comm	_BRCM_PSEUDO_PHY_ADDR,4,2       ## @BRCM_PSEUDO_PHY_ADDR
	.no_dead_strip	_bcm_sf2_mdio_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_sf2_mdio_register
_bcm_sf2_mdio_register:                 ; @bcm_sf2_mdio_register
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	bl	_bcm_sf2_to_priv
	mov	x21, x0
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	mov	x1, #0
	bl	_of_find_compatible_node
	mov	x19, x0
	bl	_of_mdio_find_bus
	str	x0, [x21, #24]
	cbz	x0, LBB0_4
; %bb.1:
	bl	_get_device
	str	x19, [x21, #16]
	ldr	x0, [x20, #8]
	bl	_devm_mdiobus_alloc
	str	x0, [x21, #8]
	cbz	x0, LBB0_5
; %bb.2:
Lloh2:
	adrp	x8, l_.str.1@PAGE
Lloh3:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x21, [x0, #40]
	str	x8, [x0]
Lloh4:
	adrp	x8, _bcm_sf2_sw_mdio_read@GOTPAGE
Lloh5:
	ldr	x8, [x8, _bcm_sf2_sw_mdio_read@GOTPAGEOFF]
Lloh6:
	adrp	x9, _bcm_sf2_sw_mdio_write@GOTPAGE
Lloh7:
	ldr	x9, [x9, _bcm_sf2_sw_mdio_write@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #28]
Lloh10:
	adrp	x8, _MII_BUS_ID_SIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MII_BUS_ID_SIZE@GOTPAGEOFF]
	ldr	w0, [x0, #24]
Lloh12:
	ldr	w1, [x8]
	adrp	x8, _bcm_sf2_mdio_register.index@PAGE
	ldr	w3, [x8, _bcm_sf2_mdio_register.index@PAGEOFF]
	add	w9, w3, #1
	str	w9, [x8, _bcm_sf2_mdio_register.index@PAGEOFF]
Lloh13:
	adrp	x2, l_.str.2@PAGE
Lloh14:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_snprintf
	ldr	x8, [x21, #8]
	str	x19, [x8, #16]
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_of_machine_is_compatible
	cbz	x0, LBB0_7
; %bb.3:
Lloh17:
	adrp	x8, _BRCM_PSEUDO_PHY_ADDR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BRCM_PSEUDO_PHY_ADDR@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
	b	LBB0_8
LBB0_4:
Lloh20:
	adrp	x8, _EPROBE_DEFER@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EPROBE_DEFER@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_7:
	mov	w8, #0
	str	wzr, [x21]
LBB0_8:
	str	w8, [x20]
	ldr	x0, [x21, #8]
	str	x0, [x20, #16]
	ldr	x9, [x20, #8]
	ldr	w9, [x9]
	mvn	w8, w8
	stp	w8, w9, [x0, #8]
	mov	x1, x19
	bl	_of_mdiobus_register
	mov	x20, x0
	cbz	x19, LBB0_11
; %bb.9:
	cbz	w20, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_of_node_put
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh8
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_bcm_sf2_mdio_register.index,4,2 ; @bcm_sf2_mdio_register.index
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"brcm,unimac-mdio"

	.comm	_EPROBE_DEFER,4,2               ; @EPROBE_DEFER
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"sf2 slave mii"

	.comm	_bcm_sf2_sw_mdio_read,4,2       ; @bcm_sf2_sw_mdio_read
	.comm	_bcm_sf2_sw_mdio_write,4,2      ; @bcm_sf2_sw_mdio_write
	.comm	_MII_BUS_ID_SIZE,4,2            ; @MII_BUS_ID_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"sf2-%d"

l_.str.3:                               ; @.str.3
	.asciz	"brcm,bcm7445d0"

	.comm	_BRCM_PSEUDO_PHY_ADDR,4,2       ; @BRCM_PSEUDO_PHY_ADDR
	.no_dead_strip	_bcm_sf2_mdio_register
.subsections_via_symbols
