	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_spi_setup_mode
_aw_spi_setup_mode:                     ## @aw_spi_setup_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_AW_SPI_GCR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_AW_SPI_READ_4
	movq	_AW_SPI_GCR_MODE_MASTER@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_AW_SPI_WRITE_4
	movq	_AW_SPI_TCR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_AW_SPI_READ_4
	movq	_SPIBUS_MODE_CPHA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%ebx, %edx
	je	LBB0_2
## %bb.1:
	movq	_AW_SPI_TCR_CPHA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_2:
	orl	%eax, %edx
	movq	_SPIBUS_MODE_CPOL@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	je	LBB0_4
## %bb.3:
	movq	_AW_SPI_TCR_CPOL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_4:
	orl	%ebx, %edx
	movl	(%r15), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AW_SPI_WRITE_4                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AW_SPI_GCR,4,2                 ## @AW_SPI_GCR
	.comm	_AW_SPI_GCR_MODE_MASTER,4,2     ## @AW_SPI_GCR_MODE_MASTER
	.comm	_AW_SPI_TCR,4,2                 ## @AW_SPI_TCR
	.comm	_SPIBUS_MODE_CPHA,4,2           ## @SPIBUS_MODE_CPHA
	.comm	_AW_SPI_TCR_CPHA,4,2            ## @AW_SPI_TCR_CPHA
	.comm	_SPIBUS_MODE_CPOL,4,2           ## @SPIBUS_MODE_CPOL
	.comm	_AW_SPI_TCR_CPOL,4,2            ## @AW_SPI_TCR_CPOL
	.no_dead_strip	_aw_spi_setup_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aw_spi_setup_mode
_aw_spi_setup_mode:                     ; @aw_spi_setup_mode
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x21, _AW_SPI_GCR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AW_SPI_GCR@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_AW_SPI_READ_4
Lloh2:
	adrp	x8, _AW_SPI_GCR_MODE_MASTER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AW_SPI_GCR_MODE_MASTER@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x21]
	mov	x0, x20
	bl	_AW_SPI_WRITE_4
Lloh5:
	adrp	x21, _AW_SPI_TCR@GOTPAGE
Lloh6:
	ldr	x21, [x21, _AW_SPI_TCR@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_AW_SPI_READ_4
Lloh7:
	adrp	x8, _SPIBUS_MODE_CPHA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SPIBUS_MODE_CPHA@GOTPAGEOFF]
Lloh9:
	adrp	x9, _AW_SPI_TCR_CPHA@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AW_SPI_TCR_CPHA@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	ldr	w9, [x9]
	tst	w8, w19
	csel	w8, wzr, w9, eq
Lloh13:
	adrp	x9, _SPIBUS_MODE_CPOL@GOTPAGE
Lloh14:
	ldr	x9, [x9, _SPIBUS_MODE_CPOL@GOTPAGEOFF]
	orr	w8, w8, w0
Lloh15:
	ldr	w9, [x9]
Lloh16:
	adrp	x10, _AW_SPI_TCR_CPOL@GOTPAGE
Lloh17:
	ldr	x10, [x10, _AW_SPI_TCR_CPOL@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	tst	w9, w19
	csel	w9, wzr, w10, eq
	orr	w2, w8, w9
	ldr	w1, [x21]
	mov	x0, x20
	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
	b	_AW_SPI_WRITE_4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_AW_SPI_GCR,4,2                 ; @AW_SPI_GCR
	.comm	_AW_SPI_GCR_MODE_MASTER,4,2     ; @AW_SPI_GCR_MODE_MASTER
	.comm	_AW_SPI_TCR,4,2                 ; @AW_SPI_TCR
	.comm	_SPIBUS_MODE_CPHA,4,2           ; @SPIBUS_MODE_CPHA
	.comm	_AW_SPI_TCR_CPHA,4,2            ; @AW_SPI_TCR_CPHA
	.comm	_SPIBUS_MODE_CPOL,4,2           ; @SPIBUS_MODE_CPOL
	.comm	_AW_SPI_TCR_CPOL,4,2            ; @AW_SPI_TCR_CPOL
	.no_dead_strip	_aw_spi_setup_mode
.subsections_via_symbols
