	.file	"extr_radeon_cp.c_radeon_get_scratch.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	radeon_get_scratch
	.type	radeon_get_scratch, @function
radeon_get_scratch:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	mov	edx, DWORD PTR CHIP_R600[rip]
	mov	edi, esi
	mov	eax, DWORD PTR 0[rbp]
	and	eax, DWORD PTR RADEON_FAMILY_MASK[rip]
	cmp	QWORD PTR 8[rbp], 0
	je	.L2
	cmp	eax, edx
	jl	.L3
	call	R600_SCRATCHOFF@PLT
	mov	rdi, rbp
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	mov	esi, eax
	jmp	radeon_read_ring_rptr@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	sal	edi, 2
	movsx	rdi, edi
	cmp	eax, edx
	jl	.L4
	add	rdi, QWORD PTR R600_SCRATCH_REG0[rip]
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	RADEON_READ@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	add	rdi, QWORD PTR RADEON_SCRATCH_REG0[rip]
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	RADEON_READ@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	call	RADEON_SCRATCHOFF@PLT
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 8
	mov	esi, eax
	jmp	radeon_read_ring_rptr@PLT
	.cfi_endproc
.LFE0:
	.size	radeon_get_scratch, .-radeon_get_scratch
	.comm	RADEON_SCRATCH_REG0,8,8
	.comm	RADEON_FAMILY_MASK,4,4
	.comm	R600_SCRATCH_REG0,8,8
	.comm	CHIP_R600,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_radeon_cp.c_radeon_get_scratch.c"
	.text
	.align	2
	.global	radeon_get_scratch
	.syntax unified
	.arm
	.fpu softvfp
	.type	radeon_get_scratch, %function
radeon_get_scratch:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, lr}
	mov	r4, r0
	ldr	r2, .L7
	ldr	r0, [r0, #4]
	ldr	ip, [r2]
	ldr	r3, [r4]
	ldr	r2, .L7+4
	cmp	r0, #0
	ldr	r2, [r2]
	mov	r0, r1
	and	r3, r3, ip
	beq	.L2
	cmp	r3, r2
	blt	.L3
	bl	R600_SCRATCHOFF
	mov	r1, r0
	mov	r0, r4
	pop	{r4, lr}
	b	radeon_read_ring_rptr
.L2:
	cmp	r3, r2
	lsl	r0, r1, #2
	blt	.L4
	pop	{r4, lr}
	ldr	r3, .L7+8
	ldr	r3, [r3]
	add	r0, r0, r3
	b	RADEON_READ
.L4:
	ldr	r3, .L7+12
	pop	{r4, lr}
	ldr	r3, [r3]
	add	r0, r0, r3
	b	RADEON_READ
.L3:
	bl	RADEON_SCRATCHOFF
	mov	r1, r0
	mov	r0, r4
	pop	{r4, lr}
	b	radeon_read_ring_rptr
.L8:
	.align	2
.L7:
	.word	RADEON_FAMILY_MASK
	.word	CHIP_R600
	.word	R600_SCRATCH_REG0
	.word	RADEON_SCRATCH_REG0
	.size	radeon_get_scratch, .-radeon_get_scratch
	.comm	RADEON_SCRATCH_REG0,4,4
	.comm	RADEON_FAMILY_MASK,4,4
	.comm	R600_SCRATCH_REG0,4,4
	.comm	CHIP_R600,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
