	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv88e6xxx_g2_avb_read
_mv88e6xxx_g2_avb_read:                 ## @mv88e6xxx_g2_avb_read
	.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, %r12d
	movq	%rdx, %r15
	movl	%esi, %r13d
	movq	%rdi, %r14
	callq	_mv88e6xxx_g2_avb_wait
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	cmpl	$5, %r12d
	jl	LBB0_3
## %bb.2:
	movq	_E2BIG@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_3:
	movq	_MV88E6352_G2_AVB_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MV88E6352_G2_AVB_CMD_BUSY@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_mv88e6xxx_g2_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.4:
	movq	%r14, %rdi
	callq	_mv88e6xxx_g2_avb_wait
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	jle	LBB0_10
## %bb.6:
	movl	%r12d, %r12d
	movq	_MV88E6352_G2_AVB_DATA@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_mv88e6xxx_g2_read
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	addq	$4, %r15
	decq	%r12
	jne	LBB0_8
	jmp	LBB0_10
LBB0_9:
	movl	%eax, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_MV88E6352_G2_AVB_CMD,4,2       ## @MV88E6352_G2_AVB_CMD
	.comm	_MV88E6352_G2_AVB_CMD_BUSY,4,2  ## @MV88E6352_G2_AVB_CMD_BUSY
	.comm	_MV88E6352_G2_AVB_DATA,4,2      ## @MV88E6352_G2_AVB_DATA
	.no_dead_strip	_mv88e6xxx_g2_avb_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv88e6xxx_g2_avb_read
_mv88e6xxx_g2_avb_read:                 ; @mv88e6xxx_g2_avb_read
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x3
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	bl	_mv88e6xxx_g2_avb_wait
	cbnz	w0, LBB0_9
; %bb.1:
	cmp	w21, #5
	b.lt	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _E2BIG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_3:
Lloh3:
	adrp	x8, _MV88E6352_G2_AVB_CMD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MV88E6352_G2_AVB_CMD@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _MV88E6352_G2_AVB_CMD_BUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MV88E6352_G2_AVB_CMD_BUSY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w2, w8, w22
	mov	x0, x19
	bl	_mv88e6xxx_g2_write
	cbnz	w0, LBB0_9
; %bb.4:
	mov	x0, x19
	bl	_mv88e6xxx_g2_avb_wait
	cbnz	w0, LBB0_9
; %bb.5:
	cmp	w21, #0
	b.le	LBB0_8
; %bb.6:
Lloh9:
	adrp	x22, _MV88E6352_G2_AVB_DATA@GOTPAGE
Lloh10:
	ldr	x22, [x22, _MV88E6352_G2_AVB_DATA@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x20
	bl	_mv88e6xxx_g2_read
	cbnz	w0, LBB0_9
; %bb.7:
	cmp	w21, #1
	b.ne	LBB0_10
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	w1, [x22]
	add	x2, x20, #4
	mov	x0, x19
	bl	_mv88e6xxx_g2_read
	cbnz	w0, LBB0_9
; %bb.11:
	cmp	w21, #2
	b.eq	LBB0_8
; %bb.12:
	ldr	w1, [x22]
	add	x2, x20, #8
	mov	x0, x19
	bl	_mv88e6xxx_g2_read
	cbnz	w0, LBB0_9
; %bb.13:
	cmp	w21, #3
	b.eq	LBB0_8
; %bb.14:
	ldr	w1, [x22]
	add	x2, x20, #12
	mov	x0, x19
	bl	_mv88e6xxx_g2_read
	cmp	w0, #0
	csel	w0, wzr, w0, eq
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_MV88E6352_G2_AVB_CMD,4,2       ; @MV88E6352_G2_AVB_CMD
	.comm	_MV88E6352_G2_AVB_CMD_BUSY,4,2  ; @MV88E6352_G2_AVB_CMD_BUSY
	.comm	_MV88E6352_G2_AVB_DATA,4,2      ; @MV88E6352_G2_AVB_DATA
	.no_dead_strip	_mv88e6xxx_g2_avb_read
.subsections_via_symbols
