	.file	"781549.c"
	.intel_syntax noprefix
	.text
	.local	old
	.comm	old,60,32
	.local	new
	.comm	new,60,32
	.data
	.align 4
	.type	inputfd, @object
	.size	inputfd, 4
inputfd:
	.long	-1
	.text
	.globl	initTermios
	.type	initTermios, @function
initTermios:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	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]
	and	eax, -9
	mov	DWORD PTR new[rip+12], eax
	lea	rdx, new[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	initTermios, .-initTermios
	.globl	resetTermios
	.type	resetTermios, @function
resetTermios:
.LFB7:
	.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
.LFE7:
	.size	resetTermios, .-resetTermios
	.section	.rodata
	.align 8
.LC0:
	.string	"\nKOBO PageTurn 1.1 Usage:\nd, space, enter => forward\nu => backward\nq => exit\nother keys => show this message\n"
	.text
	.globl	help
	.type	help, @function
help:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	help, .-help
	.section	.rodata
.LC1:
	.string	"exitcode %d\n"
	.text
	.globl	terminate
	.type	terminate, @function
terminate:
.LFB9:
	.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 -4[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	call	resetTermios
	mov	eax, DWORD PTR inputfd[rip]
	cmp	eax, -1
	je	.L5
	mov	eax, DWORD PTR inputfd[rip]
	mov	edx, 0
	mov	esi, 1074021776
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	eax, DWORD PTR inputfd[rip]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
.L5:
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE9:
	.size	terminate, .-terminate
	.section	.rodata
.LC2:
	.string	"/dev/input/event0"
.LC3:
	.string	"exit\tkeycode=%d\n"
.LC4:
	.string	"next\tkeycode=%d\n"
.LC5:
	.string	"prev\tkeycode=%d\n"
.LC6:
	.string	"unknown\tkeycode=%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 0
	mov	esi, 1
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR inputfd[rip], eax
	mov	eax, DWORD PTR inputfd[rip]
	cmp	eax, -1
	jne	.L7
	mov	eax, 1
	jmp	.L16
.L7:
	mov	eax, DWORD PTR inputfd[rip]
	mov	edx, 1
	mov	esi, 1074021776
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	call	initTermios
	lea	rsi, terminate[rip]
	mov	edi, 2
	call	signal@PLT
	lea	rsi, terminate[rip]
	mov	edi, 15
	call	signal@PLT
	call	help
	jmp	.L9
.L15:
	cmp	DWORD PTR -36[rbp], 117
	je	.L10
	cmp	DWORD PTR -36[rbp], 117
	jg	.L11
	cmp	DWORD PTR -36[rbp], 113
	je	.L12
	cmp	DWORD PTR -36[rbp], 113
	jg	.L11
	cmp	DWORD PTR -36[rbp], 32
	jg	.L13
	cmp	DWORD PTR -36[rbp], 10
	jl	.L11
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	movabs	rax, 4294976512
	and	rax, rdx
	test	rax, rax
	setne	al
	test	al, al
	jne	.L14
	jmp	.L11
.L13:
	cmp	DWORD PTR -36[rbp], 100
	je	.L14
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	terminate
.L14:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	WORD PTR -16[rbp], 1
	mov	WORD PTR -14[rbp], 90
	mov	DWORD PTR -12[rbp], 2
	mov	eax, DWORD PTR inputfd[rip]
	lea	rcx, -32[rbp]
	mov	edx, 24
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	WORD PTR -16[rbp], 0
	mov	WORD PTR -14[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR inputfd[rip]
	lea	rcx, -32[rbp]
	mov	edx, 24
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	jmp	.L9
.L10:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	WORD PTR -16[rbp], 1
	mov	WORD PTR -14[rbp], 59
	mov	DWORD PTR -12[rbp], 2
	mov	eax, DWORD PTR inputfd[rip]
	lea	rcx, -32[rbp]
	mov	edx, 24
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	WORD PTR -16[rbp], 0
	mov	WORD PTR -14[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR inputfd[rip]
	lea	rcx, -32[rbp]
	mov	edx, 24
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	call	help
.L9:
	call	getchar@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jne	.L15
	mov	edi, 0
	call	terminate
	mov	eax, 0
.L16:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"781549.c"
	.text
	.local	old
	.comm	old,60,4
	.local	new
	.comm	new,60,4
	.data
	.align	2
	.type	inputfd, %object
	.size	inputfd, 4
inputfd:
	.word	-1
	.text
	.align	2
	.global	initTermios
	.syntax unified
	.arm
	.fpu softvfp
	.type	initTermios, %function
initTermios:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r1, .L2
	mov	r0, #0
	bl	tcgetattr
	ldr	r2, .L2+4
	ldr	r3, .L2
	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, .L2+4
	ldr	r3, [r3, #12]
	bic	r3, r3, #2
	ldr	r2, .L2+4
	str	r3, [r2, #12]
	ldr	r3, .L2+4
	ldr	r3, [r3, #12]
	bic	r3, r3, #8
	ldr	r2, .L2+4
	str	r3, [r2, #12]
	ldr	r2, .L2+4
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.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, .L5
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	nop
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	old
	.size	resetTermios, .-resetTermios
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012KOBO PageTurn 1.1 Usage:\012d, space, enter => "
	.ascii	"forward\012u => backward\012q => exit\012other keys"
	.ascii	" => show this message\012\000"
	.text
	.align	2
	.global	help
	.syntax unified
	.arm
	.fpu softvfp
	.type	help, %function
help:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L8
	bl	puts
	nop
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC0
	.size	help, .-help
	.section	.rodata
	.align	2
.LC1:
	.ascii	"exitcode %d\012\000"
	.text
	.align	2
	.global	terminate
	.syntax unified
	.arm
	.fpu softvfp
	.type	terminate, %function
terminate:
	@ 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, [fp, #-8]
	ldr	r0, .L12
	bl	printf
	bl	resetTermios
	ldr	r3, .L12+4
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L11
	ldr	r3, .L12+4
	ldr	r3, [r3]
	mov	r2, #0
	ldr	r1, .L12+8
	mov	r0, r3
	bl	ioctl
	ldr	r3, .L12+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
.L11:
	mov	r0, #0
	bl	exit
.L13:
	.align	2
.L12:
	.word	.LC1
	.word	inputfd
	.word	1074021776
	.size	terminate, .-terminate
	.section	.rodata
	.align	2
.LC2:
	.ascii	"/dev/input/event0\000"
	.align	2
.LC3:
	.ascii	"exit\011keycode=%d\012\000"
	.align	2
.LC4:
	.ascii	"next\011keycode=%d\012\000"
	.align	2
.LC5:
	.ascii	"prev\011keycode=%d\012\000"
	.align	2
.LC6:
	.ascii	"unknown\011keycode=%d\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #1
	ldr	r0, .L26+4
	bl	open
	mov	r3, r0
	ldr	r2, .L26+8
	str	r3, [r2]
	ldr	r3, .L26+8
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L15
	mov	r3, #1
	b	.L24
.L15:
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r2, #1
	ldr	r1, .L26+12
	mov	r0, r3
	bl	ioctl
	bl	initTermios
	ldr	r1, .L26+16
	mov	r0, #2
	bl	signal
	ldr	r1, .L26+16
	mov	r0, #15
	bl	signal
	bl	help
	b	.L17
.L23:
	ldr	r3, [fp, #-28]
	cmp	r3, #117
	beq	.L18
	ldr	r3, [fp, #-28]
	cmp	r3, #117
	bgt	.L19
	ldr	r3, [fp, #-28]
	cmp	r3, #113
	beq	.L20
	ldr	r3, [fp, #-28]
	cmp	r3, #113
	bgt	.L19
	ldr	r3, [fp, #-28]
	cmp	r3, #32
	bgt	.L21
	ldr	r3, [fp, #-28]
	cmp	r3, #10
	blt	.L19
	ldr	r3, [fp, #-28]
	sub	r3, r3, #10
	mov	r2, #1
	lsl	r2, r2, r3
	ldr	r3, .L26+20
	and	r3, r3, r2
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L22
	b	.L19
.L21:
	ldr	r3, [fp, #-28]
	cmp	r3, #100
	beq	.L22
	b	.L19
.L20:
	ldr	r1, [fp, #-28]
	ldr	r0, .L26+24
	bl	printf
	mov	r0, #0
	bl	terminate
.L22:
	ldr	r1, [fp, #-28]
	ldr	r0, .L26+28
	bl	printf
	sub	r3, fp, #24
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	mov	r3, #1
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #90
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #2
	str	r3, [fp, #-12]
	ldr	r3, .L26+8
	ldr	r3, [r3]
	sub	r1, fp, #24
	mov	r2, #16
	mov	r0, r3
	bl	write
	sub	r3, fp, #24
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, .L26+8
	ldr	r3, [r3]
	sub	r1, fp, #24
	mov	r2, #16
	mov	r0, r3
	bl	write
	b	.L17
.L18:
	ldr	r1, [fp, #-28]
	ldr	r0, .L26+32
	bl	printf
	sub	r3, fp, #24
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	mov	r3, #1
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #59
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #2
	str	r3, [fp, #-12]
	ldr	r3, .L26+8
	ldr	r3, [r3]
	sub	r1, fp, #24
	mov	r2, #16
	mov	r0, r3
	bl	write
	sub	r3, fp, #24
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, .L26+8
	ldr	r3, [r3]
	sub	r1, fp, #24
	mov	r2, #16
	mov	r0, r3
	bl	write
	b	.L17
.L19:
	ldr	r1, [fp, #-28]
	ldr	r0, .L26+36
	bl	printf
	bl	help
.L17:
	bl	getchar
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L23
	mov	r0, #0
	bl	terminate
	mov	r3, #0
.L24:
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC7
	.word	.LC2
	.word	inputfd
	.word	1074021776
	.word	terminate
	.word	4194313
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
