	.file	"492629.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Opening Xrecord context"
	.align 8
.LC1:
	.string	"======================================================="
.LC2:
	.string	"XOpenDisplay error.\n"
.LC3:
	.string	"XRecordAllocRange error.\n"
.LC4:
	.string	"XRecordCreateContext error.\n"
.LC5:
	.string	"XRecordEnableContext error.\n"
	.text
	.globl	scan
	.type	scan, @function
scan:
.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, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	edi, 0
	call	XOpenDisplay@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	eax, -1
	jmp	.L7
.L2:
	call	XRecordAllocRange@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	test	rax, rax
	jne	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, -2
	jmp	.L7
.L4:
	mov	rax, QWORD PTR -40[rbp]
	mov	BYTE PTR 18[rax], 2
	mov	rax, QWORD PTR -40[rbp]
	mov	BYTE PTR 19[rax], 3
	mov	QWORD PTR -32[rbp], 3
	lea	rcx, -40[rbp]
	lea	rdx, -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	r9d, 1
	mov	r8, rcx
	mov	ecx, 1
	mov	esi, 0
	mov	rdi, rax
	call	XRecordCreateContext@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 28
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	eax, -3
	jmp	.L7
.L5:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	XFree@PLT
	mov	rsi, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	ecx, 0
	lea	rdx, callback_function[rip]
	mov	rdi, rax
	call	XRecordEnableContext@PLT
	test	eax, eax
	jne	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 28
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	eax, -4
	jmp	.L7
.L6:
	mov	eax, 0
.L7:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	scan, .-scan
	.section	.rodata
.LC6:
	.string	"K,T:P,K:%d\n"
.LC7:
	.string	"K,T:R,K:%d\n"
.LC8:
	.string	"K,T:E,K:%d\n"
	.text
	.globl	callback_function
	.type	callback_function, @function
callback_function:
.LFB7:
	.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	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR 24[rax]
	test	eax, eax
	jne	.L18
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 32[rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 32[rax]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	and	eax, 127
	mov	DWORD PTR -8[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 32[rax]
	add	rax, 2
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	and	eax, 1
	mov	DWORD PTR -4[rbp], eax
	sub	DWORD PTR -12[rbp], 8
	cmp	DWORD PTR -4[rbp], 0
	jne	.L12
	cmp	DWORD PTR -8[rbp], 2
	je	.L13
	cmp	DWORD PTR -8[rbp], 3
	je	.L14
	jmp	.L17
.L13:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L17
.L14:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L17
.L12:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
.L17:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	XRecordFreeData@PLT
	jmp	.L9
.L18:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	callback_function, .-callback_function
	.section	.rodata
.LC9:
	.string	"Starting key listener..."
	.align 8
.LC10:
	.string	"Error encountered. Return code %d.\n"
.LC11:
	.string	"Key listener terminated."
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, 0
	call	scan
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L20
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L21
.L20:
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, 0
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"492629.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Opening Xrecord context\000"
	.align	2
.LC1:
	.ascii	"==================================================="
	.ascii	"====\000"
	.align	2
.LC2:
	.ascii	"XOpenDisplay error.\012\000"
	.align	2
.LC3:
	.ascii	"XRecordAllocRange error.\012\000"
	.align	2
.LC4:
	.ascii	"XRecordCreateContext error.\012\000"
	.align	2
.LC5:
	.ascii	"XRecordEnableContext error.\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	scan
	.syntax unified
	.arm
	.fpu softvfp
	.type	scan, %function
scan:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L9+4
	bl	puts
	ldr	r0, .L9+8
	bl	puts
	ldr	r3, .L9+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r0, #0
	bl	XOpenDisplay
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L9+16
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L9+20
	bl	fwrite
	mvn	r3, #0
	b	.L7
.L2:
	bl	XRecordAllocRange
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L9+16
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L9+24
	bl	fwrite
	mvn	r3, #1
	b	.L7
.L4:
	ldr	r3, [fp, #-24]
	mov	r2, #2
	strb	r2, [r3, #18]
	ldr	r3, [fp, #-24]
	mov	r2, #3
	strb	r2, [r3, #19]
	mov	r3, #3
	str	r3, [fp, #-20]
	sub	r2, fp, #20
	mov	r3, #1
	str	r3, [sp, #4]
	sub	r3, fp, #24
	str	r3, [sp]
	mov	r3, #1
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	XRecordCreateContext
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L9+16
	ldr	r3, [r3]
	mov	r2, #28
	mov	r1, #1
	ldr	r0, .L9+28
	bl	fwrite
	mvn	r3, #2
	b	.L7
.L5:
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	XFree
	mov	r3, #0
	ldr	r2, .L9+32
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	XRecordEnableContext
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L9+16
	ldr	r3, [r3]
	mov	r2, #28
	mov	r1, #1
	ldr	r0, .L9+36
	bl	fwrite
	mvn	r3, #3
	b	.L7
.L6:
	mov	r3, #0
.L7:
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	stdout
	.word	stderr
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	callback_function
	.word	.LC5
	.size	scan, .-scan
	.section	.rodata
	.align	2
.LC7:
	.ascii	"K,T:P,K:%d\012\000"
	.align	2
.LC8:
	.ascii	"K,T:R,K:%d\012\000"
	.align	2
.LC9:
	.ascii	"K,T:E,K:%d\012\000"
	.text
	.align	2
	.global	callback_function
	.syntax unified
	.arm
	.fpu softvfp
	.type	callback_function, %function
callback_function:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #12]
	cmp	r3, #0
	bne	.L20
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #20]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	and	r3, r3, #127
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #20]
	add	r3, r3, #2
	ldrb	r3, [r3]	@ zero_extendqisi2
	and	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	sub	r3, r3, #8
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-12]
	cmp	r3, #2
	beq	.L15
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	beq	.L16
	b	.L19
.L15:
	ldr	r1, [fp, #-16]
	ldr	r0, .L21
	bl	printf
	ldr	r3, .L21+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L19
.L16:
	ldr	r1, [fp, #-16]
	ldr	r0, .L21+8
	bl	printf
	ldr	r3, .L21+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L19
.L14:
	ldr	r1, [fp, #-16]
	ldr	r0, .L21+12
	bl	printf
	ldr	r3, .L21+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
.L19:
	ldr	r0, [fp, #-28]
	bl	XRecordFreeData
	b	.L11
.L20:
	nop
.L11:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC7
	.word	stdout
	.word	.LC8
	.word	.LC9
	.size	callback_function, .-callback_function
	.section	.rodata
	.align	2
.LC10:
	.ascii	"Starting key listener...\000"
	.align	2
.LC11:
	.ascii	"Error encountered. Return code %d.\012\000"
	.align	2
.LC12:
	.ascii	"Key listener terminated.\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
	ldr	r0, .L26
	bl	puts
	ldr	r0, .L26+4
	bl	puts
	ldr	r3, .L26+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	bl	scan
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L24
	ldr	r1, [fp, #-8]
	ldr	r0, .L26+12
	bl	printf
	mvn	r3, #0
	b	.L25
.L24:
	ldr	r0, .L26+16
	bl	puts
	mov	r3, #0
.L25:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC1
	.word	.LC10
	.word	stdout
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
