	.file	"extr_sh.lex.c_bgetc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	bgetc, @function
bgetc:
.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, 8
	.cfi_def_cfa_offset 64
	cmp	QWORD PTR cantell[rip], 0
	mov	rsi, QWORD PTR fseekp[rip]
	je	.L2
	cmp	QWORD PTR fbobp[rip], rsi
	jg	.L3
	mov	rax, QWORD PTR feobp[rip]
	cmp	rax, rsi
	jl	.L3
	mov	rdx, QWORD PTR fbuf[rip]
	mov	r8, QWORD PTR [rdx]
	cmp	rsi, rax
	je	.L30
.L5:
	mov	rax, rsi
	add	rsi, 1
	sub	rax, QWORD PTR fbobp[rip]
	movzx	eax, BYTE PTR [r8+rax]
	mov	QWORD PTR fseekp[rip], rsi
	add	rsp, 8
	.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
.L9:
	.cfi_restore_state
	test	ebx, ebx
	je	.L13
	.p2align 4,,10
	.p2align 3
.L34:
	mov	esi, DWORD PTR errno[rip]
	mov	edi, DWORD PTR SHIN[rip]
	call	fixio@PLT
	cmp	eax, -1
	je	.L13
	mov	rsi, QWORD PTR fseekp[rip]
.L2:
	mov	rax, QWORD PTR feobp[rip]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L33:
	cdqe
	add	rax, QWORD PTR feobp[rip]
	mov	QWORD PTR feobp[rip], rax
.L12:
	mov	rsi, QWORD PTR fseekp[rip]
.L15:
	cmp	rsi, rax
	jl	.L31
	cmp	QWORD PTR editing[rip], 0
	je	.L8
	cmp	QWORD PTR intty[rip], 0
	jne	.L32
.L8:
	cdq
	idiv	DWORD PTR BUFSIZE[rip]
	mov	edi, eax
	mov	ebx, edx
	mov	r12d, eax
	call	balloc@PLT
	mov	rcx, QWORD PTR fbuf[rip]
	movsx	rax, r12d
	mov	edx, DWORD PTR BUFSIZE[rip]
	mov	edi, DWORD PTR SHIN[rip]
	movsx	rsi, ebx
	sub	edx, ebx
	add	rsi, QWORD PTR [rcx+rax*8]
	xor	ecx, ecx
	call	wide_read@PLT
	mov	ebx, eax
	test	eax, eax
	jg	.L33
	test	ebx, ebx
	jne	.L34
.L13:
	movzx	eax, BYTE PTR CHAR_ERR[rip]
	add	rsp, 8
	.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
.L32:
	.cfi_restore_state
	mov	QWORD PTR fseekp[rip], rax
	xor	eax, eax
	call	Inputl@PLT
	mov	ebx, eax
	test	eax, eax
	jle	.L9
	movsx	r14, ebx
	mov	rax, QWORD PTR feobp[rip]
	mov	r13, r14
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L35:
	movsx	r14, ebx
.L10:
	cdq
	idiv	DWORD PTR BUFSIZE[rip]
	mov	edi, eax
	mov	r15d, edx
	mov	r12d, eax
	call	balloc@PLT
	mov	ebp, DWORD PTR BUFSIZE[rip]
	movsx	rax, r12d
	movsx	rdi, r15d
	mov	rsi, QWORD PTR InputBuf[rip]
	mov	rdx, QWORD PTR fbuf[rip]
	sub	ebp, r15d
	cmp	ebp, ebx
	cmovg	ebp, ebx
	add	rsi, r13
	add	rdi, QWORD PTR [rdx+rax*8]
	sub	rsi, r14
	mov	edx, ebp
	sub	ebx, ebp
	call	memcpy@PLT
	movsx	rax, ebp
	add	rax, QWORD PTR feobp[rip]
	mov	QWORD PTR feobp[rip], rax
	test	ebx, ebx
	jg	.L35
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edx, DWORD PTR L_SET[rip]
	mov	edi, DWORD PTR SHIN[rip]
	mov	QWORD PTR feobp[rip], rsi
	mov	QWORD PTR fbobp[rip], rsi
	call	lseek@PLT
	mov	rdx, QWORD PTR fbuf[rip]
	mov	rsi, QWORD PTR fseekp[rip]
	mov	rax, QWORD PTR feobp[rip]
	mov	r8, QWORD PTR [rdx]
	cmp	rsi, rax
	jne	.L5
.L30:
	mov	edx, DWORD PTR BUFSIZE[rip]
	mov	edi, DWORD PTR SHIN[rip]
	mov	ecx, 1
	mov	QWORD PTR fbobp[rip], rsi
	mov	rsi, r8
	call	wide_read@PLT
	test	eax, eax
	jle	.L13
	cdqe
	add	QWORD PTR feobp[rip], rax
	mov	rax, QWORD PTR fbuf[rip]
	mov	rsi, QWORD PTR fseekp[rip]
	mov	r8, QWORD PTR [rax]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L31:
	mov	eax, esi
	mov	rcx, QWORD PTR fbuf[rip]
	add	rsi, 1
	cdq
	idiv	DWORD PTR BUFSIZE[rip]
	cdqe
	movsx	rdx, edx
	mov	rax, QWORD PTR [rcx+rax*8]
	movzx	eax, BYTE PTR [rax+rdx]
	mov	QWORD PTR fseekp[rip], rsi
	add	rsp, 8
	.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
	.cfi_endproc
.LFE0:
	.size	bgetc, .-bgetc
	.comm	windowchg,8,8
	.comm	progname,4,4
	.comm	intty,8,8
	.comm	fseekp,8,8
	.comm	filec,8,8
	.comm	feobp,8,8
	.comm	fclens,8,8
	.comm	fbuf,8,8
	.comm	fbobp,8,8
	.comm	errno,4,4
	.comm	editing,8,8
	.comm	cantell,8,8
	.comm	SHIN,4,4
	.comm	L_SET,4,4
	.comm	InputBuf,8,8
	.comm	ERR_SYSTEM,4,4
	.comm	CHAR_ERR,1,1
	.comm	BUFSIZE,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_sh.lex.c_bgetc.c"
	.text
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bgetc, %function
bgetc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L43
	ldr	r2, .L43+4
	ldr	r3, [r3]
	ldr	r5, [r2]
	cmp	r3, #0
	sub	sp, sp, #12
	bne	.L32
	ldr	r7, .L43+8
	ldr	r9, .L43+12
	ldr	r6, .L43+16
	ldr	r8, .L43+20
.L2:
	ldr	r0, [r7]
	ldr	r10, .L43+24
	b	.L15
.L41:
	ldr	r0, [r7]
	add	r0, r5, r0
	str	r0, [r7]
.L12:
	ldr	r3, .L43+4
	ldr	r5, [r3]
.L15:
	cmp	r5, r0
	blt	.L39
	ldr	r3, [r9]
	cmp	r3, #0
	beq	.L8
	ldr	r3, .L43+28
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L40
.L8:
	ldr	r1, [r6]
	bl	__aeabi_idivmod
	mov	r5, r0
	mov	r4, r1
	bl	balloc
	ldr	r3, [r8]
	ldr	r2, [r6]
	ldr	r1, [r3, r5, lsl #2]
	ldr	r0, .L43+32
	mov	r3, #0
	ldr	r0, [r0]
	sub	r2, r2, r4
	add	r1, r1, r4
	bl	wide_read
	subs	r5, r0, #0
	bgt	.L41
.L9:
	cmp	r5, #0
	beq	.L13
	ldr	r3, .L43+36
	ldr	r2, .L43+32
	ldr	r1, [r3]
	ldr	r0, [r2]
	bl	fixio
	cmn	r0, #1
	beq	.L13
	ldr	r3, .L43+4
	ldr	r5, [r3]
	b	.L2
.L40:
	ldr	r3, .L43+4
	str	r0, [r3]
	bl	Inputl
	subs	r5, r0, #0
	ble	.L9
	mov	fp, r5
	ldr	r0, [r7]
	str	r5, [sp, #4]
.L10:
	ldr	r1, [r6]
	bl	__aeabi_idivmod
	mov	r5, r1
	str	r0, [sp]
	bl	balloc
	ldr	r4, [r6]
	ldr	r3, [sp]
	sub	r4, r4, r5
	cmp	r4, fp
	movge	r4, fp
	ldr	r0, [r8]
	ldr	r2, [r10]
	ldr	r0, [r0, r3, lsl #2]
	ldr	r3, [sp, #4]
	add	r0, r0, r5
	add	r3, r3, r2
	sub	r1, r3, fp
	mov	r2, r4
	bl	memcpy
	ldr	r0, [r7]
	sub	fp, fp, r4
	add	r0, r4, r0
	cmp	fp, #0
	str	r0, [r7]
	bgt	.L10
	b	.L12
.L32:
	ldr	r4, .L43+40
	ldr	r7, .L43+8
	ldr	r3, [r4]
	cmp	r3, r5
	bgt	.L3
	ldr	r3, [r7]
	cmp	r3, r5
	blt	.L3
.L4:
	ldr	r6, .L43+20
	cmp	r5, r3
	ldr	r3, [r6]
	ldr	r1, [r3]
	beq	.L42
.L5:
	ldr	r3, [r4]
	add	r2, r5, #1
	sub	r5, r5, r3
	ldrb	r0, [r1, r5]	@ zero_extendqisi2
	ldr	r3, .L43+4
	str	r2, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	ldr	r3, .L43+32
	ldr	r2, .L43+44
	mov	r1, r5
	ldr	r0, [r3]
	ldr	r2, [r2]
	str	r5, [r7]
	str	r5, [r4]
	bl	lseek
	ldr	r3, .L43+4
	ldr	r5, [r3]
	ldr	r3, [r7]
	b	.L4
.L13:
	ldr	r3, .L43+48
	ldrb	r0, [r3]	@ zero_extendqisi2
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L39:
	ldr	r2, .L43+16
	ldr	r3, .L43+20
	mov	r0, r5
	ldr	r1, [r2]
	ldr	r4, [r3]
	bl	__aeabi_idivmod
	ldr	r3, [r4, r0, lsl #2]
	add	r5, r5, #1
	ldrb	r0, [r3, r1]	@ zero_extendqisi2
	ldr	r3, .L43+4
	str	r5, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L42:
	ldr	r3, .L43+32
	ldr	r2, .L43+16
	ldr	r0, [r3]
	ldr	r2, [r2]
	mov	r3, #1
	str	r5, [r4]
	bl	wide_read
	cmp	r0, #0
	ble	.L13
	ldr	r3, [r7]
	ldr	r2, [r6]
	add	r0, r3, r0
	ldr	r3, .L43+4
	ldr	r1, [r2]
	ldr	r5, [r3]
	str	r0, [r7]
	b	.L5
.L44:
	.align	2
.L43:
	.word	cantell
	.word	fseekp
	.word	feobp
	.word	editing
	.word	BUFSIZE
	.word	fbuf
	.word	InputBuf
	.word	intty
	.word	SHIN
	.word	errno
	.word	fbobp
	.word	L_SET
	.word	CHAR_ERR
	.size	bgetc, .-bgetc
	.comm	windowchg,4,4
	.comm	progname,4,4
	.comm	intty,4,4
	.comm	fseekp,4,4
	.comm	filec,4,4
	.comm	feobp,4,4
	.comm	fclens,4,4
	.comm	fbuf,4,4
	.comm	fbobp,4,4
	.comm	errno,4,4
	.comm	editing,4,4
	.comm	cantell,4,4
	.comm	SHIN,4,4
	.comm	L_SET,4,4
	.comm	InputBuf,4,4
	.comm	ERR_SYSTEM,4,4
	.comm	CHAR_ERR,1,1
	.comm	BUFSIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
