	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function asus_wmi_backlight_init
_asus_wmi_backlight_init:               ## @asus_wmi_backlight_init
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_read_brightness_max
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_read_backlight_power
	movl	%eax, %r14d
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	jne	LBB0_4
## %bb.3:
	movq	_FB_BLANK_UNBLANK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_5
LBB0_1:
	movl	%ebx, %r14d
	jmp	LBB0_10
LBB0_4:
	testl	%r14d, %r14d
	js	LBB0_10
LBB0_5:
	leaq	-40(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_BACKLIGHT_PLATFORM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movl	%ebx, -40(%rbp)
	movq	(%r15), %rax
	movq	16(%r15), %rsi
	movl	16(%rax), %edi
	movq	_asus_wmi_bl_ops@GOTPCREL(%rip), %rcx
	movq	%r15, %rdx
	movq	%r12, %r8
	callq	_backlight_device_register
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %r14d
	jmp	LBB0_10
LBB0_7:
	movq	%rbx, 8(%r15)
	movq	(%r15), %rax
	movq	8(%rax), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_9
## %bb.8:
	movl	%r14d, (%rax)
LBB0_9:
	movq	%rbx, %rdi
	callq	_read_brightness
	movl	%eax, 4(%rbx)
	movl	%r14d, (%rbx)
	movq	%rbx, %rdi
	callq	_backlight_update_status
	movl	4(%rbx), %eax
	movq	(%r15), %rcx
	movl	%eax, 4(%rcx)
	xorl	%r14d, %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_FB_BLANK_UNBLANK,4,2           ## @FB_BLANK_UNBLANK
	.comm	_BACKLIGHT_PLATFORM,4,2         ## @BACKLIGHT_PLATFORM
	.comm	_asus_wmi_bl_ops,4,2            ## @asus_wmi_bl_ops
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not register backlight device\n"

	.no_dead_strip	_asus_wmi_backlight_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function asus_wmi_backlight_init
_asus_wmi_backlight_init:               ; @asus_wmi_backlight_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	bl	_read_brightness_max
	mov	x21, x0
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_read_backlight_power
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _FB_BLANK_UNBLANK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FB_BLANK_UNBLANK@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	b	LBB0_5
LBB0_3:
	mov	x20, x21
	b	LBB0_10
LBB0_4:
	mov	x20, x0
	tbnz	w0, #31, LBB0_10
LBB0_5:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh6:
	adrp	x8, _BACKLIGHT_PLATFORM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BACKLIGHT_PLATFORM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	stp	w21, w8, [sp, #8]
	ldr	x8, [x19]
	ldr	w0, [x8, #16]
	ldr	x1, [x19, #16]
Lloh9:
	adrp	x3, _asus_wmi_bl_ops@GOTPAGE
Lloh10:
	ldr	x3, [x3, _asus_wmi_bl_ops@GOTPAGEOFF]
	add	x4, sp, #8
	mov	x2, x19
	bl	_backlight_device_register
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.6:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	mov	x0, x21
	bl	_PTR_ERR
	mov	x20, x0
	b	LBB0_10
LBB0_7:
	str	x21, [x19, #8]
	ldr	x8, [x19]
	ldr	x9, [x8, #8]
	ldr	x9, [x9]
	cbz	x9, LBB0_9
; %bb.8:
	str	w20, [x8]
LBB0_9:
	mov	x0, x21
	bl	_read_brightness
	stp	w20, w0, [x21]
	mov	x0, x21
	bl	_backlight_update_status
	mov	w20, #0
	ldr	w8, [x21, #4]
	ldr	x9, [x19]
	str	w8, [x9, #4]
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_FB_BLANK_UNBLANK,4,2           ; @FB_BLANK_UNBLANK
	.comm	_BACKLIGHT_PLATFORM,4,2         ; @BACKLIGHT_PLATFORM
	.comm	_asus_wmi_bl_ops,4,2            ; @asus_wmi_bl_ops
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not register backlight device\n"

	.no_dead_strip	_asus_wmi_backlight_init
.subsections_via_symbols
