	.file	"extr_rs690.c_rs690_compute_mode_priority.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rs690_compute_mode_priority, @function
rs690_compute_mode_priority:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rcx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	mov	edi, 1
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, r8
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, r9
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	S_006548_D1MODE_PRIORITY_A_OFF@PLT
	mov	edi, 1
	mov	DWORD PTR [r12], eax
	call	S_006548_D1MODE_PRIORITY_A_OFF@PLT
	mov	rcx, QWORD PTR 80[rsp]
	mov	DWORD PTR [rcx], eax
	test	r15, r15
	je	.L13
	test	r13, r13
	jne	.L38
	test	r15, r15
	je	.L13
	mov	rdi, QWORD PTR 56[rbx]
	call	dfixed_trunc@PLT
	mov	rsi, QWORD PTR 48[rbx]
	cmp	eax, 64
	jg	.L39
.L15:
	mov	rdi, QWORD PTR 40[rbx]
	call	dfixed_div@PLT
	mov	rsi, QWORD PTR 16[rbx]
	cmp	rax, rsi
	jl	.L40
	mov	rdi, QWORD PTR 24[rbx]
	call	dfixed_mul@PLT
	mov	rbp, rax
.L35:
	mov	edi, 16000
	call	dfixed_const@PLT
	mov	rdi, rbp
	mov	rsi, rax
	call	dfixed_div@PLT
	mov	rdi, QWORD PTR [rbx]
	cmp	QWORD PTR 8[rbx], rdi
	cmovge	rdi, QWORD PTR 8[rbx]
	cmp	rdi, rax
	cmovl	rdi, rax
	call	dfixed_trunc@PLT
	mov	DWORD PTR [r12], eax
	cmp	DWORD PTR [r14], 2
	jne	.L1
	mov	edi, 1
	call	S_006548_D1MODE_PRIORITY_A_ALWAYS_ON@PLT
	or	DWORD PTR [r12], eax
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	mov	rdi, QWORD PTR 56[rbx]
	call	dfixed_trunc@PLT
	cmp	eax, 64
	jg	.L41
	mov	r13, QWORD PTR 48[rbx]
.L4:
	mov	rdi, QWORD PTR 56[rbp]
	call	dfixed_trunc@PLT
	mov	rsi, QWORD PTR 48[rbp]
	cmp	eax, 64
	jg	.L42
.L6:
	mov	rdi, QWORD PTR 40[rbx]
	add	rsi, r13
	call	dfixed_div@PLT
	mov	rsi, QWORD PTR 16[rbx]
	cmp	rax, rsi
	jl	.L43
	mov	rdi, QWORD PTR 24[rbx]
	mov	QWORD PTR 8[rsp], rax
	call	dfixed_mul@PLT
	mov	r13, rax
.L33:
	mov	edi, 16000
	call	dfixed_const@PLT
	mov	rdi, r13
	mov	rsi, rax
	call	dfixed_div@PLT
	mov	rdx, QWORD PTR 8[rsp]
	mov	rsi, QWORD PTR 16[rbp]
	mov	r15, rax
	cmp	rdx, rsi
	jge	.L9
	sub	rsi, rdx
	mov	rdi, rsi
	mov	rsi, QWORD PTR 32[rbp]
	call	dfixed_mul@PLT
	mov	rsi, QWORD PTR 16[rbp]
	mov	rdi, QWORD PTR 24[rbp]
	mov	r13, rax
	call	dfixed_mul@PLT
	add	r13, rax
.L34:
	mov	edi, 16000
	call	dfixed_const@PLT
	mov	rdi, r13
	mov	rsi, rax
	call	dfixed_div@PLT
	mov	rdx, QWORD PTR 0[rbp]
	cmp	QWORD PTR 8[rbp], rdx
	cmovge	rdx, QWORD PTR 8[rbp]
	mov	rdi, QWORD PTR [rbx]
	cmp	rdx, rax
	cmovge	rax, rdx
	cmp	QWORD PTR 8[rbx], rdi
	cmovge	rdi, QWORD PTR 8[rbx]
	cmp	rdi, r15
	mov	rbp, rax
	cmovl	rdi, r15
	call	dfixed_trunc@PLT
	mov	rdi, rbp
	mov	DWORD PTR [r12], eax
	call	dfixed_trunc@PLT
	mov	rcx, QWORD PTR 80[rsp]
	mov	DWORD PTR [rcx], eax
	cmp	DWORD PTR [r14], 2
	jne	.L1
	mov	edi, 1
	call	S_006548_D1MODE_PRIORITY_A_ALWAYS_ON@PLT
	or	DWORD PTR [r12], eax
	mov	edi, 1
	call	S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON@PLT
	mov	rcx, QWORD PTR 80[rsp]
	or	DWORD PTR [rcx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	test	r13, r13
	je	.L1
	mov	rdi, QWORD PTR 56[rbp]
	call	dfixed_trunc@PLT
	mov	rsi, QWORD PTR 48[rbp]
	cmp	eax, 64
	jg	.L44
.L20:
	mov	rdi, QWORD PTR 40[rbp]
	call	dfixed_div@PLT
	mov	rsi, QWORD PTR 16[rbp]
	cmp	rax, rsi
	jge	.L21
	sub	rsi, rax
	mov	rdi, rsi
	mov	rsi, QWORD PTR 32[rbp]
	call	dfixed_mul@PLT
	mov	rsi, QWORD PTR 16[rbp]
	mov	rdi, QWORD PTR 24[rbp]
	mov	r12, rax
	call	dfixed_mul@PLT
	add	r12, rax
.L36:
	mov	edi, 16000
	call	dfixed_const@PLT
	mov	rdi, r12
	mov	rsi, rax
	call	dfixed_div@PLT
	mov	rdi, QWORD PTR 0[rbp]
	cmp	QWORD PTR 8[rbp], rdi
	cmovge	rdi, QWORD PTR 8[rbp]
	cmp	rdi, rax
	cmovl	rdi, rax
	call	dfixed_trunc@PLT
	mov	rcx, QWORD PTR 80[rsp]
	mov	DWORD PTR [rcx], eax
	cmp	DWORD PTR [r14], 2
	jne	.L1
	mov	edi, 1
	call	S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON@PLT
	mov	rcx, QWORD PTR 80[rsp]
	or	DWORD PTR [rcx], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L40:
	sub	rsi, rax
	mov	rdi, rsi
	mov	rsi, QWORD PTR 32[rbx]
	call	dfixed_mul@PLT
	mov	rsi, QWORD PTR 16[rbx]
	mov	rdi, QWORD PTR 24[rbx]
	mov	rbp, rax
	call	dfixed_mul@PLT
	add	rbp, rax
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L43:
	sub	rsi, rax
	mov	QWORD PTR 8[rsp], rax
	mov	rdi, rsi
	mov	rsi, QWORD PTR 32[rbx]
	call	dfixed_mul@PLT
	mov	rsi, QWORD PTR 16[rbx]
	mov	rdi, QWORD PTR 24[rbx]
	mov	r13, rax
	call	dfixed_mul@PLT
	add	r13, rax
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdi, QWORD PTR 24[rbp]
	call	dfixed_mul@PLT
	mov	r13, rax
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L39:
	mov	rdi, QWORD PTR 56[rbx]
	call	dfixed_mul@PLT
	mov	rsi, rax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L42:
	mov	rdi, QWORD PTR 56[rbp]
	call	dfixed_mul@PLT
	mov	rsi, rax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L41:
	mov	rsi, QWORD PTR 48[rbx]
	mov	rdi, QWORD PTR 56[rbx]
	call	dfixed_mul@PLT
	mov	r13, rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdi, QWORD PTR 24[rbp]
	call	dfixed_mul@PLT
	mov	r12, rax
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L44:
	mov	rdi, QWORD PTR 56[rbp]
	call	dfixed_mul@PLT
	mov	rsi, rax
	jmp	.L20
	.cfi_endproc
.LFE0:
	.size	rs690_compute_mode_priority, .-rs690_compute_mode_priority
	.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_rs690.c_rs690_compute_mode_priority.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rs690_compute_mode_priority, %function
rs690_compute_mode_priority:
	@ args = 12, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r7, r0
	mov	r0, #1
	mov	r6, r3
	mov	r4, r1
	mov	r5, r2
	ldr	r10, [sp, #32]
	ldr	r8, [sp, #36]
	ldr	r9, [sp, #40]
	bl	S_006548_D1MODE_PRIORITY_A_OFF
	str	r0, [r8]
	mov	r0, #1
	bl	S_006548_D1MODE_PRIORITY_A_OFF
	cmp	r6, #0
	cmpne	r10, #0
	str	r0, [r9]
	bne	.L29
	cmp	r6, #0
	beq	.L13
	ldr	r0, [r4, #28]
	bl	dfixed_trunc
	cmp	r0, #64
	ldr	r1, [r4, #24]
	bgt	.L30
.L15:
	ldr	r0, [r4, #20]
	bl	dfixed_div
	ldr	r1, [r4, #8]
	cmp	r0, r1
	blt	.L31
	ldr	r0, [r4, #12]
	bl	dfixed_mul
	mov	r5, r0
	mov	r0, #16000
	bl	dfixed_const
	mov	r1, r0
	mov	r0, r5
	bl	dfixed_div
.L17:
	ldm	r4, {r2, r3}
	cmp	r3, r2
	movlt	r3, r2
	cmp	r3, r0
	movge	r0, r3
	bl	dfixed_trunc
	str	r0, [r8]
	ldr	r3, [r7]
	cmp	r3, #2
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r0, #1
	bl	S_006548_D1MODE_PRIORITY_A_ALWAYS_ON
	ldr	r3, [r8]
	orr	r3, r3, r0
	str	r3, [r8]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	cmp	r10, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r0, [r5, #28]
	bl	dfixed_trunc
	cmp	r0, #64
	ldr	r1, [r5, #24]
	bgt	.L32
.L20:
	ldr	r0, [r5, #20]
	bl	dfixed_div
	ldr	r1, [r5, #8]
	cmp	r0, r1
	bge	.L21
	sub	r0, r1, r0
	ldr	r1, [r5, #16]
	bl	dfixed_mul
	ldr	r1, [r5, #8]
	mov	r4, r0
	ldr	r0, [r5, #12]
	bl	dfixed_mul
	mov	r3, r0
	mov	r0, #16000
	add	r4, r4, r3
	bl	dfixed_const
	mov	r1, r0
	mov	r0, r4
	bl	dfixed_div
.L22:
	ldm	r5, {r2, r3}
	cmp	r3, r2
	movlt	r3, r2
	cmp	r3, r0
	movge	r0, r3
	bl	dfixed_trunc
	str	r0, [r9]
	ldr	r3, [r7]
	cmp	r3, #2
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r0, #1
	bl	S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON
	ldr	r3, [r9]
	orr	r3, r3, r0
	str	r3, [r9]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L29:
	ldr	r0, [r4, #28]
	bl	dfixed_trunc
	cmp	r0, #64
	ldrle	r6, [r4, #24]
	bgt	.L33
.L4:
	ldr	r0, [r5, #28]
	bl	dfixed_trunc
	cmp	r0, #64
	ldrle	r0, [r5, #24]
	bgt	.L34
.L6:
	add	r1, r6, r0
	ldr	r0, [r4, #20]
	bl	dfixed_div
	ldr	r1, [r4, #8]
	mov	r10, r0
	cmp	r0, r1
	blt	.L35
	ldr	r0, [r4, #12]
	bl	dfixed_mul
	mov	r6, r0
	mov	r0, #16000
.L27:
	bl	dfixed_const
	mov	r1, r0
	mov	r0, r6
	bl	dfixed_div
	ldr	r1, [r5, #8]
	mov	r6, r0
	cmp	r10, r1
	bge	.L9
	sub	r0, r1, r10
	ldr	r1, [r5, #16]
	bl	dfixed_mul
	ldr	r1, [r5, #8]
	mov	r10, r0
	ldr	r0, [r5, #12]
	bl	dfixed_mul
	mov	r3, r0
	mov	r0, #16000
	add	r10, r10, r3
	bl	dfixed_const
	mov	r1, r0
	mov	r0, r10
	bl	dfixed_div
.L10:
	ldm	r5, {r1, r3}
	cmp	r3, r1
	movlt	r3, r1
	ldr	r2, [r4, #4]
	ldr	r1, [r4]
	cmp	r3, r0
	movge	r4, r3
	movlt	r4, r0
	cmp	r2, r1
	movlt	r2, r1
	cmp	r2, r6
	movge	r0, r2
	movlt	r0, r6
	bl	dfixed_trunc
	mov	r3, r0
	mov	r0, r4
	str	r3, [r8]
	bl	dfixed_trunc
	str	r0, [r9]
	ldr	r3, [r7]
	cmp	r3, #2
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r0, #1
	bl	S_006548_D1MODE_PRIORITY_A_ALWAYS_ON
	mov	r2, r0
	ldr	r3, [r8]
	mov	r0, #1
	orr	r3, r3, r2
	str	r3, [r8]
	bl	S_006D48_D2MODE_PRIORITY_A_ALWAYS_ON
	ldr	r3, [r9]
	orr	r3, r3, r0
	str	r3, [r9]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L31:
	sub	r0, r1, r0
	ldr	r1, [r4, #16]
	bl	dfixed_mul
	ldr	r1, [r4, #8]
	mov	r5, r0
	ldr	r0, [r4, #12]
	bl	dfixed_mul
	mov	r3, r0
	mov	r0, #16000
	add	r5, r5, r3
	bl	dfixed_const
	mov	r1, r0
	mov	r0, r5
	bl	dfixed_div
	b	.L17
.L35:
	sub	r0, r1, r0
	ldr	r1, [r4, #16]
	bl	dfixed_mul
	ldr	r1, [r4, #8]
	mov	r6, r0
	ldr	r0, [r4, #12]
	bl	dfixed_mul
	mov	r3, r0
	mov	r0, #16000
	add	r6, r6, r3
	b	.L27
.L9:
	ldr	r0, [r5, #12]
	bl	dfixed_mul
	mov	r10, r0
	mov	r0, #16000
	bl	dfixed_const
	mov	r1, r0
	mov	r0, r10
	bl	dfixed_div
	b	.L10
.L30:
	ldr	r0, [r4, #28]
	bl	dfixed_mul
	mov	r1, r0
	b	.L15
.L34:
	ldr	r1, [r5, #24]
	ldr	r0, [r5, #28]
	bl	dfixed_mul
	b	.L6
.L33:
	ldr	r1, [r4, #24]
	ldr	r0, [r4, #28]
	bl	dfixed_mul
	mov	r6, r0
	b	.L4
.L21:
	ldr	r0, [r5, #12]
	bl	dfixed_mul
	mov	r4, r0
	mov	r0, #16000
	bl	dfixed_const
	mov	r1, r0
	mov	r0, r4
	bl	dfixed_div
	b	.L22
.L32:
	ldr	r0, [r5, #28]
	bl	dfixed_mul
	mov	r1, r0
	b	.L20
	.size	rs690_compute_mode_priority, .-rs690_compute_mode_priority
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
