	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_twi_read_next_byte
_at91_twi_read_next_byte:               ## @at91_twi_read_next_byte
	.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	%rdi, %rbx
	cmpl	$0, (%rdi)
	je	LBB0_12
## %bb.1:
	movq	_AT91_TWI_RHR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	40(%rbx), %rdi
	callq	_readb_relaxed
	movq	8(%rbx), %rcx
	movq	%rax, (%rcx)
	decl	(%rbx)
	cmpl	$0, 16(%rbx)
	jne	LBB0_11
## %bb.2:
	movq	32(%rbx), %rax
	movq	_I2C_M_RECV_LEN@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	andl	(%rax), %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jle	LBB0_6
## %bb.4:
	movq	_I2C_SMBUS_BLOCK_MAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_6
## %bb.5:
	movl	(%r14), %ecx
	notl	%ecx
	movq	32(%rbx), %rdx
	andl	%ecx, (%rdx)
	movl	(%rbx), %ecx
	leal	(%rcx,%rax), %esi
	movl	%esi, (%rbx)
	addl	%ecx, %eax
	incl	%eax
	movl	%eax, 4(%rdx)
	movl	20(%rbx), %edi
	movslq	%esi, %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_7:
	cmpl	$0, 24(%rbx)
	jne	LBB0_10
	jmp	LBB0_8
LBB0_12:
	movq	_AT91_TWI_RHR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_at91_twi_read                  ## TAILCALL
LBB0_6:
	movl	$1, 16(%rbx)
	movl	$1, (%rbx)
	cmpl	$0, 24(%rbx)
	jne	LBB0_10
LBB0_8:
	cmpl	$1, (%rbx)
	jne	LBB0_10
## %bb.9:
	movq	_AT91_TWI_CR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_TWI_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_at91_twi_write
LBB0_10:
	movl	20(%rbx), %edi
	movq	8(%rbx), %rax
	movq	(%rax), %rdx
	movl	(%rbx), %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	addq	$8, 8(%rbx)
LBB0_11:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AT91_TWI_RHR,8,3               ## @AT91_TWI_RHR
	.comm	_I2C_M_RECV_LEN,4,2             ## @I2C_M_RECV_LEN
	.comm	_I2C_SMBUS_BLOCK_MAX,8,3        ## @I2C_SMBUS_BLOCK_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"received block length %zu\n"

	.comm	_AT91_TWI_CR,4,2                ## @AT91_TWI_CR
	.comm	_AT91_TWI_STOP,4,2              ## @AT91_TWI_STOP
L_.str.1:                               ## @.str.1
	.asciz	"read 0x%x, to go %zu\n"

	.no_dead_strip	_at91_twi_read_next_byte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_twi_read_next_byte
_at91_twi_read_next_byte:               ; @at91_twi_read_next_byte
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_6
; %bb.1:
	ldr	x8, [x19, #40]
Lloh0:
	adrp	x9, _AT91_TWI_RHR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AT91_TWI_RHR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readb_relaxed
	ldr	x8, [x19, #8]
	str	x0, [x8]
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
	ldr	w8, [x19, #16]
	cbnz	w8, LBB0_11
; %bb.2:
	ldr	x8, [x19, #32]
	ldr	w8, [x8]
Lloh3:
	adrp	x20, _I2C_M_RECV_LEN@GOTPAGE
Lloh4:
	ldr	x20, [x20, _I2C_M_RECV_LEN@GOTPAGEOFF]
	ldr	w9, [x20]
	and	w0, w9, w8
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _I2C_SMBUS_BLOCK_MAX@GOTPAGE
Lloh6:
	ldr	x9, [x9, _I2C_SMBUS_BLOCK_MAX@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, #1
	ccmp	x8, x9, #0, ge
	b.le	LBB0_7
; %bb.4:
	mov	w8, #1
	str	w8, [x19, #16]
	str	w8, [x19]
LBB0_5:
	ldr	w8, [x19, #24]
	cbnz	w8, LBB0_10
	b	LBB0_8
LBB0_6:
Lloh8:
	adrp	x8, _AT91_TWI_RHR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AT91_TWI_RHR@GOTPAGEOFF]
Lloh10:
	ldr	x1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_at91_twi_read
LBB0_7:
	ldr	w9, [x20]
	ldr	x10, [x19, #32]
	ldr	w11, [x10]
	bic	w9, w11, w9
	ldr	w11, [x19]
	add	w8, w11, w8
	str	w8, [x19]
	add	w11, w8, #1
	stp	w9, w11, [x10]
	ldr	w0, [x19, #20]
	sxtw	x2, w8
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x19, #24]
	cbnz	w8, LBB0_10
LBB0_8:
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_10
; %bb.9:
Lloh13:
	adrp	x8, _AT91_TWI_CR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AT91_TWI_CR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _AT91_TWI_STOP@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AT91_TWI_STOP@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_at91_twi_write
LBB0_10:
	ldr	w0, [x19, #20]
	ldr	x8, [x19, #8]
	ldr	x2, [x8]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x19, #8]
	add	x8, x8, #8
	str	x8, [x19, #8]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_AT91_TWI_RHR,8,3               ; @AT91_TWI_RHR
	.comm	_I2C_M_RECV_LEN,4,2             ; @I2C_M_RECV_LEN
	.comm	_I2C_SMBUS_BLOCK_MAX,8,3        ; @I2C_SMBUS_BLOCK_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"received block length %zu\n"

	.comm	_AT91_TWI_CR,4,2                ; @AT91_TWI_CR
	.comm	_AT91_TWI_STOP,4,2              ; @AT91_TWI_STOP
l_.str.1:                               ; @.str.1
	.asciz	"read 0x%x, to go %zu\n"

	.no_dead_strip	_at91_twi_read_next_byte
.subsections_via_symbols
