	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s6e3ha2_set_brightness
_s6e3ha2_set_brightness:                ## @s6e3ha2_set_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
	movq	%rdi, %rbx
	callq	_bl_get_data
	movq	%rax, %r14
	movl	(%rbx), %r15d
	movq	_S6E3HA2_MIN_BRIGHTNESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jb	LBB0_2
## %bb.1:
	cmpl	4(%rbx), %r15d
	jbe	LBB0_3
LBB0_2:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	8(%rbx), %rax
	movq	_FB_BLANK_NORMAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_6
## %bb.4:
	movq	_EPERM@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_6:
	movq	%r14, %rdi
	callq	_s6e3ha2_test_key_on_f0
	movl	%eax, %esi
	callq	_s6e3ha2_call_write_func
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_s6e3ha2_update_gamma
	movl	%eax, %esi
	callq	_s6e3ha2_call_write_func
	movq	%r14, %rdi
	callq	_s6e3ha2_aor_control
	movl	%eax, %esi
	callq	_s6e3ha2_call_write_func
	movq	%r14, %rdi
	callq	_s6e3ha2_set_vint
	movl	%eax, %esi
	callq	_s6e3ha2_call_write_func
	movq	%r14, %rdi
	callq	_s6e3ha2_test_key_off_f0
	movl	%eax, %esi
	callq	_s6e3ha2_call_write_func
	xorl	%eax, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_S6E3HA2_MIN_BRIGHTNESS,4,2     ## @S6E3HA2_MIN_BRIGHTNESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid brightness: %u\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FB_BLANK_NORMAL,8,3            ## @FB_BLANK_NORMAL
	.comm	_EPERM,4,2                      ## @EPERM
	.no_dead_strip	_s6e3ha2_set_brightness
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s6e3ha2_set_brightness
_s6e3ha2_set_brightness:                ; @s6e3ha2_set_brightness
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x0
	bl	_bl_get_data
	mov	x19, x0
	ldr	w20, [x21]
Lloh0:
	adrp	x8, _S6E3HA2_MIN_BRIGHTNESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _S6E3HA2_MIN_BRIGHTNESS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w20, w8
	b.lo	LBB0_2
; %bb.1:
	ldr	w8, [x21, #4]
	cmp	w20, w8
	b.ls	LBB0_5
LBB0_2:
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x8, [x21, #8]
Lloh7:
	adrp	x9, _FB_BLANK_NORMAL@GOTPAGE
Lloh8:
	ldr	x9, [x9, _FB_BLANK_NORMAL@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_7
; %bb.6:
Lloh10:
	adrp	x8, _EPERM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_3
LBB0_7:
	mov	x0, x19
	bl	_s6e3ha2_test_key_on_f0
	mov	x1, x0
	bl	_s6e3ha2_call_write_func
	mov	x0, x19
	mov	x1, x20
	bl	_s6e3ha2_update_gamma
	mov	x1, x0
	bl	_s6e3ha2_call_write_func
	mov	x0, x19
	bl	_s6e3ha2_aor_control
	mov	x1, x0
	bl	_s6e3ha2_call_write_func
	mov	x0, x19
	bl	_s6e3ha2_set_vint
	mov	x1, x0
	bl	_s6e3ha2_call_write_func
	mov	x0, x19
	bl	_s6e3ha2_test_key_off_f0
	mov	x1, x0
	bl	_s6e3ha2_call_write_func
	mov	w0, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_S6E3HA2_MIN_BRIGHTNESS,4,2     ; @S6E3HA2_MIN_BRIGHTNESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid brightness: %u\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FB_BLANK_NORMAL,8,3            ; @FB_BLANK_NORMAL
	.comm	_EPERM,4,2                      ; @EPERM
	.no_dead_strip	_s6e3ha2_set_brightness
.subsections_via_symbols
