	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max5821_set_value
_max5821_set_value:                     ## @max5821_set_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	callq	_iio_priv
	cmpl	$1024, %ebx                     ## imm = 0x400
	jae	LBB0_1
## %bb.2:
	cmpl	$2, %r14d
	jae	LBB0_1
## %bb.3:
	movq	(%rax), %rdi
	movq	_max5821_load_dac_command@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r14d, %ecx
	movl	%ebx, %edx
	shrl	$6, %edx
	orl	(%rax,%rcx,4), %edx
	movl	%edx, -32(%rbp)
	shll	$2, %ebx
	movzbl	%bl, %eax
	movl	%eax, -28(%rbp)
	leaq	-32(%rbp), %rsi
	movl	$2, %edx
	callq	_i2c_master_send
	movl	%eax, %ecx
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	xorl	%eax, %eax
	cmpl	$2, %ecx
	je	LBB0_8
## %bb.6:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_10
## %bb.9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_4:
	movl	%ecx, %eax
	jmp	LBB0_8
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_max5821_load_dac_command,8,3   ## @max5821_load_dac_command
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_max5821_set_value
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max5821_set_value
_max5821_set_value:                     ; @max5821_set_value
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, 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, #8]
	bl	_iio_priv
	cmp	w19, #1024
	b.hs	LBB0_5
; %bb.1:
	cmp	w20, #2
	b.hs	LBB0_5
; %bb.2:
	ldr	x0, [x0]
Lloh3:
	adrp	x8, _max5821_load_dac_command@GOTPAGE
Lloh4:
	ldr	x8, [x8, _max5821_load_dac_command@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w8, [x8, w20, uxtw #2]
	orr	w8, w8, w19, lsr #6
	ubfiz	w9, w19, #2, #6
	stp	w8, w9, [sp]
	mov	x1, sp
	mov	w2, #2
	bl	_i2c_master_send
	tbnz	w0, #31, LBB0_7
; %bb.3:
	cmp	w0, #2
	b.ne	LBB0_9
; %bb.4:
	mov	w0, #0
	b	LBB0_7
LBB0_5:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldr	x8, [sp, #8]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_9:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_max5821_load_dac_command,8,3   ; @max5821_load_dac_command
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_max5821_set_value
.subsections_via_symbols
