	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_do_wait
_i2c_do_wait:                           ## @i2c_do_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	_I2C_STATUS_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_i2c_read_reg
	movq	_I2CSR_MIF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_12
## %bb.1:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.2:
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.3:
	movq	_I2CSR_RXAK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.4:
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_debugf
	movq	_IIC_ENOACK@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_6:
	movq	_I2CSR_MAL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.7:
	leaq	L_.str.3(%rip), %rdi
LBB0_8:
	xorl	%eax, %eax
	callq	_debugf
	movq	_IIC_EBUSERR@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %ebx
	movl	(%r12), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_i2c_write_reg
	movq	_I2C_CONTROL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_I2CCR_MEN@GOTPCREL(%rip), %rax
	movq	_I2CCR_TXAK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_i2c_write_reg
	jmp	LBB0_13
LBB0_9:
	testl	%r15d, %r15d
	jne	LBB0_12
## %bb.10:
	movq	_I2CSR_MCF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
LBB0_12:
	movq	_IIC_NOERR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_STATUS_REG,4,2             ## @I2C_STATUS_REG
	.comm	_I2CSR_MIF,4,2                  ## @I2CSR_MIF
	.comm	_I2CSR_RXAK,4,2                 ## @I2CSR_RXAK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no ack %s"

L_.str.1:                               ## @.str.1
	.asciz	"after sending slave address"

	.comm	_IIC_ENOACK,4,2                 ## @IIC_ENOACK
	.comm	_I2CSR_MAL,4,2                  ## @I2CSR_MAL
L_.str.3:                               ## @.str.3
	.asciz	"arbitration lost"

	.comm	_IIC_EBUSERR,4,2                ## @IIC_EBUSERR
	.comm	_I2CSR_MCF,4,2                  ## @I2CSR_MCF
L_.str.4:                               ## @.str.4
	.asciz	"transfer unfinished"

	.comm	_IIC_NOERR,4,2                  ## @IIC_NOERR
	.comm	_I2C_CONTROL_REG,4,2            ## @I2C_CONTROL_REG
	.comm	_I2CCR_MEN,4,2                  ## @I2CCR_MEN
	.comm	_I2CCR_TXAK,4,2                 ## @I2CCR_TXAK
	.no_dead_strip	_i2c_do_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_do_wait
_i2c_do_wait:                           ; @i2c_do_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x3
	mov	x20, x2
	mov	x19, x1
Lloh0:
	adrp	x22, _I2C_STATUS_REG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _I2C_STATUS_REG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_i2c_read_reg
Lloh2:
	adrp	x8, _I2CSR_MIF@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I2CSR_MIF@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_11
; %bb.1:
	cbz	w20, LBB0_5
; %bb.2:
	cbz	w21, LBB0_5
; %bb.3:
Lloh5:
	adrp	x8, _I2CSR_RXAK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I2CSR_RXAK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:
Lloh8:
	adrp	x8, l_.str.1@PAGE
Lloh9:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debugf
Lloh12:
	adrp	x8, _IIC_ENOACK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IIC_ENOACK@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
Lloh14:
	adrp	x8, _I2CSR_MAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _I2CSR_MAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.6:
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_7:
	bl	_debugf
Lloh19:
	adrp	x8, _IIC_EBUSERR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IIC_EBUSERR@GOTPAGEOFF]
LBB0_8:
	ldr	w20, [x8]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #0
	bl	_i2c_write_reg
Lloh21:
	adrp	x8, _I2C_CONTROL_REG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _I2C_CONTROL_REG@GOTPAGEOFF]
Lloh23:
	adrp	x9, _I2CCR_MEN@GOTPAGE
Lloh24:
	ldr	x9, [x9, _I2CCR_MEN@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	ldr	w8, [x9]
Lloh27:
	adrp	x9, _I2CCR_TXAK@GOTPAGE
Lloh28:
	ldr	x9, [x9, _I2CCR_TXAK@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_i2c_write_reg
	b	LBB0_12
LBB0_9:
	cbnz	w20, LBB0_11
; %bb.10:
Lloh30:
	adrp	x8, _I2CSR_MCF@GOTPAGE
Lloh31:
	ldr	x8, [x8, _I2CSR_MCF@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_13
LBB0_11:
Lloh33:
	adrp	x8, _IIC_NOERR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _IIC_NOERR@GOTPAGEOFF]
Lloh35:
	ldr	w20, [x8]
LBB0_12:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_13:
Lloh36:
	adrp	x0, l_.str.4@PAGE
Lloh37:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh25
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_STATUS_REG,4,2             ; @I2C_STATUS_REG
	.comm	_I2CSR_MIF,4,2                  ; @I2CSR_MIF
	.comm	_I2CSR_RXAK,4,2                 ; @I2CSR_RXAK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no ack %s"

l_.str.1:                               ; @.str.1
	.asciz	"after sending slave address"

	.comm	_IIC_ENOACK,4,2                 ; @IIC_ENOACK
	.comm	_I2CSR_MAL,4,2                  ; @I2CSR_MAL
l_.str.3:                               ; @.str.3
	.asciz	"arbitration lost"

	.comm	_IIC_EBUSERR,4,2                ; @IIC_EBUSERR
	.comm	_I2CSR_MCF,4,2                  ; @I2CSR_MCF
l_.str.4:                               ; @.str.4
	.asciz	"transfer unfinished"

	.comm	_IIC_NOERR,4,2                  ; @IIC_NOERR
	.comm	_I2C_CONTROL_REG,4,2            ; @I2C_CONTROL_REG
	.comm	_I2CCR_MEN,4,2                  ; @I2CCR_MEN
	.comm	_I2CCR_TXAK,4,2                 ; @I2CCR_TXAK
	.no_dead_strip	_i2c_do_wait
.subsections_via_symbols
