	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_light_prox_read
_cros_ec_light_prox_read:               ## @cros_ec_light_prox_read
	.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	%r8, %r15
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_iio_priv
	movq	%rax, %r13
	movl	$0, -44(%rbp)
	movslq	(%r14), %r12
	movq	%rax, %rdi
	callq	_mutex_lock
	leaq	-128(%r15), %rax
	cmpq	$3, %rax
	ja	LBB0_4
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movl	4(%r14), %eax
	movq	_IIO_PROXIMITY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_4:
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, %r8
	callq	_cros_ec_sensors_core_read
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_5:
	movl	4(%r14), %eax
	movq	_IIO_LIGHT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
LBB0_6:
	movl	$1, %esi
	movl	%r12d, %ecx
	shll	%cl, %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_cros_ec_sensors_read_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.7:
	movl	-44(%rbp), %eax
	jmp	LBB0_12
LBB0_8:
	movq	_MOTIONSENSE_CMD_SENSOR_RANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r13)
	movq	_EC_MOTION_SENSE_NO_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r13)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_cros_ec_motion_send_host_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.9:
	movq	8(%r13), %rax
	movl	(%rax), %eax
	movzwl	%ax, %ecx
	sarl	$16, %eax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx)
	imull	$100, %ecx, %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	_IIO_VAL_INT_PLUS_MICRO@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_10:
	movq	_MOTIONSENSE_CMD_SENSOR_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r13)
	movl	$0, 24(%r13)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_cros_ec_motion_send_host_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:
	movq	8(%r13), %rax
	movq	32(%r13), %rcx
	movq	8(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	(%rcx,%r12,4), %eax
LBB0_12:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %ebx
LBB0_14:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_5
	.long	L0_0_set_8
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_IIO_PROXIMITY,4,2              ## @IIO_PROXIMITY
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_LIGHT,4,2                  ## @IIO_LIGHT
	.comm	_MOTIONSENSE_CMD_SENSOR_OFFSET,4,2 ## @MOTIONSENSE_CMD_SENSOR_OFFSET
	.comm	_MOTIONSENSE_CMD_SENSOR_RANGE,4,2 ## @MOTIONSENSE_CMD_SENSOR_RANGE
	.comm	_EC_MOTION_SENSE_NO_VALUE,4,2   ## @EC_MOTION_SENSE_NO_VALUE
	.comm	_IIO_VAL_INT_PLUS_MICRO,4,2     ## @IIO_VAL_INT_PLUS_MICRO
	.no_dead_strip	_cros_ec_light_prox_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_ec_light_prox_read
_cros_ec_light_prox_read:               ; @cros_ec_light_prox_read
	.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	x24, x4
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	mov	x22, x0
	bl	_iio_priv
	mov	x19, x0
	str	wzr, [sp, #12]
	ldrsw	x25, [x23]
	bl	_mutex_lock
	sub	x8, x24, #128
	cmp	x8, #3
	b.hi	LBB0_3
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w8, [x23, #4]
Lloh2:
	adrp	x9, _IIO_PROXIMITY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IIO_PROXIMITY@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	x3, x21
	mov	x4, x24
	bl	_cros_ec_sensors_core_read
	mov	x22, x0
	b	LBB0_14
LBB0_4:
	ldr	w8, [x23, #4]
Lloh4:
	adrp	x9, _IIO_LIGHT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _IIO_LIGHT@GOTPAGEOFF]
LBB0_5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.6:
	mov	w8, #1
	lsl	w1, w8, w25
	add	x2, sp, #12
	mov	x0, x22
	bl	_cros_ec_sensors_read_cmd
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.7:
	ldr	w8, [sp, #12]
	b	LBB0_12
LBB0_8:
Lloh6:
	adrp	x8, _MOTIONSENSE_CMD_SENSOR_RANGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MOTIONSENSE_CMD_SENSOR_RANGE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _EC_MOTION_SENSE_NO_VALUE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _EC_MOTION_SENSE_NO_VALUE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #16]
	mov	x0, x19
	mov	w1, #0
	bl	_cros_ec_motion_send_host_cmd
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.9:
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	asr	w9, w8, #16
	str	w9, [x20]
	and	w8, w8, #0xffff
	mov	w9, #100
	mul	w8, w8, w9
	str	w8, [x21]
Lloh12:
	adrp	x8, _IIO_VAL_INT_PLUS_MICRO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IIO_VAL_INT_PLUS_MICRO@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	b	LBB0_14
LBB0_10:
Lloh15:
	adrp	x8, _MOTIONSENSE_CMD_SENSOR_OFFSET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MOTIONSENSE_CMD_SENSOR_OFFSET@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	stp	w8, wzr, [x19, #20]
	mov	x0, x19
	mov	w1, #0
	bl	_cros_ec_motion_send_host_cmd
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.11:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
	ldr	x9, [x19, #32]
	str	w8, [x9]
	ldr	w8, [x9, x25, lsl #2]
LBB0_12:
	str	w8, [x20]
Lloh18:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh20:
	ldr	w22, [x8]
	b	LBB0_14
LBB0_13:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
                                        ; -- End function
	.comm	_IIO_PROXIMITY,4,2              ; @IIO_PROXIMITY
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_LIGHT,4,2                  ; @IIO_LIGHT
	.comm	_MOTIONSENSE_CMD_SENSOR_OFFSET,4,2 ; @MOTIONSENSE_CMD_SENSOR_OFFSET
	.comm	_MOTIONSENSE_CMD_SENSOR_RANGE,4,2 ; @MOTIONSENSE_CMD_SENSOR_RANGE
	.comm	_EC_MOTION_SENSE_NO_VALUE,4,2   ; @EC_MOTION_SENSE_NO_VALUE
	.comm	_IIO_VAL_INT_PLUS_MICRO,4,2     ; @IIO_VAL_INT_PLUS_MICRO
	.no_dead_strip	_cros_ec_light_prox_read
.subsections_via_symbols
