	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elantech_write_reg
_elantech_write_reg:                    ## @elantech_write_reg
	.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
                                        ## kill: def $esi killed $esi def $rsi
	leal	-39(%rsi), %eax
	movl	$-1, %ebx
	cmpb	$-32, %al
	jb	LBB0_28
## %bb.1:
	leal	-18(%rsi), %eax
	cmpb	$14, %al
	jb	LBB0_28
## %bb.2:
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	$3, %eax
	ja	LBB0_3
## %bb.4:
	movl	%edx, %r14d
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	movzbl	%sil, %r15d
	jmpq	*%rax
LBB0_5:
	movq	_ETP_REGISTER_WRITE@GOTPCREL(%rip), %rax
	movzbl	(%rax), %esi
	movq	%r12, %rdi
	callq	_ps2_sliced_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.6:
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_ps2_sliced_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.7:
	movzbl	%r14b, %esi
	movq	%r12, %rdi
	callq	_ps2_sliced_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.8:
	movq	_PSMOUSE_CMD_SETSCALE11@GOTPCREL(%rip), %rax
	movzbl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
	jmp	LBB0_28
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_28
LBB0_9:
	movq	_ETP_PS2_CUSTOM_COMMAND@GOTPCREL(%rip), %rbx
	movzbl	(%rbx), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.10:
	movq	_ETP_REGISTER_WRITE@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_14:
	movq	_ETP_PS2_CUSTOM_COMMAND@GOTPCREL(%rip), %rbx
	movzbl	(%rbx), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.15:
	movq	_ETP_REGISTER_READWRITE@GOTPCREL(%rip), %rax
LBB0_11:
	movzbl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.12:
	movzbl	(%rbx), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.13:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
LBB0_22:
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.23:
	movzbl	(%rbx), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.24:
	movzbl	%r14b, %edx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.25:
	movq	_PSMOUSE_CMD_SETSCALE11@GOTPCREL(%rip), %rax
	movzbl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
	jmp	LBB0_28
LBB0_16:
	movq	_ETP_PS2_CUSTOM_COMMAND@GOTPCREL(%rip), %rbx
	movzbl	(%rbx), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.17:
	movq	_ETP_REGISTER_READWRITE@GOTPCREL(%rip), %r13
	movzbl	(%r13), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.18:
	movzbl	(%rbx), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.19:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_elantech_ps2_command
	testl	%eax, %eax
	jne	LBB0_27
## %bb.20:
	movzbl	(%rbx), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_elantech_ps2_command
	testl	%eax, %eax
	je	LBB0_21
LBB0_27:
	movzbl	%r14b, %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_psmouse_err
	movl	$-1, %ebx
LBB0_28:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movzbl	(%r13), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	jmp	LBB0_22
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_9
	.long	L0_0_set_14
	.long	L0_0_set_16
	.end_data_region
                                        ## -- End function
	.comm	_ETP_REGISTER_WRITE,1,0         ## @ETP_REGISTER_WRITE
	.comm	_PSMOUSE_CMD_SETSCALE11,1,0     ## @PSMOUSE_CMD_SETSCALE11
	.comm	_ETP_PS2_CUSTOM_COMMAND,1,0     ## @ETP_PS2_CUSTOM_COMMAND
	.comm	_ETP_REGISTER_READWRITE,1,0     ## @ETP_REGISTER_READWRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to write register 0x%02x with value 0x%02x.\n"

	.no_dead_strip	_elantech_write_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elantech_write_reg
_elantech_write_reg:                    ; @elantech_write_reg
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	w8, w1, #39
	and	w8, w8, #0xff
	sub	w9, w1, #18
	cmp	w8, #224
	and	w8, w9, #0xff
	ccmp	w8, #14, #0, hs
	b.lo	LBB0_25
; %bb.1:
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	sub	w8, w8, #1
	cmp	w8, #3
	b.hi	LBB0_7
; %bb.2:
	mov	x19, x2
	mov	x20, x1
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_3
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_3:
Lloh2:
	adrp	x8, _ETP_REGISTER_WRITE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ETP_REGISTER_WRITE@GOTPAGEOFF]
	ldrb	w1, [x8]
	mov	x0, x21
	bl	_ps2_sliced_command
	cbnz	w0, LBB0_24
; %bb.4:
	mov	x0, x21
	mov	x1, x20
	bl	_ps2_sliced_command
	cbnz	w0, LBB0_24
; %bb.5:
	mov	x0, x21
	mov	x1, x19
	bl	_ps2_sliced_command
	cbnz	w0, LBB0_24
; %bb.6:
Lloh4:
	adrp	x8, _PSMOUSE_CMD_SETSCALE11@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PSMOUSE_CMD_SETSCALE11@GOTPAGEOFF]
	ldrb	w2, [x8]
	mov	x0, x21
	mov	x1, #0
	bl	_ps2_command
	cbnz	w0, LBB0_24
	b	LBB0_26
LBB0_7:
	mov	w0, #0
	b	LBB0_26
LBB0_8:
Lloh6:
	adrp	x22, _ETP_PS2_CUSTOM_COMMAND@GOTPAGE
Lloh7:
	ldr	x22, [x22, _ETP_PS2_CUSTOM_COMMAND@GOTPAGEOFF]
	ldrb	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.9:
Lloh8:
	adrp	x8, _ETP_REGISTER_WRITE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ETP_REGISTER_WRITE@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh10:
	adrp	x22, _ETP_PS2_CUSTOM_COMMAND@GOTPAGE
Lloh11:
	ldr	x22, [x22, _ETP_PS2_CUSTOM_COMMAND@GOTPAGEOFF]
	ldrb	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.11:
Lloh12:
	adrp	x8, _ETP_REGISTER_READWRITE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETP_REGISTER_READWRITE@GOTPAGEOFF]
LBB0_12:
	ldrb	w2, [x8]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.13:
	ldrb	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.14:
	mov	x0, x21
	mov	x1, #0
	mov	x2, x20
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
LBB0_15:
	ldrb	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.16:
	mov	x0, x21
	mov	x1, #0
	mov	x2, x19
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.17:
Lloh14:
	adrp	x8, _PSMOUSE_CMD_SETSCALE11@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PSMOUSE_CMD_SETSCALE11@GOTPAGEOFF]
	ldrb	w2, [x8]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
	b	LBB0_26
LBB0_18:
Lloh16:
	adrp	x22, _ETP_PS2_CUSTOM_COMMAND@GOTPAGE
Lloh17:
	ldr	x22, [x22, _ETP_PS2_CUSTOM_COMMAND@GOTPAGEOFF]
	ldrb	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.19:
Lloh18:
	adrp	x23, _ETP_REGISTER_READWRITE@GOTPAGE
Lloh19:
	ldr	x23, [x23, _ETP_REGISTER_READWRITE@GOTPAGEOFF]
	ldrb	w2, [x23]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.20:
	ldrb	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.21:
	mov	x0, x21
	mov	x1, #0
	mov	x2, x20
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.22:
	ldrb	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbnz	w0, LBB0_24
; %bb.23:
	ldrb	w2, [x23]
	mov	x0, x21
	mov	x1, #0
	bl	_elantech_ps2_command
	cbz	w0, LBB0_15
LBB0_24:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	x3, x19
	bl	_psmouse_err
LBB0_25:
	mov	w0, #-1
LBB0_26:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_8-LBB0_3)>>2
	.byte	(LBB0_10-LBB0_3)>>2
	.byte	(LBB0_18-LBB0_3)>>2
                                        ; -- End function
	.comm	_ETP_REGISTER_WRITE,1,0         ; @ETP_REGISTER_WRITE
	.comm	_PSMOUSE_CMD_SETSCALE11,1,0     ; @PSMOUSE_CMD_SETSCALE11
	.comm	_ETP_PS2_CUSTOM_COMMAND,1,0     ; @ETP_PS2_CUSTOM_COMMAND
	.comm	_ETP_REGISTER_READWRITE,1,0     ; @ETP_REGISTER_READWRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to write register 0x%02x with value 0x%02x.\n"

	.no_dead_strip	_elantech_write_reg
.subsections_via_symbols
