	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_octeon_mbox_read               ## -- Begin function octeon_mbox_read
	.p2align	4, 0x90
_octeon_mbox_read:                      ## @octeon_mbox_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movl	8(%r15), %edi
	callq	_readq
	movq	_OCTEON_PFVFACK@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	cmpq	(%r12), %rax
	je	LBB0_21
## %bb.1:
	movq	_OCTEON_PFVFSIG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_21
## %bb.2:
	movl	(%r15), %ecx
	movq	_OCTEON_MBOX_STATE_REQUEST_RECEIVING@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_4
## %bb.3:
	movq	56(%r15), %rsi
	movslq	64(%r15), %rdi
	movq	%rax, -8(%rsi,%rdi,8)
	leal	1(%rdi), %eax
	movl	%eax, 64(%r15)
	jmp	LBB0_12
LBB0_4:
	movq	_OCTEON_MBOX_STATE_RESPONSE_RECEIVING@GOTPCREL(%rip), %rsi
	testl	%ecx, (%rsi)
	je	LBB0_6
## %bb.5:
	movq	16(%r15), %rsi
	movslq	24(%r15), %rdi
	movq	%rax, -8(%rsi,%rdi,8)
	leal	1(%rdi), %eax
	movl	%eax, 24(%r15)
	jmp	LBB0_12
LBB0_6:
	movq	_OCTEON_MBOX_STATE_IDLE@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	testl	%ecx, %edi
	je	LBB0_9
## %bb.7:
	movq	_OCTEON_MBOX_REQUEST@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_9
## %bb.8:
	notl	%edi
	andl	%edi, %ecx
	movl	%ecx, (%r15)
	orl	(%rdx), %ecx
	movl	%ecx, (%r15)
	movq	%rax, 72(%r15)
	movl	96(%r15), %eax
	movl	%eax, 88(%r15)
	movl	$1, 64(%r15)
	jmp	LBB0_12
LBB0_9:
	movq	_OCTEON_MBOX_STATE_RESPONSE_PENDING@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	testl	%ecx, %edi
	je	LBB0_22
## %bb.10:
	movq	_OCTEON_MBOX_RESPONSE@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_22
## %bb.11:
	notl	%edi
	andl	%edi, %ecx
	movl	%ecx, (%r15)
	orl	(%rsi), %ecx
	movl	%ecx, (%r15)
	movq	%rax, 32(%r15)
	movl	96(%r15), %eax
	movl	%eax, 48(%r15)
	movl	$1, 24(%r15)
LBB0_12:
	movl	(%rdx), %eax
	testl	%ecx, %eax
	je	LBB0_16
## %bb.13:
	movl	64(%r15), %edx
	xorl	%ebx, %ebx
	cmpl	80(%r15), %edx
	jl	LBB0_20
## %bb.14:
	notl	%eax
	andl	%eax, %ecx
	movl	%ecx, (%r15)
	movq	_OCTEON_MBOX_STATE_REQUEST_RECEIVED@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_16:
	movq	_OCTEON_MBOX_STATE_RESPONSE_RECEIVING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ecx, %eax
	je	LBB0_19
## %bb.17:
	movl	24(%r15), %edx
	xorl	%ebx, %ebx
	cmpl	40(%r15), %edx
	jl	LBB0_20
## %bb.18:
	notl	%eax
	andl	%eax, %ecx
	movl	%ecx, (%r15)
	movq	_OCTEON_MBOX_STATE_RESPONSE_RECEIVED@GOTPCREL(%rip), %rax
LBB0_15:
	orl	(%rax), %ecx
	movl	%ecx, (%r15)
	movl	$1, %ebx
	jmp	LBB0_20
LBB0_19:
	movl	$1, %edi
	callq	_WARN_ON
	xorl	%ebx, %ebx
LBB0_20:
	movq	(%r12), %rdi
	movl	8(%r15), %esi
	callq	_writeq
LBB0_21:
	movq	%r14, %rdi
	callq	_spin_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	_OCTEON_PFVFERR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	8(%r15), %esi
	callq	_writeq
	movq	_OCTEON_MBOX_STATE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	movl	$1, %ebx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_OCTEON_PFVFACK,8,3             ## @OCTEON_PFVFACK
	.comm	_OCTEON_PFVFSIG,8,3             ## @OCTEON_PFVFSIG
	.comm	_OCTEON_MBOX_STATE_REQUEST_RECEIVING,4,2 ## @OCTEON_MBOX_STATE_REQUEST_RECEIVING
	.comm	_OCTEON_MBOX_STATE_RESPONSE_RECEIVING,4,2 ## @OCTEON_MBOX_STATE_RESPONSE_RECEIVING
	.comm	_OCTEON_MBOX_STATE_IDLE,4,2     ## @OCTEON_MBOX_STATE_IDLE
	.comm	_OCTEON_MBOX_REQUEST,8,3        ## @OCTEON_MBOX_REQUEST
	.comm	_OCTEON_MBOX_STATE_RESPONSE_PENDING,4,2 ## @OCTEON_MBOX_STATE_RESPONSE_PENDING
	.comm	_OCTEON_MBOX_RESPONSE,8,3       ## @OCTEON_MBOX_RESPONSE
	.comm	_OCTEON_PFVFERR,8,3             ## @OCTEON_PFVFERR
	.comm	_OCTEON_MBOX_STATE_ERROR,4,2    ## @OCTEON_MBOX_STATE_ERROR
	.comm	_OCTEON_MBOX_STATE_REQUEST_RECEIVED,4,2 ## @OCTEON_MBOX_STATE_REQUEST_RECEIVED
	.comm	_OCTEON_MBOX_STATE_RESPONSE_RECEIVED,4,2 ## @OCTEON_MBOX_STATE_RESPONSE_RECEIVED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_octeon_mbox_read               ; -- Begin function octeon_mbox_read
	.p2align	2
_octeon_mbox_read:                      ; @octeon_mbox_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	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_spin_lock
	ldr	w0, [x20, #8]
	bl	_readq
Lloh0:
	adrp	x22, _OCTEON_PFVFACK@GOTPAGE
Lloh1:
	ldr	x22, [x22, _OCTEON_PFVFACK@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh2:
	adrp	x9, _OCTEON_PFVFSIG@GOTPAGE
Lloh3:
	ldr	x9, [x9, _OCTEON_PFVFSIG@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x0, x8
	ccmp	x0, x9, #4, ne
	b.ne	LBB0_2
; %bb.1:
	mov	w21, #0
	b	LBB0_20
LBB0_2:
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _OCTEON_MBOX_STATE_REQUEST_RECEIVING@GOTPAGE
Lloh6:
	ldr	x9, [x9, _OCTEON_MBOX_STATE_REQUEST_RECEIVING@GOTPAGEOFF]
	ldr	w10, [x9]
	tst	w10, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	x10, [x20, #56]
	ldr	w11, [x20, #64]
	sub	w12, w11, #1
	str	x0, [x10, w12, sxtw #3]
	add	w10, w11, #1
	str	w10, [x20, #64]
	b	LBB0_7
LBB0_4:
Lloh7:
	adrp	x10, _OCTEON_MBOX_STATE_RESPONSE_RECEIVING@GOTPAGE
Lloh8:
	ldr	x10, [x10, _OCTEON_MBOX_STATE_RESPONSE_RECEIVING@GOTPAGEOFF]
	ldr	w11, [x10]
	tst	w11, w8
	b.eq	LBB0_14
; %bb.5:
	ldr	x10, [x20, #16]
	ldr	w11, [x20, #24]
	sub	w12, w11, #1
	str	x0, [x10, w12, sxtw #3]
	add	w10, w11, #1
LBB0_6:
	str	w10, [x20, #24]
LBB0_7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:
	ldr	w10, [x20, #64]
	ldr	w11, [x20, #80]
	cmp	w10, w11
	b.lt	LBB0_18
; %bb.9:
	bic	w8, w8, w9
	str	w8, [x20]
Lloh9:
	adrp	x9, _OCTEON_MBOX_STATE_REQUEST_RECEIVED@GOTPAGE
Lloh10:
	ldr	x9, [x9, _OCTEON_MBOX_STATE_REQUEST_RECEIVED@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
Lloh11:
	adrp	x9, _OCTEON_MBOX_STATE_RESPONSE_RECEIVING@GOTPAGE
Lloh12:
	ldr	x9, [x9, _OCTEON_MBOX_STATE_RESPONSE_RECEIVING@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.11:
	ldr	w10, [x20, #24]
	ldr	w11, [x20, #40]
	cmp	w10, w11
	b.lt	LBB0_18
; %bb.12:
	bic	w8, w8, w9
	str	w8, [x20]
Lloh14:
	adrp	x9, _OCTEON_MBOX_STATE_RESPONSE_RECEIVED@GOTPAGE
Lloh15:
	ldr	x9, [x9, _OCTEON_MBOX_STATE_RESPONSE_RECEIVED@GOTPAGEOFF]
LBB0_13:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x20]
	mov	w21, #1
	b	LBB0_19
LBB0_14:
Lloh16:
	adrp	x11, _OCTEON_MBOX_STATE_IDLE@GOTPAGE
Lloh17:
	ldr	x11, [x11, _OCTEON_MBOX_STATE_IDLE@GOTPAGEOFF]
Lloh18:
	ldr	w11, [x11]
	and	w12, w11, w8
Lloh19:
	adrp	x13, _OCTEON_MBOX_REQUEST@GOTPAGE
Lloh20:
	ldr	x13, [x13, _OCTEON_MBOX_REQUEST@GOTPAGEOFF]
Lloh21:
	ldr	x13, [x13]
	cmp	w12, #0
	ccmp	x0, x13, #0, ne
	b.eq	LBB0_21
; %bb.15:
Lloh22:
	adrp	x11, _OCTEON_MBOX_STATE_RESPONSE_PENDING@GOTPAGE
Lloh23:
	ldr	x11, [x11, _OCTEON_MBOX_STATE_RESPONSE_PENDING@GOTPAGEOFF]
Lloh24:
	ldr	w11, [x11]
	and	w12, w11, w8
Lloh25:
	adrp	x13, _OCTEON_MBOX_RESPONSE@GOTPAGE
Lloh26:
	ldr	x13, [x13, _OCTEON_MBOX_RESPONSE@GOTPAGEOFF]
Lloh27:
	ldr	x13, [x13]
	cmp	w12, #0
	ccmp	x0, x13, #0, ne
	b.eq	LBB0_22
; %bb.16:
Lloh28:
	adrp	x8, _OCTEON_PFVFERR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _OCTEON_PFVFERR@GOTPAGEOFF]
Lloh30:
	ldr	x0, [x8]
	ldr	w1, [x20, #8]
	bl	_writeq
Lloh31:
	adrp	x8, _OCTEON_MBOX_STATE_ERROR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _OCTEON_MBOX_STATE_ERROR@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	mov	w21, #1
	b	LBB0_20
LBB0_17:
	mov	w0, #1
	bl	_WARN_ON
LBB0_18:
	mov	w21, #0
LBB0_19:
	ldr	x0, [x22]
	ldr	w1, [x20, #8]
	bl	_writeq
LBB0_20:
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x21
	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_21:
	bic	w8, w8, w11
	str	w8, [x20]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x20]
	str	x0, [x20, #72]
	ldr	w10, [x20, #96]
	str	w10, [x20, #88]
	mov	w10, #1
	str	w10, [x20, #64]
	b	LBB0_7
LBB0_22:
	bic	w8, w8, w11
	str	w8, [x20]
	ldr	w10, [x10]
	orr	w8, w10, w8
	str	w8, [x20]
	str	x0, [x20, #32]
	ldr	w10, [x20, #96]
	str	w10, [x20, #48]
	mov	w10, #1
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_OCTEON_PFVFACK,8,3             ; @OCTEON_PFVFACK
	.comm	_OCTEON_PFVFSIG,8,3             ; @OCTEON_PFVFSIG
	.comm	_OCTEON_MBOX_STATE_REQUEST_RECEIVING,4,2 ; @OCTEON_MBOX_STATE_REQUEST_RECEIVING
	.comm	_OCTEON_MBOX_STATE_RESPONSE_RECEIVING,4,2 ; @OCTEON_MBOX_STATE_RESPONSE_RECEIVING
	.comm	_OCTEON_MBOX_STATE_IDLE,4,2     ; @OCTEON_MBOX_STATE_IDLE
	.comm	_OCTEON_MBOX_REQUEST,8,3        ; @OCTEON_MBOX_REQUEST
	.comm	_OCTEON_MBOX_STATE_RESPONSE_PENDING,4,2 ; @OCTEON_MBOX_STATE_RESPONSE_PENDING
	.comm	_OCTEON_MBOX_RESPONSE,8,3       ; @OCTEON_MBOX_RESPONSE
	.comm	_OCTEON_PFVFERR,8,3             ; @OCTEON_PFVFERR
	.comm	_OCTEON_MBOX_STATE_ERROR,4,2    ; @OCTEON_MBOX_STATE_ERROR
	.comm	_OCTEON_MBOX_STATE_REQUEST_RECEIVED,4,2 ; @OCTEON_MBOX_STATE_REQUEST_RECEIVED
	.comm	_OCTEON_MBOX_STATE_RESPONSE_RECEIVED,4,2 ; @OCTEON_MBOX_STATE_RESPONSE_RECEIVED
.subsections_via_symbols
