	.file	"extr_lcs.c_lcs_alloc_channel.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"ichalloc"
.LC1:
	.string	"echalloc"
	.text
	.p2align 4
	.type	lcs_alloc_channel, @function
lcs_alloc_channel:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	esi, DWORD PTR setup[rip]
	lea	rdx, .LC0[rip]
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdi
	mov	edi, 2
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	LCS_DBF_TEXT@PLT
	mov	eax, DWORD PTR LCS_NUM_BUFFS[rip]
	test	eax, eax
	jle	.L5
	mov	rax, QWORD PTR [r12]
	xor	r14d, r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	mov	edx, DWORD PTR LCS_BUF_STATE_EMPTY[rip]
	add	r14, 1
	cmp	DWORD PTR LCS_NUM_BUFFS[rip], r14d
	mov	DWORD PTR 8[rbx], edx
	jle	.L5
.L4:
	mov	edi, DWORD PTR LCS_IOBUFFERSIZE[rip]
	mov	rbx, r14
	mov	esi, DWORD PTR GFP_DMA[rip]
	sal	rbx, 4
	or	esi, DWORD PTR GFP_KERNEL[rip]
	lea	rbp, [rax+rbx]
	call	kzalloc@PLT
	mov	QWORD PTR 0[rbp], rax
	mov	rax, QWORD PTR [r12]
	add	rbx, rax
	cmp	QWORD PTR [rbx], 0
	jne	.L14
	cmp	DWORD PTR LCS_NUM_BUFFS[rip], r14d
	jle	.L5
	mov	esi, DWORD PTR setup[rip]
	lea	rdx, .LC1[rip]
	mov	edi, 2
	lea	ebp, -1[r14]
	call	LCS_DBF_TEXT@PLT
	test	r14d, r14d
	jle	.L9
	movsx	rbx, r14d
	lea	eax, -1[r14]
	movsx	rbp, ebp
	sub	rbx, rax
	sal	rbp, 4
	sal	rbx, 4
	sub	rbx, 32
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR [r12]
	mov	rdi, QWORD PTR [rax+rbp]
	sub	rbp, 16
	call	kfree@PLT
	cmp	rbx, rbp
	jne	.L8
.L9:
	mov	eax, DWORD PTR ENOMEM[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	pop	rbx
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	lcs_alloc_channel, .-lcs_alloc_channel
	.comm	setup,4,4
	.comm	LCS_NUM_BUFFS,4,4
	.comm	LCS_IOBUFFERSIZE,4,4
	.comm	LCS_BUF_STATE_EMPTY,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GFP_DMA,4,4
	.comm	ENOMEM,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_lcs.c_lcs_alloc_channel.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ichalloc\000"
	.align	2
.LC1:
	.ascii	"echalloc\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	lcs_alloc_channel, %function
lcs_alloc_channel:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L15
	ldr	r7, .L15+4
	ldr	r1, [r3]
	mov	r6, r0
	ldr	r2, .L15+8
	mov	r0, #2
	bl	LCS_DBF_TEXT
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L5
	mov	r4, #0
	ldr	r5, [r6]
	ldr	r10, .L15+12
	ldr	fp, .L15+16
	ldr	r8, .L15+20
	ldr	r9, .L15+24
	b	.L4
.L14:
	ldr	r0, [r7]
	ldr	r1, [r9]
	add	r4, r4, #1
	cmp	r0, r4
	str	r1, [r3, #4]
	ble	.L5
.L4:
	ldr	r3, [fp]
	ldr	r1, [r10]
	ldr	r0, [r8]
	orr	r1, r1, r3
	bl	kzalloc
	str	r0, [r5, r4, lsl #3]
	ldr	r5, [r6]
	lsl	r3, r4, #3
	ldr	r1, [r5, r4, lsl #3]
	add	r3, r5, r3
	cmp	r1, #0
	bne	.L14
	ldr	r3, [r7]
	cmp	r3, r4
	ble	.L5
	ldr	r3, .L15
	mov	r0, #2
	ldr	r1, [r3]
	ldr	r2, .L15+28
	bl	LCS_DBF_TEXT
	cmp	r4, #0
	sub	r4, r4, #1
	ble	.L8
.L6:
	ldr	r3, [r6]
	ldr	r0, [r3, r4, lsl #3]
	sub	r4, r4, #1
	bl	kfree
	cmn	r4, #1
	bne	.L6
.L8:
	ldr	r3, .L15+32
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	mov	r0, #0
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	.align	2
.L15:
	.word	setup
	.word	LCS_NUM_BUFFS
	.word	.LC0
	.word	GFP_DMA
	.word	GFP_KERNEL
	.word	LCS_IOBUFFERSIZE
	.word	LCS_BUF_STATE_EMPTY
	.word	.LC1
	.word	ENOMEM
	.size	lcs_alloc_channel, .-lcs_alloc_channel
	.comm	setup,4,4
	.comm	LCS_NUM_BUFFS,4,4
	.comm	LCS_IOBUFFERSIZE,4,4
	.comm	LCS_BUF_STATE_EMPTY,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GFP_DMA,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
