	.file	"891438.c"
	.intel_syntax noprefix
	.text
	.globl	is_interactive
	.bss
	.align 4
	.type	is_interactive, @object
	.size	is_interactive, 4
is_interactive:
	.zero	4
	.globl	orig_state
	.align 32
	.type	orig_state, @object
	.size	orig_state, 60
orig_state:
	.zero	60
	.text
	.globl	init
	.type	init, @function
init:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	isatty@PLT
	mov	DWORD PTR is_interactive[rip], eax
	mov	eax, DWORD PTR is_interactive[rip]
	test	eax, eax
	je	.L4
	lea	rsi, orig_state[rip]
	mov	edi, 0
	call	tcgetattr@PLT
	mov	rax, QWORD PTR orig_state[rip]
	mov	rdx, QWORD PTR orig_state[rip+8]
	mov	QWORD PTR -80[rbp], rax
	mov	QWORD PTR -72[rbp], rdx
	mov	rax, QWORD PTR orig_state[rip+16]
	mov	rdx, QWORD PTR orig_state[rip+24]
	mov	QWORD PTR -64[rbp], rax
	mov	QWORD PTR -56[rbp], rdx
	mov	rax, QWORD PTR orig_state[rip+32]
	mov	rdx, QWORD PTR orig_state[rip+40]
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], rdx
	mov	rax, QWORD PTR orig_state[rip+48]
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR orig_state[rip+56]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	and	eax, -11
	mov	DWORD PTR -68[rbp], eax
	lea	rax, -80[rbp]
	mov	rdx, rax
	mov	esi, 2
	mov	edi, 0
	call	tcsetattr@PLT
.L4:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init, .-init
	.globl	clean_exit
	.type	clean_exit, @function
clean_exit:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR is_interactive[rip]
	test	eax, eax
	je	.L7
	lea	rdx, orig_state[rip]
	mov	esi, 2
	mov	edi, 0
	call	tcsetattr@PLT
.L7:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	clean_exit, .-clean_exit
	.section	.rodata
	.align 8
.LC0:
	.string	"ship: Could not allocate memory for input buffer.\n"
.LC1:
	.string	"%% "
.LC2:
	.string	"\n%s"
	.align 8
.LC3:
	.string	"ship: Could not allocate memory for                                         input buffer.\n"
	.align 8
.LC4:
	.string	"\r\033[2K%% %s\0337\t\t(char:%d pos%d)\0338"
	.text
	.globl	parse_interactive
	.type	parse_interactive, @function
parse_interactive:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], 1
	mov	DWORD PTR -16[rbp], 1024
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 50
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, -1
	call	exit@PLT
.L9:
	mov	DWORD PTR -12[rbp], 0
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L10
.L17:
	mov	rax, QWORD PTR stdin[rip]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -21[rbp], al
	cmp	BYTE PTR -21[rbp], 127
	jne	.L11
	cmp	DWORD PTR -12[rbp], 0
	jle	.L12
	sub	DWORD PTR -12[rbp], 1
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	jmp	.L12
.L11:
	cmp	BYTE PTR -21[rbp], 10
	jne	.L13
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -20[rbp], 0
	jmp	.L10
.L13:
	cmp	BYTE PTR -21[rbp], -1
	je	.L14
	cmp	BYTE PTR -21[rbp], 4
	jne	.L15
.L14:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L10
.L15:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -21[rbp]
	mov	BYTE PTR [rdx], al
	add	DWORD PTR -12[rbp], 1
.L12:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -16[rbp]
	jl	.L16
	add	DWORD PTR -16[rbp], 1024
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L16
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 90
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	edi, -1
	call	exit@PLT
.L16:
	movsx	edx, BYTE PTR -21[rbp]
	mov	ecx, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
.L10:
	cmp	DWORD PTR -20[rbp], 0
	jne	.L17
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	parse_interactive, .-parse_interactive
	.globl	repl
	.type	repl, @function
repl:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	parse_interactive
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	repl, .-repl
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, 0
	call	init
	mov	eax, 0
	call	repl
	mov	eax, 0
	call	clean_exit
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"891438.c"
	.text
	.comm	is_interactive,4,4
	.comm	orig_state,60,4
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	init
	.syntax unified
	.arm
	.fpu softvfp
	.type	init, %function
init:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	ldr	r3, .L5
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #0
	bl	isatty
	mov	r3, r0
	ldr	r2, .L5+4
	str	r3, [r2]
	ldr	r3, .L5+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L4
	ldr	r1, .L5+8
	mov	r0, #0
	bl	tcgetattr
	ldr	r3, .L5+8
	sub	ip, fp, #68
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	ldr	r3, [fp, #-56]
	bic	r3, r3, #10
	str	r3, [fp, #-56]
	sub	r3, fp, #68
	mov	r2, r3
	mov	r1, #2
	mov	r0, #0
	bl	tcsetattr
.L4:
	nop
	ldr	r3, .L5
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	is_interactive
	.word	orig_state
	.size	init, .-init
	.align	2
	.global	clean_exit
	.syntax unified
	.arm
	.fpu softvfp
	.type	clean_exit, %function
clean_exit:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L10
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L9
	ldr	r2, .L10+4
	mov	r1, #2
	mov	r0, #0
	bl	tcsetattr
.L9:
	nop
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	is_interactive
	.word	orig_state
	.size	clean_exit, .-clean_exit
	.section	.rodata
	.align	2
.LC1:
	.ascii	"ship: Could not allocate memory for input buffer.\012"
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"%% \000"
	.align	2
.LC3:
	.ascii	"\012%s\000"
	.align	2
.LC4:
	.ascii	"ship: Could not allocate memory for                "
	.ascii	"                         input buffer.\012\000"
	.align	2
.LC5:
	.ascii	"\015\033[2K%% %s\0337\011\011(char:%d pos%d)\0338\000"
	.text
	.align	2
	.global	parse_interactive
	.syntax unified
	.arm
	.fpu softvfp
	.type	parse_interactive, %function
parse_interactive:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	mov	r3, #1
	str	r3, [fp, #-20]
	mov	r3, #1024
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L13
	ldr	r3, .L21
	ldr	r3, [r3]
	mov	r2, #50
	mov	r1, #1
	ldr	r0, .L21+4
	bl	fwrite
	mvn	r0, #0
	bl	exit
.L13:
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r0, .L21+8
	bl	printf
	b	.L14
.L20:
	ldr	r3, .L21+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-21]
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #127
	bne	.L15
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	ble	.L16
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	b	.L16
.L15:
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L17
	ldr	r1, [fp, #-12]
	ldr	r0, .L21+16
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L14
.L17:
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #4
	bne	.L18
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L14
.L18:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldrb	r2, [fp, #-21]
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L16:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L19
	ldr	r3, [fp, #-16]
	add	r3, r3, #1024
	str	r3, [fp, #-16]
	mov	r1, #1024
	ldr	r0, [fp, #-12]
	bl	realloc
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L21
	ldr	r3, [r3]
	mov	r2, #90
	mov	r1, #1
	ldr	r0, .L21+20
	bl	fwrite
	mvn	r0, #0
	bl	exit
.L19:
	ldrb	r2, [fp, #-21]	@ zero_extendqisi2
	ldr	r3, [fp, #-8]
	ldr	r1, [fp, #-12]
	ldr	r0, .L21+24
	bl	printf
	ldr	r3, .L21+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
.L14:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L20
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	stdin
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	stdout
	.size	parse_interactive, .-parse_interactive
	.align	2
	.global	repl
	.syntax unified
	.arm
	.fpu softvfp
	.type	repl, %function
repl:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r0, [fp, #-8]
	bl	parse_interactive
	ldr	r0, [fp, #-8]
	bl	free
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	repl, .-repl
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	bl	init
	bl	repl
	bl	clean_exit
	mov	r0, #0
	bl	exit
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
