	.file	"extr_waitq.c_waitq_prepost_reserve.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Attempting to reserve prepost linkages for waitq %p (extra:%d)"
	.text
	.p2align 4
	.globl	waitq_prepost_reserve
	.type	waitq_prepost_reserve, @function
waitq_prepost_reserve:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, esi
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	QWORD PTR 16[rsp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR WAITQ_KEEP_LOCKED[rip]
	mov	QWORD PTR 48[rsp], 0
	mov	DWORD PTR 44[rsp], 0
	cmp	rax, rdx
	mov	QWORD PTR 24[rsp], rax
	sete	r12b
	call	VM_KERNEL_UNSLIDE_OR_PERM@PLT
	mov	edx, ebx
	lea	rdi, .LC0[rip]
	mov	rsi, rax
	call	wqdbg_v@PLT
	test	r13, r13
	jne	.L2
	test	ebx, ebx
	jg	.L38
.L2:
	mov	rax, QWORD PTR 16[rsp]
	cmp	QWORD PTR WAITQ_KEEP_LOCKED[rip], rax
	mov	edi, 1
	je	.L4
	xor	edi, edi
	cmp	QWORD PTR WAITQ_UNLOCK[rip], rax
	sete	dil
.L4:
	call	assert@PLT
	mov	rdi, r13
	call	waitq_irq_safe@PLT
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	assert@PLT
	mov	rdi, r13
	call	waitq_lock@PLT
	mov	rbp, QWORD PTR 0[r13]
	test	rbp, rbp
	jne	.L5
	test	r12b, r12b
	je	.L5
.L6:
	mov	rdx, QWORD PTR 48[rsp]
	xor	eax, eax
	test	rdx, rdx
	je	.L1
	mov	rax, QWORD PTR [rdx]
.L1:
	mov	rbx, QWORD PTR 56[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L39
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	add	ebx, 2
	lea	rcx, 48[rsp]
	lea	rdx, 44[rsp]
	xor	esi, esi
	mov	edi, ebx
	call	waitq_alloc_prepost_reservation@PLT
	xor	edi, edi
	cmp	ebx, eax
	sete	dil
	call	assert@PLT
	mov	rax, QWORD PTR 48[rsp]
	mov	rax, QWORD PTR [rax]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, QWORD PTR 8[r13]
	movzx	r12d, r12b
	mov	rdi, r13
	mov	esi, ebx
	mov	edx, r12d
	mov	QWORD PTR [rsp], rax
	call	waitq_count_prepost_reservation@PLT
	mov	edi, eax
	test	eax, eax
	je	.L34
	lea	rax, 44[rsp]
	lea	r15, 48[rsp]
	mov	QWORD PTR 8[rsp], rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rax, QWORD PTR 0[r13]
	test	rax, rax
	je	.L13
	cmp	rax, rbp
	jne	.L12
	mov	rax, QWORD PTR [rsp]
	cmp	QWORD PTR 8[r13], rax
	je	.L13
.L12:
	mov	edx, r12d
	mov	esi, ebx
	mov	rdi, r13
	call	waitq_count_prepost_reservation@PLT
	cmp	r14d, eax
	jge	.L13
	mov	rcx, QWORD PTR 8[r13]
	sub	eax, r14d
	mov	rbp, QWORD PTR 0[r13]
	mov	edi, eax
	mov	QWORD PTR [rsp], rcx
.L7:
	mov	rdx, QWORD PTR 8[rsp]
	mov	rcx, r15
	mov	rsi, r13
	call	waitq_alloc_prepost_reservation@PLT
	mov	r14d, eax
	mov	eax, DWORD PTR 44[rsp]
	test	eax, eax
	jne	.L9
.L34:
	mov	rcx, QWORD PTR 16[rsp]
	cmp	QWORD PTR 24[rsp], rcx
	je	.L6
.L10:
	mov	rdi, r13
	call	waitq_unlock@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rbx, QWORD PTR 16[rsp]
	cmp	QWORD PTR 24[rsp], rbx
	jne	.L10
	jmp	.L6
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	waitq_prepost_reserve, .-waitq_prepost_reserve
	.comm	WAITQ_UNLOCK,8,8
	.comm	WAITQ_KEEP_LOCKED,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_waitq.c_waitq_prepost_reserve.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Attempting to reserve prepost linkages for waitq %p"
	.ascii	" (extra:%d)\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	waitq_prepost_reserve
	.syntax unified
	.arm
	.fpu softvfp
	.type	waitq_prepost_reserve, %function
waitq_prepost_reserve:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, #0
	ldr	r3, .L28
	ldr	r10, .L28+4
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	mov	r5, r1
	mov	r6, r2
	mov	r4, r0
	ldr	r9, [r10]
	str	r7, [sp, #4]
	str	r7, [sp, #8]
	bl	VM_KERNEL_UNSLIDE_OR_PERM
	mov	r2, r5
	mov	r1, r0
	ldr	r0, .L28+8
	bl	wqdbg_v
	cmp	r5, r7
	movle	r3, #0
	movgt	r3, #1
	cmp	r4, r7
	movne	r3, r7
	sub	r8, r9, r6
	clz	r8, r8
	cmp	r3, r7
	lsr	r8, r8, #5
	bne	.L25
	ldr	r3, [r10]
	cmp	r3, r6
	ldrne	r3, .L28+12
	moveq	r0, #1
	ldrne	r0, [r3]
	subne	r0, r0, r6
	clzne	r0, r0
	lsrne	r0, r0, #5
	bl	assert
	mov	r0, r4
	bl	waitq_irq_safe
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	mov	r0, r4
	bl	waitq_lock
	ldr	r7, [r4]
	cmp	r7, #0
	moveq	r3, r8
	movne	r3, #0
	cmp	r3, #0
	beq	.L26
.L6:
	ldr	r0, [sp, #4]
	cmp	r0, #0
	ldrne	r0, [r0]
.L1:
	ldr	r3, .L28
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L27
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L26:
	mov	r2, r8
	mov	r1, r5
	mov	r0, r4
	ldr	r10, [r4, #4]
	bl	waitq_count_prepost_reservation
	cmp	r0, #0
	bne	.L7
.L23:
	cmp	r9, r6
	beq	.L6
	mov	r0, r4
	bl	waitq_unlock
	b	.L6
.L9:
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L23
	cmp	r3, r7
	bne	.L12
	ldr	r3, [r4, #4]
	cmp	r3, r10
	beq	.L23
.L12:
	mov	r2, r8
	mov	r1, r5
	mov	r0, r4
	bl	waitq_count_prepost_reservation
	cmp	fp, r0
	bge	.L23
	ldm	r4, {r7, r10}
	sub	r0, r0, fp
.L7:
	add	r3, sp, #4
	mov	r1, r4
	add	r2, sp, #8
	bl	waitq_alloc_prepost_reservation
	ldr	r3, [sp, #8]
	mov	fp, r0
	cmp	r3, #0
	bne	.L9
	b	.L23
.L25:
	add	r5, r5, #2
	add	r3, sp, #4
	mov	r1, r7
	add	r2, sp, #8
	mov	r0, r5
	bl	waitq_alloc_prepost_reservation
	sub	r0, r5, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r3, [sp, #4]
	ldr	r0, [r3]
	b	.L1
.L27:
	bl	__stack_chk_fail
.L29:
	.align	2
.L28:
	.word	.LC1
	.word	WAITQ_KEEP_LOCKED
	.word	.LC0
	.word	WAITQ_UNLOCK
	.size	waitq_prepost_reserve, .-waitq_prepost_reserve
	.comm	WAITQ_UNLOCK,4,4
	.comm	WAITQ_KEEP_LOCKED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
