	.file	"extr_necp.c_necp_get_new_uuid_id.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Failed to find a free service UUID.\n"
	.align 8
.LC1:
	.string	"Failed to find a free app UUID.\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"Allocate uuid ID failed.\n"
	.text
	.p2align 4
	.type	necp_get_new_uuid_id, @function
necp_get_new_uuid_id:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, edi
	lea	rdi, necp_kernel_policy_lock[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	esi, DWORD PTR LCK_RW_ASSERT_EXCLUSIVE[rip]
	call	LCK_RW_ASSERT@PLT
	test	ebx, ebx
	mov	ebx, DWORD PTR FALSE[rip]
	je	.L11
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	cmp	rax, QWORD PTR NECP_FIRST_VALID_APP_ID[rip]
	jge	.L3
	mov	r12, rax
	mov	rdi, r12
	call	necp_uuid_lookup_uuid_with_service_id_locked@PLT
	test	rax, rax
	je	.L8
.L7:
	mov	rax, QWORD PTR necp_last_service_uuid_id.1937[rip]
	mov	r12, QWORD PTR NECP_FIRST_VALID_SERVICE_ID[rip]
	add	rax, 1
	mov	QWORD PTR necp_last_service_uuid_id.1937[rip], rax
	cmp	rax, r12
	jge	.L17
.L3:
	test	ebx, ebx
	jne	.L18
	mov	rdi, r12
	mov	QWORD PTR necp_last_service_uuid_id.1937[rip], r12
	mov	ebx, DWORD PTR TRUE[rip]
	call	necp_uuid_lookup_uuid_with_service_id_locked@PLT
	test	rax, rax
	jne	.L7
.L8:
	cmp	QWORD PTR NECP_NULL_SERVICE_ID[rip], r12
	je	.L19
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	rax, QWORD PTR necp_last_app_uuid_id.1938[rip]
	lea	r12, 1[rax]
	mov	rax, QWORD PTR NECP_FIRST_VALID_APP_ID[rip]
	mov	QWORD PTR necp_last_app_uuid_id.1938[rip], r12
	cmp	r12, rax
	jge	.L9
	test	ebx, ebx
	jne	.L20
	mov	QWORD PTR necp_last_app_uuid_id.1938[rip], rax
	mov	ebx, DWORD PTR TRUE[rip]
	mov	r12, rax
.L9:
	mov	rdi, r12
	call	necp_uuid_lookup_uuid_with_app_id_locked@PLT
	test	rax, rax
	jne	.L11
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edi, DWORD PTR LOG_ERR[rip]
	lea	rsi, .LC0[rip]
	call	NECPLOG0@PLT
	mov	r12, QWORD PTR NECP_NULL_SERVICE_ID[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	mov	rax, r12
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	mov	edi, DWORD PTR LOG_ERR[rip]
	lea	rsi, .LC1[rip]
	call	NECPLOG0@PLT
	mov	r12, QWORD PTR NECP_NULL_SERVICE_ID[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	mov	rax, r12
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	edi, DWORD PTR LOG_ERR[rip]
	lea	rsi, .LC2[rip]
	call	NECPLOG0@PLT
	mov	r12, QWORD PTR NECP_NULL_SERVICE_ID[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	necp_get_new_uuid_id, .-necp_get_new_uuid_id
	.local	necp_last_app_uuid_id.1938
	.comm	necp_last_app_uuid_id.1938,8,8
	.local	necp_last_service_uuid_id.1937
	.comm	necp_last_service_uuid_id.1937,8,8
	.comm	necp_kernel_policy_lock,4,4
	.comm	TRUE,4,4
	.comm	NECP_NULL_SERVICE_ID,8,8
	.comm	NECP_FIRST_VALID_SERVICE_ID,8,8
	.comm	NECP_FIRST_VALID_APP_ID,8,8
	.comm	LOG_ERR,4,4
	.comm	LCK_RW_ASSERT_EXCLUSIVE,4,4
	.comm	FALSE,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_necp.c_necp_get_new_uuid_id.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed to find a free service UUID.\012\000"
	.align	2
.LC1:
	.ascii	"Failed to find a free app UUID.\012\000"
	.align	2
.LC2:
	.ascii	"Allocate uuid ID failed.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	necp_get_new_uuid_id, %function
necp_get_new_uuid_id:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	ldr	r3, .L21
	ldr	r0, .L21+4
	ldr	r1, [r3]
	bl	LCK_RW_ASSERT
	ldr	r3, .L21+8
	cmp	r4, #0
	ldr	r5, .L21+12
	ldr	r6, [r3]
	beq	.L2
	ldr	r7, .L21+16
	ldr	r8, .L21+20
	ldr	r9, .L21+24
	b	.L7
.L17:
	ldr	r2, [r9]
	cmp	r3, r2
	bge	.L3
	mov	r4, r3
	mov	r0, r4
	bl	necp_uuid_lookup_uuid_with_service_id_locked
	cmp	r0, #0
	beq	.L8
.L7:
	ldr	r3, [r5]
	ldr	r4, [r7]
	add	r3, r3, #1
	cmp	r3, r4
	str	r3, [r5]
	bge	.L17
.L3:
	cmp	r6, #0
	bne	.L18
	mov	r0, r4
	ldr	r6, [r8]
	str	r4, [r5]
	bl	necp_uuid_lookup_uuid_with_service_id_locked
	cmp	r0, #0
	bne	.L7
.L8:
	ldr	r5, .L21+28
	ldr	r3, [r5]
	cmp	r3, r4
	beq	.L19
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r7, .L21+24
	ldr	r8, .L21+20
.L11:
	ldr	r4, [r5, #4]
	ldr	r3, [r7]
	add	r4, r4, #1
	cmp	r4, r3
	str	r4, [r5, #4]
	bge	.L9
	cmp	r6, #0
	bne	.L20
	mov	r4, r3
	ldr	r6, [r8]
	str	r3, [r5, #4]
.L9:
	mov	r0, r4
	bl	necp_uuid_lookup_uuid_with_app_id_locked
	cmp	r0, #0
	bne	.L11
	b	.L8
.L18:
	ldr	r3, .L21+32
	ldr	r1, .L21+36
	ldr	r0, [r3]
	bl	NECPLOG0
	ldr	r3, .L21+28
	ldr	r4, [r3]
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L20:
	ldr	r3, .L21+32
	ldr	r1, .L21+40
	ldr	r0, [r3]
	bl	NECPLOG0
	ldr	r3, .L21+28
	ldr	r4, [r3]
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L19:
	ldr	r3, .L21+32
	ldr	r1, .L21+44
	ldr	r0, [r3]
	bl	NECPLOG0
	ldr	r4, [r5]
	b	.L1
.L22:
	.align	2
.L21:
	.word	LCK_RW_ASSERT_EXCLUSIVE
	.word	necp_kernel_policy_lock
	.word	FALSE
	.word	.LANCHOR0
	.word	NECP_FIRST_VALID_SERVICE_ID
	.word	TRUE
	.word	NECP_FIRST_VALID_APP_ID
	.word	NECP_NULL_SERVICE_ID
	.word	LOG_ERR
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	necp_get_new_uuid_id, .-necp_get_new_uuid_id
	.comm	necp_kernel_policy_lock,4,4
	.comm	TRUE,4,4
	.comm	NECP_NULL_SERVICE_ID,4,4
	.comm	NECP_FIRST_VALID_SERVICE_ID,4,4
	.comm	NECP_FIRST_VALID_APP_ID,4,4
	.comm	LOG_ERR,4,4
	.comm	LCK_RW_ASSERT_EXCLUSIVE,4,4
	.comm	FALSE,4,4
	.bss
	.align	2
	.set	.LANCHOR0,. + 0
	.type	necp_last_service_uuid_id.4221, %object
	.size	necp_last_service_uuid_id.4221, 4
necp_last_service_uuid_id.4221:
	.space	4
	.type	necp_last_app_uuid_id.4222, %object
	.size	necp_last_app_uuid_id.4222, 4
necp_last_app_uuid_id.4222:
	.space	4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
