	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uinput_open_keyboard           ## -- Begin function uinput_open_keyboard
	.p2align	4, 0x90
_uinput_open_keyboard:                  ## @uinput_open_keyboard
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_assert
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_uinput_open_common
	movq	$-1, %r14
	testq	%rax, %rax
	js	LBB0_25
## %bb.1:
	movq	%rax, %rbx
	movq	_UI_SET_EVBIT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_24
## %bb.2:
	movl	(%r12), %esi
	movq	_EV_LED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_24
## %bb.3:
	movl	(%r12), %esi
	movq	_EV_SYN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_24
## %bb.4:
	movl	(%r12), %esi
	movq	_EV_REP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_24
## %bb.5:
	movq	_UI_SET_LEDBIT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_LED_CAPSL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_24
## %bb.6:
	movl	(%r12), %esi
	movq	_LED_NUML@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_24
## %bb.7:
	movl	(%r12), %esi
	movq	_LED_SCROLLL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_8
LBB0_24:
	movq	%rbx, %rdi
	callq	_close
LBB0_25:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_keymap@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_nitems
	testq	%rax, %rax
	je	LBB0_14
## %bb.9:
	xorl	%r13d, %r13d
	jmp	LBB0_10
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r12), %rdi
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%r13
	callq	_nitems
	cmpq	%rax, %r13
	jae	LBB0_14
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	movq	(%rdi,%r13,8), %rdx
	movq	_NONE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_UI_SET_KEYBIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_12
	jmp	LBB0_23
LBB0_14:
	cmpq	$0, (%r15)
	je	LBB0_21
## %bb.15:
	movq	_consmap@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_nitems
	testq	%rax, %rax
	je	LBB0_21
## %bb.16:
	movq	_NONE@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_17
LBB0_20:                                ##   in Loop: Header=BB0_17 Depth=1
	incq	%r13
	callq	_nitems
	cmpq	%rax, %r13
	jae	LBB0_21
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movq	(%rdi,%r13,8), %rdx
	cmpq	(%r12), %rdx
	je	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	_UI_SET_KEYBIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_23
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	(%r15), %rdi
	jmp	LBB0_20
LBB0_21:
	movq	_UI_DEV_CREATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_23
## %bb.22:
	movq	%rbx, %r14
	jmp	LBB0_25
LBB0_23:
	testq	%rbx, %rbx
	jns	LBB0_24
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bluetooth Keyboard"

	.comm	_UI_SET_EVBIT,4,2               ## @UI_SET_EVBIT
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_EV_LED,4,2                     ## @EV_LED
	.comm	_EV_SYN,4,2                     ## @EV_SYN
	.comm	_EV_REP,4,2                     ## @EV_REP
	.comm	_UI_SET_LEDBIT,4,2              ## @UI_SET_LEDBIT
	.comm	_LED_CAPSL,4,2                  ## @LED_CAPSL
	.comm	_LED_NUML,4,2                   ## @LED_NUML
	.comm	_LED_SCROLLL,4,2                ## @LED_SCROLLL
	.comm	_keymap,8,3                     ## @keymap
	.comm	_NONE,8,3                       ## @NONE
	.comm	_UI_SET_KEYBIT,4,2              ## @UI_SET_KEYBIT
	.comm	_consmap,8,3                    ## @consmap
	.comm	_UI_DEV_CREATE,4,2              ## @UI_DEV_CREATE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uinput_open_keyboard           ; -- Begin function uinput_open_keyboard
	.p2align	2
_uinput_open_keyboard:                  ; @uinput_open_keyboard
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	bl	_uinput_open_common
	tbnz	x0, #63, LBB0_9
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x21, _UI_SET_EVBIT@GOTPAGE
Lloh3:
	ldr	x21, [x21, _UI_SET_EVBIT@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh4:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	x8, [sp]
	bl	_ioctl
	tbnz	x0, #63, LBB0_8
; %bb.2:
	ldr	w1, [x21]
Lloh7:
	adrp	x8, _EV_LED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EV_LED@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_8
; %bb.3:
	ldr	w1, [x21]
Lloh10:
	adrp	x8, _EV_SYN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EV_SYN@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_8
; %bb.4:
	ldr	w1, [x21]
Lloh13:
	adrp	x8, _EV_REP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EV_REP@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_8
; %bb.5:
Lloh16:
	adrp	x21, _UI_SET_LEDBIT@GOTPAGE
Lloh17:
	ldr	x21, [x21, _UI_SET_LEDBIT@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh18:
	adrp	x8, _LED_CAPSL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LED_CAPSL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_8
; %bb.6:
	ldr	w1, [x21]
Lloh21:
	adrp	x8, _LED_NUML@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LED_NUML@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_8
; %bb.7:
	ldr	w1, [x21]
Lloh24:
	adrp	x8, _LED_SCROLLL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LED_SCROLLL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	cbz	x0, LBB0_11
LBB0_8:
	mov	x0, x19
	bl	_close
LBB0_9:
	mov	x19, #-1
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
Lloh27:
	adrp	x21, _keymap@GOTPAGE
Lloh28:
	ldr	x21, [x21, _keymap@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_nitems
	cbz	x0, LBB0_17
; %bb.12:
	mov	x22, #0
Lloh29:
	adrp	x23, _NONE@GOTPAGE
Lloh30:
	ldr	x23, [x23, _NONE@GOTPAGEOFF]
Lloh31:
	adrp	x24, _UI_SET_KEYBIT@GOTPAGE
Lloh32:
	ldr	x24, [x24, _UI_SET_KEYBIT@GOTPAGEOFF]
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	x0, [x21]
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x22, x22, #1
	bl	_nitems
	cmp	x22, x0
	b.hs	LBB0_17
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	ldr	x8, [x0, x22, lsl #3]
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w1, [x24]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbz	x0, #63, LBB0_13
	b	LBB0_25
LBB0_17:
	ldr	x8, [x20]
	cbz	x8, LBB0_24
; %bb.18:
Lloh33:
	adrp	x20, _consmap@GOTPAGE
Lloh34:
	ldr	x20, [x20, _consmap@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_nitems
	cbz	x0, LBB0_24
; %bb.19:
	mov	x21, #0
Lloh35:
	adrp	x22, _NONE@GOTPAGE
Lloh36:
	ldr	x22, [x22, _NONE@GOTPAGEOFF]
Lloh37:
	adrp	x23, _UI_SET_KEYBIT@GOTPAGE
Lloh38:
	ldr	x23, [x23, _UI_SET_KEYBIT@GOTPAGEOFF]
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	add	x21, x21, #1
	bl	_nitems
	cmp	x21, x0
	b.hs	LBB0_24
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	x8, [x0, x21, lsl #3]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_20
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	w1, [x23]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_25
; %bb.23:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x0, [x20]
	b	LBB0_20
LBB0_24:
Lloh39:
	adrp	x8, _UI_DEV_CREATE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _UI_DEV_CREATE@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ioctl
	tbz	x0, #63, LBB0_10
LBB0_25:
	tbz	x19, #63, LBB0_8
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bluetooth Keyboard"

	.comm	_UI_SET_EVBIT,4,2               ; @UI_SET_EVBIT
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_EV_LED,4,2                     ; @EV_LED
	.comm	_EV_SYN,4,2                     ; @EV_SYN
	.comm	_EV_REP,4,2                     ; @EV_REP
	.comm	_UI_SET_LEDBIT,4,2              ; @UI_SET_LEDBIT
	.comm	_LED_CAPSL,4,2                  ; @LED_CAPSL
	.comm	_LED_NUML,4,2                   ; @LED_NUML
	.comm	_LED_SCROLLL,4,2                ; @LED_SCROLLL
	.comm	_keymap,8,3                     ; @keymap
	.comm	_NONE,8,3                       ; @NONE
	.comm	_UI_SET_KEYBIT,4,2              ; @UI_SET_KEYBIT
	.comm	_consmap,8,3                    ; @consmap
	.comm	_UI_DEV_CREATE,4,2              ; @UI_DEV_CREATE
.subsections_via_symbols
