	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function owl_i2c_reset_fifo
_owl_i2c_reset_fifo:                    ## @owl_i2c_reset_fifo
	.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
	movq	%rdi, %r13
	movq	_OWL_I2C_REG_FIFOCTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r13), %rdi
	movq	_OWL_I2C_FIFOCTL_RFR@GOTPCREL(%rip), %r15
	movq	_OWL_I2C_FIFOCTL_TFR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	orl	(%r15), %esi
	movl	$1, %edx
	callq	_owl_i2c_update_reg
	xorl	%ebx, %ebx
	movq	_OWL_I2C_MAX_RETRIES@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_OWL_I2C_REG_FIFOCTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r13), %rdi
	callq	_readl
	movl	(%r12), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$500, %edi                      ## imm = 0x1F4
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usleep_range
	leal	1(%rbx), %edx
	movl	(%r14), %ecx
	cmpl	%ecx, %ebx
	movl	%edx, %ebx
	jb	LBB0_1
	jmp	LBB0_4
LBB0_2:
	movl	(%r14), %ecx
	movl	%ebx, %edx
LBB0_4:
	xorl	%eax, %eax
	cmpl	%ecx, %edx
	jbe	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OWL_I2C_REG_FIFOCTL,8,3        ## @OWL_I2C_REG_FIFOCTL
	.comm	_OWL_I2C_FIFOCTL_RFR,4,2        ## @OWL_I2C_FIFOCTL_RFR
	.comm	_OWL_I2C_FIFOCTL_TFR,4,2        ## @OWL_I2C_FIFOCTL_TFR
	.comm	_OWL_I2C_MAX_RETRIES,4,2        ## @OWL_I2C_MAX_RETRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FIFO reset timeout\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function owl_i2c_reset_fifo
_owl_i2c_reset_fifo:                    ; @owl_i2c_reset_fifo
	.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, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x20, _OWL_I2C_REG_FIFOCTL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _OWL_I2C_REG_FIFOCTL@GOTPAGEOFF]
	ldr	x9, [x20]
Lloh2:
	adrp	x21, _OWL_I2C_FIFOCTL_RFR@GOTPAGE
Lloh3:
	ldr	x21, [x21, _OWL_I2C_FIFOCTL_RFR@GOTPAGEOFF]
	add	x0, x9, x8
	ldr	w8, [x21]
Lloh4:
	adrp	x22, _OWL_I2C_FIFOCTL_TFR@GOTPAGE
Lloh5:
	ldr	x22, [x22, _OWL_I2C_FIFOCTL_TFR@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w1, w9, w8
	mov	w2, #1
	bl	_owl_i2c_update_reg
	mov	w23, #0
Lloh6:
	adrp	x24, _OWL_I2C_MAX_RETRIES@GOTPAGE
Lloh7:
	ldr	x24, [x24, _OWL_I2C_MAX_RETRIES@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #500
	mov	w1, #1000
	bl	_usleep_range
	add	w9, w23, #1
	ldr	w8, [x24]
	cmp	w23, w8
	mov	x23, x9
	b.lo	LBB0_1
; %bb.3:
	mov	x23, x9
	cmp	w23, w8
	b.hi	LBB0_6
LBB0_4:
	mov	w0, #0
	b	LBB0_7
LBB0_5:
	ldr	w8, [x24]
	cmp	w23, w8
	b.ls	LBB0_4
LBB0_6:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh10:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_OWL_I2C_REG_FIFOCTL,8,3        ; @OWL_I2C_REG_FIFOCTL
	.comm	_OWL_I2C_FIFOCTL_RFR,4,2        ; @OWL_I2C_FIFOCTL_RFR
	.comm	_OWL_I2C_FIFOCTL_TFR,4,2        ; @OWL_I2C_FIFOCTL_TFR
	.comm	_OWL_I2C_MAX_RETRIES,4,2        ; @OWL_I2C_MAX_RETRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FIFO reset timeout\n"

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