	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4780_i2c_xfer_read
_jz4780_i2c_xfer_read:                  ## @jz4780_i2c_xfer_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
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	_JZ4780_I2C_TIMEOUT@GOTPCREL(%rip), %rax
	leal	5(%rbx), %r15d
	imull	(%rax), %r15d
	movq	%rsi, %rdi
	xorl	%esi, %esi
	callq	_memset
	leaq	52(%r13), %rdi
	movq	%rdi, %r14
	callq	_spin_lock_irqsave
	xorps	%xmm0, %xmm0
	movups	%xmm0, 72(%r13)
	movq	%r12, (%r13)
	movl	%ebx, 8(%r13)
	movups	%xmm0, 56(%r13)
	movq	_JZ4780_I2C_FIFO_LEN@GOTPCREL(%rip), %rax
	movq	_JZ4780_I2C_RXTL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	%ebx, (%rax)
	jge	LBB0_1
## %bb.2:
	movq	_RX_LEVEL@GOTPCREL(%rip), %rax
	movzwl	(%rax), %ebx
	jmp	LBB0_3
LBB0_1:
	decl	%ebx
LBB0_3:
	movq	%r14, %r12
	xorl	%r14d, %r14d
	movzwl	%bx, %edx
	movq	%r13, %rdi
	callq	_jz4780_i2c_writew
	movq	_JZ4780_I2C_TXTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TX_LEVEL@GOTPCREL(%rip), %rax
	movzwl	(%rax), %edx
	movq	%r13, %rdi
	callq	_jz4780_i2c_writew
	movq	_JZ4780_I2C_INTM@GOTPCREL(%rip), %rax
	movq	_JZ4780_I2C_INTM_MRXFL@GOTPCREL(%rip), %rcx
	movq	_JZ4780_I2C_INTM_MTXEMP@GOTPCREL(%rip), %rdx
	movzwl	(%rdx), %edx
	orw	(%rcx), %dx
	movl	(%rax), %esi
	movq	_JZ4780_I2C_INTM_MTXABT@GOTPCREL(%rip), %rax
	orw	(%rax), %dx
	movq	_JZ4780_I2C_INTM_MRXOF@GOTPCREL(%rip), %rax
	orw	(%rax), %dx
	movzwl	%dx, %edx
	movq	%r13, %rdi
	callq	_jz4780_i2c_writew
	movq	_JZ4780_I2C_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_jz4780_i2c_readw
	movq	_JZ4780_I2C_CTRL_STPHLD@GOTPCREL(%rip), %rcx
	orw	(%rcx), %ax
	movl	(%rbx), %esi
	movzwl	%ax, %edx
	movq	%r13, %rdi
	callq	_jz4780_i2c_writew
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	leaq	48(%r13), %rbx
	movl	%r15d, %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	leaq	32(%r13), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	movq	16(%r13), %rdx
	movq	40(%r13), %rax
	movl	(%rax,%rdx,4), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
	movq	16(%r13), %rdx
	movq	24(%r13), %rax
	movl	(%rax,%rdx,4), %ecx
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_5:
	movq	_JZ4780_I2C_TXABRT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_jz4780_i2c_readw
	testw	%ax, %ax
	je	LBB0_7
## %bb.6:
	movzwl	%ax, %esi
	movq	%r13, %rdi
	callq	_jz4780_i2c_txabrt
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JZ4780_I2C_TIMEOUT,4,2         ## @JZ4780_I2C_TIMEOUT
	.comm	_JZ4780_I2C_FIFO_LEN,4,2        ## @JZ4780_I2C_FIFO_LEN
	.comm	_JZ4780_I2C_RXTL,4,2            ## @JZ4780_I2C_RXTL
	.comm	_RX_LEVEL,2,1                   ## @RX_LEVEL
	.comm	_JZ4780_I2C_TXTL,4,2            ## @JZ4780_I2C_TXTL
	.comm	_TX_LEVEL,2,1                   ## @TX_LEVEL
	.comm	_JZ4780_I2C_INTM,4,2            ## @JZ4780_I2C_INTM
	.comm	_JZ4780_I2C_INTM_MRXFL,2,1      ## @JZ4780_I2C_INTM_MRXFL
	.comm	_JZ4780_I2C_INTM_MTXEMP,2,1     ## @JZ4780_I2C_INTM_MTXEMP
	.comm	_JZ4780_I2C_INTM_MTXABT,2,1     ## @JZ4780_I2C_INTM_MTXABT
	.comm	_JZ4780_I2C_INTM_MRXOF,2,1      ## @JZ4780_I2C_INTM_MRXOF
	.comm	_JZ4780_I2C_CTRL,4,2            ## @JZ4780_I2C_CTRL
	.comm	_JZ4780_I2C_CTRL_STPHLD,2,1     ## @JZ4780_I2C_CTRL_STPHLD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"irq read timeout\n"

L_.str.1:                               ## @.str.1
	.asciz	"send cmd count:%d  %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"receive data count:%d  %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_JZ4780_I2C_TXABRT,4,2          ## @JZ4780_I2C_TXABRT
	.no_dead_strip	_jz4780_i2c_xfer_read
.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_read
_jz4780_i2c_xfer_read:                  ; @jz4780_i2c_xfer_read
	.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	x22, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _JZ4780_I2C_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JZ4780_I2C_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w9, w2, #5
	mul	w20, w8, w9
	mov	x0, x1
	mov	w1, #0
	bl	_memset
	add	x21, x19, #52
	mov	x0, x21
	bl	_spin_lock_irqsave
	stp	xzr, xzr, [x19, #72]
	str	x23, [x19]
	str	w22, [x19, #8]
Lloh3:
	adrp	x8, _JZ4780_I2C_FIFO_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _JZ4780_I2C_FIFO_LEN@GOTPAGEOFF]
	stp	xzr, xzr, [x19, #56]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _JZ4780_I2C_RXTL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _JZ4780_I2C_RXTL@GOTPAGEOFF]
Lloh8:
	adrp	x10, _RX_LEVEL@GOTPAGE
Lloh9:
	ldr	x10, [x10, _RX_LEVEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x9]
	ldrh	w9, [x10]
	sub	w10, w22, #1
	cmp	w8, w22
	csel	w8, w9, w10, lt
	and	w2, w8, #0xffff
	mov	x0, x19
	bl	_jz4780_i2c_writew
Lloh11:
	adrp	x8, _JZ4780_I2C_TXTL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _JZ4780_I2C_TXTL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _TX_LEVEL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TX_LEVEL@GOTPAGEOFF]
	ldrh	w2, [x8]
	mov	x0, x19
	bl	_jz4780_i2c_writew
Lloh16:
	adrp	x8, _JZ4780_I2C_INTM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _JZ4780_I2C_INTM@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x8, _JZ4780_I2C_INTM_MRXFL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _JZ4780_I2C_INTM_MRXFL@GOTPAGEOFF]
	ldrh	w8, [x8]
Lloh21:
	adrp	x9, _JZ4780_I2C_INTM_MTXEMP@GOTPAGE
Lloh22:
	ldr	x9, [x9, _JZ4780_I2C_INTM_MTXEMP@GOTPAGEOFF]
	ldrh	w9, [x9]
	orr	w8, w9, w8
Lloh23:
	adrp	x9, _JZ4780_I2C_INTM_MTXABT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _JZ4780_I2C_INTM_MTXABT@GOTPAGEOFF]
	ldrh	w9, [x9]
	orr	w8, w8, w9
Lloh25:
	adrp	x9, _JZ4780_I2C_INTM_MRXOF@GOTPAGE
Lloh26:
	ldr	x9, [x9, _JZ4780_I2C_INTM_MRXOF@GOTPAGEOFF]
	ldrh	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_jz4780_i2c_writew
Lloh27:
	adrp	x22, _JZ4780_I2C_CTRL@GOTPAGE
Lloh28:
	ldr	x22, [x22, _JZ4780_I2C_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_jz4780_i2c_readw
Lloh29:
	adrp	x8, _JZ4780_I2C_CTRL_STPHLD@GOTPAGE
Lloh30:
	ldr	x8, [x8, _JZ4780_I2C_CTRL_STPHLD@GOTPAGEOFF]
	ldrh	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x22]
	mov	x0, x19
	bl	_jz4780_i2c_writew
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	add	x21, x19, #48
	mov	x0, x20
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_timeout
	mov	w20, #0
Lloh31:
	adrp	x21, _EIO@GOTPAGE
Lloh32:
	ldr	x21, [x21, _EIO@GOTPAGEOFF]
	cbnz	x0, LBB0_2
; %bb.1:
	add	x20, x19, #32
Lloh33:
	adrp	x1, l_.str@PAGE
Lloh34:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	ldr	x2, [x19, #16]
	ldr	x8, [x19, #40]
	ldr	w3, [x8, x2, lsl #2]
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldp	x2, x8, [x19, #16]
	ldr	w3, [x8, x2, lsl #2]
Lloh37:
	adrp	x1, l_.str.2@PAGE
Lloh38:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	w8, [x21]
	neg	w20, w8
LBB0_2:
Lloh39:
	adrp	x8, _JZ4780_I2C_TXABRT@GOTPAGE
Lloh40:
	ldr	x8, [x8, _JZ4780_I2C_TXABRT@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_jz4780_i2c_readw
	cbz	w0, LBB0_4
; %bb.3:
	mov	x1, x0
	mov	x0, x19
	bl	_jz4780_i2c_txabrt
	ldr	w8, [x21]
	neg	w20, w8
LBB0_4:
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_JZ4780_I2C_TIMEOUT,4,2         ; @JZ4780_I2C_TIMEOUT
	.comm	_JZ4780_I2C_FIFO_LEN,4,2        ; @JZ4780_I2C_FIFO_LEN
	.comm	_JZ4780_I2C_RXTL,4,2            ; @JZ4780_I2C_RXTL
	.comm	_RX_LEVEL,2,1                   ; @RX_LEVEL
	.comm	_JZ4780_I2C_TXTL,4,2            ; @JZ4780_I2C_TXTL
	.comm	_TX_LEVEL,2,1                   ; @TX_LEVEL
	.comm	_JZ4780_I2C_INTM,4,2            ; @JZ4780_I2C_INTM
	.comm	_JZ4780_I2C_INTM_MRXFL,2,1      ; @JZ4780_I2C_INTM_MRXFL
	.comm	_JZ4780_I2C_INTM_MTXEMP,2,1     ; @JZ4780_I2C_INTM_MTXEMP
	.comm	_JZ4780_I2C_INTM_MTXABT,2,1     ; @JZ4780_I2C_INTM_MTXABT
	.comm	_JZ4780_I2C_INTM_MRXOF,2,1      ; @JZ4780_I2C_INTM_MRXOF
	.comm	_JZ4780_I2C_CTRL,4,2            ; @JZ4780_I2C_CTRL
	.comm	_JZ4780_I2C_CTRL_STPHLD,2,1     ; @JZ4780_I2C_CTRL_STPHLD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"irq read timeout\n"

l_.str.1:                               ; @.str.1
	.asciz	"send cmd count:%d  %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"receive data count:%d  %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_JZ4780_I2C_TXABRT,4,2          ; @JZ4780_I2C_TXABRT
	.no_dead_strip	_jz4780_i2c_xfer_read
.subsections_via_symbols
