	.file	"extr_portserial.c_vMBPortSerialRxPoll.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Receive: %d(bytes in buffer)\n"
	.text
	.p2align 4
	.type	vMBPortSerialRxPoll, @function
vMBPortSerialRxPoll:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR bRxStateEnabled[rip], 0
	je	.L1
	test	rdi, rdi
	jne	.L20
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rdx, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rcx, QWORD PTR MB_SERIAL_BUF_SIZE[rip]
	mov	rax, QWORD PTR uiRxBufferPos[rip]
	cmp	rcx, rdi
	cmovbe	rdx, rcx
	lea	rsi, [rax+rdx]
	cmp	rcx, rsi
	ja	.L21
	xor	esi, esi
	xor	eax, eax
.L3:
	mov	ecx, DWORD PTR portMAX_DELAY[rip]
	mov	edi, DWORD PTR ucUartNumber[rip]
	mov	QWORD PTR uiRxBufferPos[rip], rax
	xor	ebx, ebx
	add	rsi, QWORD PTR ucBuffer[rip]
	call	uart_read_bytes@PLT
	mov	rbp, rax
	test	rax, rax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xor	eax, eax
	add	rbx, 1
	call	pxMBFrameCBByteReceived@PLT
	cmp	rbp, rbx
	jne	.L4
.L5:
	mov	edi, DWORD PTR ucUartNumber[rip]
	call	uart_flush_input@PLT
	xor	eax, eax
	call	pxMBPortCBTimerExpired@PLT
	mov	edi, DWORD PTR TAG[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	edx, ebp
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	lea	rsi, .LC0[rip]
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	ESP_LOGD@PLT
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	lea	rsi, 0[0+rax*4]
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	vMBPortSerialRxPoll, .-vMBPortSerialRxPoll
	.comm	uiRxBufferPos,8,8
	.comm	ucUartNumber,4,4
	.comm	ucBuffer,8,8
	.comm	portMAX_DELAY,4,4
	.comm	bRxStateEnabled,8,8
	.comm	TAG,4,4
	.comm	MB_SERIAL_BUF_SIZE,8,8
	.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_portserial.c_vMBPortSerialRxPoll.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Receive: %d(bytes in buffer)\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vMBPortSerialRxPoll, %function
vMBPortSerialRxPoll:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L13
	ldr	r3, [r3]
	cmp	r3, #0
	cmpne	r0, #0
	bxeq	lr
	ldr	r3, .L13+4
	push	{r4, r5, r6, lr}
	ldr	r3, [r3]
	ldr	lr, .L13+8
	cmp	r3, r0
	movcc	r2, r3
	movcs	r2, r0
	ldr	ip, [lr]
	ldr	r0, .L13+12
	add	r1, ip, r2
	cmp	r3, r1
	movls	r3, #0
	movls	ip, r3
	ldr	r1, .L13+16
	ldr	r6, .L13+20
	ldr	r1, [r1]
	lslhi	r3, ip, #2
	add	r1, r1, r3
	ldr	r3, [r0]
	ldr	r0, [r6]
	str	ip, [lr]
	bl	uart_read_bytes
	subs	r5, r0, #0
	movgt	r4, #0
	ble	.L5
.L4:
	add	r4, r4, #1
	bl	pxMBFrameCBByteReceived
	cmp	r5, r4
	bne	.L4
.L5:
	ldr	r0, [r6]
	bl	uart_flush_input
	bl	pxMBPortCBTimerExpired
	ldr	r3, .L13+24
	mov	r2, r5
	pop	{r4, r5, r6, lr}
	ldr	r0, [r3]
	ldr	r1, .L13+28
	b	ESP_LOGD
.L14:
	.align	2
.L13:
	.word	bRxStateEnabled
	.word	MB_SERIAL_BUF_SIZE
	.word	uiRxBufferPos
	.word	portMAX_DELAY
	.word	ucBuffer
	.word	ucUartNumber
	.word	TAG
	.word	.LC0
	.size	vMBPortSerialRxPoll, .-vMBPortSerialRxPoll
	.comm	uiRxBufferPos,4,4
	.comm	ucUartNumber,4,4
	.comm	ucBuffer,4,4
	.comm	portMAX_DELAY,4,4
	.comm	bRxStateEnabled,4,4
	.comm	TAG,4,4
	.comm	MB_SERIAL_BUF_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
