	.file	"extr_unique.c_unique_insert.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	unique_insert
	.type	unique_insert, @function
unique_insert:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, edi
	mov	edi, 4
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	esi, DWORD PTR KM_SLEEP[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	lea	r12, 4[rsp]
	call	kmem_alloc@PLT
	lea	rdi, unique_mtx[rip]
	mov	DWORD PTR [rax], ebp
	mov	rbx, rax
	lea	rbp, unique_avl[rip]
	call	mutex_enter@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	lea	rdi, unique_mtx[rip]
	call	mutex_exit@PLT
	mov	rdi, rbx
	mov	esi, 4
	call	random_get_pseudo_bytes@PLT
	mov	eax, DWORD PTR UNIQUE_MASK[rip]
	and	DWORD PTR [rbx], eax
	lea	rdi, unique_mtx[rip]
	call	mutex_enter@PLT
.L2:
	mov	edx, DWORD PTR [rbx]
	test	edx, edx
	je	.L3
	mov	eax, DWORD PTR UNIQUE_MASK[rip]
	not	eax
	test	eax, edx
	jne	.L3
	mov	rdx, r12
	mov	rsi, rbx
	mov	rdi, rbp
	call	avl_find@PLT
	test	rax, rax
	jne	.L3
	mov	edx, DWORD PTR 4[rsp]
	mov	rsi, rbx
	lea	rdi, unique_avl[rip]
	call	avl_insert@PLT
	lea	rdi, unique_mtx[rip]
	call	mutex_exit@PLT
	mov	eax, DWORD PTR [rbx]
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L10
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	unique_insert, .-unique_insert
	.comm	unique_mtx,4,4
	.comm	unique_avl,4,4
	.comm	UNIQUE_MASK,4,4
	.comm	KM_SLEEP,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_unique.c_unique_insert.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	unique_insert
	.syntax unified
	.arm
	.fpu softvfp
	.type	unique_insert, %function
unique_insert:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L11
	mov	r5, r0
	ldr	r1, [r3]
	ldr	r3, .L11+4
	sub	sp, sp, #12
	mov	r0, #4
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	kmem_alloc
	mov	r4, r0
	ldr	r0, .L11+8
	str	r5, [r4]
	bl	mutex_enter
	ldr	r6, .L11+12
	ldr	r7, .L11+16
	ldr	r5, .L11+8
	b	.L2
.L3:
	mov	r0, r5
	bl	mutex_exit
	mov	r1, #4
	mov	r0, r4
	bl	random_get_pseudo_bytes
	ldr	r3, [r4]
	ldr	r2, [r6]
	mov	r0, r5
	and	r3, r3, r2
	str	r3, [r4]
	bl	mutex_enter
.L2:
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L3
	ldr	r2, [r6]
	bics	r3, r3, r2
	bne	.L3
	mov	r2, sp
	mov	r1, r4
	mov	r0, r7
	bl	avl_find
	cmp	r0, #0
	bne	.L3
	ldr	r2, [sp]
	mov	r1, r4
	ldr	r0, .L11+16
	bl	avl_insert
	ldr	r0, .L11+8
	bl	mutex_exit
	ldr	r3, .L11+4
	ldr	r0, [r4]
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L10:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	KM_SLEEP
	.word	.LC0
	.word	unique_mtx
	.word	UNIQUE_MASK
	.word	unique_avl
	.size	unique_insert, .-unique_insert
	.comm	unique_mtx,4,4
	.comm	unique_avl,4,4
	.comm	UNIQUE_MASK,4,4
	.comm	KM_SLEEP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
