	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alps_hw_init_v3
_alps_hw_init_v3:                       ## @alps_hw_init_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	_ALPS_DUALPOINT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_ALPS_REG_BASE_PINNACLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_alps_setup_trackstick_v3
	movq	_EIO@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	je	LBB0_5
LBB0_2:
	movq	%r14, %rdi
	callq	_alps_enter_command_mode
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_alps_absolute_mode_v3
	testq	%rax, %rax
	je	LBB0_6
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_psmouse_err
LBB0_5:
	movq	%r14, %rdi
	callq	_alps_exit_command_mode
LBB0_21:
	movl	$-1, %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movq	%r14, %rdi
	movl	$6, %esi
	callq	_alps_command_mode_read_reg
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.7:
	orl	$1, %eax
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	___alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_5
## %bb.8:
	movq	%r14, %rdi
	movl	$7, %esi
	callq	_alps_command_mode_read_reg
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.9:
	orl	$1, %eax
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	___alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_5
## %bb.10:
	movq	%r14, %rdi
	movl	$324, %esi                      ## imm = 0x144
	callq	_alps_command_mode_read_reg
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.11:
	movq	%r14, %rdi
	movl	$4, %esi
	callq	___alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_5
## %bb.12:
	movq	%r14, %rdi
	movl	$345, %esi                      ## imm = 0x159
	callq	_alps_command_mode_read_reg
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.13:
	movq	%r14, %rdi
	movl	$3, %esi
	callq	___alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_5
## %bb.14:
	movq	%r14, %rdi
	movl	$355, %esi                      ## imm = 0x163
	callq	_alps_command_mode_read_reg
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.15:
	movq	%r14, %rdi
	movl	$355, %esi                      ## imm = 0x163
	movl	$3, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_5
## %bb.16:
	movq	%r14, %rdi
	movl	$354, %esi                      ## imm = 0x162
	callq	_alps_command_mode_read_reg
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.17:
	movq	%r14, %rdi
	movl	$354, %esi                      ## imm = 0x162
	movl	$4, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_5
## %bb.18:
	movq	%r14, %rdi
	callq	_alps_exit_command_mode
	movb	$100, -20(%rbp)
	movq	_PSMOUSE_CMD_SETRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-20(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:
	movq	_PSMOUSE_CMD_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	testq	%rax, %rax
	je	LBB0_22
LBB0_20:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_psmouse_err
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_ALPS_DUALPOINT,4,2             ## @ALPS_DUALPOINT
	.comm	_ALPS_REG_BASE_PINNACLE,4,2     ## @ALPS_REG_BASE_PINNACLE
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to enter absolute mode\n"

	.comm	_PSMOUSE_CMD_SETRATE,4,2        ## @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_ENABLE,4,2         ## @PSMOUSE_CMD_ENABLE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to enable data reporting\n"

	.no_dead_strip	_alps_hw_init_v3
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alps_hw_init_v3
_alps_hw_init_v3:                       ; @alps_hw_init_v3
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _ALPS_DUALPOINT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ALPS_DUALPOINT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ALPS_REG_BASE_PINNACLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ALPS_REG_BASE_PINNACLE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_alps_setup_trackstick_v3
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_alps_enter_command_mode
	cbnz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_alps_absolute_mode_v3
	cbz	x0, LBB0_8
LBB0_4:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
LBB0_5:
	mov	x0, x19
	bl	_alps_exit_command_mode
LBB0_6:
	mov	w0, #-1
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_8:
	mov	x0, x19
	mov	w1, #6
	bl	_alps_command_mode_read_reg
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.9:
	orr	w1, w0, #0x1
	mov	x0, x19
	bl	___alps_command_mode_write_reg
	cbnz	x0, LBB0_5
; %bb.10:
	mov	x0, x19
	mov	w1, #7
	bl	_alps_command_mode_read_reg
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.11:
	orr	w1, w0, #0x1
	mov	x0, x19
	bl	___alps_command_mode_write_reg
	cbnz	x0, LBB0_5
; %bb.12:
	mov	x0, x19
	mov	w1, #324
	bl	_alps_command_mode_read_reg
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.13:
	mov	x0, x19
	mov	w1, #4
	bl	___alps_command_mode_write_reg
	cbnz	x0, LBB0_5
; %bb.14:
	mov	x0, x19
	mov	w1, #345
	bl	_alps_command_mode_read_reg
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.15:
	mov	x0, x19
	mov	w1, #3
	bl	___alps_command_mode_write_reg
	cbnz	x0, LBB0_5
; %bb.16:
	mov	x0, x19
	mov	w1, #355
	bl	_alps_command_mode_read_reg
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.17:
	mov	x0, x19
	mov	w1, #355
	mov	w2, #3
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_5
; %bb.18:
	mov	x0, x19
	mov	w1, #354
	bl	_alps_command_mode_read_reg
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.19:
	mov	x0, x19
	mov	w1, #354
	mov	w2, #4
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_5
; %bb.20:
	mov	x0, x19
	bl	_alps_exit_command_mode
	mov	w8, #100
	strb	w8, [sp, #12]
Lloh11:
	adrp	x8, _PSMOUSE_CMD_SETRATE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PSMOUSE_CMD_SETRATE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	add	x1, sp, #12
	mov	x0, x19
	bl	_ps2_command
	cbnz	x0, LBB0_22
; %bb.21:
Lloh14:
	adrp	x8, _PSMOUSE_CMD_ENABLE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PSMOUSE_CMD_ENABLE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_ps2_command
	cbz	x0, LBB0_7
LBB0_22:
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ALPS_DUALPOINT,4,2             ; @ALPS_DUALPOINT
	.comm	_ALPS_REG_BASE_PINNACLE,4,2     ; @ALPS_REG_BASE_PINNACLE
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to enter absolute mode\n"

	.comm	_PSMOUSE_CMD_SETRATE,4,2        ; @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_ENABLE,4,2         ; @PSMOUSE_CMD_ENABLE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to enable data reporting\n"

	.no_dead_strip	_alps_hw_init_v3
.subsections_via_symbols
