	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oaktrail_hdmi_i2c_access
_oaktrail_hdmi_i2c_access:              ## @oaktrail_hdmi_i2c_access
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r13
	callq	_i2c_get_adapdata
	movq	%rax, %r12
	movq	(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_HDMI_ICRH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$34656, %esi                    ## imm = 0x8760
	callq	_HDMI_WRITE
	movq	%r12, %rdi
	callq	_hdmi_i2c_irq_enable
	testl	%r15d, %r15d
	jle	LBB0_1
## %bb.2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_I2C_M_RD@GOTPCREL(%rip), %r14
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_xfer_read
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	$24, %rbx
	decl	%r15d
	je	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 16(%rbx)
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 8(%rbx)
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14), %eax
	testl	%eax, (%rbx)
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_xfer_write
	jmp	LBB0_8
LBB0_9:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_1:
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r12, %rdi
	callq	_hdmi_i2c_irq_disable
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDMI_ICRH,4,2                  ## @HDMI_ICRH
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.no_dead_strip	_oaktrail_hdmi_i2c_access
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function oaktrail_hdmi_i2c_access
_oaktrail_hdmi_i2c_access:              ; @oaktrail_hdmi_i2c_access
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x23, x0
	bl	_i2c_get_adapdata
	mov	x21, x0
	ldr	x20, [x0]
	mov	x0, x20
	bl	_mutex_lock
Lloh0:
	adrp	x8, _HDMI_ICRH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HDMI_ICRH@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w1, #34656
	bl	_HDMI_WRITE
	mov	x0, x21
	bl	_hdmi_i2c_irq_enable
	cmp	w19, #1
	b.lt	LBB0_8
; %bb.1:
Lloh3:
	adrp	x24, _I2C_M_RD@GOTPAGE
Lloh4:
	ldr	x24, [x24, _I2C_M_RD@GOTPAGEOFF]
	mov	x25, x19
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_xfer_read
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #24
	subs	w25, w25, #1
	b.eq	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	ldr	w9, [x24]
	mov	x0, x23
	mov	x1, x22
	tst	w9, w8
	b.ne	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_xfer_write
	b	LBB0_3
LBB0_8:
	mov	w19, #0
LBB0_9:
	mov	x0, x21
	bl	_hdmi_i2c_irq_disable
	mov	x0, x20
	bl	_mutex_unlock
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_HDMI_ICRH,4,2                  ; @HDMI_ICRH
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.no_dead_strip	_oaktrail_hdmi_i2c_access
.subsections_via_symbols
