	.file	"extr_io_bfdbg.c___write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	__write, @function
__write:
.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
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	test	rsi, rsi
	je	.L4
	mov	r12, QWORD PTR [rsi]
	mov	rbp, rsi
	test	r12, r12
	je	.L4
	mov	rbx, rdi
	mov	rsi, QWORD PTR [r12]
	mov	edi, DWORD PTR [rdi]
	mov	r14, rdx
	mov	r13d, ecx
	call	is_in_base@PLT
	test	rax, rax
	jne	.L18
	mov	rsi, QWORD PTR [r12]
	mov	edi, DWORD PTR [rbx]
	call	is_in_screen@PLT
	test	rax, rax
	je	.L6
	mov	rax, QWORD PTR [r12]
	mov	edi, DWORD PTR [rbx]
	sub	edi, DWORD PTR 4[rax]
	cmp	r13d, edi
	jl	.L19
.L7:
	movsx	rdi, edi
	mov	edx, r13d
	add	rdi, QWORD PTR 32[rax]
	mov	rsi, r14
	call	memcpy@PLT
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L6:
	.cfi_restore_state
	mov	rsi, QWORD PTR [r12]
	mov	edi, DWORD PTR [rbx]
	call	is_in_input@PLT
	test	rax, rax
	je	.L8
	mov	rax, QWORD PTR [r12]
	mov	edi, DWORD PTR [rbx]
	sub	edi, DWORD PTR 12[rax]
	cmp	r13d, edi
	jge	.L9
	mov	r13d, DWORD PTR 16[rax]
	sub	r13d, edi
.L9:
	mov	edx, r13d
	mov	rsi, r14
	movsx	rdi, edi
	add	rdi, QWORD PTR 24[rax]
	call	memcpy@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L18:
	.cfi_restore_state
	mov	rax, QWORD PTR [r12]
	mov	edi, DWORD PTR [rbx]
	mov	rsi, r14
	sub	edi, DWORD PTR [rax]
	cmp	r13d, edi
	cmovl	r13d, edi
	movsx	rdi, edi
	add	rdi, QWORD PTR 40[rax]
	mov	edx, r13d
	call	memcpy@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L19:
	.cfi_restore_state
	mov	r13d, DWORD PTR 8[rax]
	sub	r13d, edi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, rbp
	call	RIOBFDBG_SZ@PLT
	mov	edx, DWORD PTR [rbx]
	mov	ecx, eax
	lea	esi, [rdx+r13]
	sub	ecx, edx
	cmp	esi, eax
	cmovge	r13d, ecx
	cmp	edx, eax
	jge	.L4
	mov	rdi, rbp
	call	RIOBFDBG_BUF@PLT
	movsx	rdi, DWORD PTR [rbx]
	mov	edx, r13d
	mov	rsi, r14
	add	rdi, rax
	call	memcpy@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L4:
	.cfi_restore_state
	mov	r13d, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	__write, .-__write
	.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_io_bfdbg.c___write.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	__write, %function
__write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	subs	r8, r1, #0
	beq	.L4
	ldr	r6, [r8]
	cmp	r6, #0
	beq	.L4
	mov	r5, r0
	ldr	r1, [r6]
	ldr	r0, [r0]
	mov	r7, r2
	mov	r4, r3
	bl	is_in_base
	cmp	r0, #0
	bne	.L18
	ldr	r1, [r6]
	ldr	r0, [r5]
	bl	is_in_screen
	cmp	r0, #0
	beq	.L6
	ldr	r2, [r6]
	ldr	r3, [r5]
	ldr	r0, [r2, #4]
	mov	r1, r7
	sub	r3, r3, r0
	cmp	r4, r3
	ldrlt	r4, [r2, #8]
	ldr	r0, [r2, #24]
	sublt	r4, r4, r3
	mov	r2, r4
	add	r0, r3, r0
	bl	memcpy
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L6:
	ldr	r1, [r6]
	ldr	r0, [r5]
	bl	is_in_input
	cmp	r0, #0
	beq	.L8
	ldr	r2, [r6]
	ldr	r3, [r5]
	ldr	r0, [r2, #12]
	mov	r1, r7
	sub	r3, r3, r0
	cmp	r4, r3
	ldrlt	r4, [r2, #16]
	ldr	r0, [r2, #20]
	sublt	r4, r4, r3
	mov	r2, r4
	add	r0, r3, r0
	bl	memcpy
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L18:
	ldr	r2, [r6]
	ldr	r3, [r5]
	ldr	r1, [r2]
	ldr	r0, [r2, #28]
	sub	r3, r3, r1
	cmp	r4, r3
	movlt	r4, r3
	mov	r1, r7
	mov	r2, r4
	add	r0, r3, r0
	bl	memcpy
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	mov	r0, r8
	bl	RIOBFDBG_SZ
	ldr	r3, [r5]
	add	r2, r3, r4
	cmp	r2, r0
	subge	r4, r0, r3
	cmp	r3, r0
	bge	.L4
	mov	r0, r8
	bl	RIOBFDBG_BUF
	ldr	r3, [r5]
	mov	r1, r7
	mov	r2, r4
	add	r0, r0, r3
	bl	memcpy
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	mvn	r4, #0
	b	.L1
	.size	__write, .-__write
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
