	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tpacpi_brightness_set_ec
_tpacpi_brightness_set_ec:              ## @tpacpi_brightness_set_ec
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	movl	$0, -20(%rbp)
	movq	_TP_EC_BACKLIGHT@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	-20(%rbp), %rsi
	callq	_acpi_ec_read
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movl	(%r14), %edi
	movq	_TP_EC_BACKLIGHT_CMDMSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-20(%rbp), %eax
	movq	_TP_EC_BACKLIGHT_LVLMSK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	orl	%eax, %ebx
	movl	%ebx, %esi
	callq	_acpi_ec_write
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	xorl	%eax, %eax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_TP_EC_BACKLIGHT,4,2            ## @TP_EC_BACKLIGHT
	.comm	_EIO,4,2                        ## @EIO
	.comm	_TP_EC_BACKLIGHT_CMDMSK,4,2     ## @TP_EC_BACKLIGHT_CMDMSK
	.comm	_TP_EC_BACKLIGHT_LVLMSK,4,2     ## @TP_EC_BACKLIGHT_LVLMSK
	.no_dead_strip	_tpacpi_brightness_set_ec
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tpacpi_brightness_set_ec
_tpacpi_brightness_set_ec:              ; @tpacpi_brightness_set_ec
	.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, x0
	str	wzr, [sp, #12]
Lloh0:
	adrp	x20, _TP_EC_BACKLIGHT@GOTPAGE
Lloh1:
	ldr	x20, [x20, _TP_EC_BACKLIGHT@GOTPAGEOFF]
	ldr	w0, [x20]
	add	x1, sp, #12
	bl	_acpi_ec_read
	cmp	w0, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x20]
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _TP_EC_BACKLIGHT_CMDMSK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TP_EC_BACKLIGHT_CMDMSK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh5:
	adrp	x9, _TP_EC_BACKLIGHT_LVLMSK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TP_EC_BACKLIGHT_LVLMSK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w9, w9, w19
	orr	w1, w9, w8
	bl	_acpi_ec_write
	cmp	w0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_3
LBB0_2:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_TP_EC_BACKLIGHT,4,2            ; @TP_EC_BACKLIGHT
	.comm	_EIO,4,2                        ; @EIO
	.comm	_TP_EC_BACKLIGHT_CMDMSK,4,2     ; @TP_EC_BACKLIGHT_CMDMSK
	.comm	_TP_EC_BACKLIGHT_LVLMSK,4,2     ; @TP_EC_BACKLIGHT_LVLMSK
	.no_dead_strip	_tpacpi_brightness_set_ec
.subsections_via_symbols
