	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function applesmc_create_accelerometer
_applesmc_create_accelerometer:         ## @applesmc_create_accelerometer
	.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
	movq	_smcreg@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movq	_accelerometer_group@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	$1, %esi
	callq	_applesmc_create_nodes
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_input_allocate_polled_device
	movq	_applesmc_idev@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_applesmc_idev_poll@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%rax)
	movq	_APPLESMC_POLL_INTERVAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	xorl	%eax, %eax
	callq	_applesmc_calibrate
	movq	(%r14), %rax
	movq	(%rax), %r14
	leaq	L_.str(%rip), %rax
	movq	%rax, (%r14)
	movq	_BUS_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r14)
	movq	_pdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r14)
	movq	_EV_ABS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT_MASK
	movq	8(%r14), %rcx
	movl	%eax, (%rcx)
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_APPLESMC_INPUT_FUZZ@GOTPCREL(%rip), %r13
	movl	(%r13), %r8d
	movq	_APPLESMC_INPUT_FLAT@GOTPCREL(%rip), %r12
	movl	(%r12), %r9d
	movq	%r14, %rdi
	movl	$-256, %edx
	movl	$256, %ecx                      ## imm = 0x100
	callq	_input_set_abs_params
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %r8d
	movl	(%r12), %r9d
	movq	_applesmc_idev@GOTPCREL(%rip), %r12
	movq	%r14, %rdi
	movl	$-256, %edx
	movl	$256, %ecx                      ## imm = 0x100
	callq	_input_set_abs_params
	movq	(%r12), %rdi
	callq	_input_register_polled_device
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:
	movl	%eax, %r14d
	movq	(%r12), %rdi
	callq	_input_free_polled_device
	movl	%r14d, %ebx
	jmp	LBB0_7
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	(%r15), %edi
	callq	_applesmc_destroy_nodes
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_warn
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_smcreg,4,2                     ## @smcreg
	.comm	_accelerometer_group,4,2        ## @accelerometer_group
	.comm	_applesmc_idev,8,3              ## @applesmc_idev
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_applesmc_idev_poll,4,2         ## @applesmc_idev_poll
	.comm	_APPLESMC_POLL_INTERVAL,4,2     ## @APPLESMC_POLL_INTERVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"applesmc"

	.comm	_BUS_HOST,4,2                   ## @BUS_HOST
	.comm	_pdev,8,3                       ## @pdev
	.comm	_EV_ABS,4,2                     ## @EV_ABS
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_APPLESMC_INPUT_FUZZ,4,2        ## @APPLESMC_INPUT_FUZZ
	.comm	_APPLESMC_INPUT_FLAT,4,2        ## @APPLESMC_INPUT_FLAT
	.comm	_ABS_Y,4,2                      ## @ABS_Y
L_.str.1:                               ## @.str.1
	.asciz	"driver init failed (ret=%d)!\n"

	.no_dead_strip	_applesmc_create_accelerometer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function applesmc_create_accelerometer
_applesmc_create_accelerometer:         ; @applesmc_create_accelerometer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x8, _smcreg@GOTPAGE
Lloh1:
	ldr	x8, [x8, _smcreg@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_5
; %bb.1:
Lloh3:
	adrp	x20, _accelerometer_group@GOTPAGE
Lloh4:
	ldr	x20, [x20, _accelerometer_group@GOTPAGEOFF]
	ldr	w0, [x20]
	mov	w1, #1
	bl	_applesmc_create_nodes
	mov	x19, x0
	cbnz	w0, LBB0_8
; %bb.2:
	bl	_input_allocate_polled_device
Lloh5:
	adrp	x21, _applesmc_idev@GOTPAGE
Lloh6:
	ldr	x21, [x21, _applesmc_idev@GOTPAGEOFF]
	str	x0, [x21]
	cbz	x0, LBB0_6
; %bb.3:
Lloh7:
	adrp	x8, _applesmc_idev_poll@GOTPAGE
Lloh8:
	ldr	x8, [x8, _applesmc_idev_poll@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _APPLESMC_POLL_INTERVAL@GOTPAGE
Lloh11:
	ldr	x9, [x9, _APPLESMC_POLL_INTERVAL@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #8]
	bl	_applesmc_calibrate
	ldr	x8, [x21]
	ldr	x19, [x8]
Lloh13:
	adrp	x8, l_.str@PAGE
Lloh14:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x19]
Lloh15:
	adrp	x8, _BUS_HOST@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BUS_HOST@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _pdev@GOTPAGE
Lloh19:
	ldr	x9, [x9, _pdev@GOTPAGEOFF]
	str	w8, [x19, #24]
Lloh20:
	ldr	x8, [x9]
	str	x8, [x19, #16]
Lloh21:
	adrp	x8, _EV_ABS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EV_ABS@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	bl	_BIT_MASK
	ldr	x8, [x19, #8]
	str	w0, [x8]
Lloh24:
	adrp	x8, _ABS_X@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x22, _APPLESMC_INPUT_FUZZ@GOTPAGE
Lloh28:
	ldr	x22, [x22, _APPLESMC_INPUT_FUZZ@GOTPAGEOFF]
	ldr	w4, [x22]
Lloh29:
	adrp	x23, _APPLESMC_INPUT_FLAT@GOTPAGE
Lloh30:
	ldr	x23, [x23, _APPLESMC_INPUT_FLAT@GOTPAGEOFF]
	ldr	w5, [x23]
	mov	x0, x19
	mov	w2, #-256
	mov	w3, #256
	bl	_input_set_abs_params
Lloh31:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	ldr	w4, [x22]
	ldr	w5, [x23]
	mov	x0, x19
	mov	w2, #-256
	mov	w3, #256
	bl	_input_set_abs_params
	ldr	x0, [x21]
	bl	_input_register_polled_device
	mov	x19, x0
	cbz	w0, LBB0_9
; %bb.4:
	ldr	x0, [x21]
	bl	_input_free_polled_device
	b	LBB0_7
LBB0_5:
	mov	w19, #0
	b	LBB0_9
LBB0_6:
Lloh34:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_7:
	ldr	w0, [x20]
	bl	_applesmc_destroy_nodes
LBB0_8:
Lloh37:
	adrp	x0, l_.str.1@PAGE
Lloh38:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_pr_warn
LBB0_9:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_smcreg,4,2                     ; @smcreg
	.comm	_accelerometer_group,4,2        ; @accelerometer_group
	.comm	_applesmc_idev,8,3              ; @applesmc_idev
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_applesmc_idev_poll,4,2         ; @applesmc_idev_poll
	.comm	_APPLESMC_POLL_INTERVAL,4,2     ; @APPLESMC_POLL_INTERVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"applesmc"

	.comm	_BUS_HOST,4,2                   ; @BUS_HOST
	.comm	_pdev,8,3                       ; @pdev
	.comm	_EV_ABS,4,2                     ; @EV_ABS
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_APPLESMC_INPUT_FUZZ,4,2        ; @APPLESMC_INPUT_FUZZ
	.comm	_APPLESMC_INPUT_FLAT,4,2        ; @APPLESMC_INPUT_FLAT
	.comm	_ABS_Y,4,2                      ; @ABS_Y
l_.str.1:                               ; @.str.1
	.asciz	"driver init failed (ret=%d)!\n"

	.no_dead_strip	_applesmc_create_accelerometer
.subsections_via_symbols
