	.file	"extr_builtin-sched.c_get_idle_thread.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	get_idle_thread, @function
get_idle_thread:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movsx	rbx, edi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	cmp	DWORD PTR idle_max_cpu[rip], ebx
	jle	.L2
	mov	rax, QWORD PTR idle_threads[rip]
	test	rax, rax
	je	.L2
	lea	rbp, [rax+rbx*8]
	mov	rax, QWORD PTR 0[rbp]
	test	rax, rax
	je	.L17
.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
.L2:
	.cfi_restore_state
	lea	edi, 1[rbx]
	call	__roundup_pow_of_two@PLT
	mov	rdi, QWORD PTR idle_threads[rip]
	lea	esi, 0[0+rax*8]
	mov	ebp, eax
	call	realloc@PLT
	test	rax, rax
	je	.L10
	mov	ecx, DWORD PTR idle_max_cpu[rip]
	mov	QWORD PTR idle_threads[rip], rax
	cmp	ebp, ecx
	jle	.L8
	movsx	rsi, ecx
	not	ecx
	add	ecx, ebp
	lea	rdx, [rax+rsi*8]
	add	rcx, rsi
	lea	rcx, 8[rax+rcx*8]
	.p2align 4,,10
	.p2align 3
.L7:
	mov	QWORD PTR [rdx], 0
	add	rdx, 8
	cmp	rdx, rcx
	jne	.L7
.L8:
	mov	DWORD PTR idle_max_cpu[rip], ebp
	lea	rbp, [rax+rbx*8]
	mov	rax, QWORD PTR 0[rbp]
	test	rax, rax
	jne	.L1
.L17:
	xor	esi, esi
	xor	edi, edi
	call	thread__new@PLT
	mov	QWORD PTR 0[rbp], rax
	mov	rax, QWORD PTR idle_threads[rip]
	mov	rax, QWORD PTR [rax+rbx*8]
	test	rax, rax
	je	.L1
	mov	rdi, rax
	call	init_idle_thread@PLT
	test	rax, rax
	js	.L10
	mov	rax, QWORD PTR idle_threads[rip]
	mov	rax, QWORD PTR [rax+rbx*8]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	get_idle_thread, .-get_idle_thread
	.comm	idle_threads,8,8
	.comm	idle_max_cpu,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_builtin-sched.c_get_idle_thread.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_idle_thread, %function
get_idle_thread:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r7, .L19
	mov	r5, r0
	ldr	r3, [r7]
	ldr	r8, .L19+4
	cmp	r3, r0
	ble	.L2
	ldr	r4, [r8]
	cmp	r4, #0
	beq	.L2
.L3:
	ldr	r0, [r4, r5, lsl #2]
	cmp	r0, #0
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r1, r0
	bl	thread__new
	ldr	r3, [r8]
	str	r0, [r4, r5, lsl #2]
	ldr	r0, [r3, r5, lsl #2]
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	bl	init_idle_thread
	cmp	r0, #0
	blt	.L10
	ldr	r3, [r8]
	ldr	r0, [r3, r5, lsl #2]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	add	r0, r5, #1
	bl	__roundup_pow_of_two
	lsl	r9, r0, #2
	mov	r6, r0
	mov	r1, r9
	ldr	r0, [r8]
	bl	realloc
	subs	r4, r0, #0
	beq	.L10
	ldr	r3, [r7]
	str	r4, [r8]
	cmp	r6, r3
	ble	.L8
	mov	r0, #0
	sub	r3, r3, #-1073741823
	sub	r2, r4, #4
	add	r3, r4, r3, lsl #2
	add	r1, r2, r9
.L7:
	str	r0, [r3, #4]!
	cmp	r1, r3
	bne	.L7
.L8:
	str	r6, [r7]
	b	.L3
.L10:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L20:
	.align	2
.L19:
	.word	idle_max_cpu
	.word	idle_threads
	.size	get_idle_thread, .-get_idle_thread
	.comm	idle_threads,4,4
	.comm	idle_max_cpu,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
