	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_spi_sw_cycle
_intel_spi_sw_cycle:                    ## @intel_spi_sw_cycle
	.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
	movl	%ecx, %r15d
	movl	%edx, %r12d
	movq	%rdi, %r14
	movl	%ecx, %edx
	callq	_intel_spi_opcode_index
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_19
## %bb.1:
	movq	_INTEL_SPI_FIFO_SZ@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jl	LBB0_2
## %bb.3:
	movl	(%r14), %r13d
	movl	$0, (%r14)
	testl	%r12d, %r12d
	jle	LBB0_4
## %bb.5:
	decl	%r12d
	movq	_SSFSTS_CTL_DBC_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	movq	_SSFSTS_CTL_DS@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	jmp	LBB0_6
LBB0_4:
	xorl	%r12d, %r12d
LBB0_6:
	movq	_SSFSTS_CTL_COP_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	orl	%r12d, %ebx
	movq	_SSFSTS_CTL_FCERR@GOTPCREL(%rip), %r12
	movq	_SSFSTS_CTL_FDONE@GOTPCREL(%rip), %rax
	orl	(%r12), %ebx
	orl	(%rax), %ebx
	movq	_SSFSTS_CTL_SCGO@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	testl	%r13d, %r13d
	je	LBB0_12
## %bb.7:
	andl	$-2, %r15d
	cmpl	$128, %r15d
	jne	LBB0_2
## %bb.8:
	movq	_PREOP_OPTYPE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	callq	_readw
	movzbl	%al, %ecx
	cmpl	%r13d, %ecx
	je	LBB0_11
## %bb.9:
	sarl	$8, %eax
	cmpl	%r13d, %eax
	jne	LBB0_2
## %bb.10:
	movq	_SSFSTS_CTL_SPOP@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_11:
	movq	_SSFSTS_CTL_ACS@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_12:
	movq	_SSFSTS_CTL@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	addq	8(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	%r14, %rdi
	callq	_intel_spi_wait_sw_busy
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.13:
	movq	(%r15), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	testl	%eax, (%r12)
	je	LBB0_15
## %bb.14:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_18:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_SSFSTS_CTL_AEL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_16
## %bb.17:
	movq	_EACCES@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_16:
	xorl	%ebx, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_INTEL_SPI_FIFO_SZ,4,2          ## @INTEL_SPI_FIFO_SZ
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SSFSTS_CTL_DBC_SHIFT,4,2       ## @SSFSTS_CTL_DBC_SHIFT
	.comm	_SSFSTS_CTL_DS,4,2              ## @SSFSTS_CTL_DS
	.comm	_SSFSTS_CTL_COP_SHIFT,4,2       ## @SSFSTS_CTL_COP_SHIFT
	.comm	_SSFSTS_CTL_FCERR,4,2           ## @SSFSTS_CTL_FCERR
	.comm	_SSFSTS_CTL_FDONE,4,2           ## @SSFSTS_CTL_FDONE
	.comm	_SSFSTS_CTL_SCGO,4,2            ## @SSFSTS_CTL_SCGO
	.comm	_PREOP_OPTYPE,8,3               ## @PREOP_OPTYPE
	.comm	_SSFSTS_CTL_SPOP,4,2            ## @SSFSTS_CTL_SPOP
	.comm	_SSFSTS_CTL_ACS,4,2             ## @SSFSTS_CTL_ACS
	.comm	_SSFSTS_CTL,8,3                 ## @SSFSTS_CTL
	.comm	_EIO,4,2                        ## @EIO
	.comm	_SSFSTS_CTL_AEL,4,2             ## @SSFSTS_CTL_AEL
	.comm	_EACCES,4,2                     ## @EACCES
	.no_dead_strip	_intel_spi_sw_cycle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_spi_sw_cycle
_intel_spi_sw_cycle:                    ; @intel_spi_sw_cycle
	.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, x3
	mov	x21, x2
	mov	x19, x0
	mov	x2, x3
	bl	_intel_spi_opcode_index
	tbnz	w0, #31, LBB0_16
; %bb.1:
Lloh0:
	adrp	x8, _INTEL_SPI_FIFO_SZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INTEL_SPI_FIFO_SZ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.lt	LBB0_14
; %bb.2:
	ldr	w23, [x19]
	str	wzr, [x19]
	subs	w8, w21, #1
	b.lt	LBB0_4
; %bb.3:
Lloh3:
	adrp	x9, _SSFSTS_CTL_DBC_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SSFSTS_CTL_DBC_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh6:
	adrp	x9, _SSFSTS_CTL_DS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SSFSTS_CTL_DS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9
	b	LBB0_5
LBB0_4:
	mov	w8, #0
LBB0_5:
Lloh9:
	adrp	x9, _SSFSTS_CTL_COP_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SSFSTS_CTL_COP_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x22, _SSFSTS_CTL_FCERR@GOTPAGE
Lloh13:
	ldr	x22, [x22, _SSFSTS_CTL_FCERR@GOTPAGEOFF]
	lsl	w9, w0, w9
	ldr	w10, [x22]
Lloh14:
	adrp	x11, _SSFSTS_CTL_FDONE@GOTPAGE
Lloh15:
	ldr	x11, [x11, _SSFSTS_CTL_FDONE@GOTPAGEOFF]
Lloh16:
	adrp	x12, _SSFSTS_CTL_SCGO@GOTPAGE
Lloh17:
	ldr	x12, [x12, _SSFSTS_CTL_SCGO@GOTPAGEOFF]
Lloh18:
	ldr	w11, [x11]
Lloh19:
	ldr	w12, [x12]
	orr	w8, w9, w8
	orr	w8, w8, w10
	orr	w8, w8, w11
	orr	w21, w8, w12
	cbz	w23, LBB0_11
; %bb.6:
	and	w8, w20, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_14
; %bb.7:
	ldr	x8, [x19, #8]
Lloh20:
	adrp	x9, _PREOP_OPTYPE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _PREOP_OPTYPE@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readw
	cmp	w23, w0, uxtb
	b.eq	LBB0_10
; %bb.8:
	cmp	w23, w0, asr #8
	b.ne	LBB0_14
; %bb.9:
Lloh23:
	adrp	x8, _SSFSTS_CTL_SPOP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SSFSTS_CTL_SPOP@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_10:
Lloh26:
	adrp	x8, _SSFSTS_CTL_ACS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SSFSTS_CTL_ACS@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_11:
	ldr	x8, [x19, #8]
Lloh29:
	adrp	x20, _SSFSTS_CTL@GOTPAGE
Lloh30:
	ldr	x20, [x20, _SSFSTS_CTL@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x1, x9, x8
	mov	x0, x21
	bl	_writel
	mov	x0, x19
	bl	_intel_spi_wait_sw_busy
	cbnz	w0, LBB0_16
; %bb.12:
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_17
; %bb.13:
Lloh31:
	adrp	x8, _EIO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh33:
	adrp	x8, _EINVAL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	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
LBB0_17:
Lloh35:
	adrp	x8, _SSFSTS_CTL_AEL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SSFSTS_CTL_AEL@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_19
; %bb.18:
Lloh38:
	adrp	x8, _EACCES@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_15
LBB0_19:
	mov	w0, #0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_INTEL_SPI_FIFO_SZ,4,2          ; @INTEL_SPI_FIFO_SZ
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SSFSTS_CTL_DBC_SHIFT,4,2       ; @SSFSTS_CTL_DBC_SHIFT
	.comm	_SSFSTS_CTL_DS,4,2              ; @SSFSTS_CTL_DS
	.comm	_SSFSTS_CTL_COP_SHIFT,4,2       ; @SSFSTS_CTL_COP_SHIFT
	.comm	_SSFSTS_CTL_FCERR,4,2           ; @SSFSTS_CTL_FCERR
	.comm	_SSFSTS_CTL_FDONE,4,2           ; @SSFSTS_CTL_FDONE
	.comm	_SSFSTS_CTL_SCGO,4,2            ; @SSFSTS_CTL_SCGO
	.comm	_PREOP_OPTYPE,8,3               ; @PREOP_OPTYPE
	.comm	_SSFSTS_CTL_SPOP,4,2            ; @SSFSTS_CTL_SPOP
	.comm	_SSFSTS_CTL_ACS,4,2             ; @SSFSTS_CTL_ACS
	.comm	_SSFSTS_CTL,8,3                 ; @SSFSTS_CTL
	.comm	_EIO,4,2                        ; @EIO
	.comm	_SSFSTS_CTL_AEL,4,2             ; @SSFSTS_CTL_AEL
	.comm	_EACCES,4,2                     ; @EACCES
	.no_dead_strip	_intel_spi_sw_cycle
.subsections_via_symbols
