	.file	"extr_window-copy.c_window_copy_copy_line.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	window_copy_copy_line, @function
window_copy_copy_line:
.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
	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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	cmp	r8, r9
	mov	QWORD PTR [rsp], r8
	jle	.L26
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L27
	add	rsp, 88
	.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
.L26:
	.cfi_restore_state
	mov	rax, QWORD PTR [rdi]
	mov	r14, rdi
	mov	r12, rsi
	mov	rsi, rcx
	mov	rbx, rdx
	mov	rbp, rcx
	mov	r15, r9
	mov	rax, QWORD PTR [rax]
	mov	r13, QWORD PTR [rax]
	mov	rdi, r13
	call	grid_get_line@PLT
	mov	r8, QWORD PTR [rsp]
	mov	edx, DWORD PTR [rax]
	test	DWORD PTR GRID_LINE_WRAPPED[rip], edx
	je	.L3
	mov	rax, QWORD PTR 8[rax]
	cmp	rax, QWORD PTR 0[r13]
	jg	.L3
	cmp	rax, r15
	mov	rdx, r15
	cmovle	rdx, rax
	cmp	rax, r8
	cmovle	r8, rax
	cmp	rax, r15
	mov	QWORD PTR [rsp], rdx
	mov	r14, r8
	setg	BYTE PTR 23[rsp]
	cmp	rdx, r8
	jg	.L5
.L7:
	cmp	BYTE PTR 23[rsp], 0
	je	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rax, QWORD PTR [rbx]
	mov	rdi, QWORD PTR [r12]
	lea	rsi, 1[rax]
	call	xrealloc@PLT
	mov	rdx, QWORD PTR [rbx]
	mov	QWORD PTR [r12], rax
	lea	rcx, 1[rdx]
	mov	QWORD PTR [rbx], rcx
	mov	BYTE PTR [rax+rdx], 10
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, r14
	mov	rsi, rbp
	mov	QWORD PTR 8[rsp], r8
	call	window_copy_find_length@PLT
	mov	r8, QWORD PTR 8[rsp]
	mov	rcx, r15
	mov	BYTE PTR 23[rsp], 1
	cmp	r15, rax
	cmovg	rcx, rax
	cmp	r8, rax
	cmovle	rax, r8
	mov	QWORD PTR [rsp], rcx
	mov	r14, rax
	cmp	rcx, rax
	jle	.L13
.L5:
	lea	rax, 44[rsp]
	lea	r15, 36[rsp]
	mov	QWORD PTR 8[rsp], rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdi, QWORD PTR [r12]
	add	rsi, QWORD PTR [rbx]
	call	xrealloc@PLT
	mov	edx, DWORD PTR 48[rsp]
	mov	rsi, QWORD PTR 56[rsp]
	mov	QWORD PTR [r12], rax
	add	rax, QWORD PTR [rbx]
	mov	rdi, rax
	call	memcpy@PLT
	movsx	rax, DWORD PTR 48[rsp]
	add	QWORD PTR [rbx], rax
.L8:
	add	r14, 1
	cmp	r14, QWORD PTR [rsp]
	jge	.L7
.L12:
	mov	rcx, r15
	mov	rdx, rbp
	mov	rsi, r14
	mov	rdi, r13
	call	grid_get_cell@PLT
	mov	eax, DWORD PTR 36[rsp]
	test	DWORD PTR GRID_FLAG_PADDING[rip], eax
	jne	.L8
	mov	rsi, QWORD PTR 8[rsp]
	lea	rdi, 48[rsp]
	call	utf8_copy@PLT
	movsx	rsi, DWORD PTR 48[rsp]
	cmp	esi, 1
	jne	.L9
	mov	eax, DWORD PTR 40[rsp]
	test	DWORD PTR GRID_ATTR_CHARSET[rip], eax
	je	.L9
	mov	rax, QWORD PTR 56[rsp]
	xor	edi, edi
	movsx	esi, BYTE PTR [rax]
	call	tty_acs_get@PLT
	test	rax, rax
	je	.L24
	mov	rdi, rax
	mov	QWORD PTR 24[rsp], rax
	call	strlen@PLT
	mov	rsi, QWORD PTR 24[rsp]
	cmp	eax, 8
	jbe	.L11
.L24:
	movsx	rsi, DWORD PTR 48[rsp]
	jmp	.L9
.L11:
	mov	rdi, rsi
	mov	QWORD PTR 24[rsp], rsi
	call	strlen@PLT
	mov	rsi, QWORD PTR 24[rsp]
	mov	rdi, QWORD PTR 56[rsp]
	mov	edx, eax
	mov	DWORD PTR 48[rsp], eax
	call	memcpy@PLT
	jmp	.L24
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	window_copy_copy_line, .-window_copy_copy_line
	.comm	GRID_LINE_WRAPPED,4,4
	.comm	GRID_FLAG_PADDING,4,4
	.comm	GRID_ATTR_CHARSET,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_window-copy.c_window_copy_copy_line.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	window_copy_copy_line, %function
window_copy_copy_line:
	@ args = 8, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #36
	ldr	r4, [sp, #72]
	ldr	r10, [sp, #76]
	mov	r6, r3
	ldr	r3, .L29
	cmp	r4, r10
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	ble	.L26
.L1:
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L27
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L26:
	ldr	r3, [r0]
	mov	r9, r0
	ldr	r3, [r3]
	mov	r7, r1
	ldr	r8, [r3]
	mov	r1, r6
	mov	r0, r8
	mov	r5, r2
	bl	grid_get_line
	ldr	r3, .L29+4
	ldr	r2, [r0]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L3
	ldr	r3, [r0, #4]
	ldr	r2, [r8]
	cmp	r3, r2
	bgt	.L3
	cmp	r3, r10
	movlt	r9, r3
	movge	r9, r10
	cmp	r3, r4
	movlt	r4, r3
	cmp	r3, r10
	movle	r3, #0
	movgt	r3, #1
	cmp	r9, r4
	str	r3, [sp, #4]
	bgt	.L5
.L7:
	ldr	r3, [sp, #4]
	cmp	r3, #0
	beq	.L1
.L13:
	ldr	r1, [r5]
	ldr	r0, [r7]
	add	r1, r1, #1
	bl	xrealloc
	mov	r2, #10
	ldr	r3, [r5]
	str	r0, [r7]
	add	r1, r3, #1
	str	r1, [r5]
	strb	r2, [r0, r3]
	b	.L1
.L3:
	mov	r0, r9
	mov	r1, r6
	bl	window_copy_find_length
	cmp	r10, r0
	movlt	r9, r10
	movge	r9, r0
	cmp	r4, r0
	movge	r4, r0
	cmp	r9, r4
	movgt	r3, #1
	strgt	r3, [sp, #4]
	ble	.L13
.L5:
	ldr	r10, .L29+8
	b	.L12
.L9:
	ldr	r1, [r5]
	ldr	r0, [r7]
	add	r1, r3, r1
	bl	xrealloc
	ldr	r3, [r5]
	ldr	r2, [sp, #8]
	str	r0, [r7]
	ldr	r1, [sp, #12]
	add	r0, r0, r3
	bl	memcpy
	ldr	r3, [r5]
	ldr	r2, [sp, #8]
	add	r3, r3, r2
	str	r3, [r5]
.L8:
	add	r4, r4, #1
	cmp	r4, r9
	bge	.L7
.L12:
	add	r3, sp, #16
	mov	r2, r6
	mov	r1, r4
	mov	r0, r8
	bl	grid_get_cell
	ldr	r0, [sp, #16]
	ldr	r3, [r10]
	ands	fp, r0, r3
	bne	.L8
	add	r1, sp, #24
	add	r0, sp, #8
	bl	utf8_copy
	ldr	r3, [sp, #8]
	cmp	r3, #1
	bne	.L9
	ldr	r2, .L29+12
	ldr	r1, [sp, #20]
	ldr	r2, [r2]
	tst	r1, r2
	beq	.L9
	ldr	r3, [sp, #12]
	mov	r0, fp
	ldrb	r1, [r3]	@ zero_extendqisi2
	bl	tty_acs_get
	subs	fp, r0, #0
	beq	.L24
	bl	strlen
	cmp	r0, #4
	mov	r2, r0
	ble	.L28
.L24:
	ldr	r3, [sp, #8]
	b	.L9
.L28:
	mov	r1, fp
	ldr	r0, [sp, #12]
	str	r2, [sp, #8]
	bl	memcpy
	b	.L24
.L27:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	.LC0
	.word	GRID_LINE_WRAPPED
	.word	GRID_FLAG_PADDING
	.word	GRID_ATTR_CHARSET
	.size	window_copy_copy_line, .-window_copy_copy_line
	.comm	GRID_LINE_WRAPPED,4,4
	.comm	GRID_FLAG_PADDING,4,4
	.comm	GRID_ATTR_CHARSET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
