	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_read
_i2c_read:                              ## @i2c_read
	.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
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %r13
	decl	%edx
	je	LBB0_3
## %bb.4:
	movl	%edx, %r12d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movb	$0, (%r13)
	xorl	%eax, %eax
	callq	_au_sync
	movq	%rbx, %rdi
	leaq	-41(%rbp), %rsi
	callq	_wait_for_rx_byte
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movzbl	-41(%rbp), %eax
	movb	%al, (%r14,%r15)
	incq	%r15
	cmpq	%r15, %r12
	jne	LBB0_5
	jmp	LBB0_8
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_11
LBB0_3:
	xorl	%r12d, %r12d
LBB0_8:
	movq	_PSC_SMBTXRX_STP@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, (%r13)
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_au_sync
	movq	%rbx, %rdi
	callq	_wait_master_done
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_11
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_11
LBB0_10:
	movb	(%r13), %al
	movb	%al, -41(%rbp)
	xorl	%eax, %eax
	callq	_au_sync
	movb	-41(%rbp), %al
	movb	%al, (%r14,%r12)
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_PSC_SMBTXRX_STP,1,0            ## @PSC_SMBTXRX_STP
	.no_dead_strip	_i2c_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_read
_i2c_read:                              ; @i2c_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	w2, LBB0_5
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x22, [x0]
	subs	w21, w2, #1
	b.eq	LBB0_6
; %bb.2:
	mov	x23, x21
	mov	x24, x19
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	strb	wzr, [x22]
	bl	_au_sync
	add	x1, sp, #15
	mov	x0, x20
	bl	_wait_for_rx_byte
	cbnz	x0, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldrb	w8, [sp, #15]
	strb	w8, [x24], #1
	subs	x23, x23, #1
	b.ne	LBB0_3
	b	LBB0_7
LBB0_5:
	mov	w0, #0
	b	LBB0_10
LBB0_6:
	mov	x21, #0
LBB0_7:
Lloh0:
	adrp	x8, _PSC_SMBTXRX_STP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PSC_SMBTXRX_STP@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [x22]
	bl	_au_sync
	mov	x0, x20
	bl	_wait_master_done
	cbz	x0, LBB0_9
LBB0_8:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_9:
	ldrb	w8, [x22]
	strb	w8, [sp, #15]
	bl	_au_sync
	mov	w0, #0
	ldrb	w8, [sp, #15]
	strb	w8, [x19, x21]
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_PSC_SMBTXRX_STP,1,0            ; @PSC_SMBTXRX_STP
	.no_dead_strip	_i2c_read
.subsections_via_symbols
