	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calibrate_store
_calibrate_store:                       ## @calibrate_store
	.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	%rcx, %r12
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_to_i2c_client
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_i2c_get_clientdata
	movq	%rax, %r13
	movq	_ETP_CALIBRATE_MAX_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%r13, %rdi
	callq	_mutex_lock_interruptible
	testl	%eax, %eax
	jne	LBB0_16
## %bb.1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	callq	_disable_irq
	movq	_ETP_ENABLE_CALIBRATE@GOTPCREL(%rip), %rax
	movl	4(%r13), %esi
	orl	(%rax), %esi
	movl	%esi, 4(%r13)
	movq	16(%r13), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_15
LBB0_3:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rax
	movq	%r15, %rdi
	callq	*8(%rax)
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
LBB0_5:
	movl	$255, (%r14)
	movl	$-20, %r12d
	leaq	L_.str.2(%rip), %rbx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	incl	%r12d
	je	LBB0_11
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$250, %edi
	callq	_msleep
	movq	16(%r13), %rax
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	*16(%rax)
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$0, (%r14)
	jne	LBB0_9
## %bb.10:
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	jne	LBB0_12
LBB0_11:
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_12:
	movq	_ETP_ENABLE_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%esi
	andl	4(%r13), %esi
	movl	%esi, 4(%r13)
	movq	8(%r13), %rdi
	movq	16(%r13), %rax
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r14d
	leaq	L_.str.4(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	testl	%ebx, %ebx
	cmovel	%r14d, %ebx
LBB0_14:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
LBB0_15:
	movl	(%r15), %edi
	callq	_enable_irq
	movq	%r13, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	cmovnel	%ebx, %r12d
	movl	%r12d, %eax
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_18
## %bb.17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETP_CALIBRATE_MAX_LEN,4,2      ## @ETP_CALIBRATE_MAX_LEN
	.comm	_ETP_ENABLE_CALIBRATE,4,2       ## @ETP_ENABLE_CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to enable calibration mode: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to start calibration: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to check calibration result: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to calibrate. Timeout.\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.4:                               ## @.str.4
	.asciz	"failed to disable calibration mode: %d\n"

	.no_dead_strip	_calibrate_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calibrate_store
_calibrate_store:                       ; @calibrate_store
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x19, x3
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	bl	_to_i2c_client
	mov	x21, x0
	bl	_i2c_get_clientdata
	mov	x20, x0
Lloh3:
	adrp	x8, _ETP_CALIBRATE_MAX_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETP_CALIBRATE_MAX_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	bl	_mutex_lock_interruptible
	cbnz	w0, LBB0_16
; %bb.1:
	ldr	w0, [x21]
	bl	_disable_irq
Lloh8:
	adrp	x25, _ETP_ENABLE_CALIBRATE@GOTPAGE
Lloh9:
	ldr	x25, [x25, _ETP_ENABLE_CALIBRATE@GOTPAGEOFF]
	ldr	w8, [x25]
	ldr	w9, [x20, #4]
	orr	w1, w9, w8
	str	w1, [x20, #4]
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	mov	x0, x21
	blr	x8
	cbz	w0, LBB0_3
; %bb.2:
	mov	x24, x0
	str	x24, [sp, #-16]!
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	add	sp, sp, #16
	b	LBB0_15
LBB0_3:
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #8]
	mov	x0, x21
	blr	x8
	cbz	w0, LBB0_5
; %bb.4:
	mov	x24, x0
	str	x24, [sp, #-16]!
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	add	sp, sp, #16
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	b	LBB0_13
LBB0_5:
	mov	w8, #255
	str	w8, [x23]
	mov	w26, #-20
Lloh14:
	adrp	x24, l_.str.2@PAGE
Lloh15:
	add	x24, x24, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	str	x0, [sp, #-16]!
	mov	x0, x22
	mov	x1, x24
	bl	_dev_err
	add	sp, sp, #16
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	adds	w26, w26, #1
	b.hs	LBB0_12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #250
	bl	_msleep
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #16]
	mov	x0, x21
	mov	x1, x23
	blr	x8
                                        ; kill: def $w0 killed $w0 def $x0
	cbnz	w0, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x23]
	cbnz	w8, LBB0_7
; %bb.10:
	cbz	w26, LBB0_12
; %bb.11:
	mov	w24, #0
	b	LBB0_13
LBB0_12:
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	bl	_dev_err
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_13:
	ldr	w8, [x25]
	ldr	w9, [x20, #4]
	bic	w1, w9, w8
	str	w1, [x20, #4]
	ldp	x0, x8, [x20, #8]
	ldr	x8, [x8]
	blr	x8
	cbz	w0, LBB0_15
; %bb.14:
	mov	x23, x0
	str	x23, [sp, #-16]!
Lloh21:
	adrp	x1, l_.str.4@PAGE
Lloh22:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	add	sp, sp, #16
	cmp	w24, #0
	csel	w24, w23, w24, eq
LBB0_15:
	ldr	w0, [x21]
	bl	_enable_irq
	mov	x0, x20
	bl	_mutex_unlock
	cmp	w24, #0
	csel	w0, w19, w24, eq
LBB0_16:
	ldur	x8, [x29, #-72]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ETP_CALIBRATE_MAX_LEN,4,2      ; @ETP_CALIBRATE_MAX_LEN
	.comm	_ETP_ENABLE_CALIBRATE,4,2       ; @ETP_ENABLE_CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to enable calibration mode: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to start calibration: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to check calibration result: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to calibrate. Timeout.\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.4:                               ; @.str.4
	.asciz	"failed to disable calibration mode: %d\n"

	.no_dead_strip	_calibrate_store
.subsections_via_symbols
