	.file	"extr_mach64_gx.c_aty_var_to_pll_18818.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	aty_var_to_pll_18818, @function
aty_var_to_pll_18818:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, 100000000
	cdq
	idiv	esi
	cmp	DWORD PTR MAX_FREQ_2595[rip], eax
	mov	edi, eax
	jl	.L4
	cmp	DWORD PTR ABS_MIN_FREQ_2595[rip], eax
	jg	.L4
	mov	r10d, DWORD PTR MIN_FREQ_2595[rip]
	mov	edx, DWORD PTR REF_DIV_2595[rip]
	mov	r11d, DWORD PTR REF_FREQ_2595[rip]
	mov	r9d, DWORD PTR N_ADJ_2595[rip]
	cmp	eax, r10d
	jge	.L5
	mov	r8d, 1
	.p2align 4,,10
	.p2align 3
.L6:
	add	edi, edi
	add	r8d, r8d
	cmp	edi, r10d
	jl	.L6
	imul	edi, edx
	imul	eax, edi, 1000
	cdq
	idiv	r11d
	add	eax, 500
	movsx	rdx, eax
	sar	eax, 31
	imul	rdx, rdx, 274877907
	sar	rdx, 38
	sub	edx, eax
	mov	eax, edx
	sub	eax, r9d
	cmp	r8d, 2
	je	.L7
	mov	edx, eax
	or	dh, 2
	cmp	r8d, 4
	cmove	eax, edx
.L9:
	or	eax, DWORD PTR STOP_BITS_2595[rip]
	mov	QWORD PTR 16[rcx], 0
	mov	DWORD PTR [rcx], eax
	xor	eax, eax
	mov	DWORD PTR 4[rcx], r8d
	mov	DWORD PTR 8[rcx], esi
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	imul	eax, edx
	mov	r8d, 1
	imul	eax, eax, 1000
	cdq
	idiv	r11d
	lea	edx, 500[rax]
	movsx	rax, edx
	sar	edx, 31
	imul	rax, rax, 274877907
	sar	rax, 38
	sub	eax, edx
	sub	eax, r9d
	or	ah, 6
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	or	ah, 4
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	aty_var_to_pll_18818, .-aty_var_to_pll_18818
	.comm	STOP_BITS_2595,4,4
	.comm	REF_FREQ_2595,4,4
	.comm	REF_DIV_2595,4,4
	.comm	N_ADJ_2595,4,4
	.comm	MIN_FREQ_2595,4,4
	.comm	MAX_FREQ_2595,4,4
	.comm	EINVAL,4,4
	.comm	ABS_MIN_FREQ_2595,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_mach64_gx.c_aty_var_to_pll_18818.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aty_var_to_pll_18818, %function
aty_var_to_pll_18818:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r0, .L14
	mov	r5, r3
	mov	r6, r1
	bl	__aeabi_idiv
	ldr	r3, .L14+4
	ldr	r3, [r3]
	cmp	r3, r0
	blt	.L4
	ldr	r3, .L14+8
	ldr	r3, [r3]
	cmp	r3, r0
	bgt	.L4
	ldr	r3, .L14+12
	ldr	r2, .L14+16
	ldr	r3, [r3]
	ldr	r1, .L14+20
	ldr	ip, .L14+24
	cmp	r0, r3
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r7, [ip]
	bge	.L5
	mov	r4, #1
.L6:
	lsl	r0, r0, #1
	cmp	r0, r3
	lsl	r4, r4, #1
	blt	.L6
	mul	r0, r2, r0
	rsb	r3, r0, r0, lsl #5
	add	r0, r0, r3, lsl #2
	lsl	r0, r0, #3
	bl	__aeabi_idiv
	ldr	r2, .L14+28
	add	r0, r0, #500
	smull	r1, r3, r2, r0
	asr	r2, r0, #31
	rsb	r2, r2, r3, asr #6
	cmp	r4, #2
	sub	r2, r2, r7
	orreq	r2, r2, #1024
	beq	.L9
	cmp	r4, #4
	beq	.L13
.L9:
	mov	r0, #0
	ldr	r3, .L14+32
	str	r4, [r5, #4]
	ldr	r3, [r3]
	str	r6, [r5, #8]
	orr	r2, r3, r2
	str	r2, [r5]
	str	r0, [r5, #12]
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	ldr	r3, .L14+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	mul	r0, r2, r0
	rsb	r3, r0, r0, lsl #5
	add	r0, r0, r3, lsl #2
	lsl	r0, r0, #3
	bl	__aeabi_idiv
	ldr	r2, .L14+28
	add	r0, r0, #500
	smull	r1, r3, r2, r0
	asr	r2, r0, #31
	rsb	r2, r2, r3, asr #6
	sub	r2, r2, r7
	mov	r4, #1
	orr	r2, r2, #1536
	b	.L9
.L13:
	orr	r2, r2, #512
	b	.L9
.L15:
	.align	2
.L14:
	.word	100000000
	.word	MAX_FREQ_2595
	.word	ABS_MIN_FREQ_2595
	.word	MIN_FREQ_2595
	.word	REF_DIV_2595
	.word	REF_FREQ_2595
	.word	N_ADJ_2595
	.word	274877907
	.word	STOP_BITS_2595
	.word	EINVAL
	.size	aty_var_to_pll_18818, .-aty_var_to_pll_18818
	.comm	STOP_BITS_2595,4,4
	.comm	REF_FREQ_2595,4,4
	.comm	REF_DIV_2595,4,4
	.comm	N_ADJ_2595,4,4
	.comm	MIN_FREQ_2595,4,4
	.comm	MAX_FREQ_2595,4,4
	.comm	EINVAL,4,4
	.comm	ABS_MIN_FREQ_2595,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
