	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mac_set_speed_duplex_fc
_mac_set_speed_duplex_fc:               ## @mac_set_speed_duplex_fc
	.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	%ecx, %r15d
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movl	(%rax), %r14d
	movq	_SPEED_100@GOTPCREL(%rip), %rsi
	movq	_SPEED_1000@GOTPCREL(%rip), %rdx
	movl	$-1, %eax
	testl	%ebx, %ebx
	js	LBB0_4
## %bb.1:
	movq	_SPEED_10@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	je	LBB0_4
## %bb.2:
	cmpl	%ebx, (%rsi)
	je	LBB0_4
## %bb.3:
	cmpl	%ebx, (%rdx)
	jne	LBB0_26
LBB0_4:
	testl	%r12d, %r12d
	jle	LBB0_6
## %bb.5:
	movq	_DUPLEX_FULL@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rcx)
	jne	LBB0_26
LBB0_6:
	testl	%ebx, %ebx
	js	LBB0_20
## %bb.7:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	(%r13), %r15d
	movl	%r14d, %edi
	callq	_REG_MODE_CFG
	leaq	-44(%rbp), %rdx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_vsc_read
	movl	-44(%rbp), %eax
	andl	$-16, %eax
	leal	4(%rax), %ecx
	movl	%ecx, -44(%rbp)
	movq	_SPEED_1000@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_9
## %bb.8:
	orl	$12, %eax
	movl	%eax, -44(%rbp)
LBB0_9:
	movl	(%r13), %r15d
	movl	%r14d, %edi
	callq	_REG_MODE_CFG
	movl	-44(%rbp), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_vsc_write
	movq	_SPEED_1000@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_11
## %bb.10:
	movl	$130, -44(%rbp)
	jmp	LBB0_14
LBB0_11:
	movq	_SPEED_100@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_13
## %bb.12:
	movl	$132, -44(%rbp)
	jmp	LBB0_14
LBB0_13:
	movl	$134, -44(%rbp)
LBB0_14:
	movl	(%r13), %r15d
	movl	%r14d, %edi
	callq	_REG_DEV_SETUP
	movl	-44(%rbp), %edx
	orl	$1, %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_vsc_write
	movl	(%r13), %r15d
	movl	%r14d, %edi
	callq	_REG_DEV_SETUP
	movl	-44(%rbp), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_vsc_write
	movl	(%r13), %r15d
	movl	%r14d, %edi
	callq	_REG_DBG
	leaq	-44(%rbp), %rdx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_vsc_read
	movq	_SPEED_1000@GOTPCREL(%rip), %rdx
	movl	-44(%rbp), %ecx
	movl	%ecx, %eax
	andl	$-65281, %eax                   ## imm = 0xFFFF00FF
	cmpl	%ebx, (%rdx)
	jne	LBB0_16
## %bb.15:
	orl	$1024, %eax                     ## imm = 0x400
	movl	%eax, -44(%rbp)
	jmp	LBB0_19
LBB0_16:
	movq	_SPEED_100@GOTPCREL(%rip), %rsi
	cmpl	%ebx, (%rsi)
	jne	LBB0_18
## %bb.17:
	orl	$8192, %eax                     ## imm = 0x2000
	movl	%eax, -44(%rbp)
	jmp	LBB0_19
LBB0_18:
	orl	$65280, %ecx                    ## imm = 0xFF00
	movl	%ecx, -44(%rbp)
LBB0_19:
	movl	(%r13), %r15d
	movl	%r14d, %edi
	callq	_REG_DBG
	movl	-44(%rbp), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_vsc_write
	movl	(%r13), %r15d
	movl	%r14d, %edi
	callq	_REG_TX_IFG
	movq	_SPEED_1000@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	movl	$5, %ecx
	movl	$17, %edx
	cmovel	%ecx, %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_vsc_write
	movq	_DUPLEX_HALF@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movq	_SPEED_1000@GOTPCREL(%rip), %rdx
	cmpl	%ebx, (%rdx)
	sete	%cl
	cmpl	%r12d, (%rax)
	leal	9623(,%rcx,8), %eax
	movl	$9619, %ebx                     ## imm = 0x2593
	cmovnel	%eax, %ebx
	movl	(%r13), %r15d
	movl	%r14d, %edi
	callq	_REG_MODE_CFG
	movl	%r15d, %edi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_vsc_write
	movl	-48(%rbp), %r15d                ## 4-byte Reload
LBB0_20:
	movl	(%r13), %ebx
	movl	%r14d, %edi
	callq	_REG_PAUSE_CFG
	leaq	-44(%rbp), %rdx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_vsc_read
	movl	$-983041, %edx                  ## imm = 0xFFF0FFFF
	andl	-44(%rbp), %edx
	leal	131072(%rdx), %ecx
	movl	%ecx, -44(%rbp)
	movq	_PAUSE_RX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r15d, %eax
	je	LBB0_22
## %bb.21:
	orl	$393216, %edx                   ## imm = 0x60000
	movl	%edx, -44(%rbp)
	movl	%edx, %ecx
LBB0_22:
	movq	_PAUSE_TX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%edx, %eax
	cmpl	%r15d, %eax
	je	LBB0_24
## %bb.23:
	movl	%edx, %esi
	andl	%r15d, %esi
	je	LBB0_25
LBB0_24:
	movl	%ecx, %esi
	orl	$524288, %esi                   ## imm = 0x80000
	testl	%r15d, %edx
	cmovel	%ecx, %esi
	movl	%esi, %ecx
	orl	$65536, %ecx                    ## imm = 0x10000
	cmpl	%r15d, %eax
	cmovnel	%esi, %ecx
	movl	%ecx, -44(%rbp)
LBB0_25:
	movl	(%r13), %ebx
	movl	%r14d, %edi
	callq	_REG_PAUSE_CFG
	movl	-44(%rbp), %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_vsc_write
	xorl	%eax, %eax
LBB0_26:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPEED_10,4,2                   ## @SPEED_10
	.comm	_SPEED_100,4,2                  ## @SPEED_100
	.comm	_SPEED_1000,4,2                 ## @SPEED_1000
	.comm	_DUPLEX_FULL,4,2                ## @DUPLEX_FULL
	.comm	_DUPLEX_HALF,4,2                ## @DUPLEX_HALF
	.comm	_PAUSE_RX,4,2                   ## @PAUSE_RX
	.comm	_PAUSE_TX,4,2                   ## @PAUSE_TX
	.no_dead_strip	_mac_set_speed_duplex_fc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mac_set_speed_duplex_fc
_mac_set_speed_duplex_fc:               ; @mac_set_speed_duplex_fc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w20, [x8]
Lloh0:
	adrp	x26, _SPEED_100@GOTPAGE
Lloh1:
	ldr	x26, [x26, _SPEED_100@GOTPAGEOFF]
Lloh2:
	adrp	x25, _SPEED_1000@GOTPAGE
Lloh3:
	ldr	x25, [x25, _SPEED_1000@GOTPAGEOFF]
	tbnz	w1, #31, LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _SPEED_10@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SPEED_10@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x26]
	ldr	w10, [x25]
	cmp	w8, w23
	ccmp	w9, w23, #4, ne
	ccmp	w10, w23, #4, ne
	b.ne	LBB0_4
LBB0_2:
	cmp	w22, #1
	b.lt	LBB0_5
; %bb.3:
Lloh7:
	adrp	x8, _DUPLEX_FULL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DUPLEX_FULL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, w22
	b.eq	LBB0_5
LBB0_4:
	mov	w0, #-1
	b	LBB0_24
LBB0_5:
	tbnz	w23, #31, LBB0_19
; %bb.6:
	ldr	w24, [x19]
	mov	x0, x20
	bl	_REG_MODE_CFG
	mov	x1, x0
	add	x2, sp, #12
	mov	x0, x24
	bl	_vsc_read
	ldr	w8, [sp, #12]
	and	w8, w8, #0xfffffff0
	orr	w9, w8, #0x4
	str	w9, [sp, #12]
	ldr	w9, [x25]
	cmp	w9, w23
	b.ne	LBB0_8
; %bb.7:
	orr	w8, w8, #0xc
	str	w8, [sp, #12]
LBB0_8:
	ldr	w24, [x19]
	mov	x0, x20
	bl	_REG_MODE_CFG
	mov	x1, x0
	ldr	w2, [sp, #12]
	mov	x0, x24
	bl	_vsc_write
	ldr	w8, [x25]
	cmp	w8, w23
	b.ne	LBB0_10
; %bb.9:
	mov	w8, #130
	b	LBB0_13
LBB0_10:
	ldr	w8, [x26]
	cmp	w8, w23
	b.ne	LBB0_12
; %bb.11:
	mov	w8, #132
	b	LBB0_13
LBB0_12:
	mov	w8, #134
LBB0_13:
	str	w8, [sp, #12]
	ldr	w24, [x19]
	mov	x0, x20
	bl	_REG_DEV_SETUP
	mov	x1, x0
	ldr	w8, [sp, #12]
	orr	w2, w8, #0x1
	mov	x0, x24
	bl	_vsc_write
	ldr	w24, [x19]
	mov	x0, x20
	bl	_REG_DEV_SETUP
	mov	x1, x0
	ldr	w2, [sp, #12]
	mov	x0, x24
	bl	_vsc_write
	ldr	w24, [x19]
	mov	x0, x20
	bl	_REG_DBG
	mov	x1, x0
	add	x2, sp, #12
	mov	x0, x24
	bl	_vsc_read
	ldr	w9, [sp, #12]
	and	w8, w9, #0xffff00ff
	ldr	w10, [x25]
	cmp	w10, w23
	b.ne	LBB0_15
; %bb.14:
	orr	w8, w8, #0x400
	b	LBB0_18
LBB0_15:
	ldr	w10, [x26]
	cmp	w10, w23
	b.ne	LBB0_17
; %bb.16:
	orr	w8, w8, #0x2000
	b	LBB0_18
LBB0_17:
	orr	w8, w9, #0xff00
LBB0_18:
	str	w8, [sp, #12]
	ldr	w24, [x19]
	mov	x0, x20
	bl	_REG_DBG
	mov	x1, x0
	ldr	w2, [sp, #12]
	mov	x0, x24
	bl	_vsc_write
	ldr	w24, [x19]
	mov	x0, x20
	bl	_REG_TX_IFG
	mov	x1, x0
	ldr	w8, [x25]
	mov	w9, #17
	mov	w10, #5
	cmp	w8, w23
	csel	w2, w10, w9, eq
	mov	x0, x24
	bl	_vsc_write
Lloh10:
	adrp	x8, _DUPLEX_HALF@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DUPLEX_HALF@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x25]
	mov	w10, #9623
	mov	w11, #9631
	cmp	w9, w23
	csel	w9, w11, w10, eq
	mov	w10, #9619
	cmp	w8, w22
	csel	w22, w10, w9, eq
	ldr	w23, [x19]
	mov	x0, x20
	bl	_REG_MODE_CFG
	mov	x1, x0
	mov	x0, x23
	mov	x2, x22
	bl	_vsc_write
LBB0_19:
	ldr	w22, [x19]
	mov	x0, x20
	bl	_REG_PAUSE_CFG
	mov	x1, x0
	add	x2, sp, #12
	mov	x0, x22
	bl	_vsc_read
	ldr	w8, [sp, #12]
	and	w10, w8, #0xfff0ffff
	orr	w8, w10, #0x20000
	str	w8, [sp, #12]
Lloh13:
	adrp	x9, _PAUSE_RX@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PAUSE_RX@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w21
	b.eq	LBB0_21
; %bb.20:
	orr	w8, w10, #0x60000
	str	w8, [sp, #12]
LBB0_21:
Lloh16:
	adrp	x10, _PAUSE_TX@GOTPAGE
Lloh17:
	ldr	x10, [x10, _PAUSE_TX@GOTPAGEOFF]
Lloh18:
	ldr	w11, [x10]
	and	w10, w11, w21
	orr	w9, w11, w9
	cmp	w9, w21
	ccmp	w10, #0, #0, ne
	b.eq	LBB0_23
; %bb.22:
	orr	w11, w8, #0x80000
	cmp	w10, #0
	csel	w8, w8, w11, eq
	orr	w10, w8, #0x10000
	cmp	w9, w21
	csel	w8, w10, w8, eq
	str	w8, [sp, #12]
LBB0_23:
	ldr	w19, [x19]
	mov	x0, x20
	bl	_REG_PAUSE_CFG
	mov	x1, x0
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_vsc_write
	mov	w0, #0
LBB0_24:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SPEED_10,4,2                   ; @SPEED_10
	.comm	_SPEED_100,4,2                  ; @SPEED_100
	.comm	_SPEED_1000,4,2                 ; @SPEED_1000
	.comm	_DUPLEX_FULL,4,2                ; @DUPLEX_FULL
	.comm	_DUPLEX_HALF,4,2                ; @DUPLEX_HALF
	.comm	_PAUSE_RX,4,2                   ; @PAUSE_RX
	.comm	_PAUSE_TX,4,2                   ; @PAUSE_TX
	.no_dead_strip	_mac_set_speed_duplex_fc
.subsections_via_symbols
