	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lan9303_read_switch_reg
_lan9303_read_switch_reg:               ## @lan9303_read_switch_reg
	.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
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r15
	movq	_LAN9303_SWITCH_CSR_CMD_LANES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_LAN9303_SWITCH_CSR_CMD_RW@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_LAN9303_SWITCH_CSR_CMD_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_lan9303_switch_wait_for_completion
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	%r14d, %ebx
	orl	%r13d, %ebx
	movl	8(%r15), %edi
	movq	_LAN9303_SWITCH_CSR_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r12d
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
LBB0_7:
	movl	%r12d, %edx
	callq	_dev_err
	jmp	LBB0_8
LBB0_3:
	movq	%r15, %rdi
	callq	_lan9303_switch_wait_for_completion
	movl	%eax, %r12d
	testl	%eax, %eax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	je	LBB0_4
LBB0_8:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	8(%r15), %edi
	movq	_LAN9303_SWITCH_CSR_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_lan9303_read
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	%eax, %r12d
	movl	4(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_5:
	xorl	%r12d, %r12d
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_LAN9303_SWITCH_CSR_CMD_LANES,4,2 ## @LAN9303_SWITCH_CSR_CMD_LANES
	.comm	_LAN9303_SWITCH_CSR_CMD_RW,4,2  ## @LAN9303_SWITCH_CSR_CMD_RW
	.comm	_LAN9303_SWITCH_CSR_CMD_BUSY,4,2 ## @LAN9303_SWITCH_CSR_CMD_BUSY
	.comm	_LAN9303_SWITCH_CSR_CMD,4,2     ## @LAN9303_SWITCH_CSR_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to write csr command reg: %d\n"

	.comm	_LAN9303_SWITCH_CSR_DATA,4,2    ## @LAN9303_SWITCH_CSR_DATA
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read csr data reg: %d\n"

	.no_dead_strip	_lan9303_read_switch_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lan9303_read_switch_reg
_lan9303_read_switch_reg:               ; @lan9303_read_switch_reg
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _LAN9303_SWITCH_CSR_CMD_LANES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LAN9303_SWITCH_CSR_CMD_LANES@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x8, _LAN9303_SWITCH_CSR_CMD_RW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LAN9303_SWITCH_CSR_CMD_RW@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
Lloh6:
	adrp	x8, _LAN9303_SWITCH_CSR_CMD_BUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LAN9303_SWITCH_CSR_CMD_BUSY@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
	bl	_mutex_lock
	mov	x0, x19
	bl	_lan9303_switch_wait_for_completion
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.1:
	orr	w8, w23, w22
	orr	w8, w8, w24
	orr	w2, w8, w25
	ldr	w0, [x19, #8]
Lloh9:
	adrp	x8, _LAN9303_SWITCH_CSR_CMD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LAN9303_SWITCH_CSR_CMD@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_regmap_write
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
	ldr	w0, [x19, #4]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
LBB0_3:
	mov	x2, x21
	bl	_dev_err
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_lan9303_switch_wait_for_completion
	mov	x21, x0
	cbz	w0, LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w0, [x19, #8]
Lloh14:
	adrp	x8, _LAN9303_SWITCH_CSR_DATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LAN9303_SWITCH_CSR_DATA@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_lan9303_read
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.7:
	ldr	w0, [x19, #4]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_LAN9303_SWITCH_CSR_CMD_LANES,4,2 ; @LAN9303_SWITCH_CSR_CMD_LANES
	.comm	_LAN9303_SWITCH_CSR_CMD_RW,4,2  ; @LAN9303_SWITCH_CSR_CMD_RW
	.comm	_LAN9303_SWITCH_CSR_CMD_BUSY,4,2 ; @LAN9303_SWITCH_CSR_CMD_BUSY
	.comm	_LAN9303_SWITCH_CSR_CMD,4,2     ; @LAN9303_SWITCH_CSR_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to write csr command reg: %d\n"

	.comm	_LAN9303_SWITCH_CSR_DATA,4,2    ; @LAN9303_SWITCH_CSR_DATA
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read csr data reg: %d\n"

	.no_dead_strip	_lan9303_read_switch_reg
.subsections_via_symbols
