	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function st_nci_spi_write
_st_nci_spi_write:                      ## @st_nci_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_ST_NCI_SPI_MAX_SIZE@GOTPCREL(%rip), %rcx
	movq	_NCI_DATA_HDR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	(%rcx), %eax
	movq	8(%rdi), %r12
	movq	_ST_NCI_FRAME_HEADROOM@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movq	_ST_NCI_FRAME_TAILROOM@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	(%rbx), %eax
	movl	%eax, -64(%rbp)
	movq	%r15, -56(%rbp)
	movl	4(%rbx), %eax
	movl	%eax, -48(%rbp)
	movq	(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	leaq	-64(%rbp), %rsi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_spi_sync_transfer
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	movl	(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_alloc_skb
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	movl	(%rbx), %esi
	movq	%rax, %rdi
	callq	_skb_put
	movl	4(%r12), %edi
	movl	(%rbx), %edx
	movq	%r15, %rsi
	callq	_memcpy
	movq	(%r14), %rdi
	movq	%r12, %rsi
	callq	_ndlc_recv
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_7
## %bb.6:
                                        ## kill: def $eax killed $eax killed $rax
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ST_NCI_SPI_MAX_SIZE,4,2        ## @ST_NCI_SPI_MAX_SIZE
	.comm	_NCI_DATA_HDR_SIZE,4,2          ## @NCI_DATA_HDR_SIZE
	.comm	_ST_NCI_FRAME_HEADROOM,4,2      ## @ST_NCI_FRAME_HEADROOM
	.comm	_ST_NCI_FRAME_TAILROOM,4,2      ## @ST_NCI_FRAME_TAILROOM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_st_nci_spi_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function st_nci_spi_write
_st_nci_spi_write:                      ; @st_nci_spi_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #32
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _ST_NCI_SPI_MAX_SIZE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ST_NCI_SPI_MAX_SIZE@GOTPAGEOFF]
	stur	x8, [x29, #-40]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _NCI_DATA_HDR_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NCI_DATA_HDR_SIZE@GOTPAGEOFF]
Lloh8:
	adrp	x10, _ST_NCI_FRAME_HEADROOM@GOTPAGE
Lloh9:
	ldr	x10, [x10, _ST_NCI_FRAME_HEADROOM@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	ldr	w10, [x10]
	add	w8, w9, w8
	add	w8, w8, w10
Lloh12:
	adrp	x9, _ST_NCI_FRAME_TAILROOM@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ST_NCI_FRAME_TAILROOM@GOTPAGEOFF]
	ldr	x0, [x0, #8]
Lloh14:
	ldr	w9, [x9]
	add	w8, w8, w9
	lsl	x9, x8, #2
	add	x8, x9, #15
	and	x8, x8, #0x7fffffff0
Lloh15:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh16:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x21, x9, x8
	mov	sp, x21
	ldp	w8, w9, [x1]
	stur	w8, [x29, #-64]
	stur	x21, [x29, #-56]
	stur	w9, [x29, #-48]
	ldr	x8, [x19]
	ldr	x8, [x8]
	cbnz	x8, LBB0_5
; %bb.1:
	sub	x1, x29, #64
	mov	w2, #1
	bl	_spi_sync_transfer
	mov	x8, x0
	cbnz	w0, LBB0_5
; %bb.2:
	ldr	w0, [x20]
Lloh17:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_alloc_skb
	cbz	x0, LBB0_4
; %bb.3:
	mov	x22, x0
	ldr	w1, [x20]
	bl	_skb_put
	ldr	w0, [x22, #4]
	ldr	w2, [x20]
	mov	x1, x21
	bl	_memcpy
	ldr	x0, [x19]
	mov	x1, x22
	bl	_ndlc_recv
	mov	w8, #0
	b	LBB0_5
LBB0_4:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w8, w8
LBB0_5:
	ldur	x9, [x29, #-40]
Lloh23:
	adrp	x10, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x10, [x10, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x10, [x10]
	cmp	x10, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x8
	sub	sp, x29, #32
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ST_NCI_SPI_MAX_SIZE,4,2        ; @ST_NCI_SPI_MAX_SIZE
	.comm	_NCI_DATA_HDR_SIZE,4,2          ; @NCI_DATA_HDR_SIZE
	.comm	_ST_NCI_FRAME_HEADROOM,4,2      ; @ST_NCI_FRAME_HEADROOM
	.comm	_ST_NCI_FRAME_TAILROOM,4,2      ; @ST_NCI_FRAME_TAILROOM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_st_nci_spi_write
.subsections_via_symbols
