	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msg_queue_pop
_msg_queue_pop:                         ## @msg_queue_pop
	.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	%rcx, %r13
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	(%rdi), %rdi
	movq	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	16(%rsi), %esi
	callq	_nvkm_falcon_rd32
	movq	%rax, %r14
	movq	(%rbx), %r15
	cmpq	%r15, %rax
	jge	LBB0_2
## %bb.1:
	movq	8(%rbx), %r15
	movq	%r15, (%rbx)
LBB0_2:
	subq	%r15, %r14
	je	LBB0_3
## %bb.4:
	cmpq	%r13, %r14
	jge	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_nvkm_warn
	movq	%r14, %r13
LBB0_6:
	movq	(%r12), %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_nvkm_falcon_read_dmem
	movq	_QUEUE_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_ALIGN
	addq	%rax, (%rbx)
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_nvkm_warn
	xorl	%r13d, %r13d
LBB0_7:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no message data available\n"

L_.str.1:                               ## @.str.1
	.asciz	"message data smaller than read request\n"

	.comm	_QUEUE_ALIGNMENT,4,2            ## @QUEUE_ALIGNMENT
	.no_dead_strip	_msg_queue_pop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msg_queue_pop
_msg_queue_pop:                         ; @msg_queue_pop
	.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	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	ldr	x0, [x0]
	ldr	x23, [x0]
	ldr	w1, [x1, #16]
	bl	_nvkm_falcon_rd32
	ldr	x24, [x20]
	cmp	x0, x24
	b.ge	LBB0_2
; %bb.1:
	ldr	x24, [x20, #8]
	str	x24, [x20]
LBB0_2:
	subs	x25, x0, x24
	b.eq	LBB0_6
; %bb.3:
	cmp	x25, x19
	b.ge	LBB0_5
; %bb.4:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_nvkm_warn
	mov	x19, x25
LBB0_5:
	ldr	x0, [x22]
	mov	x1, x24
	mov	x2, x19
	mov	w3, #0
	mov	x4, x21
	bl	_nvkm_falcon_read_dmem
Lloh2:
	adrp	x8, _QUEUE_ALIGNMENT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QUEUE_ALIGNMENT@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ALIGN
	ldr	x8, [x20]
	add	x8, x8, x0
	str	x8, [x20]
	b	LBB0_7
LBB0_6:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_nvkm_warn
	mov	w19, #0
LBB0_7:
	mov	x0, x19
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no message data available\n"

l_.str.1:                               ; @.str.1
	.asciz	"message data smaller than read request\n"

	.comm	_QUEUE_ALIGNMENT,4,2            ; @QUEUE_ALIGNMENT
	.no_dead_strip	_msg_queue_pop
.subsections_via_symbols
