	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zx_hdmi_i2c_read
_zx_hdmi_i2c_read:                      ## @zx_hdmi_i2c_read
	.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
	movq	%rdi, %r15
	movl	(%rsi), %ecx
	movq	8(%rsi), %rbx
	movq	_ZX_DDC_DIN_CNT2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%ch, %edx
	movl	%ecx, %r13d
	callq	_hdmi_writeb
	movq	_ZX_DDC_DIN_CNT1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%r13b, %edx
	movq	%r15, %rdi
	callq	_hdmi_writeb
	movq	_ZX_DDC_CMD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_DDC_CMD_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_DDC_CMD_CLEAR_FIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_hdmi_writeb_mask
	movl	(%r14), %esi
	movl	(%r12), %edx
	movq	_DDC_CMD_SEQUENTIAL_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_hdmi_writeb_mask
	testl	%r13d, %r13d
	jle	LBB0_7
## %bb.1:
	movl	%r13d, %eax
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	_ZX_DDC_DATA@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	subl	%r12d, %eax
	testl	%eax, %eax
	jle	LBB0_7
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	$500, %edi                      ## imm = 0x1F4
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usleep_range
	movq	_ZX_DDC_DOUT_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_hdmi_readb
	movl	%eax, %r12d
	movq	_DDC_DOUT_CNT_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %r14d
	jle	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_hdmi_readb
	movl	%eax, (%rbx)
	addq	$4, %rbx
	decl	%r14d
	jne	LBB0_4
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	$5, %eax
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jg	LBB0_2
LBB0_7:
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_ZX_DDC_DIN_CNT2,4,2            ## @ZX_DDC_DIN_CNT2
	.comm	_ZX_DDC_DIN_CNT1,4,2            ## @ZX_DDC_DIN_CNT1
	.comm	_ZX_DDC_CMD,4,2                 ## @ZX_DDC_CMD
	.comm	_DDC_CMD_MASK,4,2               ## @DDC_CMD_MASK
	.comm	_DDC_CMD_CLEAR_FIFO,4,2         ## @DDC_CMD_CLEAR_FIFO
	.comm	_DDC_CMD_SEQUENTIAL_READ,4,2    ## @DDC_CMD_SEQUENTIAL_READ
	.comm	_ZX_DDC_DOUT_CNT,4,2            ## @ZX_DDC_DOUT_CNT
	.comm	_DDC_DOUT_CNT_MASK,4,2          ## @DDC_DOUT_CNT_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DDC FIFO read timed out!"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_ZX_DDC_DATA,4,2                ## @ZX_DDC_DATA
	.no_dead_strip	_zx_hdmi_i2c_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zx_hdmi_i2c_read
_zx_hdmi_i2c_read:                      ; @zx_hdmi_i2c_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	ldr	w20, [x1]
	ldr	x21, [x1, #8]
Lloh0:
	adrp	x8, _ZX_DDC_DIN_CNT2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ZX_DDC_DIN_CNT2@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ubfx	w2, w20, #8, #8
	bl	_hdmi_writeb
Lloh3:
	adrp	x8, _ZX_DDC_DIN_CNT1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ZX_DDC_DIN_CNT1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	and	w2, w20, #0xff
	mov	x0, x19
	bl	_hdmi_writeb
Lloh6:
	adrp	x22, _ZX_DDC_CMD@GOTPAGE
Lloh7:
	ldr	x22, [x22, _ZX_DDC_CMD@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh8:
	adrp	x23, _DDC_CMD_MASK@GOTPAGE
Lloh9:
	ldr	x23, [x23, _DDC_CMD_MASK@GOTPAGEOFF]
	ldr	w2, [x23]
Lloh10:
	adrp	x8, _DDC_CMD_CLEAR_FIFO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DDC_CMD_CLEAR_FIFO@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_hdmi_writeb_mask
	ldr	w1, [x22]
	ldr	w2, [x23]
Lloh13:
	adrp	x8, _DDC_CMD_SEQUENTIAL_READ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DDC_CMD_SEQUENTIAL_READ@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_hdmi_writeb_mask
	cmp	w20, #1
	b.lt	LBB0_8
; %bb.1:
	mov	w22, #0
Lloh16:
	adrp	x23, _ZX_DDC_DOUT_CNT@GOTPAGE
Lloh17:
	ldr	x23, [x23, _ZX_DDC_DOUT_CNT@GOTPAGEOFF]
Lloh18:
	adrp	x24, _DDC_DOUT_CNT_MASK@GOTPAGE
Lloh19:
	ldr	x24, [x24, _DDC_DOUT_CNT_MASK@GOTPAGEOFF]
Lloh20:
	adrp	x25, _ZX_DDC_DATA@GOTPAGE
Lloh21:
	ldr	x25, [x25, _ZX_DDC_DATA@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	sub	w20, w20, w26
	cmp	w20, #0
	b.le	LBB0_8
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mov	w0, #500
	mov	w1, #1000
	bl	_usleep_range
	ldr	w1, [x23]
	mov	x0, x19
	bl	_hdmi_readb
	ldr	w8, [x24]
	ands	w26, w8, w0
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x27, x26
	cmp	w26, #1
	b.lt	LBB0_2
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x25]
	mov	x0, x19
	bl	_hdmi_readb
	str	w0, [x21], #4
	subs	w27, w27, #1
	b.ne	LBB0_5
	b	LBB0_2
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w22, #5
	b.ge	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w22, w22, #1
	cmp	w20, #0
	b.gt	LBB0_3
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	w0, [x19]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
Lloh24:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ZX_DDC_DIN_CNT2,4,2            ; @ZX_DDC_DIN_CNT2
	.comm	_ZX_DDC_DIN_CNT1,4,2            ; @ZX_DDC_DIN_CNT1
	.comm	_ZX_DDC_CMD,4,2                 ; @ZX_DDC_CMD
	.comm	_DDC_CMD_MASK,4,2               ; @DDC_CMD_MASK
	.comm	_DDC_CMD_CLEAR_FIFO,4,2         ; @DDC_CMD_CLEAR_FIFO
	.comm	_DDC_CMD_SEQUENTIAL_READ,4,2    ; @DDC_CMD_SEQUENTIAL_READ
	.comm	_ZX_DDC_DOUT_CNT,4,2            ; @ZX_DDC_DOUT_CNT
	.comm	_DDC_DOUT_CNT_MASK,4,2          ; @DDC_DOUT_CNT_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DDC FIFO read timed out!"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_ZX_DDC_DATA,4,2                ; @ZX_DDC_DATA
	.no_dead_strip	_zx_hdmi_i2c_read
.subsections_via_symbols
