	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hgpk_reset_device
_hgpk_reset_device:                     ## @hgpk_reset_device
	.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, %ebx
	movq	%rdi, %r15
	callq	_psmouse_reset
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.1:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$245, %edx
	callq	_ps2_command
	movl	$-1, %r14d
	testq	%rax, %rax
	jne	LBB0_9
## %bb.2:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$245, %edx
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_9
## %bb.3:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$230, %edx
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$245, %edx
	callq	_ps2_command
	testq	%rax, %rax
	jne	LBB0_9
## %bb.5:
	movl	$150, %edi
	callq	_msleep
LBB0_6:
	movq	%r15, %rdi
	callq	_hgpk_select_mode
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_psmouse_err
	jmp	LBB0_9
LBB0_8:
	movq	%r15, %rdi
	callq	_hgpk_reset_hack_state
	xorl	%r14d, %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to select mode\n"

	.no_dead_strip	_hgpk_reset_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hgpk_reset_device
_hgpk_reset_device:                     ; @hgpk_reset_device
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_psmouse_reset
	cbz	w20, LBB0_7
; %bb.1:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #245
	bl	_ps2_command
	cbnz	x0, LBB0_5
; %bb.2:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #245
	bl	_ps2_command
	cbnz	x0, LBB0_5
; %bb.3:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #230
	bl	_ps2_command
	cbnz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #245
	bl	_ps2_command
	cbz	x0, LBB0_6
LBB0_5:
	mov	w20, #-1
	b	LBB0_10
LBB0_6:
	mov	w0, #150
	bl	_msleep
LBB0_7:
	mov	x0, x19
	bl	_hgpk_select_mode
	mov	x20, x0
	cbz	w0, LBB0_9
; %bb.8:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_hgpk_reset_hack_state
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to select mode\n"

	.no_dead_strip	_hgpk_reset_device
.subsections_via_symbols
