	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_do_twi_transfer
_at91_do_twi_transfer:                  ## @at91_do_twi_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	%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
	movq	%rdi, %r15
	movq	64(%rdi), %rax
	movl	(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	4(%rax), %r12d
	movl	(%rdi), %ecx
	movl	8(%rdi), %edi
	movq	48(%r15), %rax
	movq	_I2C_M_RD@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	andl	(%rax), %edx
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	leaq	36(%r15), %rbx
	movq	%rbx, %rdi
	callq	_reinit_completion
	movl	$0, 4(%r15)
	movq	_AT91_TWI_SR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_at91_twi_read
	cmpq	$0, 16(%r15)
	je	LBB0_2
## %bb.1:
	movq	_AT91_TWI_FMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_at91_twi_read
	movq	_AT91_TWI_FMR_TXRDYM_MASK@GOTPCREL(%rip), %rcx
	movq	_AT91_TWI_FMR_RXRDYM_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r13d
	orl	(%rcx), %r13d
	notl	%r13d
	andl	%eax, %r13d
	movq	_AT91_TWI_ONE_DATA@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_AT91_TWI_FMR_TXRDYM
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %ebx
	movl	(%r14), %edi
	movq	_AT91_TWI_SR@GOTPCREL(%rip), %r14
	callq	_AT91_TWI_FMR_RXRDYM
	orl	%eax, %ebx
	orl	%r13d, %ebx
	movq	_I2C_M_RD@GOTPCREL(%rip), %r13
	movq	_AT91_TWI_FMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	callq	_at91_twi_write
	movq	_AT91_TWI_CR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_TWI_THRCLR@GOTPCREL(%rip), %rax
	movq	_AT91_TWI_RHRCLR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_at91_twi_write
LBB0_2:
	movl	(%r15), %eax
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	48(%r15), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r13)
	je	LBB0_13
## %bb.5:
	movq	_AT91_TWI_START@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	$0, 56(%r15)
	jne	LBB0_9
## %bb.6:
	cmpl	$1, %eax
	jg	LBB0_9
## %bb.7:
	movq	_I2C_M_RECV_LEN@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	jne	LBB0_9
## %bb.8:
	movq	_AT91_TWI_STOP@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
LBB0_9:
	movq	_AT91_TWI_CR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_at91_twi_write
	cmpq	$0, 40(%r15)
	je	LBB0_12
## %bb.10:
	movl	(%r15), %eax
	movq	_AT91_I2C_DMA_THRESHOLD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_12
## %bb.11:
	movq	_AT91_TWI_IER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_TWI_NACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_at91_twi_write
	movq	%r15, %rdi
	callq	_at91_twi_read_data_dma
	jmp	LBB0_20
LBB0_3:
	movq	_AT91_TWI_CR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_TWI_QUICK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_at91_twi_write
	movq	_AT91_TWI_IER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_TWI_TXCOMP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	jmp	LBB0_19
LBB0_12:
	movq	_AT91_TWI_IER@GOTPCREL(%rip), %rax
	movq	_AT91_TWI_TXCOMP@GOTPCREL(%rip), %rcx
	movq	_AT91_TWI_NACK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_AT91_TWI_RXRDY@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	jmp	LBB0_19
LBB0_13:
	cmpq	$0, 40(%r15)
	je	LBB0_16
## %bb.14:
	movq	_AT91_I2C_DMA_THRESHOLD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_16
## %bb.15:
	movq	_AT91_TWI_IER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_TWI_NACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_at91_twi_write
	movq	%r15, %rdi
	callq	_at91_twi_write_data_dma
	jmp	LBB0_20
LBB0_16:
	movq	%r15, %rdi
	callq	_at91_twi_write_next_byte
	movq	_AT91_TWI_IER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_TWI_TXCOMP@GOTPCREL(%rip), %rax
	movq	_AT91_TWI_NACK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	(%r15), %eax
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movq	_AT91_TWI_TXRDY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_18:
	orl	%eax, %edx
LBB0_19:
	movq	%r15, %rdi
	callq	_at91_twi_write
LBB0_20:
	movl	32(%r15), %esi
	movq	%rbx, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_21
## %bb.22:
	movl	4(%r15), %eax
	movq	_AT91_TWI_NACK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_24
## %bb.23:
	movl	8(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	jmp	LBB0_36
LBB0_21:
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_at91_twi_read
	orl	%eax, 4(%r15)
	movl	8(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movq	%r15, %rdi
	callq	_at91_init_twi_bus
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_36
LBB0_24:
	movq	_AT91_TWI_OVRE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_27
## %bb.25:
	movl	8(%r15), %edi
	leaq	L_.str.5(%rip), %rsi
LBB0_26:
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_36:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movq	%r15, %rdi
	callq	_at91_twi_dma_cleanup
	testl	%r12d, %r12d
	jne	LBB0_38
## %bb.37:
	cmpq	$0, 16(%r15)
	je	LBB0_40
LBB0_38:
	movq	_AT91_TWI_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r15)
	je	LBB0_40
## %bb.39:
	movl	8(%r15), %edi
	leaq	L_.str.10(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_AT91_TWI_CR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_TWI_THRCLR@GOTPCREL(%rip), %rax
	movq	_AT91_TWI_LOCKCLR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_at91_twi_write
LBB0_40:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_30
## %bb.28:
	movq	_AT91_TWI_UNRE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_30
## %bb.29:
	movl	8(%r15), %edi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_26
LBB0_30:
	testl	%r12d, %r12d
	jne	LBB0_32
## %bb.31:
	cmpq	$0, 16(%r15)
	je	LBB0_34
LBB0_32:
	movq	_AT91_TWI_LOCK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_34
## %bb.33:
	movl	8(%r15), %edi
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_26
LBB0_34:
	cmpq	$0, 24(%r15)
	movl	8(%r15), %edi
	je	LBB0_41
## %bb.35:
	leaq	L_.str.8(%rip), %rsi
	callq	_dev_err
	movq	_EPROTO@GOTPCREL(%rip), %rax
	jmp	LBB0_36
LBB0_41:
	leaq	L_.str.9(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_40
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"transfer: %s %zu bytes.\n"

	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
L_.str.1:                               ## @.str.1
	.asciz	"read"

L_.str.2:                               ## @.str.2
	.asciz	"write"

	.comm	_AT91_TWI_SR,4,2                ## @AT91_TWI_SR
	.comm	_AT91_TWI_FMR,4,2               ## @AT91_TWI_FMR
	.comm	_AT91_TWI_FMR_TXRDYM_MASK,4,2   ## @AT91_TWI_FMR_TXRDYM_MASK
	.comm	_AT91_TWI_FMR_RXRDYM_MASK,4,2   ## @AT91_TWI_FMR_RXRDYM_MASK
	.comm	_AT91_TWI_ONE_DATA,4,2          ## @AT91_TWI_ONE_DATA
	.comm	_AT91_TWI_CR,4,2                ## @AT91_TWI_CR
	.comm	_AT91_TWI_THRCLR,4,2            ## @AT91_TWI_THRCLR
	.comm	_AT91_TWI_RHRCLR,4,2            ## @AT91_TWI_RHRCLR
	.comm	_AT91_TWI_QUICK,4,2             ## @AT91_TWI_QUICK
	.comm	_AT91_TWI_IER,4,2               ## @AT91_TWI_IER
	.comm	_AT91_TWI_TXCOMP,4,2            ## @AT91_TWI_TXCOMP
	.comm	_AT91_TWI_START,4,2             ## @AT91_TWI_START
	.comm	_I2C_M_RECV_LEN,4,2             ## @I2C_M_RECV_LEN
	.comm	_AT91_TWI_STOP,4,2              ## @AT91_TWI_STOP
	.comm	_AT91_I2C_DMA_THRESHOLD,4,2     ## @AT91_I2C_DMA_THRESHOLD
	.comm	_AT91_TWI_NACK,4,2              ## @AT91_TWI_NACK
	.comm	_AT91_TWI_RXRDY,4,2             ## @AT91_TWI_RXRDY
	.comm	_AT91_TWI_TXRDY,4,2             ## @AT91_TWI_TXRDY
L_.str.3:                               ## @.str.3
	.asciz	"controller timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.4:                               ## @.str.4
	.asciz	"received nack\n"

	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.comm	_AT91_TWI_OVRE,4,2              ## @AT91_TWI_OVRE
L_.str.5:                               ## @.str.5
	.asciz	"overrun while reading\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_AT91_TWI_UNRE,4,2              ## @AT91_TWI_UNRE
L_.str.6:                               ## @.str.6
	.asciz	"underrun while writing\n"

	.comm	_AT91_TWI_LOCK,4,2              ## @AT91_TWI_LOCK
L_.str.7:                               ## @.str.7
	.asciz	"tx locked\n"

L_.str.8:                               ## @.str.8
	.asciz	"invalid smbus block length recvd\n"

	.comm	_EPROTO,4,2                     ## @EPROTO
L_.str.9:                               ## @.str.9
	.asciz	"transfer complete\n"

L_.str.10:                              ## @.str.10
	.asciz	"unlock tx\n"

	.comm	_AT91_TWI_LOCKCLR,4,2           ## @AT91_TWI_LOCKCLR
	.no_dead_strip	_at91_do_twi_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_do_twi_transfer
_at91_do_twi_transfer:                  ; @at91_do_twi_transfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x0
	ldr	x8, [x0, #64]
	ldp	w9, w21, [x8]
	str	w9, [sp, #28]                   ; 4-byte Folded Spill
	ldr	w0, [x0, #8]
	ldr	x8, [x19, #48]
	ldr	w8, [x8]
Lloh0:
	adrp	x26, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x26, [x26, _I2C_M_RD@GOTPAGEOFF]
Lloh2:
	adrp	x9, l_.str.1@PAGE
Lloh3:
	add	x9, x9, l_.str.1@PAGEOFF
	ldr	w10, [x26]
Lloh4:
	adrp	x11, l_.str.2@PAGE
Lloh5:
	add	x11, x11, l_.str.2@PAGEOFF
	tst	w10, w8
	csel	x8, x11, x9, eq
	ldr	w9, [x19]
	stp	x8, x9, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	add	x20, x19, #36
	mov	x0, x20
	bl	_reinit_completion
	str	wzr, [x19, #4]
Lloh8:
	adrp	x25, _AT91_TWI_SR@GOTPAGE
Lloh9:
	ldr	x25, [x25, _AT91_TWI_SR@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_at91_twi_read
	ldr	x8, [x19, #16]
Lloh10:
	adrp	x22, _AT91_TWI_CR@GOTPAGE
Lloh11:
	ldr	x22, [x22, _AT91_TWI_CR@GOTPAGEOFF]
Lloh12:
	adrp	x24, _AT91_TWI_THRCLR@GOTPAGE
Lloh13:
	ldr	x24, [x24, _AT91_TWI_THRCLR@GOTPAGEOFF]
	cbz	x8, LBB0_2
; %bb.1:
Lloh14:
	adrp	x27, _AT91_TWI_FMR@GOTPAGE
Lloh15:
	ldr	x27, [x27, _AT91_TWI_FMR@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x19
	bl	_at91_twi_read
Lloh16:
	adrp	x8, _AT91_TWI_FMR_TXRDYM_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AT91_TWI_FMR_TXRDYM_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _AT91_TWI_FMR_RXRDYM_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _AT91_TWI_FMR_RXRDYM_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w28, w0, w8
Lloh22:
	adrp	x23, _AT91_TWI_ONE_DATA@GOTPAGE
Lloh23:
	ldr	x23, [x23, _AT91_TWI_ONE_DATA@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_AT91_TWI_FMR_TXRDYM
	orr	w28, w28, w0
	ldr	w0, [x23]
	bl	_AT91_TWI_FMR_RXRDYM
	orr	w2, w28, w0
	ldr	w1, [x27]
	mov	x0, x19
	bl	_at91_twi_write
	ldr	w1, [x22]
	ldr	w8, [x24]
Lloh24:
	adrp	x9, _AT91_TWI_RHRCLR@GOTPAGE
Lloh25:
	ldr	x9, [x9, _AT91_TWI_RHRCLR@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_at91_twi_write
LBB0_2:
	ldr	w8, [x19]
	cbz	w8, LBB0_11
; %bb.3:
	ldr	x9, [x19, #48]
	ldr	w9, [x9]
	ldr	w10, [x26]
	tst	w10, w9
	b.eq	LBB0_13
; %bb.4:
Lloh27:
	adrp	x10, _AT91_TWI_START@GOTPAGE
Lloh28:
	ldr	x10, [x10, _AT91_TWI_START@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x10]
	ldr	w10, [x19, #56]
	cbnz	w10, LBB0_8
; %bb.5:
	cmp	w8, #1
	b.gt	LBB0_8
; %bb.6:
Lloh30:
	adrp	x8, _I2C_M_RECV_LEN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _I2C_M_RECV_LEN@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	tst	w8, w9
	b.ne	LBB0_8
; %bb.7:
Lloh33:
	adrp	x8, _AT91_TWI_STOP@GOTPAGE
Lloh34:
	ldr	x8, [x8, _AT91_TWI_STOP@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	orr	w2, w8, w2
LBB0_8:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_at91_twi_write
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_12
; %bb.9:
	ldr	w8, [x19]
Lloh36:
	adrp	x9, _AT91_I2C_DMA_THRESHOLD@GOTPAGE
Lloh37:
	ldr	x9, [x9, _AT91_I2C_DMA_THRESHOLD@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_12
; %bb.10:
Lloh39:
	adrp	x8, _AT91_TWI_IER@GOTPAGE
Lloh40:
	ldr	x8, [x8, _AT91_TWI_IER@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
Lloh42:
	adrp	x8, _AT91_TWI_NACK@GOTPAGE
Lloh43:
	ldr	x8, [x8, _AT91_TWI_NACK@GOTPAGEOFF]
Lloh44:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_at91_twi_write
	mov	x0, x19
	bl	_at91_twi_read_data_dma
	b	LBB0_19
LBB0_11:
	ldr	w1, [x22]
Lloh45:
	adrp	x8, _AT91_TWI_QUICK@GOTPAGE
Lloh46:
	ldr	x8, [x8, _AT91_TWI_QUICK@GOTPAGEOFF]
Lloh47:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_at91_twi_write
Lloh48:
	adrp	x8, _AT91_TWI_IER@GOTPAGE
Lloh49:
	ldr	x8, [x8, _AT91_TWI_IER@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
Lloh51:
	adrp	x8, _AT91_TWI_TXCOMP@GOTPAGE
Lloh52:
	ldr	x8, [x8, _AT91_TWI_TXCOMP@GOTPAGEOFF]
Lloh53:
	ldr	w2, [x8]
	b	LBB0_18
LBB0_12:
Lloh54:
	adrp	x8, _AT91_TWI_IER@GOTPAGE
Lloh55:
	ldr	x8, [x8, _AT91_TWI_IER@GOTPAGEOFF]
Lloh56:
	ldr	w1, [x8]
Lloh57:
	adrp	x8, _AT91_TWI_TXCOMP@GOTPAGE
Lloh58:
	ldr	x8, [x8, _AT91_TWI_TXCOMP@GOTPAGEOFF]
Lloh59:
	ldr	w8, [x8]
Lloh60:
	adrp	x9, _AT91_TWI_NACK@GOTPAGE
Lloh61:
	ldr	x9, [x9, _AT91_TWI_NACK@GOTPAGEOFF]
Lloh62:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh63:
	adrp	x9, _AT91_TWI_RXRDY@GOTPAGE
Lloh64:
	ldr	x9, [x9, _AT91_TWI_RXRDY@GOTPAGEOFF]
Lloh65:
	ldr	w9, [x9]
	b	LBB0_17
LBB0_13:
	ldr	x9, [x19, #40]
	cbz	x9, LBB0_16
; %bb.14:
Lloh66:
	adrp	x9, _AT91_I2C_DMA_THRESHOLD@GOTPAGE
Lloh67:
	ldr	x9, [x9, _AT91_I2C_DMA_THRESHOLD@GOTPAGEOFF]
Lloh68:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_16
; %bb.15:
Lloh69:
	adrp	x8, _AT91_TWI_IER@GOTPAGE
Lloh70:
	ldr	x8, [x8, _AT91_TWI_IER@GOTPAGEOFF]
Lloh71:
	ldr	w1, [x8]
Lloh72:
	adrp	x8, _AT91_TWI_NACK@GOTPAGE
Lloh73:
	ldr	x8, [x8, _AT91_TWI_NACK@GOTPAGEOFF]
Lloh74:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_at91_twi_write
	mov	x0, x19
	bl	_at91_twi_write_data_dma
	b	LBB0_19
LBB0_16:
	mov	x0, x19
	bl	_at91_twi_write_next_byte
Lloh75:
	adrp	x8, _AT91_TWI_IER@GOTPAGE
Lloh76:
	ldr	x8, [x8, _AT91_TWI_IER@GOTPAGEOFF]
Lloh77:
	ldr	w1, [x8]
Lloh78:
	adrp	x8, _AT91_TWI_TXCOMP@GOTPAGE
Lloh79:
	ldr	x8, [x8, _AT91_TWI_TXCOMP@GOTPAGEOFF]
Lloh80:
	ldr	w8, [x8]
Lloh81:
	adrp	x9, _AT91_TWI_NACK@GOTPAGE
Lloh82:
	ldr	x9, [x9, _AT91_TWI_NACK@GOTPAGEOFF]
Lloh83:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19]
Lloh84:
	adrp	x10, _AT91_TWI_TXRDY@GOTPAGE
Lloh85:
	ldr	x10, [x10, _AT91_TWI_TXRDY@GOTPAGEOFF]
Lloh86:
	ldr	w10, [x10]
	cmp	w9, #0
	csel	w9, wzr, w10, eq
LBB0_17:
	orr	w2, w8, w9
LBB0_18:
	mov	x0, x19
	bl	_at91_twi_write
LBB0_19:
	ldr	w1, [x19, #32]
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_22
; %bb.20:
	ldr	w8, [x19, #4]
Lloh87:
	adrp	x9, _AT91_TWI_NACK@GOTPAGE
Lloh88:
	ldr	x9, [x9, _AT91_TWI_NACK@GOTPAGEOFF]
Lloh89:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_23
; %bb.21:
	ldr	w0, [x19, #8]
Lloh90:
	adrp	x1, l_.str.4@PAGE
Lloh91:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
Lloh92:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh93:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
	b	LBB0_26
LBB0_22:
	ldr	w1, [x25]
	mov	x0, x19
	bl	_at91_twi_read
	ldp	w9, w8, [x19, #4]
	orr	w9, w9, w0
	str	w9, [x19, #4]
Lloh94:
	adrp	x1, l_.str.3@PAGE
Lloh95:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x8
	bl	_dev_err
	mov	x0, x19
	bl	_at91_init_twi_bus
Lloh96:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh97:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_26
LBB0_23:
Lloh98:
	adrp	x9, _AT91_TWI_OVRE@GOTPAGE
Lloh99:
	ldr	x9, [x9, _AT91_TWI_OVRE@GOTPAGEOFF]
Lloh100:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_31
; %bb.24:
	ldr	w0, [x19, #8]
Lloh101:
	adrp	x1, l_.str.5@PAGE
Lloh102:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_25:
	bl	_dev_err
Lloh103:
	adrp	x8, _EIO@GOTPAGE
Lloh104:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_26:
	ldr	w8, [x8]
	neg	w20, w8
	mov	x0, x19
	bl	_at91_twi_dma_cleanup
	cbnz	w21, LBB0_28
; %bb.27:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_30
LBB0_28:
	ldr	w8, [x19, #4]
Lloh105:
	adrp	x9, _AT91_TWI_LOCK@GOTPAGE
Lloh106:
	ldr	x9, [x9, _AT91_TWI_LOCK@GOTPAGEOFF]
Lloh107:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_30
; %bb.29:
	ldr	w0, [x19, #8]
Lloh108:
	adrp	x1, l_.str.10@PAGE
Lloh109:
	add	x1, x1, l_.str.10@PAGEOFF
	bl	_dev_dbg
	ldr	w1, [x22]
	ldr	w8, [x24]
Lloh110:
	adrp	x9, _AT91_TWI_LOCKCLR@GOTPAGE
Lloh111:
	ldr	x9, [x9, _AT91_TWI_LOCKCLR@GOTPAGEOFF]
Lloh112:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_at91_twi_write
LBB0_30:
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_31:
	ldr	w9, [sp, #28]                   ; 4-byte Folded Reload
	cbz	w9, LBB0_34
; %bb.32:
Lloh113:
	adrp	x9, _AT91_TWI_UNRE@GOTPAGE
Lloh114:
	ldr	x9, [x9, _AT91_TWI_UNRE@GOTPAGEOFF]
Lloh115:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_34
; %bb.33:
	ldr	w0, [x19, #8]
Lloh116:
	adrp	x1, l_.str.6@PAGE
Lloh117:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_25
LBB0_34:
	cbnz	w21, LBB0_36
; %bb.35:
	ldr	x9, [x19, #16]
	cbz	x9, LBB0_38
LBB0_36:
Lloh118:
	adrp	x9, _AT91_TWI_LOCK@GOTPAGE
Lloh119:
	ldr	x9, [x9, _AT91_TWI_LOCK@GOTPAGEOFF]
Lloh120:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_38
; %bb.37:
	ldr	w0, [x19, #8]
Lloh121:
	adrp	x1, l_.str.7@PAGE
Lloh122:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_25
LBB0_38:
	ldr	x8, [x19, #24]
	ldr	w0, [x19, #8]
	cbz	x8, LBB0_40
; %bb.39:
Lloh123:
	adrp	x1, l_.str.8@PAGE
Lloh124:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_dev_err
Lloh125:
	adrp	x8, _EPROTO@GOTPAGE
Lloh126:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
	b	LBB0_26
LBB0_40:
Lloh127:
	adrp	x1, l_.str.9@PAGE
Lloh128:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_dev_dbg
	mov	w20, #0
	b	LBB0_30
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh84, Lloh85, Lloh86
	.loh AdrpLdrGotLdr	Lloh81, Lloh82, Lloh83
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh87, Lloh88, Lloh89
	.loh AdrpLdrGot	Lloh92, Lloh93
	.loh AdrpAdd	Lloh90, Lloh91
	.loh AdrpLdrGot	Lloh96, Lloh97
	.loh AdrpAdd	Lloh94, Lloh95
	.loh AdrpLdrGotLdr	Lloh98, Lloh99, Lloh100
	.loh AdrpAdd	Lloh101, Lloh102
	.loh AdrpLdrGot	Lloh103, Lloh104
	.loh AdrpLdrGotLdr	Lloh105, Lloh106, Lloh107
	.loh AdrpLdrGotLdr	Lloh110, Lloh111, Lloh112
	.loh AdrpAdd	Lloh108, Lloh109
	.loh AdrpLdrGotLdr	Lloh113, Lloh114, Lloh115
	.loh AdrpAdd	Lloh116, Lloh117
	.loh AdrpLdrGotLdr	Lloh118, Lloh119, Lloh120
	.loh AdrpAdd	Lloh121, Lloh122
	.loh AdrpLdrGot	Lloh125, Lloh126
	.loh AdrpAdd	Lloh123, Lloh124
	.loh AdrpAdd	Lloh127, Lloh128
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"transfer: %s %zu bytes.\n"

	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
l_.str.1:                               ; @.str.1
	.asciz	"read"

l_.str.2:                               ; @.str.2
	.asciz	"write"

	.comm	_AT91_TWI_SR,4,2                ; @AT91_TWI_SR
	.comm	_AT91_TWI_FMR,4,2               ; @AT91_TWI_FMR
	.comm	_AT91_TWI_FMR_TXRDYM_MASK,4,2   ; @AT91_TWI_FMR_TXRDYM_MASK
	.comm	_AT91_TWI_FMR_RXRDYM_MASK,4,2   ; @AT91_TWI_FMR_RXRDYM_MASK
	.comm	_AT91_TWI_ONE_DATA,4,2          ; @AT91_TWI_ONE_DATA
	.comm	_AT91_TWI_CR,4,2                ; @AT91_TWI_CR
	.comm	_AT91_TWI_THRCLR,4,2            ; @AT91_TWI_THRCLR
	.comm	_AT91_TWI_RHRCLR,4,2            ; @AT91_TWI_RHRCLR
	.comm	_AT91_TWI_QUICK,4,2             ; @AT91_TWI_QUICK
	.comm	_AT91_TWI_IER,4,2               ; @AT91_TWI_IER
	.comm	_AT91_TWI_TXCOMP,4,2            ; @AT91_TWI_TXCOMP
	.comm	_AT91_TWI_START,4,2             ; @AT91_TWI_START
	.comm	_I2C_M_RECV_LEN,4,2             ; @I2C_M_RECV_LEN
	.comm	_AT91_TWI_STOP,4,2              ; @AT91_TWI_STOP
	.comm	_AT91_I2C_DMA_THRESHOLD,4,2     ; @AT91_I2C_DMA_THRESHOLD
	.comm	_AT91_TWI_NACK,4,2              ; @AT91_TWI_NACK
	.comm	_AT91_TWI_RXRDY,4,2             ; @AT91_TWI_RXRDY
	.comm	_AT91_TWI_TXRDY,4,2             ; @AT91_TWI_TXRDY
l_.str.3:                               ; @.str.3
	.asciz	"controller timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.4:                               ; @.str.4
	.asciz	"received nack\n"

	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.comm	_AT91_TWI_OVRE,4,2              ; @AT91_TWI_OVRE
l_.str.5:                               ; @.str.5
	.asciz	"overrun while reading\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_AT91_TWI_UNRE,4,2              ; @AT91_TWI_UNRE
l_.str.6:                               ; @.str.6
	.asciz	"underrun while writing\n"

	.comm	_AT91_TWI_LOCK,4,2              ; @AT91_TWI_LOCK
l_.str.7:                               ; @.str.7
	.asciz	"tx locked\n"

l_.str.8:                               ; @.str.8
	.asciz	"invalid smbus block length recvd\n"

	.comm	_EPROTO,4,2                     ; @EPROTO
l_.str.9:                               ; @.str.9
	.asciz	"transfer complete\n"

l_.str.10:                              ; @.str.10
	.asciz	"unlock tx\n"

	.comm	_AT91_TWI_LOCKCLR,4,2           ; @AT91_TWI_LOCKCLR
	.no_dead_strip	_at91_do_twi_transfer
.subsections_via_symbols
