	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uinput_open_mouse              ## -- Begin function uinput_open_mouse
	.p2align	4, 0x90
_uinput_open_mouse:                     ## @uinput_open_mouse
	.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, %r12
	xorl	%edi, %edi
	testq	%r12, %r12
	setne	%dil
	callq	_assert
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_uinput_open_common
	movq	$-1, %r14
	testq	%rax, %rax
	js	LBB0_19
## %bb.1:
	movq	%rax, %r15
	movq	_UI_SET_EVBIT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_EV_SYN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_16
## %bb.2:
	movl	(%rbx), %esi
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_16
## %bb.3:
	movl	(%rbx), %esi
	movq	_EV_REL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_16
## %bb.4:
	movq	_UI_SET_RELBIT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_REL_X@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_16
## %bb.5:
	movl	(%rbx), %esi
	movq	_REL_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_16
## %bb.6:
	cmpq	$0, 8(%r12)
	je	LBB0_8
## %bb.7:
	movl	(%rbx), %esi
	movq	_REL_WHEEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_16
LBB0_8:
	cmpq	$0, (%r12)
	je	LBB0_10
## %bb.9:
	movl	(%rbx), %esi
	movq	_REL_HWHEEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_16
LBB0_10:
	movq	_UI_SET_PROPBIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_INPUT_PROP_POINTER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_16
## %bb.11:
	movq	_mbuttons@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_nitems
	testq	%rax, %rax
	je	LBB0_17
## %bb.12:
	movq	_UI_SET_KEYBIT@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	(%r13), %rax
	movl	(%rax,%rbx,4), %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_14 Depth=1
	incq	%rbx
	movq	(%r13), %rdi
	callq	_nitems
	cmpq	%rax, %rbx
	jb	LBB0_14
LBB0_17:
	movq	_UI_DEV_CREATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_15
## %bb.18:
	movq	%r15, %r14
	jmp	LBB0_19
LBB0_15:
	testq	%r15, %r15
	js	LBB0_19
LBB0_16:
	movq	%r15, %rdi
	callq	_close
LBB0_19:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bluetooth Mouse"

	.comm	_UI_SET_EVBIT,4,2               ## @UI_SET_EVBIT
	.comm	_EV_SYN,4,2                     ## @EV_SYN
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_EV_REL,4,2                     ## @EV_REL
	.comm	_UI_SET_RELBIT,4,2              ## @UI_SET_RELBIT
	.comm	_REL_X,4,2                      ## @REL_X
	.comm	_REL_Y,4,2                      ## @REL_Y
	.comm	_REL_WHEEL,4,2                  ## @REL_WHEEL
	.comm	_REL_HWHEEL,4,2                 ## @REL_HWHEEL
	.comm	_UI_SET_PROPBIT,4,2             ## @UI_SET_PROPBIT
	.comm	_INPUT_PROP_POINTER,4,2         ## @INPUT_PROP_POINTER
	.comm	_mbuttons,8,3                   ## @mbuttons
	.comm	_UI_SET_KEYBIT,4,2              ## @UI_SET_KEYBIT
	.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_mouse              ; -- Begin function uinput_open_mouse
	.p2align	2
_uinput_open_mouse:                     ; @uinput_open_mouse
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	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_18
; %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_SYN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EV_SYN@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	x8, [sp]
	bl	_ioctl
	tbnz	x0, #63, LBB0_17
; %bb.2:
	ldr	w1, [x21]
Lloh7:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_17
; %bb.3:
	ldr	w1, [x21]
Lloh10:
	adrp	x8, _EV_REL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EV_REL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_17
; %bb.4:
Lloh13:
	adrp	x21, _UI_SET_RELBIT@GOTPAGE
Lloh14:
	ldr	x21, [x21, _UI_SET_RELBIT@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh15:
	adrp	x8, _REL_X@GOTPAGE
Lloh16:
	ldr	x8, [x8, _REL_X@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_17
; %bb.5:
	ldr	w1, [x21]
Lloh18:
	adrp	x8, _REL_Y@GOTPAGE
Lloh19:
	ldr	x8, [x8, _REL_Y@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_17
; %bb.6:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	w1, [x21]
Lloh21:
	adrp	x8, _REL_WHEEL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _REL_WHEEL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_17
LBB0_8:
	ldr	x8, [x20]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w1, [x21]
Lloh24:
	adrp	x8, _REL_HWHEEL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _REL_HWHEEL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_17
LBB0_10:
Lloh27:
	adrp	x8, _UI_SET_PROPBIT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _UI_SET_PROPBIT@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _INPUT_PROP_POINTER@GOTPAGE
Lloh31:
	ldr	x8, [x8, _INPUT_PROP_POINTER@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_17
; %bb.11:
Lloh33:
	adrp	x20, _mbuttons@GOTPAGE
Lloh34:
	ldr	x20, [x20, _mbuttons@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_nitems
	cbz	x0, LBB0_15
; %bb.12:
	mov	x21, #0
Lloh35:
	adrp	x22, _UI_SET_KEYBIT@GOTPAGE
Lloh36:
	ldr	x22, [x22, _UI_SET_KEYBIT@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	ldr	x8, [x20]
	ldr	w8, [x8, x21, lsl #2]
	str	x8, [sp]
	mov	x0, x19
	bl	_ioctl
	tbnz	x0, #63, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x21, x21, #1
	ldr	x0, [x20]
	bl	_nitems
	cmp	x21, x0
	b.lo	LBB0_13
LBB0_15:
Lloh37:
	adrp	x8, _UI_DEV_CREATE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _UI_DEV_CREATE@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ioctl
	tbz	x0, #63, LBB0_19
LBB0_16:
	tbnz	x19, #63, LBB0_18
LBB0_17:
	mov	x0, x19
	bl	_close
LBB0_18:
	mov	x19, #-1
LBB0_19:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.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	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bluetooth Mouse"

	.comm	_UI_SET_EVBIT,4,2               ; @UI_SET_EVBIT
	.comm	_EV_SYN,4,2                     ; @EV_SYN
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_EV_REL,4,2                     ; @EV_REL
	.comm	_UI_SET_RELBIT,4,2              ; @UI_SET_RELBIT
	.comm	_REL_X,4,2                      ; @REL_X
	.comm	_REL_Y,4,2                      ; @REL_Y
	.comm	_REL_WHEEL,4,2                  ; @REL_WHEEL
	.comm	_REL_HWHEEL,4,2                 ; @REL_HWHEEL
	.comm	_UI_SET_PROPBIT,4,2             ; @UI_SET_PROPBIT
	.comm	_INPUT_PROP_POINTER,4,2         ; @INPUT_PROP_POINTER
	.comm	_mbuttons,8,3                   ; @mbuttons
	.comm	_UI_SET_KEYBIT,4,2              ; @UI_SET_KEYBIT
	.comm	_UI_DEV_CREATE,4,2              ; @UI_DEV_CREATE
.subsections_via_symbols
