	.file	"extr_xilinx-xadc-core.c_xadc_write_raw.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	xadc_write_raw, @function
xadc_write_raw:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, r8
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	ebx, edx
	call	iio_priv@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	xadc_get_dclk_rate@PLT
	test	rax, rax
	je	.L4
	cmp	QWORD PTR IIO_CHAN_INFO_SAMP_FREQ[rip], r12
	jne	.L4
	test	ebx, ebx
	jle	.L4
	cmp	ebx, 150000
	mov	edx, 150000
	mov	esi, 1000000
	mov	rcx, rax
	cmovg	ebx, edx
	imul	ebx, ebx, 26
	cmp	ebx, 1000000
	cmovl	ebx, esi
	xor	edx, edx
	movsx	rsi, ebx
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	div	rsi
	xor	edx, edx
	mov	edi, eax
	mov	rsi, rax
	mov	rax, rcx
	mov	ecx, 255
	div	rdi
	mov	edx, DWORD PTR XADC_CONF2_DIV_MASK[rip]
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	cmp	rax, 3900026
	sbb	esi, -1
	cmp	esi, 255
	cmova	esi, ecx
	mov	ecx, 2
	cmp	esi, 2
	cmovb	esi, ecx
	mov	ecx, DWORD PTR XADC_CONF2_DIV_OFFSET[rip]
	sal	esi, cl
	mov	ecx, esi
	mov	esi, DWORD PTR XADC_REG_CONF2[rip]
	jmp	xadc_update_adc_reg@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	xadc_write_raw, .-xadc_write_raw
	.comm	XADC_REG_CONF2,4,4
	.comm	XADC_CONF2_DIV_OFFSET,4,4
	.comm	XADC_CONF2_DIV_MASK,4,4
	.comm	IIO_CHAN_INFO_SAMP_FREQ,8,8
	.comm	EINVAL,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_xilinx-xadc-core.c_xadc_write_raw.c"
	.text
	.global	__aeabi_uidiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	xadc_write_raw, %function
xadc_write_raw:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, [sp, #24]
	mov	r5, r2
	bl	iio_priv
	mov	r4, r0
	bl	xadc_get_dclk_rate
	subs	r6, r0, #0
	beq	.L4
	ldr	r3, .L9
	ldr	r3, [r3]
	cmp	r3, r7
	bne	.L4
	cmp	r5, #0
	ble	.L4
	ldr	r2, .L9+4
	ldr	r1, .L9+8
	cmp	r5, r2
	movlt	r2, r5
	add	r3, r2, r2, lsl #1
	add	r2, r2, r3, lsl #2
	lsl	r2, r2, #1
	cmp	r2, r1
	movge	r1, r2
	bl	__aeabi_uidiv
	mov	r5, r0
	mov	r0, r6
	mov	r1, r5
	bl	__aeabi_uidiv
	ldr	r3, .L9+12
	ldr	r2, .L9+16
	cmp	r0, r3
	addhi	r5, r5, #1
	cmp	r5, #255
	movcs	r5, #255
	cmp	r5, #2
	movcc	r5, #2
	ldr	r3, .L9+20
	ldr	r1, .L9+24
	ldr	r3, [r3]
	mov	r0, r4
	lsl	r3, r5, r3
	ldr	r2, [r2]
	ldr	r1, [r1]
	pop	{r4, r5, r6, r7, r8, lr}
	b	xadc_update_adc_reg
.L4:
	ldr	r3, .L9+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	.align	2
.L9:
	.word	IIO_CHAN_INFO_SAMP_FREQ
	.word	150000
	.word	1000000
	.word	3900025
	.word	XADC_CONF2_DIV_MASK
	.word	XADC_CONF2_DIV_OFFSET
	.word	XADC_REG_CONF2
	.word	EINVAL
	.size	xadc_write_raw, .-xadc_write_raw
	.comm	XADC_REG_CONF2,4,4
	.comm	XADC_CONF2_DIV_OFFSET,4,4
	.comm	XADC_CONF2_DIV_MASK,4,4
	.comm	IIO_CHAN_INFO_SAMP_FREQ,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
