	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function udev_input_add_device
_udev_input_add_device:                 ## @udev_input_add_device
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	$0, -64(%rbp)
	leaq	-64(%rbp), %rsi
	movq	%rdx, %rdi
	callq	_stat
	xorl	%ebx, %ebx
	testq	%rax, %rax
	js	LBB0_14
## %bb.1:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_open
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	js	LBB0_14
## %bb.2:
	movq	%r13, %rbx
	movl	$1, %edi
	movl	$40, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.3:
	movq	%rax, %r13
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r13)
	movq	-64(%rbp), %rax
	movq	%rax, 32(%r13)
	movl	%r15d, 28(%r13)
	movl	%r12d, 4(%r13)
	movl	24(%r13), %edi
	movq	%r14, %rsi
	movl	$4, %edx
	callq	_strlcpy
	movq	_UDEV_INPUT_MOUSE@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_5
## %bb.4:
	movq	_UDEV_INPUT_TOUCHPAD@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_9
LBB0_5:
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_EVIOCGABS
	leaq	-56(%rbp), %rdx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %esi
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_7
## %bb.6:
	movl	-56(%rbp), %eax
	movl	-52(%rbp), %ecx
	cmpl	%ecx, %eax
	movl	$-1, %edx
	cmovgel	%edx, %eax
	cmovll	%ecx, %edx
	movl	%eax, 8(%r13)
	movl	%edx, 12(%r13)
LBB0_7:
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_EVIOCGABS
	leaq	-56(%rbp), %rdx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %esi
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_9
## %bb.8:
	movl	-56(%rbp), %eax
	movl	-52(%rbp), %ecx
	cmpl	%ecx, %eax
	movl	$-1, %edx
	cmovgel	%edx, %eax
	cmovll	%ecx, %edx
	movl	%eax, 16(%r13)
	movl	%edx, 20(%r13)
LBB0_9:
	movq	8(%rbx), %rdi
	movl	(%rbx), %eax
	leal	8(,%rax,8), %esi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movslq	(%rbx), %rcx
	leal	1(%rcx), %edx
	movl	%edx, (%rbx)
	movq	%r13, (%rax,%rcx,8)
	movq	%rax, 8(%rbx)
	movl	$1, %ebx
	jmp	LBB0_14
LBB0_12:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_close
	jmp	LBB0_13
LBB0_11:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_close
	movq	%r13, %rdi
	callq	_free
LBB0_13:
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_UDEV_INPUT_MOUSE,4,2           ## @UDEV_INPUT_MOUSE
	.comm	_UDEV_INPUT_TOUCHPAD,4,2        ## @UDEV_INPUT_TOUCHPAD
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_EPOLLIN,4,2                    ## @EPOLLIN
	.comm	_EPOLL_CTL_ADD,4,2              ## @EPOLL_CTL_ADD
	.comm	_EVFILT_READ,4,2                ## @EVFILT_READ
	.comm	_EV_ADD,4,2                     ## @EV_ADD
	.comm	_LISTENSOCKET,4,2               ## @LISTENSOCKET
	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_udev_input_add_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function udev_input_add_device
_udev_input_add_device:                 ; @udev_input_add_device
	.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	x24, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	add	x1, sp, #8
	mov	x0, x2
	bl	_stat
	tbnz	x0, #63, LBB0_12
; %bb.1:
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x23
	bl	_open
	tbnz	w0, #31, LBB0_12
; %bb.2:
	mov	x20, x0
	mov	w0, #1
	mov	w1, #40
	bl	_calloc
	cbz	x0, LBB0_10
; %bb.3:
	mov	x21, x0
	str	w20, [x0]
	ldr	x8, [sp, #8]
	str	x8, [x0, #32]
	str	w24, [x0, #28]
	str	w22, [x0, #4]
	ldr	w0, [x0, #24]
	mov	x1, x23
	mov	w2, #4
	bl	_strlcpy
Lloh6:
	adrp	x8, _UDEV_INPUT_MOUSE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _UDEV_INPUT_MOUSE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _UDEV_INPUT_TOUCHPAD@GOTPAGE
Lloh10:
	ldr	x9, [x9, _UDEV_INPUT_TOUCHPAD@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, w22
	ccmp	w9, w22, #4, ne
	b.ne	LBB0_8
; %bb.4:
Lloh12:
	adrp	x8, _ABS_X@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_EVIOCGABS
	mov	x1, x0
	mov	x2, sp
	mov	x0, x20
	bl	_ioctl
	tbnz	x0, #63, LBB0_6
; %bb.5:
	ldp	w8, w9, [sp]
	cmp	w8, w9
	csinv	w8, w8, wzr, lt
	csinv	w9, w9, wzr, lt
	stp	w8, w9, [x21, #8]
LBB0_6:
Lloh15:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_EVIOCGABS
	mov	x1, x0
	mov	x2, sp
	mov	x0, x20
	bl	_ioctl
	tbnz	x0, #63, LBB0_8
; %bb.7:
	ldp	w8, w9, [sp]
	cmp	w8, w9
	csinv	w8, w8, wzr, lt
	csinv	w9, w9, wzr, lt
	stp	w8, w9, [x21, #16]
LBB0_8:
	ldr	x0, [x19, #8]
	ldr	w8, [x19]
	lsl	w8, w8, #3
	add	w1, w8, #8
	bl	_realloc
	cbz	x0, LBB0_11
; %bb.9:
	ldrsw	x8, [x19]
	add	w9, w8, #1
	str	w9, [x19]
	str	x21, [x0, x8, lsl #3]
	str	x0, [x19, #8]
	mov	w0, #1
	b	LBB0_13
LBB0_10:
	mov	x0, x20
	bl	_close
	b	LBB0_12
LBB0_11:
	mov	x0, x20
	bl	_close
	mov	x0, x21
	bl	_free
LBB0_12:
	mov	w0, #0
LBB0_13:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_UDEV_INPUT_MOUSE,4,2           ; @UDEV_INPUT_MOUSE
	.comm	_UDEV_INPUT_TOUCHPAD,4,2        ; @UDEV_INPUT_TOUCHPAD
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_EPOLLIN,4,2                    ; @EPOLLIN
	.comm	_EPOLL_CTL_ADD,4,2              ; @EPOLL_CTL_ADD
	.comm	_EVFILT_READ,4,2                ; @EVFILT_READ
	.comm	_EV_ADD,4,2                     ; @EV_ADD
	.comm	_LISTENSOCKET,4,2               ; @LISTENSOCKET
	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_udev_input_add_device
.subsections_via_symbols
