	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bh1770_set_lux_rate
_bh1770_set_lux_rate:                   ## @bh1770_set_lux_rate
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r12
	callq	_dev_get_drvdata
	movq	%rax, %r15
	xorl	%ebx, %ebx
	leaq	-40(%rbp), %rdx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_kstrtoul
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	_lux_rates_hz@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cmpl	$2, %eax
	jl	LBB0_5
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-40(%rbp), %rax
	movq	(%r12), %rdi
	cmpq	(%rdi,%rbx,8), %rax
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	decl	%eax
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_5:
	movq	%r15, %r12
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movl	%ebx, (%r15)
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_bh1770_lux_rate
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	cmovsl	%ebx, %r14d
	movl	%r14d, %eax
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_lux_rates_hz,8,3               ## @lux_rates_hz
	.no_dead_strip	_bh1770_set_lux_rate
.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_rate
_bh1770_set_lux_rate:                   ; @bh1770_set_lux_rate
	.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	x19, x3
	mov	x21, x2
	bl	_dev_get_drvdata
	mov	x20, x0
	add	x2, sp, #8
	mov	x0, x21
	mov	w1, #0
	bl	_kstrtoul
	cbnz	w0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x22, _lux_rates_hz@GOTPAGE
Lloh1:
	ldr	x22, [x22, _lux_rates_hz@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #2
	b.lt	LBB0_5
; %bb.2:
	mov	x21, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #8]
	ldr	x0, [x22]
	ldr	x9, [x0, x21, lsl #3]
	cmp	x8, x9
	b.hs	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #1
	bl	_ARRAY_SIZE
	sub	w8, w0, #1
	cmp	x21, w8, sxtw
	b.lt	LBB0_3
	b	LBB0_6
LBB0_5:
	mov	w21, #0
LBB0_6:
	add	x22, x20, #4
	mov	x0, x22
	bl	_mutex_lock
	str	w21, [x20]
	mov	x0, x20
	mov	x1, x21
	bl	_bh1770_lux_rate
	mov	x20, x0
	mov	x0, x22
	bl	_mutex_unlock
	cmp	w20, #0
	csel	w0, w20, w19, lt
LBB0_7:
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_lux_rates_hz,8,3               ; @lux_rates_hz
	.no_dead_strip	_bh1770_set_lux_rate
.subsections_via_symbols
