	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cns3xxx_spi_chipselect
_cns3xxx_spi_chipselect:                ## @cns3xxx_spi_chipselect
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_to_hw
	cmpl	$129, %ebx
	jne	LBB0_2
## %bb.1:
	movq	_SPI_CONFIGURATION_REG@GOTPCREL(%rip), %rax
	movl	(%r14), %ecx
	movq	_SPI_CPHA@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	movl	(%rdx), %edx
	andl	%ecx, %edx
	setne	%sil
	movl	$-24577, %edx                   ## imm = 0x9FFF
	andl	(%rax), %edx
	shll	$13, %esi
	orl	%edx, %esi
	movq	_SPI_CPOL@GOTPCREL(%rip), %rdx
	xorl	%edi, %edi
	andl	(%rdx), %ecx
	setne	%dil
	shll	$14, %edi
	orl	%esi, %edi
	movl	%edi, (%rax)
	movq	_SPI_TRANSMIT_CONTROL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	$-8, %ecx
	movl	4(%r14), %edx
	andl	$3, %edx
	orl	%ecx, %edx
	movl	%edx, (%rax)
LBB0_2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPI_CONFIGURATION_REG,4,2      ## @SPI_CONFIGURATION_REG
	.comm	_SPI_CPHA,4,2                   ## @SPI_CPHA
	.comm	_SPI_CPOL,4,2                   ## @SPI_CPOL
	.comm	_SPI_TRANSMIT_CONTROL_REG,4,2   ## @SPI_TRANSMIT_CONTROL_REG
	.no_dead_strip	_cns3xxx_spi_chipselect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cns3xxx_spi_chipselect
_cns3xxx_spi_chipselect:                ; @cns3xxx_spi_chipselect
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_to_hw
	cmp	w20, #129
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _SPI_CONFIGURATION_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SPI_CONFIGURATION_REG@GOTPAGEOFF]
	ldr	w9, [x8]
Lloh2:
	adrp	x10, _SPI_CPHA@GOTPAGE
Lloh3:
	ldr	x10, [x10, _SPI_CPHA@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	ldp	w11, w12, [x19]
	tst	w10, w11
	cset	w10, ne
	and	w9, w9, #0xffff9fff
Lloh5:
	adrp	x13, _SPI_CPOL@GOTPAGE
Lloh6:
	ldr	x13, [x13, _SPI_CPOL@GOTPAGEOFF]
	bfi	w9, w10, #13, #1
Lloh7:
	ldr	w10, [x13]
	tst	w10, w11
	cset	w10, ne
	bfi	w9, w10, #14, #1
	str	w9, [x8]
Lloh8:
	adrp	x8, _SPI_TRANSMIT_CONTROL_REG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SPI_TRANSMIT_CONTROL_REG@GOTPAGEOFF]
	ldr	w9, [x8]
	and	w9, w9, #0xfffffff8
	bfxil	w9, w12, #0, #2
	str	w9, [x8]
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SPI_CONFIGURATION_REG,4,2      ; @SPI_CONFIGURATION_REG
	.comm	_SPI_CPHA,4,2                   ; @SPI_CPHA
	.comm	_SPI_CPOL,4,2                   ; @SPI_CPOL
	.comm	_SPI_TRANSMIT_CONTROL_REG,4,2   ; @SPI_TRANSMIT_CONTROL_REG
	.no_dead_strip	_cns3xxx_spi_chipselect
.subsections_via_symbols
