	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dm_helpers_read_local_edid     ## -- Begin function dm_helpers_read_local_edid
	.p2align	4, 0x90
_dm_helpers_read_local_edid:            ## @dm_helpers_read_local_edid
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	8(%rsi), %rcx
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%rsi)
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	leaq	16(%rcx), %rax
	jmp	LBB0_3
LBB0_2:
	movq	8(%rcx), %rax
LBB0_3:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	16(%r12), %r15
	movl	$3, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %r14
	movq	%rcx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_drm_get_edid
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rbx
	movl	(%rax), %edx
	incl	%edx
	movq	_EDID_LENGTH@GOTPCREL(%rip), %rax
	imull	(%rax), %edx
	movl	%edx, (%r12)
	movq	8(%r12), %rdi
	movq	%rbx, %rsi
	callq	_memmove
	movq	%rbx, %rdi
	callq	_kfree
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_dm_helpers_parse_edid_caps
	movl	%eax, %ebx
	movq	_EDID_BAD_CHECKSUM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movq	%r14, %rcx
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	-1(%r13), %eax
	cmpl	$1, %r13d
	movl	%eax, %r13d
	ja	LBB0_4
LBB0_8:
	movq	_EDID_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_10
## %bb.9:
	movl	(%rcx), %edx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_DRM_ERROR
LBB0_10:
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	cmpq	$0, (%r14)
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_13
## %bb.11:
	movl	$0, -48(%rbp)
	movq	_DP_TEST_REQUEST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %r8d
	callq	_dm_helpers_dp_read_dpcd
	cmpl	$0, -48(%rbp)
	je	LBB0_13
## %bb.12:
	movl	$1, -56(%rbp)
	movq	_DP_TEST_EDID_CHECKSUM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	8(%r12), %rax
	movslq	(%r12), %rcx
	leaq	-4(%rax,%rcx,4), %rcx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$1, %r8d
	callq	_dm_helpers_dp_write_dpcd
	movq	_DP_TEST_RESPONSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$4, %r8d
	callq	_dm_helpers_dp_write_dpcd
	jmp	LBB0_13
LBB0_5:
	movq	_EDID_NO_RESPONSE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EDID_NO_RESPONSE,4,2           ## @EDID_NO_RESPONSE
	.comm	_EDID_LENGTH,4,2                ## @EDID_LENGTH
	.comm	_EDID_BAD_CHECKSUM,4,2          ## @EDID_BAD_CHECKSUM
	.comm	_EDID_OK,4,2                    ## @EDID_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EDID err: %d, on connector: %s"

	.comm	_DP_TEST_REQUEST,4,2            ## @DP_TEST_REQUEST
	.comm	_DP_TEST_EDID_CHECKSUM,4,2      ## @DP_TEST_EDID_CHECKSUM
	.comm	_DP_TEST_RESPONSE,4,2           ## @DP_TEST_RESPONSE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dm_helpers_read_local_edid     ; -- Begin function dm_helpers_read_local_edid
	.p2align	2
_dm_helpers_read_local_edid:            ; @dm_helpers_read_local_edid
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldp	x8, x22, [x1]
	cbz	x8, LBB0_2
; %bb.1:
	add	x25, x22, #16
	b	LBB0_3
LBB0_2:
	ldr	x25, [x22, #8]
LBB0_3:
	mov	x0, x22
	mov	x1, x25
	bl	_drm_get_edid
	cbz	x0, LBB0_14
; %bb.4:
	mov	x24, x0
Lloh0:
	adrp	x26, _EDID_LENGTH@GOTPAGE
Lloh1:
	ldr	x26, [x26, _EDID_LENGTH@GOTPAGEOFF]
	add	x23, x21, #16
	ldr	w8, [x26]
	ldr	w9, [x0]
	madd	w2, w8, w9, w8
	str	w2, [x21]
	ldr	x0, [x21, #8]
	mov	x1, x24
	bl	_memmove
	mov	x0, x24
	bl	_kfree
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_dm_helpers_parse_edid_caps
	mov	x24, x0
Lloh2:
	adrp	x27, _EDID_BAD_CHECKSUM@GOTPAGE
Lloh3:
	ldr	x27, [x27, _EDID_BAD_CHECKSUM@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w0, w8
	b.ne	LBB0_9
; %bb.5:
	mov	x0, x22
	mov	x1, x25
	bl	_drm_get_edid
	cbz	x0, LBB0_14
; %bb.6:
	mov	x24, x0
	ldr	w8, [x26]
	ldr	w9, [x0]
	madd	w2, w8, w9, w8
	str	w2, [x21]
	ldr	x0, [x21, #8]
	mov	x1, x24
	bl	_memmove
	mov	x0, x24
	bl	_kfree
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_dm_helpers_parse_edid_caps
	mov	x24, x0
	ldr	w8, [x27]
	cmp	w0, w8
	b.ne	LBB0_9
; %bb.7:
	mov	x0, x22
	mov	x1, x25
	bl	_drm_get_edid
	cbz	x0, LBB0_14
; %bb.8:
	mov	x24, x0
	ldr	w8, [x26]
	ldr	w9, [x0]
	madd	w2, w8, w9, w8
	str	w2, [x21]
	ldr	x0, [x21, #8]
	mov	x1, x24
	bl	_memmove
	mov	x0, x24
	bl	_kfree
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_dm_helpers_parse_edid_caps
	mov	x24, x0
LBB0_9:
Lloh4:
	adrp	x8, _EDID_OK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EDID_OK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w24, w8
	b.eq	LBB0_11
; %bb.10:
	ldr	w2, [x22]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	bl	_DRM_ERROR
LBB0_11:
	ldr	x8, [x19]
	cbz	x8, LBB0_15
; %bb.12:
	str	wzr, [sp, #8]
Lloh9:
	adrp	x8, _DP_TEST_REQUEST@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DP_TEST_REQUEST@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x20
	mov	x1, x19
	mov	w4, #4
	bl	_dm_helpers_dp_read_dpcd
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_15
; %bb.13:
	mov	w8, #1
Lloh12:
	adrp	x9, _DP_TEST_EDID_CHECKSUM@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DP_TEST_EDID_CHECKSUM@GOTPAGEOFF]
	str	w8, [sp]
Lloh14:
	ldr	w2, [x9]
	ldr	x8, [x21, #8]
	ldrsw	x9, [x21]
	add	x8, x8, x9, lsl #2
	sub	x3, x8, #4
	mov	x0, x20
	mov	x1, x19
	mov	w4, #1
	bl	_dm_helpers_dp_write_dpcd
Lloh15:
	adrp	x8, _DP_TEST_RESPONSE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DP_TEST_RESPONSE@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x3, sp
	mov	x0, x20
	mov	x1, x19
	mov	w4, #4
	bl	_dm_helpers_dp_write_dpcd
	b	LBB0_15
LBB0_14:
Lloh18:
	adrp	x8, _EDID_NO_RESPONSE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EDID_NO_RESPONSE@GOTPAGEOFF]
Lloh20:
	ldr	w24, [x8]
LBB0_15:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EDID_NO_RESPONSE,4,2           ; @EDID_NO_RESPONSE
	.comm	_EDID_LENGTH,4,2                ; @EDID_LENGTH
	.comm	_EDID_BAD_CHECKSUM,4,2          ; @EDID_BAD_CHECKSUM
	.comm	_EDID_OK,4,2                    ; @EDID_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EDID err: %d, on connector: %s"

	.comm	_DP_TEST_REQUEST,4,2            ; @DP_TEST_REQUEST
	.comm	_DP_TEST_EDID_CHECKSUM,4,2      ; @DP_TEST_EDID_CHECKSUM
	.comm	_DP_TEST_RESPONSE,4,2           ; @DP_TEST_RESPONSE
.subsections_via_symbols
