	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alps_hw_init_v4
_alps_hw_init_v4:                       ## @alps_hw_init_v4
	.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
	movq	%rdi, %r14
	callq	_alps_enter_command_mode
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movq	%r14, %rdi
	callq	_alps_absolute_mode_v4
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_psmouse_err
	jmp	LBB0_3
LBB0_4:
	movq	%r14, %rdi
	movl	$7, %esi
	movl	$140, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.5:
	movq	%r14, %rdi
	movl	$329, %esi                      ## imm = 0x149
	movl	$3, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.6:
	movq	%r14, %rdi
	movl	$352, %esi                      ## imm = 0x160
	movl	$3, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.7:
	movq	%r14, %rdi
	movl	$383, %esi                      ## imm = 0x17F
	movl	$21, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.8:
	movq	%r14, %rdi
	movl	$337, %esi                      ## imm = 0x151
	movl	$1, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.9:
	movq	%r14, %rdi
	movl	$360, %esi                      ## imm = 0x168
	movl	$3, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.10:
	movq	%r14, %rdi
	movl	$330, %esi                      ## imm = 0x14A
	movl	$3, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.11:
	movq	%r14, %rdi
	movl	$353, %esi                      ## imm = 0x161
	movl	$3, %edx
	callq	_alps_command_mode_write_reg
	testq	%rax, %rax
	je	LBB0_12
LBB0_3:
	movq	%r14, %rdi
	callq	_alps_exit_command_mode
LBB0_19:
	movl	$-1, %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%r14, %rdi
	callq	_alps_exit_command_mode
	movw	$25800, -28(%rbp)               ## imm = 0x64C8
	movb	$80, -26(%rbp)
	movq	_PSMOUSE_CMD_SETRATE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	leaq	-28(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ps2_command
	movl	$-1, %ebx
	testq	%rax, %rax
	jne	LBB0_20
## %bb.13:
	leaq	-27(%rbp), %rsi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_20
## %bb.14:
	leaq	-26(%rbp), %rsi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_20
## %bb.15:
	movq	_PSMOUSE_CMD_GETID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_20
## %bb.16:
	movb	$100, -28(%rbp)
	movl	(%r15), %edx
	leaq	-28(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:
	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_20
LBB0_18:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_psmouse_err
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.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_GETID,4,2          ## @PSMOUSE_CMD_GETID
	.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_v4
.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_v4
_alps_hw_init_v4:                       ; @alps_hw_init_v4
	.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	x19, x0
	bl	_alps_enter_command_mode
	cbnz	x0, LBB0_11
; %bb.1:
	mov	x0, x19
	bl	_alps_absolute_mode_v4
	cbz	x0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
	b	LBB0_11
LBB0_3:
	mov	x0, x19
	mov	w1, #7
	mov	w2, #140
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_11
; %bb.4:
	mov	x0, x19
	mov	w1, #329
	mov	w2, #3
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_11
; %bb.5:
	mov	x0, x19
	mov	w1, #352
	mov	w2, #3
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_11
; %bb.6:
	mov	x0, x19
	mov	w1, #383
	mov	w2, #21
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_11
; %bb.7:
	mov	x0, x19
	mov	w1, #337
	mov	w2, #1
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_11
; %bb.8:
	mov	x0, x19
	mov	w1, #360
	mov	w2, #3
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_11
; %bb.9:
	mov	x0, x19
	mov	w1, #330
	mov	w2, #3
	bl	_alps_command_mode_write_reg
	cbnz	x0, LBB0_11
; %bb.10:
	mov	x0, x19
	mov	w1, #353
	mov	w2, #3
	bl	_alps_command_mode_write_reg
	cbz	x0, LBB0_14
LBB0_11:
	mov	x0, x19
	bl	_alps_exit_command_mode
LBB0_12:
	mov	w0, #-1
LBB0_13:
	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_14:
	mov	x0, x19
	bl	_alps_exit_command_mode
	mov	w8, #25800
	strh	w8, [sp, #12]
	add	x21, sp, #12
	mov	w8, #80
	strb	w8, [sp, #14]
Lloh2:
	adrp	x20, _PSMOUSE_CMD_SETRATE@GOTPAGE
Lloh3:
	ldr	x20, [x20, _PSMOUSE_CMD_SETRATE@GOTPAGEOFF]
	ldr	w2, [x20]
	add	x1, sp, #12
	mov	x0, x19
	bl	_ps2_command
	cbnz	x0, LBB0_12
; %bb.15:
	add	x1, x21, #1
	ldr	w2, [x20]
	mov	x0, x19
	bl	_ps2_command
	cbnz	x0, LBB0_12
; %bb.16:
	add	x1, x21, #2
	ldr	w2, [x20]
	mov	x0, x19
	bl	_ps2_command
	cbnz	x0, LBB0_12
; %bb.17:
Lloh4:
	adrp	x8, _PSMOUSE_CMD_GETID@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PSMOUSE_CMD_GETID@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	add	x1, sp, #12
	mov	x0, x19
	bl	_ps2_command
	cbnz	x0, LBB0_12
; %bb.18:
	mov	w8, #100
	strb	w8, [sp, #12]
	ldr	w2, [x20]
	add	x1, sp, #12
	mov	x0, x19
	bl	_ps2_command
	cbnz	x0, LBB0_20
; %bb.19:
Lloh7:
	adrp	x8, _PSMOUSE_CMD_ENABLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PSMOUSE_CMD_ENABLE@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_ps2_command
	cbz	x0, LBB0_13
LBB0_20:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.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_GETID,4,2          ; @PSMOUSE_CMD_GETID
	.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_v4
.subsections_via_symbols
