	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sii8620_wait_for_fsm_state
_sii8620_wait_for_fsm_state:            ## @sii8620_wait_for_fsm_state
	.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, %r14d
	movq	%rdi, %r15
	movl	$10, %ebx
	movq	_MSK_COC_STAT_0_FSM_STATE@GOTPCREL(%rip), %r13
	movq	_BIT_COC_STAT_0_PLL_LOCKED@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_REG_COC_STAT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_sii8620_readb
	movl	(%r13), %ecx
	andl	%eax, %ecx
	cmpl	%r14d, %ecx
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%eax, (%r12)
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$4000, %edi                     ## imm = 0xFA0
	movl	$6000, %esi                     ## imm = 0x1770
	callq	_usleep_range
	decl	%ebx
	jne	LBB0_1
## %bb.6:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_2:
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_COC_STAT_0,4,2             ## @REG_COC_STAT_0
	.comm	_MSK_COC_STAT_0_FSM_STATE,4,2   ## @MSK_COC_STAT_0_FSM_STATE
	.comm	_BIT_COC_STAT_0_PLL_LOCKED,4,2  ## @BIT_COC_STAT_0_PLL_LOCKED
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_sii8620_wait_for_fsm_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sii8620_wait_for_fsm_state
_sii8620_wait_for_fsm_state:            ; @sii8620_wait_for_fsm_state
	.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
	mov	w21, #10
Lloh0:
	adrp	x22, _REG_COC_STAT_0@GOTPAGE
Lloh1:
	ldr	x22, [x22, _REG_COC_STAT_0@GOTPAGEOFF]
Lloh2:
	adrp	x23, _MSK_COC_STAT_0_FSM_STATE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _MSK_COC_STAT_0_FSM_STATE@GOTPAGEOFF]
Lloh4:
	adrp	x24, _BIT_COC_STAT_0_PLL_LOCKED@GOTPAGE
Lloh5:
	ldr	x24, [x24, _BIT_COC_STAT_0_PLL_LOCKED@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x20
	bl	_sii8620_readb
	ldr	w8, [x23]
	and	w8, w8, w0
	cmp	w8, w19
	b.eq	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #4000
	mov	w1, #6000
	bl	_usleep_range
	subs	w21, w21, #1
	b.ne	LBB0_1
; %bb.4:
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	mov	w0, #0
	b	LBB0_8
LBB0_6:
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_COC_STAT_0,4,2             ; @REG_COC_STAT_0
	.comm	_MSK_COC_STAT_0_FSM_STATE,4,2   ; @MSK_COC_STAT_0_FSM_STATE
	.comm	_BIT_COC_STAT_0_PLL_LOCKED,4,2  ; @BIT_COC_STAT_0_PLL_LOCKED
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_sii8620_wait_for_fsm_state
.subsections_via_symbols
