	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ad_sd_write_reg                ## -- Begin function ad_sd_write_reg
	.p2align	4, 0x90
_ad_sd_write_reg:                       ## @ad_sd_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	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%ecx, %r8d
                                        ## kill: def $edx killed $edx def $rdx
	movl	%esi, %eax
	movq	(%rdi), %rsi
	movq	%rsi, -40(%rbp)
	leal	1(%rdx), %ecx
	movl	%ecx, -32(%rbp)
	movl	32(%rdi), %ecx
	movl	%ecx, -28(%rbp)
	movq	24(%rdi), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	8(%rdi), %eax
	movl	%eax, (%rsi)
	cmpl	$3, %edx
	ja	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	movl	%edx, %eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_3:
	movl	%r8d, 4(%rsi)
	jmp	LBB0_6
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	addq	$4, %rsi
	movl	%r8d, %edi
	callq	_put_unaligned_be16
	jmp	LBB0_6
LBB0_5:
	movl	%r8d, %eax
	shrl	$16, %eax
	movl	%eax, 4(%rsi)
	movl	%r8d, %eax
	shrl	$8, %eax
	movl	%eax, 8(%rsi)
	movl	%r8d, 12(%rsi)
LBB0_6:
	leaq	-24(%rbp), %r14
	movq	%r14, %rdi
	callq	_spi_message_init
	leaq	-40(%rbp), %rdi
	movq	%r14, %rsi
	callq	_spi_message_add_tail
	cmpq	$0, 16(%rbx)
	movl	12(%rbx), %edi
	leaq	-24(%rbp), %rsi
	je	LBB0_8
## %bb.7:
	callq	_spi_sync_locked
	jmp	LBB0_9
LBB0_8:
	callq	_spi_sync
LBB0_9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_3
	.long	L0_0_set_2
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function ad_sd_write_reg
lCPI0_0:
	.long	4294967280                      ; 0xfffffff0
	.long	4294967288                      ; 0xfffffff8
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_ad_sd_write_reg
	.p2align	2
_ad_sd_write_reg:                       ; @ad_sd_write_reg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	ldr	x8, [x0]
	str	x8, [sp, #16]
	add	w9, w2, #1
	ldr	w10, [x0, #32]
	stp	w9, w10, [sp, #24]
	ldr	x9, [x0, #24]
	ldr	w9, [x9]
	lsl	w9, w1, w9
	ldr	w10, [x0, #8]
	orr	w9, w9, w10
	str	w9, [x8]
	cmp	w2, #3
	b.hi	LBB0_3
; %bb.1:
	mov	x19, x0
	mov	w9, w2
Lloh0:
	adrp	x10, lJTI0_0@PAGE
Lloh1:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_2
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_2:
	str	w3, [x8, #4]
	b	LBB0_6
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_4:
	add	x1, x8, #4
	mov	x0, x3
	bl	_put_unaligned_be16
	b	LBB0_6
LBB0_5:
	dup.2s	v0, w3
Lloh5:
	adrp	x9, lCPI0_0@PAGE
Lloh6:
	ldr	d1, [x9, lCPI0_0@PAGEOFF]
	ushl.2s	v0, v0, v1
	stur	d0, [x8, #4]
	str	w3, [x8, #12]
LBB0_6:
	add	x0, sp, #8
	bl	_spi_message_init
	add	x0, sp, #16
	add	x1, sp, #8
	bl	_spi_message_add_tail
	ldr	x8, [x19, #16]
	ldr	w0, [x19, #12]
	add	x1, sp, #8
	cbz	x8, LBB0_8
; %bb.7:
	bl	_spi_sync_locked
	b	LBB0_9
LBB0_8:
	bl	_spi_sync
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdr	Lloh5, Lloh6
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
