	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_write
_do_write:                              ## @do_write
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movq	%rcx, %r12
	movl	%edx, %r13d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_getmbox
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_qels@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	%r14d, %ebx
	movslq	%eax, %r14
	leaq	(,%r14,8), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	movq	%r15, (%rdx,%rsi)
	movq	(%rcx), %rdx
	movl	%r13d, 8(%rdx,%rsi)
	movq	%r12, 16(%rdx,%rsi)
	movq	(%rcx), %rcx
	leaq	(%rcx,%rsi), %rdi
	movl	%ebx, 24(%rcx,%rsi)
	movl	$1, 28(%rcx,%rsi)
	movl	%eax, 32(%rcx,%rsi)
	callq	_enQ
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_idle
	movq	_mailbox@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %eax
	movq	_mboxinuse@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	$0, (%rcx,%r14,8)
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_printk
	movl	$-1, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_qels,8,3                       ## @qels
	.comm	_mailbox,8,3                    ## @mailbox
	.comm	_mboxinuse,8,3                  ## @mboxinuse
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ltpc: could not allocate mbox\n"

	.no_dead_strip	_do_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_write
_do_write:                              ; @do_write
	.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	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x20, x0
	bl	_getmbox
	cbz	w0, LBB0_2
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _qels@GOTPAGE
Lloh1:
	ldr	x8, [x8, _qels@GOTPAGEOFF]
	ldr	x9, [x8]
	sxtw	x10, w19
	sbfiz	x25, x19, #2, #32
	add	x10, x25, x10
	lsl	x10, x10, #3
	str	x24, [x9, x10]
	ldr	x9, [x8]
	add	x9, x9, x10
	str	w23, [x9, #8]
	str	x22, [x9, #16]
	ldr	x8, [x8]
	add	x0, x8, x10
	mov	w8, #1
	stp	w21, w8, [x0, #24]
	str	w19, [x0, #32]
	bl	_enQ
	mov	x0, x20
	bl	_idle
Lloh2:
	adrp	x8, _mailbox@GOTPAGE
Lloh3:
	ldr	x8, [x8, _mailbox@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	w0, [x8, x25]
Lloh5:
	adrp	x8, _mboxinuse@GOTPAGE
Lloh6:
	ldr	x8, [x8, _mboxinuse@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	xzr, [x8, w19, sxtw #3]
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	mov	w0, #-1
LBB0_3:
	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 AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_qels,8,3                       ; @qels
	.comm	_mailbox,8,3                    ; @mailbox
	.comm	_mboxinuse,8,3                  ; @mboxinuse
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ltpc: could not allocate mbox\n"

	.no_dead_strip	_do_write
.subsections_via_symbols
