	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_for_xfer
_wait_for_xfer:                         ## @wait_for_xfer
	.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	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movslq	(%rdi), %rsi
	imulq	$1717986919, %rsi, %rdx         ## imm = 0x66666667
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$35, %rdx
	addl	%eax, %edx
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	_pause_sbt
	movl	$-10000, %ebx                   ## imm = 0xD8F0
	movq	_I2C_STATUS_REG@GOTPCREL(%rip), %r13
	movq	_I2CSR_MIF@GOTPCREL(%rip), %r14
	movq	_IIC_ETIMEOUT@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_i2c_read_reg
	testl	%eax, (%r14)
	jne	LBB0_2
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, %edi
	callq	_DELAY
	incl	%ebx
	jne	LBB0_1
	jmp	LBB0_9
LBB0_2:
	movq	_I2CSR_MAL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_IIC_EBUSERR@GOTPCREL(%rip), %r15
	jmp	LBB0_9
LBB0_4:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_7
## %bb.5:
	movq	_I2CSR_RXAK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_IIC_ENOACK@GOTPCREL(%rip), %r15
	jmp	LBB0_9
LBB0_7:
	movq	_IIC_NOERR@GOTPCREL(%rip), %r15
LBB0_9:
	movl	(%r15), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"imxi2c"

	.comm	_I2C_STATUS_REG,4,2             ## @I2C_STATUS_REG
	.comm	_I2CSR_MIF,4,2                  ## @I2CSR_MIF
	.comm	_I2CSR_MAL,4,2                  ## @I2CSR_MAL
	.comm	_IIC_EBUSERR,4,2                ## @IIC_EBUSERR
	.comm	_I2CSR_RXAK,4,2                 ## @I2CSR_RXAK
	.comm	_IIC_ENOACK,4,2                 ## @IIC_ENOACK
	.comm	_IIC_NOERR,4,2                  ## @IIC_NOERR
	.comm	_IIC_ETIMEOUT,4,2               ## @IIC_ETIMEOUT
	.no_dead_strip	_wait_for_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_for_xfer
_wait_for_xfer:                         ; @wait_for_xfer
	.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	x19, x1
	mov	x20, x0
	ldrsw	x1, [x0]
	mov	w8, #26215
	movk	w8, #26214, lsl #16
	mul	x8, x1, x8
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w2, w8, w9
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	w3, #0
	bl	_pause_sbt
	mov	w22, #-10000
Lloh2:
	adrp	x23, _I2C_STATUS_REG@GOTPAGE
Lloh3:
	ldr	x23, [x23, _I2C_STATUS_REG@GOTPAGEOFF]
Lloh4:
	adrp	x24, _I2CSR_MIF@GOTPAGE
Lloh5:
	ldr	x24, [x24, _I2CSR_MIF@GOTPAGEOFF]
Lloh6:
	adrp	x21, _IIC_ETIMEOUT@GOTPAGE
Lloh7:
	ldr	x21, [x21, _IIC_ETIMEOUT@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x20
	bl	_i2c_read_reg
	ldr	w8, [x24]
	tst	w8, w0
	b.ne	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #1
	bl	_DELAY
	adds	w22, w22, #1
	b.lo	LBB0_1
	b	LBB0_9
LBB0_3:
Lloh8:
	adrp	x8, _I2CSR_MAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I2CSR_MAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:
Lloh11:
	adrp	x21, _IIC_EBUSERR@GOTPAGE
Lloh12:
	ldr	x21, [x21, _IIC_EBUSERR@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
	cbz	w19, LBB0_8
; %bb.6:
Lloh13:
	adrp	x8, _I2CSR_RXAK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _I2CSR_RXAK@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.7:
Lloh16:
	adrp	x21, _IIC_ENOACK@GOTPAGE
Lloh17:
	ldr	x21, [x21, _IIC_ENOACK@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh18:
	adrp	x21, _IIC_NOERR@GOTPAGE
Lloh19:
	ldr	x21, [x21, _IIC_NOERR@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"imxi2c"

	.comm	_I2C_STATUS_REG,4,2             ; @I2C_STATUS_REG
	.comm	_I2CSR_MIF,4,2                  ; @I2CSR_MIF
	.comm	_I2CSR_MAL,4,2                  ; @I2CSR_MAL
	.comm	_IIC_EBUSERR,4,2                ; @IIC_EBUSERR
	.comm	_I2CSR_RXAK,4,2                 ; @I2CSR_RXAK
	.comm	_IIC_ENOACK,4,2                 ; @IIC_ENOACK
	.comm	_IIC_NOERR,4,2                  ; @IIC_NOERR
	.comm	_IIC_ETIMEOUT,4,2               ; @IIC_ETIMEOUT
	.no_dead_strip	_wait_for_xfer
.subsections_via_symbols
