	.file	"extr_linux_idr.c_idr_get_new_locked.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"idr_get_new: Invalid leaf state (%p, %p)\n"
	.text
	.p2align 4
	.type	idr_get_new_locked, @function
idr_get_new_locked:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rdi
	push	r12
	push	rbx
	sub	rsp, 72
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	QWORD PTR -104[rbp], rdx
	mov	QWORD PTR -96[rbp], rsi
	mov	rbx, rsp
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAX_LEVEL[rip]
	lea	rax, 15[0+rax*8]
	mov	rdx, rax
	and	rax, -4096
	sub	rbx, rax
	and	rdx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L3
.L34:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L34
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L35
.L4:
	mov	esi, DWORD PTR MA_OWNED[rip]
	lea	rdi, 16[r13]
	mov	QWORD PTR -80[rbp], rsp
	call	mtx_assert@PLT
	mov	eax, DWORD PTR EAGAIN[rip]
	mov	r15, QWORD PTR 8[r13]
	neg	eax
	mov	DWORD PTR -108[rbp], eax
	test	r15, r15
	je	.L36
	mov	r8d, DWORD PTR 0[r13]
	mov	rdi, QWORD PTR [r15]
	lea	r14d, -1[r8]
	test	rdi, rdi
	jne	.L7
.L6:
	mov	eax, DWORD PTR MAX_LEVEL[rip]
	mov	r14d, DWORD PTR ENOSPC[rip]
	add	eax, 1
	neg	r14d
	cmp	eax, r8d
	je	.L1
	mov	rdi, r13
	call	idr_get@PLT
	mov	r15, rax
	test	rax, rax
	je	.L20
	mov	rax, QWORD PTR 8[r13]
	mov	rcx, QWORD PTR 8[r15]
	mov	rdi, QWORD PTR [r15]
	mov	QWORD PTR [rcx], rax
	test	rax, rax
	je	.L10
	and	rdi, -2
	mov	QWORD PTR [r15], rdi
.L10:
	mov	r14d, DWORD PTR 0[r13]
	mov	QWORD PTR 8[r13], r15
	lea	eax, 1[r14]
	mov	DWORD PTR 0[r13], eax
.L7:
	mov	rbx, QWORD PTR -80[rbp]
	movsx	rax, r14d
	xor	r12d, r12d
	lea	rbx, [rbx+rax*8]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	lea	eax, -1[rcx]
	mov	ecx, DWORD PTR IDR_BITS[rip]
	mov	rsi, QWORD PTR 8[r15]
	mov	edx, eax
	imul	ecx, r14d
	sal	edx, cl
	movsx	rcx, eax
	or	r12d, edx
	lea	rsi, [rsi+rcx*8]
	test	r14d, r14d
	je	.L12
	mov	rax, QWORD PTR [rsi]
	test	rax, rax
	je	.L37
.L13:
	mov	rdi, QWORD PTR [rax]
	sub	r14d, 1
	sub	rbx, 8
	mov	r15, rax
.L14:
	mov	QWORD PTR [rbx], r15
	call	ffsl@PLT
	mov	ecx, eax
	test	eax, eax
	jne	.L11
	mov	DWORD PTR -72[rbp], eax
	mov	rdx, r15
	mov	rsi, r13
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	panic@PLT
	mov	ecx, DWORD PTR -72[rbp]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L37:
	mov	rdi, r13
	mov	QWORD PTR -88[rbp], rcx
	mov	QWORD PTR -72[rbp], rsi
	call	idr_get@PLT
	mov	rsi, QWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -88[rbp]
	mov	QWORD PTR [rsi], rax
	mov	rax, QWORD PTR 8[r15]
	mov	rax, QWORD PTR [rax+rcx*8]
	test	rax, rax
	jne	.L13
.L20:
	mov	r14d, DWORD PTR -108[rbp]
.L9:
	endbr64
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L38
	lea	rsp, -40[rbp]
	mov	eax, r14d
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	ecx, eax
	mov	edi, -2
	mov	rbx, QWORD PTR -96[rbp]
	rol	edi, cl
	movsx	rax, edi
	and	QWORD PTR [r15], rax
	mov	r15d, 1
	mov	QWORD PTR [rsi], rbx
	mov	rbx, QWORD PTR -104[rbp]
	mov	DWORD PTR [rbx], r12d
	je	.L15
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rax, QWORD PTR -80[rbp]
	mov	esi, r15d
	mov	edi, r12d
	mov	rbx, QWORD PTR [rax+r15*8]
	add	r15, 1
	call	idr_pos@PLT
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	not	eax
	cdqe
	and	rax, QWORD PTR [rbx]
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	jne	.L1
.L15:
	cmp	DWORD PTR 0[r13], r15d
	jg	.L17
	jmp	.L1
.L36:
	mov	r8d, DWORD PTR 0[r13]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L35:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	idr_get_new_locked, .-idr_get_new_locked
	.comm	MA_OWNED,4,4
	.comm	MAX_LEVEL,4,4
	.comm	IDR_BITS,4,4
	.comm	ENOSPC,4,4
	.comm	EAGAIN,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_linux_idr.c_idr_get_new_locked.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"idr_get_new: Invalid leaf state (%p, %p)\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	idr_get_new_locked, %function
idr_get_new_locked:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	mov	ip, r1
	mov	r8, r0
	ldr	r4, .L30
	ldr	r1, .L30+4
	ldr	r3, [r4]
	str	ip, [fp, #-56]
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L30+8
	str	r2, [fp, #-60]
	ldr	r1, [r1]
	add	r0, r0, #8
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	mtx_assert
	ldr	r3, .L30+12
	ldr	r9, [r8, #4]
	ldr	r3, [r3]
	cmp	r9, #0
	rsb	r3, r3, #0
	ldreq	r7, [r8]
	str	sp, [fp, #-52]
	str	r3, [fp, #-64]
	beq	.L3
	ldr	r1, [r9]
	ldr	r7, [r8]
	cmp	r1, #0
	subne	r5, r7, #1
	beq	.L3
.L4:
	ldr	r3, [fp, #-52]
	mov	r6, #0
	add	r7, r3, r7, lsl #2
	ldr	r10, .L30+16
	mov	r3, r1
	b	.L11
.L8:
	ldr	r2, [r10]
	ldr	r3, [r9, #4]
	mul	r2, r5, r2
	sub	r4, r4, #1
	cmp	r5, #0
	orr	r6, r6, r4, lsl r2
	add	r0, r3, r4, lsl #2
	beq	.L9
	ldr	r2, [r3, r4, lsl #2]
	cmp	r2, #0
	beq	.L27
.L10:
	mov	r9, r2
	ldr	r3, [r2]
	sub	r5, r5, #1
.L11:
	rsb	r2, r3, #0
	and	r3, r3, r2
	clz	r3, r3
	rsbs	r4, r3, #32
	str	r9, [r7, #-4]!
	bne	.L8
	mov	r2, r9
	mov	r1, r8
	ldr	r0, .L30+20
	bl	panic
	b	.L8
.L3:
	ldr	r3, [r4]
	add	r3, r3, #1
	cmp	r3, r7
	beq	.L28
	mov	r0, r8
	bl	idr_get
	subs	r9, r0, #0
	beq	.L17
	ldr	r3, [r8, #4]
	ldr	r1, [r9, #4]
	ldr	r5, [r8]
	str	r3, [r1]
	ldr	r1, [r9]
	cmp	r3, #0
	bicne	r1, r1, #1
	add	r7, r5, #1
	strne	r1, [r9]
	str	r9, [r8, #4]
	str	r7, [r8]
	b	.L4
.L27:
	mov	r0, r8
	str	r3, [fp, #-48]
	bl	idr_get
	ldr	r3, [fp, #-48]
	ldr	r2, [r9, #4]
	str	r0, [r3, r4, lsl #2]
	ldr	r2, [r2, r4, lsl #2]
	cmp	r2, #0
	bne	.L10
.L17:
	ldr	r5, [fp, #-64]
.L6:
.L1:
	ldr	r3, .L30+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L29
	mov	r0, r5
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	mov	r7, #1
	ldr	r1, [r9]
	ldr	r3, [fp, #-56]
	bic	r4, r1, r7, lsl r4
	str	r4, [r9]
	str	r3, [r0]
	ldr	r3, [fp, #-60]
	cmp	r4, #0
	str	r6, [r3]
	bne	.L1
	ldr	r9, [fp, #-52]
	b	.L13
.L14:
	mov	r1, r4
	mov	r0, r6
	ldr	r10, [r9, #4]!
	bl	idr_pos
	ldr	r3, [r10]
	bic	r0, r3, r7, lsl r0
	cmp	r0, #0
	str	r0, [r10]
	bne	.L1
.L13:
	ldr	r3, [r8]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L14
	b	.L1
.L28:
	ldr	r3, .L30+24
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L29:
	bl	__stack_chk_fail
.L31:
	.align	2
.L30:
	.word	MAX_LEVEL
	.word	MA_OWNED
	.word	.LC1
	.word	EAGAIN
	.word	IDR_BITS
	.word	.LC0
	.word	ENOSPC
	.size	idr_get_new_locked, .-idr_get_new_locked
	.comm	MA_OWNED,4,4
	.comm	MAX_LEVEL,4,4
	.comm	IDR_BITS,4,4
	.comm	ENOSPC,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
