	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ltr501_write_raw
_ltr501_write_raw:                      ## @ltr501_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, %r13
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_iio_priv
	movq	%rax, %r15
	movq	24(%rax), %rbx
	movq	%r12, %rdi
	callq	_iio_device_claim_direct_mode
	testl	%eax, %eax
	jne	LBB0_22
## %bb.1:
	movq	%rbx, %rsi
	movq	%r15, %rbx
	cmpq	$132, %r13
	je	LBB0_8
## %bb.2:
	cmpq	$131, %r13
	je	LBB0_11
## %bb.3:
	cmpq	$130, %r13
	jne	LBB0_20
## %bb.4:
	movl	(%r14), %eax
	cmpl	$128, %eax
	je	LBB0_17
## %bb.5:
	cmpl	$129, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	jne	LBB0_20
## %bb.6:
	movq	%rsi, %r14
	movl	16(%rsi), %esi
	movl	20(%r14), %edi
	callq	_ltr501_get_gain_index
	testl	%eax, %eax
	js	LBB0_20
## %bb.7:
	movl	(%r14), %edx
	notl	%edx
	andl	(%rbx), %edx
	movb	4(%r14), %cl
	shll	%cl, %eax
	orl	%edx, %eax
	movl	%eax, (%rbx)
	movl	20(%rbx), %edi
	movq	_LTR501_ALS_CONTR@GOTPCREL(%rip), %rcx
	jmp	LBB0_19
LBB0_8:
	cmpl	$129, (%r14)
	jne	LBB0_20
## %bb.9:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_20
## %bb.10:
	movq	%rbx, %r15
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_ltr501_set_it_time
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_21
LBB0_11:
	movq	%r14, %r15
	movl	(%r14), %eax
	cmpl	$128, %eax
	je	LBB0_23
## %bb.12:
	cmpl	$129, %eax
	jne	LBB0_20
## %bb.13:
	movq	%rbx, %r14
	leaq	-56(%rbp), %rsi
	leaq	-52(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ltr501_als_read_samp_freq
	testl	%eax, %eax
	js	LBB0_27
## %bb.14:
	movq	%r14, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_ltr501_als_write_samp_freq
	testl	%eax, %eax
	js	LBB0_27
## %bb.15:
	movl	(%r15), %esi
	movl	12(%r14), %ecx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_ltr501_write_intr_prst
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_21
## %bb.16:
	movl	-56(%rbp), %esi
	movl	-52(%rbp), %edx
	movq	%r14, %rdi
	callq	_ltr501_als_write_samp_freq
	movl	%eax, %ebx
	jmp	LBB0_21
LBB0_17:
	movq	%rsi, %rax
	movl	8(%rsi), %esi
	movl	12(%rax), %edi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_ltr501_get_gain_index
	testl	%eax, %eax
	js	LBB0_20
## %bb.18:
	movq	_LTR501_CONTR_PS_GAIN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	4(%rbx), %edx
	movq	_LTR501_CONTR_PS_GAIN_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%edx, %eax
	movl	%eax, 4(%rbx)
	movl	20(%rbx), %edi
	movq	_LTR501_PS_CONTR@GOTPCREL(%rip), %rcx
LBB0_19:
	movl	(%rcx), %esi
	movl	%eax, %edx
	callq	_regmap_write
	movl	%eax, %ebx
	jmp	LBB0_21
LBB0_20:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_21:
	movq	%r12, %rdi
	callq	_iio_device_release_direct_mode
	movl	%ebx, %eax
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	leaq	-56(%rbp), %rsi
	leaq	-52(%rbp), %rdx
	movq	%rbx, %r14
	movq	%rbx, %rdi
	callq	_ltr501_ps_read_samp_freq
	testl	%eax, %eax
	js	LBB0_27
## %bb.24:
	movq	%r14, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_ltr501_ps_write_samp_freq
	testl	%eax, %eax
	js	LBB0_27
## %bb.25:
	movl	(%r15), %esi
	movl	8(%r14), %ecx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_ltr501_write_intr_prst
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_21
## %bb.26:
	movl	-56(%rbp), %esi
	movl	-52(%rbp), %edx
	movq	%r14, %rdi
	callq	_ltr501_ps_write_samp_freq
LBB0_27:
	movl	%eax, %ebx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LTR501_ALS_CONTR,4,2           ## @LTR501_ALS_CONTR
	.comm	_LTR501_CONTR_PS_GAIN_MASK,4,2  ## @LTR501_CONTR_PS_GAIN_MASK
	.comm	_LTR501_CONTR_PS_GAIN_SHIFT,4,2 ## @LTR501_CONTR_PS_GAIN_SHIFT
	.comm	_LTR501_PS_CONTR,4,2            ## @LTR501_PS_CONTR
	.no_dead_strip	_ltr501_write_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ltr501_write_raw
_ltr501_write_raw:                      ; @ltr501_write_raw
	.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	x25, x4
	mov	x21, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
	bl	_iio_priv
	mov	x20, x0
	ldr	x26, [x0, #24]
	mov	x0, x19
	bl	_iio_device_claim_direct_mode
	mov	x22, x0
	cbnz	w0, LBB0_22
; %bb.1:
	cmp	x25, #132
	b.eq	LBB0_8
; %bb.2:
	cmp	x25, #131
	b.eq	LBB0_11
; %bb.3:
	cmp	x25, #130
	b.ne	LBB0_20
; %bb.4:
	ldr	w8, [x24]
	cmp	w8, #128
	b.eq	LBB0_17
; %bb.5:
	cmp	w8, #129
	b.ne	LBB0_20
; %bb.6:
	ldp	w1, w0, [x26, #16]
	mov	x2, x23
	mov	x3, x21
	bl	_ltr501_get_gain_index
	tbnz	w0, #31, LBB0_20
; %bb.7:
	ldr	w8, [x20]
	ldp	w9, w10, [x26]
	bic	w8, w8, w9
	lsl	w9, w0, w10
	orr	w2, w9, w8
	str	w2, [x20]
	ldr	w0, [x20, #20]
Lloh0:
	adrp	x8, _LTR501_ALS_CONTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LTR501_ALS_CONTR@GOTPAGEOFF]
	b	LBB0_19
LBB0_8:
	ldr	w8, [x24]
	cmp	w8, #129
	b.ne	LBB0_20
; %bb.9:
	cbnz	w23, LBB0_20
; %bb.10:
	add	x23, x20, #16
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x21
	bl	_ltr501_set_it_time
	mov	x22, x0
	mov	x0, x23
	bl	_mutex_unlock
	b	LBB0_21
LBB0_11:
	ldr	w8, [x24]
	cmp	w8, #128
	b.eq	LBB0_23
; %bb.12:
	cmp	w8, #129
	b.ne	LBB0_20
; %bb.13:
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x20
	bl	_ltr501_als_read_samp_freq
	tbnz	w0, #31, LBB0_27
; %bb.14:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x21
	bl	_ltr501_als_write_samp_freq
	tbnz	w0, #31, LBB0_27
; %bb.15:
	ldr	w1, [x24]
	ldr	w3, [x20, #12]
	mov	x0, x20
	mov	w2, #0
	bl	_ltr501_write_intr_prst
	mov	x22, x0
	tbz	w0, #31, LBB0_21
; %bb.16:
	ldp	w2, w1, [sp, #8]
	mov	x0, x20
	bl	_ltr501_als_write_samp_freq
	mov	x22, x0
	b	LBB0_21
LBB0_17:
	ldp	w1, w0, [x26, #8]
	mov	x2, x23
	mov	x3, x21
	bl	_ltr501_get_gain_index
	tbnz	w0, #31, LBB0_20
; %bb.18:
Lloh2:
	adrp	x8, _LTR501_CONTR_PS_GAIN_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LTR501_CONTR_PS_GAIN_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x20, #4]
	bic	w8, w9, w8
Lloh5:
	adrp	x9, _LTR501_CONTR_PS_GAIN_SHIFT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _LTR501_CONTR_PS_GAIN_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	lsl	w9, w0, w9
	orr	w2, w9, w8
	str	w2, [x20, #4]
	ldr	w0, [x20, #20]
Lloh8:
	adrp	x8, _LTR501_PS_CONTR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LTR501_PS_CONTR@GOTPAGEOFF]
LBB0_19:
	ldr	w1, [x8]
	bl	_regmap_write
	mov	x22, x0
	b	LBB0_21
LBB0_20:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_21:
	mov	x0, x19
	bl	_iio_device_release_direct_mode
LBB0_22:
	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
LBB0_23:
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x20
	bl	_ltr501_ps_read_samp_freq
	tbnz	w0, #31, LBB0_27
; %bb.24:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x21
	bl	_ltr501_ps_write_samp_freq
	tbnz	w0, #31, LBB0_27
; %bb.25:
	ldr	w1, [x24]
	ldr	w3, [x20, #8]
	mov	x0, x20
	mov	w2, #0
	bl	_ltr501_write_intr_prst
	mov	x22, x0
	tbz	w0, #31, LBB0_21
; %bb.26:
	ldp	w2, w1, [sp, #8]
	mov	x0, x20
	bl	_ltr501_ps_write_samp_freq
LBB0_27:
	mov	x22, x0
	b	LBB0_21
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LTR501_ALS_CONTR,4,2           ; @LTR501_ALS_CONTR
	.comm	_LTR501_CONTR_PS_GAIN_MASK,4,2  ; @LTR501_CONTR_PS_GAIN_MASK
	.comm	_LTR501_CONTR_PS_GAIN_SHIFT,4,2 ; @LTR501_CONTR_PS_GAIN_SHIFT
	.comm	_LTR501_PS_CONTR,4,2            ; @LTR501_PS_CONTR
	.no_dead_strip	_ltr501_write_raw
.subsections_via_symbols
