	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_edid_block
_read_edid_block:                       ## @read_edid_block
	.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	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movl	%edx, %eax
	shll	$7, %eax
	movzbl	%al, %r12d
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	shrl	%r13d
	leaq	4(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_REG_DDC_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$160, %edx
	callq	_reg_write
	movq	_REG_DDC_OFFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_reg_write
	movq	_REG_DDC_SEGM_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$96, %edx
	callq	_reg_write
	movq	_REG_DDC_SEGM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_reg_write
	movl	$1, (%r14)
	movq	_REG_EDID_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_reg_write
	movl	(%rbx), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_reg_write
	movq	8(%r14), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_5
## %bb.1:
	movl	16(%r14), %r12d
	xorl	%r13d, %r13d
	cmpl	$0, (%r14)
	sete	%r13b
	movl	$100, %edi
	callq	_msecs_to_jiffies
	movl	%r12d, %edi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_wait_event_timeout
	testl	%eax, %eax
	js	LBB0_10
## %bb.2:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_9
LBB0_3:
	movq	_REG_EDID_DATA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rcx
	callq	_reg_read_range
	movl	%eax, %r12d
	cltq
	xorl	%r13d, %r13d
	cmpq	%rbx, %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_12
## %bb.4:
	movq	8(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r12d, %r13d
	jmp	LBB0_12
LBB0_5:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	$101, %ebx
	movq	_REG_INT_FLAGS_2@GOTPCREL(%rip), %r12
	movq	_INT_FLAGS_2_EDID_BLK_RD@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_msleep
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_reg_read
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	testl	%r13d, (%r15)
	jne	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_6
LBB0_9:
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_11:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_10:
	movl	%eax, %r13d
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_12:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_DDC_ADDR,4,2               ## @REG_DDC_ADDR
	.comm	_REG_DDC_OFFS,4,2               ## @REG_DDC_OFFS
	.comm	_REG_DDC_SEGM_ADDR,4,2          ## @REG_DDC_SEGM_ADDR
	.comm	_REG_DDC_SEGM,4,2               ## @REG_DDC_SEGM
	.comm	_REG_EDID_CTRL,4,2              ## @REG_EDID_CTRL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read edid wait err %d\n"

	.comm	_REG_INT_FLAGS_2,4,2            ## @REG_INT_FLAGS_2
	.comm	_INT_FLAGS_2_EDID_BLK_RD,4,2    ## @INT_FLAGS_2_EDID_BLK_RD
L_.str.1:                               ## @.str.1
	.asciz	"read edid timeout\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_REG_EDID_DATA_0,4,2            ## @REG_EDID_DATA_0
L_.str.2:                               ## @.str.2
	.asciz	"failed to read edid block %d: %d\n"

	.no_dead_strip	_read_edid_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_edid_block
_read_edid_block:                       ; @read_edid_block
	.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	x22, x3
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
	ubfiz	w24, w2, #7, #1
	lsr	w25, w2, #1
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x8, _REG_DDC_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_DDC_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #160
	bl	_reg_write
Lloh3:
	adrp	x8, _REG_DDC_OFFS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_DDC_OFFS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x24
	bl	_reg_write
Lloh6:
	adrp	x8, _REG_DDC_SEGM_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_DDC_SEGM_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #96
	bl	_reg_write
Lloh9:
	adrp	x8, _REG_DDC_SEGM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REG_DDC_SEGM@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x25
	bl	_reg_write
	mov	w8, #1
	str	w8, [x21]
Lloh12:
	adrp	x24, _REG_EDID_CTRL@GOTPAGE
Lloh13:
	ldr	x24, [x24, _REG_EDID_CTRL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	mov	w2, #1
	bl	_reg_write
	ldr	w1, [x24]
	mov	x0, x21
	mov	w2, #0
	bl	_reg_write
	ldr	x8, [x21, #8]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_5
; %bb.1:
	ldr	w24, [x21, #16]
	ldr	w8, [x21]
	cmp	w8, #0
	cset	w25, eq
	mov	w0, #100
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x24
	mov	x1, x25
	bl	_wait_event_timeout
	mov	x24, x0
	tbnz	w0, #31, LBB0_10
; %bb.2:
	cbz	w24, LBB0_9
LBB0_3:
Lloh14:
	adrp	x8, _REG_EDID_DATA_0@GOTPAGE
Lloh15:
	ldr	x8, [x8, _REG_EDID_DATA_0@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x23
	mov	x3, x22
	bl	_reg_read_range
	mov	x24, x0
	sxtw	x8, w24
	cmp	x8, x22
	b.ne	LBB0_11
; %bb.4:
	mov	w24, #0
	b	LBB0_12
LBB0_5:
	mov	w25, #101
Lloh17:
	adrp	x26, _REG_INT_FLAGS_2@GOTPAGE
Lloh18:
	ldr	x26, [x26, _REG_INT_FLAGS_2@GOTPAGEOFF]
Lloh19:
	adrp	x27, _INT_FLAGS_2_EDID_BLK_RD@GOTPAGE
Lloh20:
	ldr	x27, [x27, _INT_FLAGS_2_EDID_BLK_RD@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x26]
	mov	x0, x21
	bl	_reg_read
	mov	x24, x0
	tbnz	w0, #31, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x27]
	tst	w8, w24
	b.ne	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w25, w25, #1
	cmp	w25, #1
	b.hi	LBB0_6
LBB0_9:
	ldr	x0, [x21, #8]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh23:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_12
LBB0_10:
	ldr	x0, [x21, #8]
	str	x24, [sp]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_12
LBB0_11:
	ldr	x0, [x21, #8]
	mov	x8, x24
	stp	x20, x8, [sp]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
	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	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_DDC_ADDR,4,2               ; @REG_DDC_ADDR
	.comm	_REG_DDC_OFFS,4,2               ; @REG_DDC_OFFS
	.comm	_REG_DDC_SEGM_ADDR,4,2          ; @REG_DDC_SEGM_ADDR
	.comm	_REG_DDC_SEGM,4,2               ; @REG_DDC_SEGM
	.comm	_REG_EDID_CTRL,4,2              ; @REG_EDID_CTRL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read edid wait err %d\n"

	.comm	_REG_INT_FLAGS_2,4,2            ; @REG_INT_FLAGS_2
	.comm	_INT_FLAGS_2_EDID_BLK_RD,4,2    ; @INT_FLAGS_2_EDID_BLK_RD
l_.str.1:                               ; @.str.1
	.asciz	"read edid timeout\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_REG_EDID_DATA_0,4,2            ; @REG_EDID_DATA_0
l_.str.2:                               ; @.str.2
	.asciz	"failed to read edid block %d: %d\n"

	.no_dead_strip	_read_edid_block
.subsections_via_symbols
