	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bh1770_set_lux_thresh
_bh1770_set_lux_thresh:                 ## @bh1770_set_lux_thresh
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rax
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	-32(%rbp), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_kstrtoul
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	-32(%rbp), %rax
	movq	_BH1770_LUX_RANGE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jbe	LBB0_3
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_3:
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	-32(%rbp), %rax
	movq	%rax, (%r14)
	xorl	%ebx, %ebx
	cmpl	$0, 12(%r15)
	jne	LBB0_5
## %bb.4:
	movl	4(%r15), %edx
	movl	8(%r15), %esi
	movq	%r15, %rdi
	callq	_bh1770_lux_update_thresholds
	movl	%eax, %ebx
LBB0_5:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BH1770_LUX_RANGE,8,3           ## @BH1770_LUX_RANGE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_bh1770_set_lux_thresh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bh1770_set_lux_thresh
_bh1770_set_lux_thresh:                 ; @bh1770_set_lux_thresh
	.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
	mov	x8, x2
	mov	x20, x1
	mov	x19, x0
	add	x2, sp, #8
	mov	x0, x8
	mov	w1, #0
	bl	_kstrtoul
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.1:
	ldr	x8, [sp, #8]
Lloh0:
	adrp	x9, _BH1770_LUX_RANGE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BH1770_LUX_RANGE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ls	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
LBB0_3:
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [sp, #8]
	str	x8, [x20]
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_5
; %bb.4:
	mov	w21, #0
	b	LBB0_6
LBB0_5:
	ldp	w2, w1, [x19, #4]
	mov	x0, x19
	bl	_bh1770_lux_update_thresholds
	mov	x21, x0
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_BH1770_LUX_RANGE,8,3           ; @BH1770_LUX_RANGE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_bh1770_set_lux_thresh
.subsections_via_symbols
