	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_i2c
_read_i2c:                              ## @read_i2c
	.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
	movq	%rdi, %r15
	callq	_load_i2c_mcr_reg
	movq	_I2C_MCR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	24(%r15), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	_I2C_CR@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	24(%r15), %rdi
	callq	_readl
	movq	_DEFAULT_I2C_REG_CR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%rbx), %rsi
	addq	24(%r15), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	(%rbx), %rdi
	addq	24(%r15), %rdi
	movq	_I2C_CR_PE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_set_bit
	leaq	20(%r15), %r14
	movq	%r14, %rdi
	callq	_init_completion
	movq	_I2C_IT_RXFNF@GOTPCREL(%rip), %rax
	movq	_I2C_IT_RXFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_I2C_IT_MAL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_I2C_IT_BERR@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	cmpq	$0, 40(%r15)
	jne	LBB0_3
## %bb.1:
	movq	32(%r15), %rax
	cmpl	$0, (%rax)
	jne	LBB0_2
LBB0_3:
	movq	_I2C_IT_MTD@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_I2C_IT_MTDWS@GOTPCREL(%rip), %rax
LBB0_4:
	orl	(%rax), %edi
	movq	_I2C_CLEAR_ALL_INTS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	callq	_IRQ_MASK
	andl	%eax, %ebx
	movq	_I2C_IMSCR@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	24(%r15), %rdi
	callq	_readl
	orl	%eax, %ebx
	movq	(%r12), %rsi
	addq	24(%r15), %rsi
	movl	%ebx, %edi
	callq	_writel
	movl	16(%r15), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_6
## %bb.5:
	movq	8(%r15), %rdi
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@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	_I2C_MCR,8,3                    ## @I2C_MCR
	.comm	_I2C_CR,8,3                     ## @I2C_CR
	.comm	_DEFAULT_I2C_REG_CR,4,2         ## @DEFAULT_I2C_REG_CR
	.comm	_I2C_CR_PE,4,2                  ## @I2C_CR_PE
	.comm	_I2C_IT_RXFNF,4,2               ## @I2C_IT_RXFNF
	.comm	_I2C_IT_RXFF,4,2                ## @I2C_IT_RXFF
	.comm	_I2C_IT_MAL,4,2                 ## @I2C_IT_MAL
	.comm	_I2C_IT_BERR,4,2                ## @I2C_IT_BERR
	.comm	_I2C_IT_MTD,4,2                 ## @I2C_IT_MTD
	.comm	_I2C_IT_MTDWS,4,2               ## @I2C_IT_MTDWS
	.comm	_I2C_CLEAR_ALL_INTS,4,2         ## @I2C_CLEAR_ALL_INTS
	.comm	_I2C_IMSCR,8,3                  ## @I2C_IMSCR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read from slave 0x%x timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_read_i2c
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_i2c
_read_i2c:                              ; @read_i2c
	.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	x19, x0
	bl	_load_i2c_mcr_reg
	ldr	x8, [x19, #24]
Lloh0:
	adrp	x9, _I2C_MCR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_MCR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #24]
Lloh3:
	adrp	x20, _I2C_CR@GOTPAGE
Lloh4:
	ldr	x20, [x20, _I2C_CR@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh5:
	adrp	x8, _DEFAULT_I2C_REG_CR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DEFAULT_I2C_REG_CR@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19, #24]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #24]
	ldr	x9, [x20]
	add	x0, x9, x8
Lloh8:
	adrp	x8, _I2C_CR_PE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I2C_CR_PE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_i2c_set_bit
	add	x20, x19, #20
	mov	x0, x20
	bl	_init_completion
Lloh11:
	adrp	x8, _I2C_IT_RXFNF@GOTPAGE
Lloh12:
	ldr	x8, [x8, _I2C_IT_RXFNF@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _I2C_IT_RXFF@GOTPAGE
Lloh15:
	ldr	x9, [x9, _I2C_IT_RXFF@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh17:
	adrp	x9, _I2C_IT_MAL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _I2C_IT_MAL@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	adrp	x10, _I2C_IT_BERR@GOTPAGE
Lloh21:
	ldr	x10, [x10, _I2C_IT_BERR@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh22:
	ldr	w9, [x10]
	orr	w8, w8, w9
	ldr	x10, [x19, #40]
Lloh23:
	adrp	x9, _I2C_IT_MTD@GOTPAGE
Lloh24:
	ldr	x9, [x9, _I2C_IT_MTD@GOTPAGEOFF]
	cbnz	x10, LBB0_2
; %bb.1:
	ldr	x10, [x19, #32]
	ldr	w10, [x10]
Lloh25:
	adrp	x11, _I2C_IT_MTDWS@GOTPAGE
Lloh26:
	ldr	x11, [x11, _I2C_IT_MTDWS@GOTPAGEOFF]
	cmp	w10, #0
	csel	x9, x9, x11, eq
LBB0_2:
	ldr	w9, [x9]
	orr	w0, w8, w9
Lloh27:
	adrp	x8, _I2C_CLEAR_ALL_INTS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _I2C_CLEAR_ALL_INTS@GOTPAGEOFF]
Lloh29:
	ldr	w21, [x8]
	bl	_IRQ_MASK
	and	w21, w0, w21
	ldr	x8, [x19, #24]
Lloh30:
	adrp	x22, _I2C_IMSCR@GOTPAGE
Lloh31:
	ldr	x22, [x22, _I2C_IMSCR@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	orr	w0, w0, w21
	ldr	x8, [x19, #24]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel
	ldr	w1, [x19, #16]
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_4
; %bb.3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	ldr	x0, [x19, #8]
	ldr	w2, [x19]
Lloh32:
	adrp	x1, l_.str@PAGE
Lloh33:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh34:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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 AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_MCR,8,3                    ; @I2C_MCR
	.comm	_I2C_CR,8,3                     ; @I2C_CR
	.comm	_DEFAULT_I2C_REG_CR,4,2         ; @DEFAULT_I2C_REG_CR
	.comm	_I2C_CR_PE,4,2                  ; @I2C_CR_PE
	.comm	_I2C_IT_RXFNF,4,2               ; @I2C_IT_RXFNF
	.comm	_I2C_IT_RXFF,4,2                ; @I2C_IT_RXFF
	.comm	_I2C_IT_MAL,4,2                 ; @I2C_IT_MAL
	.comm	_I2C_IT_BERR,4,2                ; @I2C_IT_BERR
	.comm	_I2C_IT_MTD,4,2                 ; @I2C_IT_MTD
	.comm	_I2C_IT_MTDWS,4,2               ; @I2C_IT_MTDWS
	.comm	_I2C_CLEAR_ALL_INTS,4,2         ; @I2C_CLEAR_ALL_INTS
	.comm	_I2C_IMSCR,8,3                  ; @I2C_IMSCR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read from slave 0x%x timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_read_i2c
.subsections_via_symbols
