	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_touchkit_ps2_detect            ## -- Begin function touchkit_ps2_detect
	.p2align	4, 0x90
_touchkit_ps2_detect:                   ## @touchkit_ps2_detect
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	32(%rdi), %r14
	movq	_TOUCHKIT_CMD_LENGTH@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -43(%rbp)
	movq	_TOUCHKIT_CMD_ACTIVE@GOTPCREL(%rip), %r13
	movb	(%r13), %al
	movb	%al, -42(%rbp)
	movq	_TOUCHKIT_CMD@GOTPCREL(%rip), %rbx
	movzbl	(%rbx), %edx
	movl	$2, %edi
	movl	$3, %esi
	callq	_TOUCHKIT_SEND_PARMS
	leaq	24(%r12), %rdi
	leaq	-43(%rbp), %rsi
	movl	%eax, %edx
	callq	_ps2_command
	testq	%rax, %rax
	je	LBB0_2
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movb	-43(%rbp), %al
	cmpb	(%rbx), %al
	jne	LBB0_1
## %bb.3:
	cmpb	$1, -42(%rbp)
	jne	LBB0_1
## %bb.4:
	movb	-41(%rbp), %al
	cmpb	(%r13), %al
	jne	LBB0_1
## %bb.5:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.7:
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT_MASK
	movl	%eax, %ebx
	movq	_EV_ABS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT_MASK
	orl	%ebx, %eax
	movq	(%r14), %rcx
	movl	%eax, (%rcx)
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r14), %esi
	callq	___set_bit
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TOUCHKIT_MAX_XC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TOUCHKIT_MAX_YC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_set_abs_params
	leaq	L_.str(%rip), %rax
	movq	%rax, (%r12)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%r12)
	movq	_touchkit_ps2_process_byte@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r12)
	movl	$5, 16(%r12)
	jmp	LBB0_8
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_TOUCHKIT_CMD_LENGTH,1,0        ## @TOUCHKIT_CMD_LENGTH
	.comm	_TOUCHKIT_CMD_ACTIVE,1,0        ## @TOUCHKIT_CMD_ACTIVE
	.comm	_TOUCHKIT_CMD,1,0               ## @TOUCHKIT_CMD
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_EV_ABS,4,2                     ## @EV_ABS
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_TOUCHKIT_MAX_XC,4,2            ## @TOUCHKIT_MAX_XC
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_TOUCHKIT_MAX_YC,4,2            ## @TOUCHKIT_MAX_YC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"eGalax"

L_.str.1:                               ## @.str.1
	.asciz	"Touchscreen"

	.comm	_touchkit_ps2_process_byte,4,2  ## @touchkit_ps2_process_byte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_touchkit_ps2_detect            ; -- Begin function touchkit_ps2_detect
	.p2align	2
_touchkit_ps2_detect:                   ; @touchkit_ps2_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0, #32]
Lloh0:
	adrp	x8, _TOUCHKIT_CMD_LENGTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TOUCHKIT_CMD_LENGTH@GOTPAGEOFF]
	ldrb	w8, [x8]
Lloh2:
	adrp	x22, _TOUCHKIT_CMD_ACTIVE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _TOUCHKIT_CMD_ACTIVE@GOTPAGEOFF]
	strb	w8, [sp, #13]
	ldrb	w8, [x22]
	strb	w8, [sp, #14]
Lloh4:
	adrp	x23, _TOUCHKIT_CMD@GOTPAGE
Lloh5:
	ldr	x23, [x23, _TOUCHKIT_CMD@GOTPAGEOFF]
	ldrb	w2, [x23]
	mov	w0, #2
	mov	w1, #3
	bl	_TOUCHKIT_SEND_PARMS
	mov	x2, x0
	add	x0, x19, #24
	add	x1, sp, #13
	bl	_ps2_command
	cbnz	x0, LBB0_5
; %bb.1:
	ldrb	w8, [sp, #13]
	ldrb	w9, [x23]
	ldrb	w10, [sp, #14]
	cmp	w8, w9
	ccmp	w10, #1, #0, eq
	b.ne	LBB0_5
; %bb.2:
	ldrb	w8, [sp, #15]
	ldrb	w9, [x22]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.3:
	cbz	w21, LBB0_7
; %bb.4:
Lloh6:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_BIT_MASK
	mov	x21, x0
Lloh9:
	adrp	x8, _EV_ABS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EV_ABS@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_BIT_MASK
	orr	w8, w0, w21
	ldr	x9, [x20]
	str	w8, [x9]
Lloh12:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
	bl	___set_bit
Lloh15:
	adrp	x8, _ABS_X@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _TOUCHKIT_MAX_XC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TOUCHKIT_MAX_XC@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
Lloh21:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _TOUCHKIT_MAX_YC@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TOUCHKIT_MAX_YC@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w2, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_set_abs_params
	mov	w0, #0
Lloh27:
	adrp	x8, l_.str@PAGE
Lloh28:
	add	x8, x8, l_.str@PAGEOFF
Lloh29:
	adrp	x9, l_.str.1@PAGE
Lloh30:
	add	x9, x9, l_.str.1@PAGEOFF
	stp	x8, x9, [x19]
Lloh31:
	adrp	x8, _touchkit_ps2_process_byte@GOTPAGE
Lloh32:
	ldr	x8, [x8, _touchkit_ps2_process_byte@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	mov	w9, #5
	stp	w9, w8, [x19, #16]
	b	LBB0_6
LBB0_5:
Lloh34:
	adrp	x8, _ENODEV@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	mov	w0, #0
	b	LBB0_6
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.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	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_TOUCHKIT_CMD_LENGTH,1,0        ; @TOUCHKIT_CMD_LENGTH
	.comm	_TOUCHKIT_CMD_ACTIVE,1,0        ; @TOUCHKIT_CMD_ACTIVE
	.comm	_TOUCHKIT_CMD,1,0               ; @TOUCHKIT_CMD
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_EV_ABS,4,2                     ; @EV_ABS
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_TOUCHKIT_MAX_XC,4,2            ; @TOUCHKIT_MAX_XC
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_TOUCHKIT_MAX_YC,4,2            ; @TOUCHKIT_MAX_YC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"eGalax"

l_.str.1:                               ; @.str.1
	.asciz	"Touchscreen"

	.comm	_touchkit_ps2_process_byte,4,2  ; @touchkit_ps2_process_byte
.subsections_via_symbols
