	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ip17xx_set_port_speed
_ip17xx_set_port_speed:                 ## @ip17xx_set_port_speed
	.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	%rdx, %rbx
	movq	%rdi, %r12
	callq	_get_state
	movq	%rax, %r14
	movl	(%rbx), %r13d
	movl	4(%rbx), %eax
	movl	$8192, %r15d                    ## imm = 0x2000
	cmpl	$100, %eax
	je	LBB0_1
## %bb.2:
	cmpl	$10, %eax
	jne	LBB0_4
## %bb.3:
	xorl	%ecx, %ecx
	xorl	%r15d, %r15d
	jmp	LBB0_5
LBB0_1:
	xorl	%ecx, %ecx
	jmp	LBB0_5
LBB0_4:
	movl	$4096, %ecx                     ## imm = 0x1000
LBB0_5:
	movq	(%r14), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_7
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_11:
	subl	(%rax), %ebx
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	testl	%r13d, %r13d
	js	LBB0_6
## %bb.8:
	cmpl	(%r12), %r13d
	jge	LBB0_6
## %bb.9:
	movl	%ecx, %r12d
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_ip_phy_read
	testl	%eax, %eax
	js	LBB0_10
## %bb.12:
	andl	$-12289, %eax                   ## imm = 0xCFFF
	orl	%r12d, %r15d
	orl	%eax, %r15d
	movq	%r14, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ip_phy_write                   ## TAILCALL
LBB0_10:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ip17xx_set_port_speed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ip17xx_set_port_speed
_ip17xx_set_port_speed:                 ; @ip17xx_set_port_speed
	.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	x22, x2
	mov	x21, x0
	bl	_get_state
	ldp	w20, w8, [x22]
	mov	w9, #8192
	mov	w10, #8192
	mov	w11, #4096
	cmp	w8, #10
	csel	w11, w11, wzr, ne
	csel	w10, w10, wzr, ne
	cmp	w8, #100
	csel	w22, wzr, w11, eq
	csel	w23, w9, w10, eq
	ldr	x8, [x0]
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_3
LBB0_1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	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_3:
	tbnz	w20, #31, LBB0_1
; %bb.4:
	ldr	w8, [x21]
	cmp	w20, w8
	b.ge	LBB0_1
; %bb.5:
	mov	x19, x0
	mov	x1, x20
	mov	w2, #0
	bl	_ip_phy_read
	tbnz	w0, #31, LBB0_7
; %bb.6:
	and	w8, w0, #0xffffcfff
	orr	w9, w23, w22
	orr	w3, w9, w8
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	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
	b	_ip_phy_write
LBB0_7:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ip17xx_set_port_speed
.subsections_via_symbols
