	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sprd_i2c_isr_thread
_sprd_i2c_isr_thread:                   ## @sprd_i2c_isr_thread
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	24(%rsi), %r14
	movq	_I2C_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rsi), %rdi
	callq	_readl
	movq	_I2C_RX_ACK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	(%rbx), %edx
	movq	_I2C_FIFO_FULL_THLD@GOTPCREL(%rip), %rsi
	xorl	%edi, %edi
	cmpl	(%rsi), %edx
	setge	%dil
	xorl	%esi, %esi
	testl	%edx, %edx
	setne	%sil
	andl	(%r14), %ecx
	cmovnel	%edi, %esi
	cmpb	$1, %sil
	jne	LBB0_3
## %bb.1:
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_sprd_i2c_data_transfer
	jmp	LBB0_9
LBB0_3:
	movl	$0, 12(%rbx)
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 12(%rbx)
	jmp	LBB0_8
LBB0_5:
	testl	%ecx, %ecx
	je	LBB0_8
## %bb.6:
	testl	%edx, %edx
	je	LBB0_8
## %bb.7:
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	callq	_sprd_i2c_read_bytes
LBB0_8:
	movq	%rbx, %rdi
	callq	_sprd_i2c_clear_ack
	movq	%rbx, %rdi
	callq	_sprd_i2c_clear_start
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_complete
LBB0_9:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_STATUS,8,3                 ## @I2C_STATUS
	.comm	_I2C_RX_ACK,4,2                 ## @I2C_RX_ACK
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_I2C_FIFO_FULL_THLD,4,2         ## @I2C_FIFO_FULL_THLD
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sprd_i2c_isr_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sprd_i2c_isr_thread
_sprd_i2c_isr_thread:                   ; @sprd_i2c_isr_thread
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	ldp	x8, x20, [x1, #16]
Lloh0:
	adrp	x9, _I2C_STATUS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh3:
	adrp	x8, _I2C_RX_ACK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I2C_RX_ACK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
	ldr	w9, [x20]
Lloh6:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh7:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	ldr	w2, [x19]
Lloh9:
	adrp	x11, _I2C_FIFO_FULL_THLD@GOTPAGE
Lloh10:
	ldr	x11, [x11, _I2C_FIFO_FULL_THLD@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	cmp	w2, w11
	cset	w11, ge
	cmp	w2, #0
	cset	w12, ne
	ands	w9, w10, w9
	csel	w10, w12, w11, eq
	cmp	w10, #1
	ccmp	w8, #0, #0, eq
	b.eq	LBB0_3
; %bb.1:
	str	wzr, [x19, #12]
	cbz	w8, LBB0_4
; %bb.2:
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19, #12]
	b	LBB0_6
LBB0_3:
	mov	x0, x19
	bl	_sprd_i2c_data_transfer
	b	LBB0_7
LBB0_4:
	cmp	w9, #0
	ccmp	w2, #0, #4, ne
	b.eq	LBB0_6
; %bb.5:
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_sprd_i2c_read_bytes
LBB0_6:
	mov	x0, x19
	bl	_sprd_i2c_clear_ack
	mov	x0, x19
	bl	_sprd_i2c_clear_start
	add	x0, x19, #4
	bl	_complete
LBB0_7:
Lloh15:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_STATUS,8,3                 ; @I2C_STATUS
	.comm	_I2C_RX_ACK,4,2                 ; @I2C_RX_ACK
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_I2C_FIFO_FULL_THLD,4,2         ; @I2C_FIFO_FULL_THLD
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_sprd_i2c_isr_thread
.subsections_via_symbols
