	.file	"extr_hinic_hw_wq.c_alloc_wq_pages.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Number wq pages exceeds the limit\n"
	.align 8
.LC1:
	.string	"Number wq pages must be power of 2\n"
	.align 8
.LC2:
	.string	"Failed to allocate wqe shadow\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"Failed to allocate wq page\n"
	.text
	.p2align 4
	.type	alloc_wq_pages, @function
alloc_wq_pages:
.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	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	r13d, DWORD PTR [rdi]
	mov	r12, QWORD PTR [rsi]
	mov	QWORD PTR 24[rsp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	WQ_SIZE@PLT
	mov	esi, r13d
	mov	edi, eax
	call	ALIGN@PLT
	lea	rsi, .LC0[rip]
	cdq
	idiv	DWORD PTR [r14]
	cmp	eax, ebp
	jg	.L14
	lea	ebp, -1[rax]
	mov	ebx, eax
	test	ebp, eax
	jne	.L16
	mov	DWORD PTR 4[r14], eax
	mov	rdi, r14
	call	alloc_wqes_shadow@PLT
	mov	DWORD PTR 20[rsp], eax
	test	eax, eax
	jne	.L5
	mov	eax, ebp
	xor	r13d, r13d
	lea	r15, 36[rsp]
	mov	QWORD PTR 8[rsp], rax
	test	ebx, ebx
	jg	.L8
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, DWORD PTR 36[rsp]
	call	cpu_to_be64@PLT
	mov	DWORD PTR [rbx], eax
	lea	rax, 1[r13]
	cmp	r13, QWORD PTR 8[rsp]
	je	.L1
	mov	r13, rax
.L8:
	mov	rax, QWORD PTR 8[r14]
	mov	ecx, DWORD PTR GFP_KERNEL[rip]
	mov	rdx, r15
	mov	rdi, r12
	mov	esi, DWORD PTR [r14]
	lea	rbp, [rax+r13*8]
	mov	rax, QWORD PTR 16[r14]
	lea	rbx, [rax+r13*4]
	call	dma_alloc_coherent@PLT
	mov	QWORD PTR 0[rbp], rax
	test	rax, rax
	jne	.L7
	lea	rsi, .LC3[rip]
	mov	rdi, r12
	call	dev_err@PLT
	mov	rsi, QWORD PTR 24[rsp]
	mov	edx, r13d
	mov	rdi, r14
	call	free_wq_pages@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	mov	DWORD PTR 20[rsp], eax
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L17
	mov	eax, DWORD PTR 20[rsp]
	add	rsp, 56
	.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
.L16:
	.cfi_restore_state
	lea	rsi, .LC1[rip]
.L14:
	mov	rdi, r12
	call	dev_err@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	mov	DWORD PTR 20[rsp], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	lea	rsi, .LC2[rip]
	mov	rdi, r12
	call	dev_err@PLT
	jmp	.L1
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	alloc_wq_pages, .-alloc_wq_pages
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_hinic_hw_wq.c_alloc_wq_pages.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Number wq pages exceeds the limit\012\000"
	.align	2
.LC1:
	.ascii	"Number wq pages must be power of 2\012\000"
	.align	2
.LC2:
	.ascii	"Failed to allocate wqe shadow\012\000"
	.align	2
.LC3:
	.ascii	"Failed to allocate wq page\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	alloc_wq_pages, %function
alloc_wq_pages:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	sub	sp, sp, #20
	ldr	r3, .L17
	str	r1, [sp, #4]
	mov	r4, r2
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r10, [r1]
	bl	WQ_SIZE
	ldr	r1, [r5]
	bl	ALIGN
	ldr	r1, [r5]
	bl	__aeabi_idiv
	cmp	r0, r4
	bgt	.L14
	sub	r3, r0, #1
	tst	r3, r0
	mov	r6, r0
	bne	.L15
	str	r0, [r5, #4]
	mov	r0, r5
	bl	alloc_wqes_shadow
	subs	r9, r0, #0
	bne	.L5
	cmp	r6, #0
	movgt	r4, r9
	ldrgt	fp, .L17+4
	bgt	.L8
	b	.L1
.L7:
	ldr	r0, [sp, #8]
	bl	cpu_to_be64
	str	r0, [r8, r4, lsl #2]
	add	r4, r4, #1
	cmp	r6, r4
	beq	.L1
.L8:
	mov	r0, r10
	ldr	r3, [fp]
	ldr	r1, [r5]
	add	r2, sp, #8
	ldr	r7, [r5, #8]
	ldr	r8, [r5, #12]
	bl	dma_alloc_coherent
	cmp	r0, #0
	str	r0, [r7, r4, lsl #2]
	bne	.L7
	ldr	r1, .L17+8
	mov	r0, r10
	bl	dev_err
	mov	r2, r4
	mov	r0, r5
	ldr	r1, [sp, #4]
	bl	free_wq_pages
	ldr	r3, .L17+12
	ldr	r9, [r3]
	rsb	r9, r9, #0
.L1:
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L16
	mov	r0, r9
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	mov	r0, r10
	ldr	r1, .L17+16
	bl	dev_err
	ldr	r3, .L17+20
	ldr	r9, [r3]
	rsb	r9, r9, #0
	b	.L1
.L14:
	mov	r0, r10
	ldr	r1, .L17+24
	bl	dev_err
	ldr	r3, .L17+20
	ldr	r9, [r3]
	rsb	r9, r9, #0
	b	.L1
.L5:
	mov	r0, r10
	ldr	r1, .L17+28
	bl	dev_err
	b	.L1
.L16:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	.LC4
	.word	GFP_KERNEL
	.word	.LC3
	.word	ENOMEM
	.word	.LC1
	.word	EINVAL
	.word	.LC0
	.word	.LC2
	.size	alloc_wq_pages, .-alloc_wq_pages
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
