	.file	"extr_stb0899_drv.c_stb0899_set_iterations.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	stb0899_set_iterations, @function
stb0899_set_iterations:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	esi, DWORD PTR MAX_ITER[rip]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movsx	rax, DWORD PTR 8[rdi]
	movsx	rcx, DWORD PTR 12[rdi]
	mov	rdx, rax
	imul	rax, rax, 274877907
	sar	edx, 31
	sar	rax, 38
	sub	eax, edx
	mov	edx, eax
	sal	edx, 4
	lea	eax, 410000[rax+rdx]
	mov	rdx, rcx
	imul	rcx, rcx, 1125899907
	sar	edx, 31
	sar	rcx, 50
	sub	ecx, edx
	cdq
	idiv	ecx
	movsx	rdx, eax
	sar	eax, 31
	imul	rdx, rdx, 274877907
	sar	rdx, 38
	sub	edx, eax
	mov	rax, QWORD PTR [rdi]
	mov	edi, DWORD PTR STB0899_S2FEC[rip]
	cmp	DWORD PTR [rax], edx
	cmovle	edx, DWORD PTR [rax]
	mov	r12d, edx
	call	STB0899_READ_S2REG@PLT
	mov	edi, DWORD PTR MAX_ITERATIONS[rip]
	mov	edx, r12d
	mov	esi, eax
	mov	ebx, eax
	call	STB0899_SETFIELD_VAL@PLT
	mov	ecx, DWORD PTR STB0899_OFF0_MAX_ITER[rip]
	mov	r8d, ebx
	mov	rdi, rbp
	mov	edx, DWORD PTR STB0899_BASE_MAX_ITER[rip]
	mov	esi, DWORD PTR STB0899_S2FEC[rip]
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	stb0899_write_s2reg@PLT
	.cfi_endproc
.LFE0:
	.size	stb0899_set_iterations, .-stb0899_set_iterations
	.comm	STB0899_S2FEC,4,4
	.comm	STB0899_OFF0_MAX_ITER,4,4
	.comm	STB0899_BASE_MAX_ITER,4,4
	.comm	MAX_ITERATIONS,4,4
	.comm	MAX_ITER,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_stb0899_drv.c_stb0899_set_iterations.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	stb0899_set_iterations, %function
stb0899_set_iterations:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, [r0, #4]
	ldr	r4, .L4
	mov	r5, r0
	ldr	r2, [r0, #8]
	smull	r1, r0, r4, r3
	ldr	r1, .L4+4
	asr	r3, r3, #31
	smull	ip, r1, r2, r1
	rsb	r3, r3, r0, asr #6
	add	r3, r3, r3, lsl #4
	add	r0, r3, #409600
	asr	r2, r2, #31
	sub	sp, sp, #12
	rsb	r1, r2, r1, asr #18
	add	r0, r0, #400
	bl	__aeabi_idiv
	smull	r3, r4, r0, r4
	ldr	r3, [r5]
	ldr	r7, .L4+8
	ldr	r3, [r3]
	asr	r2, r0, #31
	ldr	r1, .L4+12
	rsb	r2, r2, r4, asr #6
	cmp	r2, r3
	ldr	r1, [r1]
	ldr	r0, [r7]
	movge	r4, r3
	movlt	r4, r2
	bl	STB0899_READ_S2REG
	mov	r6, r0
	ldr	r3, .L4+16
	mov	r2, r4
	mov	r1, r0
	ldr	r0, [r3]
	bl	STB0899_SETFIELD_VAL
	ldr	r3, .L4+20
	ldr	r2, .L4+24
	str	r6, [sp]
	mov	r0, r5
	ldr	r1, [r7]
	ldr	r3, [r3]
	ldr	r2, [r2]
	bl	stb0899_write_s2reg
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L5:
	.align	2
.L4:
	.word	274877907
	.word	1125899907
	.word	STB0899_S2FEC
	.word	MAX_ITER
	.word	MAX_ITERATIONS
	.word	STB0899_OFF0_MAX_ITER
	.word	STB0899_BASE_MAX_ITER
	.size	stb0899_set_iterations, .-stb0899_set_iterations
	.comm	STB0899_S2FEC,4,4
	.comm	STB0899_OFF0_MAX_ITER,4,4
	.comm	STB0899_BASE_MAX_ITER,4,4
	.comm	MAX_ITERATIONS,4,4
	.comm	MAX_ITER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
