	.file	"40372.c"
	.intel_syntax noprefix
	.text
	.local	initial_settings
	.comm	initial_settings,60,32
	.local	new_settings
	.comm	new_settings,60,32
	.data
	.align 4
	.type	peek_character, @object
	.size	peek_character, 4
peek_character:
	.long	-1
	.section	.rodata
.LC0:
	.string	"looping"
.LC1:
	.string	"you hit %c\n"
	.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], 0
	mov	eax, 0
	call	init_keyboard
	jmp	.L2
.L3:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	sleep@PLT
	mov	eax, 0
	call	kbhit
	test	eax, eax
	je	.L2
	mov	eax, 0
	call	readch
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L2:
	cmp	DWORD PTR -4[rbp], 113
	jne	.L3
	mov	eax, 0
	call	close_keyboard
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	init_keyboard
	.type	init_keyboard, @function
init_keyboard:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rsi, initial_settings[rip]
	mov	edi, 0
	call	tcgetattr@PLT
	mov	rax, QWORD PTR initial_settings[rip]
	mov	rdx, QWORD PTR initial_settings[rip+8]
	mov	QWORD PTR new_settings[rip], rax
	mov	QWORD PTR new_settings[rip+8], rdx
	mov	rax, QWORD PTR initial_settings[rip+16]
	mov	rdx, QWORD PTR initial_settings[rip+24]
	mov	QWORD PTR new_settings[rip+16], rax
	mov	QWORD PTR new_settings[rip+24], rdx
	mov	rax, QWORD PTR initial_settings[rip+32]
	mov	rdx, QWORD PTR initial_settings[rip+40]
	mov	QWORD PTR new_settings[rip+32], rax
	mov	QWORD PTR new_settings[rip+40], rdx
	mov	rax, QWORD PTR initial_settings[rip+48]
	mov	QWORD PTR new_settings[rip+48], rax
	mov	eax, DWORD PTR initial_settings[rip+56]
	mov	DWORD PTR new_settings[rip+56], eax
	mov	eax, DWORD PTR new_settings[rip+12]
	and	eax, -3
	mov	DWORD PTR new_settings[rip+12], eax
	mov	eax, DWORD PTR new_settings[rip+12]
	and	eax, -9
	mov	DWORD PTR new_settings[rip+12], eax
	mov	eax, DWORD PTR new_settings[rip+12]
	and	eax, -2
	mov	DWORD PTR new_settings[rip+12], eax
	mov	BYTE PTR new_settings[rip+23], 1
	mov	BYTE PTR new_settings[rip+22], 0
	lea	rdx, new_settings[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	init_keyboard, .-init_keyboard
	.globl	close_keyboard
	.type	close_keyboard, @function
close_keyboard:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdx, initial_settings[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	close_keyboard, .-close_keyboard
	.globl	kbhit
	.type	kbhit, @function
kbhit:
.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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR peek_character[rip]
	cmp	eax, -1
	je	.L7
	mov	eax, 1
	jmp	.L10
.L7:
	mov	BYTE PTR new_settings[rip+23], 0
	lea	rdx, new_settings[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	lea	rax, -13[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	BYTE PTR new_settings[rip+23], 1
	lea	rdx, new_settings[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	cmp	DWORD PTR -12[rbp], 1
	jne	.L9
	movzx	eax, BYTE PTR -13[rbp]
	movsx	eax, al
	mov	DWORD PTR peek_character[rip], eax
	mov	eax, 1
	jmp	.L10
.L9:
	mov	eax, 0
.L10:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	kbhit, .-kbhit
	.globl	readch
	.type	readch, @function
readch:
.LFB4:
	.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 fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR peek_character[rip]
	cmp	eax, -1
	je	.L13
	mov	eax, DWORD PTR peek_character[rip]
	mov	BYTE PTR -9[rbp], al
	mov	DWORD PTR peek_character[rip], -1
	movzx	eax, BYTE PTR -9[rbp]
	movsx	eax, al
	jmp	.L15
.L13:
	lea	rax, -9[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	movzx	eax, BYTE PTR -9[rbp]
	movsx	eax, al
.L15:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	readch, .-readch
	.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	"40372.c"
	.text
	.local	initial_settings
	.comm	initial_settings,60,4
	.local	new_settings
	.comm	new_settings,60,4
	.data
	.align	2
	.type	peek_character, %object
	.size	peek_character, 4
peek_character:
	.word	-1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"looping\000"
	.align	2
.LC1:
	.ascii	"you hit %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
	mov	r3, #0
	str	r3, [fp, #-8]
	bl	init_keyboard
	b	.L2
.L3:
	ldr	r0, .L4
	bl	puts
	mov	r0, #1
	bl	sleep
	bl	kbhit
	mov	r3, r0
	cmp	r3, #0
	beq	.L2
	bl	readch
	str	r0, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, .L4+4
	bl	printf
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #113
	bne	.L3
	bl	close_keyboard
	mov	r0, #0
	bl	exit
.L5:
	.align	2
.L4:
	.word	.LC0
	.word	.LC1
	.size	main, .-main
	.align	2
	.global	init_keyboard
	.syntax unified
	.arm
	.fpu softvfp
	.type	init_keyboard, %function
init_keyboard:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r1, .L7
	mov	r0, #0
	bl	tcgetattr
	ldr	r2, .L7+4
	ldr	r3, .L7
	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, .L7+4
	ldr	r3, [r3, #12]
	bic	r3, r3, #2
	ldr	r2, .L7+4
	str	r3, [r2, #12]
	ldr	r3, .L7+4
	ldr	r3, [r3, #12]
	bic	r3, r3, #8
	ldr	r2, .L7+4
	str	r3, [r2, #12]
	ldr	r3, .L7+4
	ldr	r3, [r3, #12]
	bic	r3, r3, #1
	ldr	r2, .L7+4
	str	r3, [r2, #12]
	ldr	r3, .L7+4
	mov	r2, #1
	strb	r2, [r3, #23]
	ldr	r3, .L7+4
	mov	r2, #0
	strb	r2, [r3, #22]
	ldr	r2, .L7+4
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	nop
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	initial_settings
	.word	new_settings
	.size	init_keyboard, .-init_keyboard
	.align	2
	.global	close_keyboard
	.syntax unified
	.arm
	.fpu softvfp
	.type	close_keyboard, %function
close_keyboard:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r2, .L10
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	nop
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	initial_settings
	.size	close_keyboard, .-close_keyboard
	.section	.rodata
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	kbhit
	.syntax unified
	.arm
	.fpu softvfp
	.type	kbhit, %function
kbhit:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L18+4
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L13
	mov	r3, #1
	b	.L16
.L13:
	ldr	r3, .L18+8
	mov	r2, #0
	strb	r2, [r3, #23]
	ldr	r2, .L18+8
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	sub	r3, fp, #13
	mov	r2, #1
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-12]
	ldr	r3, .L18+8
	mov	r2, #1
	strb	r2, [r3, #23]
	ldr	r2, .L18+8
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	bne	.L15
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, .L18+4
	str	r2, [r3]
	mov	r3, #1
	b	.L16
.L15:
	mov	r3, #0
.L16:
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC2
	.word	peek_character
	.word	new_settings
	.size	kbhit, .-kbhit
	.section	.rodata
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	readch
	.syntax unified
	.arm
	.fpu softvfp
	.type	readch, %function
readch:
	@ 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	r3, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L25+4
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L21
	ldr	r3, .L25+4
	ldr	r3, [r3]
	and	r3, r3, #255
	strb	r3, [fp, #-9]
	ldr	r3, .L25+4
	mvn	r2, #0
	str	r2, [r3]
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	b	.L23
.L21:
	sub	r3, fp, #9
	mov	r2, #1
	mov	r1, r3
	mov	r0, #0
	bl	read
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
.L23:
	ldr	r2, .L25
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC3
	.word	peek_character
	.size	readch, .-readch
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
