	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_lcd_brightness
_set_lcd_brightness:                    ## @set_lcd_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	xorl	%esi, %esi
	subl	$1, %ebx
	setb	%sil
	cmovbl	%eax, %ebx
	movq	%r14, %rdi
	callq	_set_tr_backlight_status
	testl	%eax, %eax
	jne	LBB0_7
LBB0_2:
	movq	_HCI_LCD_BRIGHTNESS_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_HCI_LCD_BRIGHTNESS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_hci_write
	movq	%rax, %rbx
	movq	_TOS_FAILURE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_5
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_4
LBB0_5:
	movq	_TOS_NOT_SUPPORTED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_4
## %bb.6:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_4:
	movq	_TOS_SUCCESS@GOTPCREL(%rip), %rcx
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	xorl	%eax, %eax
	subl	(%rdx), %eax
	cmpq	(%rcx), %rbx
	cmovel	%esi, %eax
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HCI_LCD_BRIGHTNESS_SHIFT,4,2   ## @HCI_LCD_BRIGHTNESS_SHIFT
	.comm	_HCI_LCD_BRIGHTNESS,4,2         ## @HCI_LCD_BRIGHTNESS
	.comm	_TOS_FAILURE,8,3                ## @TOS_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ACPI call to set LCD Brightness failed\n"

	.comm	_TOS_NOT_SUPPORTED,8,3          ## @TOS_NOT_SUPPORTED
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_TOS_SUCCESS,8,3                ## @TOS_SUCCESS
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_set_lcd_brightness
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_lcd_brightness
_set_lcd_brightness:                    ; @set_lcd_brightness
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	sub	w8, w20, #1
	cmp	w20, #0
	cset	w1, eq
	csel	w20, wzr, w8, eq
	mov	x0, x19
	bl	_set_tr_backlight_status
	cbnz	w0, LBB0_7
LBB0_2:
Lloh0:
	adrp	x8, _HCI_LCD_BRIGHTNESS_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HCI_LCD_BRIGHTNESS_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w2, w20, w8
Lloh3:
	adrp	x8, _HCI_LCD_BRIGHTNESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HCI_LCD_BRIGHTNESS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hci_write
	mov	x19, x0
Lloh6:
	adrp	x8, _TOS_FAILURE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TOS_FAILURE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_6
LBB0_4:
Lloh11:
	adrp	x8, _TOS_NOT_SUPPORTED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TOS_NOT_SUPPORTED@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x19, x8
	b.ne	LBB0_6
; %bb.5:
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
Lloh17:
	adrp	x8, _TOS_SUCCESS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TOS_SUCCESS@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
Lloh20:
	adrp	x9, _EIO@GOTPAGE
Lloh21:
	ldr	x9, [x9, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	x19, x8
	csneg	w0, wzr, w9, eq
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_HCI_LCD_BRIGHTNESS_SHIFT,4,2   ; @HCI_LCD_BRIGHTNESS_SHIFT
	.comm	_HCI_LCD_BRIGHTNESS,4,2         ; @HCI_LCD_BRIGHTNESS
	.comm	_TOS_FAILURE,8,3                ; @TOS_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ACPI call to set LCD Brightness failed\n"

	.comm	_TOS_NOT_SUPPORTED,8,3          ; @TOS_NOT_SUPPORTED
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_TOS_SUCCESS,8,3                ; @TOS_SUCCESS
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_set_lcd_brightness
.subsections_via_symbols
