	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mcs7830_read_phy
_mcs7830_read_phy:                      ## @mcs7830_read_phy
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_HIF_REG_PHY_CMD1_READ@GOTPCREL(%rip), %rax
	movq	_HIF_REG_PHY_CMD1_PHYADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -56(%rbp)
	movq	_HIF_REG_PHY_CMD2_PEND_FLAG_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%esi, %eax
	movl	%eax, -52(%rbp)
	callq	_mutex_lock
	movq	_HIF_REG_PHY_CMD1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rcx
	movq	%r15, %rdi
	movl	$2, %edx
	callq	_mcs7830_set_reg
	testl	%eax, %eax
	js	LBB0_12
## %bb.1:
	movl	%r14d, -64(%rbp)                ## 4-byte Spill
	xorl	%r12d, %r12d
	leaq	-56(%rbp), %r13
	movq	_HIF_REG_PHY_CMD2_READY_FLAG_BIT@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_HIF_REG_PHY_CMD1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$2, %edx
	movq	%r13, %rcx
	callq	_mcs7830_get_reg
	testl	%eax, %eax
	js	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r14), %eax
	testl	%eax, -52(%rbp)
	jne	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$1, %edi
	callq	_msleep
	incl	%r12d
	cmpl	$10, %r12d
	jne	LBB0_2
## %bb.5:
	testl	%ebx, %ebx
	jle	LBB0_9
## %bb.6:
	negl	%ebx
	jmp	LBB0_13
LBB0_9:
	movl	$10, %r12d
LBB0_10:
	movq	_HIF_REG_PHY_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-60(%rbp), %rcx
	movq	%r15, %rdi
	movl	$2, %edx
	callq	_mcs7830_get_reg
	testl	%eax, %eax
	js	LBB0_12
## %bb.11:
	movl	-60(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %ebx
	movq	8(%r15), %rdi
	movl	-60(%rbp), %ecx
	leaq	L_.str(%rip), %rsi
	movl	-64(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %r8d
	callq	_dev_dbg
	jmp	LBB0_13
LBB0_12:
	movl	%eax, %ebx
LBB0_13:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HIF_REG_PHY_CMD1_READ,4,2      ## @HIF_REG_PHY_CMD1_READ
	.comm	_HIF_REG_PHY_CMD1_PHYADDR,4,2   ## @HIF_REG_PHY_CMD1_PHYADDR
	.comm	_HIF_REG_PHY_CMD2_PEND_FLAG_BIT,4,2 ## @HIF_REG_PHY_CMD2_PEND_FLAG_BIT
	.comm	_HIF_REG_PHY_CMD1,4,2           ## @HIF_REG_PHY_CMD1
	.comm	_HIF_REG_PHY_CMD2_READY_FLAG_BIT,4,2 ## @HIF_REG_PHY_CMD2_READY_FLAG_BIT
	.comm	_EIO,4,2                        ## @EIO
	.comm	_HIF_REG_PHY_DATA,4,2           ## @HIF_REG_PHY_DATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read PHY reg %02x: %04x (%d tries)\n"

	.no_dead_strip	_mcs7830_read_phy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mcs7830_read_phy
_mcs7830_read_phy:                      ; @mcs7830_read_phy
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _HIF_REG_PHY_CMD1_READ@GOTPAGE
Lloh4:
	ldr	x9, [x9, _HIF_REG_PHY_CMD1_READ@GOTPAGEOFF]
	str	x8, [sp, #24]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _HIF_REG_PHY_CMD1_PHYADDR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _HIF_REG_PHY_CMD1_PHYADDR@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _HIF_REG_PHY_CMD2_PEND_FLAG_BIT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _HIF_REG_PHY_CMD2_PEND_FLAG_BIT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w9, w9, w1
	stp	w8, w9, [sp, #16]
	bl	_mutex_lock
Lloh12:
	adrp	x23, _HIF_REG_PHY_CMD1@GOTPAGE
Lloh13:
	ldr	x23, [x23, _HIF_REG_PHY_CMD1@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x3, sp, #16
	mov	x0, x19
	mov	w2, #2
	bl	_mcs7830_set_reg
	tbnz	w0, #31, LBB0_10
; %bb.1:
	mov	w21, #0
Lloh14:
	adrp	x24, _HIF_REG_PHY_CMD2_READY_FLAG_BIT@GOTPAGE
Lloh15:
	ldr	x24, [x24, _HIF_REG_PHY_CMD2_READY_FLAG_BIT@GOTPAGEOFF]
Lloh16:
	adrp	x25, _EIO@GOTPAGE
Lloh17:
	ldr	x25, [x25, _EIO@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	add	x3, sp, #16
	mov	x0, x19
	mov	w2, #2
	bl	_mcs7830_get_reg
	tbnz	w0, #31, LBB0_10
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [sp, #20]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w22, [x25]
	mov	w0, #1
	bl	_msleep
	add	w21, w21, #1
	cmp	w21, #10
	b.ne	LBB0_2
; %bb.5:
	cmp	w22, #0
	b.le	LBB0_7
; %bb.6:
	neg	w22, w22
	b	LBB0_11
LBB0_7:
	mov	w21, #10
LBB0_8:
Lloh18:
	adrp	x8, _HIF_REG_PHY_DATA@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HIF_REG_PHY_DATA@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	add	x3, sp, #12
	mov	x0, x19
	mov	w2, #2
	bl	_mcs7830_get_reg
	tbnz	w0, #31, LBB0_10
; %bb.9:
	ldr	w0, [sp, #12]
	bl	_le16_to_cpu
	mov	x22, x0
	ldr	x0, [x19, #8]
	ldr	w3, [sp, #12]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x4, x21
	bl	_dev_dbg
	b	LBB0_11
LBB0_10:
	mov	x22, x0
LBB0_11:
	mov	x0, x19
	bl	_mutex_unlock
	ldr	x8, [sp, #24]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_HIF_REG_PHY_CMD1_READ,4,2      ; @HIF_REG_PHY_CMD1_READ
	.comm	_HIF_REG_PHY_CMD1_PHYADDR,4,2   ; @HIF_REG_PHY_CMD1_PHYADDR
	.comm	_HIF_REG_PHY_CMD2_PEND_FLAG_BIT,4,2 ; @HIF_REG_PHY_CMD2_PEND_FLAG_BIT
	.comm	_HIF_REG_PHY_CMD1,4,2           ; @HIF_REG_PHY_CMD1
	.comm	_HIF_REG_PHY_CMD2_READY_FLAG_BIT,4,2 ; @HIF_REG_PHY_CMD2_READY_FLAG_BIT
	.comm	_EIO,4,2                        ; @EIO
	.comm	_HIF_REG_PHY_DATA,4,2           ; @HIF_REG_PHY_DATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read PHY reg %02x: %04x (%d tries)\n"

	.no_dead_strip	_mcs7830_read_phy
.subsections_via_symbols
