	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sensor_set_auto_brightness
_sensor_set_auto_brightness:            ## @sensor_set_auto_brightness
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	testl	%esi, %esi
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$4, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
	movq	(%r15), %rax
	movq	_SEN_KS0127@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.1:
	movq	_SEN_KS0127B@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	_SEN_SAA7111A@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.4:
	xorl	%edx, %edx
	testl	%r14d, %r14d
	setne	%dl
	shll	$4, %edx
	movq	%r15, %rdi
	movl	$45, %esi
	movl	$16, %ecx
	callq	_i2c_w_mask
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	%r14d, 8(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str.3(%rip), %rsi
	movl	$5, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
	movq	_EPERM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_5:
	movl	%eax, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" (%s)"

L_.str.1:                               ## @.str.1
	.asciz	"turn on"

L_.str.2:                               ## @.str.2
	.asciz	"turn off"

	.comm	_SEN_KS0127,8,3                 ## @SEN_KS0127
	.comm	_SEN_KS0127B,8,3                ## @SEN_KS0127B
	.comm	_SEN_SAA7111A,8,3               ## @SEN_SAA7111A
L_.str.3:                               ## @.str.3
	.asciz	"Unsupported with this sensor"

	.comm	_EPERM,4,2                      ## @EPERM
	.no_dead_strip	_sensor_set_auto_brightness
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sensor_set_auto_brightness
_sensor_set_auto_brightness:            ; @sensor_set_auto_brightness
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, l_.str.1@PAGE
Lloh1:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh2:
	adrp	x9, l_.str.2@PAGE
Lloh3:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w1, #0
	csel	x8, x9, x8, eq
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	bl	_PDEBUG
	ldr	x8, [x20]
Lloh6:
	adrp	x9, _SEN_KS0127@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SEN_KS0127@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _SEN_KS0127B@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SEN_KS0127B@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
Lloh12:
	adrp	x11, _SEN_SAA7111A@GOTPAGE
Lloh13:
	ldr	x11, [x11, _SEN_SAA7111A@GOTPAGEOFF]
Lloh14:
	ldr	x11, [x11]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	b.ne	LBB0_2
; %bb.1:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #5
	bl	_PDEBUG
Lloh17:
	adrp	x8, _EPERM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_2:
	cmp	w19, #0
	cset	w8, ne
	lsl	w2, w8, #4
	mov	x0, x20
	mov	w1, #45
	mov	w3, #16
	bl	_i2c_w_mask
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	w0, #0
	str	w19, [x20, #8]
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" (%s)"

l_.str.1:                               ; @.str.1
	.asciz	"turn on"

l_.str.2:                               ; @.str.2
	.asciz	"turn off"

	.comm	_SEN_KS0127,8,3                 ; @SEN_KS0127
	.comm	_SEN_KS0127B,8,3                ; @SEN_KS0127B
	.comm	_SEN_SAA7111A,8,3               ; @SEN_SAA7111A
l_.str.3:                               ; @.str.3
	.asciz	"Unsupported with this sensor"

	.comm	_EPERM,4,2                      ; @EPERM
	.no_dead_strip	_sensor_set_auto_brightness
.subsections_via_symbols
