	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_sensors_calibrate
_cros_ec_sensors_calibrate:             ## @cros_ec_sensors_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	%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
	movq	%r8, %r12
	movq	%rcx, %rbx
	movq	%rdi, %r13
	callq	_iio_priv
	movq	%rax, %r14
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_strtobool
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	cmpl	$0, -44(%rbp)
	je	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_MOTIONSENSE_CMD_PERFORM_CALIB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r14)
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_cros_ec_motion_send_host_cmd
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_warn
	jmp	LBB0_9
LBB0_1:
	movl	%eax, %r12d
	jmp	LBB0_10
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_10
LBB0_6:
	movq	_CROS_EC_SENSOR_X@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	_CROS_EC_SENSOR_MAX_AXIS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_9
## %bb.7:
	movq	8(%r14), %rsi
	movq	16(%r14), %rdx
	movq	(%rsi), %rsi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rax,4), %edi
	movl	%edi, (%rdx,%rax,4)
	incq	%rax
	movslq	(%rcx), %rdi
	cmpq	%rdi, %rax
	jl	LBB0_8
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%r15d, %r15d
	cmovnel	%r15d, %r12d
LBB0_10:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MOTIONSENSE_CMD_PERFORM_CALIB,4,2 ## @MOTIONSENSE_CMD_PERFORM_CALIB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to calibrate sensor\n"

	.comm	_CROS_EC_SENSOR_X,4,2           ## @CROS_EC_SENSOR_X
	.comm	_CROS_EC_SENSOR_MAX_AXIS,4,2    ## @CROS_EC_SENSOR_MAX_AXIS
	.no_dead_strip	_cros_ec_sensors_calibrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_ec_sensors_calibrate
_cros_ec_sensors_calibrate:             ; @cros_ec_sensors_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	x19, x4
	mov	x21, x3
	mov	x22, x0
	bl	_iio_priv
	mov	x20, x0
	add	x1, sp, #12
	mov	x0, x21
	bl	_strtobool
	tbnz	w0, #31, LBB0_9
; %bb.1:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_mutex_lock
Lloh0:
	adrp	x8, _MOTIONSENSE_CMD_PERFORM_CALIB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MOTIONSENSE_CMD_PERFORM_CALIB@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x20, #24]
	mov	x0, x20
	mov	w1, #0
	bl	_cros_ec_motion_send_host_cmd
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.3:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_warn
	b	LBB0_8
LBB0_4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_5:
Lloh8:
	adrp	x8, _CROS_EC_SENSOR_X@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CROS_EC_SENSOR_X@GOTPAGEOFF]
Lloh10:
	ldrsw	x8, [x8]
Lloh11:
	adrp	x9, _CROS_EC_SENSOR_MAX_AXIS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CROS_EC_SENSOR_MAX_AXIS@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w8, w10
	b.ge	LBB0_8
; %bb.6:
	ldp	x11, x10, [x20, #8]
	ldr	x11, [x11]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x8, #2
	ldr	w13, [x11, x12]
	str	w13, [x10, x12]
	add	x8, x8, #1
	ldrsw	x12, [x9]
	cmp	x8, x12
	b.lt	LBB0_7
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
	cmp	w21, #0
	csel	w0, w19, w21, eq
LBB0_9:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MOTIONSENSE_CMD_PERFORM_CALIB,4,2 ; @MOTIONSENSE_CMD_PERFORM_CALIB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to calibrate sensor\n"

	.comm	_CROS_EC_SENSOR_X,4,2           ; @CROS_EC_SENSOR_X
	.comm	_CROS_EC_SENSOR_MAX_AXIS,4,2    ; @CROS_EC_SENSOR_MAX_AXIS
	.no_dead_strip	_cros_ec_sensors_calibrate
.subsections_via_symbols
