	.file	"extr_amd5536udc.c_udc_rxfifo_read.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"%s: rx %d bytes, rx-buf space = %d bytesn\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"ep %s: rxfifo read %d bytes\n"
	.text
	.p2align 4
	.type	udc_rxfifo_read, @function
udc_rxfifo_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	mov	rdi, QWORD PTR 16[rdi]
	call	readl@PLT
	mov	esi, DWORD PTR UDC_EPSTS_RX_PKT_SIZE[rip]
	mov	edi, eax
	call	AMD_GETBITS@PLT
	mov	esi, DWORD PTR 0[rbp]
	mov	edi, DWORD PTR 4[rbp]
	mov	rdx, QWORD PTR 16[rbp]
	mov	ecx, eax
	mov	r12d, esi
	sub	r12d, edi
	lea	r13, [rdx+rdi*4]
	cmp	eax, r12d
	ja	.L2
	xor	edx, edx
	lea	esi, [rdi+rax]
	mov	r9d, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rbx]
	div	DWORD PTR 4[rbx]
	mov	r12d, ecx
.L3:
	mov	DWORD PTR 4[rbp], esi
	test	r12d, r12d
	je	.L5
	test	edx, edx
	je	.L12
.L5:
	mov	r14d, 1
.L4:
	mov	ecx, r12d
	mov	edx, r9d
	lea	rsi, .LC1[rip]
	call	VDBG@PLT
	mov	edi, DWORD PTR [rbx]
	mov	edx, r12d
	mov	rsi, r13
	call	udc_rxfifo_read_bytes@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	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
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	xor	r14d, r14d
	cmp	DWORD PTR 0[rbp], esi
	jne	.L4
	mov	eax, DWORD PTR 8[rbp]
	xor	r14d, r14d
	test	eax, eax
	sete	r14b
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	mov	eax, r12d
	xor	edx, edx
	mov	r9d, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rbx]
	div	DWORD PTR 4[rbx]
	test	edx, edx
	je	.L3
	mov	edx, r9d
	lea	rsi, .LC0[rip]
	mov	r8d, r12d
	call	DBG@PLT
	mov	eax, DWORD PTR EOVERFLOW[rip]
	mov	esi, DWORD PTR 4[rbp]
	xor	edx, edx
	mov	r9d, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rbx]
	neg	eax
	add	esi, r12d
	mov	DWORD PTR 12[rbp], eax
	mov	eax, r12d
	div	DWORD PTR 4[rbx]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	udc_rxfifo_read, .-udc_rxfifo_read
	.comm	UDC_EPSTS_RX_PKT_SIZE,4,4
	.comm	EOVERFLOW,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_amd5536udc.c_udc_rxfifo_read.c"
	.text
	.global	__aeabi_uidivmod
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s: rx %d bytes, rx-buf space = %d bytesn\012\000"
	.align	2
.LC1:
	.ascii	"ep %s: rxfifo read %d bytes\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	udc_rxfifo_read, %function
udc_rxfifo_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r0
	sub	sp, sp, #12
	ldr	r0, [r0, #12]
	mov	r8, r1
	bl	readl
	ldr	r3, .L13
	ldr	r1, [r3]
	bl	AMD_GETBITS
	ldr	r3, [r8, #4]
	ldr	r9, [r8]
	ldr	r7, [r8, #16]
	sub	r6, r9, r3
	cmp	r0, r6
	mov	r4, r0
	ldr	r1, [r5, #4]
	add	r7, r7, r3, lsl #2
	bhi	.L2
	mov	r6, r4
	add	r9, r3, r0
	bl	__aeabi_uidivmod
	ldr	r0, [r5]
	ldr	r2, [r5, #8]
.L3:
	subs	r4, r1, #0
	movne	r4, #1
	cmp	r6, #0
	moveq	r4, #1
	cmp	r4, #0
	movne	r4, #1
	str	r9, [r8, #4]
	beq	.L12
.L4:
	mov	r3, r6
	ldr	r1, .L13+4
	bl	VDBG
	mov	r2, r6
	mov	r1, r7
	ldr	r0, [r5]
	bl	udc_rxfifo_read_bytes
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L2:
	mov	r0, r6
	bl	__aeabi_uidivmod
	cmp	r1, #0
	ldr	r0, [r5]
	ldr	r2, [r5, #8]
	beq	.L3
	mov	r3, r4
	ldr	r1, .L13+8
	str	r6, [sp]
	bl	DBG
	ldr	r3, .L13+12
	ldr	r9, [r8, #4]
	ldr	r3, [r3]
	ldr	r1, [r5, #4]
	rsb	r3, r3, #0
	mov	r0, r6
	str	r3, [r8, #12]
	bl	__aeabi_uidivmod
	add	r9, r6, r9
	ldr	r0, [r5]
	ldr	r2, [r5, #8]
	b	.L3
.L12:
	ldr	r3, [r8]
	cmp	r3, r9
	ldreq	r4, [r8, #8]
	clzeq	r4, r4
	lsreq	r4, r4, #5
	b	.L4
.L14:
	.align	2
.L13:
	.word	UDC_EPSTS_RX_PKT_SIZE
	.word	.LC1
	.word	.LC0
	.word	EOVERFLOW
	.size	udc_rxfifo_read, .-udc_rxfifo_read
	.comm	UDC_EPSTS_RX_PKT_SIZE,4,4
	.comm	EOVERFLOW,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
