	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_panel_actually_set_backlight
_intel_panel_actually_set_backlight:    ## @intel_panel_actually_set_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_DRIVER
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_intel_panel_compute_brightness
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_HAS_PCH_SPLIT
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%r15, %rdi
	movl	%r14d, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_intel_pch_panel_set_backlight  ## TAILCALL
LBB0_1:
	movq	%r15, %rdi
	callq	_is_backlight_combination_mode
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_intel_panel_get_max_backlight
	movl	%eax, %ecx
	movl	%r14d, %eax
	shll	$8, %eax
	subl	%r14d, %eax
	subl	%r14d, %eax
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %ecx
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	movl	(%r15), %edi
	movq	_PCI_LBPC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movl	%eax, %r14d
	movl	%ecx, %edx
	callq	_pci_write_config_byte
LBB0_3:
	movq	_BLC_PWM_CTL@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_I915_READ
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_INTEL_INFO
	cmpl	$4, (%rax)
	setl	%cl
	shll	%cl, %r14d
	movq	_BACKLIGHT_DUTY_CYCLE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%esi
	andl	%ebx, %esi
	orl	%r14d, %esi
	movl	(%r12), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_I915_WRITE                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set backlight PWM = %d\n"

	.comm	_PCI_LBPC,4,2                   ## @PCI_LBPC
	.comm	_BLC_PWM_CTL,4,2                ## @BLC_PWM_CTL
	.comm	_BACKLIGHT_DUTY_CYCLE_MASK,4,2  ## @BACKLIGHT_DUTY_CYCLE_MASK
	.no_dead_strip	_intel_panel_actually_set_backlight
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_panel_actually_set_backlight
_intel_panel_actually_set_backlight:    ; @intel_panel_actually_set_backlight
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	x0, x19
	mov	x1, x20
	bl	_intel_panel_compute_brightness
	mov	x20, x0
	mov	x0, x19
	bl	_HAS_PCH_SPLIT
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	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
	b	_intel_pch_panel_set_backlight
LBB0_2:
	mov	x0, x19
	bl	_is_backlight_combination_mode
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_intel_panel_get_max_backlight
	mov	w8, #254
	mul	w8, w20, w8
	sdiv	w8, w8, w0
	add	w2, w8, #1
	ldr	w0, [x19]
Lloh2:
	adrp	x8, _PCI_LBPC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_LBPC@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	sdiv	w20, w20, w2
	bl	_pci_write_config_byte
LBB0_4:
Lloh5:
	adrp	x22, _BLC_PWM_CTL@GOTPAGE
Lloh6:
	ldr	x22, [x22, _BLC_PWM_CTL@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_I915_READ
	mov	x21, x0
	mov	x0, x19
	bl	_INTEL_INFO
	ldr	w8, [x0]
	cmp	w8, #4
	cset	w8, lt
	lsl	w8, w20, w8
Lloh7:
	adrp	x9, _BACKLIGHT_DUTY_CYCLE_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BACKLIGHT_DUTY_CYCLE_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	bic	w9, w21, w9
	ldr	w0, [x22]
	orr	w1, w8, w9
	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
	b	_I915_WRITE
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set backlight PWM = %d\n"

	.comm	_PCI_LBPC,4,2                   ; @PCI_LBPC
	.comm	_BLC_PWM_CTL,4,2                ; @BLC_PWM_CTL
	.comm	_BACKLIGHT_DUTY_CYCLE_MASK,4,2  ; @BACKLIGHT_DUTY_CYCLE_MASK
	.no_dead_strip	_intel_panel_actually_set_backlight
.subsections_via_symbols
