	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_spi_write_reg
_intel_spi_write_reg:                   ## @intel_spi_write_reg
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	(%rdi), %rbx
	movq	_SPINOR_OP_WREN@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_9
## %bb.1:
	xorl	%r15d, %r15d
	cmpq	$0, 8(%rbx)
	je	LBB0_6
## %bb.2:
	movq	_PREOP_OPTYPE@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	24(%rbx), %rdi
	callq	_readw
	movzbl	%al, %ecx
	cmpl	%r14d, %ecx
	je	LBB0_8
## %bb.3:
	sarl	$8, %eax
	cmpl	%r14d, %eax
	je	LBB0_8
## %bb.4:
	cmpq	$0, 32(%rbx)
	je	LBB0_7
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_9:
	movl	%ecx, %r12d
	movq	%rdx, %r15
	movq	_FADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_intel_spi_write_block
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.10:
	cmpq	$0, 8(%rbx)
	je	LBB0_11
## %bb.12:
	movq	_OPTYPE_WRITE_NO_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r12d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_intel_spi_sw_cycle             ## TAILCALL
LBB0_11:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r12d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_intel_spi_hw_cycle             ## TAILCALL
LBB0_7:
	movq	(%r12), %rsi
	addq	24(%rbx), %rsi
	movl	%r14d, %edi
	callq	_writel
LBB0_8:
	movl	%r14d, (%rbx)
LBB0_6:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPINOR_OP_WREN,4,2             ## @SPINOR_OP_WREN
	.comm	_PREOP_OPTYPE,8,3               ## @PREOP_OPTYPE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FADDR,8,3                      ## @FADDR
	.comm	_OPTYPE_WRITE_NO_ADDR,4,2       ## @OPTYPE_WRITE_NO_ADDR
	.no_dead_strip	_intel_spi_write_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_spi_write_reg
_intel_spi_write_reg:                   ; @intel_spi_write_reg
	.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
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _SPINOR_OP_WREN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SPINOR_OP_WREN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_5
; %bb.1:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_8
; %bb.2:
	ldr	x8, [x20, #24]
Lloh3:
	adrp	x21, _PREOP_OPTYPE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _PREOP_OPTYPE@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readw
	asr	w8, w0, #8
	cmp	w19, w0, uxtb
	ccmp	w8, w19, #4, ne
	b.eq	LBB0_11
; %bb.3:
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_10
; %bb.4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_5:
	mov	x21, x3
	mov	x22, x2
	ldr	x8, [x20, #16]
Lloh8:
	adrp	x9, _FADDR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FADDR@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_intel_spi_write_block
	cbnz	w0, LBB0_12
; %bb.6:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_9
; %bb.7:
Lloh11:
	adrp	x8, _OPTYPE_WRITE_NO_ADDR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _OPTYPE_WRITE_NO_ADDR@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	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	_intel_spi_sw_cycle
LBB0_8:
	mov	w0, #0
	b	LBB0_12
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	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	_intel_spi_hw_cycle
LBB0_10:
	ldr	x8, [x20, #24]
	ldr	x9, [x21]
	add	x1, x9, x8
	mov	x0, x19
	bl	_writel
LBB0_11:
	mov	w0, #0
	str	w19, [x20]
LBB0_12:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SPINOR_OP_WREN,4,2             ; @SPINOR_OP_WREN
	.comm	_PREOP_OPTYPE,8,3               ; @PREOP_OPTYPE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FADDR,8,3                      ; @FADDR
	.comm	_OPTYPE_WRITE_NO_ADDR,4,2       ; @OPTYPE_WRITE_NO_ADDR
	.no_dead_strip	_intel_spi_write_reg
.subsections_via_symbols
