	.file	"extr_max5821.c_max5821_get_value.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	max5821_get_value, @function
max5821_get_value:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movsx	r12, edx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 40
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	iio_priv@PLT
	cmp	r12d, 1
	jbe	.L2
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L12
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rbp, QWORD PTR 8[rax]
	mov	r13, rax
	mov	rax, QWORD PTR max5821_read_dac_command[rip]
	mov	rdi, r13
	mov	eax, DWORD PTR [rax+r12*4]
	mov	DWORD PTR 12[rsp], eax
	call	mutex_lock@PLT
	lea	rsi, 12[rsp]
	mov	edx, 1
	mov	rdi, rbp
	call	i2c_master_send@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L10
	cmp	eax, 1
	jne	.L13
	lea	rsi, 16[rsp]
	mov	edx, 2
	mov	rdi, rbp
	call	i2c_master_recv@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L10
	mov	rdi, r13
	cmp	eax, 2
	je	.L7
	call	mutex_unlock@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, r13
	call	mutex_unlock@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdi, r13
	call	mutex_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	call	mutex_unlock@PLT
	mov	eax, DWORD PTR 16[rsp]
	mov	edx, DWORD PTR 20[rsp]
	sal	eax, 6
	sar	edx, 2
	and	eax, 960
	or	eax, edx
	mov	DWORD PTR [rbx], eax
	mov	r12d, DWORD PTR IIO_VAL_INT[rip]
	jmp	.L1
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	max5821_get_value, .-max5821_get_value
	.comm	max5821_read_dac_command,8,8
	.comm	IIO_VAL_INT,4,4
	.comm	EIO,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_max5821.c_max5821_get_value.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	max5821_get_value, %function
max5821_get_value:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r2
	ldr	r3, .L14
	sub	sp, sp, #20
	mov	r6, r1
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	iio_priv
	cmp	r4, #1
	bls	.L2
	ldr	r3, .L14+4
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L1:
	ldr	r3, .L14
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	ldr	r3, .L14+8
	ldr	r7, [r0, #4]
	ldr	r3, [r3]
	mov	r5, r0
	ldr	r3, [r3, r4, lsl #2]
	str	r3, [sp]
	bl	mutex_lock
	mov	r0, r7
	mov	r2, #1
	mov	r1, sp
	bl	i2c_master_send
	subs	r4, r0, #0
	blt	.L10
	cmp	r4, #1
	bne	.L13
	mov	r0, r7
	mov	r2, #2
	add	r1, sp, #4
	bl	i2c_master_recv
	subs	r4, r0, #0
	blt	.L10
	cmp	r4, #2
	mov	r0, r5
	beq	.L7
	bl	mutex_unlock
	ldr	r3, .L14+12
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L13:
	mov	r0, r5
	bl	mutex_unlock
	ldr	r3, .L14+12
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L10:
	mov	r0, r5
	bl	mutex_unlock
	b	.L1
.L7:
	bl	mutex_unlock
	ldr	r3, [sp, #4]
	ldr	r2, [sp, #8]
	lsl	r3, r3, #6
	and	r3, r3, #960
	orr	r3, r3, r2, asr #2
	ldr	r2, .L14+16
	str	r3, [r6]
	ldr	r4, [r2]
	b	.L1
.L12:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	.LC0
	.word	EINVAL
	.word	max5821_read_dac_command
	.word	EIO
	.word	IIO_VAL_INT
	.size	max5821_get_value, .-max5821_get_value
	.comm	max5821_read_dac_command,4,4
	.comm	IIO_VAL_INT,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
