	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msgqueue_msg_handle
_msgqueue_msg_handle:                   ## @msgqueue_msg_handle
	.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
	movq	(%rdi), %r12
	movq	(%rsi), %rbx
	shlq	$5, %rbx
	movq	(%r12,%rbx), %rax
	movq	_SEQ_STATE_USED@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	je	LBB0_3
## %bb.1:
	movq	_SEQ_STATE_CANCELLED@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_3
## %bb.2:
	movq	8(%r15), %rax
	movq	(%rax), %rdi
	movl	24(%r12,%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_nvkm_error
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_3:
	cmpq	%rcx, %rax
	jne	LBB0_6
## %bb.4:
	movq	16(%r12,%rbx), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	*%rax
LBB0_6:
	leaq	(%r12,%rbx), %r14
	movq	8(%r12,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	callq	_complete
LBB0_8:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_msgqueue_seq_release
	xorl	%eax, %eax
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SEQ_STATE_USED,8,3             ## @SEQ_STATE_USED
	.comm	_SEQ_STATE_CANCELLED,8,3        ## @SEQ_STATE_CANCELLED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"msg for unknown sequence %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_msgqueue_msg_handle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msgqueue_msg_handle
_msgqueue_msg_handle:                   ; @msgqueue_msg_handle
	.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	x19, x0
	ldr	x21, [x0]
	ldr	x22, [x1]
	add	x20, x21, x22, lsl #5
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _SEQ_STATE_USED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SEQ_STATE_USED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _SEQ_STATE_CANCELLED@GOTPAGE
Lloh4:
	ldr	x10, [x10, _SEQ_STATE_CANCELLED@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_7
; %bb.1:
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	add	x8, x21, x22, lsl #5
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	blr	x8
LBB0_4:
	add	x8, x21, x22, lsl #5
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_complete
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_msgqueue_seq_release
	mov	w0, #0
	b	LBB0_8
LBB0_7:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
	ldr	w2, [x20, #24]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_nvkm_error
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SEQ_STATE_USED,8,3             ; @SEQ_STATE_USED
	.comm	_SEQ_STATE_CANCELLED,8,3        ; @SEQ_STATE_CANCELLED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"msg for unknown sequence %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_msgqueue_msg_handle
.subsections_via_symbols
