	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsp_activate_protocol
_fsp_activate_protocol:                 ## @fsp_activate_protocol
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movb	$-56, -34(%rbp)
	movq	_PSMOUSE_CMD_SETRATE@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	-34(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_ps2_command
	movb	$-56, -34(%rbp)
	movl	(%r14), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ps2_command
	movb	$80, -34(%rbp)
	movl	(%r14), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ps2_command
	movq	_PSMOUSE_CMD_GETID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ps2_command
	cmpb	$4, -34(%rbp)
	jne	LBB0_1
## %bb.2:
	movq	(%r12), %rax
	movq	_FSP_VER_STL3888_C0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_14
## %bb.3:
	movq	_FSP_REG_SYSCTL5@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	callq	_fsp_reg_read
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_17
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_17
LBB0_14:
	movq	_FSP_BIT_SWC1_EN_ABS_1F@GOTPCREL(%rip), %rax
	movq	_FSP_BIT_SWC1_EN_ABS_2F@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_FSP_REG_SWC1@GOTPCREL(%rip), %rax
	movq	_FSP_BIT_SWC1_EN_FUP_OUT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_FSP_BIT_SWC1_EN_ABS_CON@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_fsp_reg_write
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_17
LBB0_5:
	leaq	8(%r12), %r14
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_fsp_get_buttons
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_17
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_7:
	movq	_FSP_BIT_EN_MSID7@GOTPCREL(%rip), %rax
	movq	_FSP_BIT_EN_MSID8@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_FSP_BIT_EN_AUTO_MSID8@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_FSP_BIT_EN_PKT_G0@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	notl	%edx
	andl	-40(%rbp), %edx
	movl	%edx, -40(%rbp)
	cmpl	$6, (%r14)
	jne	LBB0_9
## %bb.8:
	movq	_FSP_BIT_EN_MSID6@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, -40(%rbp)
LBB0_9:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_fsp_reg_write
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.3(%rip), %rsi
LBB0_17:
	movq	%r15, %rdi
	callq	_psmouse_err
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_18:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_fsp_opc_tag_enable
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	callq	_psmouse_warn
LBB0_13:
	movq	_FSPDRV_FLAG_EN_OPC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%r12)
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_fsp_onpad_vscr
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_fsp_onpad_hscr
	xorl	%eax, %eax
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_PSMOUSE_CMD_SETRATE,4,2        ## @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_GETID,4,2          ## @PSMOUSE_CMD_GETID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to enable 4 bytes packet format.\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_FSP_VER_STL3888_C0,8,3         ## @FSP_VER_STL3888_C0
	.comm	_FSP_REG_SYSCTL5,4,2            ## @FSP_REG_SYSCTL5
L_.str.1:                               ## @.str.1
	.asciz	"Unable to read SYSCTL5 register.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to retrieve number of buttons.\n"

	.comm	_FSP_BIT_EN_MSID7,4,2           ## @FSP_BIT_EN_MSID7
	.comm	_FSP_BIT_EN_MSID8,4,2           ## @FSP_BIT_EN_MSID8
	.comm	_FSP_BIT_EN_AUTO_MSID8,4,2      ## @FSP_BIT_EN_AUTO_MSID8
	.comm	_FSP_BIT_EN_PKT_G0,4,2          ## @FSP_BIT_EN_PKT_G0
	.comm	_FSP_BIT_EN_MSID6,4,2           ## @FSP_BIT_EN_MSID6
L_.str.3:                               ## @.str.3
	.asciz	"Unable to set up required mode bits.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to enable OPC tag mode.\n"

	.comm	_FSPDRV_FLAG_EN_OPC,4,2         ## @FSPDRV_FLAG_EN_OPC
	.comm	_FSP_REG_SWC1,4,2               ## @FSP_REG_SWC1
	.comm	_FSP_BIT_SWC1_EN_ABS_1F,4,2     ## @FSP_BIT_SWC1_EN_ABS_1F
	.comm	_FSP_BIT_SWC1_EN_ABS_2F,4,2     ## @FSP_BIT_SWC1_EN_ABS_2F
	.comm	_FSP_BIT_SWC1_EN_FUP_OUT,4,2    ## @FSP_BIT_SWC1_EN_FUP_OUT
	.comm	_FSP_BIT_SWC1_EN_ABS_CON,4,2    ## @FSP_BIT_SWC1_EN_ABS_CON
L_.str.5:                               ## @.str.5
	.asciz	"Unable to enable absolute coordinates output.\n"

	.no_dead_strip	_fsp_activate_protocol
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsp_activate_protocol
_fsp_activate_protocol:                 ; @fsp_activate_protocol
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x21, [x0, #8]
	mov	w20, #200
	strb	w20, [sp, #14]
Lloh0:
	adrp	x22, _PSMOUSE_CMD_SETRATE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PSMOUSE_CMD_SETRATE@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x1, sp, #14
	bl	_ps2_command
	strb	w20, [sp, #14]
	ldr	w2, [x22]
	add	x1, sp, #14
	mov	x0, x19
	bl	_ps2_command
	mov	w8, #80
	strb	w8, [sp, #14]
	ldr	w2, [x22]
	add	x1, sp, #14
	mov	x0, x19
	bl	_ps2_command
Lloh2:
	adrp	x8, _PSMOUSE_CMD_GETID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PSMOUSE_CMD_GETID@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x1, sp, #14
	mov	x0, x19
	bl	_ps2_command
	ldrb	w8, [sp, #14]
	cmp	w8, #4
	b.ne	LBB0_4
; %bb.1:
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _FSP_VER_STL3888_C0@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FSP_VER_STL3888_C0@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.2:
Lloh8:
	adrp	x22, _FSP_REG_SYSCTL5@GOTPAGE
Lloh9:
	ldr	x22, [x22, _FSP_REG_SYSCTL5@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #8
	mov	x0, x19
	bl	_fsp_reg_read
	cbz	x0, LBB0_7
; %bb.3:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_4:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_13
LBB0_5:
Lloh14:
	adrp	x8, _FSP_REG_SWC1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FSP_REG_SWC1@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _FSP_BIT_SWC1_EN_ABS_1F@GOTPAGE
Lloh18:
	ldr	x8, [x8, _FSP_BIT_SWC1_EN_ABS_1F@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _FSP_BIT_SWC1_EN_ABS_2F@GOTPAGE
Lloh21:
	ldr	x9, [x9, _FSP_BIT_SWC1_EN_ABS_2F@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh23:
	adrp	x9, _FSP_BIT_SWC1_EN_FUP_OUT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _FSP_BIT_SWC1_EN_FUP_OUT@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh26:
	adrp	x9, _FSP_BIT_SWC1_EN_ABS_CON@GOTPAGE
Lloh27:
	ldr	x9, [x9, _FSP_BIT_SWC1_EN_ABS_CON@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_fsp_reg_write
	cbz	x0, LBB0_14
; %bb.6:
Lloh29:
	adrp	x1, l_.str.5@PAGE
Lloh30:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_13
LBB0_7:
	add	x20, x21, #8
	mov	x0, x19
	mov	x1, x20
	bl	_fsp_get_buttons
	cbz	x0, LBB0_9
; %bb.8:
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_13
LBB0_9:
Lloh33:
	adrp	x8, _FSP_BIT_EN_MSID7@GOTPAGE
Lloh34:
	ldr	x8, [x8, _FSP_BIT_EN_MSID7@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _FSP_BIT_EN_MSID8@GOTPAGE
Lloh37:
	ldr	x9, [x9, _FSP_BIT_EN_MSID8@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
Lloh39:
	adrp	x10, _FSP_BIT_EN_AUTO_MSID8@GOTPAGE
Lloh40:
	ldr	x10, [x10, _FSP_BIT_EN_AUTO_MSID8@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh41:
	ldr	w9, [x10]
	orr	w8, w8, w9
	ldr	w9, [sp, #8]
Lloh42:
	adrp	x10, _FSP_BIT_EN_PKT_G0@GOTPAGE
Lloh43:
	ldr	x10, [x10, _FSP_BIT_EN_PKT_G0@GOTPAGEOFF]
Lloh44:
	ldr	w10, [x10]
	orr	w8, w8, w10
	bic	w2, w9, w8
	str	w2, [sp, #8]
	ldr	w8, [x20]
	cmp	w8, #6
	b.ne	LBB0_11
; %bb.10:
Lloh45:
	adrp	x8, _FSP_BIT_EN_MSID6@GOTPAGE
Lloh46:
	ldr	x8, [x8, _FSP_BIT_EN_MSID6@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	orr	w2, w8, w2
	str	w2, [sp, #8]
LBB0_11:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_fsp_reg_write
	cbz	x0, LBB0_15
; %bb.12:
Lloh48:
	adrp	x1, l_.str.3@PAGE
Lloh49:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_13:
	mov	x0, x19
	bl	_psmouse_err
Lloh50:
	adrp	x8, _EIO@GOTPAGE
Lloh51:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_15:
	mov	x0, x19
	mov	w1, #1
	bl	_fsp_opc_tag_enable
	cbz	x0, LBB0_17
; %bb.16:
Lloh53:
	adrp	x1, l_.str.4@PAGE
Lloh54:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_psmouse_warn
LBB0_17:
Lloh55:
	adrp	x8, _FSPDRV_FLAG_EN_OPC@GOTPAGE
Lloh56:
	ldr	x8, [x8, _FSPDRV_FLAG_EN_OPC@GOTPAGEOFF]
Lloh57:
	ldr	w8, [x8]
	ldr	w9, [x21, #12]
	orr	w8, w9, w8
	str	w8, [x21, #12]
	mov	x0, x19
	mov	w1, #1
	bl	_fsp_onpad_vscr
	mov	x0, x19
	mov	w1, #1
	bl	_fsp_onpad_hscr
	mov	w0, #0
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_PSMOUSE_CMD_SETRATE,4,2        ; @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_GETID,4,2          ; @PSMOUSE_CMD_GETID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to enable 4 bytes packet format.\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_FSP_VER_STL3888_C0,8,3         ; @FSP_VER_STL3888_C0
	.comm	_FSP_REG_SYSCTL5,4,2            ; @FSP_REG_SYSCTL5
l_.str.1:                               ; @.str.1
	.asciz	"Unable to read SYSCTL5 register.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to retrieve number of buttons.\n"

	.comm	_FSP_BIT_EN_MSID7,4,2           ; @FSP_BIT_EN_MSID7
	.comm	_FSP_BIT_EN_MSID8,4,2           ; @FSP_BIT_EN_MSID8
	.comm	_FSP_BIT_EN_AUTO_MSID8,4,2      ; @FSP_BIT_EN_AUTO_MSID8
	.comm	_FSP_BIT_EN_PKT_G0,4,2          ; @FSP_BIT_EN_PKT_G0
	.comm	_FSP_BIT_EN_MSID6,4,2           ; @FSP_BIT_EN_MSID6
l_.str.3:                               ; @.str.3
	.asciz	"Unable to set up required mode bits.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to enable OPC tag mode.\n"

	.comm	_FSPDRV_FLAG_EN_OPC,4,2         ; @FSPDRV_FLAG_EN_OPC
	.comm	_FSP_REG_SWC1,4,2               ; @FSP_REG_SWC1
	.comm	_FSP_BIT_SWC1_EN_ABS_1F,4,2     ; @FSP_BIT_SWC1_EN_ABS_1F
	.comm	_FSP_BIT_SWC1_EN_ABS_2F,4,2     ; @FSP_BIT_SWC1_EN_ABS_2F
	.comm	_FSP_BIT_SWC1_EN_FUP_OUT,4,2    ; @FSP_BIT_SWC1_EN_FUP_OUT
	.comm	_FSP_BIT_SWC1_EN_ABS_CON,4,2    ; @FSP_BIT_SWC1_EN_ABS_CON
l_.str.5:                               ; @.str.5
	.asciz	"Unable to enable absolute coordinates output.\n"

	.no_dead_strip	_fsp_activate_protocol
.subsections_via_symbols
