	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function p54spi_spi_write
_p54spi_spi_write:                      ## @p54spi_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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	shll	$8, %esi
	movl	%esi, %edi
	callq	_cpu_to_le16
	movl	%eax, -112(%rbp)
	leaq	-104(%rbp), %r12
	movq	%r12, %rdi
	callq	_spi_message_init
	leaq	-96(%rbp), %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	leaq	-112(%rbp), %rax
	movq	%rax, -88(%rbp)
	movl	$4, -96(%rbp)
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_spi_message_add_tail
	leaq	-80(%rbp), %rdi
	movq	%r15, -72(%rbp)
	movl	%ebx, %eax
	andl	$-2, %eax
	movl	%eax, -80(%rbp)
	movq	%r12, %rsi
	callq	_spi_message_add_tail
	testb	$1, %bl
	je	LBB0_2
## %bb.1:
	movl	-4(%r15,%rbx,4), %edi
	callq	_cpu_to_le16
	movl	%eax, -108(%rbp)
	leaq	-64(%rbp), %rdi
	leaq	-108(%rbp), %rax
	movq	%rax, -56(%rbp)
	movl	$4, -64(%rbp)
	leaq	-104(%rbp), %rsi
	callq	_spi_message_add_tail
LBB0_2:
	movl	(%r14), %edi
	leaq	-104(%rbp), %rsi
	callq	_spi_sync
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_4
## %bb.3:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_p54spi_spi_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function p54spi_spi_write
_p54spi_spi_write:                      ; @p54spi_spi_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x20, x3
	mov	x21, x2
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	lsl	w0, w1, #8
	bl	_cpu_to_le16
	str	w0, [sp, #12]
	add	x0, sp, #16
	bl	_spi_message_init
	add	x22, sp, #24
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	add	x8, sp, #12
	str	x8, [sp, #32]
	mov	w23, #4
	str	w23, [sp, #24]
	add	x0, sp, #24
	add	x1, sp, #16
	bl	_spi_message_add_tail
	add	x0, x22, #16
	str	x21, [sp, #48]
	and	w8, w20, #0xfffffffe
	str	w8, [sp, #40]
	add	x1, sp, #16
	bl	_spi_message_add_tail
	tbz	w20, #0, LBB0_2
; %bb.1:
	add	x8, x21, x20, lsl #2
	ldur	w0, [x8, #-4]
	bl	_cpu_to_le16
	str	w0, [sp, #8]
	add	x0, x22, #32
	add	x8, sp, #8
	str	x8, [sp, #64]
	str	w23, [sp, #56]
	add	x1, sp, #16
	bl	_spi_message_add_tail
LBB0_2:
	ldr	w0, [x19]
	add	x1, sp, #16
	bl	_spi_sync
	ldur	x8, [x29, #-56]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_p54spi_spi_write
.subsections_via_symbols
