	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setbrightness
_setbrightness:                         ## @setbrightness
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	movq	_NORM_BRIGHTNESS_IDX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jae	LBB0_2
## %bb.1:
	movq	_ARGUS_QC_BRIGHTNESS_IDX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jae	LBB0_2
## %bb.8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	movq	(%rbx), %rax
	movq	_CAM_TYPE_VGA@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	sete	%r14b
	leal	7(,%r14,4), %esi
	cmpq	$0, 8(%rbx)
	jle	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_sensor_write1
	movl	8(%rbx), %edx
	jmp	LBB0_5
LBB0_4:
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_sensor_write1
	movl	$257, %edx                      ## imm = 0x101
	subl	8(%rbx), %edx
LBB0_5:
	leal	8(,%r14,4), %esi
	cmpq	$0, 16(%rbx)
	je	LBB0_7
## %bb.6:
	movslq	%edx, %rax
	leaq	_setbrightness.quick_clix_table(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
LBB0_7:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_sensor_write1                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @setbrightness.quick_clix_table
_setbrightness.quick_clix_table:
	.long	0                               ## 0x0
	.long	4                               ## 0x4
	.long	8                               ## 0x8
	.long	12                              ## 0xc
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	5                               ## 0x5
	.long	6                               ## 0x6
	.long	9                               ## 0x9
	.long	7                               ## 0x7
	.long	10                              ## 0xa
	.long	13                              ## 0xd
	.long	11                              ## 0xb
	.long	14                              ## 0xe
	.long	15                              ## 0xf

	.comm	_NORM_BRIGHTNESS_IDX,4,2        ## @NORM_BRIGHTNESS_IDX
	.comm	_ARGUS_QC_BRIGHTNESS_IDX,4,2    ## @ARGUS_QC_BRIGHTNESS_IDX
	.comm	_CAM_TYPE_VGA,8,3               ## @CAM_TYPE_VGA
	.no_dead_strip	_setbrightness
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setbrightness
_setbrightness:                         ; @setbrightness
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _NORM_BRIGHTNESS_IDX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NORM_BRIGHTNESS_IDX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsr	w9, w8, w9
	tbz	w9, #0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x9, _ARGUS_QC_BRIGHTNESS_IDX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ARGUS_QC_BRIGHTNESS_IDX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsr	w8, w8, w9
	tbz	w8, #0, LBB0_3
; %bb.2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh6:
	adrp	x8, _CAM_TYPE_VGA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CAM_TYPE_VGA@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldp	x9, x10, [x19]
	cmp	x9, x8
	mov	w8, #7
	mov	w9, #11
	csel	w1, w9, w8, eq
	mov	w8, #8
	mov	w9, #12
	csel	w20, w9, w8, eq
	mov	x0, x19
	cmp	x10, #1
	b.lt	LBB0_7
; %bb.4:
	mov	w2, #0
	bl	_sensor_write1
	ldr	w2, [x19, #8]
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
LBB0_5:
Lloh9:
	adrp	x8, _setbrightness.quick_clix_table@PAGE
Lloh10:
	add	x8, x8, _setbrightness.quick_clix_table@PAGEOFF
	ldr	w2, [x8, w2, sxtw #2]
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_sensor_write1
LBB0_7:
	mov	w2, #1
	bl	_sensor_write1
	ldr	w8, [x19, #8]
	mov	w9, #257
	sub	w2, w9, w8
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_5
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @setbrightness.quick_clix_table
_setbrightness.quick_clix_table:
	.long	0                               ; 0x0
	.long	4                               ; 0x4
	.long	8                               ; 0x8
	.long	12                              ; 0xc
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	5                               ; 0x5
	.long	6                               ; 0x6
	.long	9                               ; 0x9
	.long	7                               ; 0x7
	.long	10                              ; 0xa
	.long	13                              ; 0xd
	.long	11                              ; 0xb
	.long	14                              ; 0xe
	.long	15                              ; 0xf

	.comm	_NORM_BRIGHTNESS_IDX,4,2        ; @NORM_BRIGHTNESS_IDX
	.comm	_ARGUS_QC_BRIGHTNESS_IDX,4,2    ; @ARGUS_QC_BRIGHTNESS_IDX
	.comm	_CAM_TYPE_VGA,8,3               ; @CAM_TYPE_VGA
	.no_dead_strip	_setbrightness
.subsections_via_symbols
