	.file	"extr_priority.c_sched_thread_mode_undemote.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	sched_thread_mode_undemote
	.type	sched_thread_mode_undemote, @function
sched_thread_mode_undemote:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edi, DWORD PTR TH_SFLAG_DEMOTED_MASK[rip]
	and	edi, esi
	call	assert@PLT
	mov	eax, DWORD PTR 0[rbp]
	xor	edi, edi
	and	eax, ebx
	cmp	eax, ebx
	not	ebx
	sete	dil
	call	assert@PLT
	mov	rax, QWORD PTR TH_MODE_NONE[rip]
	xor	edi, edi
	cmp	QWORD PTR 8[rbp], rax
	setne	dil
	call	assert@PLT
	mov	rax, QWORD PTR TH_MODE_TIMESHARE[rip]
	xor	edi, edi
	cmp	QWORD PTR 16[rbp], rax
	sete	dil
	call	assert@PLT
	xor	edi, edi
	cmp	QWORD PTR 24[rbp], 0
	sete	dil
	call	assert@PLT
	and	ebx, DWORD PTR 0[rbp]
	mov	DWORD PTR 0[rbp], ebx
	test	DWORD PTR TH_SFLAG_DEMOTED_MASK[rip], ebx
	je	.L10
.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
.L10:
	.cfi_restore_state
	mov	rdi, rbp
	call	thread_run_queue_remove@PLT
	mov	rsi, QWORD PTR 8[rbp]
	mov	rdi, rbp
	mov	rbx, rax
	call	sched_set_thread_mode@PLT
	mov	rax, QWORD PTR TH_MODE_NONE[rip]
	mov	rdi, rbp
	mov	QWORD PTR 8[rbp], rax
	call	thread_recompute_priority@PLT
	test	rbx, rbx
	je	.L1
	mov	esi, DWORD PTR SCHED_TAILQ[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	thread_run_queue_reinsert@PLT
	.cfi_endproc
.LFE0:
	.size	sched_thread_mode_undemote, .-sched_thread_mode_undemote
	.comm	TH_SFLAG_DEMOTED_MASK,4,4
	.comm	TH_MODE_TIMESHARE,8,8
	.comm	TH_MODE_NONE,8,8
	.comm	SCHED_TAILQ,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_priority.c_sched_thread_mode_undemote.c"
	.text
	.align	2
	.global	sched_thread_mode_undemote
	.syntax unified
	.arm
	.fpu softvfp
	.type	sched_thread_mode_undemote, %function
sched_thread_mode_undemote:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	mov	r5, r1
	ldr	r6, .L10
	ldr	r7, .L10+4
	ldr	r0, [r6]
	and	r0, r0, r1
	bl	assert
	ldr	r3, [r4]
	bics	r3, r5, r3
	moveq	r0, #1
	movne	r0, #0
	bl	assert
	ldr	r3, [r7]
	ldr	r0, [r4, #4]
	subs	r0, r0, r3
	movne	r0, #1
	bl	assert
	ldr	r3, .L10+8
	ldr	r0, [r4, #8]
	ldr	r3, [r3]
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r0, [r4, #12]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r1, [r4]
	ldr	r3, [r6]
	bic	r5, r1, r5
	tst	r5, r3
	str	r5, [r4]
	popne	{r4, r5, r6, r7, r8, pc}
	mov	r0, r4
	bl	thread_run_queue_remove
	mov	r5, r0
	ldr	r1, [r4, #4]
	mov	r0, r4
	bl	sched_set_thread_mode
	ldr	r3, [r7]
	mov	r0, r4
	str	r3, [r4, #4]
	bl	thread_recompute_priority
	cmp	r5, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r3, .L10+12
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	ldr	r1, [r3]
	b	thread_run_queue_reinsert
.L11:
	.align	2
.L10:
	.word	TH_SFLAG_DEMOTED_MASK
	.word	TH_MODE_NONE
	.word	TH_MODE_TIMESHARE
	.word	SCHED_TAILQ
	.size	sched_thread_mode_undemote, .-sched_thread_mode_undemote
	.comm	TH_SFLAG_DEMOTED_MASK,4,4
	.comm	TH_MODE_TIMESHARE,4,4
	.comm	TH_MODE_NONE,4,4
	.comm	SCHED_TAILQ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
