	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	48(%rdi), %rbx
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	callq	___clear_bit
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	___set_bit
	movq	_EV_REL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	___set_bit
	movq	_REL_X@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	___set_bit
	movq	_REL_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	___set_bit
	movq	_BTN_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	callq	___set_bit
	movq	_BTN_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	callq	___set_bit
	movq	_hgpk_process_byte@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r12)
	movq	_hgpk_poll@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r12)
	movq	_hgpk_disconnect@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r12)
	movq	_hgpk_reconnect@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movabsq	$4398046511107, %rax            ## imm = 0x40000000003
	movq	%rax, (%r12)
	movq	$0, 24(%r12)
	movq	16(%r12), %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	%r12, %rdi
	callq	_hgpk_err
	jmp	LBB0_5
LBB0_2:
	movq	8(%r12), %rax
	movq	_HGPK_MODEL_C@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	jl	LBB0_5
## %bb.3:
	movq	16(%r12), %rdi
	movq	_psmouse_attr_recalibrate@GOTPCREL(%rip), %rsi
	callq	_device_create_file
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_hgpk_err
	movq	16(%r12), %rdi
	movq	_psmouse_attr_powered@GOTPCREL(%rip), %rsi
	callq	_device_remove_file
	movl	%r15d, %r14d
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BTN_MIDDLE,4,2                 ## @BTN_MIDDLE
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_EV_REL,4,2                     ## @EV_REL
	.comm	_REL_X,4,2                      ## @REL_X
	.comm	_REL_Y,4,2                      ## @REL_Y
	.comm	_BTN_LEFT,4,2                   ## @BTN_LEFT
	.comm	_BTN_RIGHT,4,2                  ## @BTN_RIGHT
	.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	_HGPK_MODEL_C,8,3               ## @HGPK_MODEL_C
	.comm	_psmouse_attr_recalibrate,4,2   ## @psmouse_attr_recalibrate
L_.str.1:                               ## @.str.1
	.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
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function hgpk_register
lCPI0_0:
	.long	3                               ; 0x3
	.long	1024                            ; 0x400
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_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	x20, [x0, #48]
Lloh0:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w1, [x20]
	bl	___clear_bit
Lloh3:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
	bl	___set_bit
Lloh6:
	adrp	x8, _EV_REL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EV_REL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
	bl	___set_bit
Lloh9:
	adrp	x8, _REL_X@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REL_X@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	w1, [x20, #4]
	bl	___set_bit
Lloh12:
	adrp	x8, _REL_Y@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REL_Y@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	w1, [x20, #4]
	bl	___set_bit
Lloh15:
	adrp	x8, _BTN_LEFT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BTN_LEFT@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldr	w1, [x20]
	bl	___set_bit
Lloh18:
	adrp	x8, _BTN_RIGHT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BTN_RIGHT@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	w1, [x20]
	bl	___set_bit
Lloh21:
	adrp	x8, _hgpk_process_byte@GOTPAGE
Lloh22:
	ldr	x8, [x8, _hgpk_process_byte@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _hgpk_poll@GOTPAGE
Lloh25:
	ldr	x9, [x9, _hgpk_poll@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
Lloh27:
	adrp	x10, _hgpk_disconnect@GOTPAGE
Lloh28:
	ldr	x10, [x10, _hgpk_disconnect@GOTPAGEOFF]
	stp	w9, w8, [x19, #40]
Lloh29:
	ldr	w8, [x10]
Lloh30:
	adrp	x9, _hgpk_reconnect@GOTPAGE
Lloh31:
	ldr	x9, [x9, _hgpk_reconnect@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #32]
	str	xzr, [x19, #24]
Lloh33:
	adrp	x8, lCPI0_0@PAGE
Lloh34:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
	ldr	x0, [x19, #16]
Lloh35:
	adrp	x1, _psmouse_attr_powered@GOTPAGE
Lloh36:
	ldr	x1, [x1, _psmouse_attr_powered@GOTPAGEOFF]
	bl	_device_create_file
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh37:
	adrp	x1, l_.str@PAGE
Lloh38:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_hgpk_err
	b	LBB0_6
LBB0_2:
	ldr	x8, [x19, #8]
Lloh39:
	adrp	x9, _HGPK_MODEL_C@GOTPAGE
Lloh40:
	ldr	x9, [x9, _HGPK_MODEL_C@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_4
; %bb.3:
	mov	w20, #0
	b	LBB0_6
LBB0_4:
	ldr	x0, [x19, #16]
Lloh42:
	adrp	x1, _psmouse_attr_recalibrate@GOTPAGE
Lloh43:
	ldr	x1, [x1, _psmouse_attr_recalibrate@GOTPAGEOFF]
	bl	_device_create_file
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.5:
Lloh44:
	adrp	x1, l_.str.1@PAGE
Lloh45:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_hgpk_err
	ldr	x0, [x19, #16]
Lloh46:
	adrp	x1, _psmouse_attr_powered@GOTPAGE
Lloh47:
	ldr	x1, [x1, _psmouse_attr_powered@GOTPAGEOFF]
	bl	_device_remove_file
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdr	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_BTN_MIDDLE,4,2                 ; @BTN_MIDDLE
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_EV_REL,4,2                     ; @EV_REL
	.comm	_REL_X,4,2                      ; @REL_X
	.comm	_REL_Y,4,2                      ; @REL_Y
	.comm	_BTN_LEFT,4,2                   ; @BTN_LEFT
	.comm	_BTN_RIGHT,4,2                  ; @BTN_RIGHT
	.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	_HGPK_MODEL_C,8,3               ; @HGPK_MODEL_C
	.comm	_psmouse_attr_recalibrate,4,2   ; @psmouse_attr_recalibrate
l_.str.1:                               ; @.str.1
	.asciz	"Failed creating 'recalibrate' sysfs node\n"

	.no_dead_strip	_hgpk_register
.subsections_via_symbols
