	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxs_i2c_pio_setup_xfer
_mxs_i2c_pio_setup_xfer:                ## @mxs_i2c_pio_setup_xfer
	.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	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r13
	callq	_i2c_get_adapdata
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_i2c_8bit_addr_from_msg
	movl	%eax, %r12d
	movq	_MXS_I2C_IRQ_MASK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	shll	$8, %edi
	movq	_MXS_I2C_CTRL1_CLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_writel
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	4(%r13), %r8d
	testl	%eax, (%r13)
	je	LBB0_14
## %bb.1:
	xorl	%edi, %edi
	cmpl	$5, %r8d
	setge	%dil
	callq	_BUG_ON
	movq	_MXS_CMD_I2C_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_mxs_i2c_pio_trigger_write_cmd
	movq	%r14, %rdi
	callq	_mxs_i2c_pio_wait_xfer_end
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movl	%eax, %r15d
	movl	16(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_3
LBB0_14:
	testl	%r8d, %r8d
	jle	LBB0_9
## %bb.15:
	cmpl	$4, %r8d
	movq	_MXS_I2C_CTRL0_RETAIN_CLOCK@GOTPCREL(%rip), %r9
	movl	(%r9), %edx
	movl	$0, %r15d
	cmovael	%edx, %r15d
	movq	_MXS_I2C_CTRL0_PRE_SEND_START@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	shll	$24, %r12d
	leaq	L_.str.4(%rip), %r11
	xorl	%eax, %eax
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %esi
	movl	%r12d, %ecx
	sarl	$8, %ecx
	movq	8(%r13), %rdi
	movl	(%rdi,%rax,4), %r12d
	shll	$24, %r12d
	orl	%ecx, %r12d
	leaq	1(%rax), %rbx
	movl	%r8d, %ecx
	movl	%r15d, %edi
	orl	-44(%rbp), %edi                 ## 4-byte Folded Reload
	movl	%edx, %r15d
	notl	%r15d
	andl	%edi, %r15d
	cmpq	%rcx, %rbx
	cmovnel	%esi, %r15d
	movl	%eax, %esi
	andl	$3, %esi
	cmpl	$2, %esi
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpq	%rcx, %rbx
	jne	LBB0_28
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	leal	2(%rsi), %r13d
	cmpl	$3, %esi
	movl	$1, %ecx
	cmovel	%ecx, %r13d
	leal	(,%r13,8), %ecx
	negb	%cl
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %r12d
	movq	_MXS_I2C_CTRL0_PRE_SEND_START@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r11, %r9
	andl	%r15d, %ecx
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	leaq	L_.str.3(%rip), %r9
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	_MXS_I2C_CTRL0_POST_SEND_STOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r11, %r10
	andl	%r15d, %ecx
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=1
	leaq	L_.str.5(%rip), %r10
LBB0_22:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	%r11, %rbx
	testl	%edx, %r15d
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_16 Depth=1
	leaq	L_.str.6(%rip), %rbx
LBB0_24:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	16(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	pushq	%rbx
	pushq	%r10
	callq	_dev_dbg
	addq	$16, %rsp
	movq	_MXS_I2C_DEBUG0_DMAREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r14, %rbx
	movq	8(%r14), %r14
	movq	%rbx, %rdi
	callq	_MXS_I2C_DEBUG0_CLR
	addq	%rax, %r14
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movq	%r14, %rsi
	movq	%rbx, %r14
	callq	_writel
	movq	_MXS_I2C_CTRL0_MASTER_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	orl	%r15d, %ebx
	movq	_MXS_I2C_CTRL0_DIRECTION@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	%r13d, %edi
	callq	_MXS_I2C_CTRL0_XFER_COUNT
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_mxs_i2c_pio_trigger_write_cmd
	movq	_MXS_I2C_CTRL0_PRE_SEND_START@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_mxs_i2c_pio_wait_xfer_end
	testl	%eax, %eax
	jne	LBB0_25
## %bb.26:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_MXS_I2C_STAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	movq	_MXS_I2C_STAT_GOT_A_NAK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_30
## %bb.27:                              ##   in Loop: Header=BB0_16 Depth=1
	notl	%ebx
	andl	%ebx, %r15d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	4(%r13), %r8d
	movq	_MXS_I2C_CTRL0_RETAIN_CLOCK@GOTPCREL(%rip), %r9
	leaq	L_.str.4(%rip), %r11
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_28:                                ##   in Loop: Header=BB0_16 Depth=1
	movslq	%r8d, %rax
	cmpq	%rax, %rbx
	jge	LBB0_9
## %bb.29:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	(%r9), %edx
	movq	%rbx, %rax
	jmp	LBB0_16
LBB0_4:
	movq	_MXS_CMD_I2C_READ@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	orl	(%rax), %r15d
	movl	4(%r13), %edi
	callq	_MXS_I2C_CTRL0_XFER_COUNT
	orl	%eax, %r15d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_mxs_i2c_pio_trigger_cmd
	movq	%r14, %rdi
	callq	_mxs_i2c_pio_wait_xfer_end
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	movl	16(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_3:
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_11
LBB0_6:
	movq	8(%r14), %r15
	movq	%r14, %rdi
	callq	_MXS_I2C_DATA
	addq	%rax, %r15
	movq	%r15, %rdi
	callq	_readl
	cmpl	$0, 4(%r13)
	jle	LBB0_9
## %bb.7:
	movq	8(%r13), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	%al, %esi
	movl	%esi, (%rcx,%rdx,4)
	sarl	$8, %eax
	incq	%rdx
	movslq	4(%r13), %rsi
	cmpq	%rsi, %rdx
	jl	LBB0_8
	jmp	LBB0_9
LBB0_25:
	movl	16(%r14), %edi
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_9:
	movq	%r14, %rdi
	callq	_mxs_i2c_pio_check_error_state
	movl	%eax, %r15d
LBB0_10:
	movq	_MXS_I2C_IRQ_MASK@GOTPCREL(%rip), %rbx
LBB0_11:
	movq	_MXS_I2C_CTRL1_CLR@GOTPCREL(%rip), %rax
	movl	(%rbx), %edi
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_writel
	movl	(%rbx), %edi
	shll	$8, %edi
	movq	_MXS_I2C_CTRL1_SET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_writel
	movq	(%r14), %rax
	movq	_MXS_I2C_V1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:
	movq	_MXS_I2C_CTRL0_PIO_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MXS_I2C_CTRL0_CLR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	callq	_writel
LBB0_13:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_MXS_I2C_IRQ_MASK,4,2           ## @MXS_I2C_IRQ_MASK
	.comm	_MXS_I2C_CTRL1_CLR,8,3          ## @MXS_I2C_CTRL1_CLR
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_MXS_CMD_I2C_SELECT,4,2         ## @MXS_CMD_I2C_SELECT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PIO: Failed to send SELECT command!\n"

	.comm	_MXS_CMD_I2C_READ,4,2           ## @MXS_CMD_I2C_READ
L_.str.1:                               ## @.str.1
	.asciz	"PIO: Failed to send READ command!\n"

	.comm	_MXS_I2C_CTRL0_PRE_SEND_START,4,2 ## @MXS_I2C_CTRL0_PRE_SEND_START
	.comm	_MXS_I2C_CTRL0_RETAIN_CLOCK,4,2 ## @MXS_I2C_CTRL0_RETAIN_CLOCK
L_.str.2:                               ## @.str.2
	.asciz	"PIO: len=%i pos=%i total=%i [W%s%s%s]\n"

L_.str.3:                               ## @.str.3
	.asciz	"S"

L_.str.4:                               ## @.str.4
	.space	1

	.comm	_MXS_I2C_CTRL0_POST_SEND_STOP,4,2 ## @MXS_I2C_CTRL0_POST_SEND_STOP
L_.str.5:                               ## @.str.5
	.asciz	"E"

L_.str.6:                               ## @.str.6
	.asciz	"C"

	.comm	_MXS_I2C_DEBUG0_DMAREQ,4,2      ## @MXS_I2C_DEBUG0_DMAREQ
	.comm	_MXS_I2C_CTRL0_MASTER_MODE,4,2  ## @MXS_I2C_CTRL0_MASTER_MODE
	.comm	_MXS_I2C_CTRL0_DIRECTION,4,2    ## @MXS_I2C_CTRL0_DIRECTION
L_.str.7:                               ## @.str.7
	.asciz	"PIO: Failed to finish WRITE cmd!\n"

	.comm	_MXS_I2C_STAT,8,3               ## @MXS_I2C_STAT
	.comm	_MXS_I2C_STAT_GOT_A_NAK,4,2     ## @MXS_I2C_STAT_GOT_A_NAK
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_MXS_I2C_CTRL1_SET,8,3          ## @MXS_I2C_CTRL1_SET
	.comm	_MXS_I2C_V1,8,3                 ## @MXS_I2C_V1
	.comm	_MXS_I2C_CTRL0_PIO_MODE,4,2     ## @MXS_I2C_CTRL0_PIO_MODE
	.comm	_MXS_I2C_CTRL0_CLR,8,3          ## @MXS_I2C_CTRL0_CLR
	.no_dead_strip	_mxs_i2c_pio_setup_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxs_i2c_pio_setup_xfer
_mxs_i2c_pio_setup_xfer:                ; @mxs_i2c_pio_setup_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x2
	mov	x27, x1
	bl	_i2c_get_adapdata
	mov	x19, x0
	mov	x0, x27
	bl	_i2c_8bit_addr_from_msg
	mov	x22, x0
Lloh0:
	adrp	x23, _MXS_I2C_IRQ_MASK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MXS_I2C_IRQ_MASK@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w0, w8, #8
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x24, _MXS_I2C_CTRL1_CLR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _MXS_I2C_CTRL1_CLR@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x1, x9, x8
	bl	_writel
Lloh4:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh5:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x8]
	ldp	w10, w8, [x27]
	tst	w9, w10
	str	x19, [sp, #56]                  ; 8-byte Folded Spill
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #4
	cset	w0, gt
	bl	_BUG_ON
Lloh7:
	adrp	x8, _MXS_CMD_I2C_SELECT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MXS_CMD_I2C_SELECT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_mxs_i2c_pio_trigger_write_cmd
	mov	x0, x19
	bl	_mxs_i2c_pio_wait_xfer_end
	cbz	w0, LBB0_12
; %bb.2:
	mov	x22, x0
	ldr	w0, [x19, #16]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_14
LBB0_3:
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.4:
	mov	x28, #0
Lloh12:
	adrp	x21, _MXS_I2C_CTRL0_RETAIN_CLOCK@GOTPAGE
Lloh13:
	ldr	x21, [x21, _MXS_I2C_CTRL0_RETAIN_CLOCK@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w8, #3
	csel	w10, w9, wzr, hi
Lloh14:
	adrp	x11, _MXS_I2C_CTRL0_PRE_SEND_START@GOTPAGE
Lloh15:
	ldr	x11, [x11, _MXS_I2C_CTRL0_PRE_SEND_START@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	orr	w23, w10, w11
	lsl	w22, w22, #24
	str	w25, [sp, #52]                  ; 4-byte Folded Spill
	ldr	x20, [sp, #56]                  ; 8-byte Folded Reload
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x27, #8]
	ldr	w10, [x10, x28, lsl #2]
	lsl	w10, w10, #24
	orr	w22, w10, w22, asr #8
	add	x26, x28, #1
	mov	w10, w8
	orr	w11, w23, w25
	bic	w11, w11, w9
	cmp	x26, x10
	csel	w23, w11, w23, eq
	and	w11, w28, #0x3
	cmp	w11, #2
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x26, x10
	b.ne	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x19, x27
	add	w10, w11, #2
	cmp	w11, #3
	csinc	w24, w10, wzr, ne
	lsl	w10, w24, #3
	neg	w10, w10
	asr	w22, w22, w10
	ldr	w0, [x20, #16]
Lloh17:
	adrp	x10, _MXS_I2C_CTRL0_PRE_SEND_START@GOTPAGE
Lloh18:
	ldr	x10, [x10, _MXS_I2C_CTRL0_PRE_SEND_START@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	tst	w10, w23
Lloh20:
	adrp	x10, l_.str.3@PAGE
Lloh21:
	add	x10, x10, l_.str.3@PAGEOFF
Lloh22:
	adrp	x12, l_.str.4@PAGE
Lloh23:
	add	x12, x12, l_.str.4@PAGEOFF
	csel	x10, x12, x10, eq
Lloh24:
	adrp	x11, _MXS_I2C_CTRL0_POST_SEND_STOP@GOTPAGE
Lloh25:
	ldr	x11, [x11, _MXS_I2C_CTRL0_POST_SEND_STOP@GOTPAGEOFF]
Lloh26:
	ldr	w11, [x11]
	tst	w11, w23
Lloh27:
	adrp	x11, l_.str.5@PAGE
Lloh28:
	add	x11, x11, l_.str.5@PAGEOFF
	csel	x11, x12, x11, eq
	tst	w23, w9
Lloh29:
	adrp	x9, l_.str.6@PAGE
Lloh30:
	add	x9, x9, l_.str.6@PAGEOFF
	csel	x9, x12, x9, eq
	stp	x11, x9, [sp, #32]
	stp	x8, x10, [sp, #16]
	stp	x24, x28, [sp]
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh33:
	adrp	x8, _MXS_I2C_DEBUG0_DMAREQ@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MXS_I2C_DEBUG0_DMAREQ@GOTPAGEOFF]
Lloh35:
	ldr	w25, [x8]
	ldr	x27, [x20, #8]
	mov	x0, x20
	bl	_MXS_I2C_DEBUG0_CLR
	add	x1, x0, x27
	mov	x0, x25
	bl	_writel
Lloh36:
	adrp	x8, _MXS_I2C_CTRL0_MASTER_MODE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MXS_I2C_CTRL0_MASTER_MODE@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	orr	w8, w8, w23
Lloh39:
	adrp	x9, _MXS_I2C_CTRL0_DIRECTION@GOTPAGE
Lloh40:
	ldr	x9, [x9, _MXS_I2C_CTRL0_DIRECTION@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w25, w8, w9
	mov	x0, x24
	bl	_MXS_I2C_CTRL0_XFER_COUNT
	orr	w1, w25, w0
	mov	x0, x20
	mov	x2, x22
	bl	_mxs_i2c_pio_trigger_write_cmd
Lloh42:
	adrp	x8, _MXS_I2C_CTRL0_PRE_SEND_START@GOTPAGE
Lloh43:
	ldr	x8, [x8, _MXS_I2C_CTRL0_PRE_SEND_START@GOTPAGEOFF]
Lloh44:
	ldr	w24, [x8]
	mov	x0, x20
	bl	_mxs_i2c_pio_wait_xfer_end
	cbnz	w0, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #8]
Lloh45:
	adrp	x9, _MXS_I2C_STAT@GOTPAGE
Lloh46:
	ldr	x9, [x9, _MXS_I2C_STAT@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh48:
	adrp	x8, _MXS_I2C_STAT_GOT_A_NAK@GOTPAGE
Lloh49:
	ldr	x8, [x8, _MXS_I2C_STAT_GOT_A_NAK@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_23
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	bic	w23, w23, w24
	mov	x27, x19
	ldr	w8, [x19, #4]
	ldr	w25, [sp, #52]                  ; 4-byte Folded Reload
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x26, w8, sxtw
	b.ge	LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x21]
	add	x28, x28, #1
	b	LBB0_5
LBB0_12:
Lloh51:
	adrp	x8, _MXS_CMD_I2C_READ@GOTPAGE
Lloh52:
	ldr	x8, [x8, _MXS_CMD_I2C_READ@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
	orr	w21, w8, w25
	ldr	w0, [x27, #4]
	bl	_MXS_I2C_CTRL0_XFER_COUNT
	orr	w1, w21, w0
	mov	x0, x19
	bl	_mxs_i2c_pio_trigger_cmd
	mov	x0, x19
	bl	_mxs_i2c_pio_wait_xfer_end
	cbz	w0, LBB0_15
; %bb.13:
	mov	x22, x0
	ldr	w0, [x19, #16]
Lloh54:
	adrp	x1, l_.str.1@PAGE
Lloh55:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_14:
	bl	_dev_dbg
	b	LBB0_20
LBB0_15:
	ldr	x21, [x19, #8]
	mov	x0, x19
	bl	_MXS_I2C_DATA
	add	x0, x0, x21
	bl	_readl
	ldr	w8, [x27, #4]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.16:
	mov	x8, #0
	ldr	x9, [x27, #8]
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	and	w10, w0, #0xff
	str	w10, [x9, x8, lsl #2]
	asr	w0, w0, #8
	add	x8, x8, #1
	ldrsw	x10, [x27, #4]
	cmp	x8, x10
	b.lt	LBB0_17
	b	LBB0_19
LBB0_18:
	ldr	w0, [x20, #16]
Lloh56:
	adrp	x1, l_.str.7@PAGE
Lloh57:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_dev_dbg
LBB0_19:
	ldr	x19, [sp, #56]                  ; 8-byte Folded Reload
	mov	x0, x19
	bl	_mxs_i2c_pio_check_error_state
	mov	x22, x0
Lloh58:
	adrp	x23, _MXS_I2C_IRQ_MASK@GOTPAGE
Lloh59:
	ldr	x23, [x23, _MXS_I2C_IRQ_MASK@GOTPAGEOFF]
Lloh60:
	adrp	x24, _MXS_I2C_CTRL1_CLR@GOTPAGE
Lloh61:
	ldr	x24, [x24, _MXS_I2C_CTRL1_CLR@GOTPAGEOFF]
LBB0_20:
	ldr	w0, [x23]
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x23]
	lsl	w0, w8, #8
	ldr	x8, [x19, #8]
Lloh62:
	adrp	x9, _MXS_I2C_CTRL1_SET@GOTPAGE
Lloh63:
	ldr	x9, [x9, _MXS_I2C_CTRL1_SET@GOTPAGEOFF]
Lloh64:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19]
Lloh65:
	adrp	x9, _MXS_I2C_V1@GOTPAGE
Lloh66:
	ldr	x9, [x9, _MXS_I2C_V1@GOTPAGEOFF]
Lloh67:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_22
; %bb.21:
Lloh68:
	adrp	x8, _MXS_I2C_CTRL0_PIO_MODE@GOTPAGE
Lloh69:
	ldr	x8, [x8, _MXS_I2C_CTRL0_PIO_MODE@GOTPAGEOFF]
Lloh70:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
Lloh71:
	adrp	x9, _MXS_I2C_CTRL0_CLR@GOTPAGE
Lloh72:
	ldr	x9, [x9, _MXS_I2C_CTRL0_CLR@GOTPAGEOFF]
Lloh73:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
LBB0_22:
	mov	x0, x22
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_23:
Lloh74:
	adrp	x8, _ENXIO@GOTPAGE
Lloh75:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh76:
	ldr	w8, [x8]
	neg	w22, w8
Lloh77:
	adrp	x23, _MXS_I2C_IRQ_MASK@GOTPAGE
Lloh78:
	ldr	x23, [x23, _MXS_I2C_IRQ_MASK@GOTPAGEOFF]
Lloh79:
	adrp	x24, _MXS_I2C_CTRL1_CLR@GOTPAGE
Lloh80:
	ldr	x24, [x24, _MXS_I2C_CTRL1_CLR@GOTPAGEOFF]
	ldr	x19, [sp, #56]                  ; 8-byte Folded Reload
	b	LBB0_20
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGot	Lloh60, Lloh61
	.loh AdrpLdrGot	Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh71, Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGot	Lloh79, Lloh80
	.loh AdrpLdrGot	Lloh77, Lloh78
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.cfi_endproc
                                        ; -- End function
	.comm	_MXS_I2C_IRQ_MASK,4,2           ; @MXS_I2C_IRQ_MASK
	.comm	_MXS_I2C_CTRL1_CLR,8,3          ; @MXS_I2C_CTRL1_CLR
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_MXS_CMD_I2C_SELECT,4,2         ; @MXS_CMD_I2C_SELECT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PIO: Failed to send SELECT command!\n"

	.comm	_MXS_CMD_I2C_READ,4,2           ; @MXS_CMD_I2C_READ
l_.str.1:                               ; @.str.1
	.asciz	"PIO: Failed to send READ command!\n"

	.comm	_MXS_I2C_CTRL0_PRE_SEND_START,4,2 ; @MXS_I2C_CTRL0_PRE_SEND_START
	.comm	_MXS_I2C_CTRL0_RETAIN_CLOCK,4,2 ; @MXS_I2C_CTRL0_RETAIN_CLOCK
l_.str.2:                               ; @.str.2
	.asciz	"PIO: len=%i pos=%i total=%i [W%s%s%s]\n"

l_.str.3:                               ; @.str.3
	.asciz	"S"

l_.str.4:                               ; @.str.4
	.space	1

	.comm	_MXS_I2C_CTRL0_POST_SEND_STOP,4,2 ; @MXS_I2C_CTRL0_POST_SEND_STOP
l_.str.5:                               ; @.str.5
	.asciz	"E"

l_.str.6:                               ; @.str.6
	.asciz	"C"

	.comm	_MXS_I2C_DEBUG0_DMAREQ,4,2      ; @MXS_I2C_DEBUG0_DMAREQ
	.comm	_MXS_I2C_CTRL0_MASTER_MODE,4,2  ; @MXS_I2C_CTRL0_MASTER_MODE
	.comm	_MXS_I2C_CTRL0_DIRECTION,4,2    ; @MXS_I2C_CTRL0_DIRECTION
l_.str.7:                               ; @.str.7
	.asciz	"PIO: Failed to finish WRITE cmd!\n"

	.comm	_MXS_I2C_STAT,8,3               ; @MXS_I2C_STAT
	.comm	_MXS_I2C_STAT_GOT_A_NAK,4,2     ; @MXS_I2C_STAT_GOT_A_NAK
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_MXS_I2C_CTRL1_SET,8,3          ; @MXS_I2C_CTRL1_SET
	.comm	_MXS_I2C_V1,8,3                 ; @MXS_I2C_V1
	.comm	_MXS_I2C_CTRL0_PIO_MODE,4,2     ; @MXS_I2C_CTRL0_PIO_MODE
	.comm	_MXS_I2C_CTRL0_CLR,8,3          ; @MXS_I2C_CTRL0_CLR
	.no_dead_strip	_mxs_i2c_pio_setup_xfer
.subsections_via_symbols
