	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ideapad_backlight_init
_ideapad_backlight_init:                ## @ideapad_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	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movl	(%rax), %edi
	movq	_VPCCMD_R_BL_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	callq	_read_ec_data
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	movq	_VPCCMD_R_BL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	callq	_read_ec_data
	testq	%rax, %rax
	jne	LBB0_1
## %bb.3:
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	movq	_VPCCMD_R_BL_POWER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	callq	_read_ec_data
	testq	%rax, %rax
	je	LBB0_4
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_4:
	leaq	-56(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	-40(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	_BACKLIGHT_PLATFORM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	8(%rbx), %rsi
	leaq	L_.str(%rip), %rdi
	movq	_ideapad_backlight_ops@GOTPCREL(%rip), %rcx
	movq	%rbx, %rdx
	movq	%r14, %r8
	callq	_backlight_device_register
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	movq	%r14, %rdi
	callq	_PTR_ERR
	jmp	LBB0_10
LBB0_6:
	movq	%r14, (%rbx)
	movq	-32(%rbp), %rax
	movq	%rax, (%r14)
	cmpq	$0, -24(%rbp)
	jne	LBB0_7
## %bb.8:
	movq	_FB_BLANK_POWERDOWN@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_FB_BLANK_UNBLANK@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movq	%r14, %rdi
	callq	_backlight_update_status
	xorl	%eax, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_VPCCMD_R_BL_MAX,4,2            ## @VPCCMD_R_BL_MAX
	.comm	_EIO,4,2                        ## @EIO
	.comm	_VPCCMD_R_BL,4,2                ## @VPCCMD_R_BL
	.comm	_VPCCMD_R_BL_POWER,4,2          ## @VPCCMD_R_BL_POWER
	.comm	_BACKLIGHT_PLATFORM,4,2         ## @BACKLIGHT_PLATFORM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ideapad"

	.comm	_ideapad_backlight_ops,4,2      ## @ideapad_backlight_ops
L_.str.1:                               ## @.str.1
	.asciz	"Could not register backlight device\n"

	.comm	_FB_BLANK_UNBLANK,4,2           ## @FB_BLANK_UNBLANK
	.comm	_FB_BLANK_POWERDOWN,4,2         ## @FB_BLANK_POWERDOWN
	.no_dead_strip	_ideapad_backlight_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ideapad_backlight_init
_ideapad_backlight_init:                ; @ideapad_backlight_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w0, [x8]
Lloh0:
	adrp	x8, _VPCCMD_R_BL_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VPCCMD_R_BL_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #24
	bl	_read_ec_data
	cbnz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _VPCCMD_R_BL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VPCCMD_R_BL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #16
	bl	_read_ec_data
	cbnz	x0, LBB0_3
; %bb.2:
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _VPCCMD_R_BL_POWER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VPCCMD_R_BL_POWER@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_read_ec_data
	cbz	x0, LBB0_5
LBB0_3:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	add	x0, sp, #32
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	ldr	x8, [sp, #24]
	str	x8, [sp, #32]
Lloh12:
	adrp	x8, _BACKLIGHT_PLATFORM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BACKLIGHT_PLATFORM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	ldr	x1, [x19, #8]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
Lloh17:
	adrp	x3, _ideapad_backlight_ops@GOTPAGE
Lloh18:
	ldr	x3, [x3, _ideapad_backlight_ops@GOTPAGEOFF]
	add	x4, sp, #32
	mov	x2, x19
	bl	_backlight_device_register
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.6:
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	mov	x0, x20
	bl	_PTR_ERR
	b	LBB0_4
LBB0_7:
	str	x20, [x19]
	ldr	x8, [sp, #16]
	str	x8, [x20]
	ldr	x8, [sp, #8]
Lloh21:
	adrp	x9, _FB_BLANK_UNBLANK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _FB_BLANK_UNBLANK@GOTPAGEOFF]
Lloh23:
	adrp	x10, _FB_BLANK_POWERDOWN@GOTPAGE
Lloh24:
	ldr	x10, [x10, _FB_BLANK_POWERDOWN@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	str	w8, [x20, #8]
	mov	x0, x20
	bl	_backlight_update_status
	mov	w0, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_VPCCMD_R_BL_MAX,4,2            ; @VPCCMD_R_BL_MAX
	.comm	_EIO,4,2                        ; @EIO
	.comm	_VPCCMD_R_BL,4,2                ; @VPCCMD_R_BL
	.comm	_VPCCMD_R_BL_POWER,4,2          ; @VPCCMD_R_BL_POWER
	.comm	_BACKLIGHT_PLATFORM,4,2         ; @BACKLIGHT_PLATFORM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ideapad"

	.comm	_ideapad_backlight_ops,4,2      ; @ideapad_backlight_ops
l_.str.1:                               ; @.str.1
	.asciz	"Could not register backlight device\n"

	.comm	_FB_BLANK_UNBLANK,4,2           ; @FB_BLANK_UNBLANK
	.comm	_FB_BLANK_POWERDOWN,4,2         ; @FB_BLANK_POWERDOWN
	.no_dead_strip	_ideapad_backlight_init
.subsections_via_symbols
