	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4780_i2c_xfer
_jz4780_i2c_xfer:                       ## @jz4780_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	%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
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	(%rdi), %r14
	movq	%r14, %rdi
	callq	_jz4780_i2c_prepare
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_13:
	movq	%r14, %rdi
	callq	_jz4780_i2c_cleanup
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	12(%r12), %ebx
	movq	_JZ4780_I2C_TAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_jz4780_i2c_readw
	cmpl	%eax, %ebx
	je	LBB0_4
## %bb.3:
	movl	12(%r12), %esi
	movq	%r14, %rdi
	callq	_jz4780_i2c_set_target
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_13
LBB0_4:
	testl	%r15d, %r15d
	jle	LBB0_5
## %bb.6:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	4(%r12), %edx
	movl	8(%r12), %esi
	testl	%eax, (%r12)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	callq	_jz4780_i2c_xfer_read
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, %rdi
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	callq	_jz4780_i2c_xfer_write
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	addq	$16, %r12
	cmpl	%ebx, %r15d
	jne	LBB0_7
## %bb.12:
	movl	%r15d, %r13d
	jmp	LBB0_13
LBB0_5:
	xorl	%r13d, %r13d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I2C prepare failed\n"

	.comm	_JZ4780_I2C_TAR,4,2             ## @JZ4780_I2C_TAR
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.no_dead_strip	_jz4780_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jz4780_i2c_xfer
_jz4780_i2c_xfer:                       ; @jz4780_i2c_xfer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x21, x1
	ldr	x19, [x0]
	mov	x0, x19
	bl	_jz4780_i2c_prepare
	cbz	w0, LBB0_3
; %bb.1:
	mov	x23, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_2:
	mov	x0, x19
	bl	_jz4780_i2c_cleanup
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldr	w22, [x21, #12]
Lloh2:
	adrp	x8, _JZ4780_I2C_TAR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _JZ4780_I2C_TAR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_jz4780_i2c_readw
	cmp	w22, w0
	b.eq	LBB0_5
; %bb.4:
	ldr	w1, [x21, #12]
	mov	x0, x19
	bl	_jz4780_i2c_set_target
	mov	x23, x0
	cbnz	w0, LBB0_2
LBB0_5:
	cmp	w20, #1
	b.lt	LBB0_12
; %bb.6:
	mov	w22, #0
Lloh5:
	adrp	x24, _I2C_M_RD@GOTPAGE
Lloh6:
	ldr	x24, [x24, _I2C_M_RD@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	ldp	w2, w1, [x21, #4]
	ldr	w9, [x21]
	mov	x0, x19
	mov	x3, x20
	mov	x4, x22
	tst	w8, w9
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_jz4780_i2c_xfer_read
	mov	x23, x0
	cbz	w0, LBB0_10
	b	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	bl	_jz4780_i2c_xfer_write
	mov	x23, x0
	cbnz	w0, LBB0_2
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w22, w22, #1
	add	x21, x21, #16
	cmp	w20, w22
	b.ne	LBB0_7
; %bb.11:
	mov	x23, x20
	b	LBB0_2
LBB0_12:
	mov	w23, #0
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I2C prepare failed\n"

	.comm	_JZ4780_I2C_TAR,4,2             ; @JZ4780_I2C_TAR
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.no_dead_strip	_jz4780_i2c_xfer
.subsections_via_symbols
