	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmcu_set_backlight_level
_dmcu_set_backlight_level:              ## @dmcu_set_backlight_level
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movl	%esi, %ebx
	testl	$65536, %esi                    ## imm = 0x10000
	movzbl	%bh, %eax
	movl	$255, %r12d
	cmovel	%eax, %r12d
	movl	%ecx, %esi
	callq	_dce_abm_set_pipe
	movq	_MASTER_COMM_CNTL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MASTER_COMM_INTERRUPT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	movl	$80000, %r8d                    ## imm = 0x13880
	callq	_REG_WAIT
	movq	_BL1_PWM_USER_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, %esi
	movl	%ebx, %edx
	callq	_REG_UPDATE
	testl	%r15d, %r15d
	cmovel	%r15d, %r14d
	movq	_MASTER_COMM_DATA_REG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_REG_WRITE
	movq	_MASTER_COMM_CMD_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MASTER_COMM_CMD_REG_BYTE0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MCP_BL_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_REG_UPDATE
	movq	_MASTER_COMM_CNTL_REG@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movl	(%r13), %esi
	movl	$1, %edx
	callq	_REG_UPDATE
	movq	_BIOS_SCRATCH_2@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_REG_READ
	movq	_ATOM_S2_CURRENT_BL_LEVEL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%esi, %edx
	movq	_ATOM_S2_CURRENT_BL_LEVEL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %esi
	andl	%r12d, %esi
	shll	%cl, %esi
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %esi
	movl	(%rbx), %edi
	callq	_REG_WRITE
	movl	(%r14), %edi
	movl	(%r13), %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	movl	$80000, %r8d                    ## imm = 0x13880
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_REG_WAIT                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MASTER_COMM_CNTL_REG,4,2       ## @MASTER_COMM_CNTL_REG
	.comm	_MASTER_COMM_INTERRUPT,4,2      ## @MASTER_COMM_INTERRUPT
	.comm	_BL1_PWM_USER_LEVEL,4,2         ## @BL1_PWM_USER_LEVEL
	.comm	_MASTER_COMM_DATA_REG1,4,2      ## @MASTER_COMM_DATA_REG1
	.comm	_MASTER_COMM_CMD_REG,4,2        ## @MASTER_COMM_CMD_REG
	.comm	_MASTER_COMM_CMD_REG_BYTE0,4,2  ## @MASTER_COMM_CMD_REG_BYTE0
	.comm	_MCP_BL_SET,4,2                 ## @MCP_BL_SET
	.comm	_BIOS_SCRATCH_2,4,2             ## @BIOS_SCRATCH_2
	.comm	_ATOM_S2_CURRENT_BL_LEVEL_MASK,4,2 ## @ATOM_S2_CURRENT_BL_LEVEL_MASK
	.comm	_ATOM_S2_CURRENT_BL_LEVEL_SHIFT,4,2 ## @ATOM_S2_CURRENT_BL_LEVEL_SHIFT
	.no_dead_strip	_dmcu_set_backlight_level
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmcu_set_backlight_level
_dmcu_set_backlight_level:              ; @dmcu_set_backlight_level
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	ubfx	w8, w1, #8, #8
	tst	w1, #0x10000
	mov	w9, #255
	csel	w24, w8, w9, eq
	mov	x1, x3
	bl	_dce_abm_set_pipe
Lloh0:
	adrp	x22, _MASTER_COMM_CNTL_REG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MASTER_COMM_CNTL_REG@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh2:
	adrp	x23, _MASTER_COMM_INTERRUPT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _MASTER_COMM_INTERRUPT@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w2, #0
	mov	w3, #1
	mov	w4, #14464
	movk	w4, #1, lsl #16
	bl	_REG_WAIT
Lloh4:
	adrp	x8, _BL1_PWM_USER_LEVEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _BL1_PWM_USER_LEVEL@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	mov	x1, x0
	mov	x2, x21
	bl	_REG_UPDATE
	cmp	w19, #0
	csel	w1, wzr, w20, eq
Lloh7:
	adrp	x8, _MASTER_COMM_DATA_REG1@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MASTER_COMM_DATA_REG1@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_REG_WRITE
Lloh10:
	adrp	x8, _MASTER_COMM_CMD_REG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MASTER_COMM_CMD_REG@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _MASTER_COMM_CMD_REG_BYTE0@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MASTER_COMM_CMD_REG_BYTE0@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _MCP_BL_SET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MCP_BL_SET@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	bl	_REG_UPDATE
	ldr	w0, [x22]
	ldr	w1, [x23]
	mov	w2, #1
	bl	_REG_UPDATE
Lloh19:
	adrp	x19, _BIOS_SCRATCH_2@GOTPAGE
Lloh20:
	ldr	x19, [x19, _BIOS_SCRATCH_2@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_REG_READ
Lloh21:
	adrp	x8, _ATOM_S2_CURRENT_BL_LEVEL_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ATOM_S2_CURRENT_BL_LEVEL_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	bic	w9, w0, w8
Lloh24:
	adrp	x10, _ATOM_S2_CURRENT_BL_LEVEL_SHIFT@GOTPAGE
Lloh25:
	ldr	x10, [x10, _ATOM_S2_CURRENT_BL_LEVEL_SHIFT@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	asr	w8, w8, w10
	and	w8, w8, w24
	lsl	w8, w8, w10
	orr	w1, w8, w9
	ldr	w0, [x19]
	bl	_REG_WRITE
	ldr	w0, [x22]
	ldr	w1, [x23]
	mov	w2, #0
	mov	w3, #1
	mov	w4, #14464
	movk	w4, #1, lsl #16
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_REG_WAIT
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MASTER_COMM_CNTL_REG,4,2       ; @MASTER_COMM_CNTL_REG
	.comm	_MASTER_COMM_INTERRUPT,4,2      ; @MASTER_COMM_INTERRUPT
	.comm	_BL1_PWM_USER_LEVEL,4,2         ; @BL1_PWM_USER_LEVEL
	.comm	_MASTER_COMM_DATA_REG1,4,2      ; @MASTER_COMM_DATA_REG1
	.comm	_MASTER_COMM_CMD_REG,4,2        ; @MASTER_COMM_CMD_REG
	.comm	_MASTER_COMM_CMD_REG_BYTE0,4,2  ; @MASTER_COMM_CMD_REG_BYTE0
	.comm	_MCP_BL_SET,4,2                 ; @MCP_BL_SET
	.comm	_BIOS_SCRATCH_2,4,2             ; @BIOS_SCRATCH_2
	.comm	_ATOM_S2_CURRENT_BL_LEVEL_MASK,4,2 ; @ATOM_S2_CURRENT_BL_LEVEL_MASK
	.comm	_ATOM_S2_CURRENT_BL_LEVEL_SHIFT,4,2 ; @ATOM_S2_CURRENT_BL_LEVEL_SHIFT
	.no_dead_strip	_dmcu_set_backlight_level
.subsections_via_symbols
