	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad5686_spi_write
_ad5686_spi_write:                      ## @ad5686_spi_write
	.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
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movl	%esi, %r12d
	movq	%rdi, %r14
	movl	16(%rdi), %edi
	callq	_to_spi_device
	movq	%rax, %rbx
	movq	8(%r14), %rax
	movl	(%rax), %eax
	cmpl	$128, %eax
	je	LBB0_7
## %bb.1:
	cmpl	$129, %eax
	je	LBB0_5
## %bb.2:
	cmpl	$130, %eax
	jne	LBB0_8
## %bb.3:
	movl	%r12d, %edi
	callq	_AD5310_CMD
	orl	%eax, %r15d
	movl	%r15d, %edi
	callq	_cpu_to_be16
	movq	(%r14), %rcx
	movl	%eax, 16(%rcx)
	movq	(%rcx), %rsi
	movl	$2, %edx
	jmp	LBB0_4
LBB0_7:
	movl	%r12d, %edi
	callq	_AD5686_CMD
	movq	%rbx, %r12
	movl	%eax, %ebx
	movl	%r13d, %edi
	callq	_AD5686_ADDR
	orl	%r15d, %ebx
	orl	%eax, %ebx
	movl	%ebx, %edi
	movq	%r12, %rbx
	jmp	LBB0_6
LBB0_5:
	movl	%r12d, %edi
	callq	_AD5686_CMD
	movl	%eax, %r12d
	movl	%r15d, %edi
	callq	_AD5683_DATA
	orl	%eax, %r12d
	movl	%r12d, %edi
LBB0_6:
	callq	_cpu_to_be32
	movq	(%r14), %rcx
	movq	%rax, 8(%rcx)
	movq	(%rcx), %rsi
	addq	$4, %rsi
	movl	$3, %edx
LBB0_4:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spi_write                      ## TAILCALL
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ad5686_spi_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad5686_spi_write
_ad5686_spi_write:                      ; @ad5686_spi_write
	.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	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
	ldr	w0, [x0, #16]
	bl	_to_spi_device
	mov	x19, x0
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	cmp	w8, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #130
	b.ne	LBB0_8
; %bb.3:
	mov	x0, x22
	bl	_AD5310_CMD
	orr	w0, w0, w21
	bl	_cpu_to_be16
	ldr	x8, [x20]
	str	w0, [x8, #16]
	ldr	x1, [x8]
	mov	w2, #2
	b	LBB0_7
LBB0_4:
	mov	x0, x22
	bl	_AD5686_CMD
	mov	x22, x0
	mov	x0, x23
	bl	_AD5686_ADDR
	orr	w8, w22, w21
	orr	w0, w8, w0
	b	LBB0_6
LBB0_5:
	mov	x0, x22
	bl	_AD5686_CMD
	mov	x22, x0
	mov	x0, x21
	bl	_AD5683_DATA
	orr	w0, w0, w22
LBB0_6:
	bl	_cpu_to_be32
	ldr	x8, [x20]
	str	x0, [x8, #8]
	ldr	x8, [x8]
	add	x1, x8, #4
	mov	w2, #3
LBB0_7:
	mov	x0, x19
	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
	b	_spi_write
LBB0_8:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ad5686_spi_write
.subsections_via_symbols
