	.file	"9514084.c"
	.intel_syntax noprefix
	.text
	.local	old
	.comm	old,60,32
	.local	new
	.comm	new,60,32
	.globl	initTermios
	.type	initTermios, @function
initTermios:
.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], edi
	lea	rsi, old[rip]
	mov	edi, 0
	call	tcgetattr@PLT
	mov	rax, QWORD PTR old[rip]
	mov	rdx, QWORD PTR old[rip+8]
	mov	QWORD PTR new[rip], rax
	mov	QWORD PTR new[rip+8], rdx
	mov	rax, QWORD PTR old[rip+16]
	mov	rdx, QWORD PTR old[rip+24]
	mov	QWORD PTR new[rip+16], rax
	mov	QWORD PTR new[rip+24], rdx
	mov	rax, QWORD PTR old[rip+32]
	mov	rdx, QWORD PTR old[rip+40]
	mov	QWORD PTR new[rip+32], rax
	mov	QWORD PTR new[rip+40], rdx
	mov	rax, QWORD PTR old[rip+48]
	mov	QWORD PTR new[rip+48], rax
	mov	eax, DWORD PTR old[rip+56]
	mov	DWORD PTR new[rip+56], eax
	mov	eax, DWORD PTR new[rip+12]
	and	eax, -3
	mov	DWORD PTR new[rip+12], eax
	mov	eax, DWORD PTR new[rip+12]
	cmp	DWORD PTR -4[rbp], 0
	je	.L2
	mov	edx, 8
	jmp	.L3
.L2:
	mov	edx, -9
.L3:
	and	eax, edx
	mov	DWORD PTR new[rip+12], eax
	lea	rdx, new[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	initTermios, .-initTermios
	.globl	resetTermios
	.type	resetTermios, @function
resetTermios:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdx, old[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	resetTermios, .-resetTermios
	.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
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	initTermios
	call	getchar@PLT
	mov	BYTE PTR -1[rbp], al
	call	resetTermios
	movzx	eax, BYTE PTR -1[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	getch_, .-getch_
	.globl	getch
	.type	getch, @function
getch:
.LFB3:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	edi, 0
	call	getch_
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	getch, .-getch
	.globl	getche
	.type	getche, @function
getche:
.LFB4:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	edi, 1
	call	getch_
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	getche, .-getche
	.globl	testgetch
	.type	testgetch, @function
testgetch:
.LFB5:
	.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
	call	getch
	movsx	eax, al
	mov	DWORD PTR -4[rbp], eax
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	test	ax, ax
	jns	.L12
	mov	edi, 0
	call	getch_
	jmp	.L13
.L12:
	mov	edi, 1
	call	getch_
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	testgetch, .-testgetch
	.section	.rodata
.LC0:
	.string	"\nYou typed: %d\n"
.LC1:
	.string	"\nYou typed: %c\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 16
	call	getch
	movsx	eax, al
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"9514084.c"
	.text
	.local	old
	.comm	old,60,4
	.local	new
	.comm	new,60,4
	.align	2
	.global	initTermios
	.syntax unified
	.arm
	.fpu softvfp
	.type	initTermios, %function
initTermios:
	@ 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	r1, .L4
	mov	r0, #0
	bl	tcgetattr
	ldr	r2, .L4+4
	ldr	r3, .L4
	mov	ip, r2
	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, .L4+4
	ldr	r3, [r3, #12]
	bic	r3, r3, #2
	ldr	r2, .L4+4
	str	r3, [r2, #12]
	ldr	r3, .L4+4
	ldr	r3, [r3, #12]
	ldr	r2, [fp, #-8]
	cmp	r2, #0
	beq	.L2
	mov	r2, #8
	b	.L3
.L2:
	mvn	r2, #8
.L3:
	and	r3, r3, r2
	ldr	r2, .L4+4
	str	r3, [r2, #12]
	ldr	r2, .L4+4
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	old
	.word	new
	.size	initTermios, .-initTermios
	.align	2
	.global	resetTermios
	.syntax unified
	.arm
	.fpu softvfp
	.type	resetTermios, %function
resetTermios:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r2, .L7
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	nop
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	old
	.size	resetTermios, .-resetTermios
	.align	2
	.global	getch_
	.syntax unified
	.arm
	.fpu softvfp
	.type	getch_, %function
getch_:
	@ 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]
	ldr	r0, [fp, #-16]
	bl	initTermios
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-5]
	bl	resetTermios
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	getch_, .-getch_
	.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
	mov	r0, #0
	bl	getch_
	mov	r3, r0
	mov	r0, r3
	pop	{fp, pc}
	.size	getch, .-getch
	.align	2
	.global	getche
	.syntax unified
	.arm
	.fpu softvfp
	.type	getche, %function
getche:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	mov	r0, #1
	bl	getch_
	mov	r3, r0
	mov	r0, r3
	pop	{fp, pc}
	.size	getche, .-getche
	.align	2
	.global	testgetch
	.syntax unified
	.arm
	.fpu softvfp
	.type	testgetch, %function
testgetch:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	getch
	mov	r3, r0
	str	r3, [fp, #-8]
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	lsl	r3, r3, #16
	asr	r3, r3, #16
	cmp	r3, #0
	bge	.L16
	mov	r0, #0
	bl	getch_
	mov	r3, r0
	b	.L17
.L16:
	mov	r0, #1
	bl	getch_
	mov	r3, r0
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	testgetch, .-testgetch
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012You typed: %d\012\000"
	.align	2
.LC1:
	.ascii	"\012You typed: %c\012\000"
	.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
	bl	getch
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, .L20
	bl	printf
	ldr	r1, [fp, #-8]
	ldr	r0, .L20+4
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC0
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
