	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_sensors_write
_cros_ec_sensors_write:                 ## @cros_ec_sensors_write
	.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, %rbx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	movq	%rsi, %r13
	callq	_iio_priv
	movq	%rax, %r15
	movslq	(%r13), %r12
	movq	%rax, %rdi
	callq	_mutex_lock
	cmpq	$128, %rbx
	je	LBB0_12
## %bb.1:
	cmpq	$129, %rbx
	je	LBB0_8
## %bb.2:
	cmpq	$130, %rbx
	jne	LBB0_15
## %bb.3:
	movq	72(%r15), %rax
	movl	%r14d, (%rax,%r12,8)
	movq	_MOTIONSENSE_CMD_SENSOR_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%r15)
	movq	_MOTION_SENSE_SET_OFFSET@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 48(%r15)
	movq	_CROS_EC_SENSOR_X@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movq	_CROS_EC_SENSOR_MAX_AXIS@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jge	LBB0_6
## %bb.4:
	movq	40(%r15), %rsi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rax,%rcx,8), %edi
	movl	%edi, (%rsi,%rcx,4)
	incq	%rcx
	movslq	(%rdx), %rdi
	cmpq	%rdi, %rcx
	jl	LBB0_5
LBB0_6:
	movq	_EC_MOTION_SENSE_INVALID_CALIB_TEMP@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 56(%r15)
	jmp	LBB0_7
LBB0_12:
	movl	64(%r15), %eax
	movq	_MOTIONSENSE_TYPE_MAG@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_8:
	movq	72(%r15), %rax
	movl	%r14d, 4(%rax,%r12,8)
	movq	_MOTIONSENSE_CMD_SENSOR_SCALE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%r15)
	movq	_MOTION_SENSE_SET_OFFSET@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 48(%r15)
	movq	_CROS_EC_SENSOR_X@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movq	_CROS_EC_SENSOR_MAX_AXIS@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jge	LBB0_11
## %bb.9:
	movq	24(%r15), %rsi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	4(%rax,%rcx,8), %edi
	movl	%edi, (%rsi,%rcx,4)
	incq	%rcx
	movslq	(%rdx), %rdi
	cmpq	%rdi, %rcx
	jl	LBB0_10
LBB0_11:
	movq	_EC_MOTION_SENSE_INVALID_CALIB_TEMP@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%r15)
	jmp	LBB0_7
LBB0_15:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	%rbx, %r8
	callq	_cros_ec_sensors_core_write
	jmp	LBB0_16
LBB0_14:
	movq	_MOTIONSENSE_CMD_SENSOR_RANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movl	%r14d, 8(%r15)
	movl	$1, 12(%r15)
LBB0_7:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_cros_ec_motion_send_host_cmd
LBB0_16:
	movl	%eax, %ebx
LBB0_17:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MOTIONSENSE_CMD_SENSOR_OFFSET,4,2 ## @MOTIONSENSE_CMD_SENSOR_OFFSET
	.comm	_MOTION_SENSE_SET_OFFSET,8,3    ## @MOTION_SENSE_SET_OFFSET
	.comm	_CROS_EC_SENSOR_X,4,2           ## @CROS_EC_SENSOR_X
	.comm	_CROS_EC_SENSOR_MAX_AXIS,4,2    ## @CROS_EC_SENSOR_MAX_AXIS
	.comm	_EC_MOTION_SENSE_INVALID_CALIB_TEMP,8,3 ## @EC_MOTION_SENSE_INVALID_CALIB_TEMP
	.comm	_MOTIONSENSE_CMD_SENSOR_SCALE,4,2 ## @MOTIONSENSE_CMD_SENSOR_SCALE
	.comm	_MOTIONSENSE_TYPE_MAG,4,2       ## @MOTIONSENSE_TYPE_MAG
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MOTIONSENSE_CMD_SENSOR_RANGE,4,2 ## @MOTIONSENSE_CMD_SENSOR_RANGE
	.no_dead_strip	_cros_ec_sensors_write
.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_write
_cros_ec_sensors_write:                 ; @cros_ec_sensors_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x4
	mov	x22, x3
	mov	x20, x2
	mov	x23, x1
	bl	_iio_priv
	mov	x19, x0
	ldrsw	x24, [x23]
	bl	_mutex_lock
	cmp	x21, #128
	b.eq	LBB0_7
; %bb.1:
	cmp	x21, #129
	b.eq	LBB0_9
; %bb.2:
	cmp	x21, #130
	b.ne	LBB0_13
; %bb.3:
	ldr	x10, [x19, #72]
	lsl	x8, x24, #3
	str	w20, [x10, x8]
Lloh0:
	adrp	x8, _MOTIONSENSE_CMD_SENSOR_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MOTIONSENSE_CMD_SENSOR_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #16]
Lloh3:
	adrp	x8, _MOTION_SENSE_SET_OFFSET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MOTION_SENSE_SET_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _CROS_EC_SENSOR_X@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CROS_EC_SENSOR_X@GOTPAGEOFF]
	str	x8, [x19, #48]
Lloh8:
	ldrsw	x8, [x9]
Lloh9:
	adrp	x9, _CROS_EC_SENSOR_MAX_AXIS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CROS_EC_SENSOR_MAX_AXIS@GOTPAGEOFF]
	ldr	w11, [x9]
	cmp	w8, w11
	b.ge	LBB0_6
; %bb.4:
	ldr	x11, [x19, #40]
	add	x10, x10, x8, lsl #3
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x10], #8
	str	w12, [x11, x8, lsl #2]
	add	x8, x8, #1
	ldrsw	x12, [x9]
	cmp	x8, x12
	b.lt	LBB0_5
LBB0_6:
Lloh11:
	adrp	x8, _EC_MOTION_SENSE_INVALID_CALIB_TEMP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EC_MOTION_SENSE_INVALID_CALIB_TEMP@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	str	x8, [x19, #56]
	b	LBB0_15
LBB0_7:
	ldr	w8, [x19, #64]
Lloh14:
	adrp	x9, _MOTIONSENSE_TYPE_MAG@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MOTIONSENSE_TYPE_MAG@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.8:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_17
LBB0_9:
	ldr	x11, [x19, #72]
	add	x8, x11, x24, lsl #3
	str	w20, [x8, #4]
Lloh20:
	adrp	x8, _MOTIONSENSE_CMD_SENSOR_SCALE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MOTIONSENSE_CMD_SENSOR_SCALE@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [x19, #16]
Lloh23:
	adrp	x8, _MOTION_SENSE_SET_OFFSET@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MOTION_SENSE_SET_OFFSET@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
Lloh26:
	adrp	x9, _CROS_EC_SENSOR_X@GOTPAGE
Lloh27:
	ldr	x9, [x9, _CROS_EC_SENSOR_X@GOTPAGEOFF]
	str	x8, [x19, #48]
Lloh28:
	ldrsw	x8, [x9]
Lloh29:
	adrp	x9, _CROS_EC_SENSOR_MAX_AXIS@GOTPAGE
Lloh30:
	ldr	x9, [x9, _CROS_EC_SENSOR_MAX_AXIS@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w8, w10
	b.ge	LBB0_12
; %bb.10:
	ldr	x10, [x19, #24]
	add	x11, x11, x8, lsl #3
	add	x11, x11, #4
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11], #8
	str	w12, [x10, x8, lsl #2]
	add	x8, x8, #1
	ldrsw	x12, [x9]
	cmp	x8, x12
	b.lt	LBB0_11
LBB0_12:
Lloh31:
	adrp	x8, _EC_MOTION_SENSE_INVALID_CALIB_TEMP@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EC_MOTION_SENSE_INVALID_CALIB_TEMP@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	str	x8, [x19, #32]
	b	LBB0_15
LBB0_13:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	x3, x22
	mov	x4, x21
	bl	_cros_ec_sensors_core_write
	b	LBB0_16
LBB0_14:
Lloh34:
	adrp	x8, _MOTIONSENSE_CMD_SENSOR_RANGE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _MOTIONSENSE_CMD_SENSOR_RANGE@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x8]
	mov	w8, #1
	str	w20, [x19, #8]
	stp	w8, w9, [x19, #12]
LBB0_15:
	mov	x0, x19
	mov	w1, #0
	bl	_cros_ec_motion_send_host_cmd
LBB0_16:
	mov	x20, x0
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_MOTIONSENSE_CMD_SENSOR_OFFSET,4,2 ; @MOTIONSENSE_CMD_SENSOR_OFFSET
	.comm	_MOTION_SENSE_SET_OFFSET,8,3    ; @MOTION_SENSE_SET_OFFSET
	.comm	_CROS_EC_SENSOR_X,4,2           ; @CROS_EC_SENSOR_X
	.comm	_CROS_EC_SENSOR_MAX_AXIS,4,2    ; @CROS_EC_SENSOR_MAX_AXIS
	.comm	_EC_MOTION_SENSE_INVALID_CALIB_TEMP,8,3 ; @EC_MOTION_SENSE_INVALID_CALIB_TEMP
	.comm	_MOTIONSENSE_CMD_SENSOR_SCALE,4,2 ; @MOTIONSENSE_CMD_SENSOR_SCALE
	.comm	_MOTIONSENSE_TYPE_MAG,4,2       ; @MOTIONSENSE_TYPE_MAG
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MOTIONSENSE_CMD_SENSOR_RANGE,4,2 ; @MOTIONSENSE_CMD_SENSOR_RANGE
	.no_dead_strip	_cros_ec_sensors_write
.subsections_via_symbols
