	.file	"extr_gadget.c___cdns3_gadget_ep_clear_halt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	__cdns3_gadget_ep_clear_halt
	.type	__cdns3_gadget_ep_clear_halt, @function
__cdns3_gadget_ep_clear_halt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	edx, edx
	xor	esi, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	r13, QWORD PTR 8[rdi]
	mov	rbp, rdi
	call	trace_cdns3_halt@PLT
	mov	rsi, QWORD PTR 0[r13]
	mov	edi, DWORD PTR EP_CMD_CSTALL[rip]
	or	edi, DWORD PTR EP_CMD_EPRST[rip]
	call	writel@PLT
	mov	rdi, QWORD PTR 0[r13]
	xor	esi, esi
	mov	ecx, 1
	mov	r8d, 100
	mov	edx, 1
	call	readl_poll_timeout_atomic@PLT
	test	eax, eax
	je	.L2
	mov	r12d, DWORD PTR EINVAL[rip]
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r12d, eax
	mov	eax, DWORD PTR EP_STALLED[rip]
	or	eax, DWORD PTR EP_STALL_PENDING[rip]
	lea	rdi, 4[rbp]
	not	eax
	and	DWORD PTR 0[rbp], eax
	call	cdns3_next_request@PLT
	test	rax, rax
	je	.L4
	mov	esi, 1
	mov	rdi, rbp
	call	cdns3_rearm_transfer@PLT
.L4:
	mov	rsi, rbp
	mov	rdi, r13
	call	cdns3_start_all_request@PLT
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	__cdns3_gadget_ep_clear_halt, .-__cdns3_gadget_ep_clear_halt
	.comm	EP_STALL_PENDING,4,4
	.comm	EP_STALLED,4,4
	.comm	EP_CMD_EPRST,4,4
	.comm	EP_CMD_CSTALL,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_gadget.c___cdns3_gadget_ep_clear_halt.c"
	.text
	.align	2
	.global	__cdns3_gadget_ep_clear_halt
	.syntax unified
	.arm
	.fpu softvfp
	.type	__cdns3_gadget_ep_clear_halt, %function
__cdns3_gadget_ep_clear_halt:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r2, #0
	push	{r4, r5, r6, lr}
	mov	r1, r2
	sub	sp, sp, #8
	ldr	r6, [r0, #8]
	mov	r5, r0
	bl	trace_cdns3_halt
	ldr	r2, .L10
	ldr	r3, .L10+4
	ldr	r0, [r2]
	ldr	r3, [r3]
	ldr	r1, [r6]
	orr	r0, r0, r3
	bl	writel
	mov	r2, #100
	mov	r3, #1
	ldr	r0, [r6]
	mov	r1, #0
	str	r2, [sp]
	mov	r2, r3
	bl	readl_poll_timeout_atomic
	subs	r4, r0, #0
	beq	.L2
	ldr	r3, .L10+8
	ldr	r0, [r3]
	rsb	r4, r0, #0
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L2:
	mov	r0, r5
	ldr	r3, .L10+12
	ldr	r2, .L10+16
	ldr	r1, [r3]
	ldr	r2, [r2]
	ldr	r3, [r5]
	orr	r2, r2, r1
	bic	r3, r3, r2
	str	r3, [r0], #4
	bl	cdns3_next_request
	cmp	r0, #0
	beq	.L4
	mov	r1, #1
	mov	r0, r5
	bl	cdns3_rearm_transfer
.L4:
	mov	r1, r5
	mov	r0, r6
	bl	cdns3_start_all_request
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L11:
	.align	2
.L10:
	.word	EP_CMD_CSTALL
	.word	EP_CMD_EPRST
	.word	EINVAL
	.word	EP_STALL_PENDING
	.word	EP_STALLED
	.size	__cdns3_gadget_ep_clear_halt, .-__cdns3_gadget_ep_clear_halt
	.comm	EP_STALL_PENDING,4,4
	.comm	EP_STALLED,4,4
	.comm	EP_CMD_EPRST,4,4
	.comm	EP_CMD_CSTALL,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
