	.file	"extr_mcp4131.c_mcp4131_write_raw.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mcp4131_write_raw, @function
mcp4131_write_raw:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, r8
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, edx
	call	iio_priv@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	cmp	rbp, 128
	je	.L9
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	r14, rax
	mov	rax, QWORD PTR 16[rax]
	cmp	DWORD PTR [rax], ebx
	jl	.L6
	test	ebx, ebx
	js	.L6
	mov	ebp, DWORD PTR 0[r13]
	mov	r12d, DWORD PTR MCP4131_WIPER_SHIFT[rip]
	lea	r13, 8[r14]
	mov	rdi, r13
	call	mutex_lock@PLT
	mov	ecx, r12d
	mov	eax, ebp
	mov	rsi, QWORD PTR [r14]
	sal	eax, cl
	mov	ecx, DWORD PTR MCP4131_WIPER_SHIFT[rip]
	mov	edx, ebx
	and	ebx, 255
	sar	edx, 8
	mov	DWORD PTR 4[rsi], ebx
	sal	eax, cl
	mov	DWORD PTR [rsi], eax
	or	edx, DWORD PTR MCP4131_WRITE[rip]
	or	eax, edx
	mov	edx, 2
	mov	DWORD PTR [rsi], eax
	mov	edi, DWORD PTR 12[r14]
	call	spi_write@PLT
	mov	rdi, r13
	mov	r12d, eax
	call	mutex_unlock@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	r12d, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	mcp4131_write_raw, .-mcp4131_write_raw
	.comm	MCP4131_WRITE,4,4
	.comm	MCP4131_WIPER_SHIFT,4,4
	.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_mcp4131.c_mcp4131_write_raw.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mcp4131_write_raw, %function
mcp4131_write_raw:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r4, [sp, #32]
	mov	r6, r1
	mov	r5, r2
	bl	iio_priv
	cmp	r4, #128
	beq	.L7
.L2:
	ldr	r3, .L8
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L7:
	ldr	r3, [r0, #12]
	mov	r4, r0
	ldr	r3, [r3]
	cmp	r3, r5
	movge	r3, #0
	movlt	r3, #1
	orrs	r3, r3, r5, lsr #31
	bne	.L2
	ldr	r8, .L8+4
	add	r7, r0, #4
	ldr	r6, [r6]
	ldr	r9, [r8]
	mov	r0, r7
	bl	mutex_lock
	ldr	r2, [r8]
	ldr	r1, [r4]
	lsl	r3, r6, r9
	lsl	r3, r3, r2
	ldr	r2, .L8+8
	str	r3, [r1]
	ldr	r2, [r2]
	and	r0, r5, #255
	orr	r2, r2, r5, asr #8
	orr	r3, r2, r3
	str	r3, [r1]
	str	r0, [r1, #4]
	mov	r2, #2
	ldr	r0, [r4, #8]
	bl	spi_write
	mov	r4, r0
	mov	r0, r7
	bl	mutex_unlock
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L9:
	.align	2
.L8:
	.word	EINVAL
	.word	MCP4131_WIPER_SHIFT
	.word	MCP4131_WRITE
	.size	mcp4131_write_raw, .-mcp4131_write_raw
	.comm	MCP4131_WRITE,4,4
	.comm	MCP4131_WIPER_SHIFT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
