	.file	"extr_hinic_hw_cmdq.c_cmdq_set_arm_bit.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	cmdq_set_arm_bit, @function
cmdq_set_arm_bit:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	r15, 4[rdi]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	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, 56
	.cfi_def_cfa_offset 112
	mov	rbx, QWORD PTR 8[rdi]
	mov	rdi, r15
	mov	QWORD PTR [rsp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	spin_lock@PLT
	mov	esi, DWORD PTR WQE_SCMD_SIZE[rip]
	mov	rdi, rbx
	lea	rdx, 32[rsp]
	call	hinic_get_wqe@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L8
	mov	r9d, DWORD PTR 0[r13]
	mov	esi, DWORD PTR [rbx]
	mov	edi, DWORD PTR WQE_SCMD_SIZE[rip]
	mov	DWORD PTR 12[rsp], r9d
	call	ALIGN@PLT
	mov	rcx, QWORD PTR 32[rsp]
	mov	r9d, DWORD PTR 12[rsp]
	cdq
	idiv	DWORD PTR [rbx]
	cdqe
	lea	r12, [rax+rcx]
	mov	rax, QWORD PTR 8[rbx]
	cmp	rax, r12
	jle	.L9
.L4:
	mov	eax, DWORD PTR CMDQ_SET_ARM_CMD[rip]
	lea	rbx, 28[rsp]
	push	rcx
	.cfi_def_cfa_offset 120
	xor	r8d, r8d
	mov	esi, DWORD PTR CMDQ_CMD_SYNC_DIRECT_RESP[rip]
	mov	rcx, r14
	mov	rdi, rbx
	push	rax
	.cfi_def_cfa_offset 128
	mov	eax, DWORD PTR HINIC_MOD_COMM[rip]
	push	rax
	.cfi_def_cfa_offset 136
	mov	eax, DWORD PTR HINIC_CMD_ACK_TYPE_CMDQ[rip]
	push	rax
	.cfi_def_cfa_offset 144
	mov	rdx, QWORD PTR 32[rsp]
	call	cmdq_set_direct_wqe@PLT
	mov	esi, DWORD PTR WQE_SCMD_SIZE[rip]
	add	rsp, 32
	.cfi_def_cfa_offset 112
	mov	rdi, rbx
	call	hinic_cpu_to_be32@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	cmdq_wqe_fill@PLT
	mov	esi, DWORD PTR HINIC_CMDQ_SYNC[rip]
	mov	rdx, r12
	mov	rdi, r13
	call	cmdq_set_db@PLT
	mov	rdi, r15
	call	spin_unlock@PLT
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR 40[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L10
	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
.L9:
	.cfi_restore_state
	mov	esi, DWORD PTR 0[r13]
	xor	edx, edx
	test	esi, esi
	sete	dl
	sub	r12, rax
	mov	DWORD PTR 0[r13], edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, r15
	call	spin_unlock@PLT
	mov	eax, DWORD PTR EBUSY[rip]
	neg	eax
	jmp	.L1
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cmdq_set_arm_bit, .-cmdq_set_arm_bit
	.comm	WQE_SCMD_SIZE,4,4
	.comm	HINIC_MOD_COMM,4,4
	.comm	HINIC_CMD_ACK_TYPE_CMDQ,4,4
	.comm	HINIC_CMDQ_SYNC,4,4
	.comm	EBUSY,4,4
	.comm	CMDQ_SET_ARM_CMD,4,4
	.comm	CMDQ_CMD_SYNC_DIRECT_RESP,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_cmdq.c_cmdq_set_arm_bit.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cmdq_set_arm_bit, %function
cmdq_set_arm_bit:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L10
	ldr	r6, [r0, #8]
	ldr	r10, .L10+4
	add	fp, r0, #4
	sub	sp, sp, #52
	mov	r4, r0
	mov	r0, fp
	ldr	r3, [r3]
	str	r3, [sp, #44]
	mov	r3,#0
	mov	r8, r1
	mov	r9, r2
	bl	spin_lock
	ldr	r1, [r10]
	add	r2, sp, #40
	mov	r0, r6
	bl	hinic_get_wqe
	mov	r7, r0
	bl	IS_ERR
	subs	r5, r0, #0
	bne	.L8
	ldr	r2, [r4]
	ldr	r1, [r6]
	ldr	r0, [r10]
	str	r2, [sp, #28]
	bl	ALIGN
	ldr	r1, [r6]
	bl	__aeabi_idiv
	ldr	r3, [sp, #40]
	ldr	ip, [r6, #4]
	add	r6, r0, r3
	cmp	ip, r6
	ldrle	r1, [r4]
	suble	r6, r6, ip
	clzle	r1, r1
	lsrle	r1, r1, #5
	strle	r1, [r4]
	mov	r1, #0
	ldr	ip, .L10+8
	ldr	r0, .L10+12
	ldr	lr, .L10+16
	ldr	ip, [ip]
	ldr	r0, [r0]
	str	r3, [sp, #20]
	ldr	lr, [lr]
	ldr	r2, [sp, #28]
	str	ip, [sp, #16]
	ldr	ip, .L10+20
	str	lr, [sp, #8]
	str	r2, [sp, #4]
	str	r0, [sp, #12]
	str	r1, [sp]
	ldr	r1, [ip]
	mov	r3, r9
	mov	r2, r8
	add	r0, sp, #36
	bl	cmdq_set_direct_wqe
	ldr	r1, [r10]
	add	r0, sp, #36
	bl	hinic_cpu_to_be32
	add	r1, sp, #36
	mov	r0, r7
	bl	cmdq_wqe_fill
	ldr	r3, .L10+24
	mov	r2, r6
	mov	r0, r4
	ldr	r1, [r3]
	bl	cmdq_set_db
	mov	r0, fp
	bl	spin_unlock
.L1:
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L9
	mov	r0, r5
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L8:
	mov	r0, fp
	bl	spin_unlock
	ldr	r3, .L10+28
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L9:
	bl	__stack_chk_fail
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	WQE_SCMD_SIZE
	.word	CMDQ_SET_ARM_CMD
	.word	HINIC_MOD_COMM
	.word	HINIC_CMD_ACK_TYPE_CMDQ
	.word	CMDQ_CMD_SYNC_DIRECT_RESP
	.word	HINIC_CMDQ_SYNC
	.word	EBUSY
	.size	cmdq_set_arm_bit, .-cmdq_set_arm_bit
	.comm	WQE_SCMD_SIZE,4,4
	.comm	HINIC_MOD_COMM,4,4
	.comm	HINIC_CMD_ACK_TYPE_CMDQ,4,4
	.comm	HINIC_CMDQ_SYNC,4,4
	.comm	EBUSY,4,4
	.comm	CMDQ_SET_ARM_CMD,4,4
	.comm	CMDQ_CMD_SYNC_DIRECT_RESP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
