	.file	"extr_goldfish.c_goldfish_tty_rw.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"tty: DMA mapping error.\n"
	.text
	.p2align 4
	.type	goldfish_tty_rw, @function
goldfish_tty_rw:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	test	ecx, ecx
	mov	r13d, DWORD PTR DMA_TO_DEVICE[rip]
	cmove	r13d, DWORD PTR DMA_FROM_DEVICE[rip]
	cmp	QWORD PTR [rdi], 0
	mov	DWORD PTR 12[rsp], ecx
	jle	.L4
	mov	edx, edx
	lea	rbx, [rdx+rsi]
	cmp	rsi, rbx
	jb	.L8
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	ecx, DWORD PTR 12[rsp]
	mov	edx, r14d
	mov	rsi, r12
	mov	rdi, r15
	call	do_rw_io@PLT
	mov	edi, DWORD PTR 8[r15]
	mov	ecx, r13d
	mov	rdx, r14
	mov	rsi, r12
	call	dma_unmap_single@PLT
	cmp	rbx, rbp
	jbe	.L1
.L8:
	mov	rsi, rbp
	mov	rbp, QWORD PTR PAGE_MASK[rip]
	mov	edi, DWORD PTR 8[r15]
	mov	ecx, r13d
	and	rbp, rsi
	add	rbp, QWORD PTR PAGE_SIZE[rip]
	cmp	rbp, rbx
	cmova	rbp, rbx
	mov	r14, rbp
	sub	r14, rsi
	mov	rdx, r14
	call	dma_map_single@PLT
	mov	edi, DWORD PTR 8[r15]
	mov	rsi, rax
	mov	r12, rax
	call	dma_mapping_error@PLT
	test	rax, rax
	je	.L7
	mov	edi, DWORD PTR 8[r15]
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	lea	rsi, .LC0[rip]
	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
	jmp	dev_err@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_restore_state
	add	rsp, 24
	.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
.L4:
	.cfi_restore_state
	mov	ecx, DWORD PTR 12[rsp]
	add	rsp, 24
	.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
	jmp	do_rw_io@PLT
	.cfi_endproc
.LFE0:
	.size	goldfish_tty_rw, .-goldfish_tty_rw
	.comm	PAGE_SIZE,8,8
	.comm	PAGE_MASK,8,8
	.comm	DMA_TO_DEVICE,4,4
	.comm	DMA_FROM_DEVICE,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_goldfish.c_goldfish_tty_rw.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"tty: DMA mapping error.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	goldfish_tty_rw, %function
goldfish_tty_rw:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	cmp	r3, #0
	sub	sp, sp, #12
	str	r3, [sp, #4]
	ldrne	r3, .L13
	ldreq	r3, .L13+4
	mov	r5, r0
	ldr	r7, [r3]
	ldr	r3, [r0]
	mov	r4, r1
	cmp	r3, #0
	ble	.L4
	add	r6, r1, r2
	cmp	r1, r6
	bcs	.L1
	ldr	r10, .L13+8
	ldr	r9, .L13+12
	b	.L8
.L7:
	mov	r2, r8
	mov	r1, fp
	ldr	r3, [sp, #4]
	mov	r0, r5
	bl	do_rw_io
	mov	r3, r7
	mov	r2, r8
	mov	r1, fp
	ldr	r0, [r5, #4]
	bl	dma_unmap_single
	cmp	r6, r4
	bls	.L1
.L8:
	ldr	r3, [r10]
	ldr	r2, [r9]
	and	r3, r3, r4
	add	r3, r3, r2
	cmp	r3, r6
	mov	r1, r4
	movcc	r4, r3
	movcs	r4, r6
	sub	r8, r4, r1
	mov	r2, r8
	mov	r3, r7
	ldr	r0, [r5, #4]
	bl	dma_map_single
	mov	fp, r0
	ldr	r0, [r5, #4]
	mov	r1, fp
	bl	dma_mapping_error
	cmp	r0, #0
	beq	.L7
	ldr	r0, [r5, #4]
	ldr	r1, .L13+16
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	dev_err
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r3, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	do_rw_io
.L14:
	.align	2
.L13:
	.word	DMA_TO_DEVICE
	.word	DMA_FROM_DEVICE
	.word	PAGE_MASK
	.word	PAGE_SIZE
	.word	.LC0
	.size	goldfish_tty_rw, .-goldfish_tty_rw
	.comm	PAGE_SIZE,4,4
	.comm	PAGE_MASK,4,4
	.comm	DMA_TO_DEVICE,4,4
	.comm	DMA_FROM_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
