	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_wait
_i2c_wait:                              ## @i2c_wait
	.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
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	_NO_IRQ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.1:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_jiffies@GOTPCREL(%rip), %r14
	addl	(%r14), %ebx
	movq	_MPC_I2C_SR@GOTPCREL(%rip), %r13
	movq	_CSR_MIF@GOTPCREL(%rip), %r15
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	addq	24(%r12), %rdi
	callq	_readb
	testl	%eax, (%r15)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_schedule
	movq	(%r14), %rdi
	movl	%ebx, %esi
	callq	_time_after
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movl	12(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_writeccr
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
LBB0_5:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movq	(%r13), %rdi
	addq	24(%r12), %rdi
	callq	_readb
	movl	%eax, %r14d
	movq	(%r13), %rsi
	addq	24(%r12), %rsi
	xorl	%edi, %edi
	callq	_writeb
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	jns	LBB0_10
	jmp	LBB0_19
LBB0_6:
	movl	16(%r12), %edi
	movq	_CSR_MIF@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	andl	8(%r12), %esi
	movl	%ebx, %edx
	callq	_wait_event_timeout
	movl	%eax, %ebx
	movl	(%r14), %eax
	xorl	%edi, %edi
	andl	8(%r12), %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	12(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_writeccr
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_8:
	movl	8(%r12), %r14d
	movl	$0, 8(%r12)
	testl	%ebx, %ebx
	js	LBB0_19
LBB0_10:
	movq	_CSR_MCF@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_11
## %bb.13:
	movq	_CSR_MAL@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_15
## %bb.14:
	movl	12(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_18
LBB0_11:
	movl	12(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_18
LBB0_15:
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.16:
	movq	_CSR_RXAK@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_19
## %bb.17:
	movl	12(%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_dbg
	movq	_CCR_MEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_writeccr
LBB0_18:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_NO_IRQ,8,3                     ## @NO_IRQ
	.comm	_MPC_I2C_SR,8,3                 ## @MPC_I2C_SR
	.comm	_CSR_MIF,4,2                    ## @CSR_MIF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"wait timeout\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_CSR_MCF,4,2                    ## @CSR_MCF
L_.str.2:                               ## @.str.2
	.asciz	"unfinished\n"

	.comm	_CSR_MAL,4,2                    ## @CSR_MAL
L_.str.3:                               ## @.str.3
	.asciz	"MAL\n"

	.comm	_CSR_RXAK,4,2                   ## @CSR_RXAK
L_.str.4:                               ## @.str.4
	.asciz	"No RXAK\n"

	.comm	_CCR_MEN,4,2                    ## @CCR_MEN
	.no_dead_strip	_i2c_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_wait
_i2c_wait:                              ; @i2c_wait
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x2, x1
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NO_IRQ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NO_IRQ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
Lloh3:
	adrp	x22, _jiffies@GOTPAGE
Lloh4:
	ldr	x22, [x22, _jiffies@GOTPAGEOFF]
	ldr	w8, [x22]
	add	w21, w8, w2
Lloh5:
	adrp	x23, _MPC_I2C_SR@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MPC_I2C_SR@GOTPAGEOFF]
Lloh7:
	adrp	x24, _CSR_MIF@GOTPAGE
Lloh8:
	ldr	x24, [x24, _CSR_MIF@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readb
	ldr	w8, [x24]
	tst	w8, w0
	b.ne	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_schedule
	ldr	x0, [x22]
	mov	x1, x21
	bl	_time_after
	cbz	x0, LBB0_2
; %bb.4:
	ldr	w0, [x19, #12]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	mov	w1, #0
	bl	_writeccr
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_5:
	ldr	w0, [x19, #16]
	ldr	w8, [x19, #8]
Lloh14:
	adrp	x22, _CSR_MIF@GOTPAGE
Lloh15:
	ldr	x22, [x22, _CSR_MIF@GOTPAGEOFF]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_wait_event_timeout
	mov	x21, x0
	ldr	w8, [x19, #8]
	ldr	w9, [x22]
	tst	w9, w8
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w0, [x19, #12]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	mov	w1, #0
	bl	_writeccr
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	ldr	w22, [x19, #8]
	str	wzr, [x19, #8]
	tbz	w21, #31, LBB0_10
	b	LBB0_18
LBB0_8:
	mov	w21, #0
LBB0_9:
	ldr	x8, [x19, #24]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readb
	mov	x22, x0
	ldr	x8, [x19, #24]
	ldr	x9, [x23]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writeb
	tbnz	w21, #31, LBB0_18
LBB0_10:
Lloh21:
	adrp	x8, _CSR_MCF@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CSR_MCF@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_13
; %bb.11:
Lloh24:
	adrp	x8, _CSR_MAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CSR_MAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_14
; %bb.12:
	ldr	w0, [x19, #12]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	b	LBB0_17
LBB0_13:
	ldr	w0, [x19, #12]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	b	LBB0_17
LBB0_14:
	cbz	w20, LBB0_19
; %bb.15:
Lloh31:
	adrp	x8, _CSR_RXAK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _CSR_RXAK@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_19
; %bb.16:
	ldr	w0, [x19, #12]
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
Lloh36:
	adrp	x8, _CCR_MEN@GOTPAGE
Lloh37:
	ldr	x8, [x8, _CCR_MEN@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_writeccr
LBB0_17:
Lloh39:
	adrp	x8, _EIO@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_18:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_19:
	mov	w21, #0
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_NO_IRQ,8,3                     ; @NO_IRQ
	.comm	_MPC_I2C_SR,8,3                 ; @MPC_I2C_SR
	.comm	_CSR_MIF,4,2                    ; @CSR_MIF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"wait timeout\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_CSR_MCF,4,2                    ; @CSR_MCF
l_.str.2:                               ; @.str.2
	.asciz	"unfinished\n"

	.comm	_CSR_MAL,4,2                    ; @CSR_MAL
l_.str.3:                               ; @.str.3
	.asciz	"MAL\n"

	.comm	_CSR_RXAK,4,2                   ; @CSR_RXAK
l_.str.4:                               ; @.str.4
	.asciz	"No RXAK\n"

	.comm	_CCR_MEN,4,2                    ; @CCR_MEN
	.no_dead_strip	_i2c_wait
.subsections_via_symbols
