	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b53_serdes_init                ## -- Begin function b53_serdes_init
	.p2align	4, 0x90
_b53_serdes_init:                       ## @b53_serdes_init
	.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
	movq	%rdi, %rbx
	callq	_b53_serdes_map_lane
	movq	%rax, %r15
	movq	_B53_INVALID_LANE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_3:
	movq	_B53_SERDES_ID0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SERDES_ID0@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_b53_serdes_read
	movl	%eax, %r14d
	movq	_MII_PHYSID1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_B53_SERDES_MII_REG
	movq	_SERDES_MII_BLK@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_b53_serdes_read
	movl	%eax, %r12d
	movq	_MII_PHYSID2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_B53_SERDES_MII_REG
	movl	(%r13), %ecx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_b53_serdes_read
	cmpl	$65535, %r14d                   ## imm = 0xFFFF
	je	LBB0_5
## %bb.4:
	testl	%r14d, %r14d
	jne	LBB0_6
LBB0_5:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	(%rbx), %edi
	movq	_SERDES_ID0_MODEL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_SERDES_ID0_REV_LETTER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r14d, %r8d
	sarl	%cl, %r8d
	andl	%r14d, %ebx
	addl	$65, %r8d
	movq	_SERDES_ID0_REV_NUM_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %r14d
	movq	_SERDES_ID0_REV_NUM_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r14d
	shll	$16, %r12d
	orl	%r12d, %eax
	movl	%eax, (%rsp)
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	movl	%r14d, %r9d
	callq	_dev_info
	xorl	%eax, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_B53_INVALID_LANE,8,3           ## @B53_INVALID_LANE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_B53_SERDES_ID0,4,2             ## @B53_SERDES_ID0
	.comm	_SERDES_ID0,4,2                 ## @SERDES_ID0
	.comm	_MII_PHYSID1,4,2                ## @MII_PHYSID1
	.comm	_SERDES_MII_BLK,4,2             ## @SERDES_MII_BLK
	.comm	_MII_PHYSID2,4,2                ## @MII_PHYSID2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SerDes not initialized, check settings\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"SerDes lane %d, model: %d, rev %c%d (OUI: 0x%08x)\n"

	.comm	_SERDES_ID0_MODEL_MASK,4,2      ## @SERDES_ID0_MODEL_MASK
	.comm	_SERDES_ID0_REV_LETTER_SHIFT,4,2 ## @SERDES_ID0_REV_LETTER_SHIFT
	.comm	_SERDES_ID0_REV_NUM_SHIFT,4,2   ## @SERDES_ID0_REV_NUM_SHIFT
	.comm	_SERDES_ID0_REV_NUM_MASK,4,2    ## @SERDES_ID0_REV_NUM_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b53_serdes_init                ; -- Begin function b53_serdes_init
	.p2align	2
_b53_serdes_init:                       ; @b53_serdes_init
	.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	x20, x0
	bl	_b53_serdes_map_lane
Lloh0:
	adrp	x8, _B53_INVALID_LANE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _B53_INVALID_LANE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	mov	x19, x0
Lloh5:
	adrp	x8, _B53_SERDES_ID0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _B53_SERDES_ID0@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _SERDES_ID0@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SERDES_ID0@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_b53_serdes_read
	mov	x21, x0
Lloh11:
	adrp	x8, _MII_PHYSID1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MII_PHYSID1@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_B53_SERDES_MII_REG
	mov	x2, x0
Lloh14:
	adrp	x23, _SERDES_MII_BLK@GOTPAGE
Lloh15:
	ldr	x23, [x23, _SERDES_MII_BLK@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x19
	bl	_b53_serdes_read
	mov	x22, x0
Lloh16:
	adrp	x8, _MII_PHYSID2@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MII_PHYSID2@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_B53_SERDES_MII_REG
	mov	x2, x0
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x19
	bl	_b53_serdes_read
	mov	w8, #65535
	cmp	w21, w8
	ccmp	w21, #0, #4, ne
	b.ne	LBB0_6
; %bb.3:
	ldr	w0, [x20]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh21:
	adrp	x8, _ENODEV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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_6:
	ldr	w8, [x20]
Lloh23:
	adrp	x9, _SERDES_ID0_MODEL_MASK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SERDES_ID0_MODEL_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	and	w3, w9, w21
Lloh26:
	adrp	x9, _SERDES_ID0_REV_LETTER_SHIFT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _SERDES_ID0_REV_LETTER_SHIFT@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	asr	w9, w21, w9
	add	w4, w9, #65
Lloh29:
	adrp	x9, _SERDES_ID0_REV_NUM_SHIFT@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SERDES_ID0_REV_NUM_SHIFT@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	asr	w9, w21, w9
Lloh32:
	adrp	x10, _SERDES_ID0_REV_NUM_MASK@GOTPAGE
Lloh33:
	ldr	x10, [x10, _SERDES_ID0_REV_NUM_MASK@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	and	w5, w9, w10
	orr	w6, w0, w22, lsl #16
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
	mov	x2, x19
	bl	_dev_info
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_B53_INVALID_LANE,8,3           ; @B53_INVALID_LANE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_B53_SERDES_ID0,4,2             ; @B53_SERDES_ID0
	.comm	_SERDES_ID0,4,2                 ; @SERDES_ID0
	.comm	_MII_PHYSID1,4,2                ; @MII_PHYSID1
	.comm	_SERDES_MII_BLK,4,2             ; @SERDES_MII_BLK
	.comm	_MII_PHYSID2,4,2                ; @MII_PHYSID2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SerDes not initialized, check settings\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"SerDes lane %d, model: %d, rev %c%d (OUI: 0x%08x)\n"

	.comm	_SERDES_ID0_MODEL_MASK,4,2      ; @SERDES_ID0_MODEL_MASK
	.comm	_SERDES_ID0_REV_LETTER_SHIFT,4,2 ; @SERDES_ID0_REV_LETTER_SHIFT
	.comm	_SERDES_ID0_REV_NUM_SHIFT,4,2   ; @SERDES_ID0_REV_NUM_SHIFT
	.comm	_SERDES_ID0_REV_NUM_MASK,4,2    ; @SERDES_ID0_REV_NUM_MASK
.subsections_via_symbols
