	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4780_i2c_xfer_write
_jz4780_i2c_xfer_write:                 ## @jz4780_i2c_xfer_write
	.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	%r8d, %r12d
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	_JZ4780_I2C_TIMEOUT@GOTPCREL(%rip), %rax
	leal	5(%r15), %ecx
	imull	(%rax), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	addq	$28, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	decl	%ebx
	xorl	%eax, %eax
	cmpl	%r12d, %ebx
	setg	%al
	movl	%eax, (%r13)
	movl	$1, 4(%r13)
	movq	%r14, 8(%r13)
	movl	%r15d, 16(%r13)
	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
	movl	(%rax), %esi
	movq	_JZ4780_I2C_INTM_MTXEMP@GOTPCREL(%rip), %rax
	movq	_JZ4780_I2C_INTM_MTXABT@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %ecx
	orw	(%rax), %cx
	movzwl	%cx, %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	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	leaq	24(%r13), %rbx
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	xorl	%r14d, %r14d
	cmpl	$0, (%r13)
	jne	LBB0_10
## %bb.2:
	movq	_JZ4780_I2C_TIMEOUT@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$100, %rax, %rbx
	testq	%rax, %rax
	jle	LBB0_8
## %bb.3:
	testq	%rbx, %rbx
	movl	$1, %eax
	cmovleq	%rbx, %rax
	decq	%rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	incq	%rbx
	movq	_JZ4780_I2C_STA@GOTPCREL(%rip), %r12
	movq	_JZ4780_I2C_STA_MSTACT@GOTPCREL(%rip), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$10, %edi
	callq	_udelay
	decq	%rbx
	cmpq	$1, %rbx
	jle	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_jz4780_i2c_readw
	testw	%ax, (%r15)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_JZ4780_I2C_STA_TFE@GOTPCREL(%rip), %rcx
	andw	(%rcx), %ax
	je	LBB0_6
	jmp	LBB0_10
LBB0_7:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_8:
	testq	%rbx, %rbx
	jne	LBB0_10
LBB0_9:
	leaq	20(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_10:
	movq	_JZ4780_I2C_TXABRT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_jz4780_i2c_readw
	testw	%ax, %ax
	je	LBB0_12
## %bb.11:
	movzwl	%ax, %esi
	movq	%r13, %rdi
	callq	_jz4780_i2c_txabrt
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$24, %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_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_MTXEMP,2,1     ## @JZ4780_I2C_INTM_MTXEMP
	.comm	_JZ4780_I2C_INTM_MTXABT,2,1     ## @JZ4780_I2C_INTM_MTXABT
	.comm	_JZ4780_I2C_CTRL,4,2            ## @JZ4780_I2C_CTRL
	.comm	_JZ4780_I2C_CTRL_STPHLD,2,1     ## @JZ4780_I2C_CTRL_STPHLD
	.comm	_JZ4780_I2C_STA,4,2             ## @JZ4780_I2C_STA
	.comm	_JZ4780_I2C_STA_MSTACT,2,1      ## @JZ4780_I2C_STA_MSTACT
	.comm	_JZ4780_I2C_STA_TFE,2,1         ## @JZ4780_I2C_STA_TFE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write wait timeout\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_JZ4780_I2C_TXABRT,4,2          ## @JZ4780_I2C_TXABRT
	.no_dead_strip	_jz4780_i2c_xfer_write
.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_write
_jz4780_i2c_xfer_write:                 ; @jz4780_i2c_xfer_write
	.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	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
	add	w8, w2, #5
Lloh0:
	adrp	x26, _JZ4780_I2C_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x26, [x26, _JZ4780_I2C_TIMEOUT@GOTPAGEOFF]
	ldr	w9, [x26]
	mul	w20, w9, w8
	add	x25, x0, #28
	mov	x0, x25
	bl	_spin_lock_irqsave
	sub	w8, w22, #1
	cmp	w8, w21
	cset	w8, gt
	mov	w9, #1
	stp	w8, w9, [x19]
	str	x24, [x19, #8]
	str	w23, [x19, #16]
Lloh2:
	adrp	x8, _JZ4780_I2C_TXTL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _JZ4780_I2C_TXTL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _TX_LEVEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TX_LEVEL@GOTPAGEOFF]
	ldrh	w2, [x8]
	mov	x0, x19
	bl	_jz4780_i2c_writew
Lloh7:
	adrp	x8, _JZ4780_I2C_INTM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _JZ4780_I2C_INTM@GOTPAGEOFF]
Lloh9:
	adrp	x9, _JZ4780_I2C_INTM_MTXEMP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _JZ4780_I2C_INTM_MTXEMP@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldrh	w8, [x9]
Lloh12:
	adrp	x9, _JZ4780_I2C_INTM_MTXABT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _JZ4780_I2C_INTM_MTXABT@GOTPAGEOFF]
	ldrh	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_jz4780_i2c_writew
Lloh14:
	adrp	x21, _JZ4780_I2C_CTRL@GOTPAGE
Lloh15:
	ldr	x21, [x21, _JZ4780_I2C_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_jz4780_i2c_readw
Lloh16:
	adrp	x8, _JZ4780_I2C_CTRL_STPHLD@GOTPAGE
Lloh17:
	ldr	x8, [x8, _JZ4780_I2C_CTRL_STPHLD@GOTPAGEOFF]
	ldrh	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x21]
	mov	x0, x19
	bl	_jz4780_i2c_writew
	mov	x0, x25
	bl	_spin_unlock_irqrestore
	add	x21, x19, #24
	mov	x0, x20
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_timeout
Lloh18:
	adrp	x21, _EIO@GOTPAGE
Lloh19:
	ldr	x21, [x21, _EIO@GOTPAGEOFF]
	cbz	x0, LBB0_9
; %bb.1:
	ldr	w8, [x19]
	cbz	w8, LBB0_3
LBB0_2:
	mov	w20, #0
	b	LBB0_10
LBB0_3:
	ldrsw	x9, [x26]
	mov	w8, #100
	mul	x8, x9, x8
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.4:
	cmp	x8, #1
	csinc	x9, x8, xzr, lt
	sub	x20, x9, #1
	add	x22, x8, #1
Lloh20:
	adrp	x23, _JZ4780_I2C_STA@GOTPAGE
Lloh21:
	ldr	x23, [x23, _JZ4780_I2C_STA@GOTPAGEOFF]
Lloh22:
	adrp	x24, _JZ4780_I2C_STA_MSTACT@GOTPAGE
Lloh23:
	ldr	x24, [x24, _JZ4780_I2C_STA_MSTACT@GOTPAGEOFF]
Lloh24:
	adrp	x25, _JZ4780_I2C_STA_TFE@GOTPAGE
Lloh25:
	ldr	x25, [x25, _JZ4780_I2C_STA_TFE@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_jz4780_i2c_readw
	ldrh	w8, [x24]
	and	w8, w8, w0
	ldrh	w9, [x25]
	and	w9, w9, w0
	cmp	w8, #0
	ccmp	w9, #0, #4, eq
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #10
	bl	_udelay
	sub	x22, x22, #1
	cmp	x22, #1
	b.gt	LBB0_5
; %bb.7:
	cbnz	x20, LBB0_2
	b	LBB0_9
LBB0_8:
	mov	x20, x8
	cbnz	x20, LBB0_2
LBB0_9:
	add	x0, x19, #20
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	w8, [x21]
	neg	w20, w8
LBB0_10:
Lloh28:
	adrp	x8, _JZ4780_I2C_TXABRT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _JZ4780_I2C_TXABRT@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_jz4780_i2c_readw
	cbz	w0, LBB0_12
; %bb.11:
	mov	x1, x0
	mov	x0, x19
	bl	_jz4780_i2c_txabrt
	ldr	w8, [x21]
	neg	w20, w8
LBB0_12:
	mov	x0, x20
	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 AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_JZ4780_I2C_TIMEOUT,4,2         ; @JZ4780_I2C_TIMEOUT
	.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_MTXEMP,2,1     ; @JZ4780_I2C_INTM_MTXEMP
	.comm	_JZ4780_I2C_INTM_MTXABT,2,1     ; @JZ4780_I2C_INTM_MTXABT
	.comm	_JZ4780_I2C_CTRL,4,2            ; @JZ4780_I2C_CTRL
	.comm	_JZ4780_I2C_CTRL_STPHLD,2,1     ; @JZ4780_I2C_CTRL_STPHLD
	.comm	_JZ4780_I2C_STA,4,2             ; @JZ4780_I2C_STA
	.comm	_JZ4780_I2C_STA_MSTACT,2,1      ; @JZ4780_I2C_STA_MSTACT
	.comm	_JZ4780_I2C_STA_TFE,2,1         ; @JZ4780_I2C_STA_TFE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write wait timeout\n"

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