	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function serdes_set_mode
_serdes_set_mode:                       ## @serdes_set_mode
	.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, %r14d
	movl	%esi, %r15d
	callq	_phy_get_drvdata
	movq	%rax, %r13
	movq	_PHY_MODE_ETHERNET@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_11
## %bb.1:
	movq	_ocelot_serdes_muxes@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_13
## %bb.2:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$32, %rbx
	cmpq	%rax, %r12
	jae	LBB0_13
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	_ocelot_serdes_muxes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	cmpq	(%rdi,%rbx), %rax
	jne	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r15d, 8(%rdi,%rbx)
	jne	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r14d, 12(%rdi,%rbx)
	jne	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_PHY_INTERFACE_MODE_QSGMII@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r13), %rax
	cmpq	16(%rdi,%rbx), %rax
	jne	LBB0_12
LBB0_8:
	movq	16(%r13), %rax
	movl	(%rax), %eax
	movq	_HSIO_HW_CFG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	24(%rdi,%rbx), %ecx
	movl	28(%rdi,%rbx), %edx
	movl	%eax, %edi
	callq	_regmap_update_bits
	testl	%eax, %eax
	jne	LBB0_15
## %bb.9:
	movq	(%r13), %rsi
	movq	_SERDES1G_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rsi
	jle	LBB0_16
## %bb.10:
	movq	_SERDES6G_MAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rsi
	jle	LBB0_17
LBB0_11:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	jmp	LBB0_14
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_14:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	16(%r13), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_serdes_init_s1g                ## TAILCALL
LBB0_17:
	movq	16(%r13), %rcx
	movl	(%rcx), %edi
	notq	%rax
	addq	%rax, %rsi
	movq	_ocelot_serdes_muxes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	12(%rax,%rbx), %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_serdes_init_s6g                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_MODE_ETHERNET,4,2          ## @PHY_MODE_ETHERNET
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_ocelot_serdes_muxes,8,3        ## @ocelot_serdes_muxes
	.comm	_PHY_INTERFACE_MODE_QSGMII,4,2  ## @PHY_INTERFACE_MODE_QSGMII
	.comm	_HSIO_HW_CFG,4,2                ## @HSIO_HW_CFG
	.comm	_SERDES1G_MAX,8,3               ## @SERDES1G_MAX
	.comm	_SERDES6G_MAX,8,3               ## @SERDES6G_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_serdes_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function serdes_set_mode
_serdes_set_mode:                       ; @serdes_set_mode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	bl	_phy_get_drvdata
Lloh0:
	adrp	x8, _PHY_MODE_ETHERNET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHY_MODE_ETHERNET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_12
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x22, _ocelot_serdes_muxes@GOTPAGE
Lloh4:
	ldr	x22, [x22, _ocelot_serdes_muxes@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_13
; %bb.2:
	mov	x23, #0
	mov	x24, #0
Lloh5:
	adrp	x25, _PHY_INTERFACE_MODE_QSGMII@GOTPAGE
Lloh6:
	ldr	x25, [x25, _PHY_INTERFACE_MODE_QSGMII@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	bl	_ARRAY_SIZE
	add	x23, x23, #32
	cmp	x24, w0, uxtw
	b.hs	LBB0_13
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x0, [x22]
	ldr	x9, [x0, x23]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x0, x23
	ldr	w9, [x8, #8]
	cmp	w9, w21
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x8, #12]
	cmp	w8, w20
	b.ne	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x25]
	cmp	w8, w20
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	add	x9, x0, x23
	ldr	x9, [x9, #16]
	cmp	x8, x9
	b.ne	LBB0_3
LBB0_9:
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _HSIO_HW_CFG@GOTPAGE
Lloh8:
	ldr	x9, [x9, _HSIO_HW_CFG@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x9]
	add	x9, x0, x23
	ldp	w3, w2, [x9, #24]
	mov	x0, x8
	bl	_regmap_update_bits
	cbnz	w0, LBB0_15
; %bb.10:
	ldr	x1, [x19]
Lloh10:
	adrp	x8, _SERDES1G_MAX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SERDES1G_MAX@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x1, x8
	b.le	LBB0_16
; %bb.11:
Lloh13:
	adrp	x9, _SERDES6G_MAX@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SERDES6G_MAX@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x1, x9
	b.le	LBB0_17
LBB0_12:
Lloh16:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_16:
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_serdes_init_s1g
LBB0_17:
	ldr	x9, [x19, #16]
	ldr	w0, [x9]
	mvn	x8, x8
	add	x1, x1, x8
	ldr	x8, [x22]
	add	x8, x8, x23
	ldr	w2, [x8, #12]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_serdes_init_s6g
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_MODE_ETHERNET,4,2          ; @PHY_MODE_ETHERNET
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_ocelot_serdes_muxes,8,3        ; @ocelot_serdes_muxes
	.comm	_PHY_INTERFACE_MODE_QSGMII,4,2  ; @PHY_INTERFACE_MODE_QSGMII
	.comm	_HSIO_HW_CFG,4,2                ; @HSIO_HW_CFG
	.comm	_SERDES1G_MAX,8,3               ; @SERDES1G_MAX
	.comm	_SERDES6G_MAX,8,3               ; @SERDES6G_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_serdes_set_mode
.subsections_via_symbols
