	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function toshiba_acpi_setup_backlight
_toshiba_acpi_setup_backlight:          ## @toshiba_acpi_setup_backlight
	.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	___get_lcd_brightness
	xorl	%r14d, %r14d
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	movl	$1, %ebx
	cmovnel	%eax, %ebx
	cmpq	$0, 16(%r15)
	cmovel	%eax, %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_set_lcd_brightness
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	jmp	LBB0_10
LBB0_3:
	cmpq	$0, 16(%r15)
	jne	LBB0_5
## %bb.4:
	movq	_toshiba_vendor_backlight_dmi@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_dmi_check_system
	testq	%rax, %rax
	je	LBB0_6
LBB0_5:
	movq	_acpi_backlight_vendor@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_acpi_video_set_dmi_backlight_type
LBB0_6:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_acpi_video_get_backlight_type
	movq	_acpi_backlight_vendor@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.7:
	leaq	-48(%rbp), %r12
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	_BACKLIGHT_PLATFORM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_HCI_LCD_BRIGHTNESS_LEVELS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$1, 16(%r15)
	sbbq	$0, %rax
	movq	%rax, -48(%rbp)
	movq	8(%r15), %rsi
	leaq	L_.str.1(%rip), %rdi
	movq	_toshiba_backlight_data@GOTPCREL(%rip), %rcx
	movq	%r15, %rdx
	movq	%r12, %r8
	callq	_backlight_device_register
	movq	%rax, (%r15)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	(%r15), %rdi
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	callq	_PTR_ERR
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	movq	$0, (%r15)
	jmp	LBB0_10
LBB0_9:
	movl	%ebx, (%rdi)
LBB0_10:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Backlight method is read-only, disabling backlight support\n"

	.comm	_toshiba_vendor_backlight_dmi,4,2 ## @toshiba_vendor_backlight_dmi
	.comm	_acpi_backlight_vendor,8,3      ## @acpi_backlight_vendor
	.comm	_BACKLIGHT_PLATFORM,4,2         ## @BACKLIGHT_PLATFORM
	.comm	_HCI_LCD_BRIGHTNESS_LEVELS,8,3  ## @HCI_LCD_BRIGHTNESS_LEVELS
L_.str.1:                               ## @.str.1
	.asciz	"toshiba"

	.comm	_toshiba_backlight_data,4,2     ## @toshiba_backlight_data
L_.str.2:                               ## @.str.2
	.asciz	"Could not register toshiba backlight device\n"

	.no_dead_strip	_toshiba_acpi_setup_backlight
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function toshiba_acpi_setup_backlight
_toshiba_acpi_setup_backlight:          ; @toshiba_acpi_setup_backlight
	.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	___get_lcd_brightness
	tbnz	w0, #31, LBB0_9
; %bb.1:
	ldr	x8, [x19, #16]
	cmp	w0, #0
	ccmp	x8, #0, #4, eq
	csinc	w20, w0, wzr, eq
	mov	x0, x19
	mov	x1, x20
	bl	_set_lcd_brightness
	cbz	w0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	b	LBB0_9
LBB0_3:
	ldr	x8, [x19, #16]
Lloh2:
	adrp	x21, _acpi_backlight_vendor@GOTPAGE
Lloh3:
	ldr	x21, [x21, _acpi_backlight_vendor@GOTPAGEOFF]
	cbnz	x8, LBB0_5
; %bb.4:
Lloh4:
	adrp	x8, _toshiba_vendor_backlight_dmi@GOTPAGE
Lloh5:
	ldr	x8, [x8, _toshiba_vendor_backlight_dmi@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_dmi_check_system
	cbz	x0, LBB0_6
LBB0_5:
	ldr	x0, [x21]
	bl	_acpi_video_set_dmi_backlight_type
LBB0_6:
	bl	_acpi_video_get_backlight_type
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.7:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
Lloh7:
	adrp	x8, _BACKLIGHT_PLATFORM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BACKLIGHT_PLATFORM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh10:
	adrp	x8, _HCI_LCD_BRIGHTNESS_LEVELS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HCI_LCD_BRIGHTNESS_LEVELS@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldp	x1, x9, [x19, #8]
	cmp	x9, #0
	cset	w9, eq
	sub	x8, x8, x9
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
Lloh15:
	adrp	x3, _toshiba_backlight_data@GOTPAGE
Lloh16:
	ldr	x3, [x3, _toshiba_backlight_data@GOTPAGEOFF]
	mov	x4, sp
	mov	x2, x19
	bl	_backlight_device_register
	str	x0, [x19]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x19]
	cbz	x8, LBB0_11
; %bb.8:
	bl	_PTR_ERR
	mov	x21, x0
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	str	xzr, [x19]
	b	LBB0_10
LBB0_9:
	mov	w21, #0
LBB0_10:
	mov	x0, x21
	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
LBB0_11:
	mov	w21, #0
	str	w20, [x0]
	b	LBB0_10
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Backlight method is read-only, disabling backlight support\n"

	.comm	_toshiba_vendor_backlight_dmi,4,2 ; @toshiba_vendor_backlight_dmi
	.comm	_acpi_backlight_vendor,8,3      ; @acpi_backlight_vendor
	.comm	_BACKLIGHT_PLATFORM,4,2         ; @BACKLIGHT_PLATFORM
	.comm	_HCI_LCD_BRIGHTNESS_LEVELS,8,3  ; @HCI_LCD_BRIGHTNESS_LEVELS
l_.str.1:                               ; @.str.1
	.asciz	"toshiba"

	.comm	_toshiba_backlight_data,4,2     ; @toshiba_backlight_data
l_.str.2:                               ; @.str.2
	.asciz	"Could not register toshiba backlight device\n"

	.no_dead_strip	_toshiba_acpi_setup_backlight
.subsections_via_symbols
