	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_ddc_xfer
_mtk_hdmi_ddc_xfer:                     ## @mtk_hdmi_ddc_xfer
	.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
	movq	8(%rdi), %r12
	testq	%r12, %r12
	je	LBB0_1
## %bb.3:
	movl	%edx, %r13d
	movq	%rsi, %rbx
	movq	_DDC_DDCMCTL0@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_DDCM_SCL_STRECH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_sif_set_bit
	movl	(%r14), %esi
	movq	_DDCM_SM0EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_sif_set_bit
	movl	(%r14), %esi
	movq	_DDCM_ODRAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_sif_clr_bit
	movq	_DDC_DDCMCTL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DDCM_TRI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_sif_bit_is_set
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_16:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r14), %esi
	movq	_DDCM_CLK_DIV_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DDCM_CLK_DIV_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SIF1_CLOK@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	callq	_sif_write_mask
	testl	%r13d, %r13d
	jle	LBB0_6
## %bb.7:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%rbx), %edx
	movl	(%rbx), %ecx
	movl	4(%rbx), %r8d
	movq	%r15, %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_mtk_hdmi_ddc_read_msg
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_mtk_hdmi_ddc_write_msg
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	addq	$12, %rbx
	decq	%r13
	jne	LBB0_8
## %bb.13:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_14
LBB0_6:
	xorl	%r14d, %r14d
LBB0_14:
	movq	_DDCM_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_ddcm_trigger_mode
	jmp	LBB0_16
LBB0_15:
	movq	_DDCM_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_ddcm_trigger_mode
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid arguments\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DDC_DDCMCTL0,4,2               ## @DDC_DDCMCTL0
	.comm	_DDCM_SCL_STRECH,4,2            ## @DDCM_SCL_STRECH
	.comm	_DDCM_SM0EN,4,2                 ## @DDCM_SM0EN
	.comm	_DDCM_ODRAIN,4,2                ## @DDCM_ODRAIN
	.comm	_DDC_DDCMCTL1,4,2               ## @DDC_DDCMCTL1
	.comm	_DDCM_TRI,4,2                   ## @DDCM_TRI
L_.str.1:                               ## @.str.1
	.asciz	"ddc line is busy!\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_DDCM_CLK_DIV_MASK,4,2          ## @DDCM_CLK_DIV_MASK
	.comm	_DDCM_CLK_DIV_OFFSET,4,2        ## @DDCM_CLK_DIV_OFFSET
	.comm	_SIF1_CLOK,4,2                  ## @SIF1_CLOK
L_.str.2:                               ## @.str.2
	.asciz	"i2c msg, adr:0x%x, flags:%d, len :0x%x\n"

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_DDCM_STOP,4,2                  ## @DDCM_STOP
L_.str.3:                               ## @.str.3
	.asciz	"ddc failed!\n"

	.no_dead_strip	_mtk_hdmi_ddc_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_hdmi_ddc_xfer
_mtk_hdmi_ddc_xfer:                     ; @mtk_hdmi_ddc_xfer
	.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
	ldp	x21, x19, [x0]
	cbz	x19, LBB0_3
; %bb.1:
	mov	x20, x2
	mov	x22, x1
Lloh0:
	adrp	x23, _DDC_DDCMCTL0@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DDC_DDCMCTL0@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x8, _DDCM_SCL_STRECH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DDCM_SCL_STRECH@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_sif_set_bit
	ldr	w1, [x23]
Lloh5:
	adrp	x8, _DDCM_SM0EN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DDCM_SM0EN@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_sif_set_bit
	ldr	w1, [x23]
Lloh8:
	adrp	x8, _DDCM_ODRAIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DDCM_ODRAIN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_sif_clr_bit
Lloh11:
	adrp	x8, _DDC_DDCMCTL1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DDC_DDCMCTL1@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _DDCM_TRI@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DDCM_TRI@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_sif_bit_is_set
	cbz	x0, LBB0_6
; %bb.2:
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh19:
	adrp	x8, _EBUSY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_5:
	mov	x0, x24
	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_6:
	ldr	w1, [x23]
Lloh25:
	adrp	x8, _DDCM_CLK_DIV_MASK@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DDCM_CLK_DIV_MASK@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
Lloh28:
	adrp	x8, _DDCM_CLK_DIV_OFFSET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DDCM_CLK_DIV_OFFSET@GOTPAGEOFF]
Lloh30:
	ldr	w3, [x8]
Lloh31:
	adrp	x8, _SIF1_CLOK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SIF1_CLOK@GOTPAGEOFF]
Lloh33:
	ldr	w4, [x8]
	mov	x0, x19
	bl	_sif_write_mask
	cmp	w20, #1
	b.lt	LBB0_12
; %bb.7:
	mov	w25, w20
Lloh34:
	adrp	x26, _I2C_M_RD@GOTPAGE
Lloh35:
	ldr	x26, [x26, _I2C_M_RD@GOTPAGEOFF]
Lloh36:
	adrp	x23, l_.str.2@PAGE
Lloh37:
	add	x23, x23, l_.str.2@PAGEOFF
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w4, w2, [x22, #4]
	ldr	w3, [x22]
	mov	x0, x21
	mov	x1, x23
	bl	_dev_dbg
	ldr	w8, [x22]
	ldr	w9, [x26]
	mov	x0, x19
	mov	x1, x22
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_mtk_hdmi_ddc_read_msg
	mov	x24, x0
	tbz	w0, #31, LBB0_11
	b	LBB0_14
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_mtk_hdmi_ddc_write_msg
	mov	x24, x0
	tbnz	w0, #31, LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x22, x22, #12
	subs	x25, x25, #1
	b.ne	LBB0_8
	b	LBB0_13
LBB0_12:
	mov	w20, #0
LBB0_13:
Lloh38:
	adrp	x8, _DDCM_STOP@GOTPAGE
Lloh39:
	ldr	x8, [x8, _DDCM_STOP@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ddcm_trigger_mode
	mov	x24, x20
	b	LBB0_5
LBB0_14:
Lloh41:
	adrp	x8, _DDCM_STOP@GOTPAGE
Lloh42:
	ldr	x8, [x8, _DDCM_STOP@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ddcm_trigger_mode
Lloh44:
	adrp	x1, l_.str.3@PAGE
Lloh45:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid arguments\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DDC_DDCMCTL0,4,2               ; @DDC_DDCMCTL0
	.comm	_DDCM_SCL_STRECH,4,2            ; @DDCM_SCL_STRECH
	.comm	_DDCM_SM0EN,4,2                 ; @DDCM_SM0EN
	.comm	_DDCM_ODRAIN,4,2                ; @DDCM_ODRAIN
	.comm	_DDC_DDCMCTL1,4,2               ; @DDC_DDCMCTL1
	.comm	_DDCM_TRI,4,2                   ; @DDCM_TRI
l_.str.1:                               ; @.str.1
	.asciz	"ddc line is busy!\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_DDCM_CLK_DIV_MASK,4,2          ; @DDCM_CLK_DIV_MASK
	.comm	_DDCM_CLK_DIV_OFFSET,4,2        ; @DDCM_CLK_DIV_OFFSET
	.comm	_SIF1_CLOK,4,2                  ; @SIF1_CLOK
l_.str.2:                               ; @.str.2
	.asciz	"i2c msg, adr:0x%x, flags:%d, len :0x%x\n"

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_DDCM_STOP,4,2                  ; @DDCM_STOP
l_.str.3:                               ; @.str.3
	.asciz	"ddc failed!\n"

	.no_dead_strip	_mtk_hdmi_ddc_xfer
.subsections_via_symbols
