	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elants_i2c_calibrate
_elants_i2c_calibrate:                  ## @elants_i2c_calibrate
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movl	4(%r14), %edi
	callq	_disable_irq
	movq	_ELAN_WAIT_RECALIBRATION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	leaq	8(%rbx), %r15
	movq	%r15, %rdi
	callq	_reinit_completion
	leaq	_elants_i2c_calibrate.w_flashkey(%rip), %rsi
	movq	%r14, %rdi
	movl	$16, %edx
	callq	_elants_i2c_send
	leaq	_elants_i2c_calibrate.rek(%rip), %rsi
	movq	%r14, %rdi
	movl	$16, %edx
	callq	_elants_i2c_send
	movl	4(%r14), %edi
	callq	_enable_irq
	movq	_ELAN_CALI_TIMEOUT_MSEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_interruptible_timeout
	movq	_ELAN_STATE_NORMAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rbx)
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movl	(%rbx), %esi
	leaq	_elants_i2c_calibrate.rek_resp(%rip), %rdi
	movl	$16, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%rbx), %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	$4, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_1:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	testl	%eax, %eax
	cmovnel	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_5
LBB0_3:
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @elants_i2c_calibrate.w_flashkey
_elants_i2c_calibrate.w_flashkey:
	.long	84                              ## 0x54
	.long	192                             ## 0xc0
	.long	225                             ## 0xe1
	.long	90                              ## 0x5a

	.p2align	4                               ## @elants_i2c_calibrate.rek
_elants_i2c_calibrate.rek:
	.long	84                              ## 0x54
	.long	41                              ## 0x29
	.long	0                               ## 0x0
	.long	1                               ## 0x1

	.p2align	4                               ## @elants_i2c_calibrate.rek_resp
_elants_i2c_calibrate.rek_resp:
	.long	128                             ## 0x80
	.long	102                             ## 0x66
	.long	102                             ## 0x66
	.long	102                             ## 0x66

	.comm	_ELAN_WAIT_RECALIBRATION,4,2    ## @ELAN_WAIT_RECALIBRATION
	.comm	_ELAN_CALI_TIMEOUT_MSEC,4,2     ## @ELAN_CALI_TIMEOUT_MSEC
	.comm	_ELAN_STATE_NORMAL,4,2          ## @ELAN_STATE_NORMAL
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error while waiting for calibration to complete: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"unexpected calibration response: %*ph\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_elants_i2c_calibrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elants_i2c_calibrate
_elants_i2c_calibrate:                  ; @elants_i2c_calibrate
	.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	x20, x0
	ldr	x19, [x0, #16]
	ldr	w0, [x19, #4]
	bl	_disable_irq
Lloh0:
	adrp	x8, _ELAN_WAIT_RECALIBRATION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ELAN_WAIT_RECALIBRATION@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x20, #4]
	add	x21, x20, #8
	mov	x0, x21
	bl	_reinit_completion
Lloh3:
	adrp	x1, _elants_i2c_calibrate.w_flashkey@PAGE
Lloh4:
	add	x1, x1, _elants_i2c_calibrate.w_flashkey@PAGEOFF
	mov	x0, x19
	mov	w2, #16
	bl	_elants_i2c_send
Lloh5:
	adrp	x1, _elants_i2c_calibrate.rek@PAGE
Lloh6:
	add	x1, x1, _elants_i2c_calibrate.rek@PAGEOFF
	mov	x0, x19
	mov	w2, #16
	bl	_elants_i2c_send
	ldr	w0, [x19, #4]
	bl	_enable_irq
Lloh7:
	adrp	x8, _ELAN_CALI_TIMEOUT_MSEC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ELAN_CALI_TIMEOUT_MSEC@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_interruptible_timeout
Lloh10:
	adrp	x8, _ELAN_STATE_NORMAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ELAN_STATE_NORMAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x20, #4]
	cmp	w0, #0
	b.le	LBB0_3
; %bb.1:
	ldr	w1, [x20]
Lloh13:
	adrp	x0, _elants_i2c_calibrate.rek_resp@PAGE
Lloh14:
	add	x0, x0, _elants_i2c_calibrate.rek_resp@PAGEOFF
	mov	w2, #16
	bl	_memcmp
	cbz	x0, LBB0_4
; %bb.2:
	ldr	w8, [x20]
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w2, #4
	bl	_dev_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_3:
Lloh20:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	csneg	w20, w0, w8, ne
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
	b	LBB0_5
LBB0_4:
	mov	w20, #0
LBB0_5:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @elants_i2c_calibrate.w_flashkey
_elants_i2c_calibrate.w_flashkey:
	.long	84                              ; 0x54
	.long	192                             ; 0xc0
	.long	225                             ; 0xe1
	.long	90                              ; 0x5a

	.p2align	2                               ; @elants_i2c_calibrate.rek
_elants_i2c_calibrate.rek:
	.long	84                              ; 0x54
	.long	41                              ; 0x29
	.long	0                               ; 0x0
	.long	1                               ; 0x1

	.p2align	2                               ; @elants_i2c_calibrate.rek_resp
_elants_i2c_calibrate.rek_resp:
	.long	128                             ; 0x80
	.long	102                             ; 0x66
	.long	102                             ; 0x66
	.long	102                             ; 0x66

	.comm	_ELAN_WAIT_RECALIBRATION,4,2    ; @ELAN_WAIT_RECALIBRATION
	.comm	_ELAN_CALI_TIMEOUT_MSEC,4,2     ; @ELAN_CALI_TIMEOUT_MSEC
	.comm	_ELAN_STATE_NORMAL,4,2          ; @ELAN_STATE_NORMAL
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error while waiting for calibration to complete: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"unexpected calibration response: %*ph\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_elants_i2c_calibrate
.subsections_via_symbols
