	.file	"extr_qib_mad.c_add_pkey.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	add_pkey, @function
add_pkey:
.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
	mov	r14d, esi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	and	r14d, 32767
	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
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	cmp	r14d, 32767
	je	.L8
	mov	rbp, rdi
	mov	r13d, esi
	mov	rdi, QWORD PTR [rdi]
	xor	ebx, ebx
	xor	r12d, r12d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	eax, r13d
	je	.L18
	and	eax, 32767
	cmp	eax, r14d
	je	.L19
.L6:
	add	rbx, 1
.L4:
	call	ARRAY_SIZE@PLT
	cmp	eax, ebx
	jle	.L20
	mov	rdi, QWORD PTR 0[rbp]
	lea	r15, 0[0+rbx*4]
	mov	eax, DWORD PTR [rdi+rbx*4]
	test	eax, eax
	jne	.L5
	add	r12d, 1
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdi, QWORD PTR 8[rbp]
	add	rdi, r15
	call	atomic_inc_return@PLT
	cmp	eax, 1
	jg	.L8
	mov	rdi, QWORD PTR 8[rbp]
	add	r12d, 1
	add	rdi, r15
	call	atomic_dec@PLT
	mov	rdi, QWORD PTR 0[rbp]
	mov	eax, DWORD PTR [rdi+r15]
	and	eax, 32767
	cmp	eax, r14d
	jne	.L6
.L19:
	mov	eax, DWORD PTR EEXIST[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	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
.L20:
	.cfi_restore_state
	test	r12d, r12d
	je	.L16
	mov	rdi, QWORD PTR 0[rbp]
	xor	ebx, ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	add	rbx, 1
.L11:
	call	ARRAY_SIZE@PLT
	cmp	eax, ebx
	jle	.L16
	mov	rdi, QWORD PTR 0[rbp]
	lea	r12, 0[0+rbx*4]
	mov	eax, DWORD PTR [rdi+rbx*4]
	test	eax, eax
	jne	.L12
	mov	rdi, QWORD PTR 8[rbp]
	add	rdi, r12
	call	atomic_inc_return@PLT
	cmp	eax, 1
	je	.L13
	mov	rdi, QWORD PTR 0[rbp]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L16:
	mov	eax, DWORD PTR EBUSY[rip]
	neg	eax
.L3:
	endbr64
.L1:
	add	rsp, 8
	.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
.L8:
	.cfi_restore_state
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L13:
	.cfi_restore_state
	mov	rdx, QWORD PTR 0[rbp]
	mov	DWORD PTR [rdx+r12], r13d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	add_pkey, .-add_pkey
	.comm	EEXIST,4,4
	.comm	EBUSY,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_qib_mad.c_add_pkey.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	add_pkey, %function
add_pkey:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r8, .L20
	bics	r3, r8, r1
	and	r9, r1, r8
	beq	.L8
	mov	r7, #0
	mov	r5, r0
	mov	r6, r1
	mov	r4, r7
	ldr	r0, [r0]
	b	.L4
.L7:
	and	r3, r3, r8
	cmp	r3, r9
	beq	.L18
.L6:
	add	r4, r4, #1
.L4:
	bl	ARRAY_SIZE
	cmp	r0, r4
	ble	.L19
	ldr	r0, [r5]
	lsl	r10, r4, #2
	ldr	r3, [r0, r4, lsl #2]
	cmp	r3, #0
	addeq	r7, r7, #1
	beq	.L6
	cmp	r3, r6
	bne	.L7
	ldr	r0, [r5, #4]
	add	r7, r7, #1
	add	r0, r0, r10
	bl	atomic_inc_return
	cmp	r0, #1
	bgt	.L8
	ldr	r0, [r5, #4]
	add	r0, r0, r10
	bl	atomic_dec
	ldr	r0, [r5]
	ldr	r3, [r0, r10]
	and	r3, r3, r8
	cmp	r3, r9
	bne	.L6
.L18:
	ldr	r3, .L20+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L19:
	cmp	r7, #0
	beq	.L16
	mov	r4, #0
	ldr	r0, [r5]
	b	.L11
.L12:
	add	r4, r4, #1
.L11:
	bl	ARRAY_SIZE
	cmp	r0, r4
	ble	.L16
	ldr	r0, [r5]
	lsl	r7, r4, #2
	ldr	r3, [r0, r4, lsl #2]
	cmp	r3, #0
	bne	.L12
	ldr	r0, [r5, #4]
	add	r0, r0, r7
	bl	atomic_inc_return
	cmp	r0, #1
	beq	.L13
	ldr	r0, [r5]
	b	.L12
.L16:
.L3:
	ldr	r3, .L20+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L8:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	ldr	r3, [r5]
	str	r6, [r3, r7]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L21:
	.align	2
.L20:
	.word	32767
	.word	EEXIST
	.word	EBUSY
	.size	add_pkey, .-add_pkey
	.comm	EEXIST,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
