	.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, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r12
	cmpl	$0, 24(%rdi)
	je	LBB0_1
## %bb.6:
	movl	8(%r12), %edi
	movq	_CSR_MIF@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	andl	(%r12), %esi
	movl	%ebx, %edx
	callq	_wait_event_timeout
	movl	%eax, %ebx
	movl	(%r14), %eax
	xorl	%edi, %edi
	andl	(%r12), %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	4(%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	(%r12), %r14d
	movl	$0, (%r12)
	testl	%ebx, %ebx
	jns	LBB0_10
	jmp	LBB0_18
LBB0_1:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	_jiffies@GOTPCREL(%rip), %r14
	addl	(%r14), %ebx
	movq	_MPC_I2C_SR@GOTPCREL(%rip), %r15
	movq	_CSR_MIF@GOTPCREL(%rip), %r13
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	addq	16(%r12), %rdi
	callq	_readb
	testl	%eax, (%r13)
	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	4(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_writeccr
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
LBB0_5:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movq	(%r15), %rdi
	addq	16(%r12), %rdi
	callq	_readb
	movl	%eax, %r14d
	movq	(%r15), %rsi
	addq	16(%r12), %rsi
	xorl	%edi, %edi
	callq	_writeb
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	js	LBB0_18
LBB0_10:
	movq	_CSR_MCF@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_11
## %bb.12:
	movq	_CSR_MAL@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_14
## %bb.13:
	movl	4(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_11:
	movl	4(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_14:
	xorl	%ebx, %ebx
	testl	%r13d, %r13d
	je	LBB0_18
## %bb.15:
	movq	_CSR_RXAK@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_18
## %bb.16:
	movl	4(%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
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_17:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	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	_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	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.1:                               ## @.str.1
	.asciz	"wait timeout\n"

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

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

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

	.comm	_CCR_MEN,4,2                    ## @CCR_MEN
	.comm	_ENXIO,4,2                      ## @ENXIO
	.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	w8, [x0, #24]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	w0, [x19, #8]
	ldr	w8, [x19]
Lloh0:
	adrp	x22, _CSR_MIF@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CSR_MIF@GOTPAGEOFF]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_wait_event_timeout
	mov	x21, x0
	ldr	w8, [x19]
	ldr	w9, [x22]
	tst	w9, w8
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w0, [x19, #4]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	mov	w1, #0
	bl	_writeccr
Lloh4:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_3:
	ldr	w22, [x19]
	str	wzr, [x19]
	tbz	w21, #31, LBB0_10
	b	LBB0_18
LBB0_4:
Lloh7:
	adrp	x22, _jiffies@GOTPAGE
Lloh8:
	ldr	x22, [x22, _jiffies@GOTPAGEOFF]
	ldr	w8, [x22]
	add	w21, w8, w2
Lloh9:
	adrp	x23, _MPC_I2C_SR@GOTPAGE
Lloh10:
	ldr	x23, [x23, _MPC_I2C_SR@GOTPAGEOFF]
Lloh11:
	adrp	x24, _CSR_MIF@GOTPAGE
Lloh12:
	ldr	x24, [x24, _CSR_MIF@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readb
	ldr	w8, [x24]
	tst	w8, w0
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_schedule
	ldr	x0, [x22]
	mov	x1, x21
	bl	_time_after
	cbz	x0, LBB0_5
; %bb.7:
	ldr	w0, [x19, #4]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	mov	w1, #0
	bl	_writeccr
Lloh15:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_8:
	mov	w21, #0
LBB0_9:
	ldr	x8, [x19, #16]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readb
	mov	x22, x0
	ldr	x8, [x19, #16]
	ldr	x9, [x23]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writeb
	tbnz	w21, #31, LBB0_18
LBB0_10:
Lloh18:
	adrp	x8, _CSR_MCF@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CSR_MCF@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_13
; %bb.11:
Lloh21:
	adrp	x8, _CSR_MAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CSR_MAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_14
; %bb.12:
	ldr	w0, [x19, #4]
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
Lloh26:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_17
LBB0_13:
	ldr	w0, [x19, #4]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh30:
	adrp	x8, _EIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_17
LBB0_14:
	cbz	w20, LBB0_19
; %bb.15:
Lloh32:
	adrp	x8, _CSR_RXAK@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CSR_RXAK@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_19
; %bb.16:
	ldr	w0, [x19, #4]
Lloh35:
	adrp	x1, l_.str.4@PAGE
Lloh36:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
Lloh37:
	adrp	x8, _CCR_MEN@GOTPAGE
Lloh38:
	ldr	x8, [x8, _CCR_MEN@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_writeccr
Lloh40:
	adrp	x8, _ENXIO@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_17:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.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	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.1:                               ; @.str.1
	.asciz	"wait timeout\n"

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

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

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

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