	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad1836_write_reg
_ad1836_write_reg:                      ## @ad1836_write_reg
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	movl	%esi, %r13d
	xorl	%eax, %eax
	cmpl	%edx, (%r12,%r13,4)
	je	LBB0_3
## %bb.1:
	movl	%edx, %r14d
	movq	%rdi, %rbx
	leaq	-42(%rbp), %rax
	movq	%rax, -64(%rbp)
	movl	$2, -56(%rbp)
	movq	_AD1836_SPI_REG_SHFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	movq	_AD1836_SPI_VAL_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%edx, %eax
	orl	%esi, %eax
	movw	%ax, -42(%rbp)
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	callq	_spi_message_init
	leaq	-64(%rbp), %rdi
	movq	%r15, %rsi
	callq	_spi_message_add_tail
	movl	8(%rbx), %edi
	movq	%r15, %rsi
	callq	_spi_sync
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	%r14d, (%r12,%r13,4)
LBB0_3:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AD1836_SPI_REG_SHFT,4,2        ## @AD1836_SPI_REG_SHFT
	.comm	_AD1836_SPI_VAL_MSK,4,2         ## @AD1836_SPI_VAL_MSK
	.no_dead_strip	_ad1836_write_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad1836_write_reg
_ad1836_write_reg:                      ; @ad1836_write_reg
	.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
	ldr	x22, [x0]
	ldr	w8, [x22, w1, uxtw #2]
	cmp	w8, w2
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_4
LBB0_2:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	add	x8, sp, #30
	str	x8, [sp, #8]
	mov	w8, #2
	str	w8, [sp, #16]
Lloh0:
	adrp	x8, _AD1836_SPI_REG_SHFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AD1836_SPI_REG_SHFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w8, w1, w8
Lloh3:
	adrp	x9, _AD1836_SPI_VAL_MSK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AD1836_SPI_VAL_MSK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w9, w9, w2
	orr	w8, w9, w8
	strh	w8, [sp, #30]
	mov	x0, sp
	bl	_spi_message_init
	add	x0, sp, #8
	mov	x1, sp
	bl	_spi_message_add_tail
	ldr	w0, [x21, #8]
	mov	x1, sp
	bl	_spi_sync
	cbnz	w0, LBB0_4
; %bb.3:
	mov	w8, w20
	str	w19, [x22, x8, lsl #2]
LBB0_4:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AD1836_SPI_REG_SHFT,4,2        ; @AD1836_SPI_REG_SHFT
	.comm	_AD1836_SPI_VAL_MSK,4,2         ; @AD1836_SPI_VAL_MSK
	.no_dead_strip	_ad1836_write_reg
.subsections_via_symbols
