	.file	"226441.c"
	.intel_syntax noprefix
	.text
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 400
buf:
	.zero	400
	.globl	bufp
	.align 4
	.type	bufp, @object
	.size	bufp, 4
bufp:
	.zero	4
	.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
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], 42
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	ungetch
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	putchar@PLT
.L2:
	call	getch
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L3
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	getch
	.type	getch, @function
getch:
.LFB1:
	.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 bufp[rip]
	test	eax, eax
	jle	.L6
	mov	eax, DWORD PTR bufp[rip]
	sub	eax, 1
	mov	DWORD PTR bufp[rip], eax
	mov	eax, DWORD PTR bufp[rip]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, buf[rip]
	mov	eax, DWORD PTR [rdx+rax]
	jmp	.L8
.L6:
	call	getchar@PLT
.L8:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getch, .-getch
	.section	.rodata
.LC0:
	.string	"ungetch: too many characters "
	.text
	.globl	ungetch
	.type	ungetch, @function
ungetch:
.LFB2:
	.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	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR bufp[rip]
	cmp	eax, 99
	jle	.L10
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L12
.L10:
	mov	eax, DWORD PTR bufp[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR bufp[rip], edx
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, buf[rip]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rcx+rdx], eax
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	"226441.c"
	.text
	.comm	buf,400,4
	.global	bufp
	.bss
	.align	2
	.type	bufp, %object
	.size	bufp, 4
bufp:
	.space	4
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #42
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	ungetch
	b	.L2
.L3:
	ldr	r0, [fp, #-8]
	bl	putchar
.L2:
	bl	getch
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L3
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	main, .-main
	.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, .L9
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L6
	ldr	r3, .L9
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L9
	str	r3, [r2]
	ldr	r3, .L9
	ldr	r3, [r3]
	ldr	r2, .L9+4
	ldr	r3, [r2, r3, lsl #2]
	b	.L8
.L6:
	bl	getchar
	mov	r3, r0
.L8:
	mov	r0, r3
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	bufp
	.word	buf
	.size	getch, .-getch
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ungetch: too many characters \000"
	.text
	.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
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, .L15
	ldr	r3, [r3]
	cmp	r3, #99
	ble	.L12
	ldr	r0, .L15+4
	bl	puts
	b	.L14
.L12:
	ldr	r3, .L15
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r1, .L15
	str	r2, [r1]
	ldr	r1, .L15+8
	ldr	r2, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
.L14:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	bufp
	.word	.LC0
	.word	buf
	.size	ungetch, .-ungetch
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
