	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdmi5_read_edid                ## -- Begin function hdmi5_read_edid
	.p2align	4, 0x90
_hdmi5_read_edid:                       ## @hdmi5_read_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	leal	127(%r12), %r15d
	testl	%edx, %edx
	cmovnsl	%edx, %r15d
	cmpl	$127, %edx
	jg	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_10
LBB0_2:
	movq	%rsi, %r13
	movq	%rdi, %r14
	callq	_hdmi_core_ddc_init
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_hdmi_core_ddc_edid
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_8:
	movq	%r14, %rdi
	callq	_hdmi_core_ddc_uninit
	movl	%ebx, %r12d
	jmp	LBB0_10
LBB0_3:
	sarl	$7, %r15d
	movq	%r13, %rax
	leal	-1(%r15), %r13d
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	504(%rax), %eax
	cmpl	%r15d, %eax
	cmovll	%eax, %r13d
	testl	%r13d, %r13d
	jle	LBB0_9
## %bb.4:
	negl	%r13d
	movl	$1, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_EDID_LENGTH@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	%r15d, %rdx
	imulq	%rdx, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_hdmi_core_ddc_edid
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	leal	(%r15,%r13), %eax
	incl	%eax
	movl	%r15d, %ecx
	incl	%ecx
	movl	%ecx, %r15d
	cmpl	$1, %eax
	jne	LBB0_6
LBB0_9:
	movq	%r14, %rdi
	callq	_hdmi_core_ddc_uninit
LBB0_10:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%eax, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EDID_LENGTH,4,2                ## @EDID_LENGTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdmi5_read_edid                ; -- Begin function hdmi5_read_edid
	.p2align	2
_hdmi5_read_edid:                       ; @hdmi5_read_edid
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	add	w8, w2, #127
	cmp	w2, #0
	csel	w22, w8, w2, lt
	cmp	w2, #127
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_9
LBB0_2:
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_hdmi_core_ddc_init
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_hdmi_core_ddc_edid
	mov	x23, x0
	cbz	w0, LBB0_4
LBB0_3:
	mov	x0, x20
	bl	_hdmi_core_ddc_uninit
	mov	x19, x23
	b	LBB0_9
LBB0_4:
	asr	w8, w22, #7
	sub	w9, w8, #1
	ldr	w10, [x21, #504]
	cmp	w10, w8
	csel	w24, w10, w9, lt
	cmp	w24, #1
	b.lt	LBB0_8
; %bb.5:
	mov	w22, #0
Lloh3:
	adrp	x25, _EDID_LENGTH@GOTPAGE
Lloh4:
	ldr	x25, [x25, _EDID_LENGTH@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	w22, w22, #1
	ldr	w8, [x25]
	mul	w8, w8, w22
	add	x1, x21, w8, sxtw #2
	mov	x0, x20
	mov	x2, x22
	bl	_hdmi_core_ddc_edid
	cbnz	w0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w24, w22
	b.ne	LBB0_6
LBB0_8:
	mov	x0, x20
	bl	_hdmi_core_ddc_uninit
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x23, x0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EDID_LENGTH,4,2                ; @EDID_LENGTH
.subsections_via_symbols
