	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sprd_i2c_data_transfer
_sprd_i2c_data_transfer:                ## @sprd_i2c_data_transfer
	.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
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_3
## %bb.1:
	movl	8(%rbx), %esi
	movq	_I2C_FIFO_FULL_THLD@GOTPCREL(%rip), %r14
	movq	(%r14), %rdx
	movq	%rbx, %rdi
	callq	_sprd_i2c_read_bytes
	movq	(%rbx), %rax
	subq	(%r14), %rax
	movq	%rax, (%rbx)
	movq	(%r14), %rcx
	addl	%ecx, 8(%rbx)
	cmpq	%rcx, %rax
	jl	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	movl	$1, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sprd_i2c_set_fifo_full_int     ## TAILCALL
LBB0_3:
	movq	_I2C_FIFO_DEEP@GOTPCREL(%rip), %r15
	movq	(%r15), %r14
	movq	(%rbx), %r12
	cmpq	%r14, %r12
	cmovlq	%r12, %r14
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_sprd_i2c_write_bytes
	addl	%r14d, 8(%rbx)
	subq	%r14, (%rbx)
	cmpq	(%r15), %r12
	jle	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	movl	$1, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sprd_i2c_set_fifo_empty_int    ## TAILCALL
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_FIFO_DEEP,8,3              ## @I2C_FIFO_DEEP
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_I2C_FIFO_FULL_THLD,8,3         ## @I2C_FIFO_FULL_THLD
	.no_dead_strip	_sprd_i2c_data_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sprd_i2c_data_transfer
_sprd_i2c_data_transfer:                ; @sprd_i2c_data_transfer
	.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, x0
	ldr	x8, [x0, #16]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	ldr	w1, [x19, #8]
Lloh3:
	adrp	x20, _I2C_FIFO_FULL_THLD@GOTPAGE
Lloh4:
	ldr	x20, [x20, _I2C_FIFO_FULL_THLD@GOTPAGEOFF]
	ldr	x2, [x20]
	mov	x0, x19
	bl	_sprd_i2c_read_bytes
	ldr	x8, [x20]
	ldr	x9, [x19]
	sub	x8, x9, x8
	str	x8, [x19]
	ldr	x9, [x20]
	ldr	w10, [x19, #8]
	add	w10, w10, w9
	str	w10, [x19, #8]
	cmp	x8, x9
	b.lt	LBB0_5
; %bb.2:
	mov	x0, x19
	mov	w1, #1
	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
	b	_sprd_i2c_set_fifo_full_int
LBB0_3:
Lloh5:
	adrp	x21, _I2C_FIFO_DEEP@GOTPAGE
Lloh6:
	ldr	x21, [x21, _I2C_FIFO_DEEP@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x22, [x19]
	cmp	x22, x8
	csel	x20, x22, x8, lt
	ldr	w1, [x19, #8]
	mov	x0, x19
	mov	x2, x20
	bl	_sprd_i2c_write_bytes
	ldr	w8, [x19, #8]
	add	w8, w8, w20
	str	w8, [x19, #8]
	ldr	x8, [x19]
	sub	x8, x8, x20
	str	x8, [x19]
	ldr	x8, [x21]
	cmp	x22, x8
	b.le	LBB0_5
; %bb.4:
	mov	x0, x19
	mov	w1, #1
	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
	b	_sprd_i2c_set_fifo_empty_int
LBB0_5:
	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	_I2C_FIFO_DEEP,8,3              ; @I2C_FIFO_DEEP
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_I2C_FIFO_FULL_THLD,8,3         ; @I2C_FIFO_FULL_THLD
	.no_dead_strip	_sprd_i2c_data_transfer
.subsections_via_symbols
