	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hgpk_select_mode
_hgpk_select_mode:                      ## @hgpk_select_mode
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	8(%rdi), %r15
	movq	_PSMOUSE_CMD_DISABLE@GOTPCREL(%rip), %rax
	movd	(%rax), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqa	%xmm0, -80(%rbp)
	movabsq	$1039382085874, %rax            ## imm = 0xF2000000F2
	movq	%rax, -64(%rbp)
	movl	$242, -56(%rbp)
	movl	(%r15), %eax
	cmpl	$128, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$130, %eax
	je	LBB0_4
## %bb.2:
	cmpl	$129, %eax
	jne	LBB0_13
## %bb.3:
	movl	$3, (%r12)
	xorl	%r14d, %r14d
	jmp	LBB0_15
LBB0_4:
	movl	$6, (%r12)
	addq	$16, %r12
	leaq	-80(%rbp), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_9
## %bb.5:
	xorl	%ebx, %ebx
	leaq	-80(%rbp), %r14
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	-80(%rbp,%rbx,4), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movq	%r14, %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_7
LBB0_9:
	cmpl	$130, (%r15)
	jne	LBB0_10
## %bb.11:
	movq	_PSMOUSE_CMD_SETSCALE11@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_10:
	movq	_PSMOUSE_CMD_SETSCALE21@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %edx
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	testl	%eax, %eax
	je	LBB0_15
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_14:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	movl	%r14d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PSMOUSE_CMD_DISABLE,4,2        ## @PSMOUSE_CMD_DISABLE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_PSMOUSE_CMD_SETSCALE11,4,2     ## @PSMOUSE_CMD_SETSCALE11
	.comm	_PSMOUSE_CMD_SETSCALE21,4,2     ## @PSMOUSE_CMD_SETSCALE21
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_hgpk_select_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hgpk_select_mode
_hgpk_select_mode:                      ; @hgpk_select_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	x20, [x0, #8]
Lloh3:
	adrp	x8, _PSMOUSE_CMD_DISABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PSMOUSE_CMD_DISABLE@GOTPAGEOFF]
	ld1r.4s	{ v0 }, [x8]
	str	q0, [sp]
	movi.2s	v0, #242
	str	d0, [sp, #16]
	mov	w8, #242
	str	w8, [sp, #24]
	ldr	w8, [x20]
	cmp	w8, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #130
	b.eq	LBB0_4
; %bb.2:
	cmp	w8, #129
	b.ne	LBB0_10
; %bb.3:
	mov	w8, #0
	mov	w9, #3
	str	w9, [x0]
	b	LBB0_12
LBB0_4:
	add	x19, x0, #16
	mov	w8, #6
	str	w8, [x0]
	mov	x21, sp
	mov	x0, sp
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x22, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x21, x22, lsl #2]
	mov	x0, x19
	mov	x1, #0
	bl	_ps2_command
	cbnz	w0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x22, x22, #1
	mov	x0, sp
	bl	_ARRAY_SIZE
	cmp	x22, w0, sxtw
	b.lt	LBB0_6
LBB0_8:
Lloh5:
	adrp	x8, _PSMOUSE_CMD_SETSCALE11@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSMOUSE_CMD_SETSCALE11@GOTPAGEOFF]
	ldr	w9, [x20]
Lloh7:
	adrp	x10, _PSMOUSE_CMD_SETSCALE21@GOTPAGE
Lloh8:
	ldr	x10, [x10, _PSMOUSE_CMD_SETSCALE21@GOTPAGEOFF]
	cmp	w9, #130
	csel	x8, x8, x10, eq
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_ps2_command
	cbz	w0, LBB0_14
LBB0_9:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w8, w8
LBB0_12:
	ldr	x9, [sp, #40]
Lloh13:
	adrp	x10, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x10, [x10, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	cmp	x10, x9
	b.ne	LBB0_15
; %bb.13:
	mov	x0, x8
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_14:
	mov	w8, #0
	b	LBB0_12
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PSMOUSE_CMD_DISABLE,4,2        ; @PSMOUSE_CMD_DISABLE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_PSMOUSE_CMD_SETSCALE11,4,2     ; @PSMOUSE_CMD_SETSCALE11
	.comm	_PSMOUSE_CMD_SETSCALE21,4,2     ; @PSMOUSE_CMD_SETSCALE21
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_hgpk_select_mode
.subsections_via_symbols
