	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brightness_set
_brightness_set:                        ## @brightness_set
	.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	_bright_maxlvl@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jae	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_2:
	movl	%edi, %r14d
	movq	_TPACPI_DBG_BRGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_vdbg_printk
	movq	_brightness_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock_killable
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	_brightness_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	-129(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_5
## %bb.10:
	movl	%r14d, %edi
	callq	_tpacpi_brightness_set_ec
	movl	%eax, %ebx
	jmp	LBB0_8
LBB0_3:
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_5:
	cmpl	$128, %eax
	jne	LBB0_7
## %bb.6:
	movl	%r14d, %edi
	callq	_tpacpi_brightness_set_ucmsstep
	movl	%eax, %ebx
	jmp	LBB0_8
LBB0_7:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movq	_brightness_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bright_maxlvl,4,2              ## @bright_maxlvl
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TPACPI_DBG_BRGHT,4,2           ## @TPACPI_DBG_BRGHT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set backlight level to %d\n"

	.comm	_brightness_mutex,4,2           ## @brightness_mutex
	.comm	_brightness_mode,4,2            ## @brightness_mode
	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_brightness_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brightness_set
_brightness_set:                        ; @brightness_set
	.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
Lloh0:
	adrp	x8, _bright_maxlvl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bright_maxlvl@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.hs	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_2:
	mov	x19, x0
Lloh6:
	adrp	x8, _TPACPI_DBG_BRGHT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TPACPI_DBG_BRGHT@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_vdbg_printk
Lloh11:
	adrp	x0, _brightness_mutex@GOTPAGE
Lloh12:
	ldr	x0, [x0, _brightness_mutex@GOTPAGEOFF]
	bl	_mutex_lock_killable
	tbnz	w0, #31, LBB0_5
; %bb.3:
Lloh13:
	adrp	x8, _brightness_mode@GOTPAGE
Lloh14:
	ldr	x8, [x8, _brightness_mode@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	sub	w9, w8, #129
	cmp	w9, #2
	b.hs	LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_tpacpi_brightness_set_ec
	mov	x20, x0
	b	LBB0_9
LBB0_5:
	mov	x20, x0
	b	LBB0_10
LBB0_6:
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_tpacpi_brightness_set_ucmsstep
	mov	x20, x0
	b	LBB0_9
LBB0_8:
Lloh16:
	adrp	x8, _ENXIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
Lloh19:
	adrp	x0, _brightness_mutex@GOTPAGE
Lloh20:
	ldr	x0, [x0, _brightness_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_bright_maxlvl,4,2              ; @bright_maxlvl
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TPACPI_DBG_BRGHT,4,2           ; @TPACPI_DBG_BRGHT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set backlight level to %d\n"

	.comm	_brightness_mutex,4,2           ; @brightness_mutex
	.comm	_brightness_mode,4,2            ; @brightness_mode
	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_brightness_set
.subsections_via_symbols
