	.file	"extr_emu8000.c_size_dram.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"EMU8000 [0x%lx]: %d KiB on-board DRAM detected\n"
	.text
	.p2align 4
	.type	size_dram, @function
size_dram:
.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
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r12d, DWORD PTR [rdi]
	test	r12d, r12d
	je	.L17
	add	rsp, 8
	.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
.L17:
	.cfi_restore_state
	mov	edx, DWORD PTR EMU8000_RAM_WRITE[rip]
	xor	esi, esi
	mov	rbx, rdi
	xor	r13d, r13d
	call	snd_emu8000_dma_chan@PLT
	mov	edx, DWORD PTR EMU8000_RAM_READ[rip]
	mov	esi, 1
	mov	rdi, rbx
	call	snd_emu8000_dma_chan@PLT
	mov	rsi, QWORD PTR EMU8000_DRAM_OFFSET[rip]
	mov	rdi, rbx
	call	EMU8000_SMALW_WRITE@PLT
	mov	rsi, QWORD PTR UNIQUE_ID1[rip]
	mov	rdi, rbx
	call	EMU8000_SMLD_WRITE@PLT
	mov	rdi, rbx
	call	snd_emu8000_init_fm@PLT
	mov	rdi, rbx
	call	snd_emu8000_write_wait@PLT
	mov	rsi, QWORD PTR EMU8000_DRAM_OFFSET[rip]
	mov	rdi, rbx
	call	EMU8000_SMALR_WRITE@PLT
	mov	rdi, rbx
	call	EMU8000_SMLD_READ@PLT
	mov	rdi, rbx
	call	EMU8000_SMLD_READ@PLT
	cmp	rax, QWORD PTR UNIQUE_ID1[rip]
	je	.L18
.L3:
	mov	ebp, 10000
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, 1
	call	schedule_timeout_interruptible@PLT
	mov	edi, DWORD PTR current[rip]
	call	signal_pending@PLT
	test	rax, rax
	jne	.L8
	sub	ebp, 1
	je	.L8
.L9:
	mov	rdi, rbx
	call	EMU8000_SMALW_READ@PLT
	test	eax, eax
	js	.L7
.L8:
	mov	edx, DWORD PTR EMU8000_RAM_CLOSE[rip]
	mov	rdi, rbx
	xor	esi, esi
	call	snd_emu8000_dma_chan@PLT
	mov	edx, DWORD PTR EMU8000_RAM_CLOSE[rip]
	mov	rdi, rbx
	mov	esi, 1
	call	snd_emu8000_dma_chan@PLT
	mov	esi, DWORD PTR 8[rbx]
	mov	edx, r13d
	lea	rdi, .LC0[rip]
	call	pr_info@PLT
	mov	DWORD PTR 4[rbx], r12d
	mov	DWORD PTR [rbx], 1
	add	rsp, 8
	.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	rdi, rbx
	call	snd_emu8000_read_wait@PLT
	cmp	DWORD PTR EMU8000_MAX_DRAM[rip], 524288
	jle	.L11
	mov	r12d, 524288
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, rbx
	call	snd_emu8000_read_wait@PLT
	mov	rsi, QWORD PTR EMU8000_DRAM_OFFSET[rip]
	mov	rdi, rbx
	call	EMU8000_SMALR_WRITE@PLT
	mov	rdi, rbx
	call	EMU8000_SMLD_READ@PLT
	mov	rdi, rbx
	call	EMU8000_SMLD_READ@PLT
	cmp	rax, QWORD PTR UNIQUE_ID1[rip]
	jne	.L15
	mov	rdi, rbx
	add	r12d, 524288
	call	snd_emu8000_read_wait@PLT
	cmp	DWORD PTR EMU8000_MAX_DRAM[rip], r12d
	jle	.L15
.L6:
	mov	ebp, r12d
	mov	rsi, QWORD PTR EMU8000_DRAM_OFFSET[rip]
	mov	rdi, rbx
	sar	ebp
	movsx	rbp, ebp
	add	rsi, rbp
	call	EMU8000_SMALW_WRITE@PLT
	mov	rsi, QWORD PTR UNIQUE_ID2[rip]
	mov	rdi, rbx
	call	EMU8000_SMLD_WRITE@PLT
	mov	rdi, rbx
	call	snd_emu8000_write_wait@PLT
	mov	rsi, QWORD PTR EMU8000_DRAM_OFFSET[rip]
	mov	rdi, rbx
	add	rsi, rbp
	call	EMU8000_SMALR_WRITE@PLT
	mov	rdi, rbx
	call	EMU8000_SMLD_READ@PLT
	mov	rdi, rbx
	call	EMU8000_SMLD_READ@PLT
	cmp	rax, QWORD PTR UNIQUE_ID2[rip]
	je	.L4
.L15:
	mov	r13d, r12d
	sar	r13d, 10
	jmp	.L3
.L11:
	mov	r13d, 512
	mov	r12d, 524288
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	size_dram, .-size_dram
	.comm	current,4,4
	.comm	UNIQUE_ID2,8,8
	.comm	UNIQUE_ID1,8,8
	.comm	EMU8000_RAM_WRITE,4,4
	.comm	EMU8000_RAM_READ,4,4
	.comm	EMU8000_RAM_CLOSE,4,4
	.comm	EMU8000_MAX_DRAM,4,4
	.comm	EMU8000_DRAM_OFFSET,8,8
	.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_emu8000.c_size_dram.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"EMU8000 [0x%lx]: %d KiB on-board DRAM detected\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	size_dram, %function
size_dram:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r6, [r0]
	cmp	r6, #0
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r4, r0
	ldr	r3, .L18
	mov	r1, r6
	ldr	r2, [r3]
	bl	snd_emu8000_dma_chan
	ldr	r3, .L18+4
	ldr	r5, .L18+8
	ldr	r2, [r3]
	ldr	r8, .L18+12
	mov	r1, #1
	mov	r0, r4
	bl	snd_emu8000_dma_chan
	ldr	r1, [r5]
	mov	r0, r4
	bl	EMU8000_SMALW_WRITE
	ldr	r1, [r8]
	mov	r0, r4
	bl	EMU8000_SMLD_WRITE
	mov	r0, r4
	bl	snd_emu8000_init_fm
	mov	r0, r4
	bl	snd_emu8000_write_wait
	ldr	r1, [r5]
	mov	r0, r4
	bl	EMU8000_SMALR_WRITE
	mov	r0, r4
	bl	EMU8000_SMLD_READ
	mov	r0, r4
	bl	EMU8000_SMLD_READ
	ldr	r3, [r8]
	cmp	r0, r3
	movne	r8, r6
	beq	.L17
.L3:
	ldr	r5, .L18+16
	ldr	r7, .L18+20
	b	.L9
.L7:
	mov	r0, #1
	bl	schedule_timeout_interruptible
	ldr	r0, [r7]
	bl	signal_pending
	cmp	r0, #0
	bne	.L8
	subs	r5, r5, #1
	beq	.L8
.L9:
	mov	r0, r4
	bl	EMU8000_SMALW_READ
	cmp	r0, #0
	blt	.L7
.L8:
	ldr	r5, .L18+24
	mov	r1, #0
	ldr	r2, [r5]
	mov	r0, r4
	bl	snd_emu8000_dma_chan
	mov	r1, #1
	ldr	r2, [r5]
	mov	r0, r4
	bl	snd_emu8000_dma_chan
	mov	r2, r8
	ldr	r1, [r4, #8]
	ldr	r0, .L18+28
	bl	pr_info
	mov	r3, #1
	stm	r4, {r3, r6}
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	ldr	r9, .L18+32
	mov	r0, r4
	bl	snd_emu8000_read_wait
	ldr	r3, [r9]
	cmp	r3, #524288
	ble	.L11
	mov	r6, #524288
	ldr	r7, .L18+36
	b	.L6
.L4:
	mov	r0, r4
	bl	snd_emu8000_read_wait
	ldr	r1, [r5]
	mov	r0, r4
	bl	EMU8000_SMALR_WRITE
	mov	r0, r4
	bl	EMU8000_SMLD_READ
	mov	r0, r4
	bl	EMU8000_SMLD_READ
	ldr	r3, [r8]
	cmp	r0, r3
	bne	.L15
	mov	r0, r4
	bl	snd_emu8000_read_wait
	ldr	r3, [r9]
	add	r6, r6, #524288
	cmp	r3, r6
	ble	.L15
.L6:
	ldr	r1, [r5]
	mov	r0, r4
	add	r1, r1, r6, asr #1
	bl	EMU8000_SMALW_WRITE
	ldr	r1, [r7]
	mov	r0, r4
	bl	EMU8000_SMLD_WRITE
	mov	r0, r4
	bl	snd_emu8000_write_wait
	ldr	r3, [r5]
	asr	r1, r6, #1
	add	r1, r1, r3
	mov	r0, r4
	bl	EMU8000_SMALR_WRITE
	mov	r0, r4
	bl	EMU8000_SMLD_READ
	mov	r0, r4
	bl	EMU8000_SMLD_READ
	ldr	r3, [r7]
	cmp	r0, r3
	beq	.L4
.L15:
	asr	r8, r6, #10
	b	.L3
.L11:
	mov	r8, #512
	mov	r6, #524288
	b	.L3
.L19:
	.align	2
.L18:
	.word	EMU8000_RAM_WRITE
	.word	EMU8000_RAM_READ
	.word	EMU8000_DRAM_OFFSET
	.word	UNIQUE_ID1
	.word	10000
	.word	current
	.word	EMU8000_RAM_CLOSE
	.word	.LC0
	.word	EMU8000_MAX_DRAM
	.word	UNIQUE_ID2
	.size	size_dram, .-size_dram
	.comm	current,4,4
	.comm	UNIQUE_ID2,4,4
	.comm	UNIQUE_ID1,4,4
	.comm	EMU8000_RAM_WRITE,4,4
	.comm	EMU8000_RAM_READ,4,4
	.comm	EMU8000_RAM_CLOSE,4,4
	.comm	EMU8000_MAX_DRAM,4,4
	.comm	EMU8000_DRAM_OFFSET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
