	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ams_input_enable
_ams_input_enable:                      ## @ams_input_enable
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	leaq	-32(%rbp), %rdx
	callq	_ams_sensors
	movq	-48(%rbp), %rax
	movq	_ams_info@GOTPCREL(%rip), %r15
	movq	%rax, 40(%r15)
	movq	-40(%rbp), %rax
	movq	%rax, 32(%r15)
	movq	-32(%rbp), %rax
	movq	%rax, 24(%r15)
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_input_allocate_polled_device
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_ams_idev_poll@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movl	$25, (%rax)
	movq	8(%rax), %rbx
	leaq	L_.str(%rip), %rax
	movq	%rax, (%rbx)
	movl	16(%r15), %eax
	movl	%eax, 32(%rbx)
	movq	$0, 24(%rbx)
	movq	8(%r15), %rax
	movq	%rax, 16(%rbx)
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movl	$-50, %edx
	movl	$50, %ecx
	movl	$3, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-50, %edx
	movl	$50, %ecx
	movl	$3, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_ABS_Z@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-50, %edx
	movl	$50, %ecx
	movl	$3, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_EV_ABS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%rbx), %esi
	callq	_set_bit
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%rbx), %esi
	callq	_set_bit
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	_set_bit
	movq	(%r15), %rdi
	callq	_input_register_polled_device
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movq	(%r15), %rdi
	callq	_input_free_polled_device
	movq	$0, (%r15)
	movl	%ebx, %r14d
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_5
LBB0_4:
	movq	_joystick@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_5:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ams_info,48,3                  ## @ams_info
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ams_idev_poll,4,2              ## @ams_idev_poll
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Apple Motion Sensor"

	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_ABS_Z,4,2                      ## @ABS_Z
	.comm	_EV_ABS,4,2                     ## @EV_ABS
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_joystick,4,2                   ## @joystick
	.no_dead_strip	_ams_input_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ams_input_enable
_ams_input_enable:                      ; @ams_input_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	add	x0, sp, #24
	add	x1, sp, #16
	add	x2, sp, #8
	bl	_ams_sensors
Lloh0:
	adrp	x20, _ams_info@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ams_info@GOTPAGEOFF]
	ldr	x10, [sp, #24]
	ldp	x9, x8, [sp, #8]
	stp	x8, x10, [x20, #32]
	str	x9, [x20, #24]
	bl	_input_allocate_polled_device
	str	x0, [x20]
	cbz	x0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _ams_idev_poll@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ams_idev_poll@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	mov	w8, #25
	str	w8, [x0]
	ldr	x19, [x0, #8]
Lloh5:
	adrp	x8, l_.str@PAGE
Lloh6:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x19]
	ldr	w8, [x20, #16]
	str	w8, [x19, #32]
	ldr	x8, [x20, #8]
	stp	x8, xzr, [x19, #16]
Lloh7:
	adrp	x8, _ABS_X@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-50
	mov	w3, #50
	mov	w4, #3
	mov	w5, #0
	bl	_input_set_abs_params
Lloh10:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-50
	mov	w3, #50
	mov	w4, #3
	mov	w5, #0
	bl	_input_set_abs_params
Lloh13:
	adrp	x8, _ABS_Z@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ABS_Z@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-50
	mov	w3, #50
	mov	w4, #3
	mov	w5, #0
	bl	_input_set_abs_params
Lloh16:
	adrp	x8, _EV_ABS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EV_ABS@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	ldr	w1, [x19, #12]
	bl	_set_bit
Lloh19:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	ldr	w1, [x19, #12]
	bl	_set_bit
Lloh22:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldr	w1, [x19, #8]
	bl	_set_bit
	ldr	x0, [x20]
	bl	_input_register_polled_device
	mov	x19, x0
	cbz	w0, LBB0_4
; %bb.2:
	ldr	x0, [x20]
	bl	_input_free_polled_device
	str	xzr, [x20]
	b	LBB0_5
LBB0_3:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_5
LBB0_4:
Lloh28:
	adrp	x8, _joystick@GOTPAGE
Lloh29:
	ldr	x8, [x8, _joystick@GOTPAGEOFF]
	mov	w9, #1
Lloh30:
	str	w9, [x8]
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_ams_info,48,3                  ; @ams_info
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ams_idev_poll,4,2              ; @ams_idev_poll
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Apple Motion Sensor"

	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_ABS_Z,4,2                      ; @ABS_Z
	.comm	_EV_ABS,4,2                     ; @EV_ABS
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_joystick,4,2                   ; @joystick
	.no_dead_strip	_ams_input_enable
.subsections_via_symbols
