	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxs_i2c_xfer_msg
_mxs_i2c_xfer_msg:                      ## @mxs_i2c_xfer_msg
	.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, %r13d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_i2c_get_adapdata
	movq	%rax, %r14
	movl	%r13d, %r12d
	testl	%r13d, %r13d
	je	LBB0_2
## %bb.1:
	movq	_MXS_I2C_CTRL0_POST_SEND_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_2:
	movl	16(%r14), %edi
	movl	8(%rbx), %edx
	movl	(%rbx), %ecx
	movl	4(%rbx), %r8d
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %r9d
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%rbx), %eax
	testl	%ecx, 4(%rbx)
	je	LBB0_7
## %bb.3:
	cmpl	$5, %eax
	jge	LBB0_4
LBB0_8:
	movl	$0, (%r14)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_mxs_i2c_pio_setup_xfer
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %ebx
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	callq	_mxs_i2c_reset
	jmp	LBB0_12
LBB0_7:
	cmpl	$6, %eax
	jle	LBB0_8
LBB0_4:
	movl	$0, (%r14)
	movq	%r14, %r13
	addq	$32, %r13
	movq	%r13, %rdi
	callq	_reinit_completion
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_mxs_i2c_dma_setup_xfer
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.5:
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_17
## %bb.6:
	movl	(%r14), %ebx
	jmp	LBB0_12
LBB0_9:
	xorl	%ebx, %ebx
LBB0_12:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_14
## %bb.13:
	movq	_MXS_I2C_CTRL1_CLR_GOT_A_NAK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MXS_I2C_CTRL1_SET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%r14), %rsi
	callq	_writel
LBB0_14:
	movq	8(%r14), %rax
	movq	_MXS_I2C_V1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	_mxs_i2c_reset
LBB0_16:
	movl	16(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	16(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r14, %rdi
	callq	_mxs_i2c_dma_finish
	movq	%r14, %rdi
	callq	_mxs_i2c_reset
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.18:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movl	%r15d, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_MXS_I2C_CTRL0_POST_SEND_STOP,4,2 ## @MXS_I2C_CTRL0_POST_SEND_STOP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n"

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_MXS_I2C_CTRL1_CLR_GOT_A_NAK,4,2 ## @MXS_I2C_CTRL1_CLR_GOT_A_NAK
	.comm	_MXS_I2C_CTRL1_SET,8,3          ## @MXS_I2C_CTRL1_SET
	.comm	_MXS_I2C_V1,8,3                 ## @MXS_I2C_V1
L_.str.1:                               ## @.str.1
	.asciz	"Done with err=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Timeout!\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_mxs_i2c_xfer_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxs_i2c_xfer_msg
_mxs_i2c_xfer_msg:                      ; @mxs_i2c_xfer_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x2
	mov	x20, x1
	mov	x21, x0
	bl	_i2c_get_adapdata
	mov	x19, x0
Lloh0:
	adrp	x8, _MXS_I2C_CTRL0_POST_SEND_STOP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MXS_I2C_CTRL0_POST_SEND_STOP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w23, #0
	csel	w22, wzr, w8, eq
	ldr	w0, [x0, #16]
	ldp	w10, w8, [x20, #4]
	ldr	w9, [x20]
	stp	x10, x23, [sp, #16]
	stp	x8, x9, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh5:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x8]
	ldp	w8, w10, [x20]
	tst	w9, w10
	b.eq	LBB0_5
; %bb.1:
	cmp	w8, #5
	b.ge	LBB0_6
LBB0_2:
	str	wzr, [x19]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_mxs_i2c_pio_setup_xfer
	mov	x20, x0
	cbz	w0, LBB0_9
; %bb.3:
Lloh8:
	adrp	x8, _ENXIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w20, w8
	b.eq	LBB0_9
; %bb.4:
	mov	x0, x19
	bl	_mxs_i2c_reset
	b	LBB0_9
LBB0_5:
	cmp	w8, #6
	b.le	LBB0_2
LBB0_6:
	mov	x23, x19
	str	wzr, [x23], #32
	mov	x0, x23
	bl	_reinit_completion
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_mxs_i2c_dma_setup_xfer
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.7:
	mov	w0, #1000
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x23
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_15
; %bb.8:
	ldr	w20, [x19]
LBB0_9:
Lloh11:
	adrp	x8, _ENXIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmn	w20, w8
	b.ne	LBB0_11
; %bb.10:
Lloh14:
	adrp	x8, _MXS_I2C_CTRL1_CLR_GOT_A_NAK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MXS_I2C_CTRL1_CLR_GOT_A_NAK@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
Lloh17:
	adrp	x9, _MXS_I2C_CTRL1_SET@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MXS_I2C_CTRL1_SET@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
LBB0_11:
	ldr	x8, [x19, #8]
Lloh20:
	adrp	x9, _MXS_I2C_V1@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MXS_I2C_V1@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_mxs_i2c_reset
LBB0_13:
	ldr	w0, [x19, #16]
	str	x20, [sp]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_15:
	ldr	w0, [x19, #16]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	bl	_mxs_i2c_dma_finish
	mov	x0, x19
	bl	_mxs_i2c_reset
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.16:
Lloh27:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_MXS_I2C_CTRL0_POST_SEND_STOP,4,2 ; @MXS_I2C_CTRL0_POST_SEND_STOP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n"

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_MXS_I2C_CTRL1_CLR_GOT_A_NAK,4,2 ; @MXS_I2C_CTRL1_CLR_GOT_A_NAK
	.comm	_MXS_I2C_CTRL1_SET,8,3          ; @MXS_I2C_CTRL1_SET
	.comm	_MXS_I2C_V1,8,3                 ; @MXS_I2C_V1
l_.str.1:                               ; @.str.1
	.asciz	"Done with err=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Timeout!\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_mxs_i2c_xfer_msg
.subsections_via_symbols
