	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function readbytes
_readbytes:                             ## @readbytes
	.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, -48(%rbp)                 ## 8-byte Spill
	movl	8(%rsi), %r13d
	testl	%r13d, %r13d
	jle	LBB0_1
## %bb.2:
	movl	12(%rsi), %r14d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	testl	%r13d, %r13d
	jle	LBB0_15
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_i2c_inb
	testl	%eax, %eax
	js	LBB0_15
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movb	%bl, (%rax,%r12)
	decl	%r13d
	testl	%r12d, %r12d
	jne	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_I2C_M_RECV_LEN@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_I2C_SMBUS_BLOCK_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jg	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	addl	%ebx, %r13d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%ebx, 8(%rax)
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_I2C_M_NO_RD_ACK@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	andl	%r14d, %eax
	testl	%r13d, %r13d
	leaq	L_.str.3(%rip), %r8
	leaq	L_.str.4(%rip), %rcx
	cmoveq	%rcx, %r8
	testl	%eax, %eax
	leaq	L_.str.2(%rip), %rax
	cmovneq	%rax, %r8
	movl	$2, %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rdx
	movl	%ebx, %ecx
	callq	_bit_dbg
	testl	%r14d, (%r15)
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_acknak
	testl	%eax, %eax
	jns	LBB0_14
	jmp	LBB0_16
LBB0_15:
	movl	%r12d, %eax
	jmp	LBB0_16
LBB0_1:
	xorl	%eax, %eax
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_I2C_M_NO_RD_ACK@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_10
## %bb.9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	callq	_acknak
LBB0_10:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_dev_err
	movq	_EREMOTEIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RECV_LEN,4,2             ## @I2C_M_RECV_LEN
	.comm	_I2C_SMBUS_BLOCK_MAX,4,2        ## @I2C_SMBUS_BLOCK_MAX
	.comm	_I2C_M_NO_RD_ACK,4,2            ## @I2C_M_NO_RD_ACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"readbytes: invalid block length (%d)\n"

	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
L_.str.1:                               ## @.str.1
	.asciz	"readbytes: 0x%02x %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"(no ack/nak)"

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

L_.str.4:                               ## @.str.4
	.asciz	"NA"

	.no_dead_strip	_readbytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function readbytes
_readbytes:                             ; @readbytes
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w21, [x1, #8]
	cmp	w21, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	mov	x24, #0
	ldr	w25, [x1, #12]
	ldr	x26, [x1]
Lloh0:
	adrp	x28, _I2C_M_NO_RD_ACK@GOTPAGE
Lloh1:
	ldr	x28, [x28, _I2C_M_NO_RD_ACK@GOTPAGEOFF]
Lloh2:
	adrp	x27, l_.str.2@PAGE
Lloh3:
	add	x27, x27, l_.str.2@PAGEOFF
Lloh4:
	adrp	x22, l_.str.1@PAGE
Lloh5:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x24, x24, #1
	cmp	w21, #0
	b.le	LBB0_11
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_i2c_inb
	tbnz	w0, #31, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, x0
	strb	w0, [x26, x24]
	sub	w21, w21, #1
	cbnz	w24, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh6:
	adrp	x8, _I2C_M_RECV_LEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I2C_M_RECV_LEN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w25
	b.eq	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	w23, LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh9:
	adrp	x8, _I2C_SMBUS_BLOCK_MAX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I2C_SMBUS_BLOCK_MAX@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w23, w8
	b.gt	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w21, w23, w21
	ldr	w8, [x20, #8]
	add	w8, w8, w23
	str	w8, [x20, #8]
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x28]
	cmp	w21, #0
Lloh12:
	adrp	x9, l_.str.3@PAGE
Lloh13:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh14:
	adrp	x10, l_.str.4@PAGE
Lloh15:
	add	x10, x10, l_.str.4@PAGEOFF
	csel	x9, x10, x9, eq
	tst	w8, w25
	csel	x4, x9, x27, eq
	mov	w0, #2
	mov	x1, x19
	mov	x2, x22
	mov	x3, x23
	bl	_bit_dbg
	ldr	w8, [x28]
	tst	w8, w25
	b.ne	LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_acknak
	tbz	w0, #31, LBB0_2
	b	LBB0_13
LBB0_11:
	mov	x0, x24
	b	LBB0_13
LBB0_12:
	mov	w0, #0
LBB0_13:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_14:
	ldr	w8, [x28]
	tst	w8, w25
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x19
	mov	w1, #0
	bl	_acknak
LBB0_16:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x23
	bl	_dev_err
Lloh18:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RECV_LEN,4,2             ; @I2C_M_RECV_LEN
	.comm	_I2C_SMBUS_BLOCK_MAX,4,2        ; @I2C_SMBUS_BLOCK_MAX
	.comm	_I2C_M_NO_RD_ACK,4,2            ; @I2C_M_NO_RD_ACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"readbytes: invalid block length (%d)\n"

	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
l_.str.1:                               ; @.str.1
	.asciz	"readbytes: 0x%02x %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"(no ack/nak)"

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

l_.str.4:                               ; @.str.4
	.asciz	"NA"

	.no_dead_strip	_readbytes
.subsections_via_symbols
