	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function phy_record
_phy_record:                            ## @phy_record
	.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
	xorl	%r15d, %r15d
	movl	%ecx, %eax
	orl	%edx, %eax
	js	LBB0_10
## %bb.1:
	movl	%r9d, %r13d
	movq	%r8, %r14
	movl	%edx, %ebx
	movq	%rsi, %r12
	shll	$16, %ebx
	orl	%ecx, %ebx
	movq	_PHY_TYPE_PMA_PMD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_NIU_PHY_ID_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%ebx, %ecx
	movq	_PHY_TYPE_PCS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%r9d, %eax
	je	LBB0_3
## %bb.2:
	cmpl	%r13d, %edx
	je	LBB0_3
## %bb.5:
	movq	_NIU_PHY_ID_BCM5464R@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	jne	LBB0_10
	jmp	LBB0_7
LBB0_3:
	movq	_NIU_PHY_ID_BCM8704@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	je	LBB0_7
## %bb.4:
	movq	_NIU_PHY_ID_MRVL88X2011@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %ecx
	jne	LBB0_10
LBB0_7:
	cmpl	%r13d, %edx
	leaq	L_.str.2(%rip), %rcx
	leaq	L_.str.3(%rip), %rdx
	cmoveq	%rcx, %rdx
	cmpl	%r13d, %eax
	movl	(%rdi), %esi
	leaq	L_.str.1(%rip), %rcx
	cmovneq	%rdx, %rcx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	movq	%r14, %r8
	callq	_pr_info
	movq	(%r12), %rax
	movslq	%r13d, %rcx
	movq	(%rax,%rcx,8), %rdx
	movq	_NIU_MAX_PORTS@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jae	LBB0_8
## %bb.9:
	movq	8(%r12), %rsi
	movq	(%rsi,%rcx,8), %rsi
	movl	%ebx, (%rsi,%rdx,4)
	movq	16(%r12), %rsi
	movq	(%rsi,%rcx,8), %rsi
	movq	%r14, (%rsi,%rdx,8)
	incq	%rdx
	movq	%rdx, (%rax,%rcx,8)
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_TYPE_PMA_PMD,4,2           ## @PHY_TYPE_PMA_PMD
	.comm	_PHY_TYPE_PCS,4,2               ## @PHY_TYPE_PCS
	.comm	_NIU_PHY_ID_MASK,4,2            ## @NIU_PHY_ID_MASK
	.comm	_NIU_PHY_ID_BCM8704,4,2         ## @NIU_PHY_ID_BCM8704
	.comm	_NIU_PHY_ID_MRVL88X2011,4,2     ## @NIU_PHY_ID_MRVL88X2011
	.comm	_NIU_PHY_ID_BCM5464R,4,2        ## @NIU_PHY_ID_BCM5464R
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"niu%d: Found PHY %08x type %s at phy_port %u\n"

L_.str.1:                               ## @.str.1
	.asciz	"PMA/PMD"

L_.str.2:                               ## @.str.2
	.asciz	"PCS"

L_.str.3:                               ## @.str.3
	.asciz	"MII"

	.comm	_NIU_MAX_PORTS,8,3              ## @NIU_MAX_PORTS
L_.str.4:                               ## @.str.4
	.asciz	"Too many PHY ports\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_phy_record
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function phy_record
_phy_record:                            ; @phy_record
	.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
	orr	w8, w3, w2
	tbnz	w8, #31, LBB0_3
; %bb.1:
	mov	x21, x5
	mov	x19, x4
	mov	x20, x1
	orr	w22, w3, w2, lsl #16
Lloh0:
	adrp	x8, _PHY_TYPE_PMA_PMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHY_TYPE_PMA_PMD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PHY_TYPE_PCS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PHY_TYPE_PCS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _NIU_PHY_ID_MASK@GOTPAGE
Lloh7:
	ldr	x10, [x10, _NIU_PHY_ID_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	and	w10, w10, w22
	cmp	w8, w5
	ccmp	w9, w5, #4, ne
	b.ne	LBB0_5
; %bb.2:
Lloh9:
	adrp	x11, _NIU_PHY_ID_BCM8704@GOTPAGE
Lloh10:
	ldr	x11, [x11, _NIU_PHY_ID_BCM8704@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
Lloh12:
	adrp	x12, _NIU_PHY_ID_MRVL88X2011@GOTPAGE
Lloh13:
	ldr	x12, [x12, _NIU_PHY_ID_MRVL88X2011@GOTPAGEOFF]
Lloh14:
	ldr	w12, [x12]
	cmp	w10, w11
	ccmp	w10, w12, #4, ne
	b.eq	LBB0_6
LBB0_3:
	mov	w0, #0
LBB0_4:
	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
LBB0_5:
Lloh15:
	adrp	x11, _NIU_PHY_ID_BCM5464R@GOTPAGE
Lloh16:
	ldr	x11, [x11, _NIU_PHY_ID_BCM5464R@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	cmp	w10, w11
	b.ne	LBB0_3
LBB0_6:
	ldr	w1, [x0]
Lloh18:
	adrp	x10, l_.str.3@PAGE
Lloh19:
	add	x10, x10, l_.str.3@PAGEOFF
Lloh20:
	adrp	x11, l_.str.2@PAGE
Lloh21:
	add	x11, x11, l_.str.2@PAGEOFF
	cmp	w9, w21
	csel	x9, x11, x10, eq
Lloh22:
	adrp	x10, l_.str.1@PAGE
Lloh23:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	w8, w21
	csel	x3, x10, x9, eq
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x22
	mov	x4, x19
	bl	_pr_info
	ldr	x8, [x20]
	ldr	x9, [x8, w21, sxtw #3]
Lloh26:
	adrp	x10, _NIU_MAX_PORTS@GOTPAGE
Lloh27:
	ldr	x10, [x10, _NIU_MAX_PORTS@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
	cmp	x9, x10
	b.hs	LBB0_8
; %bb.7:
	mov	w0, #0
	sxtw	x10, w21
	lsl	x10, x10, #3
	ldp	x11, x12, [x20, #8]
	ldr	x11, [x11, x10]
	str	w22, [x11, x9, lsl #2]
	ldr	x11, [x12, x10]
	str	x19, [x11, x9, lsl #3]
	add	x9, x9, #1
	str	x9, [x8, x10]
	b	LBB0_4
LBB0_8:
Lloh29:
	adrp	x0, l_.str.4@PAGE
Lloh30:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_TYPE_PMA_PMD,4,2           ; @PHY_TYPE_PMA_PMD
	.comm	_PHY_TYPE_PCS,4,2               ; @PHY_TYPE_PCS
	.comm	_NIU_PHY_ID_MASK,4,2            ; @NIU_PHY_ID_MASK
	.comm	_NIU_PHY_ID_BCM8704,4,2         ; @NIU_PHY_ID_BCM8704
	.comm	_NIU_PHY_ID_MRVL88X2011,4,2     ; @NIU_PHY_ID_MRVL88X2011
	.comm	_NIU_PHY_ID_BCM5464R,4,2        ; @NIU_PHY_ID_BCM5464R
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"niu%d: Found PHY %08x type %s at phy_port %u\n"

l_.str.1:                               ; @.str.1
	.asciz	"PMA/PMD"

l_.str.2:                               ; @.str.2
	.asciz	"PCS"

l_.str.3:                               ; @.str.3
	.asciz	"MII"

	.comm	_NIU_MAX_PORTS,8,3              ; @NIU_MAX_PORTS
l_.str.4:                               ; @.str.4
	.asciz	"Too many PHY ports\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_phy_record
.subsections_via_symbols
