	.file	"extr_core.c_alloc_pwms.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	alloc_pwms, @function
alloc_pwms:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	esi, DWORD PTR MAX_PWMS[rip]
	cmp	esi, edi
	jg	.L2
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.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
	test	edi, edi
	mov	edx, 0
	mov	ebx, edi
	mov	ecx, ebp
	cmovns	edx, edi
	mov	edi, DWORD PTR allocated_pwms[rip]
	xor	r8d, r8d
	call	bitmap_find_next_zero_area@PLT
	test	ebx, ebx
	js	.L4
	cmp	ebx, eax
	je	.L4
	mov	eax, DWORD PTR EEXIST[rip]
	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
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	lea	esi, 0[rbp+rax]
	cmp	esi, DWORD PTR MAX_PWMS[rip]
	jbe	.L1
	mov	eax, DWORD PTR ENOSPC[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	alloc_pwms, .-alloc_pwms
	.comm	allocated_pwms,4,4
	.comm	MAX_PWMS,4,4
	.comm	ENOSPC,4,4
	.comm	EINVAL,4,4
	.comm	EEXIST,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_core.c_alloc_pwms.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	alloc_pwms, %function
alloc_pwms:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r6, .L9
	mov	r5, r1
	ldr	r1, [r6]
	sub	sp, sp, #8
	cmp	r1, r0
	bgt	.L2
	ldr	r3, .L9+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L2:
	mov	r2, #0
	mov	r4, r0
	ldr	r3, .L9+8
	str	r2, [sp]
	ldr	r0, [r3]
	bic	r2, r4, r4, asr #31
	mov	r3, r5
	bl	bitmap_find_next_zero_area
	mvn	r3, r4
	cmp	r4, r0
	lsr	r3, r3, #31
	moveq	r3, #0
	cmp	r3, #0
	bne	.L8
	ldr	r3, [r6]
	add	r1, r5, r0
	cmp	r1, r3
	ldrhi	r3, .L9+12
	ldrhi	r0, [r3]
	rsbhi	r0, r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L8:
	ldr	r3, .L9+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L10:
	.align	2
.L9:
	.word	MAX_PWMS
	.word	EINVAL
	.word	allocated_pwms
	.word	ENOSPC
	.word	EEXIST
	.size	alloc_pwms, .-alloc_pwms
	.comm	allocated_pwms,4,4
	.comm	MAX_PWMS,4,4
	.comm	ENOSPC,4,4
	.comm	EINVAL,4,4
	.comm	EEXIST,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
