	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_SGI_I2C_HOLD_BUS@GOTPCREL(%rip), %rax
	movq	_SGI_I2C_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	8(%rdi), %edi
	movq	_SGI_I2C_NOT_IDLE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	*16(%r12)
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.1:
	movl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_wait_xfer_done
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	8(%r12), %edi
	callq	*(%r12)
	movb	%al, (%r14,%rbx)
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_2
LBB0_5:
	movl	8(%r12), %edi
	movq	_SGI_I2C_RELEASE_BUS@GOTPCREL(%rip), %rax
	movq	_SGI_I2C_FORCE_IDLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	*16(%r12)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SGI_I2C_HOLD_BUS,4,2           ## @SGI_I2C_HOLD_BUS
	.comm	_SGI_I2C_READ,4,2               ## @SGI_I2C_READ
	.comm	_SGI_I2C_NOT_IDLE,4,2           ## @SGI_I2C_NOT_IDLE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_SGI_I2C_RELEASE_BUS,4,2        ## @SGI_I2C_RELEASE_BUS
	.comm	_SGI_I2C_FORCE_IDLE,4,2         ## @SGI_I2C_FORCE_IDLE
	.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:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x9, _SGI_I2C_HOLD_BUS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SGI_I2C_HOLD_BUS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _SGI_I2C_READ@GOTPAGE
Lloh4:
	ldr	x10, [x10, _SGI_I2C_READ@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh6:
	adrp	x10, _SGI_I2C_NOT_IDLE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SGI_I2C_NOT_IDLE@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w1, w9, w10
	blr	x8
	cbz	w21, LBB0_4
; %bb.1:
	mov	w21, w21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_wait_xfer_done
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19]
	ldr	w0, [x19, #8]
	blr	x8
	strb	w0, [x20], #1
	subs	x21, x21, #1
	b.ne	LBB0_2
LBB0_4:
	ldr	x8, [x19, #16]
Lloh9:
	adrp	x9, _SGI_I2C_RELEASE_BUS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SGI_I2C_RELEASE_BUS@GOTPAGEOFF]
	ldr	w0, [x19, #8]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _SGI_I2C_FORCE_IDLE@GOTPAGE
Lloh13:
	ldr	x10, [x10, _SGI_I2C_FORCE_IDLE@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	orr	w1, w10, w9
	blr	x8
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x8, _EIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SGI_I2C_HOLD_BUS,4,2           ; @SGI_I2C_HOLD_BUS
	.comm	_SGI_I2C_READ,4,2               ; @SGI_I2C_READ
	.comm	_SGI_I2C_NOT_IDLE,4,2           ; @SGI_I2C_NOT_IDLE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_SGI_I2C_RELEASE_BUS,4,2        ; @SGI_I2C_RELEASE_BUS
	.comm	_SGI_I2C_FORCE_IDLE,4,2         ; @SGI_I2C_FORCE_IDLE
	.no_dead_strip	_i2c_read
.subsections_via_symbols
