	.file	"extr_tws_services.c_tws_q_remove_tail.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	tws_q_remove_tail
	.type	tws_q_remove_tail, @function
tws_q_remove_tail:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	add	rdi, 16
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	esi, DWORD PTR MA_OWNED[rip]
	call	mtx_assert@PLT
	mov	rax, QWORD PTR [rbx]
	lea	rdx, [rax+rbp*8]
	mov	rax, QWORD PTR [rdx]
	test	rax, rax
	je	.L1
	cmp	QWORD PTR 8[rax], 0
	mov	rcx, QWORD PTR [rax]
	je	.L9
.L3:
	mov	QWORD PTR [rdx], rcx
	mov	rdx, QWORD PTR [rax]
	mov	QWORD PTR 8[rdx], 0
	mov	QWORD PTR 8[rax], 0
	mov	QWORD PTR [rax], 0
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	test	rcx, rcx
	jne	.L3
	mov	QWORD PTR [rdx], 0
	mov	rdx, QWORD PTR 8[rbx]
	mov	DWORD PTR [rdx+rbp*4], 0
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	tws_q_remove_tail, .-tws_q_remove_tail
	.comm	MA_OWNED,4,4
	.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_tws_services.c_tws_q_remove_tail.c"
	.text
	.align	2
	.global	tws_q_remove_tail
	.syntax unified
	.arm
	.fpu softvfp
	.type	tws_q_remove_tail, %function
tws_q_remove_tail:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	mov	r5, r1
	ldr	r3, .L10
	add	r0, r0, #8
	ldr	r1, [r3]
	bl	mtx_assert
	ldr	r2, [r4]
	ldr	r0, [r2, r5, lsl #2]
	cmp	r0, #0
	popeq	{r4, r5, r6, pc}
	ldm	r0, {r1, r3}
	cmp	r3, #0
	beq	.L9
.L3:
	mov	r3, #0
	str	r1, [r2, r5, lsl #2]
	ldr	r2, [r0]
	str	r3, [r2, #4]
	str	r3, [r0, #4]
	str	r3, [r0]
	pop	{r4, r5, r6, pc}
.L9:
	cmp	r1, #0
	bne	.L3
	ldr	r3, [r4, #4]
	str	r1, [r2, r5, lsl #2]
	str	r1, [r3, r5, lsl #2]
	pop	{r4, r5, r6, pc}
.L11:
	.align	2
.L10:
	.word	MA_OWNED
	.size	tws_q_remove_tail, .-tws_q_remove_tail
	.comm	MA_OWNED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
