	.file	"extr_sdla.c_sdla_cpuspeed.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s: SCC bad\n"
	.text
	.p2align 4
	.type	sdla_cpuspeed, @function
sdla_cpuspeed:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	sdla_start@PLT
	mov	eax, DWORD PTR HZ[rip]
	xor	r8d, r8d
	xor	esi, esi
	movsx	ecx, BYTE PTR Z80_READY[rip]
	mov	rdi, rbx
	lea	edx, [rax+rax*2]
	call	sdla_z80_poll@PLT
	test	eax, eax
	js	.L15
	lea	r13, 7[rsp]
	mov	ecx, 1
	xor	esi, esi
	mov	rdi, rbx
	movzx	eax, BYTE PTR LOADER_READY[rip]
	mov	rdx, r13
	mov	BYTE PTR 7[rsp], al
	call	sdla_write@PLT
	mov	eax, DWORD PTR HZ[rip]
	xor	esi, esi
	mov	rdi, rbx
	movsx	ecx, BYTE PTR Z80_SCC_OK[rip]
	movsx	r8d, BYTE PTR Z80_SCC_BAD[rip]
	lea	edx, 0[0+rax*8]
	call	sdla_z80_poll@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L15
	mov	rdi, rbx
	call	sdla_stop@PLT
	xor	esi, esi
	mov	ecx, 1
	mov	rdx, r13
	mov	rdi, rbx
	call	sdla_read@PLT
	movzx	eax, BYTE PTR 7[rsp]
	cmp	al, BYTE PTR Z80_SCC_BAD[rip]
	je	.L17
	cmp	al, BYTE PTR Z80_SCC_OK[rip]
	jne	.L18
	cmp	r12d, 164
	jg	.L7
	mov	eax, DWORD PTR SDLA_CPU_16M[rip]
	mov	DWORD PTR 0[rbp], eax
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	esi, DWORD PTR [rbx]
	lea	rdi, .LC0[rip]
	call	printk@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	mov	eax, DWORD PTR EIO[rip]
	neg	eax
.L1:
	mov	rbx, QWORD PTR 8[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L19
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	cmp	r12d, 219
	jle	.L20
	cmp	r12d, 257
	jg	.L9
	mov	eax, DWORD PTR SDLA_CPU_8M[rip]
	mov	DWORD PTR 0[rbp], eax
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	eax, DWORD PTR SDLA_CPU_10M[rip]
	mov	DWORD PTR 0[rbp], eax
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	cmp	r12d, 356
	jg	.L10
	mov	eax, DWORD PTR SDLA_CPU_7M[rip]
	mov	DWORD PTR 0[rbp], eax
	xor	eax, eax
	jmp	.L1
.L10:
	cmp	r12d, 466
	jg	.L11
	mov	eax, DWORD PTR SDLA_CPU_5M[rip]
	mov	DWORD PTR 0[rbp], eax
	xor	eax, eax
	jmp	.L1
.L11:
	mov	eax, DWORD PTR SDLA_CPU_3M[rip]
	mov	DWORD PTR 0[rbp], eax
	xor	eax, eax
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sdla_cpuspeed, .-sdla_cpuspeed
	.comm	Z80_SCC_OK,1,1
	.comm	Z80_SCC_BAD,1,1
	.comm	Z80_READY,1,1
	.comm	SDLA_CPU_8M,4,4
	.comm	SDLA_CPU_7M,4,4
	.comm	SDLA_CPU_5M,4,4
	.comm	SDLA_CPU_3M,4,4
	.comm	SDLA_CPU_16M,4,4
	.comm	SDLA_CPU_10M,4,4
	.comm	LOADER_READY,1,1
	.comm	HZ,4,4
	.comm	EIO,4,4
	.comm	EINVAL,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_sdla.c_sdla_cpuspeed.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s: SCC bad\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sdla_cpuspeed, %function
sdla_cpuspeed:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, #0
	mov	r5, r0
	ldr	r3, .L21
	ldr	r7, .L21+4
	sub	sp, sp, #20
	mov	r6, r1
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	sdla_start
	ldr	r2, [r7]
	ldr	r3, .L21+8
	str	r4, [sp]
	mov	r0, r5
	mov	r1, r4
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r2, r2, r2, lsl #1
	bl	sdla_z80_poll
	cmp	r0, r4
	blt	.L15
	ldr	r3, .L21+12
	ldr	r8, .L21+16
	ldrb	ip, [r3]	@ zero_extendqisi2
	mov	r1, r4
	mov	r3, #1
	add	r2, sp, #11
	mov	r0, r5
	strb	ip, [sp, #11]
	ldr	r9, .L21+20
	bl	sdla_write
	ldr	r2, [r7]
	ldrb	r3, [r8]	@ zero_extendqisi2
	mov	r1, r4
	str	r3, [sp]
	mov	r0, r5
	ldrb	r3, [r9]	@ zero_extendqisi2
	lsl	r2, r2, #3
	bl	sdla_z80_poll
	subs	r7, r0, #0
	blt	.L15
	mov	r0, r5
	bl	sdla_stop
	mov	r3, #1
	add	r2, sp, #11
	mov	r1, r4
	mov	r0, r5
	bl	sdla_read
	ldrb	r2, [r8]	@ zero_extendqisi2
	ldrb	r3, [sp, #11]	@ zero_extendqisi2
	cmp	r2, r3
	beq	.L17
	ldrb	r2, [r9]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L18
	cmp	r7, #164
	bgt	.L7
	ldr	r3, .L21+24
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [r6]
	b	.L1
.L17:
	ldr	r1, [r5]
	ldr	r0, .L21+28
	bl	printk
.L15:
	ldr	r3, .L21+32
	ldr	r4, [r3]
	rsb	r0, r4, #0
.L1:
	ldr	r3, .L21
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L19
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L18:
	ldr	r3, .L21+36
	ldr	r4, [r3]
	rsb	r0, r4, #0
	b	.L1
.L7:
	cmp	r7, #219
	ble	.L20
	ldr	r3, .L21+40
	cmp	r7, r3
	bgt	.L9
	ldr	r3, .L21+44
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [r6]
	b	.L1
.L20:
	ldr	r3, .L21+48
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [r6]
	b	.L1
.L9:
	cmp	r7, #356
	bgt	.L10
	ldr	r3, .L21+52
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [r6]
	b	.L1
.L10:
	ldr	r3, .L21+56
	cmp	r7, r3
	ldrle	r3, .L21+60
	ldrgt	r3, .L21+64
	movle	r0, r4
	ldr	r3, [r3]
	movgt	r0, r4
	str	r3, [r6]
	b	.L1
.L19:
	bl	__stack_chk_fail
.L22:
	.align	2
.L21:
	.word	.LC1
	.word	HZ
	.word	Z80_READY
	.word	LOADER_READY
	.word	Z80_SCC_BAD
	.word	Z80_SCC_OK
	.word	SDLA_CPU_16M
	.word	.LC0
	.word	EIO
	.word	EINVAL
	.word	257
	.word	SDLA_CPU_8M
	.word	SDLA_CPU_10M
	.word	SDLA_CPU_7M
	.word	466
	.word	SDLA_CPU_5M
	.word	SDLA_CPU_3M
	.size	sdla_cpuspeed, .-sdla_cpuspeed
	.comm	Z80_SCC_OK,1,1
	.comm	Z80_SCC_BAD,1,1
	.comm	Z80_READY,1,1
	.comm	SDLA_CPU_8M,4,4
	.comm	SDLA_CPU_7M,4,4
	.comm	SDLA_CPU_5M,4,4
	.comm	SDLA_CPU_3M,4,4
	.comm	SDLA_CPU_16M,4,4
	.comm	SDLA_CPU_10M,4,4
	.comm	LOADER_READY,1,1
	.comm	HZ,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
