	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdfld_dsi_brightness_control   ## -- Begin function mdfld_dsi_brightness_control
	.p2align	4, 0x90
_mdfld_dsi_brightness_control:          ## @mdfld_dsi_brightness_control
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movl	%esi, %r12d
	movl	%esi, %eax
	andl	$-3, %eax
	jne	LBB0_2
## %bb.4:
	movl	%edx, %r14d
	movq	%rdi, %rbx
	xorl	%r15d, %r15d
	testl	%r12d, %r12d
	setne	%r15b
	xorl	%esi, %esi
	callq	_mdfld_get_panel_type
	movl	%eax, %r13d
	movq	(%rbx), %rbx
	movq	8(%rbx), %rax
	movq	(%rax,%r15,8), %rdi
	callq	_mdfld_dsi_get_pkg_sender
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	%r14d, %eax
	shll	$8, %eax
	subl	%r14d, %eax
	movq	_MDFLD_DSI_BRIGHTNESS_MAX_LEVEL@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%r13d, %ebx
	movzbl	%al, %r13d
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	callq	_dev_dbg
	movq	_TMD_VID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_8
## %bb.7:
	movq	_tmd_write_display_brightness@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	jmp	LBB0_12
LBB0_2:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_3
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_8:
	movq	_write_display_brightness@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	movl	$1, %ecx
	movl	$1, %r8d
	callq	_mdfld_dsi_send_mcs_short
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.10:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	jmp	LBB0_11
LBB0_9:
	xorl	%edx, %edx
LBB0_11:
	movq	_write_ctrl_display@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
LBB0_12:
	movl	$1, %ecx
	movl	$1, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mdfld_dsi_send_mcs_short       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TMD_VID,4,2                    ## @TMD_VID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid parameter\n"

L_.str.1:                               ## @.str.1
	.asciz	"No sender found\n"

	.comm	_MDFLD_DSI_BRIGHTNESS_MAX_LEVEL,4,2 ## @MDFLD_DSI_BRIGHTNESS_MAX_LEVEL
L_.str.2:                               ## @.str.2
	.asciz	"pipe = %d, gen_ctrl_val = %d.\n"

	.comm	_tmd_write_display_brightness,4,2 ## @tmd_write_display_brightness
	.comm	_write_display_brightness,4,2   ## @write_display_brightness
	.comm	_write_ctrl_display,4,2         ## @write_ctrl_display
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdfld_dsi_brightness_control   ; -- Begin function mdfld_dsi_brightness_control
	.p2align	2
_mdfld_dsi_brightness_control:          ; @mdfld_dsi_brightness_control
	.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
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x1
	and	w8, w1, #0xfffffffd
	cbnz	w8, LBB0_5
; %bb.2:
	mov	x19, x2
	mov	x20, x0
	cmp	w21, #0
	cset	w23, ne
	mov	w1, #0
	bl	_mdfld_get_panel_type
	mov	x22, x0
	ldr	x24, [x20]
	ldr	x8, [x24, #8]
	ldr	x0, [x8, w23, uxtw #3]
	bl	_mdfld_dsi_get_pkg_sender
	cbz	x0, LBB0_6
; %bb.3:
	mov	x20, x0
	lsl	w8, w19, #8
Lloh0:
	adrp	x9, _MDFLD_DSI_BRIGHTNESS_MAX_LEVEL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MDFLD_DSI_BRIGHTNESS_MAX_LEVEL@GOTPAGEOFF]
	sub	w8, w8, w19
Lloh2:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	and	w23, w8, #0xff
	ldr	x8, [x0]
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	mov	x3, x23
	bl	_dev_dbg
Lloh5:
	adrp	x8, _TMD_VID@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TMD_VID@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_8
; %bb.4:
Lloh8:
	adrp	x8, _tmd_write_display_brightness@GOTPAGE
Lloh9:
	ldr	x8, [x8, _tmd_write_display_brightness@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x23
	b	LBB0_12
LBB0_5:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	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	_DRM_ERROR
LBB0_8:
Lloh15:
	adrp	x8, _write_display_brightness@GOTPAGE
Lloh16:
	ldr	x8, [x8, _write_display_brightness@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x23
	mov	w3, #1
	mov	w4, #1
	bl	_mdfld_dsi_send_mcs_short
	cbz	w19, LBB0_10
; %bb.9:
	ldr	w2, [x24]
	b	LBB0_11
LBB0_10:
	mov	w2, #0
LBB0_11:
Lloh18:
	adrp	x8, _write_ctrl_display@GOTPAGE
Lloh19:
	ldr	x8, [x8, _write_ctrl_display@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x20
LBB0_12:
	mov	w3, #1
	mov	w4, #1
	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	_mdfld_dsi_send_mcs_short
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_TMD_VID,4,2                    ; @TMD_VID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid parameter\n"

l_.str.1:                               ; @.str.1
	.asciz	"No sender found\n"

	.comm	_MDFLD_DSI_BRIGHTNESS_MAX_LEVEL,4,2 ; @MDFLD_DSI_BRIGHTNESS_MAX_LEVEL
l_.str.2:                               ; @.str.2
	.asciz	"pipe = %d, gen_ctrl_val = %d.\n"

	.comm	_tmd_write_display_brightness,4,2 ; @tmd_write_display_brightness
	.comm	_write_display_brightness,4,2   ; @write_display_brightness
	.comm	_write_ctrl_display,4,2         ; @write_ctrl_display
.subsections_via_symbols
