	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alps_setup_trackstick_v3
_alps_setup_trackstick_v3:              ## @alps_setup_trackstick_v3
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	$1, %edx
	callq	_alps_passthrough_mode_v3
	testq	%rax, %rax
	jne	LBB0_15
## %bb.1:
	movq	_PSMOUSE_CMD_SETSCALE21@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rcx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_alps_rpt_cmd
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_psmouse_warn
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	leaq	-28(%rbp), %rdx
	movq	%r15, %rdi
	callq	_psmouse_dbg
	movq	%r15, %rdi
	callq	_alps_trackstick_enter_extended_mode_v3_v6
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_psmouse_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_alps_passthrough_mode_v3
	testq	%rax, %rax
	je	LBB0_6
LBB0_15:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.7:
	negl	%ebx
	jmp	LBB0_16
LBB0_8:
	movq	%r15, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_alps_passthrough_mode_v3
	testq	%rax, %rax
	jne	LBB0_15
LBB0_9:
	movq	%r15, %rdi
	callq	_alps_enter_command_mode
	testq	%rax, %rax
	jne	LBB0_15
## %bb.10:
	addl	$8, %r14d
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_alps_command_mode_read_reg
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.11:
	movl	%eax, %ebx
	movl	$1, %edi
	callq	_BIT
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	___alps_command_mode_write_reg
	testq	%rax, %rax
	je	LBB0_12
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_12:
	xorl	%ebx, %ebx
LBB0_14:
	movq	%r15, %rdi
	callq	_alps_exit_command_mode
	testq	%rax, %rax
	jne	LBB0_15
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_PSMOUSE_CMD_SETSCALE21,4,2     ## @PSMOUSE_CMD_SETSCALE21
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to initialize trackstick (E7 report failed)\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"trackstick E7 report: %3ph\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to enter into trackstick extended mode\n"

	.no_dead_strip	_alps_setup_trackstick_v3
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alps_setup_trackstick_v3
_alps_setup_trackstick_v3:              ; @alps_setup_trackstick_v3
	.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	x20, x1
	mov	x19, x0
	mov	w2, #1
	bl	_alps_passthrough_mode_v3
	cbnz	x0, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _PSMOUSE_CMD_SETSCALE21@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PSMOUSE_CMD_SETSCALE21@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x0, x19
	mov	w1, #0
	bl	_alps_rpt_cmd
	cbz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_psmouse_warn
Lloh5:
	adrp	x8, _ENODEV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #12
	mov	x0, x19
	bl	_psmouse_dbg
	mov	x0, x19
	bl	_alps_trackstick_enter_extended_mode_v3_v6
	cbz	x0, LBB0_10
; %bb.4:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_5:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_alps_passthrough_mode_v3
	cbz	x0, LBB0_8
LBB0_6:
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	mov	x0, x20
	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
LBB0_8:
	cbz	w21, LBB0_11
; %bb.9:
	neg	w20, w21
	b	LBB0_7
LBB0_10:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_alps_passthrough_mode_v3
	cbnz	x0, LBB0_6
LBB0_11:
	mov	x0, x19
	bl	_alps_enter_command_mode
	cbnz	x0, LBB0_6
; %bb.12:
	add	w1, w20, #8
	mov	x0, x19
	bl	_alps_command_mode_read_reg
	cmn	w0, #1
	b.eq	LBB0_14
; %bb.13:
	mov	x20, x0
	mov	w0, #1
	bl	_BIT
	orr	w1, w0, w20
	mov	x0, x19
	bl	___alps_command_mode_write_reg
	cbz	x0, LBB0_15
LBB0_14:
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_16
LBB0_15:
	mov	w20, #0
LBB0_16:
	mov	x0, x19
	bl	_alps_exit_command_mode
	cbnz	x0, LBB0_6
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_PSMOUSE_CMD_SETSCALE21,4,2     ; @PSMOUSE_CMD_SETSCALE21
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to initialize trackstick (E7 report failed)\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"trackstick E7 report: %3ph\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to enter into trackstick extended mode\n"

	.no_dead_strip	_alps_setup_trackstick_v3
.subsections_via_symbols
