	.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	(%r12), %eax
	cmpl	$2, %eax
	je	LBB0_4
## %bb.1:
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.2:
	movabsq	$614180323350, %rax             ## imm = 0x8F00000016
	movq	%rax, 4(%r12)
	movq	%r14, %rdi
	movl	$16, %esi
	movl	$22, %edx
	callq	_elantech_write_reg
	movl	$-1, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.3:
	movl	8(%r12), %edx
	movq	%r14, %rdi
	movl	$17, %esi
	jmp	LBB0_7
LBB0_4:
	movabsq	$584115552340, %rax             ## imm = 0x8800000054
	movq	%rax, 4(%r12)
	movl	$96, 12(%r12)
	movq	%r14, %rdi
	movl	$16, %esi
	movl	$84, %edx
	callq	_elantech_write_reg
	movl	$-1, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.5:
	movl	8(%r12), %edx
	movq	%r14, %rdi
	movl	$17, %esi
	callq	_elantech_write_reg
	testl	%eax, %eax
	jne	LBB0_16
## %bb.6:
	movl	12(%r12), %edx
	movq	%r14, %rdi
	movl	$33, %esi
LBB0_7:
	callq	_elantech_write_reg
	testl	%eax, %eax
	jne	LBB0_16
LBB0_8:
	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_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	$16, %esi
	movq	%r12, %rdx
	callq	_elantech_read_reg
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 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_9
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
LBB0_15:
	callq	_pr_err
LBB0_16:
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_err
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	$1, (%rax)
	jne	LBB0_17
## %bb.13:
	movq	_ETP_R10_ABSOLUTE_MODE@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	testb	%al, -41(%rbp)
	jne	LBB0_17
## %bb.14:
	movl	$-1, %ebx
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_ETP_READ_BACK_TRIES,4,2        ## @ETP_READ_BACK_TRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"elantech.c: retrying read (%d).\n"

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

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

L_.str.3:                               ## @.str.3
	.asciz	"elantech.c: 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]
	cmp	w8, #2
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #1
	b.ne	LBB0_8
; %bb.2:
Lloh3:
	adrp	x8, lCPI0_1@PAGE
Lloh4:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	stur	d0, [x23, #4]
	mov	x0, x19
	mov	w1, #16
	mov	w2, #22
	bl	_elantech_write_reg
	cbnz	w0, LBB0_7
; %bb.3:
	ldr	w2, [x23, #8]
	mov	x0, x19
	mov	w1, #17
	bl	_elantech_write_reg
	cbnz	w0, LBB0_7
	b	LBB0_8
LBB0_4:
Lloh5:
	adrp	x8, lCPI0_0@PAGE
Lloh6:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x23, #4]
	mov	w8, #96
	str	w8, [x23, #12]
	mov	x0, x19
	mov	w1, #16
	mov	w2, #84
	bl	_elantech_write_reg
	cbnz	w0, LBB0_7
; %bb.5:
	ldr	w2, [x23, #8]
	mov	x0, x19
	mov	w1, #17
	bl	_elantech_write_reg
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	w2, [x23, #12]
	mov	x0, x19
	mov	w1, #33
	bl	_elantech_write_reg
	cbz	w0, LBB0_8
LBB0_7:
	mov	w20, #-1
	b	LBB0_12
LBB0_8:
	add	w24, w20, #1
Lloh7:
	adrp	x22, l_.str@PAGE
Lloh8:
	add	x22, x22, l_.str@PAGEOFF
Lloh9:
	adrp	x25, _ETP_READ_BACK_DELAY@GOTPAGE
Lloh10:
	ldr	x25, [x25, _ETP_READ_BACK_DELAY@GOTPAGEOFF]
Lloh11:
	adrp	x21, l_.str.1@PAGE
Lloh12:
	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_14
; %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, x21
	bl	_pr_err
LBB0_12:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
LBB0_13:
	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_14:
	ldr	w8, [x23]
	cmp	w8, #1
	b.ne	LBB0_16
; %bb.15:
	ldrb	w8, [sp, #15]
Lloh15:
	adrp	x9, _ETP_R10_ABSOLUTE_MODE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ETP_R10_ABSOLUTE_MODE@GOTPAGEOFF]
	ldrb	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
LBB0_16:
	mov	w20, #0
	b	LBB0_13
LBB0_17:
	mov	w20, #-1
Lloh17:
	adrp	x21, l_.str.2@PAGE
Lloh18:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ETP_READ_BACK_TRIES,4,2        ; @ETP_READ_BACK_TRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"elantech.c: retrying read (%d).\n"

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

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

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

	.no_dead_strip	_elantech_set_absolute_mode
.subsections_via_symbols
