	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ltr501_write_intr_prst
_ltr501_write_intr_prst:                ## @ltr501_write_intr_prst
	.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
	movl	%ecx, %eax
	orl	%edx, %eax
	js	LBB0_11
## %bb.1:
	movq	%rdi, %r15
	imull	$1000000, %edx, %ebx            ## imm = 0xF4240
	addl	%ecx, %ebx
	movslq	%ebx, %r14
	cmpl	$128, %esi
	je	LBB0_8
## %bb.2:
	cmpl	$129, %esi
	jne	LBB0_11
## %bb.3:
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	callq	_ltr501_als_read_samp_period
	testl	%eax, %eax
	js	LBB0_14
## %bb.4:
	movl	-44(%rbp), %esi
	cmpl	%esi, %ebx
	jb	LBB0_11
## %bb.5:
	movq	%r14, %rdi
	callq	_DIV_ROUND_UP
	cmpl	$16, %eax
	jae	LBB0_11
## %bb.6:
	movl	%eax, %ebx
	leaq	24(%r15), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movl	28(%r15), %edi
	movl	%ebx, %esi
	callq	_regmap_field_write
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%r13d, %r13d
	js	LBB0_12
## %bb.7:
	movq	%r14, (%r15)
	jmp	LBB0_12
LBB0_8:
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	callq	_ltr501_ps_read_samp_period
	testl	%eax, %eax
	js	LBB0_14
## %bb.9:
	movl	-44(%rbp), %esi
	cmpl	%esi, %ebx
	jb	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	callq	_DIV_ROUND_UP
	cmpl	$16, %eax
	jb	LBB0_15
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	%eax, %r13d
	jmp	LBB0_12
LBB0_15:
	movl	%eax, %ebx
	leaq	16(%r15), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movl	20(%r15), %edi
	movl	%ebx, %esi
	callq	_regmap_field_write
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%r13d, %r13d
	js	LBB0_12
## %bb.16:
	movq	%r14, 8(%r15)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ltr501_write_intr_prst
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ltr501_write_intr_prst
_ltr501_write_intr_prst:                ; @ltr501_write_intr_prst
	.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
	orr	w8, w3, w2
	tbnz	w8, #31, LBB0_11
; %bb.1:
	mov	x19, x0
	mov	w8, #16960
	movk	w8, #15, lsl #16
	madd	w8, w2, w8, w3
	sxtw	x20, w8
	cmp	w1, #128
	b.eq	LBB0_8
; %bb.2:
	cmp	w1, #129
	b.ne	LBB0_11
; %bb.3:
	add	x1, sp, #12
	mov	x0, x19
	bl	_ltr501_als_read_samp_period
	tbnz	w0, #31, LBB0_13
; %bb.4:
	ldr	w1, [sp, #12]
	cmp	w20, w1
	b.lo	LBB0_11
; %bb.5:
	mov	x0, x20
	bl	_DIV_ROUND_UP
	cmp	w0, #16
	b.hs	LBB0_11
; %bb.6:
	mov	x21, x0
	add	x22, x19, #24
	mov	x0, x22
	bl	_mutex_lock
	ldr	w0, [x19, #28]
	mov	x1, x21
	bl	_regmap_field_write
	mov	x21, x0
	mov	x0, x22
	bl	_mutex_unlock
	tbnz	w21, #31, LBB0_12
; %bb.7:
	str	x20, [x19]
	b	LBB0_12
LBB0_8:
	add	x1, sp, #12
	mov	x0, x19
	bl	_ltr501_ps_read_samp_period
	tbnz	w0, #31, LBB0_13
; %bb.9:
	ldr	w1, [sp, #12]
	cmp	w20, w1
	b.lo	LBB0_11
; %bb.10:
	mov	x0, x20
	bl	_DIV_ROUND_UP
	cmp	w0, #16
	b.lo	LBB0_14
LBB0_11:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, 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
	add	sp, sp, #64
	ret
LBB0_13:
	mov	x21, x0
	b	LBB0_12
LBB0_14:
	mov	x21, x0
	add	x22, x19, #16
	mov	x0, x22
	bl	_mutex_lock
	ldr	w0, [x19, #20]
	mov	x1, x21
	bl	_regmap_field_write
	mov	x21, x0
	mov	x0, x22
	bl	_mutex_unlock
	tbnz	w21, #31, LBB0_12
; %bb.15:
	str	x20, [x19, #8]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ltr501_write_intr_prst
.subsections_via_symbols
