	.file	"51700550.c"
	.intel_syntax noprefix
	.text
	.globl	code
	.bss
	.align 32
	.type	code, @object
	.size	code, 2048
code:
	.zero	2048
	.text
	.globl	readchar
	.type	readchar, @function
readchar:
.LFB0:
	.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
.L4:
	call	getchar@PLT
	mov	BYTE PTR -1[rbp], al
	cmp	BYTE PTR -1[rbp], 13
	je	.L4
	cmp	BYTE PTR -1[rbp], 10
	je	.L4
	movsx	eax, BYTE PTR -1[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	readchar, .-readchar
	.globl	readcodes
	.type	readcodes, @function
readcodes:
.LFB1:
	.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	edx, 2048
	mov	esi, 0
	lea	rdi, code[rip]
	call	memset@PLT
	mov	eax, 0
	call	readchar
	mov	BYTE PTR code[rip+256], al
	mov	DWORD PTR -8[rbp], 2
	jmp	.L7
.L14:
	mov	DWORD PTR -4[rbp], 0
	jmp	.L8
.L13:
	call	getchar@PLT
	mov	BYTE PTR -9[rbp], al
	cmp	BYTE PTR -9[rbp], -1
	jne	.L9
	mov	eax, 0
	jmp	.L10
.L9:
	cmp	BYTE PTR -9[rbp], 10
	je	.L11
	cmp	BYTE PTR -9[rbp], 13
	jne	.L12
.L11:
	mov	eax, 1
	jmp	.L10
.L12:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 8
	add	rdx, rax
	lea	rax, code[rip]
	add	rdx, rax
	movzx	eax, BYTE PTR -9[rbp]
	mov	BYTE PTR [rdx], al
	add	DWORD PTR -4[rbp], 1
.L8:
	mov	eax, DWORD PTR -8[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	sub	eax, 1
	cmp	DWORD PTR -4[rbp], eax
	jl	.L13
	add	DWORD PTR -8[rbp], 1
.L7:
	cmp	DWORD PTR -8[rbp], 7
	jle	.L14
	mov	eax, 1
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	readcodes, .-readcodes
	.globl	readint
	.type	readint, @function
readint:
.LFB2:
	.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	DWORD PTR -36[rbp], edi
	mov	DWORD PTR -20[rbp], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -20[rbp]
	lea	ebx, [rax+rax]
	mov	eax, 0
	call	readchar
	add	eax, ebx
	sub	eax, 48
	mov	DWORD PTR -20[rbp], eax
.L16:
	mov	eax, DWORD PTR -36[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -36[rbp], edx
	test	eax, eax
	jne	.L17
	mov	eax, DWORD PTR -20[rbp]
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	readint, .-readint
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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], edi
	mov	QWORD PTR -32[rbp], rsi
	jmp	.L20
.L25:
	mov	edi, 3
	call	readint
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], 0
	je	.L29
.L21:
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	readint
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	sub	eax, 1
	cmp	DWORD PTR -4[rbp], eax
	je	.L30
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 8
	add	rdx, rax
	lea	rax, code[rip]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	jmp	.L21
.L30:
	nop
	jmp	.L25
.L29:
	nop
	mov	edi, 10
	call	putchar@PLT
.L20:
	mov	eax, 0
	call	readcodes
	test	eax, eax
	jne	.L25
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	"51700550.c"
	.text
	.comm	code,2048,4
	.align	2
	.global	readchar
	.syntax unified
	.arm
	.fpu softvfp
	.type	readchar, %function
readchar:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
.L4:
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-5]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #13
	beq	.L4
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L4
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	readchar, .-readchar
	.align	2
	.global	readcodes
	.syntax unified
	.arm
	.fpu softvfp
	.type	readcodes, %function
readcodes:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	mov	r2, #2048
	mov	r1, #0
	ldr	r0, .L14
	bl	memset
	bl	readchar
	mov	r3, r0
	and	r2, r3, #255
	ldr	r3, .L14
	strb	r2, [r3, #256]
	mov	r3, #2
	str	r3, [fp, #-12]
	b	.L7
.L13:
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L8
.L12:
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-13]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L9
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #13
	bne	.L10
.L9:
	mov	r3, #1
	b	.L11
.L10:
	ldr	r2, .L14
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #8
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r2, [fp, #-13]
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L8:
	mov	r2, #1
	ldr	r3, [fp, #-12]
	lsl	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L12
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L7:
	ldr	r3, [fp, #-12]
	cmp	r3, #7
	ble	.L13
	mov	r3, #1
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	code
	.size	readcodes, .-readcodes
	.align	2
	.global	readint
	.syntax unified
	.arm
	.fpu softvfp
	.type	readint, %function
readint:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L17
.L18:
	ldr	r3, [fp, #-16]
	lsl	r4, r3, #1
	bl	readchar
	mov	r3, r0
	add	r3, r4, r3
	sub	r3, r3, #48
	str	r3, [fp, #-16]
.L17:
	ldr	r3, [fp, #-24]
	sub	r2, r3, #1
	str	r2, [fp, #-24]
	cmp	r3, #0
	bne	.L18
	ldr	r3, [fp, #-16]
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
	.size	readint, .-readint
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	b	.L21
.L26:
	mov	r0, #3
	bl	readint
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L30
.L22:
	ldr	r0, [fp, #-12]
	bl	readint
	str	r0, [fp, #-8]
	mov	r2, #1
	ldr	r3, [fp, #-12]
	lsl	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	beq	.L31
	ldr	r2, .L32
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #8
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	b	.L22
.L31:
	nop
	b	.L26
.L30:
	nop
	mov	r0, #10
	bl	putchar
.L21:
	bl	readcodes
	mov	r3, r0
	cmp	r3, #0
	bne	.L26
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	code
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
