	.file	"207808.c"
	.intel_syntax noprefix
	.text
	.local	usb_hid_in_report_buf
	.comm	usb_hid_in_report_buf,1,1
	.local	usb_hid_out_report_buf
	.comm	usb_hid_out_report_buf,2,1
	.section	.data.rel.local,"aw"
	.align 8
	.type	usb_hid_in_report, @object
	.size	usb_hid_in_report, 8
usb_hid_in_report:
	.quad	usb_hid_in_report_buf
	.align 8
	.type	usb_hid_out_report, @object
	.size	usb_hid_out_report, 8
usb_hid_out_report:
	.quad	usb_hid_out_report_buf+1
	.local	usb_hid_fd
	.comm	usb_hid_fd,4,4
	.local	wkup_pb_old_value
	.comm	wkup_pb_old_value,1,1
	.section	.rodata
.LC0:
	.string	"read()"
.LC1:
	.string	"read"
.LC2:
	.string	"read() read %d bytes:\t"
.LC3:
	.string	"%02hhx "
	.text
	.type	read_in_report, @function
read_in_report:
.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
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, DWORD PTR usb_hid_fd[rip]
	mov	edx, 1
	lea	rsi, usb_hid_in_report_buf[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L2
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -8[rbp], 0
	jmp	.L3
.L4:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, usb_hid_in_report_buf[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -8[rbp], 1
.L3:
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jl	.L4
	mov	edi, 10
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	read_in_report, .-read_in_report
	.section	.rodata
.LC4:
	.string	"write"
	.text
	.type	send_out_report, @function
send_out_report:
.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, 16
	mov	BYTE PTR usb_hid_out_report_buf[rip], 0
	mov	eax, DWORD PTR usb_hid_fd[rip]
	mov	edx, 2
	lea	rsi, usb_hid_out_report_buf[rip]
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	rax, QWORD PTR usb_hid_out_report[rip]
	movzx	edx, BYTE PTR [rax]
	add	edx, 1
	mov	BYTE PTR [rax], dl
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	send_out_report, .-send_out_report
	.section	.rodata
.LC5:
	.string	"Unable to open device"
.LC6:
	.string	"HIDIOCGRDESCSIZE"
.LC7:
	.string	"Report Descriptor Size: %d\n"
.LC8:
	.string	"HIDIOCGRDESC"
.LC9:
	.string	"Report Descriptor:"
.LC10:
	.string	"\n"
	.text
	.type	usb_hid_init, @function
usb_hid_init:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 336
	mov	QWORD PTR -4424[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -4404[rbp], 0
	mov	rax, QWORD PTR -4424[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR usb_hid_fd[rip], eax
	mov	eax, DWORD PTR usb_hid_fd[rip]
	test	eax, eax
	jns	.L8
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	lea	rax, -4384[rbp]
	mov	edx, 4100
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -4392[rbp]
	mov	edx, 8
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -272[rbp]
	mov	edx, 256
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR usb_hid_fd[rip]
	lea	rdx, -4404[rbp]
	mov	esi, 2147764225
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -4396[rbp], eax
	cmp	DWORD PTR -4396[rbp], 0
	jns	.L9
	lea	rdi, .LC6[rip]
	call	perror@PLT
	jmp	.L10
.L9:
	mov	eax, DWORD PTR -4404[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L10:
	mov	eax, DWORD PTR -4404[rbp]
	mov	DWORD PTR -4384[rbp], eax
	mov	eax, DWORD PTR usb_hid_fd[rip]
	lea	rdx, -4384[rbp]
	mov	esi, 2416199682
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	mov	DWORD PTR -4396[rbp], eax
	cmp	DWORD PTR -4396[rbp], 0
	jns	.L11
	lea	rdi, .LC8[rip]
	call	perror@PLT
	jmp	.L16
.L11:
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	DWORD PTR -4400[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -4400[rbp]
	cdqe
	movzx	eax, BYTE PTR -4380[rbp+rax]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -4400[rbp], 1
.L13:
	mov	edx, DWORD PTR -4384[rbp]
	mov	eax, DWORD PTR -4400[rbp]
	cmp	edx, eax
	ja	.L14
	lea	rdi, .LC10[rip]
	call	puts@PLT
.L16:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	usb_hid_init, .-usb_hid_init
	.section	.rodata
.LC11:
	.string	"Usage: %s /dev/hidrawX\n"
	.text
	.globl	main
	.type	main, @function
main:
.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	QWORD PTR -16[rbp], rsi
	cmp	DWORD PTR -4[rbp], 1
	jg	.L18
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L22
.L18:
	mov	edx, 2
	mov	esi, 0
	lea	rdi, usb_hid_out_report_buf[rip]
	call	memset@PLT
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usb_hid_init
	mov	rax, QWORD PTR usb_hid_out_report[rip]
	mov	BYTE PTR [rax], 4
	mov	eax, 0
	call	send_out_report
.L21:
	mov	eax, 0
	call	read_in_report
	mov	rax, QWORD PTR usb_hid_in_report[rip]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 40
	jne	.L21
	mov	rax, QWORD PTR usb_hid_in_report[rip]
	movzx	edx, BYTE PTR [rax]
	mov	rax, QWORD PTR usb_hid_out_report[rip]
	shr	dl
	mov	BYTE PTR [rax], dl
	mov	eax, 0
	call	send_out_report
	jmp	.L21
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"207808.c"
	.text
	.local	usb_hid_in_report_buf
	.comm	usb_hid_in_report_buf,1,4
	.local	usb_hid_out_report_buf
	.comm	usb_hid_out_report_buf,2,4
	.data
	.align	2
	.type	usb_hid_in_report, %object
	.size	usb_hid_in_report, 4
usb_hid_in_report:
	.word	usb_hid_in_report_buf
	.align	2
	.type	usb_hid_out_report, %object
	.size	usb_hid_out_report, 4
usb_hid_out_report:
	.word	usb_hid_out_report_buf+1
	.local	usb_hid_fd
	.comm	usb_hid_fd,4,4
	.local	wkup_pb_old_value
	.comm	wkup_pb_old_value,1,1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"read()\000"
	.align	2
.LC1:
	.ascii	"read\000"
	.align	2
.LC2:
	.ascii	"read() read %d bytes:\011\000"
	.align	2
.LC3:
	.ascii	"%02hhx \000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_in_report, %function
read_in_report:
	@ 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, .L5
	bl	puts
	ldr	r3, .L5+4
	ldr	r3, [r3]
	mov	r2, #1
	ldr	r1, .L5+8
	mov	r0, r3
	bl	read
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L5+12
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	ldr	r1, [fp, #-8]
	ldr	r0, .L5+16
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L3
.L4:
	ldr	r2, .L5+8
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L5+20
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L3:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	blt	.L4
	mov	r0, #10
	bl	putchar
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	usb_hid_fd
	.word	usb_hid_in_report_buf
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	read_in_report, .-read_in_report
	.section	.rodata
	.align	2
.LC4:
	.ascii	"write\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	send_out_report, %function
send_out_report:
	@ 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, .L9
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, .L9+4
	ldr	r3, [r3]
	mov	r2, #2
	ldr	r1, .L9
	mov	r0, r3
	bl	write
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L8
	ldr	r0, .L9+8
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, .L9+12
	ldr	r3, [r3]
	ldrb	r2, [r3]	@ zero_extendqisi2
	add	r2, r2, #1
	and	r2, r2, #255
	strb	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	usb_hid_out_report_buf
	.word	usb_hid_fd
	.word	.LC4
	.word	usb_hid_out_report
	.size	send_out_report, .-send_out_report
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Unable to open device\000"
	.align	2
.LC6:
	.ascii	"HIDIOCGRDESCSIZE\000"
	.align	2
.LC7:
	.ascii	"Report Descriptor Size: %d\012\000"
	.align	2
.LC8:
	.ascii	"HIDIOCGRDESC\000"
	.align	2
.LC9:
	.ascii	"Report Descriptor:\000"
	.align	2
.LC10:
	.ascii	"\012\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usb_hid_init, %function
usb_hid_init:
	@ args = 0, pretend = 0, frame = 4392
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #4352
	sub	sp, sp, #44
	sub	r3, fp, #4096
	sub	r3, r3, #12
	str	r0, [r3, #-292]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-284]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r1, #2
	ldr	r0, [r3, #-292]
	bl	open
	mov	r3, r0
	ldr	r2, .L21+4
	str	r3, [r2]
	ldr	r3, .L21+4
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L12
	ldr	r0, .L21+8
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	sub	r3, fp, #4352
	sub	r3, r3, #12
	sub	r3, r3, #8
	ldr	r2, .L21+12
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4352
	sub	r3, r3, #12
	sub	r3, r3, #16
	mov	r2, #8
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #272
	mov	r2, #256
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L21+4
	ldr	r0, [r3]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4352
	sub	r3, r3, #12
	sub	r3, r3, #28
	mov	r2, r3
	ldr	r1, .L21+16
	bl	ioctl
	str	r0, [r4, #-276]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-276]
	cmp	r3, #0
	bge	.L13
	ldr	r0, .L21+20
	bl	perror
	b	.L14
.L13:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-284]
	mov	r1, r3
	ldr	r0, .L21+24
	bl	printf
.L14:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-284]
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	str	r2, [r3, #-264]
	ldr	r3, .L21+4
	ldr	r0, [r3]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4352
	sub	r3, r3, #12
	sub	r3, r3, #8
	mov	r2, r3
	ldr	r1, .L21+28
	bl	ioctl
	str	r0, [r4, #-276]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-276]
	cmp	r3, #0
	bge	.L15
	ldr	r0, .L21+32
	bl	perror
	b	.L20
.L15:
	ldr	r0, .L21+36
	bl	puts
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-280]
	b	.L17
.L18:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-280]
	add	r3, r2, r3
	sub	r3, r3, #260
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L21+40
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-280]
	add	r3, r3, #1
	str	r3, [r2, #-280]
.L17:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r3, #-264]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-280]
	cmp	r2, r3
	bhi	.L18
	ldr	r0, .L21+44
	bl	puts
.L20:
	nop
	ldr	r3, .L21
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC11
	.word	usb_hid_fd
	.word	.LC5
	.word	4100
	.word	-2147203071
	.word	.LC6
	.word	.LC7
	.word	-1878767614
	.word	.LC8
	.word	.LC9
	.word	.LC3
	.word	.LC10
	.size	usb_hid_init, .-usb_hid_init
	.section	.rodata
	.align	2
.LC12:
	.ascii	"Usage: %s /dev/hidrawX\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
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	bgt	.L24
	ldr	r3, .L29
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L29+4
	bl	fprintf
	mov	r3, #1
	b	.L28
.L24:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, .L29+8
	bl	memset
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	usb_hid_init
	ldr	r3, .L29+12
	ldr	r3, [r3]
	mov	r2, #4
	strb	r2, [r3]
	bl	send_out_report
.L27:
	bl	read_in_report
	ldr	r3, .L29+16
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #40
	bne	.L27
	ldr	r3, .L29+16
	ldr	r3, [r3]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, .L29+12
	ldr	r3, [r3]
	lsr	r2, r2, #1
	and	r2, r2, #255
	strb	r2, [r3]
	bl	send_out_report
	b	.L27
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	stderr
	.word	.LC12
	.word	usb_hid_out_report_buf
	.word	usb_hid_out_report
	.word	usb_hid_in_report
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
