	.file	"extr_sym53c416.c_sym53c416_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sym53c416_read, @function
sym53c416_read:
.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	r14d, edx
	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
	movsx	rbp, edi
	lea	rdi, sym53c416_lock[rip]
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	xor	esi, esi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	r12d, DWORD PTR READ_TIMEOUT[rip]
	mov	DWORD PTR 12[rsp], edx
	call	spin_lock_irqsave@PLT
	test	r12d, r12d
	je	.L16
	test	r14d, r14d
	je	.L16
	xor	r15d, r15d
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdi, QWORD PTR PIO_FIFO_CNT[rip]
	add	rdi, rbp
	call	inb@PLT
	cmp	QWORD PTR fastpio[rip], 0
	mov	r13d, eax
	je	.L3
	cmp	eax, 3
	ja	.L49
.L3:
	test	r13d, r13d
	je	.L5
	lea	eax, -1[r13]
	sub	r14d, r13d
	lea	r13, 1[rbx+rax]
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, QWORD PTR PIO_FIFO_1[rip]
	add	rbx, 1
	add	rdi, rbp
	call	inb@PLT
	mov	BYTE PTR -1[rbx], al
	cmp	r13, rbx
	jne	.L6
.L4:
	test	r14d, r14d
	je	.L15
	test	r12d, r12d
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r12d, DWORD PTR 12[rsp]
	sub	r12d, r14d
.L2:
	xor	esi, esi
	lea	rdi, sym53c416_lock[rip]
	call	spin_unlock_irqrestore@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L5:
	.cfi_restore_state
	mov	r13d, DWORD PTR jiffies[rip]
	xor	esi, esi
	lea	rdi, sym53c416_lock[rip]
	add	r13d, r12d
	movsx	r13, r13d
	call	spin_unlock_irqrestore@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L51:
	mov	rdi, QWORD PTR PIO_INT_REG[rip]
	add	rdi, rbp
	call	inb@PLT
	test	DWORD PTR EMPTY[rip], eax
	je	.L9
	test	r12d, r12d
	je	.L50
	mov	rdi, QWORD PTR PIO_INT_REG[rip]
	add	rdi, rbp
	call	inb@PLT
	test	DWORD PTR SCI[rip], eax
	cmovne	r12d, r15d
.L7:
	mov	edi, DWORD PTR jiffies[rip]
	mov	rsi, r13
	call	time_before@PLT
	test	rax, rax
	jne	.L51
.L9:
	xor	esi, esi
	lea	rdi, sym53c416_lock[rip]
	call	spin_lock_irqsave@PLT
	mov	rdi, QWORD PTR PIO_INT_REG[rip]
	add	rdi, rbp
	call	inb@PLT
	test	DWORD PTR EMPTY[rip], eax
	je	.L4
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L49:
	mov	rdi, QWORD PTR PIO_FIFO_1[rip]
	mov	edx, eax
	mov	rsi, rbx
	and	r13d, 252
	shr	edx, 2
	sub	r14d, r13d
	add	rdi, rbp
	call	insl@PLT
	mov	eax, r13d
	add	rbx, rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L50:
	xor	esi, esi
	lea	rdi, sym53c416_lock[rip]
	call	spin_lock_irqsave@PLT
	mov	rdi, QWORD PTR PIO_INT_REG[rip]
	add	rdi, rbp
	call	inb@PLT
	jmp	.L15
.L16:
	xor	r12d, r12d
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	sym53c416_read, .-sym53c416_read
	.comm	sym53c416_lock,4,4
	.comm	jiffies,4,4
	.comm	fastpio,8,8
	.comm	SCI,4,4
	.comm	READ_TIMEOUT,4,4
	.comm	PIO_INT_REG,8,8
	.comm	PIO_FIFO_CNT,8,8
	.comm	PIO_FIFO_1,8,8
	.comm	EMPTY,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_sym53c416.c_sym53c416_read.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sym53c416_read, %function
sym53c416_read:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r2
	ldr	r3, .L37
	sub	sp, sp, #12
	ldr	r7, [r3]
	mov	r6, r0
	mov	r4, r1
	ldr	r0, .L37+4
	mov	r1, #0
	str	r2, [sp, #4]
	bl	spin_lock_irqsave
	subs	r3, r5, #0
	movne	r3, #1
	cmp	r7, #0
	moveq	r3, #0
	cmp	r3, #0
	beq	.L15
	ldr	r8, .L37+8
	ldr	r10, .L37+12
	ldr	fp, .L37+16
	str	r5, [sp]
.L12:
	ldr	r3, .L37+20
	ldr	r0, [r3]
	add	r0, r6, r0
	bl	inb
	ldr	r3, .L37+24
	mov	r5, r0
	ldr	r3, [r3]
	cmp	r3, #0
	cmpne	r0, #3
	bhi	.L34
	cmp	r0, #0
	beq	.L5
	ldr	r3, [sp]
	ldr	r9, .L37+28
	sub	r3, r3, r0
	str	r3, [sp]
	add	r5, r4, r0
.L6:
	ldr	r0, [r9]
	add	r0, r6, r0
	bl	inb
	strb	r0, [r4], #1
	cmp	r5, r4
	bne	.L6
	ldr	r3, [sp]
	cmp	r3, #0
	cmpne	r7, #0
	bne	.L12
.L14:
	ldm	sp, {r2, r3}
	sub	r4, r3, r2
.L2:
	mov	r1, #0
	ldr	r0, .L37+4
	bl	spin_unlock_irqrestore
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	ldr	r3, .L37+32
	mov	r1, r0
	ldr	r3, [r3]
	ldr	r0, .L37+4
	add	r5, r7, r3
	bl	spin_unlock_irqrestore
	b	.L7
.L36:
	ldr	r0, [r8]
	add	r0, r6, r0
	bl	inb
	ldr	r3, [r10]
	tst	r0, r3
	beq	.L9
	cmp	r7, #0
	beq	.L35
	ldr	r0, [r8]
	add	r0, r6, r0
	bl	inb
	ldr	r3, [fp]
	tst	r0, r3
	movne	r7, #0
.L7:
	ldr	r3, .L37+32
	mov	r1, r5
	ldr	r0, [r3]
	bl	time_before
	cmp	r0, #0
	bne	.L36
.L9:
	mov	r1, #0
	ldr	r0, .L37+4
	bl	spin_lock_irqsave
	ldr	r0, [r8]
	add	r0, r6, r0
	bl	inb
	ldr	r3, [r10]
	tst	r0, r3
	bne	.L14
	ldr	r3, [sp]
	cmp	r3, #0
	cmpne	r7, #0
	bne	.L12
	b	.L14
.L34:
	ldr	r9, .L37+28
	lsr	r2, r0, #2
	ldr	r0, [r9]
	mov	r1, r4
	add	r0, r6, r0
	bl	insl
	ldr	r3, [sp]
	and	r5, r5, #252
	sub	r3, r3, r5
	str	r3, [sp]
	ldr	r3, [sp]
	add	r4, r4, r5
	cmp	r3, #0
	cmpne	r7, #0
	bne	.L12
	b	.L14
.L35:
	mov	r1, r7
	ldr	r0, .L37+4
	bl	spin_lock_irqsave
	ldr	r0, [r8]
	add	r0, r6, r0
	bl	inb
	b	.L14
.L15:
	mov	r4, r3
	b	.L2
.L38:
	.align	2
.L37:
	.word	READ_TIMEOUT
	.word	sym53c416_lock
	.word	PIO_INT_REG
	.word	EMPTY
	.word	SCI
	.word	PIO_FIFO_CNT
	.word	fastpio
	.word	PIO_FIFO_1
	.word	jiffies
	.size	sym53c416_read, .-sym53c416_read
	.comm	sym53c416_lock,4,4
	.comm	jiffies,4,4
	.comm	fastpio,4,4
	.comm	SCI,4,4
	.comm	READ_TIMEOUT,4,4
	.comm	PIO_INT_REG,4,4
	.comm	PIO_FIFO_CNT,4,4
	.comm	PIO_FIFO_1,4,4
	.comm	EMPTY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
