	.file	"extr_ipc_mqueue.c_ipc_mqueue_destroy_locked.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ipc_mqueue_destroy_locked
	.type	ipc_mqueue_destroy_locked, @function
ipc_mqueue_destroy_locked:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, QWORD PTR FALSE[rip]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	call	ip_from_mq@PLT
	mov	edi, eax
	call	port_send_turnstile@PLT
	mov	rdi, rbx
	mov	rbp, rax
	call	imq_is_set@PLT
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	assert@PLT
	mov	rax, QWORD PTR FALSE[rip]
	cmp	QWORD PTR TURNSTILE_NULL[rip], rbp
	mov	QWORD PTR 40[rbx], rax
	je	.L2
	mov	ecx, DWORD PTR WAITQ_ALL_PRIORITIES[rip]
	mov	edx, DWORD PTR THREAD_RESTART[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR IPC_MQUEUE_FULL[rip]
	call	waitq_wakeup64_all@PLT
.L2:
	lea	rbp, 36[rbx]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	call	ipc_kmsg_delayed_destroy@PLT
	test	rax, rax
	cmovne	r12, rax
.L3:
	mov	rdi, rbp
	call	ipc_kmsg_dequeue@PLT
	cmp	QWORD PTR IKM_NULL[rip], rax
	mov	rdi, rax
	jne	.L5
	mov	QWORD PTR 24[rbx], 0
	lea	rbp, 16[rbx]
	mov	rdi, rbp
	call	waitq_invalidate_locked@PLT
	mov	rdi, rbp
	call	waitq_clear_prepost_locked@PLT
	xor	edi, edi
	cmp	QWORD PTR [rbx], 0
	sete	dil
	call	assert@PLT
	xor	edi, edi
	cmp	QWORD PTR 8[rbx], 0
	sete	dil
	call	assert@PLT
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ipc_mqueue_destroy_locked, .-ipc_mqueue_destroy_locked
	.comm	WAITQ_ALL_PRIORITIES,4,4
	.comm	TURNSTILE_NULL,8,8
	.comm	TRUE,4,4
	.comm	THREAD_RESTART,4,4
	.comm	IPC_MQUEUE_FULL,4,4
	.comm	IKM_NULL,8,8
	.comm	FALSE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ipc_mqueue.c_ipc_mqueue_destroy_locked.c"
	.text
	.align	2
	.global	ipc_mqueue_destroy_locked
	.syntax unified
	.arm
	.fpu softvfp
	.type	ipc_mqueue_destroy_locked, %function
ipc_mqueue_destroy_locked:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r6, .L10
	mov	r7, r0
	ldr	r4, [r6]
	bl	ip_from_mq
	bl	port_send_turnstile
	mov	r5, r0
	mov	r0, r7
	bl	imq_is_set
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r3, .L10+4
	ldr	r2, [r6]
	ldr	r3, [r3]
	str	r2, [r7, #24]
	cmp	r3, r5
	beq	.L2
	ldr	r3, .L10+8
	ldr	r2, .L10+12
	ldr	r1, .L10+16
	mov	r0, r5
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	waitq_wakeup64_all
.L2:
	ldr	r5, .L10+20
	add	r6, r7, #20
	b	.L3
.L5:
	bl	ipc_kmsg_delayed_destroy
	cmp	r0, #0
	movne	r4, r0
.L3:
	mov	r0, r6
	bl	ipc_kmsg_dequeue
	ldr	r3, [r5]
	cmp	r3, r0
	bne	.L5
	mov	r3, #0
	add	r5, r7, #8
	str	r3, [r7, #12]
	mov	r0, r5
	bl	waitq_invalidate_locked
	mov	r0, r5
	bl	waitq_clear_prepost_locked
	ldr	r0, [r7]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r0, [r7, #4]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L11:
	.align	2
.L10:
	.word	FALSE
	.word	TURNSTILE_NULL
	.word	WAITQ_ALL_PRIORITIES
	.word	THREAD_RESTART
	.word	IPC_MQUEUE_FULL
	.word	IKM_NULL
	.size	ipc_mqueue_destroy_locked, .-ipc_mqueue_destroy_locked
	.comm	WAITQ_ALL_PRIORITIES,4,4
	.comm	TURNSTILE_NULL,4,4
	.comm	TRUE,4,4
	.comm	THREAD_RESTART,4,4
	.comm	IPC_MQUEUE_FULL,4,4
	.comm	IKM_NULL,4,4
	.comm	FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
