	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk3x_i2c_handle_write
_rk3x_i2c_handle_write:                 ## @rk3x_i2c_handle_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_REG_INT_MBTF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%r14d, %esi
	je	LBB0_3
## %bb.1:
	movq	_REG_IPD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_i2c_writel
	movq	(%rbx), %rax
	movq	16(%rbx), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.4:
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_rk3x_i2c_stop                  ## TAILCALL
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	subl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rk3x_i2c_stop
	movl	24(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_err
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_rk3x_i2c_clean_ipd             ## TAILCALL
LBB0_2:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_rk3x_i2c_fill_transmit_buf     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_INT_MBTF,4,2               ## @REG_INT_MBTF
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unexpected irq in WRITE: 0x%x\n"

	.comm	_REG_IPD,4,2                    ## @REG_IPD
	.no_dead_strip	_rk3x_i2c_handle_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rk3x_i2c_handle_write
_rk3x_i2c_handle_write:                 ; @rk3x_i2c_handle_write
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _REG_INT_MBTF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_INT_MBTF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	tst	w1, w20
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _REG_IPD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_IPD@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_i2c_writel
	ldr	x8, [x19]
	ldr	x9, [x19, #16]
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	ldr	w1, [x19, #8]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_rk3x_i2c_stop
LBB0_3:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w1, w8
	mov	x0, x19
	bl	_rk3x_i2c_stop
	ldr	w0, [x19, #24]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_rk3x_i2c_clean_ipd
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_rk3x_i2c_fill_transmit_buf
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_INT_MBTF,4,2               ; @REG_INT_MBTF
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unexpected irq in WRITE: 0x%x\n"

	.comm	_REG_IPD,4,2                    ; @REG_IPD
	.no_dead_strip	_rk3x_i2c_handle_write
.subsections_via_symbols
