	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hgpk_register
_hgpk_register:                         ## @hgpk_register
	.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, %rbx
	movq	56(%rdi), %rax
	movq	_hgpk_process_byte@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 52(%rdi)
	movq	_hgpk_poll@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 48(%rdi)
	movq	_hgpk_disconnect@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 44(%rdi)
	movq	_hgpk_reconnect@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%rdi)
	movq	$0, 32(%rdi)
	movl	$1024, (%rdi)                   ## imm = 0x400
	movl	24(%rdi), %edi
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_hgpk_setup_input_device
	movq	16(%rbx), %rdi
	movq	_psmouse_attr_powered@GOTPCREL(%rip), %rsi
	callq	_device_create_file
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_psmouse_err
	jmp	LBB0_8
LBB0_2:
	movq	16(%rbx), %rdi
	movq	_psmouse_attr_hgpk_mode@GOTPCREL(%rip), %rsi
	callq	_device_create_file
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_psmouse_err
LBB0_7:
	movq	16(%rbx), %rdi
	movq	_psmouse_attr_powered@GOTPCREL(%rip), %rsi
	callq	_device_remove_file
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	8(%rbx), %rax
	movq	_HGPK_MODEL_C@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	jl	LBB0_8
## %bb.5:
	movq	16(%rbx), %rdi
	movq	_psmouse_attr_recalibrate@GOTPCREL(%rip), %rsi
	callq	_device_create_file
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_psmouse_err
	movq	16(%rbx), %rdi
	movq	_psmouse_attr_hgpk_mode@GOTPCREL(%rip), %rsi
	callq	_device_remove_file
	movl	%r15d, %r14d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_hgpk_process_byte,4,2          ## @hgpk_process_byte
	.comm	_hgpk_poll,4,2                  ## @hgpk_poll
	.comm	_hgpk_disconnect,4,2            ## @hgpk_disconnect
	.comm	_hgpk_reconnect,4,2             ## @hgpk_reconnect
	.comm	_psmouse_attr_powered,4,2       ## @psmouse_attr_powered
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed creating 'powered' sysfs node\n"

	.comm	_psmouse_attr_hgpk_mode,4,2     ## @psmouse_attr_hgpk_mode
L_.str.1:                               ## @.str.1
	.asciz	"Failed creating 'hgpk_mode' sysfs node\n"

	.comm	_HGPK_MODEL_C,8,3               ## @HGPK_MODEL_C
	.comm	_psmouse_attr_recalibrate,4,2   ## @psmouse_attr_recalibrate
L_.str.2:                               ## @.str.2
	.asciz	"Failed creating 'recalibrate' sysfs node\n"

	.no_dead_strip	_hgpk_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hgpk_register
_hgpk_register:                         ; @hgpk_register
	.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	x19, x0
	ldr	x8, [x0, #56]
Lloh0:
	adrp	x9, _hgpk_process_byte@GOTPAGE
Lloh1:
	ldr	x9, [x9, _hgpk_process_byte@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _hgpk_poll@GOTPAGE
Lloh4:
	ldr	x10, [x10, _hgpk_poll@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
Lloh6:
	adrp	x11, _hgpk_disconnect@GOTPAGE
Lloh7:
	ldr	x11, [x11, _hgpk_disconnect@GOTPAGEOFF]
	stp	w10, w9, [x0, #48]
Lloh8:
	ldr	w9, [x11]
Lloh9:
	adrp	x10, _hgpk_reconnect@GOTPAGE
Lloh10:
	ldr	x10, [x10, _hgpk_reconnect@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	stp	w10, w9, [x0, #40]
	str	xzr, [x0, #32]
	mov	w9, #1024
	str	w9, [x0]
	ldr	w0, [x0, #24]
	ldr	w2, [x8]
	mov	x1, #0
	bl	_hgpk_setup_input_device
	ldr	x0, [x19, #16]
Lloh12:
	adrp	x1, _psmouse_attr_powered@GOTPAGE
Lloh13:
	ldr	x1, [x1, _psmouse_attr_powered@GOTPAGEOFF]
	bl	_device_create_file
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
	b	LBB0_5
LBB0_2:
	ldr	x0, [x19, #16]
Lloh16:
	adrp	x1, _psmouse_attr_hgpk_mode@GOTPAGE
Lloh17:
	ldr	x1, [x1, _psmouse_attr_hgpk_mode@GOTPAGEOFF]
	bl	_device_create_file
	cbz	w0, LBB0_6
; %bb.3:
	mov	x20, x0
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
LBB0_4:
	ldr	x0, [x19, #16]
Lloh20:
	adrp	x1, _psmouse_attr_powered@GOTPAGE
Lloh21:
	ldr	x1, [x1, _psmouse_attr_powered@GOTPAGEOFF]
	bl	_device_remove_file
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	x8, [x19, #8]
Lloh22:
	adrp	x9, _HGPK_MODEL_C@GOTPAGE
Lloh23:
	ldr	x9, [x9, _HGPK_MODEL_C@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.7:
	mov	w20, #0
	b	LBB0_5
LBB0_8:
	ldr	x0, [x19, #16]
Lloh25:
	adrp	x1, _psmouse_attr_recalibrate@GOTPAGE
Lloh26:
	ldr	x1, [x1, _psmouse_attr_recalibrate@GOTPAGEOFF]
	bl	_device_create_file
	mov	x20, x0
	cbz	w0, LBB0_5
; %bb.9:
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
	ldr	x0, [x19, #16]
Lloh29:
	adrp	x1, _psmouse_attr_hgpk_mode@GOTPAGE
Lloh30:
	ldr	x1, [x1, _psmouse_attr_hgpk_mode@GOTPAGEOFF]
	bl	_device_remove_file
	b	LBB0_4
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_hgpk_process_byte,4,2          ; @hgpk_process_byte
	.comm	_hgpk_poll,4,2                  ; @hgpk_poll
	.comm	_hgpk_disconnect,4,2            ; @hgpk_disconnect
	.comm	_hgpk_reconnect,4,2             ; @hgpk_reconnect
	.comm	_psmouse_attr_powered,4,2       ; @psmouse_attr_powered
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed creating 'powered' sysfs node\n"

	.comm	_psmouse_attr_hgpk_mode,4,2     ; @psmouse_attr_hgpk_mode
l_.str.1:                               ; @.str.1
	.asciz	"Failed creating 'hgpk_mode' sysfs node\n"

	.comm	_HGPK_MODEL_C,8,3               ; @HGPK_MODEL_C
	.comm	_psmouse_attr_recalibrate,4,2   ; @psmouse_attr_recalibrate
l_.str.2:                               ; @.str.2
	.asciz	"Failed creating 'recalibrate' sysfs node\n"

	.no_dead_strip	_hgpk_register
.subsections_via_symbols
