	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qm_mb
_qm_mb:                                 ## @qm_mb
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movl	%ecx, %r15d
	movq	%rdx, %r13
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	8(%rdi), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ecx, %edx
	movl	%ebx, %ecx
	movq	%r13, %r8
	callq	_dev_dbg
	movq	_QM_MB_OP_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	testl	%r12d, %r12d
	cmovel	%r12d, %eax
	orl	%ebx, %eax
	movq	_QM_MB_BUSY_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	btsl	%ecx, %eax
	movl	%eax, -72(%rbp)
	movl	%r15d, -48(%rbp)
	movq	%r13, %rdi
	callq	_lower_32_bits
	movl	%eax, -52(%rbp)
	movq	%r13, %rdi
	callq	_upper_32_bits
	movl	%eax, -56(%rbp)
	movq	$0, -64(%rbp)
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_qm_wait_mb_ready
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_2:
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_qm_mb_write
	movq	%r14, %rdi
	callq	_qm_wait_mb_ready
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	8(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
LBB0_5:
	callq	_dev_err
LBB0_6:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QM mailbox request to q%u: %u-%llx\n"

	.comm	_QM_MB_OP_SHIFT,4,2             ## @QM_MB_OP_SHIFT
	.comm	_QM_MB_BUSY_SHIFT,4,2           ## @QM_MB_BUSY_SHIFT
	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.1:                               ## @.str.1
	.asciz	"QM mailbox is busy to start!\n"

L_.str.2:                               ## @.str.2
	.asciz	"QM mailbox operation timeout!\n"

	.no_dead_strip	_qm_mb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qm_mb
_qm_mb:                                 ; @qm_mb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x0, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x3
	mov	x3, x23
	mov	x4, x22
	bl	_dev_dbg
Lloh2:
	adrp	x8, _QM_MB_OP_SHIFT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QM_MB_OP_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
	cmp	w20, #0
	csel	w8, wzr, w8, eq
Lloh5:
	adrp	x10, _QM_MB_BUSY_SHIFT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _QM_MB_BUSY_SHIFT@GOTPAGEOFF]
	orr	w8, w8, w23
Lloh7:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w8, w9
	str	w8, [sp]
	str	w21, [sp, #24]
	mov	x0, x22
	bl	_lower_32_bits
	str	w0, [sp, #20]
	mov	x0, x22
	bl	_upper_32_bits
	str	w0, [sp, #16]
	str	xzr, [sp, #8]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	bl	_qm_wait_mb_ready
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	x0, [x19, #8]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_2:
	mov	x1, sp
	mov	x0, x19
	bl	_qm_mb_write
	mov	x0, x19
	bl	_qm_wait_mb_ready
	bl	_unlikely
	cbz	x0, LBB0_6
; %bb.3:
Lloh13:
	adrp	x8, _EBUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	x0, [x19, #8]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_4:
	bl	_dev_err
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	mov	w20, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QM mailbox request to q%u: %u-%llx\n"

	.comm	_QM_MB_OP_SHIFT,4,2             ; @QM_MB_OP_SHIFT
	.comm	_QM_MB_BUSY_SHIFT,4,2           ; @QM_MB_BUSY_SHIFT
	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.1:                               ; @.str.1
	.asciz	"QM mailbox is busy to start!\n"

l_.str.2:                               ; @.str.2
	.asciz	"QM mailbox operation timeout!\n"

	.no_dead_strip	_qm_mb
.subsections_via_symbols
