	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elantech_set_absolute_mode
_elantech_set_absolute_mode:            ## @elantech_set_absolute_mode
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	_ETP_READ_BACK_TRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	16(%r12), %eax
	decl	%eax
	cmpl	$3, %eax
	ja	LBB0_6
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movabsq	$614180323350, %rax             ## imm = 0x8F00000016
	movq	%rax, (%r12)
	movq	%r14, %rdi
	movl	$16, %esi
	movl	$22, %edx
	callq	_elantech_write_reg
	movl	$-1, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.3:
	movl	4(%r12), %edx
	movq	%r14, %rdi
	movl	$17, %esi
	jmp	LBB0_4
LBB0_10:
	movabsq	$584115552340, %rax             ## imm = 0x8800000054
	movq	%rax, (%r12)
	movl	$96, 8(%r12)
	movq	%r14, %rdi
	movl	$16, %esi
	movl	$84, %edx
	callq	_elantech_write_reg
	movl	$-1, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.11:
	movl	4(%r12), %edx
	movq	%r14, %rdi
	movl	$17, %esi
	callq	_elantech_write_reg
	testl	%eax, %eax
	jne	LBB0_20
## %bb.12:
	movl	8(%r12), %edx
	movq	%r14, %rdi
	movl	$33, %esi
LBB0_4:
	callq	_elantech_write_reg
	testl	%eax, %eax
	jne	LBB0_20
	jmp	LBB0_6
LBB0_13:
	cmpl	$0, 20(%r12)
	movl	$1, %eax
	movl	$11, %edx
	cmovel	%eax, %edx
	movl	%edx, (%r12)
	movq	%r14, %rdi
	movl	$16, %esi
	callq	_elantech_write_reg
	movl	$-1, %ebx
	testl	%eax, %eax
	jne	LBB0_20
LBB0_6:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	incl	%r15d
	leaq	-41(%rbp), %r12
	movq	_ETP_READ_BACK_DELAY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	$16, %esi
	movq	%r12, %rdx
	callq	_elantech_read_reg
	testl	%eax, %eax
	je	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %ebx
	leal	-2(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_elantech_debug
	movl	(%r13), %edi
	callq	_msleep
	decl	%r15d
	cmpl	$1, %r15d
	jg	LBB0_7
## %bb.9:
	leaq	L_.str.1(%rip), %rsi
LBB0_19:
	movq	%r14, %rdi
	callq	_psmouse_err
	jmp	LBB0_20
LBB0_14:
	movl	$1, 12(%r12)
	movq	%r14, %rdi
	movl	$7, %esi
	movl	$1, %edx
	callq	_elantech_write_reg
	movl	$-1, %ebx
	testl	%eax, %eax
	je	LBB0_15
LBB0_20:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_psmouse_err
LBB0_21:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	$1, 16(%rax)
	jne	LBB0_21
## %bb.17:
	movq	_ETP_R10_ABSOLUTE_MODE@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	testb	%al, -41(%rbp)
	jne	LBB0_21
## %bb.18:
	movl	$-1, %ebx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_19
LBB0_15:
	xorl	%ebx, %ebx
	jmp	LBB0_21
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_10
	.long	L0_0_set_13
	.long	L0_0_set_14
	.end_data_region
                                        ## -- End function
	.comm	_ETP_READ_BACK_TRIES,4,2        ## @ETP_READ_BACK_TRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"retrying read (%d).\n"

	.comm	_ETP_READ_BACK_DELAY,4,2        ## @ETP_READ_BACK_DELAY
L_.str.1:                               ## @.str.1
	.asciz	"failed to read back register 0x10.\n"

	.comm	_ETP_R10_ABSOLUTE_MODE,1,0      ## @ETP_R10_ABSOLUTE_MODE
L_.str.2:                               ## @.str.2
	.asciz	"touchpad refuses to switch to absolute mode.\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to initialise registers.\n"

	.no_dead_strip	_elantech_set_absolute_mode
.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 elantech_set_absolute_mode
lCPI0_0:
	.long	84                              ; 0x54
	.long	136                             ; 0x88
lCPI0_1:
	.long	22                              ; 0x16
	.long	143                             ; 0x8f
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_elantech_set_absolute_mode:            ; @elantech_set_absolute_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x23, [x0]
Lloh0:
	adrp	x8, _ETP_READ_BACK_TRIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETP_READ_BACK_TRIES@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	w8, [x23, #16]
	sub	w8, w8, #1
	cmp	w8, #3
	b.hi	LBB0_8
; %bb.1:
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh5:
	adrp	x8, lCPI0_1@PAGE
Lloh6:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x23]
	mov	x0, x19
	mov	w1, #16
	mov	w2, #22
	bl	_elantech_write_reg
	cbnz	w0, LBB0_13
; %bb.3:
	ldr	w2, [x23, #4]
	mov	x0, x19
	mov	w1, #17
	bl	_elantech_write_reg
	cbnz	w0, LBB0_13
	b	LBB0_8
LBB0_4:
Lloh7:
	adrp	x8, lCPI0_0@PAGE
Lloh8:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x23]
	mov	w8, #96
	str	w8, [x23, #8]
	mov	x0, x19
	mov	w1, #16
	mov	w2, #84
	bl	_elantech_write_reg
	cbnz	w0, LBB0_13
; %bb.5:
	ldr	w2, [x23, #4]
	mov	x0, x19
	mov	w1, #17
	bl	_elantech_write_reg
	cbnz	w0, LBB0_13
; %bb.6:
	ldr	w2, [x23, #8]
	mov	x0, x19
	mov	w1, #33
	bl	_elantech_write_reg
	cbnz	w0, LBB0_13
	b	LBB0_8
LBB0_7:
	ldr	w8, [x23, #20]
	cmp	w8, #0
	mov	w8, #11
	csinc	w2, w8, wzr, ne
	str	w2, [x23]
	mov	x0, x19
	mov	w1, #16
	bl	_elantech_write_reg
	cbnz	w0, LBB0_13
LBB0_8:
	add	w24, w20, #1
Lloh9:
	adrp	x22, l_.str@PAGE
Lloh10:
	add	x22, x22, l_.str@PAGEOFF
Lloh11:
	adrp	x25, _ETP_READ_BACK_DELAY@GOTPAGE
Lloh12:
	ldr	x25, [x25, _ETP_READ_BACK_DELAY@GOTPAGEOFF]
Lloh13:
	adrp	x21, l_.str.1@PAGE
Lloh14:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #15
	mov	x0, x19
	mov	w1, #16
	bl	_elantech_read_reg
	cbz	w0, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x20, x0
	sub	w1, w24, #2
	mov	x0, x22
	bl	_elantech_debug
	ldr	w0, [x25]
	bl	_msleep
	sub	w24, w24, #1
	cmp	w24, #1
	b.gt	LBB0_9
LBB0_11:
	mov	x0, x19
	mov	x1, x21
	bl	_psmouse_err
	b	LBB0_14
LBB0_12:
	mov	w8, #1
	str	w8, [x23, #12]
	mov	x0, x19
	mov	w1, #7
	mov	w2, #1
	bl	_elantech_write_reg
	cbz	w0, LBB0_17
LBB0_13:
	mov	w20, #-1
LBB0_14:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
	b	LBB0_18
LBB0_15:
	ldr	w8, [x23, #16]
	cmp	w8, #1
	b.ne	LBB0_17
; %bb.16:
	ldrb	w8, [sp, #15]
Lloh17:
	adrp	x9, _ETP_R10_ABSOLUTE_MODE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ETP_R10_ABSOLUTE_MODE@GOTPAGEOFF]
	ldrb	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
LBB0_17:
	mov	w20, #0
LBB0_18:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_19:
	mov	w20, #-1
Lloh19:
	adrp	x21, l_.str.2@PAGE
Lloh20:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpLdr	Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_12-LBB0_2)>>2
                                        ; -- End function
	.comm	_ETP_READ_BACK_TRIES,4,2        ; @ETP_READ_BACK_TRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"retrying read (%d).\n"

	.comm	_ETP_READ_BACK_DELAY,4,2        ; @ETP_READ_BACK_DELAY
l_.str.1:                               ; @.str.1
	.asciz	"failed to read back register 0x10.\n"

	.comm	_ETP_R10_ABSOLUTE_MODE,1,0      ; @ETP_R10_ABSOLUTE_MODE
l_.str.2:                               ; @.str.2
	.asciz	"touchpad refuses to switch to absolute mode.\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to initialise registers.\n"

	.no_dead_strip	_elantech_set_absolute_mode
.subsections_via_symbols
