	.file	"97013359.c"
	.intel_syntax noprefix
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	add	rsp, -128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -116[rbp]
	mov	edi, eax
	call	putchar@PLT
.L2:
	lea	rax, -112[rbp]
	mov	rdi, rax
	call	getop
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], -1
	jne	.L3
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	getop
	.type	getop, @function
getop:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	nop
.L7:
	call	getch
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 32
	je	.L7
	cmp	DWORD PTR -20[rbp], 9
	je	.L7
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 1
	mov	BYTE PTR [rax], 0
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 2048
	test	eax, eax
	jne	.L8
	cmp	DWORD PTR -20[rbp], 46
	je	.L8
	mov	eax, DWORD PTR -20[rbp]
	jmp	.L9
.L8:
	mov	DWORD PTR -24[rbp], 0
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 2048
	test	eax, eax
	je	.L10
	nop
.L11:
	call	__ctype_b_loc@PLT
	mov	rbx, QWORD PTR [rax]
	call	getch
	mov	DWORD PTR -20[rbp], eax
	add	DWORD PTR -24[rbp], 1
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -20[rbp]
	mov	BYTE PTR [rax], dl
	movzx	eax, BYTE PTR [rax]
	movsx	rax, al
	add	rax, rax
	add	rax, rbx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 2048
	test	eax, eax
	jne	.L11
.L10:
	cmp	DWORD PTR -20[rbp], 46
	jne	.L12
	nop
.L13:
	call	__ctype_b_loc@PLT
	mov	rbx, QWORD PTR [rax]
	call	getch
	mov	DWORD PTR -20[rbp], eax
	add	DWORD PTR -24[rbp], 1
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -20[rbp]
	mov	BYTE PTR [rax], dl
	movzx	eax, BYTE PTR [rax]
	movsx	rax, al
	add	rax, rax
	add	rax, rbx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 2048
	test	eax, eax
	jne	.L13
.L12:
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	cmp	DWORD PTR -20[rbp], -1
	je	.L14
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	ungetch
.L14:
	mov	eax, 48
.L9:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getop, .-getop
	.globl	flag
	.bss
	.align 4
	.type	flag, @object
	.size	flag, 4
flag:
	.zero	4
	.globl	last
	.align 4
	.type	last, @object
	.size	last, 4
last:
	.zero	4
	.text
	.globl	getch
	.type	getch, @function
getch:
.LFB2:
	.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 flag[rip]
	test	eax, eax
	jne	.L16
	call	getchar@PLT
	jmp	.L17
.L16:
	mov	DWORD PTR flag[rip], 0
	mov	eax, DWORD PTR last[rip]
.L17:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	getch, .-getch
	.globl	ungetch
	.type	ungetch, @function
ungetch:
.LFB3:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR last[rip], eax
	mov	DWORD PTR flag[rip], 1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	ungetch, .-ungetch
	.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	"97013359.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #112
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	b	.L2
.L3:
	ldr	r0, [fp, #-112]
	bl	putchar
.L2:
	sub	r3, fp, #108
	mov	r0, r3
	bl	getop
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmn	r3, #1
	bne	.L3
	mov	r3, #0
	ldr	r2, .L6
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.size	main, .-main
	.align	2
	.global	getop
	.syntax unified
	.arm
	.fpu softvfp
	.type	getop, %function
getop:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	nop
.L9:
	bl	getch
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	and	r2, r3, #255
	ldr	r3, [fp, #-24]
	strb	r2, [r3]
	ldr	r3, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #32
	beq	.L9
	ldr	r3, [fp, #-16]
	cmp	r3, #9
	beq	.L9
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	mov	r2, #0
	strb	r2, [r3]
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #2048
	cmp	r3, #0
	bne	.L10
	ldr	r3, [fp, #-16]
	cmp	r3, #46
	beq	.L10
	ldr	r3, [fp, #-16]
	b	.L11
.L10:
	mov	r3, #0
	str	r3, [fp, #-20]
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #2048
	cmp	r3, #0
	beq	.L12
	nop
.L13:
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r4, [r3]
	bl	getch
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	and	r2, r2, #255
	strb	r2, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #1
	add	r3, r4, r3
	ldrh	r3, [r3]
	and	r3, r3, #2048
	cmp	r3, #0
	bne	.L13
.L12:
	ldr	r3, [fp, #-16]
	cmp	r3, #46
	bne	.L14
	nop
.L15:
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r4, [r3]
	bl	getch
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	and	r2, r2, #255
	strb	r2, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #1
	add	r3, r4, r3
	ldrh	r3, [r3]
	and	r3, r3, #2048
	cmp	r3, #0
	bne	.L15
.L14:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	beq	.L16
	ldr	r0, [fp, #-16]
	bl	ungetch
.L16:
	mov	r3, #48
.L11:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
	.size	getop, .-getop
	.comm	flag,4,4
	.comm	last,4,4
	.align	2
	.global	getch
	.syntax unified
	.arm
	.fpu softvfp
	.type	getch, %function
getch:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L20
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L18
	bl	getchar
	mov	r3, r0
	b	.L19
.L18:
	ldr	r3, .L20
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L20+4
	ldr	r3, [r3]
.L19:
	mov	r0, r3
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	flag
	.word	last
	.size	getch, .-getch
	.align	2
	.global	ungetch
	.syntax unified
	.arm
	.fpu softvfp
	.type	ungetch, %function
ungetch:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r2, .L23
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	ldr	r3, .L23+4
	mov	r2, #1
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L24:
	.align	2
.L23:
	.word	last
	.word	flag
	.size	ungetch, .-ungetch
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
