	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si1145_write_raw
_si1145_write_raw:                      ## @si1145_write_raw
	.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, %r14
	movl	%ecx, %r13d
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_iio_priv
	movq	%rax, %rdi
	cmpq	$132, %r14
	je	LBB0_7
## %bb.1:
	cmpq	$131, %r14
	je	LBB0_15
## %bb.2:
	cmpq	$130, %r14
	jne	LBB0_13
## %bb.3:
	movl	4(%rbx), %eax
	cmpl	$129, %eax
	je	LBB0_16
## %bb.4:
	cmpl	$128, %eax
	jne	LBB0_13
## %bb.5:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_si1145_proximity_adcgain_from_scale
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_22
## %bb.6:
	movq	_SI1145_PARAM_PS_ADC_COUNTER@GOTPCREL(%rip), %rcx
	movq	_SI1145_PARAM_PS_ADC_GAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_7:
	movl	4(%rbx), %eax
	movq	_IIO_CURRENT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.8:
	cmpl	$15, %r12d
	ja	LBB0_13
## %bb.9:
	testl	%r13d, %r13d
	jne	LBB0_13
## %bb.10:
	movq	%rdi, %r14
	movl	(%rbx), %edi
	callq	_SI1145_PS_LED_REG
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	(%rbx), %edi
	callq	_SI1145_PS_LED_SHIFT
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_iio_device_claim_direct_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:
	movl	(%r14), %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_24
## %bb.12:
	movl	$15, %eax
	movl	%r13d, %ecx
	shll	%cl, %eax
	movl	(%r14), %edi
	notl	%eax
	andl	%eax, %ebx
	shll	%cl, %r12d
	orl	%ebx, %r12d
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	callq	_i2c_smbus_write_byte_data
	jmp	LBB0_23
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%r12d, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_si1145_store_samp_freq         ## TAILCALL
LBB0_16:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_si1145_intensity_adcgain_from_scale
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_22
## %bb.17:
	movl	8(%rbx), %eax
	movq	_IIO_MOD_LIGHT_IR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movq	_SI1145_PARAM_ALSVIS_ADC_GAIN@GOTPCREL(%rip), %rax
	cmoveq	_SI1145_PARAM_ALSIR_ADC_GAIN@GOTPCREL(%rip), %rax
	movq	_SI1145_PARAM_ALSVIS_ADC_COUNTER@GOTPCREL(%rip), %rcx
	cmoveq	_SI1145_PARAM_ALSIR_ADC_COUNTER@GOTPCREL(%rip), %rcx
LBB0_18:
	movl	(%rcx), %r13d
	movl	(%rax), %r14d
	movq	%r15, %rdi
	callq	_iio_device_claim_direct_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.19:
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r12d, %edx
	callq	_si1145_param_set
	testl	%eax, %eax
	js	LBB0_23
## %bb.20:
	shll	$4, %r12d
	notl	%r12d
	andl	$112, %r12d
	movq	%r13, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	callq	_si1145_param_set
LBB0_23:
	movl	%eax, %ebx
LBB0_24:
	movq	%r15, %rdi
	callq	_iio_device_release_direct_mode
	jmp	LBB0_14
LBB0_22:
	movl	%r12d, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_SI1145_PARAM_PS_ADC_GAIN,4,2   ## @SI1145_PARAM_PS_ADC_GAIN
	.comm	_SI1145_PARAM_PS_ADC_COUNTER,4,2 ## @SI1145_PARAM_PS_ADC_COUNTER
	.comm	_IIO_MOD_LIGHT_IR,4,2           ## @IIO_MOD_LIGHT_IR
	.comm	_SI1145_PARAM_ALSIR_ADC_GAIN,4,2 ## @SI1145_PARAM_ALSIR_ADC_GAIN
	.comm	_SI1145_PARAM_ALSIR_ADC_COUNTER,4,2 ## @SI1145_PARAM_ALSIR_ADC_COUNTER
	.comm	_SI1145_PARAM_ALSVIS_ADC_GAIN,4,2 ## @SI1145_PARAM_ALSVIS_ADC_GAIN
	.comm	_SI1145_PARAM_ALSVIS_ADC_COUNTER,4,2 ## @SI1145_PARAM_ALSVIS_ADC_COUNTER
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IIO_CURRENT,4,2                ## @IIO_CURRENT
	.no_dead_strip	_si1145_write_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si1145_write_raw
_si1145_write_raw:                      ; @si1145_write_raw
	.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	x24, x4
	mov	x23, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_iio_priv
	mov	x20, x0
	cmp	x24, #132
	b.eq	LBB0_7
; %bb.1:
	cmp	x24, #131
	b.eq	LBB0_16
; %bb.2:
	cmp	x24, #130
	b.ne	LBB0_13
; %bb.3:
	ldr	w8, [x22, #4]
	cmp	w8, #129
	b.eq	LBB0_17
; %bb.4:
	cmp	w8, #128
	b.ne	LBB0_13
; %bb.5:
	mov	x0, x21
	mov	x1, x23
	bl	_si1145_proximity_adcgain_from_scale
	mov	x21, x0
	tbnz	w0, #31, LBB0_23
; %bb.6:
Lloh0:
	adrp	x9, _SI1145_PARAM_PS_ADC_COUNTER@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SI1145_PARAM_PS_ADC_COUNTER@GOTPAGEOFF]
Lloh2:
	adrp	x8, _SI1145_PARAM_PS_ADC_GAIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SI1145_PARAM_PS_ADC_GAIN@GOTPAGEOFF]
	b	LBB0_19
LBB0_7:
	ldr	w8, [x22, #4]
Lloh4:
	adrp	x9, _IIO_CURRENT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _IIO_CURRENT@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.8:
	cmp	w21, #15
	b.hi	LBB0_13
; %bb.9:
	cbnz	w23, LBB0_13
; %bb.10:
	ldr	w0, [x22]
	bl	_SI1145_PS_LED_REG
	mov	x23, x0
	ldr	w0, [x22]
	bl	_SI1145_PS_LED_SHIFT
	mov	x24, x0
	mov	x0, x19
	bl	_iio_device_claim_direct_mode
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.11:
	ldr	w0, [x20]
	mov	x1, x23
	bl	_i2c_smbus_read_byte_data
	mov	x22, x0
	tbnz	w0, #31, LBB0_25
; %bb.12:
	ldr	w0, [x20]
	mov	w8, #15
	lsl	w8, w8, w24
	bic	w8, w22, w8
	lsl	w9, w21, w24
	orr	w2, w8, w9
	mov	x1, x23
	bl	_i2c_smbus_write_byte_data
	b	LBB0_22
LBB0_13:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_14:
	mov	x0, x22
LBB0_15:
	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
LBB0_16:
	mov	x0, x20
	mov	x1, x21
	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
	b	_si1145_store_samp_freq
LBB0_17:
	mov	x0, x21
	mov	x1, x23
	bl	_si1145_intensity_adcgain_from_scale
	mov	x21, x0
	tbnz	w0, #31, LBB0_23
; %bb.18:
	ldr	w8, [x22, #8]
Lloh10:
	adrp	x9, _IIO_MOD_LIGHT_IR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IIO_MOD_LIGHT_IR@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _SI1145_PARAM_ALSVIS_ADC_GAIN@GOTPAGE
Lloh14:
	ldr	x10, [x10, _SI1145_PARAM_ALSVIS_ADC_GAIN@GOTPAGEOFF]
Lloh15:
	adrp	x11, _SI1145_PARAM_ALSIR_ADC_GAIN@GOTPAGE
Lloh16:
	ldr	x11, [x11, _SI1145_PARAM_ALSIR_ADC_GAIN@GOTPAGEOFF]
	cmp	w8, w9
	csel	x8, x11, x10, eq
Lloh17:
	adrp	x9, _SI1145_PARAM_ALSVIS_ADC_COUNTER@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SI1145_PARAM_ALSVIS_ADC_COUNTER@GOTPAGEOFF]
Lloh19:
	adrp	x10, _SI1145_PARAM_ALSIR_ADC_COUNTER@GOTPAGE
Lloh20:
	ldr	x10, [x10, _SI1145_PARAM_ALSIR_ADC_COUNTER@GOTPAGEOFF]
	csel	x9, x10, x9, eq
LBB0_19:
	ldr	w23, [x9]
	ldr	w24, [x8]
	mov	x0, x19
	bl	_iio_device_claim_direct_mode
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.20:
	mov	x0, x20
	mov	x1, x24
	mov	x2, x21
	bl	_si1145_param_set
	tbnz	w0, #31, LBB0_24
; %bb.21:
	mov	w8, #112
	bic	w2, w8, w21, lsl #4
	mov	x0, x20
	mov	x1, x23
	bl	_si1145_param_set
LBB0_22:
	mov	x20, x0
	mov	x0, x19
	bl	_iio_device_release_direct_mode
	mov	x0, x20
	b	LBB0_15
LBB0_23:
	mov	x22, x21
	b	LBB0_14
LBB0_24:
	mov	x22, x0
LBB0_25:
	mov	x0, x19
	bl	_iio_device_release_direct_mode
	b	LBB0_14
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SI1145_PARAM_PS_ADC_GAIN,4,2   ; @SI1145_PARAM_PS_ADC_GAIN
	.comm	_SI1145_PARAM_PS_ADC_COUNTER,4,2 ; @SI1145_PARAM_PS_ADC_COUNTER
	.comm	_IIO_MOD_LIGHT_IR,4,2           ; @IIO_MOD_LIGHT_IR
	.comm	_SI1145_PARAM_ALSIR_ADC_GAIN,4,2 ; @SI1145_PARAM_ALSIR_ADC_GAIN
	.comm	_SI1145_PARAM_ALSIR_ADC_COUNTER,4,2 ; @SI1145_PARAM_ALSIR_ADC_COUNTER
	.comm	_SI1145_PARAM_ALSVIS_ADC_GAIN,4,2 ; @SI1145_PARAM_ALSVIS_ADC_GAIN
	.comm	_SI1145_PARAM_ALSVIS_ADC_COUNTER,4,2 ; @SI1145_PARAM_ALSVIS_ADC_COUNTER
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IIO_CURRENT,4,2                ; @IIO_CURRENT
	.no_dead_strip	_si1145_write_raw
.subsections_via_symbols
