	.file	"extr_32x.c_p32x_sync_sh2s.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"sh2 sync to %u"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"sh2 exec to %u %d,%d/%d, flags %x"
	.text
	.p2align 4
	.globl	sync_sh2s_normal
	.type	sync_sh2s_normal, @function
sync_sh2s_normal:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	edx, edi
	lea	rsi, .LC0[rip]
	xor	eax, eax
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, edi
	mov	edi, DWORD PTR EL_32X[rip]
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	elprintf@PLT
	mov	rax, QWORD PTR Pico32x[rip]
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR P32XS_nRES[rip], eax
	jne	.L2
	mov	DWORD PTR ssh2[rip], r12d
	mov	DWORD PTR msh2[rip], r12d
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r14d, DWORD PTR msh2[rip]
	mov	esi, DWORD PTR ssh2[rip]
	lea	r13, .LC1[rip]
	mov	edi, r14d
	call	CYCLES_GT@PLT
	mov	edi, r12d
	test	rax, rax
	cmovne	r14d, DWORD PTR ssh2[rip]
	mov	esi, r14d
	call	CYCLES_GT@PLT
	test	rax, rax
	je	.L66
	.p2align 4,,10
	.p2align 3
.L22:
	mov	esi, DWORD PTR event_time_next[rip]
	test	esi, esi
	jne	.L6
.L9:
	mov	ebx, r12d
.L7:
	mov	ebp, r14d
	.p2align 4,,10
	.p2align 3
.L10:
	mov	esi, ebp
	mov	edi, ebx
	call	CYCLES_GT@PLT
	test	rax, rax
	je	.L67
.L21:
	mov	eax, DWORD PTR Pico32x[rip+8]
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	r9d, r12d
	mov	edx, ebx
	mov	edi, DWORD PTR EL_32X[rip]
	mov	ecx, ebx
	sub	r9d, ebp
	mov	r8d, ebx
	push	rax
	.cfi_def_cfa_offset 64
	sub	ecx, DWORD PTR msh2[rip]
	mov	rsi, r13
	xor	eax, eax
	sub	r8d, DWORD PTR ssh2[rip]
	call	elprintf@PLT
	pop	rdx
	.cfi_def_cfa_offset 56
	mov	eax, DWORD PTR SH2_IDLE_STATES[rip]
	pop	rcx
	.cfi_def_cfa_offset 48
	test	DWORD PTR ssh2[rip+4], eax
	jne	.L11
	mov	esi, ebx
	sub	esi, DWORD PTR ssh2[rip]
	test	esi, esi
	jg	.L68
	mov	ebp, ebx
	test	DWORD PTR msh2[rip+4], eax
	je	.L27
.L28:
	mov	esi, DWORD PTR ssh2[rip]
	mov	edi, ebp
	call	CYCLES_GT@PLT
	mov	edi, ebx
	test	rax, rax
	cmovne	ebp, DWORD PTR ssh2[rip]
	mov	esi, ebp
	call	CYCLES_GT@PLT
	test	rax, rax
	jne	.L21
.L67:
	mov	edi, ebp
	sub	edi, r14d
	mov	r14d, ebp
	call	p32x_timers_do@PLT
	mov	esi, r14d
	mov	edi, r12d
	call	CYCLES_GT@PLT
	test	rax, rax
	jne	.L22
.L66:
	mov	eax, DWORD PTR SH2_IDLE_STATES[rip]
	test	DWORD PTR msh2[rip+4], eax
	jne	.L69
.L23:
	test	DWORD PTR ssh2[rip+4], eax
	je	.L1
	mov	esi, DWORD PTR ssh2[rip]
	mov	edi, r12d
	call	CYCLES_GT@PLT
	test	rax, rax
	je	.L1
	mov	DWORD PTR ssh2[rip], r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	ebp, ebx
	test	DWORD PTR msh2[rip+4], eax
	jne	.L10
.L27:
	mov	esi, DWORD PTR msh2[rip]
	mov	r8d, ebx
	sub	r8d, esi
	test	r8d, r8d
	jg	.L70
	mov	edi, ebx
	call	CYCLES_GT@PLT
	test	rax, rax
	jne	.L19
.L72:
	mov	eax, DWORD PTR SH2_IDLE_STATES[rip]
	mov	ebp, ebx
.L16:
	test	DWORD PTR ssh2[rip+4], eax
	jne	.L10
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L68:
	lea	rdi, ssh2[rip]
	call	run_sh2@PLT
	mov	esi, DWORD PTR event_time_next[rip]
	test	esi, esi
	jne	.L13
.L63:
	mov	eax, DWORD PTR SH2_IDLE_STATES[rip]
	mov	ebp, ebx
	test	DWORD PTR msh2[rip+4], eax
	jne	.L16
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L70:
	mov	esi, r8d
	lea	rdi, msh2[rip]
	call	run_sh2@PLT
	mov	esi, DWORD PTR event_time_next[rip]
	test	esi, esi
	jne	.L71
.L18:
	mov	eax, DWORD PTR SH2_IDLE_STATES[rip]
	mov	ebp, ebx
	test	DWORD PTR msh2[rip+4], eax
	jne	.L16
	mov	esi, DWORD PTR msh2[rip]
	mov	edi, ebx
	call	CYCLES_GT@PLT
	test	rax, rax
	je	.L72
	.p2align 4,,10
	.p2align 3
.L19:
	mov	ebp, DWORD PTR msh2[rip]
	mov	eax, DWORD PTR SH2_IDLE_STATES[rip]
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L71:
	mov	edi, ebx
	call	CYCLES_GT@PLT
	test	rax, rax
	cmovne	ebx, DWORD PTR event_time_next[rip]
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edi, ebx
	call	CYCLES_GT@PLT
	test	rax, rax
	je	.L63
	mov	ebx, DWORD PTR event_time_next[rip]
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, r14d
	call	CYCLES_GE@PLT
	test	rax, rax
	jne	.L73
.L8:
	mov	esi, DWORD PTR event_time_next[rip]
	test	esi, esi
	je	.L9
	mov	edi, r12d
	call	CYCLES_GT@PLT
	test	rax, rax
	je	.L9
	mov	ebx, DWORD PTR event_time_next[rip]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L73:
	mov	edi, r14d
	call	p32x_run_events@PLT
	jmp	.L8
.L69:
	mov	esi, DWORD PTR msh2[rip]
	mov	edi, r12d
	call	CYCLES_GT@PLT
	test	rax, rax
	je	.L64
	mov	DWORD PTR msh2[rip], r12d
.L64:
	mov	eax, DWORD PTR SH2_IDLE_STATES[rip]
	jmp	.L23
	.cfi_endproc
.LFE0:
	.size	sync_sh2s_normal, .-sync_sh2s_normal
	.comm	ssh2,8,8
	.comm	msh2,8,8
	.comm	event_time_next,4,4
	.comm	SH2_IDLE_STATES,4,4
	.comm	Pico32x,16,16
	.comm	P32XS_nRES,4,4
	.comm	EL_32X,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_32x.c_p32x_sync_sh2s.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"sh2 sync to %u\000"
	.align	2
.LC1:
	.ascii	"sh2 exec to %u %d,%d/%d, flags %x\000"
	.text
	.align	2
	.global	sync_sh2s_normal
	.syntax unified
	.arm
	.fpu softvfp
	.type	sync_sh2s_normal, %function
sync_sh2s_normal:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L74
	ldr	r8, .L74+4
	mov	r2, r0
	mov	r7, r0
	ldr	r1, .L74+8
	ldr	r0, [r3]
	sub	sp, sp, #28
	bl	elprintf
	ldr	r2, [r8]
	ldr	r3, .L74+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L2
	ldr	r2, .L74+16
	ldr	r3, .L74+20
	str	r7, [r2]
	str	r7, [r3]
.L1:
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r5, .L74+20
	ldr	r4, .L74+16
	ldr	r3, [r5]
	ldr	r1, [r4]
	mov	r0, r3
	str	r3, [sp, #20]
	bl	CYCLES_GT
	cmp	r0, #0
	ldrne	r3, [r4]
	ldr	r6, .L74+24
	ldr	r10, .L74+28
	strne	r3, [sp, #20]
.L5:
	mov	r0, r7
	ldr	r1, [sp, #20]
	bl	CYCLES_GT
	cmp	r0, #0
	beq	.L67
	ldr	r3, .L74+32
	ldr	r1, [r3]
	cmp	r1, #0
	bne	.L6
.L9:
	mov	r9, r7
.L7:
	ldr	fp, [sp, #20]
.L10:
	mov	r1, fp
	mov	r0, r9
	bl	CYCLES_GT
	cmp	r0, #0
	beq	.L68
	ldr	r2, [r4]
	sub	fp, r7, fp
	sub	r2, r9, r2
	stm	sp, {r2, fp}
	ldr	r1, [r8, #4]
	ldr	r3, [r5]
	ldr	r0, .L74
	str	r1, [sp, #8]
	mov	r2, r9
	sub	r3, r9, r3
	mov	r1, r10
	ldr	r0, [r0]
	bl	elprintf
	ldr	r3, [r6]
	ldr	r2, [r4, #4]
	tst	r3, r2
	bne	.L11
	ldr	r1, [r4]
	sub	r1, r9, r1
	cmp	r1, #0
	bgt	.L69
	ldr	r2, [r5, #4]
	tst	r3, r2
	movne	fp, r9
	beq	.L27
.L28:
	mov	r0, fp
	ldr	r1, [r4]
	bl	CYCLES_GT
	cmp	r0, #0
	ldrne	fp, [r4]
	b	.L10
.L11:
	ldr	r2, [r5, #4]
	tst	r3, r2
	movne	fp, r9
	bne	.L10
.L27:
	ldr	r1, [r5]
	sub	r3, r9, r1
	cmp	r3, #0
	bgt	.L70
.L17:
	mov	r0, r9
	bl	CYCLES_GT
	cmp	r0, #0
	moveq	fp, r9
	ldreq	r3, [r6]
	ldrne	fp, [r5]
	ldrne	r3, [r6]
.L16:
	ldr	r2, [r4, #4]
	tst	r3, r2
	bne	.L10
	b	.L28
.L69:
	ldr	r0, .L74+16
	bl	run_sh2
	ldr	r3, .L74+32
	ldr	r1, [r3]
	cmp	r1, #0
	bne	.L13
.L65:
	ldr	r3, [r6]
	ldr	r2, [r5, #4]
	tst	r3, r2
	beq	.L27
.L30:
	mov	fp, r9
	b	.L16
.L70:
	mov	r1, r3
	ldr	r0, .L74+20
	bl	run_sh2
	ldr	r3, .L74+32
	ldr	r1, [r3]
	cmp	r1, #0
	bne	.L71
.L18:
	ldr	r3, [r6]
	ldr	r2, [r5, #4]
	tst	r3, r2
	bne	.L30
	ldr	r1, [r5]
	b	.L17
.L68:
	ldr	r3, [sp, #20]
	sub	r0, fp, r3
	bl	p32x_timers_do
	str	fp, [sp, #20]
	b	.L5
.L71:
	mov	r0, r9
	bl	CYCLES_GT
	cmp	r0, #0
	ldrne	r3, .L74+32
	ldrne	r9, [r3]
	b	.L18
.L13:
	mov	r0, r9
	bl	CYCLES_GT
	cmp	r0, #0
	ldrne	r3, .L74+32
	ldrne	r9, [r3]
	b	.L65
.L6:
	ldr	r0, [sp, #20]
	bl	CYCLES_GE
	cmp	r0, #0
	bne	.L72
.L8:
	ldr	r9, .L74+32
	ldr	r1, [r9]
	cmp	r1, #0
	beq	.L9
	mov	r0, r7
	bl	CYCLES_GT
	cmp	r0, #0
	beq	.L9
	ldr	r9, [r9]
	b	.L7
.L67:
	ldr	r3, [r6]
	ldr	r2, [r5, #4]
	tst	r3, r2
	bne	.L73
.L23:
	ldr	r2, [r4, #4]
	tst	r3, r2
	beq	.L1
	mov	r0, r7
	ldr	r1, [r4]
	bl	CYCLES_GT
	cmp	r0, #0
	strne	r7, [r4]
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L72:
	ldr	r0, [sp, #20]
	bl	p32x_run_events
	b	.L8
.L73:
	mov	r0, r7
	ldr	r1, [r5]
	bl	CYCLES_GT
	cmp	r0, #0
	ldr	r3, [r6]
	strne	r7, [r5]
	b	.L23
.L75:
	.align	2
.L74:
	.word	EL_32X
	.word	Pico32x
	.word	.LC0
	.word	P32XS_nRES
	.word	ssh2
	.word	msh2
	.word	SH2_IDLE_STATES
	.word	.LC1
	.word	event_time_next
	.size	sync_sh2s_normal, .-sync_sh2s_normal
	.comm	ssh2,8,4
	.comm	msh2,8,4
	.comm	event_time_next,4,4
	.comm	SH2_IDLE_STATES,4,4
	.comm	Pico32x,8,4
	.comm	P32XS_nRES,4,4
	.comm	EL_32X,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
