	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4i_hdmi_i2c_xfer
_sun4i_hdmi_i2c_xfer:                   ## @sun4i_hdmi_i2c_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r12
	callq	_i2c_get_adapdata
	movq	%rax, %r15
	testl	%r14d, %r14d
	jle	LBB0_6
## %bb.1:
	movq	_SUN4I_HDMI_DDC_BYTE_COUNT_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r14d, %ecx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rdx,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%rax, %rsi
	jg	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_4
LBB0_6:
	movl	(%r15), %edi
	callq	_clk_prepare_enable
	movl	(%r15), %edi
	movl	$100000, %esi                   ## imm = 0x186A0
	callq	_clk_set_rate
	movl	16(%r15), %edi
	movl	$1, %esi
	callq	_regmap_field_write
	movl	12(%r15), %edi
	movl	$1, %esi
	callq	_regmap_field_write
	movl	12(%r15), %edi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	movl	$100, %ecx
	movl	$2000, %r8d                     ## imm = 0x7D0
	callq	_regmap_field_read_poll_timeout
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%r15), %edi
	callq	_clk_disable_unprepare
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r14d
	jmp	LBB0_14
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_14
LBB0_8:
	movl	8(%r15), %edi
	movl	$1, %esi
	callq	_regmap_field_write
	movl	4(%r15), %edi
	movl	$1, %esi
	callq	_regmap_field_write
	testl	%r14d, %r14d
	jle	LBB0_13
## %bb.9:
	movl	%r14d, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_xfer_msg
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_11 Depth=1
	addq	$8, %r12
	decq	%rbx
	jne	LBB0_11
	jmp	LBB0_13
LBB0_12:
	movl	%eax, %r14d
LBB0_13:
	movl	(%r15), %edi
	callq	_clk_disable_unprepare
LBB0_14:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SUN4I_HDMI_DDC_BYTE_COUNT_MAX,8,3 ## @SUN4I_HDMI_DDC_BYTE_COUNT_MAX
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sun4i_hdmi_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4i_hdmi_i2c_xfer
_sun4i_hdmi_i2c_xfer:                   ; @sun4i_hdmi_i2c_xfer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x21, x1
	bl	_i2c_get_adapdata
	mov	x20, x0
	cmp	w19, #1
	b.lt	LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _SUN4I_HDMI_DDC_BYTE_COUNT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SUN4I_HDMI_DDC_BYTE_COUNT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mov	w9, w19
	mov	x10, x21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	cbz	x11, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	x11, x8
	b.gt	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x10, x10, #8
	subs	x9, x9, #1
	b.ne	LBB0_2
LBB0_5:
	ldr	w0, [x20]
	bl	_clk_prepare_enable
	ldr	w0, [x20]
	mov	w1, #34464
	movk	w1, #1, lsl #16
	bl	_clk_set_rate
	ldr	w0, [x20, #16]
	mov	w1, #1
	bl	_regmap_field_write
	ldr	w0, [x20, #12]
	mov	w1, #1
	bl	_regmap_field_write
	ldr	w0, [x20, #12]
	mov	w2, #0
	mov	w3, #100
	mov	w4, #2000
	bl	_regmap_field_read_poll_timeout
	cbz	x0, LBB0_9
; %bb.6:
	ldr	w0, [x20]
	bl	_clk_disable_unprepare
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_15
LBB0_9:
	ldr	w0, [x20, #8]
	mov	w1, #1
	bl	_regmap_field_write
	ldr	w0, [x20, #4]
	mov	w1, #1
	bl	_regmap_field_write
	cmp	w19, #1
	b.lt	LBB0_14
; %bb.10:
	mov	w22, w19
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_xfer_msg
	cbnz	w0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x21, x21, #8
	subs	x22, x22, #1
	b.ne	LBB0_11
	b	LBB0_14
LBB0_13:
	mov	x19, x0
LBB0_14:
	ldr	w0, [x20]
	bl	_clk_disable_unprepare
LBB0_15:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SUN4I_HDMI_DDC_BYTE_COUNT_MAX,8,3 ; @SUN4I_HDMI_DDC_BYTE_COUNT_MAX
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_sun4i_hdmi_i2c_xfer
.subsections_via_symbols
