	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max5821_get_value
_max5821_get_value:                     ## @max5821_get_value
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_iio_priv
	cmpl	$2, %ebx
	jae	LBB0_6
## %bb.1:
	movq	%rax, %r15
	movq	8(%rax), %r12
	movq	_max5821_read_dac_command@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -52(%rbp)
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	-52(%rbp), %rsi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_i2c_master_send
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
## %bb.2:
	cmpl	$1, %ebx
	jne	LBB0_8
## %bb.3:
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movl	$2, %edx
	callq	_i2c_master_recv
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
## %bb.4:
	movq	%r15, %rdi
	callq	_mutex_unlock
	cmpl	$2, %ebx
	jne	LBB0_9
## %bb.5:
	movl	-48(%rbp), %eax
	movl	-44(%rbp), %ecx
	andl	$15, %eax
	shll	$6, %eax
	sarl	$2, %ecx
	orl	%eax, %ecx
	movl	%ecx, (%r14)
	movq	_IIO_VAL_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_7:
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_11
LBB0_8:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_9:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_max5821_read_dac_command,8,3   ## @max5821_read_dac_command
	.comm	_EIO,4,2                        ## @EIO
	.comm	_IIO_VAL_INT,4,2                ## @IIO_VAL_INT
	.no_dead_strip	_max5821_get_value
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max5821_get_value
_max5821_get_value:                     ; @max5821_get_value
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x2
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_iio_priv
	cmp	w21, #2
	b.hs	LBB0_6
; %bb.1:
	mov	x20, x0
	ldr	x22, [x0, #8]
Lloh3:
	adrp	x8, _max5821_read_dac_command@GOTPAGE
Lloh4:
	ldr	x8, [x8, _max5821_read_dac_command@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w8, [x8, w21, uxtw #2]
	str	w8, [sp, #12]
	bl	_mutex_lock
	add	x1, sp, #12
	mov	x0, x22
	mov	w2, #1
	bl	_i2c_master_send
	mov	x21, x0
	tbnz	w0, #31, LBB0_7
; %bb.2:
	cmp	w21, #1
	b.ne	LBB0_8
; %bb.3:
	add	x1, sp, #16
	mov	x0, x22
	mov	w2, #2
	bl	_i2c_master_recv
	mov	x21, x0
	tbnz	w0, #31, LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_mutex_unlock
	cmp	w21, #2
	b.ne	LBB0_9
; %bb.5:
	ldp	w8, w9, [sp, #16]
	ubfiz	w8, w8, #6, #4
	orr	w8, w8, w9, asr #2
	str	w8, [x19]
Lloh6:
	adrp	x8, _IIO_VAL_INT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IIO_VAL_INT@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
	b	LBB0_11
LBB0_6:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:
	mov	x0, x20
	bl	_mutex_unlock
	b	LBB0_11
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_9:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_11:
	ldr	x8, [sp, #24]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_max5821_read_dac_command,8,3   ; @max5821_read_dac_command
	.comm	_EIO,4,2                        ; @EIO
	.comm	_IIO_VAL_INT,4,2                ; @IIO_VAL_INT
	.no_dead_strip	_max5821_get_value
.subsections_via_symbols
