	.file	"extr_btuinput.c_uinput_open_keyboard.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Bluetooth Keyboard"
	.text
	.p2align 4
	.globl	uinput_open_keyboard
	.type	uinput_open_keyboard, @function
uinput_open_keyboard:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	test	rdi, rdi
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	setne	dil
	movzx	edi, dil
	call	assert@PLT
	lea	rdx, .LC0[rip]
	mov	esi, r12d
	mov	rdi, rbx
	call	uinput_open_common@PLT
	test	rax, rax
	js	.L15
	mov	edx, DWORD PTR EV_KEY[rip]
	mov	esi, DWORD PTR UI_SET_EVBIT[rip]
	mov	r12, rax
	mov	rdi, rax
	xor	eax, eax
	call	ioctl@PLT
	test	rax, rax
	js	.L3
	mov	edx, DWORD PTR EV_LED[rip]
	mov	esi, DWORD PTR UI_SET_EVBIT[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	js	.L3
	mov	edx, DWORD PTR EV_SYN[rip]
	mov	esi, DWORD PTR UI_SET_EVBIT[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	js	.L3
	mov	edx, DWORD PTR EV_REP[rip]
	mov	esi, DWORD PTR UI_SET_EVBIT[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	js	.L3
	mov	edx, DWORD PTR LED_CAPSL[rip]
	mov	esi, DWORD PTR UI_SET_LEDBIT[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	js	.L3
	mov	edx, DWORD PTR LED_NUML[rip]
	mov	esi, DWORD PTR UI_SET_LEDBIT[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	js	.L3
	mov	edx, DWORD PTR LED_SCROLLL[rip]
	mov	esi, DWORD PTR UI_SET_LEDBIT[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	jne	.L3
	mov	rdi, QWORD PTR keymap[rip]
	xor	ebp, ebp
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, QWORD PTR keymap[rip]
	mov	rdx, QWORD PTR [rdi+rbp*8]
	cmp	rdx, QWORD PTR NONE[rip]
	je	.L5
	mov	esi, DWORD PTR UI_SET_KEYBIT[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	js	.L3
	mov	rdi, QWORD PTR keymap[rip]
.L5:
	add	rbp, 1
.L4:
	call	nitems@PLT
	cmp	rax, rbp
	ja	.L6
	xor	ebp, ebp
	cmp	QWORD PTR [rbx], 0
	mov	rdi, QWORD PTR consmap[rip]
	jne	.L8
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdi, QWORD PTR consmap[rip]
	mov	rdx, QWORD PTR [rdi+rbp*8]
	cmp	rdx, QWORD PTR NONE[rip]
	je	.L9
	mov	esi, DWORD PTR UI_SET_KEYBIT[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	js	.L3
	mov	rdi, QWORD PTR consmap[rip]
.L9:
	add	rbp, 1
.L8:
	call	nitems@PLT
	cmp	rax, rbp
	ja	.L10
.L11:
	mov	esi, DWORD PTR UI_DEV_CREATE[rip]
	xor	eax, eax
	mov	rdi, r12
	call	ioctl@PLT
	test	rax, rax
	jns	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, r12
	call	close@PLT
.L15:
	mov	r12, -1
.L1:
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	uinput_open_keyboard, .-uinput_open_keyboard
	.comm	keymap,8,8
	.comm	consmap,8,8
	.comm	UI_SET_LEDBIT,4,4
	.comm	UI_SET_KEYBIT,4,4
	.comm	UI_SET_EVBIT,4,4
	.comm	UI_DEV_CREATE,4,4
	.comm	NONE,8,8
	.comm	LED_SCROLLL,4,4
	.comm	LED_NUML,4,4
	.comm	LED_CAPSL,4,4
	.comm	EV_SYN,4,4
	.comm	EV_REP,4,4
	.comm	EV_LED,4,4
	.comm	EV_KEY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_btuinput.c_uinput_open_keyboard.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Bluetooth Keyboard\000"
	.text
	.align	2
	.global	uinput_open_keyboard
	.syntax unified
	.arm
	.fpu softvfp
	.type	uinput_open_keyboard, %function
uinput_open_keyboard:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	mov	r5, r0
	subs	r0, r0, #0
	movne	r0, #1
	bl	assert
	mov	r1, r4
	mov	r0, r5
	ldr	r2, .L17
	bl	uinput_open_common
	subs	r4, r0, #0
	blt	.L14
	ldr	r3, .L17+4
	ldr	r6, .L17+8
	ldr	r2, [r3]
	ldr	r1, [r6]
	bl	ioctl
	cmp	r0, #0
	blt	.L3
	ldr	r3, .L17+12
	mov	r0, r4
	ldr	r1, [r6]
	ldr	r2, [r3]
	bl	ioctl
	cmp	r0, #0
	blt	.L3
	ldr	r3, .L17+16
	mov	r0, r4
	ldr	r1, [r6]
	ldr	r2, [r3]
	bl	ioctl
	cmp	r0, #0
	blt	.L3
	ldr	r3, .L17+20
	mov	r0, r4
	ldr	r1, [r6]
	ldr	r2, [r3]
	bl	ioctl
	cmp	r0, #0
	blt	.L3
	ldr	r3, .L17+24
	ldr	r6, .L17+28
	mov	r0, r4
	ldr	r2, [r3]
	ldr	r1, [r6]
	bl	ioctl
	cmp	r0, #0
	blt	.L3
	ldr	r3, .L17+32
	mov	r0, r4
	ldr	r1, [r6]
	ldr	r2, [r3]
	bl	ioctl
	cmp	r0, #0
	blt	.L3
	ldr	r3, .L17+36
	ldr	r1, [r6]
	mov	r0, r4
	ldr	r2, [r3]
	bl	ioctl
	subs	r6, r0, #0
	bne	.L3
	ldr	r7, .L17+40
	ldr	r8, .L17+44
	ldr	r0, [r7]
	ldr	r9, .L17+48
.L4:
	bl	nitems
	cmp	r0, r6
	bls	.L16
.L6:
	ldr	r0, [r7]
	ldr	r3, [r8]
	ldr	r2, [r0, r6, lsl #2]
	add	r6, r6, #1
	cmp	r2, r3
	beq	.L4
	mov	r0, r4
	ldr	r1, [r9]
	bl	ioctl
	cmp	r0, #0
	blt	.L3
	ldr	r0, [r7]
	bl	nitems
	cmp	r0, r6
	bhi	.L6
.L16:
	ldr	r3, [r5]
	cmp	r3, #0
	beq	.L11
	mov	r5, #0
	ldr	r6, .L17+52
	ldr	r7, .L17+44
	ldr	r0, [r6]
	ldr	r8, .L17+48
.L8:
	bl	nitems
	cmp	r0, r5
	bls	.L11
.L10:
	ldr	r0, [r6]
	ldr	r3, [r7]
	ldr	r2, [r0, r5, lsl #2]
	add	r5, r5, #1
	cmp	r2, r3
	beq	.L8
	mov	r0, r4
	ldr	r1, [r8]
	bl	ioctl
	cmp	r0, #0
	blt	.L3
	ldr	r0, [r6]
	bl	nitems
	cmp	r0, r5
	bhi	.L10
.L11:
	ldr	r3, .L17+56
	mov	r0, r4
	ldr	r1, [r3]
	bl	ioctl
	cmp	r0, #0
	bge	.L1
.L3:
	mov	r0, r4
	bl	close
.L14:
	mvn	r4, #0
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	EV_KEY
	.word	UI_SET_EVBIT
	.word	EV_LED
	.word	EV_SYN
	.word	EV_REP
	.word	LED_CAPSL
	.word	UI_SET_LEDBIT
	.word	LED_NUML
	.word	LED_SCROLLL
	.word	keymap
	.word	NONE
	.word	UI_SET_KEYBIT
	.word	consmap
	.word	UI_DEV_CREATE
	.size	uinput_open_keyboard, .-uinput_open_keyboard
	.comm	keymap,4,4
	.comm	consmap,4,4
	.comm	UI_SET_LEDBIT,4,4
	.comm	UI_SET_KEYBIT,4,4
	.comm	UI_SET_EVBIT,4,4
	.comm	UI_DEV_CREATE,4,4
	.comm	NONE,4,4
	.comm	LED_SCROLLL,4,4
	.comm	LED_NUML,4,4
	.comm	LED_CAPSL,4,4
	.comm	EV_SYN,4,4
	.comm	EV_REP,4,4
	.comm	EV_LED,4,4
	.comm	EV_KEY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
