	.file	"extr_mc44s803.c_mc44s803_set_params.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"I/O Error\n"
	.text
	.p2align 4
	.type	mc44s803_set_params, @function
mc44s803_set_params:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	r12, QWORD PTR 8[rdi]
	mov	r15d, DWORD PTR [rsi]
	mov	DWORD PTR [r12], r15d
	movsx	rcx, DWORD PTR MC44S803_OSC[rip]
	imul	rbx, rcx, 1125899907
	mov	eax, ecx
	mov	QWORD PTR 24[rsp], rcx
	mov	r13, rcx
	imul	rbp, rcx, 351843721
	sar	eax, 31
	sar	rbx, 50
	sar	rbp, 45
	sub	ebx, eax
	sub	ebp, eax
	mov	eax, DWORD PTR MC44S803_IF1[rip]
	mov	DWORD PTR 12[rsp], ebp
	mov	DWORD PTR 16[rsp], eax
	mov	eax, DWORD PTR MC44S803_IF2[rip]
	mov	DWORD PTR 20[rsp], eax
	mov	rax, QWORD PTR [rdi]
	test	rax, rax
	je	.L2
	mov	esi, 1
	call	rax
.L2:
	mov	esi, DWORD PTR MC44S803_ADDR[rip]
	mov	edi, DWORD PTR MC44S803_REG_REFDIV[rip]
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_R1[rip]
	lea	edi, -1[rbx]
	mov	ebp, eax
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_R2[rip]
	or	ebp, eax
	mov	eax, DWORD PTR 12[rsp]
	lea	edi, -1[rax]
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_REFBUF_EN[rip]
	mov	edi, 1
	or	ebp, eax
	call	MC44S803_REG_SM@PLT
	mov	esi, ebp
	mov	rdi, r12
	or	esi, eax
	call	mc44s803_writereg@PLT
	mov	ebp, eax
	test	eax, eax
	je	.L17
.L3:
	mov	rax, QWORD PTR [r14]
	test	rax, rax
	je	.L5
	xor	esi, esi
	mov	rdi, r14
	call	rax
.L5:
	mov	edi, DWORD PTR KERN_WARNING[rip]
	lea	rsi, .LC0[rip]
	call	mc_printk@PLT
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, ebp
	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
.L17:
	.cfi_restore_state
	mov	edx, DWORD PTR 16[rsp]
	mov	esi, DWORD PTR MC44S803_ADDR[rip]
	lea	edx, 500000[r15+rdx]
	movsx	rax, edx
	sar	edx, 31
	imul	rax, rax, 1125899907
	sar	rax, 50
	mov	edi, eax
	sub	edi, edx
	mov	DWORD PTR 16[rsp], edi
	mov	edi, DWORD PTR MC44S803_REG_LO1[rip]
	call	MC44S803_REG_SM@PLT
	mov	edi, DWORD PTR 16[rsp]
	mov	esi, DWORD PTR MC44S803_LO1[rip]
	mov	ebp, eax
	sub	edi, 2
	call	MC44S803_REG_SM@PLT
	mov	esi, ebp
	mov	rdi, r12
	or	esi, eax
	call	mc44s803_writereg@PLT
	mov	ebp, eax
	test	eax, eax
	jne	.L3
	mov	eax, r13d
	mov	esi, DWORD PTR MC44S803_ADDR[rip]
	mov	edi, DWORD PTR MC44S803_REG_LO2[rip]
	cdq
	idiv	ebx
	imul	eax, DWORD PTR 16[rsp]
	sub	eax, r15d
	sub	eax, DWORD PTR 20[rsp]
	add	eax, 50000
	movsx	r15, eax
	sar	eax, 31
	imul	r15, r15, 351843721
	sar	r15, 45
	sub	r15d, eax
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_LO2[rip]
	lea	edi, -2[r15]
	mov	ebp, eax
	call	MC44S803_REG_SM@PLT
	mov	esi, ebp
	mov	rdi, r12
	or	esi, eax
	call	mc44s803_writereg@PLT
	mov	ebp, eax
	test	eax, eax
	jne	.L3
	mov	esi, DWORD PTR MC44S803_ADDR[rip]
	mov	edi, DWORD PTR MC44S803_REG_DIGTUNE[rip]
	sar	r13d, 31
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_DA[rip]
	mov	edi, 1
	mov	ebp, eax
	call	MC44S803_REG_SM@PLT
	imul	edi, DWORD PTR 16[rsp], 60
	mov	esi, DWORD PTR MC44S803_LO_REF[rip]
	or	ebp, eax
	imul	rax, QWORD PTR 24[rsp], 1125899907
	sar	rax, 51
	sub	eax, r13d
	add	eax, edi
	cdq
	idiv	ebx
	mov	ebx, ebp
	mov	edi, eax
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_AT[rip]
	mov	edi, 1
	or	ebx, eax
	call	MC44S803_REG_SM@PLT
	mov	rdi, r12
	or	ebx, eax
	mov	esi, ebx
	call	mc44s803_writereg@PLT
	mov	ebp, eax
	test	eax, eax
	jne	.L3
	mov	esi, DWORD PTR MC44S803_ADDR[rip]
	mov	edi, DWORD PTR MC44S803_REG_DIGTUNE[rip]
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_DA[rip]
	mov	edi, 2
	mov	ebx, eax
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_LO_REF[rip]
	imul	rdx, QWORD PTR 24[rsp], 351843721
	or	ebx, eax
	imul	eax, r15d, 60
	sar	rdx, 46
	sub	edx, r13d
	add	eax, edx
	cdq
	idiv	DWORD PTR 12[rsp]
	mov	edi, eax
	call	MC44S803_REG_SM@PLT
	mov	esi, DWORD PTR MC44S803_AT[rip]
	mov	edi, 1
	or	ebx, eax
	call	MC44S803_REG_SM@PLT
	mov	rdi, r12
	or	ebx, eax
	mov	esi, ebx
	call	mc44s803_writereg@PLT
	mov	ebp, eax
	test	eax, eax
	jne	.L3
	mov	rax, QWORD PTR [r14]
	test	rax, rax
	je	.L1
	xor	esi, esi
	mov	rdi, r14
	call	rax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	mc44s803_set_params, .-mc44s803_set_params
	.comm	MC44S803_REG_REFDIV,4,4
	.comm	MC44S803_REG_LO2,4,4
	.comm	MC44S803_REG_LO1,4,4
	.comm	MC44S803_REG_DIGTUNE,4,4
	.comm	MC44S803_REFBUF_EN,4,4
	.comm	MC44S803_R2,4,4
	.comm	MC44S803_R1,4,4
	.comm	MC44S803_OSC,4,4
	.comm	MC44S803_LO_REF,4,4
	.comm	MC44S803_LO2,4,4
	.comm	MC44S803_LO1,4,4
	.comm	MC44S803_IF2,4,4
	.comm	MC44S803_IF1,4,4
	.comm	MC44S803_DA,4,4
	.comm	MC44S803_AT,4,4
	.comm	MC44S803_ADDR,4,4
	.comm	KERN_WARNING,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_mc44s803.c_mc44s803_set_params.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"I/O Error\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mc44s803_set_params, %function
mc44s803_set_params:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r10, [r1]
	ldr	r7, [r0, #4]
	ldr	r2, .L18
	str	r10, [r7]
	ldr	r6, [r2]
	ldr	r1, .L18+4
	ldr	r5, .L18+8
	smull	r3, r1, r6, r1
	asr	r8, r6, #31
	ldr	lr, .L18+12
	sub	sp, sp, #20
	smull	r3, r5, r6, r5
	rsb	r3, r8, r1, asr #13
	ldr	ip, .L18+16
	str	r3, [sp, #4]
	ldr	r3, [lr]
	ldr	r2, [r0]
	str	r3, [sp, #8]
	ldr	r3, [ip]
	cmp	r2, #0
	mov	r9, r0
	rsb	r5, r8, r5, asr #18
	str	r3, [sp, #12]
	beq	.L2
	mov	r1, #1
	blx	r2
.L2:
	ldr	r3, .L18+20
	ldr	r2, .L18+24
	ldr	r1, [r3]
	ldr	r0, [r2]
	bl	MC44S803_REG_SM
	ldr	r1, .L18+28
	mov	fp, r0
	ldr	r1, [r1]
	sub	r0, r5, #1
	bl	MC44S803_REG_SM
	ldr	r2, [sp, #4]
	ldr	r1, .L18+32
	mov	r4, r0
	ldr	r1, [r1]
	sub	r0, r2, #1
	bl	MC44S803_REG_SM
	ldr	r1, .L18+36
	orr	r4, fp, r4
	ldr	r1, [r1]
	mov	fp, r0
	mov	r0, #1
	bl	MC44S803_REG_SM
	mov	r1, r0
	orr	fp, r4, fp
	orr	r1, fp, r1
	mov	r0, r7
	bl	mc44s803_writereg
	subs	fp, r0, #0
	beq	.L17
.L3:
	ldr	r4, [r9]
	cmp	r4, #0
	beq	.L5
	mov	r0, r9
	mov	r1, #0
	blx	r4
.L5:
	ldr	r3, .L18+40
	ldr	r1, .L18+44
	ldr	r0, [r3]
	bl	mc_printk
.L1:
	mov	r0, fp
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	ldr	r0, [sp, #8]
	ldr	r3, .L18+20
	add	r4, r10, r0
	add	r4, r4, #499712
	ldr	r0, .L18+8
	add	r4, r4, #288
	smull	ip, r0, r4, r0
	mov	r2, r0
	ldr	r1, .L18+48
	asr	r4, r4, #31
	ldr	r0, [r1]
	ldr	r1, [r3]
	rsb	r4, r4, r2, asr #18
	bl	MC44S803_REG_SM
	ldr	r1, .L18+52
	mov	fp, r0
	ldr	r1, [r1]
	sub	r0, r4, #2
	bl	MC44S803_REG_SM
	mov	r1, r0
	mov	r0, r7
	orr	r1, fp, r1
	bl	mc44s803_writereg
	subs	fp, r0, #0
	bne	.L3
	mov	r1, r5
	mov	r0, r6
	bl	__aeabi_idiv
	mul	r0, r4, r0
	sub	r10, r0, r10
	ldr	r0, [sp, #12]
	ldr	ip, .L18+4
	sub	fp, r10, r0
	add	r0, fp, #49920
	add	r0, r0, #80
	smull	lr, ip, r0, ip
	ldr	r3, .L18+20
	ldr	r1, .L18+56
	asr	r10, r0, #31
	ldr	r0, [r1]
	ldr	r1, [r3]
	rsb	r10, r10, ip, asr #13
	bl	MC44S803_REG_SM
	ldr	r1, .L18+60
	mov	fp, r0
	ldr	r1, [r1]
	sub	r0, r10, #2
	bl	MC44S803_REG_SM
	mov	r1, r0
	mov	r0, r7
	orr	r1, fp, r1
	bl	mc44s803_writereg
	subs	fp, r0, #0
	bne	.L3
	ldr	r3, .L18+64
	ldr	r2, .L18+20
	ldr	r0, [r3]
	ldr	r1, [r2]
	bl	MC44S803_REG_SM
	ldr	ip, .L18+68
	mov	fp, r0
	ldr	r1, [ip]
	mov	r0, #1
	bl	MC44S803_REG_SM
	mov	ip, r0
	ldr	r0, .L18+8
	rsb	r4, r4, r4, lsl #4
	smull	lr, r0, r6, r0
	ldr	lr, .L18+72
	rsb	r0, r8, r0, asr #19
	add	r0, r0, r4, lsl #2
	ldr	r4, [lr]
	mov	r1, r5
	orr	r5, fp, ip
	bl	__aeabi_idiv
	mov	r1, r4
	bl	MC44S803_REG_SM
	mov	r2, r0
	ldr	r4, .L18+76
	mov	r0, #1
	ldr	r1, [r4]
	orr	r5, r5, r2
	bl	MC44S803_REG_SM
	mov	r1, r0
	mov	r0, r7
	orr	r1, r5, r1
	bl	mc44s803_writereg
	subs	fp, r0, #0
	bne	.L3
	ldr	r2, .L18+20
	ldr	r3, .L18+64
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	MC44S803_REG_SM
	ldr	ip, .L18+68
	mov	r5, r0
	ldr	r1, [ip]
	mov	r0, #2
	bl	MC44S803_REG_SM
	mov	r2, r0
	ldr	r3, .L18+4
	ldr	lr, .L18+72
	smull	r0, r3, r6, r3
	rsb	r10, r10, r10, lsl #4
	rsb	r6, r8, r3, asr #14
	add	r0, r6, r10, lsl #2
	ldr	r6, [lr]
	ldr	r1, [sp, #4]
	orr	r5, r5, r2
	bl	__aeabi_idiv
	mov	r1, r6
	bl	MC44S803_REG_SM
	mov	r2, r0
	ldr	r1, [r4]
	mov	r0, #1
	orr	r5, r5, r2
	bl	MC44S803_REG_SM
	mov	r1, r0
	mov	r0, r7
	orr	r1, r5, r1
	bl	mc44s803_writereg
	subs	fp, r0, #0
	bne	.L3
	ldr	r4, [r9]
	cmp	r4, #0
	beq	.L1
	mov	r0, r9
	mov	r1, fp
	blx	r4
	b	.L1
.L19:
	.align	2
.L18:
	.word	MC44S803_OSC
	.word	351843721
	.word	1125899907
	.word	MC44S803_IF1
	.word	MC44S803_IF2
	.word	MC44S803_ADDR
	.word	MC44S803_REG_REFDIV
	.word	MC44S803_R1
	.word	MC44S803_R2
	.word	MC44S803_REFBUF_EN
	.word	KERN_WARNING
	.word	.LC0
	.word	MC44S803_REG_LO1
	.word	MC44S803_LO1
	.word	MC44S803_REG_LO2
	.word	MC44S803_LO2
	.word	MC44S803_REG_DIGTUNE
	.word	MC44S803_DA
	.word	MC44S803_LO_REF
	.word	MC44S803_AT
	.size	mc44s803_set_params, .-mc44s803_set_params
	.comm	MC44S803_REG_REFDIV,4,4
	.comm	MC44S803_REG_LO2,4,4
	.comm	MC44S803_REG_LO1,4,4
	.comm	MC44S803_REG_DIGTUNE,4,4
	.comm	MC44S803_REFBUF_EN,4,4
	.comm	MC44S803_R2,4,4
	.comm	MC44S803_R1,4,4
	.comm	MC44S803_OSC,4,4
	.comm	MC44S803_LO_REF,4,4
	.comm	MC44S803_LO2,4,4
	.comm	MC44S803_LO1,4,4
	.comm	MC44S803_IF2,4,4
	.comm	MC44S803_IF1,4,4
	.comm	MC44S803_DA,4,4
	.comm	MC44S803_AT,4,4
	.comm	MC44S803_ADDR,4,4
	.comm	KERN_WARNING,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
