	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cns3xxx_spi_tx_rx              ## -- Begin function cns3xxx_spi_tx_rx
	.p2align	4, 0x90
_cns3xxx_spi_tx_rx:                     ## @cns3xxx_spi_tx_rx
	.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
	movq	%r8, %r14
	movl	%ecx, %r13d
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_cns3xxx_spi_bus_idle
	testl	%eax, %eax
	je	LBB0_1
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_cns3xxx_spi_tx_buffer_empty
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	_SPI_TRANSMIT_CONTROL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	$-8, %ecx
	movl	%r12d, %edx
	andl	$3, %edx
	movl	%r15d, %esi
	andl	$1, %esi
	leal	(%rdx,%rsi,4), %edx
	orl	%ecx, %edx
	movl	%edx, (%rax)
	movq	_SPI_TRANSMIT_BUFFER_REG@GOTPCREL(%rip), %rax
	movl	%r13d, (%rax)
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_cns3xxx_spi_rx_buffer_full
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	_SPI_RECEIVE_CONTROL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	andl	$3, %edx
	movq	_SPI_RECEIVE_BUFFER_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	xorl	%r12d, %edx
	shrl	$2, %ecx
	andl	$1, %ecx
	xorl	%r15d, %ecx
	xorl	%eax, %eax
	orl	%edx, %ecx
	sete	%al
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPI_TRANSMIT_CONTROL_REG,4,2   ## @SPI_TRANSMIT_CONTROL_REG
	.comm	_SPI_TRANSMIT_BUFFER_REG,4,2    ## @SPI_TRANSMIT_BUFFER_REG
	.comm	_SPI_RECEIVE_CONTROL_REG,4,2    ## @SPI_RECEIVE_CONTROL_REG
	.comm	_SPI_RECEIVE_BUFFER_REG,4,2     ## @SPI_RECEIVE_BUFFER_REG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cns3xxx_spi_tx_rx              ; -- Begin function cns3xxx_spi_tx_rx
	.p2align	2
_cns3xxx_spi_tx_rx:                     ; @cns3xxx_spi_tx_rx
	.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	x20, x4
	mov	x23, x3
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_cns3xxx_spi_bus_idle
	cbz	w0, LBB0_1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_cns3xxx_spi_tx_buffer_empty
	cbz	w0, LBB0_2
; %bb.3:
Lloh0:
	adrp	x8, _SPI_TRANSMIT_CONTROL_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SPI_TRANSMIT_CONTROL_REG@GOTPAGEOFF]
	ldr	w9, [x8]
	and	w9, w9, #0xfffffff8
	and	w10, w21, #0x3
	bfi	w10, w19, #2, #1
	orr	w9, w10, w9
	str	w9, [x8]
Lloh2:
	adrp	x8, _SPI_TRANSMIT_BUFFER_REG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SPI_TRANSMIT_BUFFER_REG@GOTPAGEOFF]
Lloh4:
	str	w23, [x8]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_cns3xxx_spi_rx_buffer_full
	cbz	w0, LBB0_4
; %bb.5:
Lloh5:
	adrp	x8, _SPI_RECEIVE_CONTROL_REG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SPI_RECEIVE_CONTROL_REG@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	and	w9, w8, #0x3
Lloh8:
	adrp	x10, _SPI_RECEIVE_BUFFER_REG@GOTPAGE
Lloh9:
	ldr	x10, [x10, _SPI_RECEIVE_BUFFER_REG@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	str	w10, [x20]
	cmp	w9, w21
	ubfx	w8, w8, #2, #1
	ccmp	w8, w19, #0, eq
	cset	w0, eq
	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 AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SPI_TRANSMIT_CONTROL_REG,4,2   ; @SPI_TRANSMIT_CONTROL_REG
	.comm	_SPI_TRANSMIT_BUFFER_REG,4,2    ; @SPI_TRANSMIT_BUFFER_REG
	.comm	_SPI_RECEIVE_CONTROL_REG,4,2    ; @SPI_RECEIVE_CONTROL_REG
	.comm	_SPI_RECEIVE_BUFFER_REG,4,2     ; @SPI_RECEIVE_BUFFER_REG
.subsections_via_symbols
