	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mcp41010_write_raw
_mcp41010_write_raw:                    ## @mcp41010_write_raw
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %rbx
	movl	%edx, %r13d
	movq	%rsi, %r15
	callq	_iio_priv
	movq	%rax, %r14
	movq	_IIO_CHAN_INFO_RAW@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jne	LBB0_1
## %bb.2:
	testl	%r13d, %r13d
	js	LBB0_1
## %bb.3:
	movq	_MCP41010_WIPER_MAX@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jl	LBB0_1
## %bb.4:
	movslq	(%r15), %r12
	movq	%r14, %r15
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_MCP41010_WIPER_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r12d, %ecx
	shll	%cl, %eax
	movq	(%r14), %rsi
	movl	%eax, (%rsi)
	movq	_MCP41010_WRITE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rsi)
	movzbl	%r13b, %eax
	movl	%eax, 4(%rsi)
	movl	20(%r14), %edi
	movl	$8, %edx
	callq	_spi_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	8(%r14), %rax
	movl	%r13d, (%rax,%r12,4)
LBB0_6:
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIO_CHAN_INFO_RAW,8,3          ## @IIO_CHAN_INFO_RAW
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MCP41010_WIPER_MAX,4,2         ## @MCP41010_WIPER_MAX
	.comm	_MCP41010_WIPER_CHANNEL,4,2     ## @MCP41010_WIPER_CHANNEL
	.comm	_MCP41010_WRITE,4,2             ## @MCP41010_WRITE
	.no_dead_strip	_mcp41010_write_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mcp41010_write_raw
_mcp41010_write_raw:                    ; @mcp41010_write_raw
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x4
	mov	x19, x2
	mov	x21, x1
	bl	_iio_priv
Lloh0:
	adrp	x8, _IIO_CHAN_INFO_RAW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IIO_CHAN_INFO_RAW@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x22
	b.ne	LBB0_6
; %bb.1:
	tbnz	w19, #31, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _MCP41010_WIPER_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MCP41010_WIPER_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w19
	b.lt	LBB0_6
; %bb.3:
	mov	x20, x0
	ldrsw	x23, [x21]
	add	x21, x0, #16
	mov	x0, x21
	bl	_mutex_lock
Lloh6:
	adrp	x8, _MCP41010_WIPER_CHANNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MCP41010_WIPER_CHANNEL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsl	w8, w8, w23
	ldr	x1, [x20]
Lloh9:
	adrp	x9, _MCP41010_WRITE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MCP41010_WRITE@GOTPAGEOFF]
	and	w10, w19, #0xff
	stp	w8, w10, [x1]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x1]
	ldr	w0, [x20, #20]
	mov	w2, #8
	bl	_spi_write
	mov	x22, x0
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	x8, [x20, #8]
	str	w19, [x8, x23, lsl #2]
LBB0_5:
	mov	x0, x21
	bl	_mutex_unlock
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IIO_CHAN_INFO_RAW,8,3          ; @IIO_CHAN_INFO_RAW
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MCP41010_WIPER_MAX,4,2         ; @MCP41010_WIPER_MAX
	.comm	_MCP41010_WIPER_CHANNEL,4,2     ; @MCP41010_WIPER_CHANNEL
	.comm	_MCP41010_WRITE,4,2             ; @MCP41010_WRITE
	.no_dead_strip	_mcp41010_write_raw
.subsections_via_symbols
