	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh2_poll_detect
_sh2_poll_detect:                       ## @sh2_poll_detect
	.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, %r12d
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_sh2_cycles_left
	cmpq	%r15, (%rbx)
	jne	LBB0_6
## %bb.1:
	movl	8(%rbx), %ecx
	subl	%eax, %ecx
	cmpl	$10, %ecx
	jg	LBB0_6
## %bb.2:
	movq	24(%rbx), %rcx
	leaq	1(%rcx), %rdx
	movq	%rdx, 24(%rbx)
	movslq	%r12d, %rdx
	cmpq	%rdx, %rcx
	jle	LBB0_7
## %bb.3:
	movq	16(%rbx), %rcx
	testq	%r14, %rcx
	jne	LBB0_5
## %bb.4:
	movq	_EL_32X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rcx, %r8
	orq	%r14, %r8
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_elprintf_sh2
	movq	16(%rbx), %rcx
LBB0_5:
	orq	%r14, %rcx
	movq	%rcx, 16(%rbx)
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_sh2_end_run
	movq	_EVT_POLL_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pevt_log_sh2                   ## TAILCALL
LBB0_6:
	movq	$0, 24(%rbx)
LBB0_7:
	movq	%r15, (%rbx)
	movl	%eax, 8(%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EL_32X,4,2                     ## @EL_32X
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"state: %02x->%02x"

	.comm	_EVT_POLL_START,4,2             ## @EVT_POLL_START
	.no_dead_strip	_sh2_poll_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh2_poll_detect
_sh2_poll_detect:                       ; @sh2_poll_detect
	.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	x22, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_sh2_cycles_left
	ldr	x8, [x19]
	cmp	x8, x21
	b.ne	LBB0_6
; %bb.1:
	ldr	w8, [x19, #8]
	sub	w8, w8, w0
	cmp	w8, #10
	b.gt	LBB0_6
; %bb.2:
	ldr	x8, [x19, #24]
	add	x9, x8, #1
	str	x9, [x19, #24]
	cmp	x8, w22, sxtw
	b.le	LBB0_7
; %bb.3:
	ldr	x3, [x19, #16]
	tst	x3, x20
	b.ne	LBB0_5
; %bb.4:
Lloh0:
	adrp	x8, _EL_32X@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EL_32X@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	orr	x4, x3, x20
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_elprintf_sh2
	ldr	x3, [x19, #16]
LBB0_5:
	orr	x8, x3, x20
	str	x8, [x19, #16]
	mov	x0, x19
	mov	w1, #1
	bl	_sh2_end_run
Lloh5:
	adrp	x8, _EVT_POLL_START@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EVT_POLL_START@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	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
	b	_pevt_log_sh2
LBB0_6:
	str	xzr, [x19, #24]
LBB0_7:
	str	x21, [x19]
	str	w0, [x19, #8]
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EL_32X,4,2                     ; @EL_32X
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"state: %02x->%02x"

	.comm	_EVT_POLL_START,4,2             ; @EVT_POLL_START
	.no_dead_strip	_sh2_poll_detect
.subsections_via_symbols
