	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgbe_phy_redrv_write
_xgbe_phy_redrv_write:                  ## @xgbe_phy_redrv_write
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r13
	movzbl	%sil, %eax
	shrl	$7, %esi
	andl	$510, %esi                      ## imm = 0x1FE
	movl	%esi, -80(%rbp)
	movl	%eax, -76(%rbp)
	movl	%edx, %edi
	callq	_cpu_to_be16
	movl	%eax, -72(%rbp)
	movl	$-1, %r12d
	movq	_XGBE_I2C_CMD_WRITE@GOTPCREL(%rip), %rbx
	leaq	-104(%rbp), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	%eax, -84(%rbp)
	movl	(%r13), %eax
	movl	%eax, -88(%rbp)
	movl	$20, -104(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, -96(%rbp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_xgbe_phy_i2c_xfer
	testl	%eax, %eax
	je	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%r12), %ecx
	testl	%r12d, %r12d
	movl	%ecx, %r12d
	jne	LBB0_1
	jmp	LBB0_10
LBB0_2:
	movl	$-1, %ebx
	movq	_XGBE_I2C_CMD_READ@GOTPCREL(%rip), %r12
	leaq	-104(%rbp), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %eax
	movl	%eax, -84(%rbp)
	movl	(%r13), %eax
	movl	%eax, -88(%rbp)
	movl	$1, -104(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, -96(%rbp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_xgbe_phy_i2c_xfer
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	jne	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	1(%rbx), %ecx
	testl	%ebx, %ebx
	movl	%ecx, %ebx
	jne	LBB0_3
	jmp	LBB0_10
LBB0_8:
	xorl	%eax, %eax
	cmpl	$255, -80(%rbp)
	je	LBB0_10
## %bb.9:
	movq	_drv@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r15, %rdi
	callq	_netif_dbg
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_12
## %bb.11:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_XGBE_I2C_CMD_WRITE,4,2         ## @XGBE_I2C_CMD_WRITE
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_XGBE_I2C_CMD_READ,4,2          ## @XGBE_I2C_CMD_READ
	.comm	_drv,4,2                        ## @drv
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Redriver write checksum error\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_xgbe_phy_redrv_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgbe_phy_redrv_write
_xgbe_phy_redrv_write:                  ; @xgbe_phy_redrv_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldr	x20, [x0, #8]
	lsr	w8, w1, #7
	and	w8, w8, #0x1fe
	and	w9, w1, #0xff
	stp	w8, w9, [sp, #36]
	mov	x0, x2
	bl	_cpu_to_be16
	str	w0, [sp, #44]
Lloh3:
	adrp	x22, _XGBE_I2C_CMD_WRITE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _XGBE_I2C_CMD_WRITE@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [sp, #28]
	ldr	w8, [x20]
	str	w8, [sp, #24]
	mov	w8, #20
	str	w8, [sp, #8]
	add	x21, sp, #36
	str	x21, [sp, #16]
	add	x1, sp, #8
	mov	x0, x19
	bl	_xgbe_phy_i2c_xfer
	cbz	w0, LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_9
; %bb.2:
	ldr	w8, [x22]
	str	w8, [sp, #28]
	ldr	w8, [x20]
	str	w8, [sp, #24]
	mov	w8, #20
	str	w8, [sp, #8]
	add	x8, sp, #36
	str	x8, [sp, #16]
	add	x1, sp, #8
	mov	x0, x19
	bl	_xgbe_phy_i2c_xfer
	cbnz	w0, LBB0_9
LBB0_3:
Lloh8:
	adrp	x22, _XGBE_I2C_CMD_READ@GOTPAGE
Lloh9:
	ldr	x22, [x22, _XGBE_I2C_CMD_READ@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [sp, #28]
	ldr	w8, [x20]
	str	w8, [sp, #24]
	mov	w8, #1
	str	w8, [sp, #8]
	str	x21, [sp, #16]
	add	x1, sp, #8
	mov	x0, x19
	bl	_xgbe_phy_i2c_xfer
	cbz	w0, LBB0_6
; %bb.4:
Lloh10:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_9
; %bb.5:
	ldr	w8, [x22]
	str	w8, [sp, #28]
	ldr	w8, [x20]
	str	w8, [sp, #24]
	mov	w8, #1
	str	w8, [sp, #8]
	add	x8, sp, #36
	str	x8, [sp, #16]
	add	x1, sp, #8
	mov	x0, x19
	bl	_xgbe_phy_i2c_xfer
	cbnz	w0, LBB0_9
LBB0_6:
	ldr	w8, [sp, #36]
	cmp	w8, #255
	b.ne	LBB0_8
; %bb.7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh13:
	adrp	x8, _drv@GOTPAGE
Lloh14:
	ldr	x8, [x8, _drv@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	w2, [x19]
Lloh16:
	adrp	x3, l_.str@PAGE
Lloh17:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netif_dbg
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldur	x8, [x29, #-40]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_XGBE_I2C_CMD_WRITE,4,2         ; @XGBE_I2C_CMD_WRITE
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_XGBE_I2C_CMD_READ,4,2          ; @XGBE_I2C_CMD_READ
	.comm	_drv,4,2                        ; @drv
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Redriver write checksum error\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_xgbe_phy_redrv_write
.subsections_via_symbols
