	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cyapa_poll_state               ## -- Begin function cyapa_poll_state
	.p2align	4, 0x90
_cyapa_poll_state:                      ## @cyapa_poll_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	%esi, %eax
	imulq	$1374389535, %rax, %rbx         ## imm = 0x51EB851F
	shrq	$37, %rbx
	incl	%ebx
	movq	_CYAPA_STATE_BL_BUSY@GOTPCREL(%rip), %r12
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$100, %edi
	callq	_msleep
	decl	%ebx
	je	LBB0_5
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_cyapa_get_state
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r14), %rax
	cmpq	(%r12), %rax
	jle	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_5:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movq	_EAGAIN@GOTPCREL(%rip), %rdx
	cmpl	%ecx, %r15d
	movl	%r15d, %eax
	cmovel	%ecx, %eax
	movl	(%rdx), %edx
	addl	%r15d, %edx
	cmovel	%ecx, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CYAPA_STATE_BL_BUSY,8,3        ## @CYAPA_STATE_BL_BUSY
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cyapa_poll_state               ; -- Begin function cyapa_poll_state
	.p2align	2
_cyapa_poll_state:                      ; @cyapa_poll_state
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	mov	w8, #34079
	movk	w8, #20971, lsl #16
	umull	x8, w1, w8
	lsr	x8, x8, #37
	add	w21, w8, #1
Lloh0:
	adrp	x22, _CYAPA_STATE_BL_BUSY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CYAPA_STATE_BL_BUSY@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #100
	bl	_msleep
	subs	w21, w21, #1
	b.eq	LBB0_5
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_cyapa_get_state
	mov	x20, x0
	cbnz	w0, LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	b.le	LBB0_1
; %bb.4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh2:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _ETIMEDOUT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ETIMEDOUT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmn	w20, w9
	ccmn	w20, w8, #4, ne
	csneg	w0, w20, w9, ne
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_CYAPA_STATE_BL_BUSY,8,3        ; @CYAPA_STATE_BL_BUSY
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
